1 /* gtkpeer.h -- Some global variables and #defines
2 Copyright (C) 1998, 1999 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
44 #include "native_state.h"
48 #define RC_FILE ".classpath-gtkrc"
59 extern struct state_table
*native_state_table
;
61 #define NSA_INIT(env, clazz) \
62 native_state_table = init_state_table (env, clazz)
64 #define NSA_GET_PTR(env, obj) \
65 get_state (env, obj, native_state_table)
67 #define NSA_SET_PTR(env, obj, ptr) \
68 set_state (env, obj, native_state_table, (void *)ptr)
70 #define NSA_DEL_PTR(env, obj) \
71 remove_state_slot (env, obj, native_state_table)
77 GdkDrawable
*drawable
;
80 jint x_offset
, y_offset
;
83 #define AWT_DEFAULT_CURSOR 0
84 #define AWT_CROSSHAIR_CURSOR 1
85 #define AWT_TEXT_CURSOR 2
86 #define AWT_WAIT_CURSOR 3
87 #define AWT_SW_RESIZE_CURSOR 4
88 #define AWT_SE_RESIZE_CURSOR 5
89 #define AWT_NW_RESIZE_CURSOR 6
90 #define AWT_NE_RESIZE_CURSOR 7
91 #define AWT_N_RESIZE_CURSOR 8
92 #define AWT_S_RESIZE_CURSOR 9
93 #define AWT_W_RESIZE_CURSOR 10
94 #define AWT_E_RESIZE_CURSOR 11
95 #define AWT_HAND_CURSOR 12
96 #define AWT_MOVE_CURSOR 13
98 #define SYNTHETIC_EVENT_MASK (1 << 10)
100 #define AWT_SHIFT_MASK (1 << 0)
101 #define AWT_CTRL_MASK (1 << 1)
102 #define AWT_META_MASK (1 << 2)
103 #define AWT_ALT_MASK (1 << 3)
105 #define AWT_BUTTON1_MASK (1 << 4)
106 #define AWT_BUTTON2_MASK AWT_ALT_MASK
107 #define AWT_BUTTON3_MASK AWT_META_MASK
109 #define MULTI_CLICK_TIME 250
110 /* as opposed to a MULTI_PASS_TIME :) */
112 #define AWT_MOUSE_CLICKED 500
113 #define AWT_MOUSE_PRESSED 501
114 #define AWT_MOUSE_RELEASED 502
115 #define AWT_MOUSE_MOVED 503
116 #define AWT_MOUSE_ENTERED 504
117 #define AWT_MOUSE_EXITED 505
118 #define AWT_MOUSE_DRAGGED 506
120 #define AWT_ADJUSTMENT_UNIT_INCREMENT 1
121 #define AWT_ADJUSTMENT_UNIT_DECREMENT 2
122 #define AWT_ADJUSTMENT_BLOCK_DECREMENT 3
123 #define AWT_ADJUSTMENT_BLOCK_INCREMENT 4
124 #define AWT_ADJUSTMENT_TRACK 5
126 #define AWT_SCROLLPANE_SCROLLBARS_AS_NEEDED 0
127 #define AWT_SCROLLPANE_SCROLLBARS_ALWAYS 1
128 #define AWT_SCROLLPANE_SCROLLBARS_NEVER 2
130 #define AWT_LABEL_LEFT 0
131 #define AWT_LABEL_CENTER 1
132 #define AWT_LABEL_RIGHT 2
134 #define AWT_TEXTAREA_SCROLLBARS_BOTH 0
135 #define AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY 1
136 #define AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY 2
138 #define AWT_ITEM_SELECTED 1
139 #define AWT_ITEM_DESELECTED 2
141 #define AWT_KEY_TYPED 400
142 #define AWT_KEY_PRESSED 401
143 #define AWT_KEY_RELEASED 402
145 #define VK_UNDEFINED 0
146 #define AWT_KEY_CHAR_UNDEFINED 0
163 #define VK_BACK_QUOTE 192
164 #define VK_BACK_SLASH 92
165 #define VK_BACK_SPACE 8
168 #define VK_CAPS_LOCK 20
170 #define VK_CLOSE_BRACKET 93
172 #define VK_CONTROL 17
173 #define VK_CONVERT 28
175 #define VK_DECIMAL 110
176 #define VK_DELETE 127
177 #define VK_DIVIDE 111
202 #define VK_INSERT 155
211 #define VK_MODECHANGE 31
212 #define VK_MULTIPLY 106
214 #define VK_NONCONVERT 29
215 #define VK_NUM_LOCK 144
216 #define VK_NUMPAD0 96
217 #define VK_NUMPAD1 97
218 #define VK_NUMPAD2 98
219 #define VK_NUMPAD3 99
220 #define VK_NUMPAD4 100
221 #define VK_NUMPAD5 101
222 #define VK_NUMPAD6 102
223 #define VK_NUMPAD7 103
224 #define VK_NUMPAD8 104
225 #define VK_NUMPAD9 105
227 #define VK_OPEN_BRACKET 91
229 #define VK_PAGE_DOWN 34
230 #define VK_PAGE_UP 33
233 #define VK_PRINTSCREEN 154
239 #define VK_SCROLL_LOCK 145
240 #define VK_SEMICOLON 59
241 #define VK_SEPARATOR 108
245 #define VK_SUBTRACT 109
256 #define AWT_FOCUS_LOST 1004
257 #define AWT_FOCUS_GAINED 1005
259 extern jmethodID postActionEventID
;
260 extern jmethodID postMenuActionEventID
;
261 extern jmethodID postMouseEventID
;
262 extern jmethodID postConfigureEventID
;
263 extern jmethodID postExposeEventID
;
264 extern jmethodID postKeyEventID
;
265 extern jmethodID postFocusEventID
;
266 extern jmethodID postAdjustmentEventID
;
267 extern jmethodID postItemEventID
;
268 extern jmethodID postListItemEventID
;
269 extern jmethodID syncAttrsID
;
270 extern jclass gdkColor
;
271 extern jmethodID gdkColorID
;
272 extern JNIEnv
*gdk_env
;
275 gdk_window_get_root_geometry (GdkWindow
*window
,
283 void awt_event_handler (GdkEvent
*event
);
285 void connect_awt_hook (JNIEnv
*env
, jobject peer_obj
, int nwindows
, ...);
287 void set_visible (GtkWidget
*widget
, jboolean visible
);
288 void set_parent (GtkWidget
*widget
, GtkContainer
*parent
);
289 GtkLayout
*find_gtk_layout (GtkWidget
*parent
);
290 void setup_window (JNIEnv
*env
, jobject obj
, GtkWidget
*window
, jint width
,
291 jint height
, jboolean visible
);
293 struct item_event_hook_info
299 #endif /* __GTKPEER_H */