Add support for changing the contents of a pre-Appearance static text control.
[u/mdw/putty] / mac / macctrls.c
1 /* $Id: macctrls.c,v 1.5 2003/03/18 23:47:33 ben Exp $ */
2 /*
3 * Copyright (c) 2003 Ben Harris
4 * All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following
13 * conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 */
27
28 #include <MacTypes.h>
29 #include <Appearance.h>
30 #include <Controls.h>
31 #include <ControlDefinitions.h>
32 #include <Resources.h>
33 #include <Sound.h>
34 #include <TextUtils.h>
35 #include <Windows.h>
36
37 #include "putty.h"
38 #include "mac.h"
39 #include "macresid.h"
40 #include "dialog.h"
41 #include "tree234.h"
42
43 union macctrl {
44 struct macctrl_generic {
45 enum {
46 MACCTRL_TEXT,
47 MACCTRL_RADIO,
48 MACCTRL_CHECKBOX,
49 MACCTRL_BUTTON
50 } type;
51 /* Template from which this was generated */
52 union control *ctrl;
53 } generic;
54 struct {
55 struct macctrl_generic generic;
56 ControlRef tbctrl;
57 } text;
58 struct {
59 struct macctrl_generic generic;
60 ControlRef *tbctrls;
61 } radio;
62 struct {
63 struct macctrl_generic generic;
64 ControlRef tbctrl;
65 } checkbox;
66 struct {
67 struct macctrl_generic generic;
68 ControlRef tbctrl;
69 } button;
70 };
71
72 struct mac_layoutstate {
73 Point pos;
74 unsigned int width;
75 };
76
77 #define ctrlevent(mcs, mc, event) do { \
78 if ((mc)->generic.ctrl->generic.handler != NULL) \
79 (*(mc)->generic.ctrl->generic.handler)((mc)->generic.ctrl, (mc),\
80 (mcs)->data, (event)); \
81 } while (0)
82
83 static void macctrl_layoutset(struct mac_layoutstate *, struct controlset *,
84 WindowPtr, struct macctrls *);
85 static void macctrl_text(struct macctrls *, WindowPtr,
86 struct mac_layoutstate *, union control *);
87 static void macctrl_radio(struct macctrls *, WindowPtr,
88 struct mac_layoutstate *, union control *);
89 static void macctrl_checkbox(struct macctrls *, WindowPtr,
90 struct mac_layoutstate *, union control *);
91 static void macctrl_button(struct macctrls *, WindowPtr,
92 struct mac_layoutstate *, union control *);
93 #if !TARGET_API_MAC_CARBON
94 static pascal SInt32 macctrl_sys7_text_cdef(SInt16, ControlRef,
95 ControlDefProcMessage, SInt32);
96 #endif
97
98 #if !TARGET_API_MAC_CARBON
99 /*
100 * This trick enables us to keep all the CDEF code in the main
101 * application, which makes life easier. For details, see
102 * <http://developer.apple.com/technotes/tn/tn2003.html#custom_code_base>.
103 */
104
105 #pragma options align=mac68k
106 typedef struct {
107 short jmpabs; /* 4EF9 */
108 ControlDefUPP theUPP;
109 } **PatchCDEF;
110 #pragma options align=reset
111 #endif
112
113 static void macctrl_init()
114 {
115 #if !TARGET_API_MAC_CARBON
116 static int inited = 0;
117 PatchCDEF cdef;
118
119 if (inited) return;
120 cdef = (PatchCDEF)GetResource(kControlDefProcResourceType, CDEF_Text);
121 (*cdef)->theUPP = NewControlDefProc(macctrl_sys7_text_cdef);
122 inited = 1;
123 #endif
124 }
125
126
127 static int macctrl_cmp_byctrl(void *av, void *bv)
128 {
129 union macctrl *a = (union macctrl *)av;
130 union macctrl *b = (union macctrl *)bv;
131
132 if (a->generic.ctrl < b->generic.ctrl)
133 return -1;
134 else if (a->generic.ctrl > b->generic.ctrl)
135 return +1;
136 else
137 return 0;
138 }
139
140 void macctrl_layoutbox(struct controlbox *cb, WindowPtr window,
141 struct macctrls *mcs)
142 {
143 int i;
144 struct mac_layoutstate curstate;
145 ControlRef root;
146 Rect rect;
147
148 macctrl_init();
149 #if TARGET_API_MAC_CARBON
150 GetPortBounds(GetWindowPort(window), &rect);
151 #else
152 rect = window->portRect;
153 #endif
154 curstate.pos.h = rect.left + 13;
155 curstate.pos.v = rect.top + 13;
156 curstate.width = rect.right - rect.left - (13 * 2);
157 if (mac_gestalts.apprvers >= 0x100)
158 CreateRootControl(window, &root);
159 mcs->byctrl = newtree234(macctrl_cmp_byctrl);
160 for (i = 0; i < cb->nctrlsets; i++)
161 macctrl_layoutset(&curstate, cb->ctrlsets[i], window, mcs);
162 }
163
164 static void macctrl_layoutset(struct mac_layoutstate *curstate,
165 struct controlset *s,
166 WindowPtr window, struct macctrls *mcs)
167 {
168 unsigned int i;
169
170 fprintf(stderr, "--- begin set ---\n");
171 if (s->boxname && *s->boxname)
172 fprintf(stderr, "boxname = %s\n", s->boxname);
173 if (s->boxtitle)
174 fprintf(stderr, "boxtitle = %s\n", s->boxtitle);
175
176
177 for (i = 0; i < s->ncontrols; i++) {
178 union control *ctrl = s->ctrls[i];
179 char const *s;
180
181 switch (ctrl->generic.type) {
182 case CTRL_TEXT: s = "text"; break;
183 case CTRL_EDITBOX: s = "editbox"; break;
184 case CTRL_RADIO: s = "radio"; break;
185 case CTRL_CHECKBOX: s = "checkbox"; break;
186 case CTRL_BUTTON: s = "button"; break;
187 case CTRL_LISTBOX: s = "listbox"; break;
188 case CTRL_COLUMNS: s = "columns"; break;
189 case CTRL_FILESELECT: s = "fileselect"; break;
190 case CTRL_FONTSELECT: s = "fontselect"; break;
191 case CTRL_TABDELAY: s = "tabdelay"; break;
192 default: s = "unknown"; break;
193 }
194 fprintf(stderr, " control: %s\n", s);
195 switch (ctrl->generic.type) {
196 case CTRL_TEXT:
197 macctrl_text(mcs, window, curstate, ctrl);
198 break;
199 case CTRL_RADIO:
200 macctrl_radio(mcs, window, curstate, ctrl);
201 break;
202 case CTRL_CHECKBOX:
203 macctrl_checkbox(mcs, window, curstate, ctrl);
204 break;
205 case CTRL_BUTTON:
206 macctrl_button(mcs, window, curstate, ctrl);
207 break;
208
209 }
210 }
211 }
212
213 static void macctrl_text(struct macctrls *mcs, WindowPtr window,
214 struct mac_layoutstate *curstate,
215 union control *ctrl)
216 {
217 union macctrl *mc = smalloc(sizeof *mc);
218 Rect bounds;
219
220 fprintf(stderr, " label = %s\n", ctrl->text.label);
221 mc->generic.type = MACCTRL_TEXT;
222 mc->generic.ctrl = ctrl;
223 bounds.left = curstate->pos.h;
224 bounds.right = bounds.left + curstate->width;
225 bounds.top = curstate->pos.v;
226 bounds.bottom = bounds.top + 16;
227 if (mac_gestalts.apprvers >= 0x100) {
228 SInt16 height;
229 Size olen;
230
231 mc->text.tbctrl = NewControl(window, &bounds, NULL, TRUE, 0, 0, 0,
232 kControlStaticTextProc, (long)mc);
233 SetControlData(mc->text.tbctrl, kControlEntireControl,
234 kControlStaticTextTextTag,
235 strlen(ctrl->text.label), ctrl->text.label);
236 GetControlData(mc->text.tbctrl, kControlEntireControl,
237 kControlStaticTextTextHeightTag,
238 sizeof(height), &height, &olen);
239 fprintf(stderr, " height = %d\n", height);
240 SizeControl(mc->text.tbctrl, curstate->width, height);
241 curstate->pos.v += height + 6;
242 } else {
243 Str255 title;
244
245 c2pstrcpy(title, ctrl->text.label);
246 mc->text.tbctrl = NewControl(window, &bounds, title, TRUE, 0, 0, 0,
247 SYS7_TEXT_PROC, (long)mc);
248 }
249 add234(mcs->byctrl, mc);
250 }
251
252 #if !TARGET_API_MAC_CARBON
253 static pascal SInt32 macctrl_sys7_text_cdef(SInt16 variant, ControlRef control,
254 ControlDefProcMessage msg, SInt32 param)
255 {
256 RgnHandle rgn;
257
258 switch (msg) {
259 case drawCntl:
260 if ((*control)->contrlVis)
261 TETextBox((*control)->contrlTitle + 1, (*control)->contrlTitle[0],
262 &(*control)->contrlRect, teFlushDefault);
263 return 0;
264 case calcCRgns:
265 if (param & (1 << 31)) {
266 param &= ~(1 << 31);
267 goto calcthumbrgn;
268 }
269 /* FALLTHROUGH */
270 case calcCntlRgn:
271 rgn = (RgnHandle)param;
272 RectRgn(rgn, &(*control)->contrlRect);
273 return 0;
274 case calcThumbRgn:
275 calcthumbrgn:
276 rgn = (RgnHandle)param;
277 SetEmptyRgn(rgn);
278 return 0;
279 }
280
281 return 0;
282 }
283 #endif
284
285 static void macctrl_radio(struct macctrls *mcs, WindowPtr window,
286 struct mac_layoutstate *curstate,
287 union control *ctrl)
288 {
289 union macctrl *mc = smalloc(sizeof *mc);
290 Rect bounds;
291 Str255 title;
292 unsigned int i, colwidth;
293
294 fprintf(stderr, " label = %s\n", ctrl->radio.label);
295 mc->generic.type = MACCTRL_RADIO;
296 mc->generic.ctrl = ctrl;
297 mc->radio.tbctrls =
298 smalloc(sizeof(*mc->radio.tbctrls) * ctrl->radio.nbuttons);
299 colwidth = (curstate->width + 13) / ctrl->radio.ncolumns;
300 for (i = 0; i < ctrl->radio.nbuttons; i++) {
301 fprintf(stderr, " button = %s\n", ctrl->radio.buttons[i]);
302 bounds.top = curstate->pos.v;
303 bounds.bottom = bounds.top + 16;
304 bounds.left = curstate->pos.h + colwidth * (i % ctrl->radio.ncolumns);
305 if (i == ctrl->radio.nbuttons - 1 ||
306 i % ctrl->radio.ncolumns == ctrl->radio.ncolumns - 1) {
307 bounds.right = curstate->pos.h + curstate->width;
308 curstate->pos.v += 22;
309 } else
310 bounds.right = bounds.left + colwidth - 13;
311 c2pstrcpy(title, ctrl->radio.buttons[i]);
312 mc->radio.tbctrls[i] = NewControl(window, &bounds, title, TRUE,
313 0, 0, 1, radioButProc, (long)mc);
314 }
315 add234(mcs->byctrl, mc);
316 ctrlevent(mcs, mc, EVENT_REFRESH);
317 }
318
319 static void macctrl_checkbox(struct macctrls *mcs, WindowPtr window,
320 struct mac_layoutstate *curstate,
321 union control *ctrl)
322 {
323 union macctrl *mc = smalloc(sizeof *mc);
324 Rect bounds;
325 Str255 title;
326
327 fprintf(stderr, " label = %s\n", ctrl->checkbox.label);
328 mc->generic.type = MACCTRL_CHECKBOX;
329 mc->generic.ctrl = ctrl;
330 bounds.left = curstate->pos.h;
331 bounds.right = bounds.left + curstate->width;
332 bounds.top = curstate->pos.v;
333 bounds.bottom = bounds.top + 16;
334 c2pstrcpy(title, ctrl->checkbox.label);
335 mc->checkbox.tbctrl = NewControl(window, &bounds, title, TRUE, 0, 0, 1,
336 checkBoxProc, (long)mc);
337 add234(mcs->byctrl, mc);
338 curstate->pos.v += 22;
339 ctrlevent(mcs, mc, EVENT_REFRESH);
340 }
341
342 static void macctrl_button(struct macctrls *mcs, WindowPtr window,
343 struct mac_layoutstate *curstate,
344 union control *ctrl)
345 {
346 union macctrl *mc = smalloc(sizeof *mc);
347 Rect bounds;
348 Str255 title;
349
350 fprintf(stderr, " label = %s\n", ctrl->button.label);
351 if (ctrl->button.isdefault)
352 fprintf(stderr, " is default\n");
353 mc->generic.type = MACCTRL_BUTTON;
354 mc->generic.ctrl = ctrl;
355 bounds.left = curstate->pos.h;
356 bounds.right = bounds.left + 100; /* XXX measure string */
357 bounds.top = curstate->pos.v;
358 bounds.bottom = bounds.top + 20;
359 c2pstrcpy(title, ctrl->button.label);
360 mc->button.tbctrl = NewControl(window, &bounds, title, TRUE, 0, 0, 1,
361 pushButProc, (long)mc);
362 if (mac_gestalts.apprvers >= 0x100) {
363 Boolean isdefault = ctrl->button.isdefault;
364
365 SetControlData(mc->button.tbctrl, kControlEntireControl,
366 kControlPushButtonDefaultTag,
367 sizeof(isdefault), &isdefault);
368 }
369 if (mac_gestalts.apprvers >= 0x110) {
370 Boolean iscancel = ctrl->button.iscancel;
371
372 SetControlData(mc->button.tbctrl, kControlEntireControl,
373 kControlPushButtonCancelTag,
374 sizeof(iscancel), &iscancel);
375 }
376 add234(mcs->byctrl, mc);
377 curstate->pos.v += 26;
378 }
379
380
381 void macctrl_activate(WindowPtr window, EventRecord *event)
382 {
383 Boolean active = (event->modifiers & activeFlag) != 0;
384 GrafPtr saveport;
385 ControlRef root;
386
387 GetPort(&saveport);
388 SetPort((GrafPtr)GetWindowPort(window));
389 if (mac_gestalts.apprvers >= 0x100) {
390 SetThemeWindowBackground(window, active ?
391 kThemeBrushModelessDialogBackgroundActive :
392 kThemeBrushModelessDialogBackgroundInactive,
393 TRUE);
394 GetRootControl(window, &root);
395 if (active)
396 ActivateControl(root);
397 else
398 DeactivateControl(root);
399 } else {
400 /* (De)activate controls one at a time */
401 }
402 SetPort(saveport);
403 }
404
405 void macctrl_click(WindowPtr window, EventRecord *event)
406 {
407 Point mouse;
408 ControlHandle control;
409 int part;
410 GrafPtr saveport;
411 union macctrl *mc;
412 struct macctrls *mcs = mac_winctrls(window);
413 int i;
414
415 GetPort(&saveport);
416 SetPort((GrafPtr)GetWindowPort(window));
417 mouse = event->where;
418 GlobalToLocal(&mouse);
419 part = FindControl(mouse, window, &control);
420 if (control != NULL)
421 if (TrackControl(control, mouse, NULL) != 0) {
422 mc = (union macctrl *)GetControlReference(control);
423 switch (mc->generic.type) {
424 case MACCTRL_RADIO:
425 for (i = 0; i < mc->generic.ctrl->radio.nbuttons; i++) {
426 if (mc->radio.tbctrls[i] == control)
427 SetControlValue(mc->radio.tbctrls[i],
428 kControlRadioButtonCheckedValue);
429 else
430 SetControlValue(mc->radio.tbctrls[i],
431 kControlRadioButtonUncheckedValue);
432 }
433 ctrlevent(mcs, mc, EVENT_VALCHANGE);
434 break;
435 case MACCTRL_CHECKBOX:
436 SetControlValue(control, !GetControlValue(control));
437 ctrlevent(mcs, mc, EVENT_VALCHANGE);
438 break;
439 case MACCTRL_BUTTON:
440 ctrlevent(mcs, mc, EVENT_ACTION);
441 break;
442 }
443 }
444 SetPort(saveport);
445 }
446
447 void macctrl_update(WindowPtr window)
448 {
449 #if TARGET_API_MAC_CARBON
450 RgnHandle visrgn;
451 #endif
452 Rect rect;
453 GrafPtr saveport;
454
455 BeginUpdate(window);
456 GetPort(&saveport);
457 SetPort((GrafPtr)GetWindowPort(window));
458 if (mac_gestalts.apprvers >= 0x101) {
459 #if TARGET_API_MAC_CARBON
460 GetPortBounds(GetWindowPort(window), &rect);
461 #else
462 rect = window->portRect;
463 #endif
464 InsetRect(&rect, -1, -1);
465 DrawThemeModelessDialogFrame(&rect, mac_frontwindow() == window ?
466 kThemeStateActive : kThemeStateInactive);
467 }
468 #if TARGET_API_MAC_CARBON
469 visrgn = NewRgn();
470 GetPortVisibleRegion(GetWindowPort(window), visrgn);
471 UpdateControls(window, visrgn);
472 DisposeRgn(visrgn);
473 #else
474 UpdateControls(window, window->visRgn);
475 #endif
476 SetPort(saveport);
477 EndUpdate(window);
478 }
479
480 #if TARGET_API_MAC_CARBON
481 #define EnableItem EnableMenuItem
482 #define DisableItem DisableMenuItem
483 #endif
484 void macctrl_adjustmenus(WindowPtr window)
485 {
486 MenuHandle menu;
487
488 menu = GetMenuHandle(mFile);
489 DisableItem(menu, iSave); /* XXX enable if modified */
490 EnableItem(menu, iSaveAs);
491 EnableItem(menu, iDuplicate);
492
493 menu = GetMenuHandle(mEdit);
494 DisableItem(menu, 0);
495 }
496
497 void macctrl_close(WindowPtr window)
498 {
499 struct macctrls *mcs = mac_winctrls(window);
500 union macctrl *mc;
501
502 while ((mc = index234(mcs->byctrl, 0)) != NULL) {
503 del234(mcs->byctrl, mc);
504 sfree(mc);
505 }
506
507 freetree234(mcs->byctrl);
508 mcs->byctrl = NULL;
509
510 /* XXX
511 DisposeWindow(window);
512 if (s->window == NULL)
513 sfree(s);
514 */
515 }
516
517 void dlg_update_start(union control *ctrl, void *dlg)
518 {
519
520 /* No-op for now */
521 }
522
523 void dlg_update_done(union control *ctrl, void *dlg)
524 {
525
526 /* No-op for now */
527 }
528
529 void dlg_set_focus(union control *ctrl, void *dlg)
530 {
531
532 if (mac_gestalts.apprvers >= 0x100) {
533 /* Use SetKeyboardFocus() */
534 } else {
535 /* Do our own mucking around */
536 }
537 }
538
539 union control *dlg_last_focused(union control *ctrl, void *dlg)
540 {
541
542 return NULL;
543 }
544
545 void dlg_beep(void *dlg)
546 {
547
548 SysBeep(30);
549 }
550
551 void dlg_error_msg(void *dlg, char *msg)
552 {
553 Str255 pmsg;
554
555 c2pstrcpy(pmsg, msg);
556 ParamText(pmsg, NULL, NULL, NULL);
557 StopAlert(128, NULL);
558 }
559
560 void dlg_end(void *dlg, int value)
561 {
562
563 };
564
565 void dlg_refresh(union control *ctrl, void *dlg)
566 {
567
568 };
569
570 void *dlg_get_privdata(union control *ctrl, void *dlg)
571 {
572
573 return NULL;
574 }
575
576 void dlg_set_privdata(union control *ctrl, void *dlg, void *ptr)
577 {
578
579 fatalbox("dlg_set_privdata");
580 }
581
582 void *dlg_alloc_privdata(union control *ctrl, void *dlg, size_t size)
583 {
584
585 fatalbox("dlg_alloc_privdata");
586 }
587
588
589 /*
590 * Radio Button control
591 */
592
593 void dlg_radiobutton_set(union control *ctrl, void *dlg, int whichbutton)
594 {
595 union macctrl *mc = dlg;
596 int i;
597
598 for (i = 0; i < ctrl->radio.nbuttons; i++) {
599 if (i == whichbutton)
600 SetControlValue(mc->radio.tbctrls[i],
601 kControlRadioButtonCheckedValue);
602 else
603 SetControlValue(mc->radio.tbctrls[i],
604 kControlRadioButtonUncheckedValue);
605 }
606
607 };
608
609 int dlg_radiobutton_get(union control *ctrl, void *dlg)
610 {
611 union macctrl *mc = dlg;
612 int i;
613
614 for (i = 0; i < ctrl->radio.nbuttons; i++) {
615 if (GetControlValue(mc->radio.tbctrls[i]) ==
616 kControlRadioButtonCheckedValue)
617 return i;
618 }
619 return -1;
620 };
621
622
623 /*
624 * Check Box control
625 */
626
627 void dlg_checkbox_set(union control *ctrl, void *dlg, int checked)
628 {
629 union macctrl *mc = dlg;
630
631 SetControlValue(mc->checkbox.tbctrl,
632 checked ? kControlCheckBoxCheckedValue :
633 kControlCheckBoxUncheckedValue);
634 }
635
636 int dlg_checkbox_get(union control *ctrl, void *dlg)
637 {
638 union macctrl *mc = dlg;
639
640 return GetControlValue(mc->checkbox.tbctrl);
641 }
642
643
644 /*
645 * Edit Box control
646 */
647
648 void dlg_editbox_set(union control *ctrl, void *dlg, char const *text)
649 {
650
651 };
652
653 void dlg_editbox_get(union control *ctrl, void *dlg, char *buffer, int length)
654 {
655
656 };
657
658
659 /*
660 * List Box control
661 */
662
663 void dlg_listbox_clear(union control *ctrl, void *dlg)
664 {
665
666 };
667
668 void dlg_listbox_del(union control *ctrl, void *dlg, int index)
669 {
670
671 };
672
673 void dlg_listbox_add(union control *ctrl, void *dlg, char const *text)
674 {
675
676 };
677
678 void dlg_listbox_addwithindex(union control *ctrl, void *dlg,
679 char const *text, int id)
680 {
681
682 };
683
684 int dlg_listbox_getid(union control *ctrl, void *dlg, int index)
685 {
686
687 return 0;
688 };
689
690 int dlg_listbox_index(union control *ctrl, void *dlg)
691 {
692
693 return 0;
694 };
695
696 int dlg_listbox_issel(union control *ctrl, void *dlg, int index)
697 {
698
699 return 0;
700 };
701
702 void dlg_listbox_select(union control *ctrl, void *dlg, int index)
703 {
704
705 };
706
707
708 /*
709 * Text control
710 */
711
712 void dlg_text_set(union control *ctrl, void *dlg, char const *text)
713 {
714 union macctrl *mc = dlg;
715 Str255 title;
716
717 if (mac_gestalts.apprvers >= 0x100)
718 SetControlData(mc->text.tbctrl, kControlEntireControl,
719 kControlStaticTextTextTag,
720 strlen(ctrl->text.label), ctrl->text.label);
721 else {
722 c2pstrcpy(title, text);
723 SetControlTitle(mc->text.tbctrl, title);
724 }
725 }
726
727
728 /*
729 * File Selector control
730 */
731
732 void dlg_filesel_set(union control *ctrl, void *dlg, Filename fn)
733 {
734
735 }
736
737 void dlg_filesel_get(union control *ctrl, void *dlg, Filename *fn)
738 {
739
740 }
741
742
743 /*
744 * Font Selector control
745 */
746
747 void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec fn)
748 {
749
750 }
751
752 void dlg_fontsel_get(union control *ctrl, void *dlg, FontSpec *fn)
753 {
754
755 }
756
757
758 /*
759 * Printer enumeration
760 */
761
762 printer_enum *printer_start_enum(int *nprinters)
763 {
764
765 *nprinters = 0;
766 return NULL;
767 }
768
769 char *printer_get_name(printer_enum *pe, int thing)
770 {
771
772 return "<none>";
773 }
774
775 void printer_finish_enum(printer_enum *pe)
776 {
777
778 }
779
780
781 /*
782 * Colour selection stuff
783 */
784
785 void dlg_coloursel_start(union control *ctrl, void *dlg,
786 int r, int g, int b)
787 {
788
789 }
790
791 int dlg_coloursel_results(union control *ctrl, void *dlg,
792 int *r, int *g, int *b)
793 {
794
795 return 0;
796 }
797
798 /*
799 * Local Variables:
800 * c-file-style: "simon"
801 * End:
802 */