annotate src/glyphs-widget.c @ 388:aabb7f5b1c81 r21-2-9

Import from CVS: tag r21-2-9
author cvs
date Mon, 13 Aug 2007 11:09:42 +0200
parents bbff43aa5eb7
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
1 /* Widget-specific glyph objects.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
2 Copyright (C) 1998 Andy Piper
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
3
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
4 This file is part of XEmacs.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
5
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
9 later version.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
10
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
14 for more details.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
15
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
20
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
22
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
23 /* written by Andy Piper <andy@xemacs.org> */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
24
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
25 #include <config.h>
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
26 #include "lisp.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
27 #include "lstream.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
28 #include "console.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
29 #include "device.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
30 #include "faces.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
31 #include "glyphs.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
32 #include "objects.h"
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
33 #include "bytecode.h"
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
34 #include "window.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
35 #include "buffer.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
36 #include "frame.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
37 #include "insdel.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
38 #include "opaque.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
39
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
40 DEFINE_IMAGE_INSTANTIATOR_FORMAT (button);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
41 DEFINE_IMAGE_INSTANTIATOR_FORMAT (combo);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
42 Lisp_Object Qcombo;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
43 DEFINE_IMAGE_INSTANTIATOR_FORMAT (edit);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
44 Lisp_Object Qedit;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
45 DEFINE_IMAGE_INSTANTIATOR_FORMAT (scrollbar);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
46 Lisp_Object Qscrollbar;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
47 DEFINE_IMAGE_INSTANTIATOR_FORMAT (widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
48 #if 0
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
49 DEFINE_IMAGE_INSTANTIATOR_FORMAT (group);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
50 Lisp_Object Qgroup;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
51 #endif
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
52 DEFINE_IMAGE_INSTANTIATOR_FORMAT (label);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
53 Lisp_Object Qlabel;
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
54 DEFINE_IMAGE_INSTANTIATOR_FORMAT (progress);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
55 Lisp_Object Qprogress;
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
56
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
57 Lisp_Object Q_descriptor, Q_height, Q_width, Q_properties, Q_items;
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
58 Lisp_Object Q_image, Q_text, Q_percent;
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
59
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
60 #define WIDGET_BORDER_HEIGHT 2
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
61 #define WIDGET_BORDER_WIDTH 4
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
62
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
63 /* TODO:
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
64 - more complex controls.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
65 - tooltips for controls.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
66 */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
67
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
68 /* In windows normal windows work in pixels, dialog boxes work in
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
69 dialog box units. Why? sigh. We could reuse the metrics for dialogs
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
70 if this were not the case. As it is we have to position things
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
71 pixel wise. I'm not even sure that X has this problem at least for
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
72 buttons in groups. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
73 Lisp_Object
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
74 widget_face_font_info (Lisp_Object domain, Lisp_Object face,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
75 int *height, int *width)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
76 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
77 Lisp_Object font_instance = FACE_FONT (face, domain, Vcharset_ascii);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
78
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
79 if (height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
80 *height = XFONT_INSTANCE (font_instance)->height;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
81 if (width)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
82 *width = XFONT_INSTANCE (font_instance)->width;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
83
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
84 return font_instance;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
85 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
86
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
87 void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
88 widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
89 int th, int tw,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
90 int* height, int* width)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
91 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
92 int ch=0, cw=0;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
93 widget_face_font_info (domain, face, &ch, &cw);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
94 if (height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
95 *height = th * (ch + 2 * WIDGET_BORDER_HEIGHT);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
96 if (width)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
97 *width = tw * cw + 2 * WIDGET_BORDER_WIDTH;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
98 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
99
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
100 static int
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
101 widget_possible_dest_types (void)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
102 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
103 return IMAGE_WIDGET_MASK;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
104 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
105
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
106 static void
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
107 check_valid_glyph_or_image (Lisp_Object data)
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
108 {
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
109 Lisp_Object glyph = data;
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
110 if (SYMBOLP (data))
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
111 glyph = XSYMBOL (data)->value;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
112
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
113 if (IMAGE_INSTANCEP (glyph))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
114 CHECK_IMAGE_INSTANCE (glyph);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
115 else if (!CONSP (glyph))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
116 CHECK_BUFFER_GLYPH (glyph);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
117 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
118
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
119 static void
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
120 check_valid_anything (Lisp_Object data)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
121 {
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
122 }
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
123
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
124 static void
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
125 check_valid_callback (Lisp_Object data)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
126 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
127 if (!SYMBOLP (data)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
128 && !COMPILED_FUNCTIONP (data)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
129 && !CONSP (data))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
130 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
131 signal_simple_error (":callback must be a function or expression", data);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
132 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
133 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
134
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
135 static void
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
136 check_valid_symbol (Lisp_Object data)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
137 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
138 CHECK_SYMBOL (data);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
139 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
140
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
141 static void
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
142 check_valid_string_or_vector (Lisp_Object data)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
143 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
144 if (!STRINGP (data) && !VECTORP (data))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
145 signal_simple_error (":descriptor must be a string or a vector", data);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
146 }
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
147
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
148 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
149 check_valid_item_list (Lisp_Object data)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
150 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
151 Lisp_Object rest;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
152 Lisp_Object items;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
153 Fcheck_valid_plist (data);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
154
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
155 items = Fplist_get (data, Q_items, Qnil);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
156
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
157 CHECK_LIST (items);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
158 EXTERNAL_LIST_LOOP (rest, items)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
159 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
160 CHECK_STRING (XCAR (rest));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
161 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
162 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
163
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
164 /* wire widget property invocations to specific widgets ... The
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
165 problem we are solving here is that when instantiators get converted
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
166 to instances they lose some type information (they just become
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
167 subwindows or widgets for example). For widgets we need to preserve
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
168 this type information so that we can do widget specific operations on
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
169 the instances. This is encoded in the widget type
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
170 field. widget_property gets invoked by decoding the primary type
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
171 (Qwidget), widget property then invokes based on the secondary type
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
172 (Qedit for example). It is debatable that we should wire things in this
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
173 generalised way rather than treating widgets specially in
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
174 image_instance_property. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
175 static Lisp_Object
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
176 widget_property (Lisp_Object image_instance, Lisp_Object prop)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
177 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
178 struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
179 struct image_instantiator_methods* meths;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
180
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
181 /* first see if its a general property ... */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
182 if (!NILP (Fplist_member (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
183 return Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, Qnil);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
184
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
185 /* .. then try device specific methods ... */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
186 meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
187 IMAGE_INSTANCE_WIDGET_TYPE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
188 ERROR_ME_NOT);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
189 if (meths && HAS_IIFORMAT_METH_P (meths, property))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
190 return IIFORMAT_METH (meths, property, (image_instance, prop));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
191 /* ... then format specific methods ... */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
192 meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
193 ERROR_ME_NOT);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
194 if (meths && HAS_IIFORMAT_METH_P (meths, property))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
195 return IIFORMAT_METH (meths, property, (image_instance, prop));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
196 /* ... then fail */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
197 return Qunbound;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
198 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
199
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
200 static Lisp_Object
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
201 widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object val)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
202 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
203 struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
204 struct image_instantiator_methods* meths;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
205 Lisp_Object ret;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
206
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
207 /* try device specific methods first ... */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
208 meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
209 IMAGE_INSTANCE_WIDGET_TYPE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
210 ERROR_ME_NOT);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
211 if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
212 &&
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
213 !UNBOUNDP (ret =
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
214 IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
215 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
216 return ret;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
217 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
218 /* ... then format specific methods ... */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
219 meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
220 ERROR_ME_NOT);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
221 if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
222 &&
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
223 !UNBOUNDP (ret =
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
224 IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
225 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
226 return ret;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
227 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
228 /* we didn't do any device specific properties, so shove the property in our plist */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
229 IMAGE_INSTANCE_WIDGET_PROPS (ii)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
230 = Fplist_put (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, val);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
231 return val;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
232 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
233
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
234 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
235 widget_validate (Lisp_Object instantiator)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
236 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
237 Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
238 struct gui_item gui;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
239 if (NILP (desc))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
240 signal_simple_error ("Must supply :descriptor", instantiator);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
241
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
242 if (VECTORP (desc))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
243 gui_parse_item_keywords (desc, &gui);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
244
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
245 if (!NILP (find_keyword_in_vector (instantiator, Q_width))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
246 && !NILP (find_keyword_in_vector (instantiator, Q_pixel_width)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
247 signal_simple_error ("Must supply only one of :width and :pixel-width", instantiator);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
248
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
249 if (!NILP (find_keyword_in_vector (instantiator, Q_height))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
250 && !NILP (find_keyword_in_vector (instantiator, Q_pixel_height)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
251 signal_simple_error ("Must supply only one of :height and :pixel-height", instantiator);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
252 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
253
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
254 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
255 combo_validate (Lisp_Object instantiator)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
256 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
257 widget_validate (instantiator);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
258 if (NILP (find_keyword_in_vector (instantiator, Q_properties)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
259 signal_simple_error ("Must supply item list", instantiator);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
260 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
261
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
262 /* we need to convert things like glyphs to images, eval expressions
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
263 etc.*/
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
264 static Lisp_Object
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
265 widget_normalize (Lisp_Object inst, Lisp_Object console_type)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
266 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
267 /* This function can call lisp */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
268 Lisp_Object glyph = find_keyword_in_vector (inst, Q_image);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
269
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
270 /* we need to eval glyph if its an expression, we do this for the
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
271 same reasons we normalize file to data. */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
272 if (!NILP (glyph))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
273 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
274 int i;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
275 struct gcpro gcpro1;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
276 if (SYMBOLP (glyph))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
277 glyph = XSYMBOL (glyph)->value;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
278 GCPRO1 (glyph);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
279
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
280 if (CONSP (glyph))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
281 glyph = Feval (glyph);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
282 /* substitute the new glyph */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
283 for (i = 0; i < XVECTOR_LENGTH (inst); i++)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
284 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
285 if (EQ (Q_image, XVECTOR_DATA (inst)[i]))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
286 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
287 XVECTOR_DATA (inst)[i+1] = glyph;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
288 break;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
289 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
290 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
291 UNGCPRO;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
292 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
293 return inst;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
294 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
295
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
296 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
297 initialize_widget_image_instance (struct Lisp_Image_Instance *ii, Lisp_Object type)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
298 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
299 /* initialize_subwindow_image_instance (ii);*/
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
300 IMAGE_INSTANCE_WIDGET_TYPE (ii) = type;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
301 IMAGE_INSTANCE_WIDGET_PROPS (ii) = Qnil;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
302 IMAGE_INSTANCE_WIDGET_FACE (ii) = Vwidget_face;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
303 gui_item_init (&IMAGE_INSTANCE_WIDGET_ITEM (ii));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
304 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
305
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
306 /* Instantiate a button widget. Unfortunately instantiated widgets are
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
307 particular to a frame since they need to have a parent. It's not
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
308 like images where you just select the image into the context you
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
309 want to display it in and BitBlt it. So images instances can have a
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
310 many-to-one relationship with things you see, whereas widgets can
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
311 only be one-to-one (i.e. per frame) */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
312 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
313 widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
314 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
315 int dest_mask, Lisp_Object domain, int default_textheight,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
316 int default_pixheight)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
317 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
318 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
319 struct gui_item* pgui = &IMAGE_INSTANCE_WIDGET_ITEM (ii);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
320 Lisp_Object face = find_keyword_in_vector (instantiator, Q_face);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
321 Lisp_Object height = find_keyword_in_vector (instantiator, Q_height);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
322 Lisp_Object width = find_keyword_in_vector (instantiator, Q_width);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
323 Lisp_Object pixwidth = find_keyword_in_vector (instantiator, Q_pixel_width);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
324 Lisp_Object pixheight = find_keyword_in_vector (instantiator, Q_pixel_height);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
325 Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
326 Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
327 int pw=0, ph=0, tw=0, th=0;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
328
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
329 /* this just does pixel type sizing */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
330 subwindow_instantiate (image_instance, instantiator, pointer_fg, pointer_bg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
331 dest_mask, domain);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
332
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
333 if (!(dest_mask & IMAGE_WIDGET_MASK))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
334 incompatible_image_types (instantiator, dest_mask, IMAGE_WIDGET_MASK);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
335
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
336 initialize_widget_image_instance (ii, XVECTOR_DATA (instantiator)[0]);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
337
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
338 /* retrieve the fg and bg colors */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
339 if (!NILP (face))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
340 IMAGE_INSTANCE_WIDGET_FACE (ii) = Fget_face (face);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
341
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
342 /* data items for some widgets */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
343 IMAGE_INSTANCE_WIDGET_PROPS (ii) =
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
344 find_keyword_in_vector (instantiator, Q_properties);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
345
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
346 /* retrieve the gui item information. This is easy if we have been
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
347 provided with a vector, more difficult if we have just been given
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
348 keywords */
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
349 if (STRINGP (desc) || NILP (desc))
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
350 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
351 /* big cheat - we rely on the fact that a gui item looks like an instantiator */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
352 gui_parse_item_keywords_no_errors (instantiator, pgui);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
353 IMAGE_INSTANCE_WIDGET_TEXT (ii) = desc;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
354 }
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
355 else
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
356 gui_parse_item_keywords_no_errors (desc, pgui);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
357
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
358 /* normalize size information */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
359 if (!NILP (width))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
360 tw = XINT (width);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
361 if (!NILP (height))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
362 th = XINT (height);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
363 if (!NILP (pixwidth))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
364 pw = XINT (pixwidth);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
365 if (!NILP (pixheight))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
366 ph = XINT (pixheight);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
367
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
368 /* for a widget with an image pick up the dimensions from that */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
369 if (!NILP (glyph))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
370 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
371 if (!pw && !tw)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
372 pw = glyph_width (glyph, Qnil, DEFAULT_INDEX, domain)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
373 + 2 * WIDGET_BORDER_WIDTH;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
374 if (!ph && !th)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
375 ph = glyph_height (glyph, Qnil, DEFAULT_INDEX, domain)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
376 + 2 * WIDGET_BORDER_HEIGHT;
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
377 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
378
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
379 /* if we still don' t have sizes, guess from text size */
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
380 if (!tw && !pw && !NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
381 tw = XSTRING_LENGTH (IMAGE_INSTANCE_WIDGET_TEXT (ii));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
382 if (!th && !ph)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
383 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
384 if (default_textheight)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
385 th = default_textheight;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
386 else if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
387 th = 1;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
388 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
389 ph = default_pixheight;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
390 }
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
391
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
392 if (tw !=0 || th !=0)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
393 widget_text_to_pixel_conversion (domain,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
394 IMAGE_INSTANCE_WIDGET_FACE (ii),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
395 th, tw, th ? &ph : 0, tw ? &pw : 0);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
396
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
397 IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = pw;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
398 IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = ph;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
399 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
400
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
401 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
402 widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
403 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
404 int dest_mask, Lisp_Object domain)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
405 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
406 widget_instantiate_1 (image_instance, instantiator, pointer_fg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
407 pointer_bg, dest_mask, domain, 1, 0);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
408 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
409
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
410 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
411 combo_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
412 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
413 int dest_mask, Lisp_Object domain)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
414 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
415 Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
416 Q_items, Qnil);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
417 int len;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
418 GET_LIST_LENGTH (data, len);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
419 widget_instantiate_1 (image_instance, instantiator, pointer_fg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
420 pointer_bg, dest_mask, domain, len + 1, 0);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
421 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
422
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
423 /* Instantiate a static control */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
424 static void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
425 static_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
426 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
427 int dest_mask, Lisp_Object domain)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
428 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
429 widget_instantiate_1 (image_instance, instantiator, pointer_fg,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
430 pointer_bg, dest_mask, domain, 0, 4);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
431 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
432
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
433
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
434 /************************************************************************/
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
435 /* initialization */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
436 /************************************************************************/
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
437
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
438 void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
439 syms_of_glyphs_widget (void)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
440 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
441 defkeyword (&Q_descriptor, ":descriptor");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
442 defkeyword (&Q_height, ":height");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
443 defkeyword (&Q_width, ":width");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
444 defkeyword (&Q_properties, ":properties");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
445 defkeyword (&Q_items, ":items");
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
446 defkeyword (&Q_image, ":image");
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
447 defkeyword (&Q_percent, ":percent");
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
448 defkeyword (&Q_text, "text");
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
449 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
450
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
451 void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
452 image_instantiator_format_create_glyphs_widget (void)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
453 {
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
454 #define VALID_GUI_KEYWORDS(type) \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
455 IIFORMAT_VALID_KEYWORD (type, Q_active, check_valid_anything); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
456 IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
457 IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
458 IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
459 IIFORMAT_VALID_KEYWORD (type, Q_selected, check_valid_anything); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
460 IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
461 IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
462 IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
463 IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
464 IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
465 IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
466 IIFORMAT_VALID_KEYWORD (type, Q_callback, check_valid_callback); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
467 IIFORMAT_VALID_KEYWORD (type, Q_descriptor, check_valid_string_or_vector)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
468
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
469 #define VALID_WIDGET_KEYWORDS(type) \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
470 IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
471 IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
472 IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
473 IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int); \
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
474 IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
475
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
476 /* we only do this for properties */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
477 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM (widget, "widget");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
478 IIFORMAT_HAS_METHOD (widget, property);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
479 IIFORMAT_HAS_METHOD (widget, set_property);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
480
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
481 /* widget image-instantiator types - buttons */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
482 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (button, "button");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
483 IIFORMAT_HAS_SHARED_METHOD (button, validate, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
484 IIFORMAT_HAS_SHARED_METHOD (button, possible_dest_types, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
485 IIFORMAT_HAS_SHARED_METHOD (button, instantiate, widget);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
486 IIFORMAT_HAS_SHARED_METHOD (button, normalize, widget);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
487 IIFORMAT_VALID_KEYWORD (button, Q_image, check_valid_glyph_or_image);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
488 VALID_WIDGET_KEYWORDS (button);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
489 VALID_GUI_KEYWORDS (button);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
490
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
491 /* edit fields */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
492 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (edit, "edit");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
493 IIFORMAT_HAS_SHARED_METHOD (edit, validate, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
494 IIFORMAT_HAS_SHARED_METHOD (edit, possible_dest_types, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
495 IIFORMAT_HAS_SHARED_METHOD (edit, instantiate, widget);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
496 VALID_WIDGET_KEYWORDS (edit);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
497 VALID_GUI_KEYWORDS (edit);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
498
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
499 /* combo box */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
500 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (combo, "combo");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
501 IIFORMAT_HAS_METHOD (combo, validate);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
502 IIFORMAT_HAS_SHARED_METHOD (combo, possible_dest_types, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
503 IIFORMAT_HAS_METHOD (combo, instantiate);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
504 VALID_GUI_KEYWORDS (combo);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
505
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
506 IIFORMAT_VALID_KEYWORD (combo, Q_width, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
507 IIFORMAT_VALID_KEYWORD (combo, Q_height, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
508 IIFORMAT_VALID_KEYWORD (combo, Q_pixel_width, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
509 IIFORMAT_VALID_KEYWORD (combo, Q_face, check_valid_face);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
510 IIFORMAT_VALID_KEYWORD (combo, Q_properties, check_valid_item_list);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
511
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
512 /* scrollbar */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
513 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (scrollbar, "scrollbar");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
514 IIFORMAT_HAS_SHARED_METHOD (scrollbar, validate, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
515 IIFORMAT_HAS_SHARED_METHOD (scrollbar, possible_dest_types, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
516 IIFORMAT_HAS_SHARED_METHOD (scrollbar, instantiate, widget);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
517 VALID_GUI_KEYWORDS (scrollbar);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
518
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
519 IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
520 IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
521 IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
522
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
523 /* progress guage */
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
524 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (progress, "progress");
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
525 IIFORMAT_HAS_SHARED_METHOD (progress, validate, widget);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
526 IIFORMAT_HAS_SHARED_METHOD (progress, possible_dest_types, widget);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
527 IIFORMAT_HAS_SHARED_METHOD (progress, instantiate, widget);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
528 VALID_WIDGET_KEYWORDS (progress);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
529 VALID_GUI_KEYWORDS (progress);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
530
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
531 /* labels */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
532 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (label, "label");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
533 IIFORMAT_HAS_SHARED_METHOD (label, possible_dest_types, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
534 IIFORMAT_HAS_SHARED_METHOD (label, instantiate, static);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
535 VALID_WIDGET_KEYWORDS (label);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
536 IIFORMAT_VALID_KEYWORD (label, Q_descriptor, check_valid_string);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
537
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
538 #if 0
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
539 /* group */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
540 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (group, "group");
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
541 IIFORMAT_HAS_SHARED_METHOD (group, possible_dest_types, widget);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
542 IIFORMAT_HAS_METHOD (group, instantiate);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
543
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
544 IIFORMAT_VALID_KEYWORD (group, Q_width, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
545 IIFORMAT_VALID_KEYWORD (group, Q_height, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
546 IIFORMAT_VALID_KEYWORD (group, Q_pixel_width, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
547 IIFORMAT_VALID_KEYWORD (group, Q_pixel_height, check_valid_int);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
548 IIFORMAT_VALID_KEYWORD (group, Q_face, check_valid_face);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
549 IIFORMAT_VALID_KEYWORD (group, Q_background, check_valid_string);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
550 IIFORMAT_VALID_KEYWORD (group, Q_descriptor, check_valid_string);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
551 #endif
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
552 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
553
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
554 void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
555 vars_of_glyphs_widget (void)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
556 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
557 }