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