2 /******************************************************************************
3 * MODULE : widkit_wrapper.hpp
4 * DESCRIPTION: Conversions between widget and wk_widget
5 * COPYRIGHT : (C) 2007 Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
12 #include "promise.hpp"
14 #include "Widkit/wk_widget.hpp"
15 #include "message.hpp"
17 #include "dictionary.hpp"
19 #define THIS wk_widget (this)
21 static void noop () {}
22 widget
box_widget (scheme_tree p
, string s
, color col
, bool trans
, bool ink
);
24 /******************************************************************************
26 ******************************************************************************/
29 abstract (array
<wk_widget
> a
) {
32 for (i
=0; i
<n
; i
++) b
[i
]= abstract (a
[i
]);
37 concrete (array
<widget
> a
) {
39 array
<wk_widget
> b (n
);
40 for (i
=0; i
<n
; i
++) b
[i
]= concrete (a
[i
]);
44 class abstract_promise_rep
: public promise_rep
<widget
> {
47 abstract_promise_rep (promise
<wk_widget
> p2
): p (p2
) {}
48 tm_ostream
& print (tm_ostream
& out
) { return out
<< p
; }
49 widget
eval () { return abstract (p ()); }
53 abstract (promise
<wk_widget
> pw
) {
54 return tm_new
<abstract_promise_rep
> (pw
);
57 class concrete_promise_rep
: public promise_rep
<wk_widget
> {
60 concrete_promise_rep (promise
<widget
> p2
): p (p2
) {}
61 tm_ostream
& print (tm_ostream
& out
) { return out
<< p
; }
62 wk_widget
eval () { return concrete (p ()); }
66 concrete (promise
<widget
> pw
) {
67 return tm_new
<concrete_promise_rep
> (pw
);
70 /******************************************************************************
71 * Exported special widgets
72 ******************************************************************************/
75 horizontal_list (array
<widget
> a
) {
76 return abstract (horizontal_list (concrete (a
)));
80 vertical_list (array
<widget
> a
) {
81 return abstract (vertical_list (concrete (a
)));
85 horizontal_menu (array
<widget
> a
) {
86 return abstract (horizontal_array (concrete (a
), -1));
90 vertical_menu (array
<widget
> a
) {
91 return abstract (vertical_menu (concrete (a
)));
95 tile_menu (array
<widget
> a
, int cols
) {
96 return abstract (tile (concrete (a
), cols
));
100 switch_widget (array
<widget
> a
, array
<string
> name
, int init
) {
101 return abstract (switch_widget (concrete (a
), name
, init
));
105 optional_widget (widget w
, bool on
) {
106 return abstract (optional_widget (concrete (w
), on
));
111 return abstract (glue_wk_widget (false, false, 0, 0));
115 glue_widget (bool hx
, bool vx
, SI w
, SI h
) {
116 return abstract (glue_wk_widget (hx
, vx
, w
, h
));
120 menu_separator (bool vert
) {
121 return abstract (separator_wk_widget (2*PIXEL
, 2*PIXEL
, vert
));
125 text_widget (string s
, bool tsp
, string lan
) {
126 return abstract (text_wk_widget (s
, tsp
, lan
));
130 menu_text_widget (string s
, color col
, bool tsp
, string lan
, bool tt
) {
131 return abstract (menu_text_wk_widget (s
, col
, tsp
, lan
, tt
));
135 text_widget (string s
, color col
, bool tsp
, string lan
) {
136 return menu_text_widget (s
, col
, tsp
, lan
, false);
140 xpm_widget (url file_name
) {
141 return abstract (xpm_wk_widget (file_name
, true));
145 command_button (widget w
, command cmd
, bool button_flag
) {
146 return abstract (command_button (concrete (w
), cmd
, button_flag
));
150 command_button (widget lw
, widget cw
, widget rw
, command cmd
, bool e
, bool c
) {
151 return abstract (command_button (concrete (lw
), concrete (cw
),
152 concrete (rw
), cmd
, e
, c
));
156 menu_group (string name
, string lan
) {
157 widget lw
= empty_widget ();
158 widget cw
= text_widget (name
, dark_grey
, false, lan
);
159 widget rw
= empty_widget ();
160 return command_button (lw
, cw
, rw
, noop
, false, true);
164 menu_button (widget w
, command cmd
, string pre
, string ks
, bool ok
) {
165 if (pre
== "" && ks
== "") return command_button (w
, cmd
, false);
167 color c
= ok
? black
: dark_grey
;
168 widget lw
= empty_widget ();
169 widget rw
= menu_text_widget (ks
, c
, true, "english", true);
172 if (pre
== "v") s
= "<checked>";
173 if (pre
== "o") s
= "<circ>";
174 if (pre
== "*") s
= "<bullet>";
175 if (s
!= "") lw
= box_widget (tree (TUPLE
), s
, c
, true, false);
177 return command_button (lw
, w
, rw
, cmd
, ok
, false);
182 pulldown_button (widget w
, promise
<widget
> pw
) {
183 return abstract (pulldown_button (concrete (w
), concrete (pw
)));
187 pullright_button (widget w
, promise
<widget
> pw
) {
188 return abstract (pullright_button (concrete (w
), concrete (pw
)));
192 popup_widget (widget w
) {
193 return abstract (popup_widget (concrete (w
), center
));
197 canvas_widget (widget w
) {
198 return abstract (canvas_widget (concrete (w
), north_west
));
202 input_text_widget (command call_back
, string type
, array
<string
> def
) {
203 return abstract (input_text_wk_widget (call_back
, type
, def
));
207 inputs_list_widget (command call_back
, array
<string
> prompts
) {
208 return abstract (inputs_list_wk_widget (call_back
, prompts
));
212 file_chooser_widget (command cmd
, string type
, string mgn
) {
213 return abstract (file_chooser_wk_widget (cmd
, type
, mgn
));
217 balloon_widget (widget w
, widget help
) {
218 return abstract (balloon_widget (concrete (w
), concrete (help
)));
222 wait_widget (SI w
, SI h
, string message
) {
223 return abstract (wait_wk_widget (w
, h
, message
));
227 texmacs_widget (int mask
, command quit
) {
228 return abstract (texmacs_wk_widget (mask
, quit
));
232 plain_window_widget (widget wid
, string s
) {
233 return abstract (plain_window_widget (concrete (wid
), s
));
237 popup_window_widget (widget wid
, string s
) {
238 return abstract (popup_window_widget (concrete (wid
), s
));
242 destroy_window_widget (widget w
) {
243 destroy_window_widget (concrete (w
));
246 /******************************************************************************
248 ******************************************************************************/
251 check_type_void (blackbox bb
, string s
) {
253 cerr
<< "\nslot type= " << s
<< "\n";
254 FAILED ("type mismatch");
258 template<class T
> void
259 check_type (blackbox bb
, string s
) {
260 if (type_box (bb
) != type_helper
<T
>::id
) {
261 cerr
<< "\nslot type= " << s
<< "\n";
262 FAILED ("type mismatch");
266 template<class T1
, class T2
> inline void
267 check_type (blackbox bb
, string s
) {
268 check_type
<pair
<T1
,T2
> > (bb
, s
);
271 /******************************************************************************
273 ******************************************************************************/
275 SI
get_dx (gravity grav
, SI w
);
276 SI
get_dy (gravity grav
, SI h
);
279 principal_widget_check (wk_widget wid
) {
280 // FIXME: Positions should really be computed relative to parent widgets.
281 // Currently, we only allow geometry access of the unique child of
283 if (wid
->win
!= NULL
&& wid
!= concrete (wid
->win
->get_widget ()) [0]) {
284 cerr
<< "Widget= " << wid
<< "\n";
285 FAILED ("invalid geometry access");
290 set_geometry (wk_widget wid
, SI x
, SI y
, SI w
, SI h
) {
291 if (wid
->is_window_widget ()) {
292 wid
->win
->set_position (x
, y
);
293 wid
->win
->set_size (w
, h
);
296 principal_widget_check (wid
); // FIXME: we should use parent's coordinates
297 wid
<< emit_position (x
, y
, w
, h
, north_west
);
302 get_geometry (wk_widget wid
, SI
& x
, SI
& y
, SI
& w
, SI
& h
) {
303 if (wid
->is_window_widget ()) {
304 wid
->win
->get_position (x
, y
);
305 wid
->win
->get_size (w
, h
);
308 principal_widget_check (wid
); // FIXME: we should use parent's coordinates
309 x
= wid
->ox
- get_dx (wid
->grav
, wid
->w
);
310 y
= wid
->oy
- get_dy (wid
->grav
, wid
->h
);
316 /******************************************************************************
318 ******************************************************************************/
321 send_bool (wk_widget w
, string key
, blackbox val
) {
322 ASSERT (type_box (val
) == type_helper
<bool>::id
, "type mismatch");
323 w
<< set_string (key
, open_box
<bool> (val
)? string ("on"): string ("off"));
327 send_int (wk_widget w
, string key
, blackbox val
) {
328 ASSERT (type_box (val
) == type_helper
<int>::id
, "type mismatch");
329 w
<< set_integer (key
, open_box
<int> (val
));
333 send_string (wk_widget w
, string key
, blackbox val
) {
334 ASSERT (type_box (val
) == type_helper
<string
>::id
, "type mismatch");
335 w
<< set_string (key
, open_box
<string
> (val
));
339 send_coord2 (wk_widget w
, string key
, blackbox val
) {
340 typedef pair
<SI
,SI
> coord2
;
341 ASSERT (type_box (val
) == type_helper
<coord2
>::id
, "type mismatch");
342 coord2 p
= open_box
<coord2
> (val
);
343 w
<< set_coord2 (key
, p
.x1
, p
.x2
);
347 send_coord4 (wk_widget w
, string key
, blackbox val
) {
348 typedef quartet
<SI
,SI
,SI
,SI
> coord4
;
349 ASSERT (type_box (val
) == type_helper
<coord4
>::id
, "type mismatch");
350 coord4 p
= open_box
<coord4
> (val
);
351 w
<< set_coord4 (key
, p
.x1
, p
.x2
, p
.x3
, p
.x4
);
355 send_position (wk_widget w
, blackbox val
) {
356 typedef pair
<SI
,SI
> coord2
;
357 ASSERT (type_box (val
) == type_helper
<coord2
>::id
, "type mismatch");
358 coord2 p
= open_box
<coord2
> (val
);
359 if (w
->is_window_widget ()) w
->win
->set_position (p
.x1
, p
.x2
);
362 get_geometry (w
, x
, y
, W
, H
);
363 set_geometry (w
, p
.x1
, p
.x2
, W
, H
);
368 send_size (wk_widget w
, blackbox val
) {
369 typedef pair
<SI
,SI
> coord2
;
370 ASSERT (type_box (val
) == type_helper
<coord2
>::id
, "type mismatch");
371 coord2 p
= open_box
<coord2
> (val
);
372 if (w
->is_window_widget ()) w
->win
->set_size (p
.x1
, p
.x2
);
375 get_geometry (w
, x
, y
, W
, H
);
376 set_geometry (w
, x
, y
, p
.x1
, p
.x2
);
381 send_update (wk_widget w
, blackbox val
) {
382 ASSERT (is_nil (val
), "type mismatch");
387 send_keyboard (wk_widget w
, blackbox val
) {
388 typedef pair
<string
,time_t> keypress
;
389 ASSERT (type_box (val
) == type_helper
<keypress
>::id
, "type mismatch");
390 keypress k
= open_box
<keypress
> (val
);
391 w
<< emit_keypress (k
.x1
, k
.x2
);
395 send_keyboard_focus (wk_widget w
, blackbox val
) {
396 ASSERT (type_box (val
) == type_helper
<bool>::id
, "type mismatch");
397 w
->win
->set_keyboard_focus (abstract (w
), open_box
<bool> (val
));
401 send_mouse (wk_widget w
, blackbox val
) {
402 typedef quintuple
<string
,SI
,SI
,int,time_t> mouse
;
403 ASSERT (type_box (val
) == type_helper
<mouse
>::id
, "type mismatch");
404 mouse m
= open_box
<mouse
> (val
);
405 // FIXME: we should assume the position in the local coordinates
406 w
<< emit_mouse (m
.x1
, m
.x2
, m
.x3
, m
.x4
, m
.x5
);
410 send_mouse_grab (wk_widget w
, blackbox val
) {
411 ASSERT (type_box (val
) == type_helper
<bool>::id
, "type mismatch");
412 w
->win
->set_mouse_grab (abstract (w
), open_box
<bool> (val
));
416 send_mouse_pointer (wk_widget w
, blackbox val
) {
417 typedef pair
<string
,string
> change_pointer
;
418 ASSERT (type_box (val
) == type_helper
<change_pointer
>::id
, "type mismatch");
419 change_pointer cp
= open_box
<change_pointer
> (val
);
420 w
->win
->set_mouse_pointer (abstract (w
), cp
.x1
, cp
.x2
);
424 send_invalidate (wk_widget w
, blackbox val
) {
425 typedef quartet
<SI
,SI
,SI
,SI
> coord4
;
426 ASSERT (type_box (val
) == type_helper
<coord4
>::id
, "type mismatch");
427 coord4 p
= open_box
<coord4
> (val
);
428 w
<< emit_invalidate (w
->ox
+ p
.x1
, w
->oy
+ p
.x2
,
429 w
->ox
+ p
.x3
, w
->oy
+ p
.x4
);
433 send_invalidate_all (wk_widget w
, blackbox val
) {
434 ASSERT (is_nil (val
), "type mismatch");
435 w
<< emit_invalidate_all ();
439 send_repaint (wk_widget w
, blackbox val
) {
440 typedef quartet
<SI
,SI
,SI
,SI
> repaint
;
441 ASSERT (type_box (val
) == type_helper
<repaint
>::id
, "type mismatch");
442 repaint r
= open_box
<repaint
> (val
);
443 bool stop_flag
= false;
444 // FIXME: we should assume local coordinates for repainting
445 w
<< emit_repaint (r
.x1
, r
.x2
, r
.x3
, r
.x4
, stop_flag
);
449 send_delayed_message (wk_widget w
, blackbox val
) {
450 typedef pair
<string
,time_t> delayed
;
451 ASSERT (type_box (val
) == type_helper
<delayed
>::id
, "type mismatch");
452 delayed dm
= open_box
<delayed
> (val
);
453 w
<< emit_alarm (dm
.x1
, dm
.x2
);
457 send_destroy (wk_widget w
, blackbox val
) {
458 ASSERT (is_nil (val
), "type mismatch");
459 w
<< emit_destroy ();
463 wk_widget_rep::send (slot s
, blackbox val
) {
465 case SLOT_IDENTIFIER
:
466 check_type
<int> (val
, "SLOT_IDENTIFIER");
467 THIS
<< emit_attach_window (get_window (open_box
<int> (val
)));
469 case SLOT_VISIBILITY
:
470 check_type
<bool> (val
, "SLOT_VISIBILITY");
471 win
->set_visibility (open_box
<bool> (val
));
473 case SLOT_FULL_SCREEN
:
474 check_type
<bool> (val
, "SLOT_FULL_SCREEN");
475 win
->set_full_screen (open_box
<bool> (val
));
478 send_string (THIS
, "window name", val
);
481 send_size (THIS
, val
);
484 send_position (THIS
, val
);
487 send_update (THIS
, val
);
490 send_keyboard (THIS
, val
);
492 case SLOT_KEYBOARD_FOCUS
:
493 send_keyboard_focus (THIS
, val
);
496 send_mouse (THIS
, val
);
498 case SLOT_MOUSE_GRAB
:
499 send_mouse_grab (THIS
, val
);
501 case SLOT_MOUSE_POINTER
:
502 send_mouse_pointer (THIS
, val
);
504 case SLOT_INVALIDATE
:
505 send_invalidate (THIS
, val
);
507 case SLOT_INVALIDATE_ALL
:
508 send_invalidate_all (THIS
, val
);
511 send_repaint (THIS
, val
);
513 case SLOT_DELAYED_MESSAGE
:
514 send_delayed_message (THIS
, val
);
517 send_destroy (THIS
, val
);
520 case SLOT_SHRINKING_FACTOR
:
521 send_int (THIS
, "shrinking factor", val
);
524 send_coord4 (THIS
, "extents", val
);
526 case SLOT_SCROLLBARS_VISIBILITY
:
527 send_int (THIS
, "scrollbars", val
);
529 case SLOT_SCROLL_POSITION
:
530 send_coord2 (THIS
, "scroll position", val
);
533 case SLOT_HEADER_VISIBILITY
:
534 send_bool (THIS
, "header", val
);
536 case SLOT_MAIN_ICONS_VISIBILITY
:
537 send_bool (THIS
, "main icons", val
);
539 case SLOT_CONTEXT_ICONS_VISIBILITY
:
540 send_bool (THIS
, "context icons", val
);
542 case SLOT_USER_ICONS_VISIBILITY
:
543 send_bool (THIS
, "user icons", val
);
545 case SLOT_FOOTER_VISIBILITY
:
546 send_bool (THIS
, "footer flag", val
);
548 case SLOT_LEFT_FOOTER
:
549 send_string (THIS
, "left footer", val
);
551 case SLOT_RIGHT_FOOTER
:
552 send_string (THIS
, "right footer", val
);
554 case SLOT_INTERACTIVE_MODE
:
555 send_bool (THIS
, "interactive mode", val
);
558 case SLOT_STRING_INPUT
:
559 send_string (THIS
, "input", val
);
561 case SLOT_INPUT_TYPE
:
562 send_string (THIS
, "type", val
);
564 case SLOT_INPUT_PROPOSAL
:
565 send_string (THIS
, "default", val
);
568 send_string (THIS
, "file", val
);
571 send_string (THIS
, "directory", val
);
574 FAILED ("cannot handle slot type");
578 /******************************************************************************
580 ******************************************************************************/
583 query_bool (wk_widget w
, string key
, int type_id
) {
584 ASSERT (type_id
== type_helper
<bool>::id
, "type mismatch");
586 w
<< get_string (key
, s
);
587 return close_box
<bool> (s
== "on");
591 query_int (wk_widget w
, string key
, int type_id
) {
592 ASSERT (type_id
== type_helper
<int>::id
, "type mismatch");
594 w
<< get_integer (key
, i
);
595 return close_box
<int> (i
);
599 query_string (wk_widget w
, string key
, int type_id
) {
600 ASSERT (type_id
== type_helper
<string
>::id
, "type mismatch");
602 w
<< get_string (key
, s
);
603 return close_box
<string
> (s
);
607 query_coord2 (wk_widget w
, string key
, int type_id
) {
608 typedef pair
<SI
,SI
> coord2
;
609 ASSERT (type_id
== type_helper
<coord2
>::id
, "type mismatch");
611 w
<< get_coord2 (key
, c1
, c2
);
612 return close_box
<coord2
> (coord2 (c1
, c2
));
616 query_coord4 (wk_widget w
, string key
, int type_id
) {
617 typedef quartet
<SI
,SI
,SI
,SI
> coord4
;
618 ASSERT (type_id
== type_helper
<coord4
>::id
, "type mismatch");
620 w
<< get_coord4 (key
, c1
, c2
, c3
, c4
);
621 return close_box
<coord4
> (coord4 (c1
, c2
, c3
, c4
));
625 query_size (wk_widget w
, int type_id
) {
626 typedef pair
<SI
,SI
> coord2
;
627 ASSERT (type_id
== type_helper
<coord2
>::id
, "type mismatch");
629 get_geometry (w
, x
, y
, W
, H
);
630 return close_box
<coord2
> (coord2 (W
, H
));
634 query_position (wk_widget w
, int type_id
) {
635 typedef pair
<SI
,SI
> coord2
;
636 ASSERT (type_id
== type_helper
<coord2
>::id
, "type mismatch");
638 get_geometry (w
, x
, y
, W
, H
);
639 return close_box
<coord2
> (coord2 (x
, y
));
643 query_keyboard_focus (wk_widget w
, int type_id
) {
644 ASSERT (type_id
== type_helper
<bool>::id
, "type mismatch");
645 return close_box
<bool> (w
->win
->get_keyboard_focus (abstract (w
)));
649 query_mouse_grab (wk_widget w
, int type_id
) {
650 ASSERT (type_id
== type_helper
<bool>::id
, "type mismatch");
651 return close_box
<bool> (w
->win
->get_mouse_grab (abstract (w
)));
655 wk_widget_rep::query (slot s
, int type_id
) {
657 case SLOT_IDENTIFIER
:
658 ASSERT (type_id
== type_helper
<int>::id
,
659 "int expected (SLOT_IDENTIFIER)");
660 return close_box
<int> (get_identifier (win
));
662 ASSERT (type_id
== type_helper
<renderer
>::id
,
663 "renderer expected (SLOT_RENDERER)");
664 return close_box
<renderer
> (win
->get_renderer ());
666 return query_size (THIS
, type_id
);
668 return query_position (THIS
, type_id
);
669 case SLOT_KEYBOARD_FOCUS
:
670 return query_keyboard_focus (THIS
, type_id
);
671 case SLOT_MOUSE_GRAB
:
672 return query_mouse_grab (THIS
, type_id
);
675 return query_coord4 (THIS
, "extents", type_id
);
676 case SLOT_VISIBLE_PART
:
677 return query_coord4 (THIS
, "visible", type_id
);
678 case SLOT_SCROLLBARS_VISIBILITY
:
679 return query_int (THIS
, "scrollbars", type_id
);
680 case SLOT_SCROLL_POSITION
:
681 return query_coord2 (THIS
, "scroll position", type_id
);
683 case SLOT_HEADER_VISIBILITY
:
684 return query_bool (THIS
, "header", type_id
);
685 case SLOT_MAIN_ICONS_VISIBILITY
:
686 return query_bool (THIS
, "main icons", type_id
);
687 case SLOT_CONTEXT_ICONS_VISIBILITY
:
688 return query_bool (THIS
, "context icons", type_id
);
689 case SLOT_USER_ICONS_VISIBILITY
:
690 return query_bool (THIS
, "user icons", type_id
);
691 case SLOT_FOOTER_VISIBILITY
:
692 return query_bool (THIS
, "footer flag", type_id
);
693 case SLOT_INTERACTIVE_MODE
:
694 return query_bool (THIS
, "interactive mode", type_id
);
695 case SLOT_INTERACTIVE_INPUT
:
696 return query_string (THIS
, "interactive input", type_id
);
698 case SLOT_STRING_INPUT
:
699 return query_string (THIS
, "input", type_id
);
701 FAILED ("cannot handle slot type");
706 /******************************************************************************
707 * Notification of state changes
708 ******************************************************************************/
711 notify_keyboard_focus (wk_widget w
, blackbox val
) {
712 ASSERT (type_box (val
) == type_helper
<bool>::id
, "type mismatch");
713 w
<< emit_keyboard_focus (open_box
<bool> (val
));
717 notify_mouse_grab (wk_widget w
, blackbox val
) {
718 ASSERT (type_box (val
) == type_helper
<bool>::id
, "type mismatch");
719 w
<< emit_mouse_grab (open_box
<bool> (val
));
723 wk_widget_rep::notify (slot s
, blackbox new_val
) {
726 check_type
<SI
,SI
> (new_val
, "SLOT_SIZE");
727 THIS
<< emit_resize ();
728 if (is_window_widget ())
729 send_size (THIS
[0], new_val
);
732 check_type
<SI
,SI
> (new_val
, "SLOT_POSITION");
733 THIS
<< emit_move ();
735 case SLOT_KEYBOARD_FOCUS
:
736 notify_keyboard_focus (THIS
, new_val
);
738 case SLOT_MOUSE_GRAB
:
739 notify_mouse_grab (THIS
, new_val
);
744 widget_rep::notify (s
, new_val
);
747 /******************************************************************************
748 * Read and write access of subwidgets
749 ******************************************************************************/
752 wk_widget_rep::read (slot s
, blackbox index
) {
755 check_type_void (index
, "SLOT_WINDOW");
756 return win
-> get_widget ();
757 case SLOT_FORM_FIELD
:
758 check_type
<int> (index
, "SLOT_FORM_FIELD");
759 return abstract (THIS
[0] ["inputs"] [open_box
<int> (index
)] ["input"]);
761 check_type_void (index
, "SLOT_FILE");
762 return abstract (THIS
[0] ["file"] ["input"]);
764 check_type_void (index
, "SLOT_DIRECTORY");
765 return abstract (THIS
[0] ["directory"] ["input"]);
767 FAILED ("cannot handle slot type");
773 wk_widget_rep::write (slot s
, blackbox index
, widget w
) {
776 check_type_void (index
, "SLOT_MAIN_MENU");
777 THIS
<< set_widget ("menu bar", concrete (w
));
779 case SLOT_MAIN_ICONS
:
780 check_type_void (index
, "SLOT_MAIN_ICONS");
781 THIS
<< set_widget ("main icons bar", concrete (w
));
783 case SLOT_CONTEXT_ICONS
:
784 check_type_void (index
, "SLOT_CONTEXT_ICONS");
785 THIS
<< set_widget ("context icons bar", concrete (w
));
787 case SLOT_USER_ICONS
:
788 check_type_void (index
, "SLOT_USER_ICONS");
789 THIS
<< set_widget ("user icons bar", concrete (w
));
792 check_type_void (index
, "SLOT_CANVAS");
793 THIS
<< set_widget ("scrollable", concrete (w
));
795 case SLOT_INTERACTIVE_PROMPT
:
796 check_type_void (index
, "SLOT_INTERACTIVE_PROMPT");
797 THIS
<< set_widget ("interactive prompt", concrete (w
));
799 case SLOT_INTERACTIVE_INPUT
:
800 check_type_void (index
, "SLOT_INTERACTIVE_INPUT");
801 THIS
<< set_widget ("interactive input", concrete (w
));
804 FAILED ("cannot handle slot type");