~kalikiana/midori/beetle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 Copyright (C) 2010-2011 Christian Dywan <christian@twotoasts.de>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#ifndef __MIDORI_PLATFORM_H__
#define __MIDORI_PLATFORM_H__ 1

#include "midori/midori-stock.h"
#include "katze/gtk3-compat.h"
#include "midori/gtkiconentry.h"
#include "midori/sokoke.h"

/* Common behavior modifiers */
#define MIDORI_MOD_NEW_WINDOW(state) (state & GDK_SHIFT_MASK)
#define MIDORI_MOD_NEW_TAB(state) (state & GDK_CONTROL_MASK)
#define MIDORI_MOD_BACKGROUND(state) (state & GDK_SHIFT_MASK)
#define MIDORI_MOD_SCROLL(state) (state & GDK_CONTROL_MASK)

#ifdef GDK_WINDOWING_QUARTZ
    #define MIDORI_EVENT_CONTEXT_MENU(evt) \
        ((evt->button == 3) \
        || (evt->button == 1 && (evt->state & GDK_CONTROL_MASK)))
#else
    #define MIDORI_EVENT_CONTEXT_MENU(evt) \
        (evt->button == 3)
#endif

#define MIDORI_EVENT_NEW_TAB(evt) \
    (evt != NULL \
     && ((((GdkEventButton*)evt)->button == 1 \
       && MIDORI_MOD_NEW_TAB(((GdkEventButton*)evt)->state)) \
     || (((GdkEventButton*)evt)->button == 2)))

#define MIDORI_MODULE_PREFIX "lib"

#endif /* !__MIDORI_PLATFORM_H__ */