428
|
1 /* Define X specific console, device, and frame object for XEmacs.
|
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
|
1318
|
4 Copyright (C) 1996, 2002, 2003 Ben Wing.
|
428
|
5
|
|
6 This file is part of XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: Not in FSF. */
|
|
24
|
|
25
|
|
26 /* Authorship:
|
|
27
|
|
28 Ultimately based on FSF, then later on JWZ work for Lemacs.
|
|
29 Rewritten over time by Ben Wing and Chuck Thompson (original
|
|
30 multi-device work by Chuck Thompson).
|
|
31 */
|
|
32
|
440
|
33 #ifndef INCLUDED_console_x_h_
|
|
34 #define INCLUDED_console_x_h_
|
428
|
35
|
|
36 #ifdef HAVE_X_WINDOWS
|
|
37
|
|
38 #include "console.h"
|
2484
|
39 /* must come before Xutil.h, which is included indirectly from xintrinsic.h,
|
|
40 to avoid breakage in keysym-parsing macros from X11R6, at least X.org as
|
|
41 of 2005-01-17, and probably XFree86 too from reports on c.e.x */
|
|
42 #include <X11/keysym.h>
|
428
|
43 #include "xintrinsic.h"
|
1346
|
44 #include "../lwlib/lwlib.h"
|
428
|
45
|
|
46 #include <X11/cursorfont.h>
|
|
47 #include <X11/Xatom.h>
|
|
48 #include <X11/StringDefs.h>
|
|
49
|
|
50 #ifdef HAVE_XPM
|
|
51 #include <X11/xpm.h>
|
|
52 #endif
|
|
53
|
|
54 /* R5 defines the XPointer type, but R4 doesn't.
|
|
55 R4 also doesn't define a version number, but R5 does. */
|
|
56 #if (XlibSpecificationRelease < 5)
|
|
57 # define XPointer char *
|
|
58 #endif
|
|
59
|
|
60 #define Xt_SET_VALUE(widget, resource, value) do { \
|
|
61 Arg al; \
|
|
62 XtSetArg (al, resource, value); \
|
|
63 XtSetValues (widget, &al, 1); \
|
|
64 } while (0)
|
|
65
|
|
66 #define Xt_GET_VALUE(widget, resource, location) do { \
|
|
67 Arg al; \
|
|
68 XtSetArg (al, resource, location); \
|
|
69 XtGetValues (widget, &al, 1); \
|
|
70 } while (0)
|
|
71
|
1204
|
72 #ifdef __cplusplus
|
|
73 #define X_CLASSFIELD c_class
|
|
74 #else
|
|
75 #define X_CLASSFIELD class
|
|
76 #endif
|
|
77
|
428
|
78 /* Variables associated with the X display frame this emacs is using. */
|
|
79 extern XtAppContext Xt_app_con;
|
|
80
|
|
81 extern Lisp_Object Vx_gc_pointer_shape;
|
|
82 extern Lisp_Object Vx_scrollbar_pointer_shape;
|
|
83 extern Lisp_Object Qx_error;
|
|
84
|
|
85 /* Number of pixels below each line. */
|
|
86 extern int x_interline_space; /* #### implement me */
|
|
87
|
458
|
88 extern Fixnum x_selection_timeout;
|
428
|
89
|
|
90 struct frame *x_any_window_to_frame (struct device *d, Window);
|
|
91 struct frame *x_any_widget_or_parent_to_frame (struct device *d,
|
|
92 Widget widget);
|
|
93 struct frame *decode_x_frame (Lisp_Object);
|
|
94 struct frame *x_window_to_frame (struct device *d, Window);
|
|
95 struct device *get_device_from_display (Display *dpy);
|
|
96 struct device *decode_x_device (Lisp_Object);
|
|
97
|
|
98 void x_handle_selection_notify (XSelectionEvent *event);
|
|
99 void x_handle_selection_request (XSelectionRequestEvent *event);
|
|
100 void x_handle_selection_clear (XSelectionClearEvent *event);
|
|
101 void x_handle_property_notify (XPropertyEvent *event);
|
|
102
|
440
|
103 void Xatoms_of_select_x (struct device *d);
|
428
|
104 void Xatoms_of_objects_x (struct device *d);
|
|
105
|
|
106 void x_wm_set_shell_iconic_p (Widget shell, int iconic_p);
|
|
107 void x_wm_set_cell_size (Widget wmshell, int cw, int ch);
|
|
108 void x_wm_set_variable_size (Widget wmshell, int width, int height);
|
|
109
|
442
|
110 const char *x_event_name (int event_type);
|
1204
|
111 int check_if_pending_expose_event (struct device *d);
|
428
|
112 int x_error_handler (Display *disp, XErrorEvent *event);
|
|
113 void expect_x_error (Display *dpy);
|
|
114 int x_error_occurred_p (Display *dpy);
|
|
115 int signal_if_x_error (Display *dpy, int resumable_p);
|
|
116 int x_IO_error_handler (Display *disp);
|
|
117
|
1346
|
118 widget_value *xmalloc_widget_value (void);
|
|
119
|
|
120 LWLIB_ID new_lwlib_id (void);
|
|
121
|
|
122 void gcpro_popup_callbacks (LWLIB_ID id);
|
|
123 void ungcpro_popup_callbacks (LWLIB_ID id);
|
|
124 int popup_handled_p (LWLIB_ID id);
|
|
125 void free_popup_widget_value_tree (widget_value *wv);
|
|
126 void popup_selection_callback (Widget widget, LWLIB_ID ignored_id,
|
|
127 XtPointer client_data);
|
|
128 Extbyte *add_accel_and_to_external (Lisp_Object string);
|
|
129 int button_item_to_widget_value (Lisp_Object gui_object_instance,
|
|
130 Lisp_Object gui_item, widget_value *wv,
|
|
131 int allow_text_field_p, int no_keys_p,
|
|
132 int menu_entry_p, int accel_p);
|
|
133 widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance,
|
|
134 Lisp_Object items, int accel_p);
|
|
135 Extbyte *menu_separator_style_and_to_external (const Ibyte *s);
|
|
136 Lisp_Object widget_value_unwind (Lisp_Object closure);
|
|
137
|
428
|
138 void x_output_string (struct window *w, struct display_line *dl,
|
867
|
139 Ichar_dynarr *buf, int xpos, int xoffset,
|
428
|
140 int start_pixpos, int width, face_index findex,
|
|
141 int cursor, int cursor_start, int cursor_width,
|
|
142 int cursor_height);
|
440
|
143 void x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p,
|
428
|
144 int x, int y, int xoffset, int yoffset,
|
|
145 int width, int height,
|
|
146 unsigned long fg, unsigned long bg,
|
|
147 GC override_gc);
|
|
148 void x_output_shadows (struct frame *f, int x, int y, int width,
|
|
149 int height, GC top_shadow_gc,
|
|
150 GC bottom_shadow_gc, GC background_gc,
|
|
151 int shadow_thickness, int edges);
|
|
152 void x_generate_shadow_pixels (struct frame *f,
|
|
153 unsigned long *top_shadow,
|
|
154 unsigned long *bottom_shadow,
|
|
155 unsigned long background,
|
|
156 unsigned long core_background);
|
|
157
|
|
158 int x_initialize_frame_menubar (struct frame *f);
|
|
159 void x_init_modifier_mapping (struct device *d);
|
|
160
|
593
|
161 int x_frame_window_state (struct frame *f);
|
|
162
|
428
|
163 #define X_ERROR_OCCURRED(dpy, body) \
|
|
164 (expect_x_error (dpy), body, x_error_occurred_p (dpy))
|
|
165
|
|
166 #define HANDLING_X_ERROR(dpy, body) \
|
|
167 (expect_x_error (dpy), body, signal_if_x_error (dpy, 0))
|
|
168
|
|
169 void Initialize_Locale (void);
|
|
170
|
|
171 #ifdef HAVE_XIM
|
|
172
|
|
173 /* X Input Method `methods' */
|
|
174 void XIM_init_device (struct device *d);
|
|
175 void XIM_init_frame (struct frame *f);
|
|
176 void XIM_SetSpotLocation (struct frame *f, int x, int y);
|
|
177 void XIM_SetGeometry (struct frame *f);
|
|
178 void XIM_focus_event (struct frame *f, int in_p);
|
|
179
|
|
180 #ifdef XIM_XLIB
|
|
181 /* XtTypeConverter */
|
|
182 Boolean EmacsXtCvtStringToXIMStyles (
|
|
183 Display *dpy,
|
|
184 XrmValuePtr args,
|
|
185 Cardinal *num_args,
|
|
186 XrmValuePtr from,
|
|
187 XrmValuePtr to_in_out,
|
|
188 XtPointer *converter_data);
|
|
189
|
|
190 /* XtDestructor */
|
|
191 void EmacsFreeXIMStyles (
|
|
192 XtAppContext app,
|
|
193 XrmValuePtr to,
|
|
194 XtPointer converter_data,
|
|
195 XrmValuePtr args,
|
|
196 Cardinal *num_args);
|
|
197
|
|
198 #ifdef DEBUG_XEMACS
|
|
199 void describe_Window (Window win);
|
|
200 void describe_XFontSet (XFontSet font_set);
|
|
201 void describe_XIM (XIM im);
|
|
202 void describe_XIMStyle (XIMStyle style);
|
|
203 void describe_XIMStyles (XIMStyles *styles);
|
|
204 void describe_XIC (XIC ic);
|
|
205 void describe_event_mask (unsigned long mask);
|
|
206 void describe_XRectangle (char *name, XRectangle *rect);
|
|
207 void describe_Status (Status status);
|
|
208 #endif /* DEBUG_XEMACS */
|
|
209 #endif /* XIM_XLIB */
|
|
210 #endif /* HAVE_XIM */
|
|
211
|
771
|
212 extern Lisp_Object Qxintl;
|
|
213
|
428
|
214 extern int in_resource_setting;
|
|
215 extern int in_specifier_change_function;
|
|
216
|
|
217 extern Lisp_Object Vx_initial_argv_list; /* #### ugh! */
|
|
218
|
|
219 #endif /* HAVE_X_WINDOWS */
|
440
|
220
|
|
221 #endif /* INCLUDED_console_x_h_ */
|