annotate src/console-xlike-inc.h @ 4917:fce43cb76a1c

xlike cleanup, documentation -------------------- ChangeLog entries follow: -------------------- man/ChangeLog addition: 2010-02-03 Ben Wing <ben@xemacs.org> * internals/internals.texi (Top): * internals/internals.texi (Evaluation; Stack Frames; Bindings): * internals/internals.texi (Ben's README): * internals/internals.texi (Consoles; Devices; Frames; Windows): * internals/internals.texi (Window Hierarchy): * internals/internals.texi (The Window Object): * internals/internals.texi (Modules for the Basic Displayable Lisp Objects): * internals/internals.texi (Window-System Support): * internals/internals.texi (Creating a Window-System Type): * internals/internals.texi (Discussion -- Garbage Collection): Update the part at the top about how to maintain the file with more tips. Add a chapter on "window-system support" describing in a general way how the support for different window systems/device types works, including the separation between device-independent and device-dependent parts, device methods, the specific device types and the "xlike" pseudo-type. src/ChangeLog addition: 2010-02-03 Ben Wing <ben@xemacs.org> * Makefile.in.in: * Makefile.in.in (x_objs): * Makefile.in.in (gtk_gui_objs): * console-xlike-inc.h: * depend: * device-x.c: * emacs.c: * gccache-gtk.h: * gccache-gtk.h (gc_cache_lookup): * gccache-x.c: * gccache-x.c (GCCACHE_HASH): * gccache-x.h: * toolbar-gtk.c: * toolbar-gtk.c (gtk_initialize_frame_toolbars): * toolbar-x.c: * toolbar-x.c (x_initialize_frame_toolbars): * toolbar-xlike.c: * toolbar-xlike.c (xlike_draw_blank_toolbar_button): * toolbar-xlike.c (xlike_output_toolbar_button): * toolbar-xlike.c (xlike_get_button_size): * toolbar-xlike.c (XLIKE_OUTPUT_BUTTONS_LOOP): * toolbar-xlike.c (xlike_output_toolbar): * toolbar-xlike.c (xlike_clear_toolbar): * toolbar-xlike.c (xlike_output_frame_toolbars): * toolbar-xlike.c (xlike_clear_frame_toolbars): * toolbar-xlike.c (xlike_redraw_exposed_toolbar): * toolbar-xlike.c (xlike_redraw_exposed_toolbars): * toolbar-xlike.c (xlike_redraw_frame_toolbars): * toolbar-xlike.h: * toolbar-xlike.h (xlike_clear_frame_toolbars): Rename some files to make them consistent with general naming rules: xgccache.c -> gccache-x.c xgccache.h -> gccache-x.h toolbar-common.c -> toolbar-xlike.c toolbar-common.h -> toolbar-xlike.h Fix include-file references. Also change the names of functions in now-named toolbar-xlike.c to be xlike_foo() instead of common_foo(). Add a longish comment in console-xlike-inc.h describing the "xlike" system, how it works and what the various files are used for.
author Ben Wing <ben@xemacs.org>
date Wed, 03 Feb 2010 02:46:50 -0600
parents a6c778975d7d
children 5502045ec510 8b2f75cecb89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
1 /* Definitions for use in *-xlike-inc.c files.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
2 Copyright (C) 2010 Ben Wing.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
3
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
4 This file is part of XEmacs.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
5
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
9 later version.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
10
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
14 for more details.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
15
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
20
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
22
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
23 #ifndef INCLUDED_console_xlike_inc_h_
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
24 #define INCLUDED_console_xlike_inc_h_
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
25
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
26 /* X and GTK are quite similar, since GTK based its structure on Xlib.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
27 However, there are many small differences. Creating two separate
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
28 versions of the code, as Bill Perry did originally, is easier to code
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
29 but hard to maintain and leads to bit rot. On the other hand, trying to
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
30 abstract out into device methods, as is done generally for different
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
31 window systems, gets very hairy very quickly because the differences are
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
32 on the level of individual library functions, constants and types, of
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
33 which there are large number. Abstracting them into device methods
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
34 would lead to a large number of very small functions and very
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
35 hard-to-read code.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
36
4917
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
37 Instead, we handle the situation by the following:
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
38
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
39 (1) In cases where there are lots of individual differences, we have
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
40 only one copy, placed in a file called *-xlike-inc.c
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
41 (e.g. redisplay-xlike-inc.c), and conditionalize using ifdefs. Because
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
42 we can compile with both X and GTK at once, we include this file inside
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
43 of the appropriate device-specific file (e.g. redisplay-gtk.c or
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
44 redisplay-x.c). The `inc' in *-xlike-inc.c indicates that this is a
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
45 file meant to be included in another file, despite the fact that it is a
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
46 .c file.
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
47
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
48 To signal which variety of "xlike" we are compiling for, either
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
49 THIS_IS_X or THIS_IS_GTK needs to be defined, prior to including the
4917
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
50 *-xlike-inc.c file.
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
51
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
52 (2) For code that is identical in both versions, or where it's possible
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
53 to have only one copy at runtime through some other means, we name
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
54 the file *-xlike.c. This is a normal file, not included in some other
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
55 file. An example of "other means" is toolbar-xlike.c, where all
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
56 functions are passed a frame or device, and it's possible to do run-time
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
57 conditionalization based on the device type. (This isn't currently the
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
58 case but will be soon once the related changes from my `hg-fixup'
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
59 workspace are checked in. --ben) */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
60
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
61
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
62 /* About the representation of color below:
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
63
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
64 X has two ways of representing a color: (a) as an unsigned long
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
65 representing a color pixel value, i.e. the actual value stored in memory
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
66 or a file at a particular pixel location to indicate that the pixel
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
67 takes on a specific color; and (b) an XColor structure, which
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
68 encapsulates both the RGB components of a color and the associated color
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
69 pixel value.
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
70
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
71 We call the former type XLIKE_PIXEL and the latter XLIKE_COLOR, along
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
72 with routines to convert from one to the other. Differences between the
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
73 two in specific functions and structures should be abstracted using the
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
74 XLIKE_FOO() routines, e.g. XLIKE_SET_GC_COLOR(). */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
75
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
76 #if defined (THIS_IS_X) && defined (THIS_IS_GTK)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
77 #error "Exactly one of THIS_IS_X and THIS_IS_GTK may be defined."
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
78 #endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
79
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
80 #if !defined (THIS_IS_X) && !defined (THIS_IS_GTK)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
81 #error "Either THIS_IS_X or THIS_IS_GTK must be defined."
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
82 #endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
83
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
84 #ifdef THIS_IS_X
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
85 # include "console-x-impl.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
86 # ifdef NEED_GCCACHE_H
4917
fce43cb76a1c xlike cleanup, documentation
Ben Wing <ben@xemacs.org>
parents: 4916
diff changeset
87 # include "gccache-x.h"
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
88 # endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
89 # ifdef NEED_GLYPHS_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
90 # include "glyphs-x.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
91 # endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
92 # ifdef NEED_OBJECTS_IMPL_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
93 # include "objects-x-impl.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
94 # endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
95 #else /* THIS_IS_GTK */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
96 # include "console-gtk-impl.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
97 # ifdef NEED_GCCACHE_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
98 # include "gccache-gtk.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
99 # endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
100 # ifdef NEED_GLYPHS_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
101 # include "glyphs-gtk.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
102 # endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
103 # ifdef NEED_OBJECTS_IMPL_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
104 # include "objects-gtk-impl.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
105 # endif
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
106 #endif /* THIS_IS_GTK */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
107
4916
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
108 /* Just because we have XFT support doesn't mean we should use it.
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
109 In particular, the xlike routines are used by both X and GTK code,
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
110 but XFT stuff is X-specific. HAVE_XFT will still be defined when
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
111 the GTK flavor is active, but we don't want to trigger the XFT code
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
112 in this case. We could just undefine HAVE_XFT but I'd rather make
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
113 it clearer that something else is going on. --ben */
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
114
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
115 #if defined (THIS_IS_X) && defined (HAVE_XFT)
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
116 #define USE_XFT
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
117 #define USE_XFT_MENUBARS
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
118 #define USE_XFT_TABS
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
119 #define USE_XFT_GAUGES
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
120 #endif
a6c778975d7d split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents: 4908
diff changeset
121
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
122 /***************************************************************************/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
123 /* Common definitions */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
124 /***************************************************************************/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
125
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
126 #define XLIKE_PASTE_1(a,b) a##_##b
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
127 #define XLIKE_PASTE(a,b) XLIKE_PASTE_1(a,b)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
128 #define XFUN(name) XLIKE_PASTE (XLIKE_NAME, name)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
129
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
130 #define XLIKE_CONSOLE_HAS_METHOD_1(xlike, name) CONSOLE_HAS_METHOD (xlike, name)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
131 #define XLIKE_CONSOLE_HAS_METHOD(name) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
132 XLIKE_CONSOLE_HAS_METHOD_1 (XLIKE_NAME, name)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
133
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
134 #define XCOLOR_INSTANCE_XLIKE_COLOR(x) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
135 COLOR_INSTANCE_XLIKE_COLOR (XCOLOR_INSTANCE (x))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
136
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
137 #ifdef THIS_IS_X
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
138
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
139 /***************************************************************************/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
140 /* Definitions implementing X flavor of XLIKE */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
141 /***************************************************************************/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
142
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
143 #define XLIKE_NAME x
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
144 #define USED_IF_X(var) var
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
145 #define USED_IF_GTK(var) UNUSED (var)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
146
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
147 /* types */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
148 typedef Display * XLIKE_DISPLAY;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
149 typedef Window XLIKE_WINDOW;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
150 typedef GC XLIKE_GC;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
151 typedef XRectangle XLIKE_RECTANGLE;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
152 typedef XGCValues XLIKE_GCVALUES;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
153 typedef XColor XLIKE_COLOR;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
154 typedef unsigned long XLIKE_PIXEL;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
155
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
156 /* constants */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
157 #define XLIKE_NONE None
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
158 #define XLIKE_FALSE False
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
159
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
160 #define XLIKE_GC_BACKGROUND GCBackground
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
161 #define XLIKE_GC_CLIP_MASK GCClipMask
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
162 #define XLIKE_GC_CLIP_X_ORIGIN GCClipXOrigin
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
163 #define XLIKE_GC_CLIP_Y_ORIGIN GCClipYOrigin
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
164 #define XLIKE_GC_EXPOSURES GCGraphicsExposures
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
165 #define XLIKE_GC_FILL GCFillStyle
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
166 #define XLIKE_GC_FONT GCFont
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
167 #define XLIKE_GC_FOREGROUND GCForeground
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
168 #define XLIKE_GC_FUNCTION GCFunction
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
169 #define XLIKE_GC_LINE_WIDTH GCLineWidth
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
170 #define XLIKE_GC_STIPPLE GCStipple
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
171 #define XLIKE_GC_TILE GCTile
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
172
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
173 #define XLIKE_GX_COPY GXcopy
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
174 #define XLIKE_GX_XOR GXxor
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
175
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
176 #define XLIKE_FILL_STIPPLED FillStippled
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
177 #define XLIKE_FILL_OPAQUE_STIPPLED FillOpaqueStippled
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
178 #define XLIKE_FILL_TILED FillTiled
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
179 #define XLIKE_FILL_SOLID FillSolid
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
180
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
181 /* functions */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
182 #define GET_XLIKE_DISPLAY(d) DEVICE_X_DISPLAY (d)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
183 #define GET_XLIKE_X_DISPLAY(d) DEVICE_X_DISPLAY (d)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
184 #define GET_XLIKE_WINDOW(w) XtWindow (FRAME_X_TEXT_WIDGET (f))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
185 #define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
186 XFillRectangle (dpy, x_win, gc, x, y, width, height)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
187 #define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
188 XDrawRectangle (dpy, x_win, gc, x, y, width, height)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
189 #define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
190 XDrawLine (dpy, x_win, gc, x1, y1, x2, y2)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
191 #define XLIKE_TEXT_WIDTH(fi, ptr, len) XTextWidth (fi, (char *) ptr, len)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
192 #define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) XTextWidth16 (fi, (XChar2b *) ptr, len)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
193
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
194 #define XLIKE_DISPLAY_LINE_HEIGHT(dl) DISPLAY_LINE_HEIGHT (dl)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
195 #define XLIKE_DISPLAY_LINE_YPOS(dl) DISPLAY_LINE_YPOS (dl)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
196 #define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((dl)->top_clip)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
197 #define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
198 /* #### why not Unsorted? */ \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
199 XSetClipRectangles (dpy, gc, xorig, yorig, prect, 1, YXBanded)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
200 #define XLIKE_CLEAR_CLIP_MASK(dpy, gc) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
201 do \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
202 { \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
203 XSetClipMask (dpy, gc, None); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
204 XSetClipOrigin (dpy, gc, 0, 0); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
205 } \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
206 while (0)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
207 #define XLIKE_FLUSH(dpy) XSync (dpy, False)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
208 #define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
209 XClearArea (dpy, win, x, y, width, height, False)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
210
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
211 #define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_X_MASK
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
212 #define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_X_PIXMAP
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
213 #define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_X_COLOR
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
214 #define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_X_FONT
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
215 #define DEVICE_XLIKE_GC_CACHE DEVICE_X_GC_CACHE
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
216 #define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_X_GRAY_PIXMAP
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
217 #define XLIKE_SET_GC_FILL(gc, style) ((gc).fill_style = (style))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
218 #define XLIKE_COLOR_TO_PIXEL(c) ((c).pixel)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
219 #define XLIKE_SET_GC_COLOR(lval, rval) ((lval) = (rval).pixel)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
220 #define XLIKE_SET_GC_PIXEL(lval, rval) ((lval) = (rval))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
221 #define XLIKE_FONT_NUM(val) ((val)->fid)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
222
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
223 /************ End X flavor of XLIKE **********/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
224
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
225
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
226 #else /* THIS_IS_GTK */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
227
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
228 /***************************************************************************/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
229 /* Definitions implementing GTK flavor of XLIKE */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
230 /***************************************************************************/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
231
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
232 #define XLIKE_NAME gtk
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
233 #define USED_IF_X(var) UNUSED (var)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
234 #define USED_IF_GTK(var) var
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
235
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
236 /*types */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
237 typedef void * XLIKE_DISPLAY;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
238 typedef GdkWindow * XLIKE_WINDOW;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
239 typedef GdkGC * XLIKE_GC;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
240 typedef GdkRectangle XLIKE_RECTANGLE;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
241 typedef GdkGCValues XLIKE_GCVALUES;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
242 typedef GdkColor XLIKE_COLOR;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
243 typedef gulong XLIKE_PIXEL;
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
244
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
245 /* constants */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
246 #define XLIKE_NONE 0
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
247 #define XLIKE_FALSE FALSE
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
248
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
249 #define XLIKE_GC_BACKGROUND GDK_GC_BACKGROUND
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
250 #define XLIKE_GC_CLIP_MASK GDK_GC_CLIP_MASK
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
251 #define XLIKE_GC_CLIP_X_ORIGIN GDK_GC_CLIP_X_ORIGIN
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
252 #define XLIKE_GC_CLIP_Y_ORIGIN GDK_GC_CLIP_Y_ORIGIN
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
253 #define XLIKE_GC_EXPOSURES GDK_GC_EXPOSURES
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
254 #define XLIKE_GC_FILL GDK_GC_FILL
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
255 #define XLIKE_GC_FONT GDK_GC_FONT
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
256 #define XLIKE_GC_FOREGROUND GDK_GC_FOREGROUND
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
257 #define XLIKE_GC_FUNCTION GDK_GC_FUNCTION
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
258 #define XLIKE_GC_LINE_WIDTH GDK_GC_LINE_WIDTH
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
259 #define XLIKE_GC_STIPPLE GDK_GC_STIPPLE
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
260 #define XLIKE_GC_TILE GDK_GC_TILE
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
261
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
262 #define XLIKE_GX_COPY GDK_COPY
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
263 #define XLIKE_GX_XOR GDK_XOR
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
264
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
265 #define XLIKE_FILL_STIPPLED GDK_STIPPLED
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
266 #define XLIKE_FILL_OPAQUE_STIPPLED GDK_OPAQUE_STIPPLED
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
267 #define XLIKE_FILL_TILED GDK_TILED
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
268 #define XLIKE_FILL_SOLID GDK_SOLID
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
269
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
270 /* functions */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
271
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
272 /* Avoid unused-variable warning involving D */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
273 #define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
274 #define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
275 #define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
276 #define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
277 (USED (dpy), gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
278 x, y, width, height))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
279 #define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
280 (USED (dpy), gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE, \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
281 x, y, width, height))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
282 #define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
283 (USED (dpy), gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
284 #define XLIKE_TEXT_WIDTH(fi, ptr, len) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
285 gdk_text_width (fi, (char *) ptr, len)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
286 #define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
287 gdk_text_width_wc (fi, (GdkWChar *) ptr, len)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
288
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
289 /* FIXME: This is totally bogus. It removes dl->top_clip from the
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
290 equations. If there is a bug involving this, fix it properly!
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
291 Or just ensure that top_clip is 0. */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
292 #define XLIKE_DISPLAY_LINE_HEIGHT(dl) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
293 ((dl)->ascent + (dl)->descent - (dl)->clip)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
294 #define XLIKE_DISPLAY_LINE_YPOS(dl) ((dl)->ypos - (dl)->ascent)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
295 #define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) (0)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
296 #define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
297 do \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
298 { \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
299 USED (dpy); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
300 gdk_gc_set_clip_rectangle (gc, prect); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
301 gdk_gc_set_clip_origin (gc, xorig, yorig); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
302 } \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
303 while (0)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
304 #define XLIKE_CLEAR_CLIP_MASK(dpy, gc) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
305 do \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
306 { \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
307 USED (dpy); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
308 gdk_gc_set_clip_rectangle (gc, NULL); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
309 gdk_gc_set_clip_origin (gc, 0, 0); \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
310 } \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
311 while (0)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
312 #define XLIKE_FLUSH(dpy) gdk_flush ()
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
313 #define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
314 (USED (dpy), gdk_window_clear_area (win, x, y, width, height))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
315
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
316 #define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_GTK_MASK
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
317 #define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_GTK_PIXMAP
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
318 #define COLOR_INSTANCE_XLIKE_COLOR(ci) (*COLOR_INSTANCE_GTK_COLOR (ci))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
319 #define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_GTK_FONT
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
320 #define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_GTK_GRAY_PIXMAP
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
321 #define DEVICE_XLIKE_GC_CACHE DEVICE_GTK_GC_CACHE
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
322 #define XLIKE_SET_GC_FILL(gc, style) ((gc).fill = (style))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
323 #define XLIKE_COLOR_TO_PIXEL(c) ((c).pixel)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
324 #define XLIKE_SET_GC_COLOR(lval, rval) ((lval) = (rval))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
325 #define XLIKE_SET_GC_PIXEL(lval, rval) ((lval).pixel = (rval))
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
326 #define XLIKE_FONT_NUM(val) (val)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
327
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
328 /************ End GTK flavor of XLIKE **********/
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
329
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
330 #endif /* (not) THIS_IS_X */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
331
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
332
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
333 #endif /* INCLUDED_console_xlike_inc_h_ */