Mercurial > hg > xemacs-beta
comparison src/redisplay-xlike-inc.c @ 4908:b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* compiler.h:
Create a USED() macro to force unused-var warnings to go away,
in certain cases where it's inconvenient to do otherwise (e.g.
when THIS_IS_GTK in redisplay-xlike-inc.c).
* console-x.h:
Remove unneeded decls, make some static.
* redisplay-xlike-inc.c:
* console-xlike-inc.h: New file. Include defns from
redisplay-xlike-inc.c that may be useful in other XLIKE files.
Correct the handling of colors and font-style setting functions
in the xlike defns. Lots of fixes in the GTK-specific defns.
* depend: Regenerate.
* event-xlike-inc.c:
* event-xlike-inc.c (USE_UNICODE_MAP):
* event-xlike-inc.c (endif):
* gccache-gtk.c:
* gtk-glue.c (xemacs_list_to_gtklist):
* gtk-glue.c (xemacs_gtklist_to_list):
* gtk-glue.c (FROB):
* gtk-glue.c (face_to_gc):
* gtk-glue.c (face_to_style):
* gtk-glue.c (gdk_event_to_emacs_event):
* gtk-xemacs.h (struct _GtkXEmacs):
* gtk-xemacs.h (struct _GtkXEmacsClass):
* objects-xlike-inc.c:
Cosmetic, comment fixes.
* glyphs.c (pixmap_to_lisp_data):
Unused var fixes.
* gtk-glue.c:
* gccache-gtk.c:
* gtk-xemacs.c:
* gtk-xemacs.h:
* objects-xlike-inc.c:
* ui-gtk.c:
* ui-gtk.h:
* xgccache.c:
* xgccache.c (GC_CACHE_SIZE):
* xgccache.h:
Misc include-file fixes.
* objects-xlike-inc.c (XFUN):
* objects-xlike-inc.c (xlistfonts_checking_charset):
Combine some ifdeffed stuff using defs in console-xlike-inc.h.
* redisplay-gtk.c:
* redisplay-gtk.c (THIS_IS_GTK):
* redisplay-gtk.c (XLIKE_bevel_area):
* redisplay-gtk.c (XLIKE_ring_bell):
* redisplay-gtk.c (gdk_draw_text_image):
Fix numerous compile problems. Delete gtk_output_shadows(),
which mostly duplicates generic bevel_modeline(). Fix up
gtk_bevel_modeline() into XLIKE_bevel_area() and make use of
the style var properly to set the appropriate GTK constant.
* redisplay-x.c:
* redisplay-x.c (XLIKE_window_output_begin):
* redisplay-x.c (XLIKE_window_output_end):
* redisplay-x.c (XLIKE_bevel_area):
* redisplay-x.c (x_output_shadows):
* redisplay-x.c (XLIKE_ring_bell):
Make x_output_shadows be static. Change the defn of various
functions to look like XLIKE_foo() so it matches the calling
convention elsewhere.
* redisplay-xlike-inc.c:
* redisplay-xlike-inc.c (NEED_GCCACHE_H):
* redisplay-xlike-inc.c (XLIKE_text_width):
* redisplay-xlike-inc.c (XLIKE_get_gc):
* redisplay-xlike-inc.c (XLIKE_text_width_single_run):
* redisplay-xlike-inc.c (XFT_FROB_LISP_COLOR):
* redisplay-xlike-inc.c (XLIKE_output_xlike_pixmap):
* redisplay-xlike-inc.c (XLIKE_output_pixmap):
* redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
* redisplay-xlike-inc.c (XLIKE_flash):
Lots of header fixes. Lots of stuff moved to console-xlike-inc.h.
Use XFUN() to generate function names instead of directly
calling XLIKE_PASTE(). Remove unnecessary prototypes.
Unify calls to text_width funs. Make XLIKE_get_gc non-static
since it's called from gtk. Change the color-function calls
and fill-style-setting calls to match the changes in
console-xlike-inc.h. Use USED() to avoid some warnings.
* symsinit.h:
Sort the prototypes, and add a fun `sort-symsinit' in a comment
that does the sorting (using sort-regexp-fields).
* symsinit.h (init_number):
* sysgtk.h: New file, wraps the various GTK headers.
* sysgdkx.h: New file, wraps <gtk/gdkx.h>. Keep this separate to
* event-gtk.h: Delete. Combine stuff into console-gtk.h.
help isolate X-specific code from GTK.
* device-gtk.c:
* event-gtk.c:
* console-gtk.h:
* frame-gtk.c:
* gccache-gtk.c:
* gccache-gtk.h:
* glyphs-gtk.c (gtk_colorize_image_instance):
* glyphs-gtk.h:
* gtk-xemacs.h:
* objects-gtk.c:
* objects-gtk.c (MAX_FONT_COUNT):
* ui-gtk.h:
Use sysgtk.h or sysgdkx.h instead of directly including GTK
headers. Don't include event-gtk.h.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 01 Feb 2010 02:15:28 -0600 |
parents | eab9498ecc0e |
children | e813cf16c015 |
comparison
equal
deleted
inserted
replaced
4907:9e7f5a77cc84 | 4908:b3ce27ca7647 |
---|---|
1 /* Common code between X and GTK. | 1 /* Common code between X and GTK -- redisplay-related. |
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. | 2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. |
3 Copyright (C) 1994 Lucid, Inc. | 3 Copyright (C) 1994 Lucid, Inc. |
4 Copyright (C) 1995 Sun Microsystems, Inc. | 4 Copyright (C) 1995 Sun Microsystems, Inc. |
5 Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing. | 5 Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing. |
6 | 6 |
26 /* Author: Chuck Thompson */ | 26 /* Author: Chuck Thompson */ |
27 /* Gtk flavor by William Perry */ | 27 /* Gtk flavor by William Perry */ |
28 /* X and GTK code merged by Ben Wing, 1-10 */ | 28 /* X and GTK code merged by Ben Wing, 1-10 */ |
29 | 29 |
30 /* Lots of work done by Ben Wing for Mule */ | 30 /* Lots of work done by Ben Wing for Mule */ |
31 | |
32 /* Before including this file, you need to define either THIS_IS_X or | |
33 THIS_IS_GTK. See comments in console-xlike-inc.h. */ | |
31 | 34 |
32 #include <config.h> | 35 #include <config.h> |
33 #include "lisp.h" | 36 #include "lisp.h" |
34 | 37 |
35 #include "buffer.h" | 38 #include "buffer.h" |
46 #ifdef MULE | 49 #ifdef MULE |
47 #include "mule-ccl.h" | 50 #include "mule-ccl.h" |
48 #endif | 51 #endif |
49 #include "charset.h" | 52 #include "charset.h" |
50 | 53 |
54 #define NEED_GCCACHE_H | |
55 #define NEED_GLYPHS_H | |
56 #define NEED_OBJECTS_IMPL_H | |
57 #include "console-xlike-inc.h" | |
58 | |
59 #include "sysproc.h" /* for select() */ | |
60 | |
51 #ifdef THIS_IS_X | 61 #ifdef THIS_IS_X |
52 #include "console-x-impl.h" | |
53 #include "glyphs-x.h" | |
54 #include "objects-x-impl.h" | |
55 #include "xgccache.h" | |
56 #else /* THIS_IS_GTK */ | |
57 #include "console-gtk-impl.h" | |
58 #include "gccache-gtk.h" | |
59 #include "glyphs-gtk.h" | |
60 #include "objects-gtk-impl.h" | |
61 #endif /* THIS_IS_GTK */ | |
62 | |
63 #include "EmacsFrame.h" | 62 #include "EmacsFrame.h" |
64 #include "EmacsFrameP.h" | 63 #include "EmacsFrameP.h" |
65 | 64 |
66 #include "sysproc.h" /* for select() */ | |
67 | |
68 #ifdef THIS_IS_X | |
69 #include <X11/bitmaps/gray> | 65 #include <X11/bitmaps/gray> |
70 #endif /* THIS_IS_X */ | 66 #endif /* THIS_IS_X */ |
71 | 67 |
72 #define EOL_CURSOR_WIDTH 5 | 68 #define EOL_CURSOR_WIDTH 5 |
73 | 69 |
74 /* About some of the types below: | |
75 | |
76 X has two ways of representing a color: (a) as an unsigned long | |
77 representing a color pixel value, i.e. the actual value stored in memory | |
78 or a file at a particular pixel location to indicate that the pixel | |
79 takes on a specific color; and (b) an XColor structure, which | |
80 encapsulates both the RGB components of a color and the associated color | |
81 pixel value. | |
82 | |
83 We call the former type XLIKE_PIXCOLOR and the latter XLIKE_COLOR. | |
84 GTK uses the same GdkColor structure for both, and normally passes in | |
85 a pointer. We provide routines to handle the two logical color types. */ | |
86 | |
87 #ifdef THIS_IS_X | |
88 | |
89 /***************************************************************************/ | |
90 /* Definitions implementing X flavor of XLIKE */ | |
91 /***************************************************************************/ | |
92 | |
93 #define XLIKE_NAME x | |
94 #define USED_IF_X(var) var | |
95 | |
96 /* types */ | |
97 #define XLIKE_DISPLAY Display * | |
98 #define XLIKE_WINDOW Window | |
99 #define XLIKE_GC GC | |
100 #define XLIKE_RECTANGLE XRectangle | |
101 #define XLIKE_GCVALUES XGCValues | |
102 #define XLIKE_COLOR XColor | |
103 #define XLIKE_PIXCOLOR unsigned long | |
104 | |
105 /* constants */ | |
106 #define XLIKE_NONE None | |
107 #define XLIKE_FALSE False | |
108 | |
109 #define XLIKE_GC_BACKGROUND GCBackground | |
110 #define XLIKE_GC_CLIP_MASK GCClipMask | |
111 #define XLIKE_GC_CLIP_X_ORIGIN GCClipXOrigin | |
112 #define XLIKE_GC_CLIP_Y_ORIGIN GCClipYOrigin | |
113 #define XLIKE_GC_EXPOSURES GCGraphicsExposures | |
114 #define XLIKE_GC_FILL GCFillStyle | |
115 #define XLIKE_GC_FONT GCFont | |
116 #define XLIKE_GC_FOREGROUND GCForeground | |
117 #define XLIKE_GC_FUNCTION GCFunction | |
118 #define XLIKE_GC_LINE_WIDTH GCLineWidth | |
119 #define XLIKE_GC_STIPPLE GCStipple | |
120 #define XLIKE_GC_TILE GCTile | |
121 | |
122 #define XLIKE_GX_COPY GXcopy | |
123 #define XLIKE_GX_XOR GXxor | |
124 | |
125 #define XLIKE_FILL_MEMBER fill_style | |
126 #define XLIKE_FILL_STIPPLED FillStippled | |
127 #define XLIKE_FILL_OPAQUE_STIPPLED FillOpaqueStippled | |
128 #define XLIKE_FILL_TILED FillTiled | |
129 #define XLIKE_FILL_SOLID FillSolid | |
130 | |
131 /* functions */ | |
132 #define GET_XLIKE_DISPLAY(d) DEVICE_X_DISPLAY (d) | |
133 #define GET_XLIKE_WINDOW(w) XtWindow (FRAME_X_TEXT_WIDGET (f)) | |
134 #define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \ | |
135 XFillRectangle (dpy, x_win, gc, x, y, width, height) | |
136 #define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \ | |
137 XDrawRectangle (dpy, x_win, gc, x, y, width, height) | |
138 #define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \ | |
139 XDrawLine (dpy, x_win, gc, x1, y1, x2, y2) | |
140 #define XLIKE_OUTPUT_XLIKE_PIXMAP x_output_x_pixmap | |
141 | |
142 #define XLIKE_DISPLAY_LINE_HEIGHT(dl) DISPLAY_LINE_HEIGHT (dl) | |
143 #define XLIKE_DISPLAY_LINE_YPOS(dl) DISPLAY_LINE_YPOS (dl) | |
144 #define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((dl)->top_clip) | |
145 #define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect) \ | |
146 /* #### why not Unsorted? */ \ | |
147 XSetClipRectangles (dpy, gc, xorig, yorig, prect, 1, YXBanded) | |
148 #define XLIKE_CLEAR_CLIP_MASK(dpy, gc) \ | |
149 do \ | |
150 { \ | |
151 XSetClipMask (dpy, gc, None); \ | |
152 XSetClipOrigin (dpy, gc, 0, 0); \ | |
153 } \ | |
154 while (0) | |
155 #define XLIKE_FLUSH(dpy) XSync (dpy, False) | |
156 #define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \ | |
157 XClearArea (dpy, win, x, y, width, height, False) | |
158 | |
159 #define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_X_MASK | |
160 #define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_X_PIXMAP | |
161 #define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_X_COLOR | |
162 #define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_X_FONT | |
163 #define DEVICE_XLIKE_GC_CACHE DEVICE_X_GC_CACHE | |
164 #define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_X_GRAY_PIXMAP | |
165 #define XLIKE_COLOR_TO_PIXCOLOR(ci) ((ci).pixel) | |
166 #define XLIKE_SET_PIXCOLOR_COPY(lval, rval) ((lval) = (rval)) | |
167 #define XLIKE_SET_PIXCOLOR_NUM(lval, rval) ((lval) = (rval)) | |
168 #define XLIKE_FONT_NUM(val) ((val)->fid) | |
169 | |
170 #define XLIKE_OUTPUT_XLIKE_PIXMAP x_output_x_pixmap | |
171 | |
172 /************ End X flavor of XLIKE **********/ | |
173 | |
174 | |
175 | |
176 | |
177 #else /* THIS_IS_GTK */ | |
178 | |
179 /***************************************************************************/ | |
180 /* Definitions implementing GTK flavor of XLIKE */ | |
181 /***************************************************************************/ | |
182 | |
183 #define XLIKE_NAME gtk | |
184 #define USED_IF_X(var) UNUSED (var) | |
185 | |
186 /*types */ | |
187 #define XLIKE_DISPLAY void * | |
188 #define XLIKE_WINDOW GdkWindow * | |
189 #define XLIKE_GC GdkGC * | |
190 #define XLIKE_RECTANGLE GdkRectangle | |
191 #define XLIKE_GCVALUES GdkGCValues | |
192 #define XLIKE_COLOR GdkColor * | |
193 #define XLIKE_PIXCOLOR GdkColor * | |
194 | |
195 /* constants */ | |
196 #define XLIKE_NONE 0 | |
197 #define XLIKE_FALSE FALSE | |
198 | |
199 #define XLIKE_GC_BACKGROUND GDK_GC_BACKGROUND | |
200 #define XLIKE_GC_CLIP_MASK GDK_GC_CLIP_MASK | |
201 #define XLIKE_GC_CLIP_X_ORIGIN GDK_GC_CLIP_X_ORIGIN | |
202 #define XLIKE_GC_CLIP_Y_ORIGIN GDK_GC_CLIP_Y_ORIGIN | |
203 #define XLIKE_GC_EXPOSURES GDK_GC_EXPOSURES | |
204 #define XLIKE_GC_FILL GDK_GC_FILL | |
205 #define XLIKE_GC_FONT GDK_GC_FONT | |
206 #define XLIKE_GC_FOREGROUND GDK_GC_FOREGROUND | |
207 #define XLIKE_GC_FUNCTION GDK_GC_FUNCTION | |
208 #define XLIKE_GC_LINE_WIDTH GDK_GC_LINE_WIDTH | |
209 #define XLIKE_GC_STIPPLE GDK_GC_STIPPLE | |
210 #define XLIKE_GC_TILE GDK_GC_TILE | |
211 | |
212 #define XLIKE_GX_COPY GDK_COPY | |
213 #define XLIKE_GX_XOR GDK_XOR | |
214 | |
215 #define XLIKE_FILL_MEMBER fill | |
216 #define XLIKE_FILL_STIPPLED GDK_STIPPLED | |
217 #define XLIKE_FILL_OPAQUE_STIPPLED GDK_OPAQUE_STIPPLED | |
218 #define XLIKE_FILL_TILED GDK_TILED | |
219 #define XLIKE_FILL_SOLID GDK_SOLID | |
220 | |
221 /* functions */ | |
222 | |
223 #define GET_XLIKE_DISPLAY(d) NULL | |
224 #define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w)) | |
225 #define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \ | |
226 gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, y, width, height) | |
227 #define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \ | |
228 gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE, x, y, width, height) | |
229 #define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \ | |
230 gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2) | |
231 #define XLIKE_OUTPUT_XLIKE_PIXMAP gtk_output_gdk_pixmap | |
232 | |
233 /* FIXME: This is totally bogus. It removes dl->top_clip from the | |
234 equations. If there is a bug involving this, fix it properly! | |
235 Or just ensure that top_clip is 0. */ | |
236 #define XLIKE_DISPLAY_LINE_HEIGHT(dl) \ | |
237 ((dl)->ascent + ((dl)->descent - (dl)->clip) | |
238 #define XLIKE_DISPLAY_LINE_YPOS(dl) ((dl)->ypos - (dl)->ascent) | |
239 #define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((0) | |
240 #define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect) \ | |
241 do \ | |
242 { \ | |
243 gdk_gc_set_clip_rectangle (gc, prect); \ | |
244 gdk_gc_set_clip_origin (gc, xorig, yorig); \ | |
245 } \ | |
246 while (0) | |
247 #define XLIKE_CLEAR_CLIP_MASK(dpy, gc) \ | |
248 do \ | |
249 { \ | |
250 gdk_gc_set_clip_rectangle (gc, NULL); \ | |
251 gdk_gc_set_clip_origin (gc, 0, 0); \ | |
252 } \ | |
253 while (0) | |
254 #define XLIKE_FLUSH(dpy) gdk_flush () | |
255 #define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \ | |
256 gdk_window_clear_area (win, x, y, width, height) | |
257 | |
258 #define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_GTK_MASK | |
259 #define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_GTK_PIXMAP | |
260 #define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_GTK_COLOR | |
261 #define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_GTK_FONT | |
262 #define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_GTK_GRAY_PIXMAP | |
263 #define DEVICE_XLIKE_GC_CACHE DEVICE_GTK_GC_CACHE | |
264 #define XLIKE_COLOR_TO_PIXCOLOR(ci) (ci) | |
265 #define XLIKE_SET_PIXCOLOR_COPY(lval, rval) ((lval) = *(rval)) | |
266 #define XLIKE_SET_PIXCOLOR_NUM(lval, rval) ((lval).pixel = (rval)) | |
267 #define XLIKE_FONT_NUM(val) (val) | |
268 | |
269 #define XLIKE_OUTPUT_XLIKE_PIXMAP gtk_output_gdk_pixmap | |
270 | |
271 static void gtk_output_pixmap (struct window *w, | |
272 Lisp_Object image_instance, | |
273 struct display_box *db, | |
274 struct display_glyph_area *dga, | |
275 face_index findex, | |
276 int cursor_start, | |
277 int cursor_width, | |
278 int cursor_height, | |
279 int bgpixmap); | |
280 static void gtk_clear_region (Lisp_Object locale, struct device* d, | |
281 struct frame* f, face_index findex, int x, int y, | |
282 int width, int height, Lisp_Object fcolor, | |
283 Lisp_Object bcolor, | |
284 Lisp_Object background_pixmap); | |
285 static void gtk_bevel_modeline (struct window *w, struct display_line *dl); | |
286 | |
287 #if 0 | |
288 static void __describe_gc (GdkGC *); | |
289 #endif | |
290 | |
291 /************ End GTK flavor of XLIKE **********/ | |
292 | |
293 #endif /* (not) THIS_IS_X */ | |
294 | |
295 | |
296 | |
297 /***************************************************************************/ | |
298 /* Common definitions */ | |
299 /***************************************************************************/ | |
300 | |
301 #define XCOLOR_INSTANCE_XLIKE_COLOR(x) \ | |
302 COLOR_INSTANCE_XLIKE_COLOR (XCOLOR_INSTANCE (x)) | |
303 | |
304 #define XLIKE_PASTE_1(a,b) a##_##b | |
305 #define XLIKE_PASTE(a,b) XLIKE_PASTE_1(a,b) | |
306 #define XLIKE_CONSOLE_HAS_METHOD_1(xlike, name) CONSOLE_HAS_METHOD (xlike, name) | |
307 #define XLIKE_CONSOLE_HAS_METHOD(name) \ | |
308 XLIKE_CONSOLE_HAS_METHOD_1 (XLIKE_NAME, name) | |
309 | |
310 /* Device methods */ | 70 /* Device methods */ |
311 | 71 |
312 #define XLIKE_text_width XLIKE_PASTE (XLIKE_NAME, text_width) | 72 #define XLIKE_text_width XFUN (text_width) |
313 #define XLIKE_output_display_block XLIKE_PASTE (XLIKE_NAME, output_display_block) | 73 #define XLIKE_output_display_block XFUN (output_display_block) |
314 #define XLIKE_divider_height XLIKE_PASTE (XLIKE_NAME, divider_height) | 74 #define XLIKE_divider_height XFUN (divider_height) |
315 #define XLIKE_eol_cursor_width XLIKE_PASTE (XLIKE_NAME, eol_cursor_width) | 75 #define XLIKE_eol_cursor_width XFUN (eol_cursor_width) |
316 #define XLIKE_output_vertical_divider XLIKE_PASTE (XLIKE_NAME, output_vertical_divider) | 76 #define XLIKE_output_vertical_divider XFUN (output_vertical_divider) |
317 #define XLIKE_clear_region XLIKE_PASTE (XLIKE_NAME, clear_region) | 77 #define XLIKE_clear_region XFUN (clear_region) |
318 #define XLIKE_clear_frame XLIKE_PASTE (XLIKE_NAME, clear_frame) | 78 #define XLIKE_clear_frame XFUN (clear_frame) |
319 #define XLIKE_flash XLIKE_PASTE (XLIKE_NAME, flash) | 79 #define XLIKE_flash XFUN (flash) |
320 #define XLIKE_ring_bell XLIKE_PASTE (XLIKE_NAME, ring_bell) | 80 #define XLIKE_ring_bell XFUN (ring_bell) |
321 #define XLIKE_bevel_area XLIKE_PASTE (XLIKE_NAME, bevel_area) | 81 #define XLIKE_bevel_area XFUN (bevel_area) |
322 #define XLIKE_output_string XLIKE_PASTE (XLIKE_NAME, output_string) | 82 #define XLIKE_output_string XFUN (output_string) |
323 #define XLIKE_output_pixmap XLIKE_PASTE (XLIKE_NAME, output_pixmap) | 83 #define XLIKE_output_pixmap XFUN (output_pixmap) |
324 #define XLIKE_window_output_begin XLIKE_PASTE (XLIKE_NAME, window_output_begin) | 84 #define XLIKE_output_xlike_pixmap XFUN (output_xlike_pixmap) |
325 #define XLIKE_window_output_end XLIKE_PASTE (XLIKE_NAME, window_output_end) | 85 #define XLIKE_window_output_begin XFUN (window_output_begin) |
86 #define XLIKE_window_output_end XFUN (window_output_end) | |
326 | 87 |
327 /* Miscellaneous split functions */ | 88 /* Miscellaneous split functions */ |
328 | 89 |
329 #define console_type_create_redisplay_XLIKE XLIKE_PASTE (console_type_create_redisplay, XLIKE_NAME) | 90 #define console_type_create_redisplay_XLIKE XLIKE_PASTE (console_type_create_redisplay, XLIKE_NAME) |
330 #define XLIKE_get_gc XLIKE_PASTE (XLIKE_NAME, get_gc) | 91 #define XLIKE_get_gc XFUN (get_gc) |
331 #define XLIKE_output_blank XLIKE_PASTE (XLIKE_NAME, output_blank) | 92 #define XLIKE_output_blank XFUN (output_blank) |
332 #define XLIKE_text_width_single_run XLIKE_PASTE (XLIKE_NAME, text_width_single_run) | 93 #define XLIKE_text_width_single_run XFUN (text_width_single_run) |
333 | 94 |
334 static void XLIKE_output_blank (struct window *w, struct display_line *dl, | 95 static void XLIKE_output_blank (struct window *w, struct display_line *dl, |
335 struct rune *rb, int start_pixpos, | 96 struct rune *rb, int start_pixpos, |
336 int cursor_start, int cursor_width); | 97 int cursor_start, int cursor_width); |
337 static void XLIKE_output_horizontal_line (struct window *w, | 98 static void XLIKE_output_horizontal_line (struct window *w, |
338 struct display_line *dl, | 99 struct display_line *dl, |
339 struct rune *rb); | 100 struct rune *rb); |
340 | |
341 static void XLIKE_output_vertical_divider (struct window *w, int clear); | |
342 | |
343 static void XLIKE_output_eol_cursor (struct window *w, | 101 static void XLIKE_output_eol_cursor (struct window *w, |
344 struct display_line *dl, | 102 struct display_line *dl, |
345 int xpos, face_index findex); | 103 int xpos, face_index findex); |
346 static void XLIKE_clear_frame (struct frame *f); | |
347 static void XLIKE_clear_frame_windows (Lisp_Object window); | 104 static void XLIKE_clear_frame_windows (Lisp_Object window); |
348 static void XLIKE_window_output_begin (struct window *w); | |
349 static void XLIKE_window_output_end (struct window *w); | |
350 static void XLIKE_bevel_area (struct window *w, face_index findex, | 105 static void XLIKE_bevel_area (struct window *w, face_index findex, |
351 int x, int y, int width, int height, | 106 int x, int y, int width, int height, |
352 int shadow_thickness, int edges, | 107 int shadow_thickness, int edges, |
353 enum edge_style style); | 108 enum edge_style style); |
354 static void XLIKE_ring_bell (struct device *d, int volume, int pitch, | 109 static void XLIKE_ring_bell (struct device *d, int volume, int pitch, |
355 int duration); | 110 int duration); |
111 | |
112 #ifdef THIS_IS_X | |
113 static void XLIKE_window_output_begin (struct window *UNUSED (w)); | |
114 static void XLIKE_window_output_end (struct window *w); | |
115 #endif /* THIS_IS_X */ | |
116 | |
356 | 117 |
357 /****************************************************************************/ | 118 /****************************************************************************/ |
358 /* */ | 119 /* */ |
359 /* Separate textual runs */ | 120 /* Separate textual runs */ |
360 /* */ | 121 /* */ |
733 #endif | 494 #endif |
734 else if (FONT_INSTANCE_XLIKE_FONT (fi)) | 495 else if (FONT_INSTANCE_XLIKE_FONT (fi)) |
735 { | 496 { |
736 if (run->dimension == 2) | 497 if (run->dimension == 2) |
737 { | 498 { |
738 #ifdef THIS_IS_X | |
739 return XTextWidth16 (FONT_INSTANCE_X_FONT (fi), | |
740 (XChar2b *) run->ptr, run->len); | |
741 #else /* THIS_IS_GTK */ | |
742 /* stderr_out ("Measuring wide characters\n"); */ | 499 /* stderr_out ("Measuring wide characters\n"); */ |
743 return gdk_text_width_wc (FONT_INSTANCE_GTK_FONT (fi), | 500 return XLIKE_TEXT_WIDTH_WIDE (FONT_INSTANCE_XLIKE_FONT (fi), |
744 (GdkWChar *) run->ptr, run->len); | 501 run->ptr, run->len); |
745 #endif /* THIS_IS_GTK */ | |
746 } | 502 } |
747 else | 503 else |
748 { | 504 { |
749 #ifdef THIS_IS_X | 505 return XLIKE_TEXT_WIDTH (FONT_INSTANCE_XLIKE_FONT (fi), |
750 return XTextWidth (FONT_INSTANCE_X_FONT (fi), | 506 run->ptr, run->len); |
751 (char *) run->ptr, run->len); | |
752 #else /* THIS_IS_GTK */ | |
753 return gdk_text_width (FONT_INSTANCE_GTK_FONT (fi), | |
754 (char *) run->ptr, run->len); | |
755 #endif /* THIS_IS_GTK */ | |
756 } | 507 } |
757 } | 508 } |
758 else | 509 else |
759 abort(); | 510 abort(); |
760 return 0; /* shut up GCC */ | 511 return 0; /* shut up GCC */ |
761 } | 512 } |
762 | 513 |
514 | |
763 /* | 515 /* |
764 XLIKE_text_width | 516 XLIKE_text_width |
765 | 517 |
766 Given a string and a merged face, return the string's length in pixels | 518 Given a string and a merged face, return the string's length in pixels |
767 when displayed in the fonts associated with the face. | 519 when displayed in the fonts associated with the face. |
768 */ | 520 */ |
769 | 521 |
770 /* #### Break me out into a separate header */ | 522 /* #### Break me out into a separate header */ |
771 int XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel, | 523 int XLIKE_text_width (struct frame *f, struct face_cachel *cachel, |
772 const Ichar *str, Charcount len); | 524 const Ichar *str, Charcount len); |
773 int | 525 int |
774 XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel, | 526 XLIKE_text_width (struct frame *f, struct face_cachel *cachel, |
775 const Ichar *str, Charcount len) | 527 const Ichar *str, Charcount len) |
776 { | 528 { |
777 /* !!#### Needs review */ | 529 /* !!#### Needs review */ |
778 int width_so_far = 0; | 530 int width_so_far = 0; |
779 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); | 531 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); |
1058 bevel_modeline (w, dl); | 810 bevel_modeline (w, dl); |
1059 | 811 |
1060 Dynarr_free (buf); | 812 Dynarr_free (buf); |
1061 } | 813 } |
1062 | 814 |
815 /* Called as gtk_get_gc from gtk-glue.c */ | |
816 | |
817 XLIKE_GC XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, | |
818 Lisp_Object bg, Lisp_Object bg_pmap, | |
819 Lisp_Object lwidth); | |
820 | |
1063 /***************************************************************************** | 821 /***************************************************************************** |
1064 XLIKE_get_gc | 822 XLIKE_get_gc |
1065 | 823 |
1066 Given a number of parameters return a GC with those properties. | 824 Given a number of parameters return a GC with those properties. |
1067 ****************************************************************************/ | 825 ****************************************************************************/ |
1068 static XLIKE_GC | 826 XLIKE_GC |
1069 XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, | 827 XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, |
1070 Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth) | 828 Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth) |
1071 { | 829 { |
1072 XLIKE_GCVALUES gcv; | 830 XLIKE_GCVALUES gcv; |
1073 unsigned long mask; | 831 unsigned long mask; |
1077 /* Make absolutely sure that we don't pick up a clipping region in | 835 /* Make absolutely sure that we don't pick up a clipping region in |
1078 the GC returned by this function. */ | 836 the GC returned by this function. */ |
1079 gcv.clip_mask = XLIKE_NONE; | 837 gcv.clip_mask = XLIKE_NONE; |
1080 gcv.clip_x_origin = 0; | 838 gcv.clip_x_origin = 0; |
1081 gcv.clip_y_origin = 0; | 839 gcv.clip_y_origin = 0; |
1082 gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_SOLID; | 840 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID); |
1083 mask = XLIKE_GC_EXPOSURES | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN; | 841 mask = XLIKE_GC_EXPOSURES | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN; |
1084 mask |= XLIKE_GC_FILL; | 842 mask |= XLIKE_GC_FILL; |
1085 | 843 |
1086 if (!NILP (font) | 844 if (!NILP (font) |
1087 #ifdef USE_XFT | 845 #ifdef USE_XFT |
1107 } | 865 } |
1108 | 866 |
1109 if (!NILP (fg)) | 867 if (!NILP (fg)) |
1110 { | 868 { |
1111 if (COLOR_INSTANCEP (fg)) | 869 if (COLOR_INSTANCEP (fg)) |
1112 XLIKE_SET_PIXCOLOR_COPY | 870 XLIKE_SET_GC_COLOR (gcv.foreground, XCOLOR_INSTANCE_XLIKE_COLOR (fg)); |
1113 (gcv.foreground, | |
1114 XLIKE_COLOR_TO_PIXCOLOR (XCOLOR_INSTANCE_XLIKE_COLOR (fg))); | |
1115 else | 871 else |
1116 XLIKE_SET_PIXCOLOR_NUM (gcv.foreground, XINT (fg)); | 872 XLIKE_SET_GC_PIXEL (gcv.foreground, XINT (fg)); |
1117 mask |= XLIKE_GC_FOREGROUND; | 873 mask |= XLIKE_GC_FOREGROUND; |
1118 } | 874 } |
1119 | 875 |
1120 if (!NILP (bg)) | 876 if (!NILP (bg)) |
1121 { | 877 { |
1122 if (COLOR_INSTANCEP (bg)) | 878 if (COLOR_INSTANCEP (bg)) |
1123 XLIKE_SET_PIXCOLOR_COPY | 879 XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (bg)); |
1124 (gcv.background, | |
1125 XLIKE_COLOR_TO_PIXCOLOR (XCOLOR_INSTANCE_XLIKE_COLOR (bg))); | |
1126 else | 880 else |
1127 XLIKE_SET_PIXCOLOR_NUM (gcv.background, XINT (bg)); | 881 XLIKE_SET_GC_PIXEL (gcv.background, XINT (bg)); |
1128 mask |= XLIKE_GC_BACKGROUND; | 882 mask |= XLIKE_GC_BACKGROUND; |
1129 } | 883 } |
1130 | 884 |
1131 /* This special case comes from a request to draw text with a face which has | 885 /* This special case comes from a request to draw text with a face which has |
1132 the dim property. We'll use a stippled foreground GC. */ | 886 the dim property. We'll use a stippled foreground GC. */ |
1133 if (EQ (bg_pmap, Qdim)) | 887 if (EQ (bg_pmap, Qdim)) |
1134 { | 888 { |
1135 assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE); | 889 assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE); |
1136 | 890 |
1137 gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_STIPPLED; | 891 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_STIPPLED); |
1138 gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d); | 892 gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d); |
1139 mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE); | 893 mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE); |
1140 } | 894 } |
1141 else if (IMAGE_INSTANCEP (bg_pmap) | 895 else if (IMAGE_INSTANCEP (bg_pmap) |
1142 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) | 896 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) |
1143 { | 897 { |
1144 if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0) | 898 if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0) |
1145 { | 899 { |
1146 gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_OPAQUE_STIPPLED; | 900 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED); |
1147 gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); | 901 gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); |
1148 mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL); | 902 mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL); |
1149 } | 903 } |
1150 else | 904 else |
1151 { | 905 { |
1152 gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_TILED; | 906 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED); |
1153 gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); | 907 gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); |
1154 mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL); | 908 mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL); |
1155 } | 909 } |
1156 } | 910 } |
1157 | 911 |
1262 xftDraw = FRAME_X_XFTDRAW (f); | 1016 xftDraw = FRAME_X_XFTDRAW (f); |
1263 | 1017 |
1264 /* #### This will probably cause asserts when passed a Lisp integer for a | 1018 /* #### This will probably cause asserts when passed a Lisp integer for a |
1265 color. See ca. line 759 this file. | 1019 color. See ca. line 759 this file. |
1266 #### Maybe xft_convert_color should take an XColor, not a pixel. */ | 1020 #### Maybe xft_convert_color should take an XColor, not a pixel. */ |
1267 #define XFT_FROB_LISP_COLOR(color, dim) \ | 1021 #define XFT_FROB_LISP_COLOR(color, dim) \ |
1268 xft_convert_color (dpy, cmap, visual, \ | 1022 xft_convert_color (dpy, cmap, visual, \ |
1269 COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)).pixel, \ | 1023 XCOLOR_INSTANCE_X_COLOR (color).pixel, (dim)) |
1270 (dim)) | |
1271 #endif /* USE_XFT */ | 1024 #endif /* USE_XFT */ |
1272 | 1025 |
1273 if (width < 0) | 1026 if (width < 0) |
1274 width = XLIKE_text_width (f, cachel, Dynarr_atp (buf, 0), | 1027 width = XLIKE_text_width (f, cachel, Dynarr_atp (buf, 0), |
1275 Dynarr_length (buf)); | 1028 Dynarr_length (buf)); |
1848 gint width, | 1601 gint width, |
1849 gint height); | 1602 gint height); |
1850 #endif /* THIS_IS_GTK */ | 1603 #endif /* THIS_IS_GTK */ |
1851 | 1604 |
1852 | 1605 |
1853 void | 1606 static void |
1854 XLIKE_OUTPUT_XLIKE_PIXMAP (struct frame *f, Lisp_Image_Instance *p, int x, | 1607 XLIKE_output_xlike_pixmap (struct frame *f, Lisp_Image_Instance *p, int x, |
1855 int y, int xoffset, int yoffset, | 1608 int y, int xoffset, int yoffset, |
1856 int width, int height, | 1609 int width, int height, |
1857 XLIKE_PIXCOLOR fg, XLIKE_PIXCOLOR bg, | 1610 XLIKE_COLOR fg, XLIKE_COLOR bg, |
1858 XLIKE_GC override_gc) | 1611 XLIKE_GC override_gc) |
1859 { | 1612 { |
1860 struct device *d = XDEVICE (f->device); | 1613 struct device *d = XDEVICE (f->device); |
1861 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); | 1614 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); |
1862 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); | 1615 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); |
1866 | 1619 |
1867 if (!override_gc) | 1620 if (!override_gc) |
1868 { | 1621 { |
1869 memset (&gcv, ~0, sizeof (gcv)); | 1622 memset (&gcv, ~0, sizeof (gcv)); |
1870 gcv.graphics_exposures = XLIKE_FALSE; | 1623 gcv.graphics_exposures = XLIKE_FALSE; |
1871 XLIKE_SET_PIXCOLOR_COPY (gcv.foreground, fg); | 1624 XLIKE_SET_GC_COLOR (gcv.foreground, fg); |
1872 XLIKE_SET_PIXCOLOR_COPY (gcv.background, bg); | 1625 XLIKE_SET_GC_COLOR (gcv.background, bg); |
1873 pixmap_mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES; | 1626 pixmap_mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES; |
1874 | 1627 |
1875 if (IMAGE_INSTANCE_XLIKE_MASK (p)) | 1628 if (IMAGE_INSTANCE_XLIKE_MASK (p)) |
1876 { | 1629 { |
1877 gcv.function = XLIKE_GX_COPY; | 1630 gcv.function = XLIKE_GX_COPY; |
1914 IMAGE_INSTANCE_X_PIXMAP_SLICE | 1667 IMAGE_INSTANCE_X_PIXMAP_SLICE |
1915 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset, | 1668 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset, |
1916 yoffset, width, | 1669 yoffset, width, |
1917 height, x, y); | 1670 height, x, y); |
1918 #else /* THIS_IS_GTK */ | 1671 #else /* THIS_IS_GTK */ |
1672 USED (dpy); | |
1919 gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc, | 1673 gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc, |
1920 IMAGE_INSTANCE_GTK_PIXMAP (p), | 1674 IMAGE_INSTANCE_GTK_PIXMAP (p), |
1921 xoffset, yoffset, x, y, width, height); | 1675 xoffset, yoffset, x, y, width, height); |
1922 #endif /* THIS_IS_GTK */ | 1676 #endif /* THIS_IS_GTK */ |
1923 } | 1677 } |
1926 #ifdef THIS_IS_X | 1680 #ifdef THIS_IS_X |
1927 XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE | 1681 XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE |
1928 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, | 1682 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, |
1929 xoffset, yoffset, width, height, x, y, 1L); | 1683 xoffset, yoffset, width, height, x, y, 1L); |
1930 #else /* THIS_IS_GTK */ | 1684 #else /* THIS_IS_GTK */ |
1685 USED (dpy); | |
1931 our_draw_bitmap (GDK_DRAWABLE (x_win), gc, | 1686 our_draw_bitmap (GDK_DRAWABLE (x_win), gc, |
1932 IMAGE_INSTANCE_GTK_PIXMAP (p), | 1687 IMAGE_INSTANCE_GTK_PIXMAP (p), |
1933 xoffset, yoffset, x, y, width, height); | 1688 xoffset, yoffset, x, y, width, height); |
1934 #endif /* THIS_IS_GTK */ | 1689 #endif /* THIS_IS_GTK */ |
1935 } | 1690 } |
1955 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); | 1710 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); |
1956 tmp_fcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel); | 1711 tmp_fcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel); |
1957 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); | 1712 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); |
1958 tmp_bcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel); | 1713 tmp_bcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel); |
1959 | 1714 |
1960 XLIKE_OUTPUT_XLIKE_PIXMAP (f, p, db->xpos, db->ypos, | 1715 XLIKE_output_xlike_pixmap (f, p, db->xpos, db->ypos, |
1961 dga->xoffset, dga->yoffset, | 1716 dga->xoffset, dga->yoffset, |
1962 dga->width, dga->height, | 1717 dga->width, dga->height, |
1963 XLIKE_COLOR_TO_PIXCOLOR (tmp_fcolor), | 1718 tmp_fcolor, tmp_bcolor, 0); |
1964 XLIKE_COLOR_TO_PIXCOLOR (tmp_bcolor), 0); | |
1965 } | 1719 } |
1966 | 1720 |
1967 /* Draw a cursor over top of the pixmap. */ | 1721 /* Draw a cursor over top of the pixmap. */ |
1968 if (cursor_width && cursor_height && (cursor_start >= db->xpos) | 1722 if (cursor_width && cursor_height && (cursor_start >= db->xpos) |
1969 && !NILP (w->text_cursor_visible_p) | 1723 && !NILP (w->text_cursor_visible_p) |
2006 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); | 1760 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); |
2007 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); | 1761 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); |
2008 Lisp_Object tmp_pixel; | 1762 Lisp_Object tmp_pixel; |
2009 XLIKE_GCVALUES gcv; | 1763 XLIKE_GCVALUES gcv; |
2010 XLIKE_GC background_gc; | 1764 XLIKE_GC background_gc; |
2011 #ifdef THIS_IS_X | |
2012 enum edge_style style; | 1765 enum edge_style style; |
2013 #endif /* THIS_IS_X */ | |
2014 unsigned long mask; | 1766 unsigned long mask; |
2015 int x, y1, y2, width, shadow_thickness, spacing, line_width; | 1767 int x, y1, y2, width, shadow_thickness, spacing, line_width; |
2016 face_index div_face = | 1768 face_index div_face = |
2017 get_builtin_face_cache_index (w, Vvertical_divider_face); | 1769 get_builtin_face_cache_index (w, Vvertical_divider_face); |
2018 | 1770 |
2027 memset (&gcv, ~0, sizeof (gcv)); | 1779 memset (&gcv, ~0, sizeof (gcv)); |
2028 | 1780 |
2029 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); | 1781 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); |
2030 | 1782 |
2031 /* First, get the GC's. */ | 1783 /* First, get the GC's. */ |
2032 XLIKE_SET_PIXCOLOR_COPY | 1784 XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel)); |
2033 (gcv.background, | |
2034 XLIKE_COLOR_TO_PIXCOLOR (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel))); | |
2035 gcv.foreground = gcv.background; | 1785 gcv.foreground = gcv.background; |
2036 gcv.graphics_exposures = XLIKE_FALSE; | 1786 gcv.graphics_exposures = XLIKE_FALSE; |
2037 mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES; | 1787 mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES; |
2038 | 1788 |
2039 background_gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, mask); | 1789 background_gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, mask); |
2042 window split occurs. */ | 1792 window split occurs. */ |
2043 #ifdef THIS_IS_X | 1793 #ifdef THIS_IS_X |
2044 if (clear) | 1794 if (clear) |
2045 XClearArea (dpy, x_win, x, y1, width, y2 - y1, False); | 1795 XClearArea (dpy, x_win, x, y1, width, y2 - y1, False); |
2046 #else /* THIS_IS_GTK */ | 1796 #else /* THIS_IS_GTK */ |
1797 USED (dpy); | |
2047 /* if (clear) */ | 1798 /* if (clear) */ |
2048 gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE, | 1799 gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE, |
2049 x, y1, width, y2 - y1); | 1800 x, y1, width, y2 - y1); |
2050 #endif /* THIS_IS_GTK */ | 1801 #endif /* THIS_IS_GTK */ |
2051 | 1802 |
2053 /* #### FIXME Why not? Formerly '#if 0' in the GDK code */ | 1804 /* #### FIXME Why not? Formerly '#if 0' in the GDK code */ |
2054 /* Draw the divider line. */ | 1805 /* Draw the divider line. */ |
2055 XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc, | 1806 XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc, |
2056 x + spacing + shadow_thickness, y1, | 1807 x + spacing + shadow_thickness, y1, |
2057 line_width, y2 - y1); | 1808 line_width, y2 - y1); |
2058 | 1809 #endif /* not THIS_IS_GTK */ |
2059 /* This code not formerly present in GTK version, maybe the omittal | 1810 |
2060 is intentional? */ | |
2061 if (shadow_thickness < 0) | 1811 if (shadow_thickness < 0) |
2062 { | 1812 { |
2063 shadow_thickness = -shadow_thickness; | 1813 shadow_thickness = -shadow_thickness; |
2064 style = EDGE_BEVEL_IN; | 1814 style = EDGE_BEVEL_IN; |
2065 } | 1815 } |
2066 else | 1816 else |
2067 { | 1817 { |
2068 style = EDGE_BEVEL_OUT; | 1818 style = EDGE_BEVEL_OUT; |
2069 } | 1819 } |
2070 #endif /* not THIS_IS_GTK */ | |
2071 | 1820 |
2072 /* Draw the shadows around the divider line */ | 1821 /* Draw the shadows around the divider line */ |
2073 #ifdef THIS_IS_X | 1822 XLIKE_bevel_area (w, div_face, x + spacing, y1, |
2074 x_bevel_area (w, div_face, x + spacing, y1, | 1823 width - 2 * spacing, y2 - y1, |
2075 width - 2 * spacing, y2 - y1, | 1824 shadow_thickness, EDGE_ALL, style); |
2076 shadow_thickness, EDGE_ALL, style); | |
2077 #else /* THIS_IS_GTK */ | |
2078 gtk_output_shadows (f, x + spacing, y1, | |
2079 width - 2 * spacing, y2 - y1, | |
2080 shadow_thickness); | |
2081 #endif /* THIS_IS_GTK */ | |
2082 } | 1825 } |
2083 | 1826 |
2084 /***************************************************************************** | 1827 /***************************************************************************** |
2085 XLIKE_output_blank | 1828 XLIKE_output_blank |
2086 | 1829 |
2428 struct frame *f = device_selected_frame (d); | 2171 struct frame *f = device_selected_frame (d); |
2429 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); | 2172 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); |
2430 XLIKE_WINDOW win = GET_XLIKE_WINDOW (f); | 2173 XLIKE_WINDOW win = GET_XLIKE_WINDOW (f); |
2431 XLIKE_GC gc = NULL; | 2174 XLIKE_GC gc = NULL; |
2432 XLIKE_GCVALUES gcv; | 2175 XLIKE_GCVALUES gcv; |
2433 XLIKE_COLOR tmp_fcolor, tmp_bcolor; | 2176 XLIKE_PIXEL tmp_fcolor, tmp_bcolor; |
2434 Lisp_Object tmp_pixel, frame; | 2177 Lisp_Object tmp_pixel, frame; |
2435 struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f)); | 2178 struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f)); |
2436 int flash_height; | 2179 int flash_height; |
2437 | 2180 |
2438 frame = wrap_frame (f); | 2181 frame = wrap_frame (f); |
2439 | 2182 |
2440 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame); | 2183 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame); |
2441 XLIKE_SET_PIXCOLOR_COPY (tmp_fcolor, | 2184 tmp_fcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel)); |
2442 XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel)); | |
2443 tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame); | 2185 tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame); |
2444 XLIKE_SET_PIXCOLOR_COPY (tmp_bcolor, | 2186 tmp_bcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel)); |
2445 XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel)); | |
2446 memset (&gcv, ~0, sizeof (gcv)); /* initialize all slots to ~0 */ | 2187 memset (&gcv, ~0, sizeof (gcv)); /* initialize all slots to ~0 */ |
2447 XLIKE_SET_PIXCOLOR_NUM (gcv.foreground, | 2188 XLIKE_SET_GC_PIXEL (gcv.foreground, tmp_fcolor ^ tmp_bcolor); |
2448 (tmp_fcolor.pixel ^ tmp_bcolor.pixel)); | |
2449 gcv.function = XLIKE_GX_XOR; | 2189 gcv.function = XLIKE_GX_XOR; |
2450 gcv.graphics_exposures = XLIKE_FALSE; | 2190 gcv.graphics_exposures = XLIKE_FALSE; |
2451 gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (XDEVICE (f->device)), &gcv, | 2191 gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (XDEVICE (f->device)), &gcv, |
2452 XLIKE_GC_FOREGROUND | XLIKE_GC_FUNCTION | XLIKE_GC_EXPOSURES); | 2192 XLIKE_GC_FOREGROUND | XLIKE_GC_FUNCTION | XLIKE_GC_EXPOSURES); |
2453 default_face_height_and_width (frame, &flash_height, 0); | 2193 default_face_height_and_width (frame, &flash_height, 0); |