Mercurial > hg > xemacs-beta
annotate src/console-gtk-impl.h @ 5925:08cfc8f77fb6 cygwin
make space for long ptr, and store as such, for frame in WINDOW data,
add a bit more debugging to debug-mswindow,
Vin Shelton patch to fix M-x shell
| author | Henry Thompson <ht@markup.co.uk> |
|---|---|
| date | Fri, 27 Feb 2015 17:41:20 +0000 |
| parents | 308d34e9f07d |
| children |
| rev | line source |
|---|---|
| 2168 | 1 /* Define GTK specific console, device, and frame object for XEmacs. |
| 872 | 2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. |
| 3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. | |
| 4 Copyright (C) 2002 Ben Wing. | |
| 5 | |
| 6 This file is part of XEmacs. | |
| 7 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5128
diff
changeset
|
8 XEmacs is free software: you can redistribute it and/or modify it |
| 872 | 9 under the terms of the GNU General Public License as published by the |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5128
diff
changeset
|
10 Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5128
diff
changeset
|
11 option) any later version. |
| 872 | 12 |
| 13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 16 for more details. | |
| 17 | |
| 18 You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5128
diff
changeset
|
19 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 872 | 20 |
| 21 /* Synched up with: Not in FSF. */ | |
| 22 | |
| 23 | |
| 24 /* Authorship: | |
| 25 | |
| 26 Ultimately based on FSF, then later on JWZ work for Lemacs. | |
| 27 Rewritten over time by Ben Wing and Chuck Thompson (original | |
| 28 multi-device work by Chuck Thompson). | |
| 2168 | 29 Gtk version by William M. Perry |
| 30 | |
| 872 | 31 */ |
| 32 | |
| 33 #ifndef INCLUDED_console_gtk_impl_h_ | |
| 34 #define INCLUDED_console_gtk_impl_h_ | |
| 35 | |
| 36 #ifdef HAVE_GTK | |
| 37 | |
| 38 #include "console-impl.h" | |
| 39 #include "console-gtk.h" | |
| 2054 | 40 #include <X11/Xlib.h> |
| 872 | 41 |
| 42 #define GDK_DRAWABLE(x) (GdkDrawable *) (x) | |
| 43 #define GET_GTK_WIDGET_WINDOW(x) (GTK_WIDGET (x)->window) | |
| 44 #define GET_GTK_WIDGET_PARENT(x) (GTK_WIDGET (x)->parent) | |
| 45 | |
| 46 DECLARE_CONSOLE_TYPE (gtk); | |
| 47 | |
| 48 struct gtk_device | |
| 49 { | |
| 3092 | 50 #ifdef NEW_GC |
|
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
51 NORMAL_LISP_OBJECT_HEADER header; |
| 3092 | 52 #endif /* NEW_GC */ |
| 872 | 53 /* Gtk application info. */ |
| 54 GtkWidget *gtk_app_shell; | |
| 55 | |
| 56 /* Cache of GC's for frame's on this device. */ | |
| 57 struct gc_cache *gc_cache; | |
| 58 | |
| 59 /* Selected visual, depth and colormap for this device */ | |
| 60 GdkVisual *visual; | |
| 61 int depth; | |
| 62 GdkColormap *device_cmap; | |
| 63 | |
| 64 /* Used by x_bevel_modeline in redisplay-x.c */ | |
| 65 GdkBitmap *gray_pixmap; | |
| 66 | |
| 67 /* frame that holds the WM_COMMAND property; there should be exactly | |
| 68 one of these per device. */ | |
| 69 Lisp_Object WM_COMMAND_frame; | |
| 70 | |
| 71 /* The following items are all used exclusively in event-gtk.c. */ | |
| 72 int MetaMask, HyperMask, SuperMask, AltMask, ModeMask; | |
| 2054 | 73 KeySym lock_interpretation; |
| 872 | 74 |
| 2054 | 75 XModifierKeymap *x_modifier_keymap; |
| 872 | 76 |
| 2054 | 77 KeySym *x_keysym_map; |
| 872 | 78 int x_keysym_map_min_code; |
| 79 int x_keysym_map_max_code; | |
| 80 int x_keysym_map_keysyms_per_code; | |
| 81 Lisp_Object x_keysym_map_hashtable; | |
| 82 | |
| 83 /* #### It's not clear that there is much distinction anymore | |
| 84 between mouse_timestamp and global_mouse_timestamp, now that | |
| 85 Emacs doesn't see most (all?) events not destined for it. */ | |
| 86 | |
| 87 /* The timestamp of the last button or key event used by emacs itself. | |
| 88 This is used for asserting selections and input focus. */ | |
| 89 guint32 mouse_timestamp; | |
| 90 | |
| 91 /* This is the timestamp the last button or key event whether it was | |
| 92 dispatched to emacs or widgets. */ | |
| 93 guint32 global_mouse_timestamp; | |
| 94 | |
| 95 /* This is the last known timestamp received from the server. It is | |
| 96 maintained by x_event_to_emacs_event and used to patch bogus | |
| 97 WM_TAKE_FOCUS messages sent by Mwm. */ | |
| 98 guint32 last_server_timestamp; | |
| 99 | |
| 100 GdkAtom atom_WM_PROTOCOLS; | |
| 101 GdkAtom atom_WM_TAKE_FOCUS; | |
| 102 GdkAtom atom_WM_STATE; | |
| 103 | |
| 104 #if 0 | |
| 105 /* #### BILL!!! */ | |
| 106 /* stuff for sticky modifiers: */ | |
| 107 unsigned int need_to_add_mask, down_mask; | |
| 108 KeyCode last_downkey; | |
| 109 guint32 release_time; | |
| 110 #endif | |
| 111 }; | |
| 112 | |
| 3092 | 113 #ifdef NEW_GC |
| 114 typedef struct gtk_device Lisp_Gtk_Device; | |
| 115 | |
|
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3092
diff
changeset
|
116 DECLARE_LISP_OBJECT (gtk_device, Lisp_Gtk_Device); |
| 3092 | 117 |
| 118 #define XGTK_DEVICE(x) \ | |
| 119 XRECORD (x, gtk_device, Lisp_Gtk_Device) | |
| 120 #define wrap_gtk_device(p) wrap_record (p, gtk_device) | |
| 121 #define GTK_DEVICE_P(x) RECORDP (x, gtk_device) | |
| 122 #endif /* NEW_GC */ | |
| 123 | |
| 872 | 124 #define DEVICE_GTK_DATA(d) DEVICE_TYPE_DATA (d, gtk) |
| 125 | |
| 126 #define DEVICE_GTK_VISUAL(d) (DEVICE_GTK_DATA (d)->visual) | |
| 127 #define DEVICE_GTK_DEPTH(d) (DEVICE_GTK_DATA (d)->depth) | |
| 128 #define DEVICE_GTK_COLORMAP(d) (DEVICE_GTK_DATA (d)->device_cmap) | |
| 129 #define DEVICE_GTK_APP_SHELL(d) (DEVICE_GTK_DATA (d)->gtk_app_shell) | |
| 130 #define DEVICE_GTK_GC_CACHE(d) (DEVICE_GTK_DATA (d)->gc_cache) | |
| 131 #define DEVICE_GTK_GRAY_PIXMAP(d) (DEVICE_GTK_DATA (d)->gray_pixmap) | |
| 132 #define DEVICE_GTK_WM_COMMAND_FRAME(d) (DEVICE_GTK_DATA (d)->WM_COMMAND_frame) | |
| 133 #define DEVICE_GTK_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->mouse_timestamp) | |
| 134 #define DEVICE_GTK_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->global_mouse_timestamp) | |
| 135 #define DEVICE_GTK_LAST_SERVER_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->last_server_timestamp) | |
| 136 | |
| 137 /* The maximum number of widgets that can be displayed above the text | |
| 138 area at one time. Currently no more than 3 will ever actually be | |
| 139 displayed (menubar, psheet, debugger panel). */ | |
| 140 #define MAX_CONCURRENT_TOP_WIDGETS 8 | |
| 141 | |
| 142 struct gtk_frame | |
| 143 { | |
| 3092 | 144 #ifdef NEW_GC |
|
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
145 NORMAL_LISP_OBJECT_HEADER header; |
| 3092 | 146 #endif /* NEW_GC */ |
| 147 | |
| 872 | 148 /* The widget of this frame. */ |
| 149 GtkWidget *widget; /* This is really a GtkWindow */ | |
| 150 | |
| 151 /* The layout manager */ | |
| 152 GtkWidget *container; /* actually a GtkVBox. */ | |
| 153 | |
| 154 /* The widget of the menubar */ | |
| 155 GtkWidget *menubar_widget; | |
| 156 | |
| 157 /* The widget of the edit portion of this frame; this is a GtkDrawingArea, | |
| 158 and the window of this widget is what the redisplay code draws on. */ | |
| 159 GtkWidget *edit_widget; | |
|
5080
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
160 /* #### WARNING: this does not currently work. -- dvl |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
161 Position of the edit widget above, for absolute background placement. |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
162 |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
163 int x, y; |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
164 */ |
| 872 | 165 |
| 166 /* Lists the widgets above the text area, in the proper order. */ | |
| 167 GtkWidget *top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; | |
| 168 int num_top_widgets; | |
| 169 | |
| 170 /* Our container widget as a Lisp_Object */ | |
| 1204 | 171 Lisp_Object lisp_visible_widgets[3]; |
| 872 | 172 |
| 1346 | 173 Lisp_Object menubar_data; |
| 872 | 174 |
| 175 /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ | |
| 176 Lisp_Object icon_pixmap; | |
| 177 Lisp_Object icon_pixmap_mask; | |
| 178 | |
| 179 /* geometry string that ought to be freed. */ | |
| 180 char *geom_free_me_please; | |
| 181 | |
| 182 /* 1 if the frame is completely visible on the display, 0 otherwise. | |
| 183 if 0 the frame may have been iconified or may be totally | |
| 184 or partially hidden by another X window */ | |
| 185 unsigned int totally_visible_p :1; | |
| 186 | |
| 187 /* Is it visible at all? */ | |
| 188 unsigned int visible_p :1; | |
| 189 | |
| 190 /* Are we a top-level frame? This means that our shell is a | |
| 191 TopLevelShell, and we should do certain things to interact with | |
| 192 the window manager. */ | |
| 193 unsigned int top_level_frame_p :1; | |
| 194 | |
| 195 /* Are we iconfied right now? */ | |
| 196 unsigned int iconified_p :1; | |
| 197 | |
| 2168 | 198 /* Data for widget callbacks. It is impossible to pass all the necessary |
| 199 data through the GTK signal API so instead it is registered here and the | |
| 200 hash key is passed instead. */ | |
| 201 Lisp_Object widget_instance_hash_table; | |
| 202 Lisp_Object widget_callback_hash_table; | |
| 203 Lisp_Object widget_callback_ex_hash_table; | |
| 872 | 204 }; |
| 205 | |
| 3092 | 206 #ifdef NEW_GC |
| 207 typedef struct gtk_frame Lisp_Gtk_Frame; | |
| 208 | |
|
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3092
diff
changeset
|
209 DECLARE_LISP_OBJECT (gtk_frame, Lisp_Gtk_Frame); |
| 3092 | 210 |
| 211 #define XGTK_FRAME(x) \ | |
| 212 XRECORD (x, gtk_frame, Lisp_Gtk_Frame) | |
| 213 #define wrap_gtk_frame(p) wrap_record (p, gtk_frame) | |
| 214 #define GTK_FRAME_P(x) RECORDP (x, gtk_frame) | |
| 215 #endif /* NEW_GC */ | |
| 216 | |
| 872 | 217 #define FRAME_GTK_DATA(f) FRAME_TYPE_DATA (f, gtk) |
| 218 | |
|
5080
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
219 /* #### WARNING: this does not currently work. -- dvl |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
220 #define FRAME_GTK_X(f) (FRAME_GTK_DATA (f)->x) |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
221 #define FRAME_GTK_Y(f) (FRAME_GTK_DATA (f)->y) |
|
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
3092
diff
changeset
|
222 */ |
| 872 | 223 #define FRAME_GTK_SHELL_WIDGET(f) (FRAME_GTK_DATA (f)->widget) |
| 224 #define FRAME_GTK_CONTAINER_WIDGET(f) (FRAME_GTK_DATA (f)->container) | |
| 225 #define FRAME_GTK_MENUBAR_WIDGET(f) (FRAME_GTK_DATA (f)->menubar_widget) | |
| 226 #define FRAME_GTK_TEXT_WIDGET(f) (FRAME_GTK_DATA (f)->edit_widget) | |
| 227 #define FRAME_GTK_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->top_widgets) | |
| 228 #define FRAME_GTK_NUM_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->num_top_widgets) | |
| 229 #define FRAME_GTK_ICONIFIED_P(f) (FRAME_GTK_DATA (f)->iconfigied_p) | |
| 230 | |
| 1346 | 231 #define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data) |
| 232 | |
| 872 | 233 #define FRAME_GTK_LISP_WIDGETS(f) (FRAME_GTK_DATA (f)->lisp_visible_widgets) |
| 234 #define FRAME_GTK_ICON_PIXMAP(f) (FRAME_GTK_DATA (f)->icon_pixmap) | |
| 235 #define FRAME_GTK_ICON_PIXMAP_MASK(f) (FRAME_GTK_DATA (f)->icon_pixmap_mask) | |
| 236 | |
| 237 #define FRAME_GTK_GEOM_FREE_ME_PLEASE(f) (FRAME_GTK_DATA (f)->geom_free_me_please) | |
| 238 | |
| 239 #define FRAME_GTK_TOTALLY_VISIBLE_P(f) (FRAME_GTK_DATA (f)->totally_visible_p) | |
| 240 #define FRAME_GTK_VISIBLE_P(f) (FRAME_GTK_DATA (f)->visible_p) | |
| 241 #define FRAME_GTK_TOP_LEVEL_FRAME_P(f) (FRAME_GTK_DATA (f)->top_level_frame_p) | |
| 2168 | 242 #define FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE(f) (FRAME_GTK_DATA (f)->widget_instance_hash_table) |
| 243 #define FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE(f) (FRAME_GTK_DATA (f)->widget_callback_hash_table) | |
| 244 #define FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE(f) (FRAME_GTK_DATA (f)->widget_callback_ex_hash_table) | |
| 872 | 245 |
| 246 extern struct console_type *gtk_console_type; | |
| 247 | |
| 2168 | 248 /* Special data used to quickly identify the frame that contains a widget. */ |
| 249 #define GTK_DATA_FRAME_IDENTIFIER "xemacs::frame" | |
| 250 | |
| 251 /* The hashcode in the frame hash table of a tab_control tab's callback data. */ | |
| 252 #define GTK_DATA_TAB_HASHCODE_IDENTIFIER "xemacs::tab_hashcode" | |
| 253 | |
| 254 #define GTK_DATA_GUI_IDENTIFIER "xemacs::gui_id" | |
| 255 | |
| 872 | 256 #endif /* HAVE_GTK */ |
| 257 #endif /* INCLUDED_console_gtk_impl_h_ */ |
