~ubuntu-branches/ubuntu/quantal/libbonobo/quantal-201207170711

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
 * Canvas-based rendering of views
 *
 * Author:
 *    Miguel de Icaza (miguel@kernel.org)
 *
 * Copyright (C) 1999, 2001 Ximian, Inc.
 */

#ifndef BONOBO_GDK_IDL
#define BONOBO_GDK_IDL

module Bonobo {

module Gdk {
	/*
	 * Idea: would it make more sense to 
	 * not provide our own types and just copy
	 * the Gdk values instead of converting back and forth?
	 */
	enum EventType {
		FOCUS,
		KEY,
		MOTION,
		BUTTON,
		CROSSING
	};

	enum ButtonType {
		BUTTON_PRESS,
		BUTTON_2_PRESS,
		BUTTON_3_PRESS,
		BUTTON_RELEASE
	};

	enum KeyType {
		KEY_PRESS,
		KEY_RELEASE
	};

	enum CrossType {
		ENTER, LEAVE
	};

	enum CrossMode {
		NORMAL,
		GRAB,
		UNGRAB
	};

	typedef long Time;

	struct MotionEvent {
		Gdk::Time time;
		double x, y, x_root, y_root;
		double pressure;
		double xtilt, ytilt;
		long   state;
		boolean is_hint;
	};

	struct ButtonEvent {
		ButtonType type;
		Gdk::Time time;
		
		double x, y, x_root, y_root;

		short  button;
	};

	struct KeyEvent {
		KeyType   type;
		Gdk::Time time;
		short	  state;
		short	  keyval;
		short	  length;
		string    str;
	};

	struct CrossingEvent {
		CrossType    type;
		Gdk::Time    time;
		double	     x, y, x_root, y_root;
		CrossMode    mode;
		boolean      focus;
		short        state;
	};

	struct FocusEvent {
		boolean      inside;
	};

	/*
	 * Only the lists of events supported by the Canvas
	 */
	union Event switch (EventType) {
		case Gdk::FOCUS:    FocusEvent focus;
		case Gdk::KEY:      KeyEvent key;
		case Gdk::MOTION:   MotionEvent motion;
		case Gdk::BUTTON:   ButtonEvent button;
		case Gdk::CROSSING: CrossingEvent crossing;
	};

	/*
	 * This is a ':' delimited string
	 *   under X11 the first entry ( before a ':' ) contains
	 *  window ID as an integer. Other fields are reserved for
	 *  future use.
	 * See also bonobo-control.c (window_id_demangle)
	 */
	typedef string WindowId;
};

module Gtk {
	struct Requisition {
		long width;
		long height;
	};
	enum State {
		StateNormal,
		StateActive,
		StatePrelight,
		StateSelected,
		StateInsensitive
	};
	enum Direction {
		DirectionTabForward,
		DirectionTabBackward,
		DirectionUp,
		DirectionDown,
		DirectionLeft,
		DirectionRight
	};
};

};

#endif