annotate src/console-gtk.h @ 617:af57a77cbc92

[xemacs-hg @ 2001-06-18 07:09:50 by ben] --------------------------------------------------------------- DOCUMENTATION FIXES: --------------------------------------------------------------- eval.c: Correct documentation. elhash.c: Doc correction. --------------------------------------------------------------- LISP OBJECT CLEANUP: --------------------------------------------------------------- bytecode.h, buffer.h, casetab.h, chartab.h, console-msw.h, console.h, database.c, device.h, eldap.h, elhash.h, events.h, extents.h, faces.h, file-coding.h, frame.h, glyphs.h, gui-x.h, gui.h, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lrecord.h, lstream.h, mule-charset.h, objects.h, opaque.h, postgresql.h, process.h, rangetab.h, specifier.h, toolbar.h, tooltalk.h, ui-gtk.h: Add wrap_* to all objects (it was already there for a few of them) -- an expression to encapsulate a pointer into a Lisp object, rather than the inconvenient XSET*. "wrap" was chosen because "make" as in make_int(), make_char() is not appropriate. (It implies allocation. The issue does not exist for ints and chars because they are not allocated.) Full error checking has been added to these expressions. When used without error checking, non-union build, use of these expressions will incur no loss of efficiency. (In fact, XSET* is now defined in terms of wrap_* in a non-union build.) In a union build, you will also get no loss of efficiency provided that you have a decent optimizing compiler, and a compiler that either understands inlines or automatically inlines those particular functions. (And since people don't normally do their production builds on union, it doesn't matter.) Update the sample Lisp object definition in lrecord.h accordingly. dumper.c: Fix places in dumper that referenced wrap_object to reference its new name, wrap_pointer_1. buffer.c, bufslots.h, conslots.h, console.c, console.h, devslots.h, device.c, device.h, frame.c, frame.h, frameslots.h, window.c, window.h, winslots.h: -- Extract out the Lisp objects of `struct device' into devslots.h, just like for the other structures. -- Extract out the remaining (not copied into the window config) Lisp objects in `struct window' into winslots.h; use different macros (WINDOW_SLOT vs. WINDOW_SAVED_SLOT) to differentiate them. -- Eliminate the `dead' flag of `struct frame', since it duplicates information already available in `framemeths', and fix FRAME_LIVE_P accordingly. (Devices and consoles already work this way.) -- In *slots.h, switch to system where MARKED_SLOT is automatically undef'd at the end of the file. (Follows what winslots.h already does.) -- Update the comments at the beginning of *slots.h to be accurate. -- When making any of the above objects dead, zero it out entirely and reset all Lisp object slots to Qnil. (We were already doing this somewhat, but not consistently.) This (1) Eliminates the possibility of extra objects hanging around that ought to be GC'd, (2) Causes an immediate crash if anyone tries to access a structure in one of these objects, (3) Ensures consistent behavior wrt dead objects. dialog-msw.c: Use internal_object_printer, since this object should not escape. --------------------------------------------------------------- FIXING A CRASH THAT I HIT ONCE (AND A RELATED BAD BEHAVIOR): --------------------------------------------------------------- eval.c: Fix up some comments about the FSF implementation. Fix two nasty bugs: (1) condition_case_unwind frees the conses sitting in the catch->tag slot too quickly, resulting in a crash that I hit. (2) catches need to be unwound one at a time when calling unwind-protect code, rather than all at once at the end; otherwise, incorrect behavior can result. (A comment shows exactly how.) backtrace.h: Improve comment about FSF differences in the handler stack. --------------------------------------------------------------- FIXING A CRASH THAT I REPEATEDLY HIT WHEN USING THE MOUSE WHEEL UNDER MSWINDOWS: --------------------------------------------------------------- Basic idea: My crash is due either to a dead, non-marked, GC-collected frame inside of a window mirror, or a prematurely freed window mirror. We need to mark the Lisp objects inside of window mirrors. Tracking the lifespan of window mirrors and scrollbar instances is extremely hard, and there may well be lurking bugs where such objects are freed too soon. The only safe way to fix these problems (and it fixes both problems at once) is to make both of these structures Lisp objects. lrecord.h, emacs.c, inline.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, symsinit.h: Make scrollbar instances actual Lisp objects. Mark the window mirrors in them. inline.c needs to know about scrollbar.h now. Record the new type in lrecord.h. Fix up scrollbar-*.c appropriately. Create a hash table in scrollbar-msw.c so that the scrollbar instances stored in scrollbar HWND's are properly GC-protected. Create complex_vars_of_scrollbar_mswindows() to create the hash table at startup, and call it from emacs.c. Don't store the scrollbar instance as a property of the GTK scrollbar, as it's not used and if we did this, we'd have to separately GC-protect it in a hash table, like in MS Windows. lrecord.h, frame.h, frame.c, frameslots.h, redisplay.c, window.c, window.h: Move mark_window_mirror from redisplay.c to window.c. Make window mirrors actual Lisp objects. Tell lrecord.h about them. Change the window mirror member of struct frame from a pointer to a Lisp object, and add XWINDOW_MIRROR in appropriate places. Mark the scrollbar instances in the window mirror. redisplay.c, redisplay.h, alloc.c: Delete mark_redisplay. Don't call mark_redisplay. We now mark frame-specific structures in mark_frame. NOTE: I also deleted an extremely questionable call to update_frame_window_mirrors(). It was extremely questionable before, and now totally impossible, since it will create Lisp objects during redisplay. frame.c: Mark the scrollbar instances, which are now Lisp objects. Call mark_gutter() here, not in mark_redisplay(). gutter.c: Update comments about correct marking. --------------------------------------------------------------- ISSUES BROUGHT UP BY MARTIN: --------------------------------------------------------------- buffer.h: Put back these macros the way Steve T and I think they ought to be. I already explained in a previous changelog entry why I think these macros should be the way I'd defined them. Once again: We fix these macros so they don't care about the type of their lvalues. The non-C-string equivalents of these already function in the same way, and it's correct because it should be OK to pass in a CBufbyte *, a BufByte *, a Char_Binary *, an UChar_Binary *, etc. The whole reason for these different types is to work around errors caused by signed-vs-unsigned non-matching types. Any possible error that might be caught in a DFC macro would also be caught wherever the argument is used elsewhere. So creating multiple macro versions would add no useful error-checking and just further complicate an already complicated area. As for Martin's "ANSI aliasing" bug, XEmacs is not ANSI-aliasing clean and probably never will be. Unless the board agrees to change XEmacs in this way (and we really don't want to go down that road), this is not a bug. sound.h: Undo Martin's type change. signal.c: Fix problem identified by Martin with Linux and g++ due to non-standard declaration of setitimer(). systime.h: Update the docs for "qxe_" to point out why making the encapsulation explicit is always the right way to go. (setitimer() itself serves as an example.) For 21.4: update-elc-2.el: Correct misplaced parentheses, making lisp/mule not get recompiled.
author ben
date Mon, 18 Jun 2001 07:10:32 +0000
parents 0784d089fdc9
children 02339d4ebed4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 /* Define X specific console, device, and frame object for XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5 This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10 later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15 for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25 /* Authorship:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
27 Ultimately based on FSF, then later on JWZ work for Lemacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28 Rewritten over time by Ben Wing and Chuck Thompson (original
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 multi-device work by Chuck Thompson).
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32 #ifndef _XEMACS_CONSOLE_GTK_H_
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 #define _XEMACS_CONSOLE_GTK_H_
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
35 #ifdef HAVE_GTK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
36
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 #include "console.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 #include <gtk/gtk.h>
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 #define GDK_DRAWABLE(x) (GdkDrawable *) (x)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 #define GET_GTK_WIDGET_WINDOW(x) (GTK_WIDGET (x)->window)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 #define GET_GTK_WIDGET_PARENT(x) (GTK_WIDGET (x)->parent)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 DECLARE_CONSOLE_TYPE (gtk);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 struct gtk_device
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 /* Gtk application info. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 GtkWidget *gtk_app_shell;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 /* Cache of GC's for frame's on this device. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 struct gc_cache *gc_cache;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 /* Selected visual, depth and colormap for this device */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 GdkVisual *visual;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 int depth;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 GdkColormap *device_cmap;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 /* Used by x_bevel_modeline in redisplay-x.c */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 GdkBitmap *gray_pixmap;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 /* frame that holds the WM_COMMAND property; there should be exactly
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 one of these per device. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 Lisp_Object WM_COMMAND_frame;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 /* The following items are all used exclusively in event-gtk.c. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 int MetaMask, HyperMask, SuperMask, AltMask, ModeMask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 guint lock_interpretation;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 void *x_modifier_keymap; /* Really an (XModifierKeymap *)*/
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 guint *x_keysym_map;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 int x_keysym_map_min_code;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 int x_keysym_map_max_code;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 int x_keysym_map_keysyms_per_code;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 Lisp_Object x_keysym_map_hashtable;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 /* #### It's not clear that there is much distinction anymore
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 between mouse_timestamp and global_mouse_timestamp, now that
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 Emacs doesn't see most (all?) events not destined for it. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 /* The timestamp of the last button or key event used by emacs itself.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 This is used for asserting selections and input focus. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 guint32 mouse_timestamp;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86 /* This is the timestamp the last button or key event whether it was
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 dispatched to emacs or widgets. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 guint32 global_mouse_timestamp;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 /* This is the last known timestamp received from the server. It is
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 maintained by x_event_to_emacs_event and used to patch bogus
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 WM_TAKE_FOCUS messages sent by Mwm. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 guint32 last_server_timestamp;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 GdkAtom atom_WM_PROTOCOLS;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 GdkAtom atom_WM_TAKE_FOCUS;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 GdkAtom atom_WM_STATE;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 #if 0
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 /* #### BILL!!! */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 /* stuff for sticky modifiers: */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 unsigned int need_to_add_mask, down_mask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 KeyCode last_downkey;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 guint32 release_time;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 #endif
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 };
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 #define DEVICE_GTK_DATA(d) DEVICE_TYPE_DATA (d, gtk)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 #define DEVICE_GTK_VISUAL(d) (DEVICE_GTK_DATA (d)->visual)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 #define DEVICE_GTK_DEPTH(d) (DEVICE_GTK_DATA (d)->depth)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 #define DEVICE_GTK_COLORMAP(d) (DEVICE_GTK_DATA (d)->device_cmap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 #define DEVICE_GTK_APP_SHELL(d) (DEVICE_GTK_DATA (d)->gtk_app_shell)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 #define DEVICE_GTK_GC_CACHE(d) (DEVICE_GTK_DATA (d)->gc_cache)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 #define DEVICE_GTK_GRAY_PIXMAP(d) (DEVICE_GTK_DATA (d)->gray_pixmap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 #define DEVICE_GTK_WM_COMMAND_FRAME(d) (DEVICE_GTK_DATA (d)->WM_COMMAND_frame)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 #define DEVICE_GTK_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->mouse_timestamp)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 #define DEVICE_GTK_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->global_mouse_timestamp)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 #define DEVICE_GTK_LAST_SERVER_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->last_server_timestamp)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 /* The maximum number of widgets that can be displayed above the text
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 area at one time. Currently no more than 3 will ever actually be
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 displayed (menubar, psheet, debugger panel). */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 #define MAX_CONCURRENT_TOP_WIDGETS 8
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 struct gtk_frame
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 /* The widget of this frame. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 GtkWidget *widget; /* This is really a GtkWindow */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 /* The layout manager */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132 GtkWidget *container; /* actually a GtkVBox. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 /* The widget of the menubar */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135 GtkWidget *menubar_widget;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 /* The widget of the edit portion of this frame; this is a GtkDrawingArea,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138 and the window of this widget is what the redisplay code draws on. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 GtkWidget *edit_widget;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 /* Lists the widgets above the text area, in the proper order. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 GtkWidget *top_widgets[MAX_CONCURRENT_TOP_WIDGETS];
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 int num_top_widgets;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 /* Our container widget as a Lisp_Object */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 Lisp_Object lisp_visible_widgets[10];
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 /*************************** Miscellaneous **************************/
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150 /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151 Lisp_Object icon_pixmap;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 Lisp_Object icon_pixmap_mask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 /* geometry string that ought to be freed. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 char *geom_free_me_please;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
156
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
157 /* 1 if the frame is completely visible on the display, 0 otherwise.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 if 0 the frame may have been iconified or may be totally
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159 or partially hidden by another X window */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160 unsigned int totally_visible_p :1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 /* Is it visible at all? */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163 unsigned int visible_p :1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 /* Are we a top-level frame? This means that our shell is a
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 TopLevelShell, and we should do certain things to interact with
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 the window manager. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 unsigned int top_level_frame_p :1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170 /* Are we iconfied right now? */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 unsigned int iconified_p :1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 };
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 #define FRAME_GTK_DATA(f) FRAME_TYPE_DATA (f, gtk)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177 #define FRAME_GTK_SHELL_WIDGET(f) (FRAME_GTK_DATA (f)->widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 #define FRAME_GTK_CONTAINER_WIDGET(f) (FRAME_GTK_DATA (f)->container)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179 #define FRAME_GTK_MENUBAR_WIDGET(f) (FRAME_GTK_DATA (f)->menubar_widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 #define FRAME_GTK_TEXT_WIDGET(f) (FRAME_GTK_DATA (f)->edit_widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181 #define FRAME_GTK_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->top_widgets)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 #define FRAME_GTK_NUM_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->num_top_widgets)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183 #define FRAME_GTK_ICONIFIED_P(f) (FRAME_GTK_DATA (f)->iconfigied_p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185 #define FRAME_GTK_LISP_WIDGETS(f) (FRAME_GTK_DATA (f)->lisp_visible_widgets)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 #define FRAME_GTK_ICON_PIXMAP(f) (FRAME_GTK_DATA (f)->icon_pixmap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187 #define FRAME_GTK_ICON_PIXMAP_MASK(f) (FRAME_GTK_DATA (f)->icon_pixmap_mask)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
189 #define FRAME_GTK_GEOM_FREE_ME_PLEASE(f) (FRAME_GTK_DATA (f)->geom_free_me_please)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
190
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
191 #define FRAME_GTK_TOTALLY_VISIBLE_P(f) (FRAME_GTK_DATA (f)->totally_visible_p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 #define FRAME_GTK_VISIBLE_P(f) (FRAME_GTK_DATA (f)->visible_p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193 #define FRAME_GTK_TOP_LEVEL_FRAME_P(f) (FRAME_GTK_DATA (f)->top_level_frame_p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
194
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195 /* Variables associated with the X display frame this emacs is using. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 extern Lisp_Object Vx_gc_pointer_shape;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
198 extern Lisp_Object Vx_scrollbar_pointer_shape;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
199
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 extern struct console_type *gtk_console_type;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201 extern Lisp_Object Vdefault_gtk_device;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203 /* Number of pixels below each line. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 extern int gtk_interline_space;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206 extern int gtk_selection_timeout;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 struct frame *gtk_any_window_to_frame (struct device *d, GdkWindow *);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209 struct frame *gtk_window_to_frame (struct device *d, GdkWindow *);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 struct frame *gtk_any_widget_or_parent_to_frame (struct device *d, GtkWidget *widget);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211 struct frame *decode_gtk_frame (Lisp_Object);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 struct device *gtk_any_window_to_device (GdkWindow *);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213 struct device *decode_gtk_device (Lisp_Object);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214 void gtk_handle_property_notify (GdkEventProperty *event);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
215
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
216 void signal_special_gtk_user_event (Lisp_Object channel, Lisp_Object function,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217 Lisp_Object object);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 void gtk_redraw_exposed_area (struct frame *f, int x, int y,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
219 int width, int height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
220 void gtk_output_string (struct window *w, struct display_line *dl,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221 Emchar_dynarr *buf, int xpos, int xoffset,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
222 int start_pixpos, int width, face_index findex,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
223 int cursor, int cursor_start, int cursor_width,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
224 int cursor_height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225 void gtk_output_gdk_pixmap (struct frame *f, struct Lisp_Image_Instance *p,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226 int x, int y, int clip_x, int clip_y,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
227 int clip_width, int clip_height, int width,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 int height, int pixmap_offset,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229 GdkColor *fg, GdkColor *bg,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
230 GdkGC *override_gc);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 void gtk_output_shadows (struct frame *f, int x, int y, int width,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 int height, int shadow_thickness);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234 int gtk_initialize_frame_menubar (struct frame *f);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 void gtk_init_modifier_mapping (struct device *d);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237 void Initialize_Locale (void);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
238
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
239 extern Lisp_Object Vgtk_initial_argv_list; /* #### ugh! */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241 const char *gtk_event_name (GdkEventType event_type);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
242 #endif /* HAVE_GTK */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
243 #endif /* _XEMACS_DEVICE_X_H_ */