462
|
1 /* Gtk-specific glyphs and related.
|
|
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
|
|
4 Copyright (C) 1995, 1996 Ben Wing
|
|
5 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
6
|
|
7 This file is part of XEmacs.
|
|
8
|
|
9 XEmacs is free software; you can redistribute it and/or modify it
|
|
10 under the terms of the GNU General Public License as published by the
|
|
11 Free Software Foundation; either version 2, or (at your option) any
|
|
12 later version.
|
|
13
|
|
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
17 for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with XEmacs; see the file COPYING. If not, write to
|
|
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 Boston, MA 02111-1307, USA. */
|
|
23
|
|
24 /* Synched up with: Not in FSF. */
|
|
25 /* Gtk version by William Perry */
|
|
26
|
|
27 #ifndef _XEMACS_GLYPHS_GTK_H_
|
|
28 #define _XEMACS_GLYPHS_GTK_H_
|
|
29
|
|
30 #include "glyphs.h"
|
|
31
|
|
32 #ifdef HAVE_GTK
|
|
33
|
|
34 #include <gtk/gtk.h>
|
|
35
|
|
36 /****************************************************************************
|
|
37 * Image-Instance Object *
|
|
38 ****************************************************************************/
|
|
39
|
|
40 struct gtk_image_instance_data
|
|
41 {
|
|
42 GdkPixmap **pixmaps;
|
|
43 GdkCursor *cursor;
|
|
44
|
|
45 /* If depth>0, then that means that other colors were allocated when
|
|
46 this pixmap was loaded. These are they; we need to free them when
|
|
47 finalizing the image instance. */
|
|
48 GdkColormap *colormap;
|
|
49 unsigned long *pixels;
|
|
50 int npixels;
|
|
51
|
|
52 /* Should we hang on to the extra info from the XpmAttributes, like
|
|
53 the textual color table and the comments? Is that useful? */
|
|
54 };
|
|
55
|
|
56 struct gtk_subwindow_data
|
|
57 {
|
|
58 union
|
|
59 {
|
|
60 struct
|
|
61 {
|
|
62 GtkWidget *parent_window;
|
|
63 GtkWidget *clip_window;
|
|
64 } sub;
|
|
65 struct
|
|
66 {
|
|
67 GtkWidget *clip_window;
|
|
68 Lisp_Object widget;
|
|
69 guint x_offset;
|
|
70 guint y_offset;
|
|
71 gboolean added_to_fixed;
|
|
72 } wid;
|
|
73 } data;
|
|
74 };
|
|
75
|
|
76 void init_image_instance_from_gdk_pixmap (struct Lisp_Image_Instance *ii,
|
|
77 struct device *device,
|
|
78 GdkPixmap *gdk_pixmap,
|
|
79 int dest_mask,
|
|
80 Lisp_Object instantiator);
|
|
81
|
|
82 #define GTK_IMAGE_INSTANCE_DATA(i) ((struct gtk_image_instance_data *) (i)->data)
|
|
83
|
|
84 #define IMAGE_INSTANCE_GTK_PIXMAP(i) (GTK_IMAGE_INSTANCE_DATA (i)->pixmaps[0])
|
|
85 #define IMAGE_INSTANCE_GTK_PIXMAP_SLICE(i,slice) \
|
|
86 (GTK_IMAGE_INSTANCE_DATA (i)->pixmaps[slice])
|
|
87 #define IMAGE_INSTANCE_GTK_PIXMAP_SLICES(i) \
|
|
88 (GTK_IMAGE_INSTANCE_DATA (i)->pixmaps)
|
2082
|
89 #define IMAGE_INSTANCE_GTK_MASK(i) (GdkPixmap*)(IMAGE_INSTANCE_PIXMAP_MASK (i))
|
462
|
90 #define IMAGE_INSTANCE_GTK_CURSOR(i) (GTK_IMAGE_INSTANCE_DATA (i)->cursor)
|
|
91 #define IMAGE_INSTANCE_GTK_COLORMAP(i) (GTK_IMAGE_INSTANCE_DATA (i)->colormap)
|
|
92 #define IMAGE_INSTANCE_GTK_PIXELS(i) (GTK_IMAGE_INSTANCE_DATA (i)->pixels)
|
|
93 #define IMAGE_INSTANCE_GTK_NPIXELS(i) (GTK_IMAGE_INSTANCE_DATA (i)->npixels)
|
|
94
|
|
95 #define XIMAGE_INSTANCE_GTK_PIXMAP(i) \
|
|
96 IMAGE_INSTANCE_GTK_PIXMAP (XIMAGE_INSTANCE (i))
|
|
97 #define XIMAGE_INSTANCE_GTK_PIXMAP_SLICE(i) \
|
|
98 IMAGE_INSTANCE_GTK_PIXMAP_SLICE (XIMAGE_INSTANCE (i))
|
|
99 #define XIMAGE_INSTANCE_GTK_PIXMAP_SLICES(i) \
|
|
100 IMAGE_INSTANCE_GTK_PIXMAP_SLICES (XIMAGE_INSTANCE (i))
|
|
101 #define XIMAGE_INSTANCE_GTK_MASK(i) \
|
|
102 IMAGE_INSTANCE_GTK_MASK (XIMAGE_INSTANCE (i))
|
|
103 #define XIMAGE_INSTANCE_GTK_CURSOR(i) \
|
|
104 IMAGE_INSTANCE_GTK_CURSOR (XIMAGE_INSTANCE (i))
|
|
105 #define XIMAGE_INSTANCE_GTK_PIXELS(i) \
|
|
106 IMAGE_INSTANCE_GTK_PIXELS (XIMAGE_INSTANCE (i))
|
|
107 #define XIMAGE_INSTANCE_GTK_NPIXELS(i) \
|
|
108 IMAGE_INSTANCE_GTK_NPIXELS (XIMAGE_INSTANCE (i))
|
|
109
|
|
110 /* Subwindow / widget stuff */
|
|
111 #define GTK_SUBWINDOW_INSTANCE_DATA(i) ((struct gtk_subwindow_data *) (i)->data)
|
|
112
|
|
113 #define IMAGE_INSTANCE_GTK_SUBWINDOW_PARENT(i) \
|
|
114 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.sub.parent_window)
|
|
115 #define IMAGE_INSTANCE_GTK_CLIPWINDOW(i) \
|
|
116 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.sub.clip_window)
|
|
117 #define IMAGE_INSTANCE_GTK_WIDGET_XOFFSET(i) \
|
|
118 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.wid.x_offset)
|
|
119 #define IMAGE_INSTANCE_GTK_WIDGET_YOFFSET(i) \
|
|
120 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.wid.y_offset)
|
|
121 #define IMAGE_INSTANCE_GTK_WIDGET_LWID(i) \
|
|
122 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.wid.id)
|
|
123 #define IMAGE_INSTANCE_GTK_CLIPWIDGET(i) \
|
|
124 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.wid.clip_window)
|
|
125 #define IMAGE_INSTANCE_GTK_ALREADY_PUT(i) \
|
|
126 (GTK_SUBWINDOW_INSTANCE_DATA (i)->data.wid.added_to_fixed)
|
|
127 #define IMAGE_INSTANCE_GTK_SUBWINDOW_ID(i) \
|
|
128 ((GdkWindow *) & IMAGE_INSTANCE_SUBWINDOW_ID (i))
|
|
129 #define IMAGE_INSTANCE_GTK_WIDGET_ID(i) \
|
|
130 ((GtkWidget *) & IMAGE_INSTANCE_SUBWINDOW_ID (i))
|
|
131
|
|
132 #define XIMAGE_INSTANCE_GTK_SUBWINDOW_PARENT(i) \
|
|
133 IMAGE_INSTANCE_GTK_SUBWINDOW_PARENT (XIMAGE_INSTANCE (i))
|
|
134 #define XIMAGE_INSTANCE_GTK_SUBWINDOW_DISPLAY(i) \
|
|
135 IMAGE_INSTANCE_GTK_SUBWINDOW_DISPLAY (XIMAGE_INSTANCE (i))
|
|
136 #define XIMAGE_INSTANCE_GTK_WIDGET_XOFFSET(i) \
|
|
137 IMAGE_INSTANCE_GTK_WIDGET_XOFFSET (XIMAGE_INSTANCE (i))
|
|
138 #define XIMAGE_INSTANCE_GTK_WIDGET_YOFFSET(i) \
|
|
139 IMAGE_INSTANCE_GTK_WIDGET_YOFFSET (XIMAGE_INSTANCE (i))
|
|
140 #define XIMAGE_INSTANCE_GTK_WIDGET_LWID(i) \
|
|
141 IMAGE_INSTANCE_GTK_WIDGET_LWID (XIMAGE_INSTANCE (i))
|
|
142 #define XIMAGE_INSTANCE_GTK_CLIPWIDGET(i) \
|
|
143 IMAGE_INSTANCE_GTK_CLIPWIDGET (XIMAGE_INSTANCE (i))
|
|
144 #define XIMAGE_INSTANCE_GTK_CLIPWINDOW(i) \
|
|
145 IMAGE_INSTANCE_GTK_CLIPWINDOW (XIMAGE_INSTANCE (i))
|
|
146 #define XIMAGE_INSTANCE_GTK_WIDGET_ID(i) \
|
|
147 IMAGE_INSTANCE_GTK_WIDGET_ID (XIMAGE_INSTANCE (i))
|
|
148
|
|
149 #define DOMAIN_GTK_WIDGET(domain) \
|
|
150 ((IMAGE_INSTANCEP (domain) && \
|
|
151 GTK_SUBWINDOW_INSTANCE_DATA (XIMAGE_INSTANCE (domain))) ? \
|
|
152 XIMAGE_INSTANCE_GTK_WIDGET_ID (domain) : \
|
|
153 FRAME_GTK_CONTAINER_WIDGET (f) (DOMAIN_XFRAME (domain)))
|
|
154
|
|
155 #endif /* HAVE_GTK */
|
|
156 #endif /* _XEMACS_GLYPHS_GTK_H_ */
|