all repos — openbox @ 515f8d8760f614b127b4435dca7881a32b5b6207

openbox fork - make it a bit more like ryudo

c/eventdata.h (raw)

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef __eventdata_h
#define __eventdata_h

#include "obexport.h"
#include <Python.h>
#include <glib.h>

struct Client;

typedef struct {
    int temp:1; /* just a placeholder to kill warnings for now.. */
} LogicalEvent;

typedef struct {
    /*! The button which generated the event */
    guint button;
    /*! The pointer's x position on the root window when the event occured */
    int xroot;
    /*! The pointer's y position on the root window when the event occured */
    int yroot;
    /*! The modifiers that were pressed when the event occured. A bitmask of:
      ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, 
      Mod4Mask, Mod5Mask */
    guint modifiers;
    /*! The name of the button/modifier combination being pressed,
      eg "Mod1-1" */
    char *name;
} PointerEvent;

typedef struct {
    /*! The keycode of the key which generated the event */
    guint keycode;
    /*! The modifiers that were pressed when the event occured. A bitmask of:
      ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, 
      Mod4Mask, Mod5Mask */
    guint modifiers;
    /* The list of strings which make up the chain that fired,
       eg ("Mod1-a", "a") */
    GList *keylist;
} KeyEvent;

/* EventData is a PyObject */
typedef struct EventData {
    PyObject_HEAD
    /* The type of event which occured */
    EventType type;
    /*! The context in which the event occured, the type of window it occured
      for. */
    const char *context;
    /* The Client on which the event occured, or NULL */
    struct Client *client;

    union EventDetails {
	LogicalEvent *logical;
	PointerEvent *pointer;
	KeyEvent *key;
    } details;
} EventData;

void eventdata_startup();
void eventdata_shutdown();

EventData *eventdata_new_logical(EventType type, GQuark context,
				 struct Client *client);
EventData *eventdata_new_pointer(EventType type, GQuark context,
				 struct Client *client, guint modifiers,
				 guint button, char *name,
				 int xroot, int yroot);
EventData *eventdata_new_key(EventType type, GQuark context,
			     struct Client *client, guint modifiers,
			     guint keycode, GList *keylist);
void eventdata_free(EventData *data);

#endif