Mercurial > hg > xemacs-beta
annotate src/console-xlike-inc.h @ 5283:be436ac36ba4
Don't share a counter when checking for circularity, list_merge().
src/ChangeLog addition:
2010-10-12 Aidan Kehoe <kehoea@parhasard.net>
* fns.c (list_merge):
Circularity checking here needs to be done independently for each
list, they can't share a loop counter. Thank you for the bug
report, Robert Pluim!
tests/ChangeLog addition:
2010-10-12 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Make sure circularity checking with #'merge is sane.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 12 Oct 2010 18:14:12 +0100 |
parents | 97eb4942aec8 |
children | 308d34e9f07d |
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 | 37 Instead, we handle the situation by the following: |
38 | |
39 (1) In cases where there are lots of individual differences, we have | |
40 only one copy, placed in a file called *-xlike-inc.c | |
41 (e.g. redisplay-xlike-inc.c), and conditionalize using ifdefs. Because | |
42 we can compile with both X and GTK at once, we include this file inside | |
43 of the appropriate device-specific file (e.g. redisplay-gtk.c or | |
44 redisplay-x.c). The `inc' in *-xlike-inc.c indicates that this is a | |
45 file meant to be included in another file, despite the fact that it is a | |
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 | 50 *-xlike-inc.c file. |
51 | |
52 (2) For code that is identical in both versions, or where it's possible | |
53 to have only one copy at runtime through some other means, we name | |
54 the file *-xlike.c. This is a normal file, not included in some other | |
55 file. An example of "other means" is toolbar-xlike.c, where all | |
56 functions are passed a frame or device, and it's possible to do run-time | |
57 conditionalization based on the device type. (This isn't currently the | |
58 case but will be soon once the related changes from my `hg-fixup' | |
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 | 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 |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4917
diff
changeset
|
93 # include "fontcolor-x-impl.h" |
4908
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 |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4917
diff
changeset
|
104 # include "fontcolor-gtk-impl.h" |
4908
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 |
5080
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4917
diff
changeset
|
172 #define XLIKE_GC_TS_X_ORIGIN GCTileStipXOrigin |
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4917
diff
changeset
|
173 #define XLIKE_GC_TS_Y_ORIGIN GCTileStipYOrigin |
4908
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
174 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
175 #define XLIKE_GX_COPY GXcopy |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
176 #define XLIKE_GX_XOR GXxor |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
177 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
178 #define XLIKE_FILL_STIPPLED FillStippled |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
179 #define XLIKE_FILL_OPAQUE_STIPPLED FillOpaqueStippled |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
180 #define XLIKE_FILL_TILED FillTiled |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
181 #define XLIKE_FILL_SOLID FillSolid |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
182 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
183 /* functions */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
184 #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
|
185 #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
|
186 #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
|
187 #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
|
188 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
|
189 #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
|
190 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
|
191 #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
|
192 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
|
193 #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
|
194 #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
|
195 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
196 #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
|
197 #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
|
198 #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
|
199 #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
|
200 /* #### why not Unsorted? */ \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
201 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
|
202 #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
|
203 do \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
204 { \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
205 XSetClipMask (dpy, gc, None); \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
206 XSetClipOrigin (dpy, gc, 0, 0); \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
207 } \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
208 while (0) |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
209 #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
|
210 #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
|
211 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
|
212 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
213 #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
|
214 #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
|
215 #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
|
216 #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
|
217 #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
|
218 #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
|
219 #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
|
220 #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
|
221 #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
|
222 #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
|
223 #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
|
224 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
225 /************ End X flavor of XLIKE **********/ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
226 |
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 #else /* THIS_IS_GTK */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
229 |
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 /* Definitions implementing GTK flavor of XLIKE */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
232 /***************************************************************************/ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
233 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
234 #define XLIKE_NAME gtk |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
235 #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
|
236 #define USED_IF_GTK(var) var |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
237 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
238 /*types */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
239 typedef void * XLIKE_DISPLAY; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
240 typedef GdkWindow * XLIKE_WINDOW; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
241 typedef GdkGC * XLIKE_GC; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
242 typedef GdkRectangle XLIKE_RECTANGLE; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
243 typedef GdkGCValues XLIKE_GCVALUES; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
244 typedef GdkColor XLIKE_COLOR; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
245 typedef gulong XLIKE_PIXEL; |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
246 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
247 /* constants */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
248 #define XLIKE_NONE 0 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
249 #define XLIKE_FALSE FALSE |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
250 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
251 #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
|
252 #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
|
253 #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
|
254 #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
|
255 #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
|
256 #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
|
257 #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
|
258 #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
|
259 #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
|
260 #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
|
261 #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
|
262 #define XLIKE_GC_TILE GDK_GC_TILE |
5080
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4917
diff
changeset
|
263 #define XLIKE_GC_TS_X_ORIGIN GDK_GC_TS_X_ORIGIN |
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4917
diff
changeset
|
264 #define XLIKE_GC_TS_Y_ORIGIN GDK_GC_TS_Y_ORIGIN |
4908
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
265 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
266 #define XLIKE_GX_COPY GDK_COPY |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
267 #define XLIKE_GX_XOR GDK_XOR |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
268 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
269 #define XLIKE_FILL_STIPPLED GDK_STIPPLED |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
270 #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
|
271 #define XLIKE_FILL_TILED GDK_TILED |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
272 #define XLIKE_FILL_SOLID GDK_SOLID |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
273 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
274 /* functions */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
275 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
276 /* Avoid unused-variable warning involving D */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
277 #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
|
278 #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
|
279 #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
|
280 #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
|
281 (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
|
282 x, y, width, height)) |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
283 #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
|
284 (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
|
285 x, y, width, height)) |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
286 #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
|
287 (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
|
288 #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
|
289 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
|
290 #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
|
291 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
|
292 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
293 /* 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
|
294 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
|
295 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
|
296 #define XLIKE_DISPLAY_LINE_HEIGHT(dl) \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
297 ((dl)->ascent + (dl)->descent - (dl)->clip) |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
298 #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
|
299 #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
|
300 #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
|
301 do \ |
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 USED (dpy); \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
304 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
|
305 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
|
306 } \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
307 while (0) |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
308 #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
|
309 do \ |
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 USED (dpy); \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
312 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
|
313 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
|
314 } \ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
315 while (0) |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
316 #define XLIKE_FLUSH(dpy) gdk_flush () |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
317 #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
|
318 (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
|
319 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
320 #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
|
321 #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
|
322 #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
|
323 #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
|
324 #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
|
325 #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
|
326 #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
|
327 #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
|
328 #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
|
329 #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
|
330 #define XLIKE_FONT_NUM(val) (val) |
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 /************ End GTK flavor of XLIKE **********/ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
333 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
334 #endif /* (not) THIS_IS_X */ |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
335 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
336 |
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff
changeset
|
337 #endif /* INCLUDED_console_xlike_inc_h_ */ |