annotate lwlib/xlwradio.c @ 4522:fc7067b7f407

Backout last patch; forgot to specify file.
author Stephen J. Turnbull <stephen@xemacs.org>
date Wed, 29 Oct 2008 03:37:16 +0900
parents 383ab474a241
children 726060ee587c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
1 /* Radio Widget for XEmacs.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
2 Copyright (C) 1999 Edward A. Falk
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
3
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
4 This file is part of XEmacs.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
5
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
9 later version.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
10
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
14 for more details.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
15
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
20
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
21 /* Synched up with: Radio.c 1.1 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
22
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
23 /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
24 * Radio.c - Radio button widget
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
25 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
26 * Author: Edward A. Falk
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
27 * falk@falconer.vip.best.com
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
28 *
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
29 * Date: June 30, 1997
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
30 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
31 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
32 * Overview: This widget is identical to the Toggle widget in behavior,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
33 * but completely different in appearance. This widget looks like a small
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
34 * diamond-shaped button with a label to the right.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
35 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
36 * To make this work, we subclass the Toggle widget to inherit its behavior
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
37 * and to inherit the label-drawing function from which Toggle is
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
38 * subclassed. We then completely replace the Expose, Set, Unset
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
39 * and Highlight member functions.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
40 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
41 * The Set and Unset actions are slightly unorthodox. In Toggle's
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
42 * ClassInit function, Toggle searches the Command actions list and
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
43 * "steals" the Set and Unset functions, caching pointers to them in its
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
44 * class record. It then calls these functions from its own ToggleSet
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
45 * and Toggle actions.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
46 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
47 * We, in turn, override the Set() and Unset() actions in our own ClassRec.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
48 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
49
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
50
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
51 #include <config.h>
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
52 #include <stdio.h>
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
53
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
54 #include <X11/IntrinsicP.h>
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
55 #include <X11/StringDefs.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
56 #include ATHENA_XawInit_h_
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
57 #include "../src/xmu.h"
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
58 #include "xlwradioP.h"
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
59
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
60 #define BOX_SIZE 13
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
61
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
62 #define rclass(w) ((RadioWidgetClass)((w)->core.widget_class))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
63
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
64
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
65 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
66 #define swid(rw) ((rw)->threeD.shadow_width)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
67 #else
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
68 #define swid(rw) ((rw)->core.border_width)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
69 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
70
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
71 #define bsize(rw) (rclass(rw)->radio_class.dsize)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
72 #define bs(rw) (bsize(rw) + 2*swid(rw))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
73
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
74
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
75
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
76 /****************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
77 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
78 * Full class record constant
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
79 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
80 ****************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
81
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
82 /* The translations table from Toggle do not need to be
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
83 * overridden by Radio
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
84 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
85
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
86
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
87 /* Member functions */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
88
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
89 static void RadioInit (Widget, Widget, ArgList, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
90 static void RadioExpose (Widget, XEvent *, Region);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
91 static void RadioResize (Widget);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
92 static void RadioClassInit (void);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
93 static void RadioClassPartInit (WidgetClass);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
94 static Boolean RadioSetValues (Widget, Widget, Widget, ArgList, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
95 static void DrawDiamond (Widget);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
96 static XtGeometryResult RadioQueryGeometry (Widget, XtWidgetGeometry *,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
97 XtWidgetGeometry *);
3072
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
98 #if 0
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
99 /* #### This function isn't used and is slated for destruction.
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
100 Can we just nuke it? */
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
101 static void RadioDestroy (Widget, XtPointer, XtPointer);
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
102 #endif
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
103
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
104 /* Action procs */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
105
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
106 static void RadioHighlight (Widget, XEvent *, String *, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
107 static void RadioUnhighlight (Widget, XEvent *, String *, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
108
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
109 /* internal privates */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
110
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
111 static void RadioSize (RadioWidget, Dimension *, Dimension *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
112
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
113 /* The actions table from Toggle is almost perfect, but we need
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
114 * to override Highlight, Set, and Unset.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
115 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
116
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
117 static XtActionsRec actionsList[] =
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
118 {
4522
fc7067b7f407 Backout last patch; forgot to specify file.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4521
diff changeset
119 {"highlight", RadioHighlight},
fc7067b7f407 Backout last patch; forgot to specify file.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4521
diff changeset
120 {"unhighlight", RadioUnhighlight},
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
121 };
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
122
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
123 #define SuperClass ((ToggleWidgetClass)&toggleClassRec)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
124
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
125 RadioClassRec radioClassRec = {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
126 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
127 (WidgetClass) SuperClass, /* superclass */
4522
fc7067b7f407 Backout last patch; forgot to specify file.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4521
diff changeset
128 "Radio", /* class_name */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
129 sizeof(RadioRec), /* size */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
130 RadioClassInit, /* class_initialize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
131 RadioClassPartInit, /* class_part_initialize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
132 FALSE, /* class_inited */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
133 RadioInit, /* initialize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
134 NULL, /* initialize_hook */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
135 XtInheritRealize, /* realize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
136 actionsList, /* actions */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
137 XtNumber(actionsList), /* num_actions */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
138 NULL, /* resources */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
139 0, /* resource_count */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
140 NULLQUARK, /* xrm_class */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
141 TRUE, /* compress_motion */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
142 TRUE, /* compress_exposure */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
143 TRUE, /* compress_enterleave */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
144 FALSE, /* visible_interest */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
145 NULL, /* destroy */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
146 RadioResize, /* resize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
147 RadioExpose, /* expose */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
148 RadioSetValues, /* set_values */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
149 NULL, /* set_values_hook */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
150 XtInheritSetValuesAlmost, /* set_values_almost */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
151 NULL, /* get_values_hook */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
152 NULL, /* accept_focus */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
153 XtVersion, /* version */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
154 NULL, /* callback_private */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
155 XtInheritTranslations, /* tm_table */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
156 RadioQueryGeometry, /* query_geometry */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
157 XtInheritDisplayAccelerator, /* display_accelerator */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
158 NULL /* extension */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
159 }, /* CoreClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
160 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
161 XtInheritChangeSensitive /* change_sensitive */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
162 }, /* SimpleClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
163 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
164 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
165 XtInheritXaw3dShadowDraw /* field not used */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
166 }, /* ThreeDClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
167 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
168 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
169 0 /* field not used */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
170 }, /* LabelClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
171 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
172 0 /* field not used */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
173 }, /* CommandClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
174 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
175 RadioSet, /* Set Procedure. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
176 RadioUnset, /* Unset Procedure. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
177 NULL /* extension. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
178 }, /* ToggleClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
179 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
180 BOX_SIZE,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
181 DrawDiamond, /* draw procedure */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
182 NULL /* extension. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
183 } /* RadioClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
184 };
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
185
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
186 /* for public consumption */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
187 WidgetClass radioWidgetClass = (WidgetClass) &radioClassRec;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
188
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
189
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
190
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
191
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
192
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
193
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
194 /****************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
195 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
196 * Class Methods
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
197 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
198 ****************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
199
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
200 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
201 RadioClassInit (void)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
202 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
203 XawInitializeWidgetSet();
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
204 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
205
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
206 static void
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
207 RadioClassPartInit (WidgetClass class_)
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
208 {
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
209 RadioWidgetClass c = (RadioWidgetClass) class_ ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
210 RadioWidgetClass super = (RadioWidgetClass)c->core_class.superclass ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
211
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
212 if( c->radio_class.drawDiamond == NULL ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
213 c->radio_class.drawDiamond == XtInheritDrawDiamond )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
214 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
215 c->radio_class.drawDiamond = super->radio_class.drawDiamond ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
216 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
217 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
218
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
219
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
220
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
221
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
222 /*ARGSUSED*/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
223 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
224 RadioInit (Widget request,
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
225 Widget new_,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
226 ArgList UNUSED (args),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
227 Cardinal *UNUSED (num_args))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
228 {
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
229 RadioWidget rw = (RadioWidget) new_;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
230 RadioWidget rw_req = (RadioWidget) request;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
231 Dimension w,h ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
232
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
233 /* Select initial size for the widget */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
234 if( rw_req->core.width == 0 || rw_req->core.height == 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
235 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
236 RadioSize(rw, &w,&h) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
237 if( rw_req->core.width == 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
238 rw->core.width = w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
239 if( rw_req->core.height == 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
240 rw->core.height = h ;
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
241 rw->core.widget_class->core_class.resize(new_) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
242 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
243 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
244
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
245 /* Function Name: RadioDestroy
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
246 * Description: Destroy Callback for radio widget.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
247 * Arguments: w - the radio widget that is being destroyed.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
248 * junk, garbage - not used.
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
249 * Returns: none.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
250 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
251
3072
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
252 #if 0
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
253 /* #### This function isn't used and is slated for destruction.
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
254 Can we just nuke it? */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
255 /* ARGSUSED */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
256 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
257 RadioDestroy (Widget UNUSED (w),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
258 XtPointer UNUSED (junk),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
259 XtPointer UNUSED (garbage))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
260 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
261 /* TODO: get rid of this */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
262 }
3072
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
263 #endif
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
264
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
265 /* React to size change from manager. Label widget will compute some internal
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
266 * stuff, but we need to override. This code requires knowledge of the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
267 * internals of the Label widget.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
268 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
269
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
270 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
271 RadioResize (Widget w)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
272 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
273 RadioWidget rw = (RadioWidget)w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
274
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
275 /* call parent resize proc */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
276 SuperClass->core_class.resize(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
277
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
278 /* override label offset */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
279
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
280 switch( rw->label.justify ) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
281 case XtJustifyLeft:
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
282 rw->label.label_x += (bs(rw) + rw->label.internal_width) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
283 break ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
284 case XtJustifyRight:
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
285 break ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
286 case XtJustifyCenter:
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
287 default:
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
288 rw->label.label_x += (bs(rw) + rw->label.internal_width)/2;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
289 break ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
290 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
291 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
292
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
293
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
294 /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
295 * Repaint the widget window.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
296 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
297
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
298 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
299 RadioExpose (Widget w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
300 XEvent *event,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
301 Region region)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
302 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
303 RadioWidget rw = (RadioWidget) w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
304 Display *dpy = XtDisplay(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
305 Window win = XtWindow(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
306 GC gc ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
307 Pixmap left_bitmap ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
308 extern WidgetClass labelWidgetClass ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
309
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
310 /* Note: the Label widget examines the region to decide if anything
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
311 * needs to be drawn. I'm not sure that this is worth the effort,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
312 * but it bears thinking on.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
313 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
314
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
315 /* Let label widget draw the label. If there was an lbm_x
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
316 * field, we could let Label draw the bitmap too. But there
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
317 * isn't, so we need to temporarily remove the bitmap and
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
318 * draw it ourself later.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
319 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
320 left_bitmap = rw->label.left_bitmap ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
321 rw->label.left_bitmap = None ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
322 labelWidgetClass->core_class.expose(w,event,region) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
323 rw->label.left_bitmap = left_bitmap ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
324
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
325 /* now manually draw the left bitmap. TODO: 3-d look, xaw-xpm */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
326 gc = XtIsSensitive(w) ? rw->label.normal_GC : rw->label.gray_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
327 if( left_bitmap != None && rw->label.lbm_width > 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
328 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
329 /* TODO: handle pixmaps */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
330 XCopyPlane(dpy, left_bitmap, win, gc,
458
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
331 0,0, rw->label.lbm_width, rw->label.lbm_height,
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
332 (int) rw->label.internal_width*2 + bs(rw),
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
333 (int) rw->label.internal_height + rw->label.lbm_y,
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
334 1UL) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
335 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
336
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
337 /* Finally, the button itself */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
338 ((RadioWidgetClass)(w->core.widget_class))->radio_class.drawDiamond(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
339 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
340
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
341
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
342
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
343
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
344 /************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
345 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
346 * Set specified arguments into widget
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
347 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
348 ***********************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
349
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
350
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
351 /* ARGSUSED */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
352 static Boolean
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
353 RadioSetValues (Widget current,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
354 Widget UNUSED (request),
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
355 Widget new_,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
356 ArgList UNUSED (args),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
357 Cardinal *UNUSED (num_args))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
358 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
359 RadioWidget oldrw = (RadioWidget) current;
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
360 RadioWidget newrw = (RadioWidget) new_;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
361
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
362 /* Need to find out if the size of the widget changed. Set new size
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
363 * if it did and resize is permitted. One way to determine of the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
364 * widget changed size would be to scan the args list. Another way
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
365 * is to compare the old and new widgets and see if any of several
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
366 * size-related fields have been changed. The Label widget chose the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
367 * former method, but I choose the latter.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
368 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
369
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
370 if( newrw->label.resize &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
371 ( newrw->core.width != oldrw->core.width ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
372 newrw->core.height != oldrw->core.height ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
373 newrw->core.border_width != oldrw->core.border_width ) )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
374 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
375 RadioSize(newrw, &newrw->core.width, &newrw->core.height) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
376 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
377
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
378 /* The label set values routine can resize the widget. We need to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
379 * recalculate if this is true.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
380 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
381 if (newrw->label.label_x != oldrw->label.label_x)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
382 {
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
383 RadioResize (new_);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
384 }
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
385 return FALSE ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
386 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
387
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
388 static XtGeometryResult
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
389 RadioQueryGeometry (Widget w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
390 XtWidgetGeometry *intended,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
391 XtWidgetGeometry *preferred)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
392 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
393 RadioWidget rw = (RadioWidget) w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
394
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
395 preferred->request_mode = CWWidth | CWHeight;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
396 RadioSize(rw, &preferred->width, &preferred->height) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
397
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
398 if ( ((intended->request_mode & (CWWidth | CWHeight))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
399 == (CWWidth | CWHeight)) &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
400 intended->width == preferred->width &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
401 intended->height == preferred->height)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
402 return XtGeometryYes;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
403 else if (preferred->width == w->core.width &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
404 preferred->height == w->core.height)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
405 return XtGeometryNo;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
406 else
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
407 return XtGeometryAlmost;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
408 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
409
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
410
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
411
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
412
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
413
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
414 /************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
415 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
416 * Action Procedures
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
417 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
418 ************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
419
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
420 /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
421 * Draw the highlight border around the widget. The Command widget
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
422 * did this by drawing through a mask. We do it by just drawing the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
423 * border.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
424 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
425
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
426 static void
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
427 DrawHighlight (Widget w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
428 GC gc)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
429 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
430 RadioWidget rw = (RadioWidget)w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
431 XRectangle rects[4] ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
432 Dimension ht = rw->command.highlight_thickness ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
433
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
434 if( ht <= 0 ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
435 ht > rw->core.width/2 ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
436 ht > rw->core.height/2 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
437 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
438
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
439 if( ! XtIsRealized(w) )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
440 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
441
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
442 rects[0].x = 0 ; rects[0].y = 0 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
443 rects[0].width = rw->core.width ; rects[0].height = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
444 rects[1].x = 0 ; rects[1].y = rw->core.height - ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
445 rects[1].width = rw->core.width ; rects[1].height = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
446 rects[2].x = 0 ; rects[2].y = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
447 rects[2].width = ht ; rects[2].height = rw->core.height - ht*2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
448 rects[3].x = rw->core.width - ht ; rects[3].y = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
449 rects[3].width = ht ; rects[3].height = rw->core.height - ht*2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
450 XFillRectangles( XtDisplay(w), XtWindow(w), gc, rects, 4) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
451 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
452
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
453 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
454 RadioHighlight (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
455 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
456 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
457 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
458 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
459 RadioWidget rw = (RadioWidget)w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
460 DrawHighlight(w, rw->command.normal_GC) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
461 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
462
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
463
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
464 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
465 RadioUnhighlight (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
466 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
467 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
468 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
469 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
470 RadioWidget rw = (RadioWidget)w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
471 DrawHighlight(w, rw->command.inverse_GC) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
472 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
473
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
474
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
475 /* ARGSUSED */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
476 void
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
477 RadioSet (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
478 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
479 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
480 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
481 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
482 RadioWidget rw = (RadioWidget)w;
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
483 RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
484
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
485 if( rw->command.set )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
486 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
487
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
488 rw->command.set = TRUE ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
489 if( XtIsRealized(w) )
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
490 class_->radio_class.drawDiamond(w) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
491 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
492
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
493
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
494 /* ARGSUSED */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
495 void
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
496 RadioUnset (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
497 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
498 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
499 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
500 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
501 RadioWidget rw = (RadioWidget)w;
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
502 RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
503
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
504 if( ! rw->command.set )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
505 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
506
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
507 rw->command.set = FALSE ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
508 if( XtIsRealized(w) )
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
509 class_->radio_class.drawDiamond(w) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
510 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
511
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
512
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
513
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
514
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
515 /************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
516 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
517 * Internal Procedures
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
518 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
519 ************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
520
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
521
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
522 /* Size of widget. Width is size of box plus width of border around
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
523 * box plus width of label plus three margins plus the size of the left
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
524 * bitmap, if any. Height is max(box,bitmap,label) plus two margins.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
525 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
526
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
527 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
528 RadioSize (RadioWidget rw,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
529 Dimension *w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
530 Dimension *h)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
531 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
532 *w = rw->label.label_width + bs(rw) + LEFT_OFFSET(rw) +
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
533 3 * rw->label.internal_width ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
534 *h = Max( rw->label.label_height, bs(rw) ) +
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
535 2 * rw->label.internal_width ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
536 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
537
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
538
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
539 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
540 DrawDiamond (Widget w)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
541 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
542 RadioWidget rw = (RadioWidget) w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
543 Display *dpy = XtDisplay(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
544 Window win = XtWindow(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
545 GC gc, gci ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
546
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
547 XPoint pts[5] ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
548 Dimension del = bsize(rw)/2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
549 Position x,y ; /* diamond center */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
550 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
551 int i=0;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
552 Dimension s = swid(rw) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
553 GC top, bot, ctr ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
554 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
555 gc = XtIsSensitive(w) ? rw->command.normal_GC : rw->label.gray_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
556
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
557 gci = rw->command.set ? rw->command.normal_GC : rw->command.inverse_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
558
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
559 x = rw->label.internal_width + bs(rw)/2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
560 y = rw->core.height/2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
561
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
562 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
563 if( ! rw->command.set ) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
564 top = rw->threeD.top_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
565 bot = rw->threeD.bot_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
566 ctr = gc ; /* TODO */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
567 } else {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
568 top = rw->threeD.bot_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
569 bot = rw->threeD.top_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
570 ctr = gc ; /* TODO */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
571 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
572 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
573
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
574 pts[0].x = x - del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
575 pts[0].y = y ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
576 pts[1].x = x ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
577 pts[1].y = y - del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
578 pts[2].x = x + del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
579 pts[2].y = y ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
580 pts[3].x = x ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
581 pts[3].y = y + del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
582 pts[4] = pts[0] ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
583 XFillPolygon(dpy,win,gci, pts,4, Convex, CoordModeOrigin) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
584
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
585 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
586 for(i=0; i<s; ++i) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
587 XDrawLine(dpy,win,bot, x-i-del,y, x,y+del+i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
588 XDrawLine(dpy,win,bot, x+del+i,y, x,y+del+i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
589 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
590 for(i=0; i<s; ++i) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
591 XDrawLine(dpy,win,top, x-del-i,y, x,y-del-i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
592 XDrawLine(dpy,win,top, x+del+i,y, x,y-del-i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
593 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
594 #else
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
595 XDrawLines(dpy,win,gc, pts,5, CoordModeOrigin) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
596 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
597 }