2168
|
1 /* Functions for the GTK toolkit.
|
462
|
2 Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc.
|
1346
|
3 Copyright (C) 1995, 1996, 2002, 2003 Ben Wing.
|
462
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Not synched with FSF. */
|
|
23
|
|
24 /* Substantially rewritten for XEmacs. */
|
|
25 /* Revamped to use Gdk/Gtk by William Perry */
|
|
26
|
|
27 #include <config.h>
|
|
28 #include "lisp.h"
|
|
29
|
872
|
30 #include "buffer.h"
|
|
31 #include "device-impl.h"
|
|
32 #include "events.h"
|
|
33 #include "extents.h"
|
|
34 #include "faces.h"
|
|
35 #include "frame-impl.h"
|
|
36 #include "window.h"
|
|
37
|
|
38 #ifdef HAVE_DRAGNDROP
|
|
39 #include "dragdrop.h"
|
|
40 #endif
|
|
41
|
2168
|
42 #include "elhash.h"
|
872
|
43 #include "console-gtk-impl.h"
|
462
|
44 #include "glyphs-gtk.h"
|
872
|
45 #include "objects-gtk-impl.h"
|
462
|
46 #include "scrollbar-gtk.h"
|
872
|
47 #include "ui-gtk.h"
|
462
|
48
|
|
49 #include "gtk-xemacs.h"
|
|
50
|
|
51 #ifdef HAVE_GNOME
|
|
52 #include <libgnomeui/libgnomeui.h>
|
|
53 #endif
|
|
54
|
|
55 #define BORDER_WIDTH 0
|
|
56 #define INTERNAL_BORDER_WIDTH 0
|
|
57
|
|
58 #define TRANSIENT_DATA_IDENTIFIER "xemacs::transient_for"
|
|
59 #define UNMAPPED_DATA_IDENTIFIER "xemacs::initially_unmapped"
|
|
60
|
|
61 #define STUPID_X_SPECIFIC_GTK_STUFF
|
|
62
|
|
63 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
64 #include <gdk/gdkx.h>
|
|
65 #endif
|
|
66
|
|
67 /* Default properties to use when creating frames. */
|
|
68 Lisp_Object Vdefault_gtk_frame_plist;
|
|
69
|
|
70 Lisp_Object Qdetachable_menubar;
|
|
71 Lisp_Object Qtext_widget;
|
|
72 Lisp_Object Qcontainer_widget;
|
|
73 Lisp_Object Qshell_widget;
|
|
74
|
|
75 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
76 EXFUN (Fgtk_window_id, 1);
|
|
77 #endif
|
|
78
|
|
79 #ifdef HAVE_DRAGNDROP
|
|
80 enum {
|
|
81 TARGET_TYPE_STRING,
|
|
82 TARGET_TYPE_URI_LIST,
|
|
83 };
|
|
84
|
|
85 static GtkTargetEntry dnd_target_table[] = {
|
|
86 { "STRING", 0, TARGET_TYPE_STRING },
|
|
87 { "text/plain", 0, TARGET_TYPE_STRING },
|
|
88 { "text/uri-list", 0, TARGET_TYPE_URI_LIST },
|
|
89 { "_NETSCAPE_URL", 0, TARGET_TYPE_STRING }
|
|
90 };
|
|
91
|
|
92 static guint dnd_n_targets = sizeof(dnd_target_table) / sizeof(dnd_target_table[0]);
|
|
93
|
|
94 #endif
|
|
95
|
1204
|
96 static const struct memory_description gtk_frame_data_description_1 [] = {
|
|
97 { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap) },
|
|
98 { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap_mask) },
|
|
99 { XD_LISP_OBJECT_ARRAY, offsetof (struct gtk_frame, lisp_visible_widgets),
|
|
100 3 },
|
1346
|
101 { XD_LISP_OBJECT, offsetof (struct gtk_frame, menubar_data) },
|
1204
|
102 { XD_END }
|
|
103 };
|
|
104
|
|
105 extern const struct sized_memory_description gtk_frame_data_description;
|
|
106
|
|
107 const struct sized_memory_description gtk_frame_data_description = {
|
|
108 sizeof (struct gtk_frame), gtk_frame_data_description_1
|
|
109 };
|
|
110
|
462
|
111
|
|
112 /************************************************************************/
|
|
113 /* helper functions */
|
|
114 /************************************************************************/
|
|
115
|
2168
|
116 /* Return the Emacs frame-object which contains the given widget. */
|
|
117 struct frame *
|
|
118 gtk_widget_to_frame (GtkWidget *w)
|
|
119 {
|
|
120 struct frame *f = NULL;
|
|
121
|
|
122 for (; w; w = w->parent)
|
|
123 {
|
|
124 if ((f = (struct frame *) gtk_object_get_data (GTK_OBJECT (w),
|
|
125 GTK_DATA_FRAME_IDENTIFIER)))
|
|
126 return (f);
|
|
127 }
|
|
128
|
|
129 return (selected_frame());
|
|
130 }
|
|
131
|
|
132
|
462
|
133 /* Return the Emacs frame-object corresponding to an X window */
|
|
134 struct frame *
|
|
135 gtk_window_to_frame (struct device *d, GdkWindow *wdesc)
|
|
136 {
|
|
137 Lisp_Object tail, frame;
|
|
138 struct frame *f;
|
|
139
|
|
140 /* This function was previously written to accept only a window argument
|
|
141 (and to loop over all devices looking for a matching window), but
|
|
142 that is incorrect because window ID's are not unique across displays. */
|
|
143
|
|
144 for (tail = DEVICE_FRAME_LIST (d); CONSP (tail); tail = XCDR (tail))
|
|
145 {
|
|
146 frame = XCAR (tail);
|
|
147 if (!FRAMEP (frame))
|
|
148 continue;
|
|
149 f = XFRAME (frame);
|
|
150 if (FRAME_GTK_P (f) && GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f)) == wdesc)
|
|
151 return f;
|
|
152 }
|
|
153 return 0;
|
|
154 }
|
|
155
|
|
156 /* Like gtk_window_to_frame but also compares the window with the widget's
|
|
157 windows */
|
|
158 struct frame *
|
|
159 gtk_any_window_to_frame (struct device *d, GdkWindow *w)
|
|
160 {
|
|
161 do
|
|
162 {
|
|
163 Lisp_Object frmcons;
|
|
164
|
|
165 DEVICE_FRAME_LOOP (frmcons, d)
|
|
166 {
|
|
167 struct frame *fr = XFRAME (XCAR (frmcons));
|
|
168 if ((w == GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (fr))) ||
|
|
169 (w == GET_GTK_WIDGET_WINDOW (FRAME_GTK_CONTAINER_WIDGET (fr))) ||
|
|
170 #ifdef HAVE_MENUBARS
|
|
171 (w == GET_GTK_WIDGET_WINDOW (FRAME_GTK_MENUBAR_WIDGET (fr))) ||
|
|
172 #endif
|
|
173 (w == GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (fr))))
|
|
174 {
|
|
175 return (fr);
|
|
176 }
|
|
177 }
|
|
178 w = gdk_window_get_parent (w);
|
|
179 } while (w);
|
|
180
|
|
181 return (0);
|
|
182 }
|
|
183
|
|
184 struct frame *
|
|
185 gtk_any_widget_or_parent_to_frame (struct device *d, GtkWidget *widget)
|
|
186 {
|
|
187 return (gtk_any_window_to_frame (d, GET_GTK_WIDGET_WINDOW (widget)));
|
|
188 }
|
|
189
|
|
190 struct device *
|
|
191 gtk_any_window_to_device (GdkWindow *w)
|
|
192 {
|
|
193 struct device *d = NULL;
|
|
194 Lisp_Object devcons, concons;
|
|
195
|
|
196 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
197 {
|
|
198 d = XDEVICE (XCAR (devcons));
|
|
199 if (!DEVICE_GTK_P (d)) continue;
|
|
200 if (gtk_any_window_to_frame (d, w))
|
|
201 return (d);
|
|
202 }
|
|
203 return (NULL);
|
|
204 }
|
|
205
|
|
206 struct frame *
|
|
207 decode_gtk_frame (Lisp_Object frame)
|
|
208 {
|
|
209 if (NILP (frame))
|
793
|
210 frame = wrap_frame (selected_frame ());
|
462
|
211 CHECK_LIVE_FRAME (frame);
|
|
212 /* this will also catch dead frames, but putting in the above check
|
|
213 results in a more useful error */
|
|
214 CHECK_GTK_FRAME (frame);
|
|
215 return XFRAME (frame);
|
|
216 }
|
|
217
|
|
218
|
|
219 /************************************************************************/
|
|
220 /* window-manager interactions */
|
|
221 /************************************************************************/
|
|
222 static int
|
|
223 gtk_frame_iconified_p (struct frame *f)
|
|
224 {
|
|
225 return (f->iconified);
|
|
226 }
|
|
227
|
|
228
|
|
229 /************************************************************************/
|
|
230 /* frame properties */
|
|
231 /************************************************************************/
|
|
232
|
|
233 static Lisp_Object
|
|
234 gtk_frame_property (struct frame *f, Lisp_Object property)
|
|
235 {
|
|
236 GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
|
|
237
|
|
238 if (EQ (Qleft, property) || EQ (Qtop, property))
|
|
239 {
|
|
240 gint x, y;
|
|
241 if (!GET_GTK_WIDGET_WINDOW(shell))
|
|
242 return Qzero;
|
|
243 gdk_window_get_deskrelative_origin (GET_GTK_WIDGET_WINDOW (shell), &x, &y);
|
|
244 if (EQ (Qleft, property)) return make_int (x);
|
|
245 if (EQ (Qtop, property)) return make_int (y);
|
|
246 }
|
|
247 if (EQ (Qshell_widget, property))
|
|
248 {
|
|
249 return (FRAME_GTK_LISP_WIDGETS (f)[0]);
|
|
250 }
|
|
251 if (EQ (Qcontainer_widget, property))
|
|
252 {
|
|
253 return (FRAME_GTK_LISP_WIDGETS (f)[1]);
|
|
254 }
|
|
255 if (EQ (Qtext_widget, property))
|
|
256 {
|
|
257 return (FRAME_GTK_LISP_WIDGETS (f)[2]);
|
|
258 }
|
|
259 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
260 if (EQ (Qwindow_id, property))
|
771
|
261 return Fgtk_window_id (wrap_frame (f));
|
462
|
262 #endif
|
|
263
|
|
264 return Qunbound;
|
|
265 }
|
|
266
|
|
267 static int
|
|
268 gtk_internal_frame_property_p (struct frame *f, Lisp_Object property)
|
|
269 {
|
|
270 return EQ (property, Qleft)
|
|
271 || EQ (property, Qtop)
|
|
272 || EQ (Qshell_widget, property)
|
|
273 || EQ (Qcontainer_widget, property)
|
|
274 || EQ (Qtext_widget, property)
|
|
275 || EQ (property, Qwindow_id)
|
|
276 || STRINGP (property);
|
|
277 }
|
|
278
|
|
279 static Lisp_Object
|
|
280 gtk_frame_properties (struct frame *f)
|
|
281 {
|
|
282 Lisp_Object props = Qnil;
|
|
283 GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
|
|
284 gint x, y;
|
|
285
|
|
286 props = cons3 (Qshell_widget, FRAME_GTK_LISP_WIDGETS (f)[0], props);
|
|
287 props = cons3 (Qcontainer_widget, FRAME_GTK_LISP_WIDGETS (f)[1], props);
|
|
288 props = cons3 (Qtext_widget, FRAME_GTK_LISP_WIDGETS (f)[2], props);
|
|
289
|
|
290 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
771
|
291 props = cons3 (Qwindow_id, Fgtk_window_id (wrap_frame (f)), props);
|
462
|
292 #endif
|
|
293
|
|
294 if (!GET_GTK_WIDGET_WINDOW (shell))
|
|
295 x = y = 0;
|
|
296 else
|
|
297 gdk_window_get_deskrelative_origin (GET_GTK_WIDGET_WINDOW (shell), &x, &y);
|
|
298
|
|
299 props = cons3 (Qtop, make_int (y), props);
|
|
300 props = cons3 (Qleft, make_int (x), props);
|
|
301
|
|
302 return props;
|
|
303 }
|
|
304
|
|
305
|
|
306 /* Functions called only from `gtk_set_frame_properties' to set
|
|
307 individual properties. */
|
|
308
|
|
309 static void
|
2286
|
310 gtk_set_frame_text_value (struct frame *UNUSED (f), Ibyte *value,
|
462
|
311 void (*func) (gpointer, gchar *),
|
|
312 gpointer arg)
|
|
313 {
|
|
314 gchar *the_text = (gchar *) value;
|
|
315
|
|
316 /* Programmer fuckup or window is not realized yet. */
|
|
317 if (!func || !arg) return;
|
|
318
|
|
319 #ifdef MULE
|
|
320 {
|
867
|
321 Ibyte *ptr;
|
462
|
322
|
|
323 /* Optimize for common ASCII case */
|
|
324 for (ptr = value; *ptr; ptr++)
|
826
|
325 if (!byte_ascii_p (*ptr))
|
462
|
326 {
|
|
327 char *tmp;
|
|
328 C_STRING_TO_EXTERNAL (value, tmp, Qctext);
|
|
329 the_text = tmp;
|
|
330 break;
|
|
331 }
|
|
332 }
|
|
333 #endif /* MULE */
|
|
334
|
|
335 (*func) (arg, (gchar *) the_text);
|
|
336 }
|
|
337
|
|
338 static void
|
867
|
339 gtk_set_title_from_ibyte (struct frame *f, Ibyte *name)
|
462
|
340 {
|
|
341 if (GTK_IS_WINDOW (FRAME_GTK_SHELL_WIDGET (f)))
|
|
342 gtk_set_frame_text_value (f, name,
|
|
343 (void (*)(gpointer, gchar *))
|
|
344 gtk_window_set_title, FRAME_GTK_SHELL_WIDGET (f));
|
|
345 }
|
|
346
|
|
347 static void
|
867
|
348 gtk_set_icon_name_from_ibyte (struct frame *f, Ibyte *name)
|
462
|
349 {
|
|
350 gtk_set_frame_text_value (f, name,
|
|
351 (void (*)(gpointer, gchar *))
|
|
352 gdk_window_set_icon_name, FRAME_GTK_SHELL_WIDGET (f)->window);
|
|
353 }
|
|
354
|
|
355 /* Set the initial frame size as specified. This function is used
|
|
356 when the frame's widgets have not yet been realized.
|
|
357 */
|
|
358 static void
|
|
359 gtk_set_initial_frame_size (struct frame *f, int x, int y,
|
|
360 unsigned int w, unsigned int h)
|
|
361 {
|
|
362 GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
|
|
363 GdkGeometry geometry;
|
|
364
|
|
365 if (GTK_IS_WINDOW (shell))
|
|
366 {
|
2054
|
367 GdkWindowHints geometry_mask = GDK_HINT_RESIZE_INC;
|
462
|
368 /* Deal with the cell size */
|
771
|
369 default_face_height_and_width (wrap_frame (f), &geometry.height_inc, &geometry.width_inc);
|
462
|
370
|
|
371 gtk_window_set_geometry_hints (GTK_WINDOW (shell),
|
|
372 FRAME_GTK_TEXT_WIDGET (f), &geometry, geometry_mask);
|
|
373 gdk_window_set_hints (GET_GTK_WIDGET_WINDOW (shell), x, y, 0, 0, 0, 0, GDK_HINT_POS);
|
|
374 gtk_window_set_policy (GTK_WINDOW (shell), TRUE, TRUE, FALSE);
|
|
375 }
|
|
376
|
|
377 FRAME_HEIGHT (f) = h;
|
|
378 FRAME_WIDTH (f) = w;
|
|
379
|
|
380 change_frame_size (f, h, w, 0);
|
|
381 {
|
|
382 GtkRequisition req;
|
|
383
|
|
384 gtk_widget_size_request (FRAME_GTK_SHELL_WIDGET (f), &req);
|
|
385 gtk_widget_set_usize (FRAME_GTK_SHELL_WIDGET (f), req.width, req.height);
|
|
386 }
|
|
387 }
|
|
388
|
|
389 /* Report that a frame property of frame S is being set or changed.
|
|
390 If the property is not specially recognized, do nothing.
|
|
391 */
|
|
392
|
|
393 static void
|
|
394 gtk_set_frame_properties (struct frame *f, Lisp_Object plist)
|
|
395 {
|
|
396 gint x, y;
|
|
397 gint width = 0, height = 0;
|
|
398 gboolean width_specified_p = FALSE;
|
|
399 gboolean height_specified_p = FALSE;
|
|
400 gboolean x_position_specified_p = FALSE;
|
|
401 gboolean y_position_specified_p = FALSE;
|
|
402 Lisp_Object tail;
|
|
403
|
|
404 for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
|
|
405 {
|
|
406 Lisp_Object prop = Fcar (tail);
|
|
407 Lisp_Object val = Fcar (Fcdr (tail));
|
|
408
|
|
409 if (SYMBOLP (prop))
|
|
410 {
|
|
411 if (EQ (prop, Qfont))
|
|
412 {
|
|
413 /* If the value is not a string we silently ignore it. */
|
|
414 if (STRINGP (val))
|
|
415 {
|
|
416 Lisp_Object frm, font_spec;
|
|
417
|
793
|
418 frm = wrap_frame (f);
|
462
|
419 font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
|
|
420
|
|
421 Fadd_spec_to_specifier (font_spec, val, frm, Qnil, Qnil);
|
|
422 update_frame_face_values (f);
|
|
423 }
|
|
424 continue;
|
|
425 }
|
|
426 else if (EQ (prop, Qwidth))
|
|
427 {
|
|
428 CHECK_INT (val);
|
|
429 width = XINT (val);
|
|
430 width_specified_p = TRUE;
|
|
431 continue;
|
|
432 }
|
|
433 else if (EQ (prop, Qheight))
|
|
434 {
|
|
435 CHECK_INT (val);
|
|
436 height = XINT (val);
|
|
437 height_specified_p = TRUE;
|
|
438 continue;
|
|
439 }
|
|
440 /* Further kludge the x/y. */
|
|
441 else if (EQ (prop, Qx))
|
|
442 {
|
|
443 CHECK_INT (val);
|
|
444 x = (gint) XINT (val);
|
|
445 x_position_specified_p = TRUE;
|
|
446 continue;
|
|
447 }
|
|
448 else if (EQ (prop, Qy))
|
|
449 {
|
|
450 CHECK_INT (val);
|
|
451 y = (gint) XINT (val);
|
|
452 y_position_specified_p = TRUE;
|
|
453 continue;
|
|
454 }
|
|
455 }
|
|
456 }
|
|
457
|
|
458 /* Kludge kludge kludge. We need to deal with the size and position
|
|
459 specially. */
|
|
460 {
|
|
461 int size_specified_p = width_specified_p || height_specified_p;
|
|
462 int position_specified_p = x_position_specified_p || y_position_specified_p;
|
|
463
|
|
464 if (!width_specified_p)
|
|
465 width = 80;
|
|
466 if (!height_specified_p)
|
|
467 height = 30;
|
|
468
|
|
469 /* Kludge kludge kludge kludge. */
|
|
470 if (position_specified_p &&
|
|
471 (!x_position_specified_p || !y_position_specified_p))
|
|
472 {
|
|
473 gint dummy;
|
|
474 GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
|
|
475 gdk_window_get_deskrelative_origin (GET_GTK_WIDGET_WINDOW (shell),
|
|
476 (x_position_specified_p ? &dummy : &x),
|
|
477 (y_position_specified_p ? &dummy : &y));
|
|
478 }
|
|
479
|
|
480 if (!f->init_finished)
|
|
481 {
|
|
482 if (size_specified_p || position_specified_p)
|
|
483 gtk_set_initial_frame_size (f, x, y, width, height);
|
|
484 }
|
|
485 else
|
|
486 {
|
|
487 if (size_specified_p)
|
|
488 {
|
793
|
489 Lisp_Object frame = wrap_frame (f);
|
|
490
|
462
|
491 Fset_frame_size (frame, make_int (width), make_int (height), Qnil);
|
|
492 }
|
|
493 if (position_specified_p)
|
|
494 {
|
793
|
495 Lisp_Object frame = wrap_frame (f);
|
|
496
|
462
|
497 Fset_frame_position (frame, make_int (x), make_int (y));
|
|
498 }
|
|
499 }
|
|
500 }
|
|
501 }
|
|
502
|
|
503
|
|
504 /************************************************************************/
|
|
505 /* widget creation */
|
|
506 /************************************************************************/
|
|
507 /* Figure out what size the shell widget should initially be,
|
|
508 and set it. Should be called after the default font has been
|
|
509 determined but before the widget has been realized. */
|
|
510
|
|
511 extern Lisp_Object Vgtk_initial_geometry;
|
|
512
|
|
513 #ifndef HAVE_GNOME
|
|
514 static int
|
|
515 get_number (const char **geometry)
|
|
516 {
|
|
517 int value = 0;
|
|
518 int mult = 1;
|
|
519
|
|
520 if (**geometry == '-'){
|
|
521 mult = -1;
|
|
522 (*geometry)++;
|
|
523 }
|
|
524 while (**geometry && isdigit (**geometry)){
|
|
525 value = value * 10 + (**geometry - '0');
|
|
526 (*geometry)++;
|
|
527 }
|
|
528 return value * mult;
|
|
529 }
|
|
530
|
|
531 /*
|
|
532 */
|
|
533
|
|
534 /**
|
|
535 * gnome_parse_geometry
|
|
536 * @geometry: geometry string to be parsed
|
|
537 * @xpos: X position geometry component
|
|
538 * @ypos: Y position geometry component
|
|
539 * @width: pixel width geometry component
|
|
540 * @height: pixel height geometry component
|
|
541 *
|
|
542 * Description:
|
|
543 * Parses the geometry string passed in @geometry, and fills
|
|
544 * @xpos, @ypos, @width, and @height with
|
|
545 * the corresponding values upon completion of the parse.
|
|
546 * If the parse fails, it should be assumed that @xpos, @ypos, @width,
|
|
547 * and @height contain undefined values.
|
|
548 *
|
|
549 * Returns:
|
|
550 * %TRUE if the geometry was successfully parsed, %FALSE otherwise.
|
|
551 **/
|
|
552
|
|
553 static gboolean
|
|
554 gnome_parse_geometry (const gchar *geometry, gint *xpos,
|
|
555 gint *ypos, gint *width, gint *height)
|
|
556 {
|
|
557 int subtract;
|
|
558
|
|
559 g_return_val_if_fail (xpos != NULL, FALSE);
|
|
560 g_return_val_if_fail (ypos != NULL, FALSE);
|
|
561 g_return_val_if_fail (width != NULL, FALSE);
|
|
562 g_return_val_if_fail (height != NULL, FALSE);
|
|
563
|
|
564 *xpos = *ypos = *width = *height = -1;
|
|
565
|
|
566 if (!geometry)
|
|
567 return FALSE;
|
|
568
|
|
569 if (*geometry == '=')
|
|
570 geometry++;
|
|
571 if (!*geometry)
|
|
572 return FALSE;
|
|
573 if (isdigit (*geometry))
|
|
574 *width = get_number (&geometry);
|
|
575 if (!*geometry)
|
|
576 return TRUE;
|
|
577 if (*geometry == 'x' || *geometry == 'X'){
|
|
578 geometry++;
|
|
579 *height = get_number (&geometry);
|
|
580 }
|
|
581 if (!*geometry)
|
|
582 return 1;
|
|
583 if (*geometry == '+'){
|
|
584 subtract = 0;
|
|
585 geometry++;
|
|
586 } else if (*geometry == '-'){
|
|
587 subtract = gdk_screen_width ();
|
|
588 geometry++;
|
|
589 } else
|
|
590 return FALSE;
|
|
591 *xpos = get_number (&geometry);
|
|
592 if (subtract)
|
|
593 *xpos = subtract - *xpos;
|
|
594 if (!*geometry)
|
|
595 return TRUE;
|
|
596 if (*geometry == '+'){
|
|
597 subtract = 0;
|
|
598 geometry++;
|
|
599 } else if (*geometry == '-'){
|
|
600 subtract = gdk_screen_height ();
|
|
601 geometry++;
|
|
602 } else
|
|
603 return FALSE;
|
|
604 *ypos = get_number (&geometry);
|
|
605 if (subtract)
|
|
606 *ypos = subtract - *ypos;
|
|
607 return TRUE;
|
|
608 }
|
|
609 #endif
|
|
610
|
|
611 static void
|
|
612 gtk_initialize_frame_size (struct frame *f)
|
|
613 {
|
|
614 gint x = 10, y = 10, w = 80, h = 30;
|
|
615
|
|
616 if (STRINGP (Vgtk_initial_geometry))
|
|
617 {
|
2054
|
618 if (!gnome_parse_geometry ((char*) XSTRING_DATA (Vgtk_initial_geometry), &x,&y,&w,&h))
|
462
|
619 {
|
|
620 x = y = 10;
|
|
621 w = 80;
|
|
622 h = 30;
|
|
623 }
|
|
624 }
|
|
625
|
|
626 /* set the position of the frame's root window now. When the
|
|
627 frame was created, the position was initialized to (0,0). */
|
|
628 {
|
|
629 struct window *win = XWINDOW (f->root_window);
|
|
630
|
|
631 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f);
|
|
632 WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f);
|
|
633
|
|
634 if (!NILP (f->minibuffer_window))
|
|
635 {
|
|
636 win = XWINDOW (f->minibuffer_window);
|
|
637 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f);
|
|
638 }
|
|
639 }
|
|
640
|
|
641 gtk_set_initial_frame_size (f, x, y, w, h);
|
|
642 }
|
|
643
|
|
644 static gboolean
|
2286
|
645 resize_event_cb (GtkWidget *UNUSED (w), GtkAllocation *allocation,
|
|
646 gpointer user_data)
|
462
|
647 {
|
|
648 struct frame *f = (struct frame *) user_data;
|
|
649
|
|
650 f->pixwidth = allocation->width;
|
|
651 f->pixheight = allocation->height;
|
|
652
|
|
653 if (FRAME_GTK_TEXT_WIDGET (f)->window)
|
|
654 {
|
793
|
655 Lisp_Object frame = wrap_frame (f);
|
|
656
|
462
|
657 Fredraw_frame (frame, Qt);
|
|
658 }
|
|
659
|
|
660 return (FALSE);
|
|
661 }
|
|
662
|
|
663 static gboolean
|
2286
|
664 delete_event_cb (GtkWidget *UNUSED (w), GdkEvent *UNUSED (ev),
|
|
665 gpointer user_data)
|
462
|
666 {
|
|
667 struct frame *f = (struct frame *) user_data;
|
793
|
668 Lisp_Object frame = wrap_frame (f);
|
462
|
669
|
|
670 enqueue_misc_user_event (frame, Qeval, list3 (Qdelete_frame, frame, Qt));
|
|
671
|
|
672 /* See if tickling the event queue helps us with our delays when
|
|
673 clicking 'close' */
|
|
674 signal_fake_event ();
|
|
675
|
|
676 return (TRUE);
|
|
677 }
|
|
678
|
|
679 extern gboolean emacs_shell_event_handler (GtkWidget *wid, GdkEvent *event, gpointer closure);
|
|
680 extern Lisp_Object build_gtk_object (GtkObject *obj);
|
|
681
|
|
682 #ifndef GNOME_IS_APP
|
|
683 #define GNOME_IS_APP(x) 0
|
|
684 #define gnome_app_set_contents(x,y) 0
|
|
685 #endif
|
|
686
|
|
687 static void
|
|
688 cleanup_deleted_frame (gpointer data)
|
|
689 {
|
|
690 struct frame *f = (struct frame *) data;
|
793
|
691 Lisp_Object frame = wrap_frame (f);
|
462
|
692
|
|
693 Fdelete_frame (frame, Qt);
|
|
694 }
|
|
695
|
|
696 #ifdef HAVE_DRAGNDROP
|
|
697 extern void
|
|
698 dragndrop_data_received (GtkWidget *widget,
|
|
699 GdkDragContext *context,
|
|
700 gint x,
|
|
701 gint y,
|
|
702 GtkSelectionData *data,
|
|
703 guint info,
|
|
704 guint time);
|
|
705
|
|
706 extern gboolean
|
|
707 dragndrop_dropped (GtkWidget *widget,
|
|
708 GdkDragContext *drag_context,
|
|
709 gint x,
|
|
710 gint y,
|
|
711 guint time,
|
|
712 gpointer user_data);
|
|
713
|
|
714 Lisp_Object Vcurrent_drag_object;
|
|
715
|
|
716 #define DRAG_SELECTION_DATA_ERROR "Error converting drag data to external format"
|
|
717 static void
|
2286
|
718 dragndrop_get_drag (GtkWidget *UNUSED (widget),
|
|
719 GdkDragContext *UNUSED (drag_context),
|
462
|
720 GtkSelectionData *data,
|
|
721 guint info,
|
2286
|
722 guint UNUSED (time),
|
|
723 gpointer UNUSED (user_data))
|
462
|
724 {
|
|
725 gtk_selection_data_set (data, GDK_SELECTION_TYPE_STRING, 8,
|
|
726 DRAG_SELECTION_DATA_ERROR,
|
|
727 strlen (DRAG_SELECTION_DATA_ERROR));
|
|
728
|
|
729 switch (info)
|
|
730 {
|
|
731 case TARGET_TYPE_STRING:
|
|
732 {
|
|
733 Lisp_Object string = Vcurrent_drag_object;
|
|
734
|
|
735 if (!STRINGP (Vcurrent_drag_object))
|
|
736 {
|
|
737 string = Fprin1_to_string (string, Qnil);
|
|
738 /* Convert to a string */
|
|
739 }
|
|
740
|
|
741 gtk_selection_data_set (data, GDK_SELECTION_TYPE_STRING,
|
|
742 8, XSTRING_DATA (string), XSTRING_LENGTH (string));
|
|
743 }
|
|
744 break;
|
|
745 case TARGET_TYPE_URI_LIST:
|
|
746 break;
|
|
747 default:
|
|
748 break;
|
|
749 }
|
|
750 Vcurrent_drag_object = Qnil;
|
|
751 }
|
|
752
|
|
753 DEFUN ("gtk-start-drag-internal", Fgtk_start_drag_internal, 2, 3, 0, /*
|
|
754 Start a GTK drag from a buffer.
|
|
755 First arg is the event that started the drag,
|
|
756 second arg should be some string, and the third
|
|
757 is the type of the data (this should be a MIME type as a string (ie: text/plain)).
|
|
758 The type defaults to text/plain.
|
|
759 */
|
|
760 (event, data, dtyp))
|
|
761 {
|
|
762 if (EVENTP(event))
|
|
763 {
|
|
764 struct frame *f = decode_gtk_frame (Fselected_frame (Qnil));
|
|
765 GtkWidget *wid = FRAME_GTK_TEXT_WIDGET (f);
|
|
766 struct Lisp_Event *lisp_event = XEVENT(event);
|
|
767 GdkAtom dnd_typ;
|
|
768 GtkTargetList *tl = gtk_target_list_new (dnd_target_table, dnd_n_targets);
|
|
769
|
|
770 /* only drag if this is really a press */
|
|
771 if (EVENT_TYPE(lisp_event) != button_press_event)
|
|
772 return Qnil;
|
|
773
|
|
774 /* get the desired type */
|
|
775 if (!NILP (dtyp) && STRINGP (dtyp))
|
|
776 dnd_typ = gdk_atom_intern (XSTRING_DATA (dtyp), FALSE);
|
|
777
|
1204
|
778 gtk_drag_begin (wid, tl, GDK_ACTION_COPY,
|
|
779 EVENT_BUTTON_BUTTON (lisp_event), NULL);
|
462
|
780
|
|
781 Vcurrent_drag_object = data;
|
|
782
|
|
783 gtk_target_list_unref (tl);
|
|
784 }
|
|
785 return Qnil;
|
|
786 }
|
|
787 #endif
|
|
788
|
|
789 /* Creates the widgets for a frame.
|
|
790 lisp_window_id is a Lisp description of an X window or Xt
|
|
791 widget to parse.
|
|
792
|
|
793 This function does not map the windows. (That is
|
|
794 done by gtk_popup_frame().)
|
|
795 */
|
|
796 static void
|
|
797 gtk_create_widgets (struct frame *f, Lisp_Object lisp_window_id, Lisp_Object parent)
|
|
798 {
|
|
799 const char *name;
|
|
800 GtkWidget *text, *container, *shell;
|
|
801 gboolean embedded_p = !NILP (lisp_window_id);
|
|
802 #ifdef HAVE_MENUBARS
|
|
803 int menubar_visible;
|
|
804 #endif
|
|
805
|
|
806 if (STRINGP (f->name))
|
|
807 TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, name, Qctext);
|
|
808 else
|
|
809 name = "emacs";
|
|
810
|
|
811 FRAME_GTK_TOP_LEVEL_FRAME_P (f) = 1;
|
|
812
|
|
813 if (embedded_p)
|
|
814 {
|
|
815 CHECK_GTK_OBJECT (lisp_window_id);
|
|
816
|
|
817 if (!GTK_IS_CONTAINER (XGTK_OBJECT (lisp_window_id)->object))
|
|
818 {
|
563
|
819 invalid_argument ("Window ID must be a GtkContainer subclass", lisp_window_id);
|
462
|
820 }
|
|
821
|
|
822 shell = gtk_vbox_new (FALSE, 0);
|
|
823
|
|
824 gtk_object_weakref (GTK_OBJECT (shell), cleanup_deleted_frame, f);
|
|
825 gtk_container_add (GTK_CONTAINER (XGTK_OBJECT (lisp_window_id)->object), shell);
|
|
826 }
|
|
827 else
|
|
828 {
|
|
829 #ifdef HAVE_GNOME
|
|
830 shell = GTK_WIDGET (gnome_app_new ("XEmacs", "XEmacs/GNOME"));
|
|
831 #else
|
|
832 shell = GTK_WIDGET (gtk_window_new (GTK_WINDOW_TOPLEVEL));
|
|
833 #endif
|
|
834 }
|
|
835
|
|
836 if (!NILP (parent))
|
|
837 {
|
|
838 /* If this is a transient window, keep the parent info around */
|
|
839 GtkWidget *parentwid = FRAME_GTK_SHELL_WIDGET (XFRAME (parent));
|
|
840 gtk_object_set_data (GTK_OBJECT (shell), TRANSIENT_DATA_IDENTIFIER, parentwid);
|
|
841 gtk_window_set_transient_for (GTK_WINDOW (shell), GTK_WINDOW (parentwid));
|
|
842 }
|
|
843
|
|
844 gtk_container_set_border_width (GTK_CONTAINER (shell), 0);
|
|
845
|
2168
|
846 /* Add a mapping from widget to frame to help widget callbacks quickly find
|
|
847 their corresponding frame. */
|
|
848 gtk_object_set_data (GTK_OBJECT (shell), GTK_DATA_FRAME_IDENTIFIER, f);
|
462
|
849
|
|
850 FRAME_GTK_SHELL_WIDGET (f) = shell;
|
|
851
|
|
852 text = GTK_WIDGET (gtk_xemacs_new (f));
|
|
853
|
|
854 if (!GNOME_IS_APP (shell))
|
|
855 container = GTK_WIDGET (gtk_vbox_new (FALSE, INTERNAL_BORDER_WIDTH));
|
|
856 else
|
|
857 container = shell;
|
|
858
|
|
859 FRAME_GTK_CONTAINER_WIDGET (f) = container;
|
|
860 FRAME_GTK_TEXT_WIDGET (f) = text;
|
|
861
|
|
862 #ifdef HAVE_DRAGNDROP
|
|
863 gtk_drag_dest_set (text, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT,
|
|
864 dnd_target_table, dnd_n_targets,
|
|
865 GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK);
|
|
866 gtk_signal_connect (GTK_OBJECT (text), "drag_drop",
|
|
867 GTK_SIGNAL_FUNC (dragndrop_dropped), text);
|
|
868 gtk_signal_connect (GTK_OBJECT (text), "drag_data_received",
|
|
869 GTK_SIGNAL_FUNC (dragndrop_data_received), text);
|
|
870 gtk_signal_connect (GTK_OBJECT (text), "drag_data_get",
|
|
871 GTK_SIGNAL_FUNC (dragndrop_get_drag), NULL);
|
|
872 #endif
|
|
873
|
|
874 #ifdef HAVE_MENUBARS
|
|
875 /* Create the initial menubar widget. */
|
|
876 menubar_visible = gtk_initialize_frame_menubar (f);
|
|
877
|
|
878 if (menubar_visible)
|
|
879 {
|
|
880 gtk_widget_show_all (FRAME_GTK_MENUBAR_WIDGET (f));
|
|
881 }
|
|
882 #endif /* HAVE_MENUBARS */
|
|
883
|
|
884 if (GNOME_IS_APP (shell))
|
|
885 gnome_app_set_contents (GNOME_APP (shell), text);
|
|
886 else
|
|
887 /* Now comes the drawing area, which should fill the rest of the
|
|
888 ** frame completely.
|
|
889 */
|
|
890 gtk_box_pack_end (GTK_BOX (container), text, TRUE, TRUE, 0);
|
|
891
|
|
892 /* Connect main event handler */
|
|
893 gtk_signal_connect (GTK_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
|
|
894
|
|
895 {
|
|
896 static char *events_to_frob[] = { "focus-in-event",
|
|
897 "focus-out-event",
|
|
898 "enter-notify-event",
|
|
899 "leave-notify-event",
|
|
900 "map-event",
|
|
901 "unmap-event",
|
|
902 "property-notify-event",
|
|
903 "selection-clear-event",
|
|
904 "selection-request-event",
|
|
905 "selection-notify-event",
|
|
906 "client-event",
|
|
907 /* "configure-event", */
|
|
908 "visibility-notify-event",
|
|
909 NULL };
|
|
910 int i;
|
|
911
|
|
912 for (i = 0; events_to_frob[i]; i++)
|
|
913 {
|
|
914 gtk_signal_connect (GTK_OBJECT (shell), events_to_frob[i],
|
|
915 GTK_SIGNAL_FUNC (emacs_shell_event_handler), f);
|
|
916 }
|
|
917 }
|
|
918
|
|
919 gtk_signal_connect (GTK_OBJECT (shell), "size-allocate", GTK_SIGNAL_FUNC (resize_event_cb), f);
|
|
920
|
|
921 /* This might be safe to call now... */
|
|
922 /* gtk_signal_connect (GTK_OBJECT (shell), "event", GTK_SIGNAL_FUNC (emacs_shell_event_handler), f); */
|
|
923
|
|
924 /* Let's make sure we get all the events we can */
|
|
925 gtk_widget_set_events (text, GDK_ALL_EVENTS_MASK);
|
|
926
|
|
927 if (shell != container)
|
|
928 gtk_container_add (GTK_CONTAINER (shell), container);
|
|
929
|
|
930 gtk_widget_set_name (shell, "XEmacs::shell");
|
|
931 gtk_widget_set_name (container, "XEmacs::container");
|
|
932 gtk_widget_set_name (text, "XEmacs::text");
|
|
933
|
|
934 FRAME_GTK_LISP_WIDGETS(f)[0] = build_gtk_object (GTK_OBJECT (shell));
|
|
935 FRAME_GTK_LISP_WIDGETS(f)[1] = build_gtk_object (GTK_OBJECT (container));
|
|
936 FRAME_GTK_LISP_WIDGETS(f)[2] = build_gtk_object (GTK_OBJECT (text));
|
|
937
|
|
938 gtk_widget_realize (shell);
|
|
939 }
|
|
940
|
|
941 /* create the windows for the specified frame and display them.
|
|
942 Note that the widgets have already been created, and any
|
|
943 necessary geometry calculations have already been done. */
|
|
944 static void
|
|
945 gtk_popup_frame (struct frame *f)
|
|
946 {
|
|
947 /* */
|
|
948
|
|
949 if (gtk_object_get_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)), UNMAPPED_DATA_IDENTIFIER))
|
|
950 {
|
|
951 FRAME_GTK_TOTALLY_VISIBLE_P (f) = 0;
|
|
952 f->visible = 0;
|
|
953 gtk_widget_realize (FRAME_GTK_SHELL_WIDGET (f));
|
|
954 gtk_widget_realize (FRAME_GTK_TEXT_WIDGET (f));
|
|
955 gtk_widget_hide_all (FRAME_GTK_SHELL_WIDGET (f));
|
|
956 }
|
|
957 else
|
|
958 {
|
|
959 gtk_widget_show_all (FRAME_GTK_SHELL_WIDGET (f));
|
|
960 }
|
|
961 }
|
|
962
|
|
963 static void
|
|
964 allocate_gtk_frame_struct (struct frame *f)
|
|
965 {
|
1346
|
966 int i;
|
|
967
|
462
|
968 /* zero out all slots. */
|
|
969 f->frame_data = xnew_and_zero (struct gtk_frame);
|
|
970
|
|
971 /* yeah, except the lisp ones */
|
|
972 FRAME_GTK_ICON_PIXMAP (f) = Qnil;
|
|
973 FRAME_GTK_ICON_PIXMAP_MASK (f) = Qnil;
|
1346
|
974 FRAME_GTK_MENUBAR_DATA (f) = Qnil;
|
|
975 for (i = 0; i < 3; i++)
|
|
976 FRAME_GTK_LISP_WIDGETS (f)[i] = Qnil;
|
2168
|
977
|
|
978 /*
|
|
979 Hashtables of callback data for glyphs on the frame. Make them EQ because
|
|
980 we only use ints as keys. Otherwise we run into stickiness in redisplay
|
|
981 because internal_equal() can QUIT. See enter_redisplay_critical_section().
|
|
982 */
|
|
983 FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f) =
|
|
984 make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
|
|
985 FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE (f) =
|
|
986 make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
|
|
987 FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE (f) =
|
|
988 make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
|
462
|
989 }
|
|
990
|
|
991
|
|
992 /************************************************************************/
|
|
993 /* Lisp functions */
|
|
994 /************************************************************************/
|
|
995
|
|
996 static void
|
771
|
997 gtk_init_frame_1 (struct frame *f, Lisp_Object props,
|
2286
|
998 int UNUSED (frame_name_is_defaulted))
|
462
|
999 {
|
|
1000 /* This function can GC */
|
|
1001 Lisp_Object initially_unmapped;
|
|
1002 Lisp_Object device = FRAME_DEVICE (f);
|
|
1003 Lisp_Object lisp_window_id = Fplist_get (props, Qwindow_id, Qnil);
|
|
1004 Lisp_Object popup = Fplist_get (props, Qpopup, Qnil);
|
|
1005
|
|
1006 if (!NILP (popup))
|
|
1007 {
|
|
1008 if (EQ (popup, Qt))
|
|
1009 popup = Fselected_frame (device);
|
|
1010 CHECK_LIVE_FRAME (popup);
|
|
1011 if (!EQ (device, FRAME_DEVICE (XFRAME (popup))))
|
563
|
1012 invalid_argument_2 ("Parent must be on same device as frame",
|
|
1013 device, popup);
|
462
|
1014 }
|
|
1015
|
|
1016 initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil);
|
|
1017
|
|
1018 /*
|
|
1019 * Previously we set this only if NILP (DEVICE_SELECTED_FRAME (d))
|
|
1020 * to make sure that messages were displayed as soon as possible
|
|
1021 * if we're creating the first frame on a device. But it is
|
|
1022 * better to just set this all the time, so that when a new frame
|
|
1023 * is created that covers the selected frame, echo area status
|
|
1024 * messages can still be seen. f->visible is reset later if the
|
|
1025 * initially-unmapped property is found to be non-nil in the
|
|
1026 * frame properties.
|
|
1027 */
|
|
1028 f->visible = 1;
|
|
1029
|
|
1030 allocate_gtk_frame_struct (f);
|
|
1031 gtk_create_widgets (f, lisp_window_id, popup);
|
|
1032
|
|
1033 if (!NILP (initially_unmapped))
|
|
1034 {
|
|
1035 gtk_object_set_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)),
|
|
1036 UNMAPPED_DATA_IDENTIFIER, (gpointer) 1);
|
|
1037 }
|
|
1038 }
|
|
1039
|
|
1040 static void
|
2286
|
1041 gtk_init_frame_2 (struct frame *f, Lisp_Object UNUSED (props))
|
462
|
1042 {
|
|
1043 /* Set up the values of the widget/frame. A case could be made for putting
|
|
1044 this inside of the widget's initialize method. */
|
|
1045
|
|
1046 update_frame_face_values (f);
|
|
1047 gtk_initialize_frame_size (f);
|
|
1048 /* Kyle:
|
|
1049 * update_frame_title() can't be done here, because some of the
|
|
1050 * modeline specs depend on the frame's device having a selected
|
|
1051 * frame, and that may not have been set up yet. The redisplay
|
|
1052 * will update the frame title anyway, so nothing is lost.
|
|
1053 * JV:
|
|
1054 * It turns out it gives problems with FVWMs name based mapping.
|
|
1055 * We'll just need to be carefull in the modeline specs.
|
|
1056 */
|
|
1057 update_frame_title (f);
|
|
1058 }
|
|
1059
|
|
1060 static void
|
|
1061 gtk_init_frame_3 (struct frame *f)
|
|
1062 {
|
|
1063 /* Pop up the frame. */
|
|
1064 gtk_popup_frame (f);
|
|
1065 }
|
|
1066
|
|
1067 static void
|
|
1068 gtk_mark_frame (struct frame *f)
|
|
1069 {
|
|
1070 mark_object (FRAME_GTK_ICON_PIXMAP (f));
|
|
1071 mark_object (FRAME_GTK_ICON_PIXMAP_MASK (f));
|
1346
|
1072 mark_object (FRAME_GTK_MENUBAR_DATA (f));
|
462
|
1073 mark_object (FRAME_GTK_LISP_WIDGETS (f)[0]);
|
|
1074 mark_object (FRAME_GTK_LISP_WIDGETS (f)[1]);
|
|
1075 mark_object (FRAME_GTK_LISP_WIDGETS (f)[2]);
|
2168
|
1076 mark_object (FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f));
|
|
1077 mark_object (FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE (f));
|
|
1078 mark_object (FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE (f));
|
462
|
1079 }
|
|
1080
|
|
1081 static void
|
|
1082 gtk_set_frame_icon (struct frame *f)
|
|
1083 {
|
|
1084 GdkPixmap *gtk_pixmap = NULL, *gtk_mask = NULL;
|
|
1085
|
|
1086 if (IMAGE_INSTANCEP (f->icon)
|
|
1087 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (f->icon)))
|
|
1088 {
|
|
1089 gtk_pixmap = XIMAGE_INSTANCE_GTK_PIXMAP (f->icon);
|
|
1090 gtk_mask = XIMAGE_INSTANCE_GTK_MASK (f->icon);
|
|
1091 }
|
|
1092 else
|
|
1093 {
|
|
1094 gtk_pixmap = 0;
|
|
1095 gtk_mask = 0;
|
|
1096 }
|
|
1097
|
|
1098 gdk_window_set_icon (GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (f)), NULL, gtk_pixmap, gtk_mask);
|
|
1099 }
|
|
1100
|
|
1101 static void
|
|
1102 gtk_set_frame_pointer (struct frame *f)
|
|
1103 {
|
|
1104 GtkWidget *w = FRAME_GTK_TEXT_WIDGET (f);
|
|
1105 GdkCursor *c = XIMAGE_INSTANCE_GTK_CURSOR (f->pointer);
|
|
1106
|
|
1107 if (POINTER_IMAGE_INSTANCEP (f->pointer))
|
|
1108 {
|
|
1109 gdk_window_set_cursor (GET_GTK_WIDGET_WINDOW (w), c);
|
|
1110 gdk_flush ();
|
|
1111 }
|
|
1112 else
|
|
1113 {
|
2500
|
1114 /* ABORT()? */
|
462
|
1115 stderr_out ("POINTER_IMAGE_INSTANCEP (f->pointer) failed!\n");
|
|
1116 }
|
|
1117 }
|
|
1118
|
|
1119 static Lisp_Object
|
|
1120 gtk_get_frame_parent (struct frame *f)
|
|
1121 {
|
2054
|
1122 GtkWidget *parentwid = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)),
|
|
1123 TRANSIENT_DATA_IDENTIFIER);
|
462
|
1124
|
|
1125 /* find the frame whose wid is parentwid */
|
|
1126 if (parentwid)
|
|
1127 {
|
|
1128 Lisp_Object frmcons;
|
|
1129 DEVICE_FRAME_LOOP (frmcons, XDEVICE (FRAME_DEVICE (f)))
|
|
1130 {
|
|
1131 Lisp_Object frame = XCAR (frmcons);
|
|
1132 if (FRAME_GTK_SHELL_WIDGET (XFRAME (frame)) == parentwid)
|
|
1133 return frame;
|
|
1134 }
|
|
1135 }
|
|
1136 return Qnil;
|
|
1137 }
|
|
1138
|
|
1139 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
1140 DEFUN ("gtk-window-id", Fgtk_window_id, 0, 1, 0, /*
|
|
1141 Get the ID of the Gtk window.
|
|
1142 This gives us a chance to manipulate the Emacs window from within a
|
|
1143 different program. Since the ID is an unsigned long, we return it as
|
|
1144 a string.
|
|
1145 */
|
|
1146 (frame))
|
|
1147 {
|
|
1148 char str[255];
|
|
1149 struct frame *f = decode_gtk_frame (frame);
|
|
1150
|
|
1151 /* Arrrrggghhh... this defeats the whole purpose of using Gdk... do we really need this? */
|
|
1152 sprintf (str, "%lu", GDK_WINDOW_XWINDOW( GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f))));
|
|
1153 return build_string (str);
|
|
1154 }
|
|
1155 #endif
|
|
1156
|
|
1157
|
|
1158 /************************************************************************/
|
|
1159 /* manipulating the X window */
|
|
1160 /************************************************************************/
|
|
1161
|
|
1162 static void
|
|
1163 gtk_set_frame_position (struct frame *f, int xoff, int yoff)
|
|
1164 {
|
|
1165 gtk_widget_set_uposition (FRAME_GTK_SHELL_WIDGET (f), xoff, yoff);
|
|
1166 }
|
|
1167
|
|
1168 /* Call this to change the size of frame S's x-window. */
|
|
1169
|
|
1170 static void
|
|
1171 gtk_set_frame_size (struct frame *f, int cols, int rows)
|
|
1172 {
|
|
1173 GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
|
|
1174 GdkGeometry geometry;
|
|
1175
|
|
1176 if (GTK_IS_WINDOW (shell))
|
|
1177 {
|
2054
|
1178 GdkWindowHints geometry_mask = GDK_HINT_RESIZE_INC;
|
|
1179
|
462
|
1180 /* Update the cell size */
|
771
|
1181 default_face_height_and_width (wrap_frame (f), &geometry.height_inc, &geometry.width_inc);
|
462
|
1182
|
|
1183 gtk_window_set_geometry_hints (GTK_WINDOW (shell),
|
|
1184 FRAME_GTK_TEXT_WIDGET (f), &geometry, geometry_mask);
|
|
1185 }
|
|
1186
|
|
1187 change_frame_size (f, rows, cols, 0);
|
|
1188
|
|
1189 {
|
|
1190 GtkRequisition req;
|
|
1191
|
|
1192 gtk_widget_size_request (FRAME_GTK_SHELL_WIDGET (f), &req);
|
|
1193 gtk_widget_set_usize (FRAME_GTK_SHELL_WIDGET (f), req.width, req.height);
|
|
1194 }
|
|
1195 }
|
|
1196
|
|
1197 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
1198 /* There is NO equivalent to XWarpPointer under Gtk */
|
|
1199 static void
|
|
1200 gtk_set_mouse_position (struct window *w, int x, int y)
|
|
1201 {
|
|
1202 struct frame *f = XFRAME (w->frame);
|
|
1203 Display *display = GDK_DISPLAY ();
|
|
1204 XWarpPointer (display, None,
|
|
1205 GDK_WINDOW_XWINDOW (GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f))),
|
|
1206 0, 0, 0, 0, w->pixel_left + x, w->pixel_top + y);
|
|
1207 }
|
|
1208 #endif /* STUPID_X_SPECIFIC_GTK_STUFF */
|
|
1209
|
|
1210 static int
|
|
1211 gtk_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
|
|
1212 {
|
|
1213 /* Returns the pixel position within the editor text widget */
|
|
1214 gint win_x, win_y;
|
|
1215 GdkWindow *w = gdk_window_at_pointer (&win_x, &win_y);
|
|
1216 struct frame *f = NULL;
|
|
1217
|
|
1218 if (!w) return (0);
|
|
1219
|
|
1220 /* At this point, w is the innermost GdkWindow containing the
|
|
1221 ** pointer and win_x and win_y are the coordinates of that window.
|
|
1222 */
|
|
1223 f = gtk_any_window_to_frame (d, w);
|
|
1224
|
|
1225 if (!f) return (0);
|
|
1226
|
793
|
1227 *frame = wrap_frame (f);
|
462
|
1228
|
|
1229 gdk_window_get_pointer (GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f)),
|
|
1230 &win_x, &win_y, NULL);
|
|
1231
|
|
1232 *x = win_x;
|
|
1233 *y = win_y;
|
|
1234
|
|
1235 return (1);
|
|
1236 }
|
|
1237
|
2268
|
1238 static DECLARE_DOESNT_RETURN (gtk_cant_notify_wm_error (void));
|
|
1239
|
|
1240 static DOESNT_RETURN
|
|
1241 gtk_cant_notify_wm_error ()
|
462
|
1242 {
|
563
|
1243 signal_error (Qgui_error, "Can't notify window manager of iconification", Qunbound);
|
462
|
1244 }
|
|
1245
|
|
1246 /* Raise frame F. */
|
|
1247 static void
|
|
1248 gtk_raise_frame_1 (struct frame *f, int force)
|
|
1249 {
|
|
1250 if (FRAME_VISIBLE_P (f) || force)
|
|
1251 {
|
|
1252 GdkWindow *emacs_window = GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (f));
|
|
1253
|
|
1254 gdk_window_raise (emacs_window);
|
|
1255 }
|
|
1256 }
|
|
1257
|
|
1258 static void
|
|
1259 gtk_raise_frame (struct frame *f)
|
|
1260 {
|
|
1261 gtk_raise_frame_1 (f, 1);
|
|
1262 }
|
|
1263
|
|
1264 /* Lower frame F. */
|
|
1265 static void
|
|
1266 gtk_lower_frame (struct frame *f)
|
|
1267 {
|
|
1268 if (FRAME_VISIBLE_P (f))
|
|
1269 {
|
|
1270 gdk_window_lower (GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (f)));
|
|
1271 }
|
|
1272 }
|
|
1273
|
|
1274 /* Change from withdrawn state to mapped state. */
|
|
1275 static void
|
|
1276 gtk_make_frame_visible (struct frame *f)
|
|
1277 {
|
2195
|
1278 gtk_widget_map (FRAME_GTK_SHELL_WIDGET (f));
|
462
|
1279 gtk_raise_frame_1 (f, 0);
|
|
1280 }
|
|
1281
|
|
1282 /* Change from mapped state to withdrawn state. */
|
|
1283 static void
|
|
1284 gtk_make_frame_invisible (struct frame *f)
|
|
1285 {
|
2195
|
1286 gtk_widget_unmap(FRAME_GTK_SHELL_WIDGET (f));
|
462
|
1287 }
|
|
1288
|
|
1289 static int
|
|
1290 gtk_frame_visible_p (struct frame *f)
|
|
1291 {
|
|
1292 GtkWidget *w = FRAME_GTK_SHELL_WIDGET (f);
|
|
1293
|
|
1294 f->visible = (GTK_OBJECT_FLAGS (w) & GTK_VISIBLE);
|
|
1295
|
|
1296 return f->visible;
|
|
1297 }
|
|
1298
|
|
1299 static int
|
|
1300 gtk_frame_totally_visible_p (struct frame *f)
|
|
1301 {
|
|
1302 return FRAME_GTK_TOTALLY_VISIBLE_P (f);
|
|
1303 }
|
|
1304
|
|
1305 /* Change window state from mapped to iconified. */
|
|
1306 static void
|
|
1307 gtk_iconify_frame (struct frame *f)
|
|
1308 {
|
|
1309 GdkWindow *w = GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (f));
|
|
1310
|
|
1311 /* There is no equivalent to XIconifyWindow in Gtk/Gdk. */
|
|
1312 if (!XIconifyWindow (GDK_WINDOW_XDISPLAY (w),
|
|
1313 GDK_WINDOW_XWINDOW (w),
|
|
1314 DefaultScreen (GDK_WINDOW_XDISPLAY (w))))
|
|
1315 gtk_cant_notify_wm_error ();
|
|
1316
|
|
1317 f->iconified = 1;
|
|
1318 }
|
|
1319
|
|
1320 /* Sets the X focus to frame f. */
|
|
1321 static void
|
|
1322 gtk_focus_on_frame (struct frame *f)
|
|
1323 {
|
|
1324 GtkWidget *shell_widget;
|
|
1325
|
|
1326 assert (FRAME_GTK_P (f));
|
|
1327
|
|
1328 shell_widget = FRAME_GTK_SHELL_WIDGET (f);
|
|
1329 if (!GET_GTK_WIDGET_WINDOW (shell_widget))
|
|
1330 return;
|
|
1331
|
|
1332 gtk_widget_grab_focus (shell_widget);
|
|
1333 }
|
|
1334
|
|
1335 /* Destroy the window of frame S. */
|
|
1336 static void
|
|
1337 gtk_delete_frame (struct frame *f)
|
|
1338 {
|
|
1339 GtkWidget *w = FRAME_GTK_SHELL_WIDGET (f);
|
|
1340
|
|
1341 gtk_widget_destroy (w);
|
|
1342
|
|
1343 if (FRAME_GTK_GEOM_FREE_ME_PLEASE (f))
|
1726
|
1344 xfree (FRAME_GTK_GEOM_FREE_ME_PLEASE (f), char *);
|
|
1345 xfree (f->frame_data, void *);
|
462
|
1346 f->frame_data = 0;
|
|
1347 }
|
|
1348
|
|
1349 static void
|
|
1350 gtk_recompute_cell_sizes (struct frame *frm)
|
|
1351 {
|
|
1352 if (GTK_IS_WINDOW (FRAME_GTK_SHELL_WIDGET (frm)))
|
|
1353 {
|
|
1354 GtkWindow *w = GTK_WINDOW (FRAME_GTK_SHELL_WIDGET (frm));
|
|
1355 GdkGeometry geometry;
|
|
1356 GdkWindowHints geometry_mask;
|
|
1357 gint width_inc = 10;
|
|
1358 gint height_inc = 10;
|
|
1359
|
771
|
1360 default_face_height_and_width (wrap_frame (frm), &height_inc, &width_inc);
|
462
|
1361 geometry_mask = GDK_HINT_RESIZE_INC;
|
|
1362 geometry.width_inc = width_inc;
|
|
1363 geometry.height_inc = height_inc;
|
|
1364
|
|
1365 gtk_window_set_geometry_hints (w, FRAME_GTK_TEXT_WIDGET (frm), &geometry, geometry_mask);
|
|
1366 }
|
|
1367 }
|
|
1368
|
|
1369 static void
|
|
1370 gtk_update_frame_external_traits (struct frame* frm, Lisp_Object name)
|
|
1371 {
|
|
1372 Lisp_Object frame = Qnil;
|
|
1373
|
793
|
1374 frame = wrap_frame (frm);
|
462
|
1375
|
|
1376 if (EQ (name, Qforeground))
|
|
1377 {
|
|
1378 Lisp_Object color = FACE_FOREGROUND (Vdefault_face, frame);
|
|
1379 GdkColor *fgc;
|
|
1380
|
|
1381 if (!EQ (color, Vthe_null_color_instance))
|
|
1382 {
|
|
1383 fgc = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (color));
|
|
1384 /* #### BILL!!! The X code set the XtNforeground property of
|
|
1385 the text widget here. Why did they bother? All that type
|
|
1386 of thing is done down in the guts of the redisplay code,
|
|
1387 not in the Emacs* widgets. */
|
|
1388 }
|
|
1389 }
|
|
1390 else if (EQ (name, Qbackground))
|
|
1391 {
|
|
1392 Lisp_Object color = FACE_BACKGROUND (Vdefault_face, frame);
|
|
1393 GdkColor *bgc;
|
|
1394
|
|
1395 if (!EQ (color, Vthe_null_color_instance))
|
|
1396 {
|
|
1397 bgc = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (color));
|
|
1398 if (FRAME_GTK_SHELL_WIDGET (frm)->window)
|
|
1399 {
|
|
1400 gdk_window_set_background (FRAME_GTK_SHELL_WIDGET (frm)->window, bgc);
|
|
1401 }
|
|
1402 if (FRAME_GTK_TEXT_WIDGET (frm)->window)
|
|
1403 {
|
|
1404 gdk_window_set_background (FRAME_GTK_TEXT_WIDGET (frm)->window, bgc);
|
|
1405 }
|
|
1406 }
|
|
1407
|
|
1408 /* Really crappy way to force the modeline shadows to be
|
|
1409 redrawn. But effective. */
|
|
1410 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (frm);
|
|
1411 MARK_FRAME_CHANGED (frm);
|
|
1412 }
|
|
1413 else if (EQ (name, Qfont))
|
|
1414 {
|
|
1415 Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii);
|
|
1416
|
|
1417 if (!EQ (font, Vthe_null_font_instance))
|
|
1418 {
|
|
1419 /* #### BILL!!! The X code set the XtNfont property of the
|
|
1420 text widget here. Why did they bother? All that type of
|
|
1421 thing is done down in the guts of the redisplay code, not
|
|
1422 in the Emacs* widgets. */
|
|
1423 }
|
|
1424 }
|
|
1425 else
|
2500
|
1426 ABORT ();
|
462
|
1427
|
|
1428 #ifdef HAVE_TOOLBARS
|
|
1429 /* Setting the background clears the entire frame area
|
|
1430 including the toolbar so we force an immediate redraw of
|
|
1431 it. */
|
|
1432 if (EQ (name, Qbackground))
|
|
1433 MAYBE_DEVMETH (XDEVICE (frm->device), redraw_frame_toolbars, (frm));
|
|
1434 #endif /* HAVE_TOOLBARS */
|
|
1435
|
|
1436 /* Set window manager resize increment hints according to
|
|
1437 the new character size */
|
|
1438 if (EQ (name, Qfont) && FRAME_GTK_TOP_LEVEL_FRAME_P (frm))
|
|
1439 gtk_recompute_cell_sizes (frm);
|
|
1440 }
|
|
1441
|
|
1442
|
|
1443 /************************************************************************/
|
|
1444 /* initialization */
|
|
1445 /************************************************************************/
|
|
1446
|
|
1447 void
|
|
1448 syms_of_frame_gtk (void)
|
|
1449 {
|
563
|
1450 DEFSYMBOL (Qtext_widget);
|
|
1451 DEFSYMBOL (Qcontainer_widget);
|
|
1452 DEFSYMBOL (Qshell_widget);
|
|
1453 DEFSYMBOL (Qdetachable_menubar);
|
462
|
1454
|
|
1455 #ifdef HAVE_DRAGNDROP
|
|
1456 staticpro (&Vcurrent_drag_object);
|
|
1457 Vcurrent_drag_object = Qnil;
|
|
1458 DEFSUBR (Fgtk_start_drag_internal);
|
|
1459 #endif
|
|
1460 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
1461 DEFSUBR (Fgtk_window_id);
|
|
1462 #endif
|
|
1463 }
|
|
1464
|
|
1465 void
|
|
1466 console_type_create_frame_gtk (void)
|
|
1467 {
|
|
1468 /* frame methods */
|
|
1469 CONSOLE_HAS_METHOD (gtk, init_frame_1);
|
|
1470 CONSOLE_HAS_METHOD (gtk, init_frame_2);
|
|
1471 CONSOLE_HAS_METHOD (gtk, init_frame_3);
|
|
1472 CONSOLE_HAS_METHOD (gtk, mark_frame);
|
|
1473 CONSOLE_HAS_METHOD (gtk, focus_on_frame);
|
|
1474 CONSOLE_HAS_METHOD (gtk, delete_frame);
|
|
1475 CONSOLE_HAS_METHOD (gtk, get_mouse_position);
|
|
1476 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
|
|
1477 CONSOLE_HAS_METHOD (gtk, set_mouse_position);
|
|
1478 #endif
|
|
1479 CONSOLE_HAS_METHOD (gtk, raise_frame);
|
|
1480 CONSOLE_HAS_METHOD (gtk, lower_frame);
|
|
1481 CONSOLE_HAS_METHOD (gtk, make_frame_visible);
|
|
1482 CONSOLE_HAS_METHOD (gtk, make_frame_invisible);
|
|
1483 CONSOLE_HAS_METHOD (gtk, iconify_frame);
|
|
1484 CONSOLE_HAS_METHOD (gtk, set_frame_size);
|
|
1485 CONSOLE_HAS_METHOD (gtk, set_frame_position);
|
|
1486 CONSOLE_HAS_METHOD (gtk, frame_property);
|
|
1487 CONSOLE_HAS_METHOD (gtk, internal_frame_property_p);
|
|
1488 CONSOLE_HAS_METHOD (gtk, frame_properties);
|
|
1489 CONSOLE_HAS_METHOD (gtk, set_frame_properties);
|
867
|
1490 CONSOLE_HAS_METHOD (gtk, set_title_from_ibyte);
|
|
1491 CONSOLE_HAS_METHOD (gtk, set_icon_name_from_ibyte);
|
462
|
1492 CONSOLE_HAS_METHOD (gtk, frame_visible_p);
|
|
1493 CONSOLE_HAS_METHOD (gtk, frame_totally_visible_p);
|
|
1494 CONSOLE_HAS_METHOD (gtk, frame_iconified_p);
|
|
1495 CONSOLE_HAS_METHOD (gtk, set_frame_pointer);
|
|
1496 CONSOLE_HAS_METHOD (gtk, set_frame_icon);
|
|
1497 CONSOLE_HAS_METHOD (gtk, get_frame_parent);
|
|
1498 CONSOLE_HAS_METHOD (gtk, update_frame_external_traits);
|
|
1499 }
|
|
1500
|
|
1501 void
|
|
1502 vars_of_frame_gtk (void)
|
|
1503 {
|
|
1504 DEFVAR_LISP ("default-gtk-frame-plist", &Vdefault_gtk_frame_plist /*
|
|
1505 Plist of default frame-creation properties for Gtk frames.
|
|
1506 These override what is specified in the resource database and in
|
|
1507 `default-frame-plist', but are overridden by the arguments to the
|
|
1508 particular call to `make-frame'.
|
|
1509
|
|
1510 Note: In many cases, properties of a frame are available as specifiers
|
|
1511 instead of through the frame-properties mechanism.
|
|
1512
|
|
1513 Here is a list of recognized frame properties, other than those
|
|
1514 documented in `set-frame-properties' (they can be queried and
|
|
1515 set at any time, except as otherwise noted):
|
|
1516
|
|
1517 initially-unmapped If non-nil, the frame will not be visible
|
|
1518 when it is created. In this case, you
|
|
1519 need to call `make-frame-visible' to make
|
|
1520 the frame appear.
|
|
1521 popup If non-nil, it should be a frame, and this
|
|
1522 frame will be created as a "popup" frame
|
|
1523 whose parent is the given frame. This
|
|
1524 will make the window manager treat the
|
|
1525 frame as a dialog box, which may entail
|
|
1526 doing different things (e.g. not asking
|
|
1527 for positioning, and not iconifying
|
|
1528 separate from its parent).
|
|
1529 inter-line-space Not currently implemented.
|
|
1530 toolbar-shadow-thickness Thickness of toolbar shadows.
|
|
1531 background-toolbar-color Color of toolbar background.
|
|
1532 bottom-toolbar-shadow-color Color of bottom shadows on toolbars.
|
|
1533 (*Not* specific to the bottom-toolbar.)
|
|
1534 top-toolbar-shadow-color Color of top shadows on toolbars.
|
|
1535 (*Not* specific to the top-toolbar.)
|
|
1536 internal-border-width Width of internal border around text area.
|
|
1537 border-width Width of external border around text area.
|
|
1538 top Y position (in pixels) of the upper-left
|
|
1539 outermost corner of the frame (i.e. the
|
|
1540 upper-left of the window-manager
|
|
1541 decorations).
|
|
1542 left X position (in pixels) of the upper-left
|
|
1543 outermost corner of the frame (i.e. the
|
|
1544 upper-left of the window-manager
|
|
1545 decorations).
|
|
1546 border-color Color of external border around text area.
|
|
1547 cursor-color Color of text cursor.
|
|
1548
|
|
1549 See also `default-frame-plist', which specifies properties which apply
|
|
1550 to all frames, not just Gtk frames.
|
|
1551 */ );
|
|
1552 Vdefault_gtk_frame_plist = Qnil;
|
|
1553
|
|
1554 gtk_console_methods->device_specific_frame_props = &Vdefault_gtk_frame_plist;
|
|
1555 }
|