annotate src/console-gtk.h @ 844:047d37eb70d7

[xemacs-hg @ 2002-05-16 13:30:23 by ben] ui fixes for things that were bothering me bytecode.c, editfns.c, lisp.h, lread.c: Fix save-restriction to use markers rather than pseudo-markers (integers representing the amount of text on either side of the region). That way, all inserts are handled correctly, not just those inside old restriction. Add buffer argument to save_restriction_save(). process.c: Clean up very dirty and kludgy code that outputs into a buffer -- use proper unwind protects, etc. font-lock.c: Do save-restriction/widen around the function -- otherwise, incorrect results will ensue when a buffer has been narrowed before a call to e.g. `buffer-syntactic-context' -- something that happens quite often. fileio.c: Look for a handler for make-temp-name. window.c, winslots.h: Try to solve this annoying problem: have two frames displaying the buffer, in different places; in one, temporarily switch away to another buffer and then back -- and you've lost your position; it's reset to the other one in the other frame. My current solution involves window-level caches of buffers and points (also a cache for window-start); when set-window-buffer is called, it looks to see if the buffer was previously visited in the window, and if so, uses the most recent point at that time. (It's a marker, so it handles changes.) #### Note: It could be argued that doing it on the frame level would be better -- e.g. if you visit a buffer temporarily through a grep, and then go back to that buffer, you presumably want the grep's position rather than some previous position provided everything was in the same frame, even though the grep was in another window in the frame. However, doing it on the frame level fails when you have two windows on the same frame. Perhaps we keep both a window and a frame cache, and use the frame cache if there are no other windows on the frame showing the buffer, else the window's cache? This is probably something to be configurable using a specifier. Suggestions please please please? window.c: Clean up a bit code that deals with the annoyance of window-point vs. point. dialog.el: Function to ask a multiple-choice question, automatically choosing a dialog box or minibuffer representation as necessary. Generalized version of yes-or-no-p, y-or-n-p. files.el: Use get-user-response to ask "yes/no/diff" question when recovering. "diff" means that a diff is displayed between the current file and the autosave. (Converts/deconverts escape-quoted as necessary. No more complaints from you, Mr. Turnbull!) One known problem: when a dialog is used, it's modal, so you can't scroll the diff. Will fix soon. lisp-mode.el: If we're filling a string, don't treat semicolon as a comment, which would give very unfriendly results. Uses `buffer-syntactic-context'. simple.el: all changes back to the beginning. (Useful if you've saved the file in the middle of the changes.) simple.el: Add option kill-word-into-kill-ring, which controls whether words deleted with kill-word, backward-kill-word, etc. are "cut" into the kill ring, or "cleared" into nothingness. (My preference is the latter, by far. I'd almost go so far as suggesting we make it the default, as you can always select a word and then cut it if you want it cut.) menubar-items.el: Add option corresponding to kill-word-into-kill-ring.
author ben
date Thu, 16 May 2002 13:30:58 +0000
parents 2923009caf47
children 804517e16990
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_shadows (struct frame *f, int x, int y, int width,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226 int height, int shadow_thickness);
714
02339d4ebed4 [xemacs-hg @ 2001-12-23 20:28:19 by wmperry]
wmperry
parents: 462
diff changeset
227 GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
02339d4ebed4 [xemacs-hg @ 2001-12-23 20:28:19 by wmperry]
wmperry
parents: 462
diff changeset
228 Lisp_Object bg_pmap, Lisp_Object lwidth);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
230 int gtk_initialize_frame_menubar (struct frame *f);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 void gtk_init_modifier_mapping (struct device *d);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233 void Initialize_Locale (void);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 extern Lisp_Object Vgtk_initial_argv_list; /* #### ugh! */
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 const char *gtk_event_name (GdkEventType event_type);
778
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
238
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
239 void reinit_console_type_create_gtk (void);
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
240
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
241 void emacs_gtk_selection_handle (GtkWidget *,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
242 GtkSelectionData *selection_data,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
243 guint info,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
244 guint time_stamp,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
245 gpointer data);
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
246 void emacs_gtk_selection_clear_event_handle (GtkWidget *widget,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
247 GdkEventSelection *event,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
248 gpointer data);
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
249 void emacs_gtk_selection_received (GtkWidget *widget,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
250 GtkSelectionData *selection_data,
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
251 gpointer user_data);
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 714
diff changeset
252
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253 #endif /* HAVE_GTK */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254 #endif /* _XEMACS_DEVICE_X_H_ */