ARB
aw_window.hxx
Go to the documentation of this file.
1 #ifndef AW_WINDOW_HXX
2 #define AW_WINDOW_HXX
3 
4 #ifndef AW_BASE_HXX
5 #include "aw_base.hxx"
6 #endif
7 #ifndef ARBDB_BASE_H
8 #include <arbdb_base.h>
9 #endif
10 #ifndef ARB_ASSERT_H
11 #include <arb_assert.h>
12 #endif
13 #ifndef AW_KEYSYM_HXX
14 #include "aw_keysym.hxx"
15 #endif
16 #ifndef ARBTOOLS_H
17 #include <arbtools.h>
18 #endif
19 #ifndef CB_H
20 #include <cb.h>
21 #endif
22 
23 class AW_window;
24 class AW_xfig;
25 class AW_device;
26 struct AW_screen_area;
27 struct GB_HASH;
28 class AW_device_click;
29 class AW_device_print;
30 class AW_device_size;
31 class AW_common;
32 
33 // --------------------------------------------------------------------------------
34 
35 #define AW_MESSAGE_TIME 2000
36 #define AW_HEADER_MAIN extern "C" { int XtAppInitialize(); } void aw_never_called_main() { XtAppInitialize(); }
37 
38 // ======= Used in Tune background function =================================
39 #define TUNE_BUTTON 8
40 #define TUNE_INPUT (-TUNE_BUTTON)
41 #define TUNE_SUBMENU 0
42 #define TUNE_MENUTOPIC (-12)
43 #define TUNE_BRIGHT (256+30)
44 #define TUNE_DARK (-TUNE_BRIGHT)
45 // ==========================================================================
46 
47 #ifndef AW_AT_HXX
48 class AW_at;
49 #endif
50 
52 
53 typedef const char *AW_label; // label for buttons menus etc
54 // "fsdf" simple label // no '/' symbol !!!
55 // "awarname/asdf" // awar name (any '/' in string)
56 // "#file.xpm" // pixmap in $ARBHOME/lib/pixmaps/file.xpm
57 
58 const char *AW_get_pixmapPath(const char *pixmapName);
59 
60 void AW_POPDOWN(AW_window *);
61 
68 };
69 
77 };
78 
79 struct AW_event {
80  // fields always valid
81  AW_event_type type; // AW_Keyboard or AW_Mouse
82  unsigned long time; // time in msec, when event occurred
83  AW_key_mod keymodifier; // control, alt/meta (shift only for type == AW_Mouse)
84 
85  // fields valid for type == AW_Mouse
87  int x, y; // pointer x,y coordinates in the event window
88 
89  // fields valid for type == AW_Keyboard
90  AW_key_code keycode; // which key type was pressed
91  char character; // the c character
92 
94  : type(AW_event_type(0)),
95  time(0),
96  keymodifier(AW_KEYMODE_NONE),
97  button(AW_BUTTON_NONE),
98  x(0),
99  y(0),
100  keycode(AW_KEY_NONE),
101  character(0)
102  {}
103 };
104 
105 void AW_help_popup(UNFIXED, const char *help_file);
106 inline WindowCallback makeHelpCallback(const char *helpfile) { return makeWindowCallback(AW_help_popup, helpfile); }
107 
109 void AW_clock_cursor(AW_root *);
110 void AW_normal_cursor(AW_root *);
111 
112 void AW_openURL(AW_root *aw_root, const char *url);
113 
114 typedef void (*AW_cb_struct_guard)();
115 typedef WindowCallbackSimple AnyWinCB; // used to check whether function is contained in callback-list (does not check parameters!)
116 
117 class AW_cb : virtual Noncopyable {
118  WindowCallback cb;
119 
120  AW_cb *next;
121 
122  static AW_cb_struct_guard guard_before;
123  static AW_cb_struct_guard guard_after;
124  static AW_postcb_cb postcb; // called after each cb triggered via interface
125 
126 public:
127  // private (read-only):
129  const char *help_text;
130  char *id;
131 
132  // real public section:
133  AW_cb(AW_window *awi,
134  const WindowCallback& wcb,
135  const char *help_texti = NULp,
136  AW_cb *next = NULp);
137 
138  ~AW_cb() {
139  delete next; next = NULp;
140  free(id);
141  }
142 
143  void run_callbacks(); // runs the whole list
144  bool contains(AnyWinCB g); // test if contained in list
145  bool is_equal(const AW_cb& other) const;
146 
147  int compare(const AW_cb& other) const { return cb<other.cb ? -1 : (other.cb<cb ? 1 : 0); }
148 
149 #if defined(ASSERTION_USED)
150  AW_CL get_cd1() const { return cb.inspect_CD1(); }
151  AW_CL get_cd2() const { return cb.inspect_CD2(); }
152 #endif // DEBUG
153 
155  guard_before = before;
156  guard_after = after;
157  }
158  static void set_AW_postcb_cb(AW_postcb_cb postcb_cb) {
159  postcb = postcb_cb;
160  }
161 
162  static void useraction_init() {
163  if (guard_before) guard_before();
164  }
165  static void useraction_done(AW_window *aw) {
166  if (guard_after) guard_after();
167  if (postcb) postcb(aw);
168  }
169 };
170 
171 
172 enum {
173  AWM_DISABLED = 0, // disabled items (used for dynamically dis-/enabled items)
175  AWM_EXP = 2,
177 };
178 
179 enum {
183 };
184 
185 typedef char *AW_pixmap;
186 
187 class AW_window_Motif;
189 class AW_selection_list;
190 struct AW_option_menu_struct;
191 struct aw_toggle_data;
192 
197 };
200  virtual ~AW_at_storage() {}
201 
202  // will be called via AW_window
203  virtual void store(const AW_at& at) = 0;
204  virtual void restore(AW_at& at) const = 0;
205 
206  static AW_at_storage *make(AW_window *aww, AW_at_storage_type type); // factory
207 };
208 
210  AW_KEEP_SIZE = 0, // do not resize
211  AW_RESIZE_DEFAULT = 1, // do resize to default size
212  AW_RESIZE_USER = 2, // do resize to user size (or default size if that is bigger)
213  AW_RESIZE_ANY = 3 // keep AW_RESIZE_USER or set AW_RESIZE_DEFAULT
214 };
215 
217  AW_KEEP_POS = 0, // do not change position on show
218  AW_REPOS_TO_CENTER = 1, // center the window on show (unused atm)
219  AW_REPOS_TO_MOUSE = 2, // move the window under the current mouse position
220  AW_REPOS_TO_MOUSE_ONCE = 3, // like AW_REPOS_TO_MOUSE, but only done once!
221 };
222 
225  AW_SCALER_EXP_LOWER, // fine-tuned at lower border, big steps at upper border
226  AW_SCALER_EXP_UPPER, // fine-tuned at upper border, big steps at lower border
227  AW_SCALER_EXP_CENTER, // fine-tuned at center, big steps at borders
228  AW_SCALER_EXP_BORDER, // fine-tuned at borders, big steps at center
229 };
230 
232  AW_ScalerType type;
233 public:
234  AW_ScalerTransformer(AW_ScalerType type_) : type(type_) {}
235 
236  float scaler2awar(float scaler, AW_awar *awar); // [0..1] -> awar-range
237  float awar2scaler(AW_awar *awar); // returns [0..1]
238 };
239 
240 class AW_window : virtual Noncopyable {
241  AW_SizeRecalc recalc_size_at_show;
242  AW_PosRecalc recalc_pos_at_show;
243 
244  WindowCallback *hide_cb;
245  bool expose_callback_added;
246 
247  AW_cb *focus_cb;
248 
249  AW_xfig *xfig_data;
250  AW_at *_at;
252  int left_indent_of_horizontal_scrollbar;
253  int top_indent_of_vertical_scrollbar;
254 
255  void all_menus_created() const;
256  void create_toggle(const char *var_name, aw_toggle_data *tdata);
257 
258  int calculate_string_width(int columns) const;
259  int calculate_string_height(int columns, int offset) const;
260  char *align_string(const char *label_text, int columns);
261 
262  void calculate_label_size(int *width, int *height, bool in_pixel);
263 
264 protected:
266 
267  void create_devices();
268  void set_background(const char *colorname, Widget w);
269 
270  void wm_activate(); // un-minimize window and give it the focus (use show_and_activate())
271 
272 public:
273 
274  // ---------------------------------------- [start read-only section] @@@ should go private
275 
277  unsigned long click_time;
284 
285  // ---------------------------------------- [end read-only section]
286 
287 #if defined(IN_ARB_WINDOW)
288  // only used internal and in motif (alternative would be to move a bunch of code into AW_window)
289  const AW_at& get_at() const { return *_at; }
290  AW_at& get_at() { return *_at; }
291 #endif
292 
293  AW_window();
294  virtual ~AW_window();
295 
296  const char *window_local_awarname(const char *localname, bool tmp = true);
297  class AW_awar *window_local_awar(const char *localname, bool tmp = true);
299 
301  void recalc_size_atShow(enum AW_SizeRecalc sr);
303 
304  void allow_delete_window(bool allow_close);
305  void on_hide(const WindowCallback& call_on_hide);
306  void on_hide(WindowCallbackSimple call_on_hide) { on_hide(makeWindowCallback(call_on_hide)); }
307 
308 
309  void run_focus_callback();
310  void run_popup_callbacks();
311  void show_modal();
312  void set_window_title_intern(char *title);
313 
314  void update_label(Widget widget, const char *var_value);
315  void update_toggle(Widget widget, const char *var_value, AW_CL cd);
316  void update_input_field(Widget widget, const char *var_value);
317  void update_text_field(Widget widget, const char *var_value);
318  void update_scaler(Widget widget, AW_awar *awar, AW_ScalerType scalerType);
319 
320  void create_invisible(int columns);
321  void *_create_option_entry(AW_VARIABLE_TYPE type, const char *name, const char *mnemonic, const char *name_of_color);
322  void refresh_toggle_field(int toggle_field_number);
323  void _set_activate_callback(void *widget);
324  void increment_at_commands(int width, int height);
325 
326 
327  AW_color_idx alloc_named_data_color(int colnum, const char *colorname);
328 
329  // special for EDIT4
330  void _get_area_size(AW_area area, AW_screen_area *square);
331 
332  int label_widget(void *wgt, AW_label str, char *mnemonic = NULp, int width = 0, int alignment = 0);
333 
334  // ------------------------------
335  // The read only section
336 
337  char *window_name;
339 
342 
344 
345  AW_screen_area *picture; // the result of tell scrolled picture size
346 
347  // --------------------------------
348  // The real public section
349 
350  AW_root *get_root() { return root; }
351  // ******************* Global layout functions **********************
352 
353  void show(); // show newly created window or unhide hidden window (aka closed window)
354  void hide(); // hide (don't destroy) a window (<->show)
355 
356  void activate() { show(); wm_activate(); } // make_visible, pop window to front and give it the focus
357 
358  bool is_shown() const; // is window visible (== true) or hidden (== false). ?
359 
360  void hide_or_notify(const char *error);
361 
362  void message(char *title, int ms); // Set for ms milliseconds the title of the window
363  void set_window_title(const char *title); // Set the window title forever
364 
365  const char *get_window_title() const; // Get the window's title
366  const char *get_window_id() const { return window_defaults_name; } // Get the window's internal name
367 
368  const char *local_id(const char *id) const;
369 
370  void set_info_area_height(int height);
371  void set_bottom_area_height(int height);
372 
373  // ******************* Input and Motion Events **********************
374 
375  void set_popup_callback(const WindowCallback& wcb);
376  void set_focus_callback(const WindowCallback& wcb);
378 
379  void set_expose_callback(AW_area area, const WindowCallback& wcb);
380  void set_resize_callback(AW_area area, const WindowCallback& wcb);
381 
382 private:
383  // motif relicts:
384  void set_expose_callback(AW_area area, WindowCallbackSimple cb) { set_expose_callback(area, makeWindowCallback(cb)); }
385  void set_resize_callback(AW_area area, WindowCallbackSimple cb) { set_resize_callback(area, makeWindowCallback(cb)); }
386 public:
387 
388  void set_input_callback(AW_area area, const WindowCallback& wcb);
389  void set_motion_callback(AW_area area, const WindowCallback& wcb);
390 
391  void set_double_click_callback(AW_area area, const WindowCallback& wcb);
392 
393  bool is_expose_callback(AW_area area, AnyWinCB f);
394  bool is_resize_callback(AW_area area, AnyWinCB f);
395 
396  void get_event(AW_event *eventi) const; // In an event callback get the events info
397 
398  void force_expose(); // forces the window to expose instantly
399 
400  // ******************* Get the devices **********************
402  AW_device_click *get_click_device(AW_area area, int mousex, int mousey, int max_distance);
404  AW_device_print *get_print_device(AW_area area);
405 
407 
408  // ************** Create the menu buttons *********
409 
416  void create_menu(const char *name, const char *mnemonic, AW_active mask = AWM_ALL);
417 
424  void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask = AWM_ALL);
425 
435  void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback& wcb);
436 
437  void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const CreateWindowCallback& cwcb) { insert_menu_topic(id, name, mnemonic, help_text_, mask, makeWindowPopper(cwcb)); }
438  void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, WindowCallbackSimple cb) { insert_menu_topic(id, name, mnemonic, help_text_, mask, makeWindowCallback(cb)); }
439  void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, CreateWindowCallbackSimple cb) { insert_menu_topic(id, name, mnemonic, help_text_, mask, makeCreateWindowCallback(cb)); }
440 
441  void sep______________();
442  void close_sub_menu();
443 
444  void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, const WindowCallback& cb);
445  void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, WindowCallbackSimple cb) { insert_help_topic(labeli, mnemonic, helpText, mask, makeWindowCallback(cb)); }
446 
447  // ************** Create modes on the left side ******************
448  int create_mode(const char *pixmap, const char *help_text_, AW_active mask, const WindowCallback& cb);
449  void select_mode(int mode);
450 
451  // ************** Control the size of the main drawing area + scrollbars *********
453  void tell_scrolled_picture_size(AW_world rectangle);
457 
458  void get_scrollarea_size(AW_screen_area *square);
459 
460  void calculate_scrollbars();
461  void set_vertical_scrollbar_position(int position);
462  void set_horizontal_scrollbar_position(int position);
463 
464  void set_vertical_change_callback(const WindowCallback& wcb);
465  void set_horizontal_change_callback(const WindowCallback& wcb);
468 
469 
471 
472  void create_user_geometry_awars(int posx, int posy, int width, int height);
473 
474  // ************** Control window size *********
475 #if defined(IN_ARB_WINDOW)
476  void set_window_size(int width, int height);
477 #endif
478  void get_window_size(int& width, int& height);
479  void window_fit(); // Recalculate the size of a window with buttons
480 
481 #if defined(IN_ARB_WINDOW)
482  void store_size_in_awars(int width, int height);
483  void get_size_from_awars(int& width, int& height);
484 
485  // ************** Control window position *********
486  void set_window_frame_pos(int xpos, int ypos);
487  void get_window_content_pos(int& xpos, int& ypos);
488 
489  void store_pos_in_awars(int xpos, int ypos);
490  void get_pos_from_awars(int& xpos, int& ypos);
491 
492  void reset_geometry_awars();
493 
494  // *****************
495  void get_screen_size(int& width, int& height);
496  bool get_mouse_pos(int& x, int& y);
497  void set_focus_policy(bool follow_mouse);
498  void get_font_size(int& w, int& h);
499 #endif
500 
501  // ************** ******************************************************************** *********
502  // ************** Create buttons: First set modify flags and finally create the button *********
503  // ************** ******************************************************************** *********
504 
505  // *** global modifier: ****
506  void load_xfig(const char *file, bool resize=true); // Loads the background graphic
507  void draw_line(int x1, int y1, int x2, int y2, int width, bool resize); // draws a line on the background
508 
509  void label_length(int length); // Justifies all following labels
510  void button_length(int length); // Sets the width of all following buttons (in chars)
511  void button_height(int height); // Sets the height of all following buttons (in lines)
512  int get_button_length() const; // returns the current width of buttons
513  void highlight(); // Creates a frame around the button
514  void auto_increment(int dx, int dy); // enable automatic placement of buttons
515  // dx is the horizontal distance between the left
516  // borders of two buttons
517  void auto_space(int xspace, int yspace); // enable automatic placement of buttons
518  // xspace is the horizontal space between 2 buttons
519 
520  void shadow_width (int shadow_thickness); // set the shadow_thickness of buttons
521 
522  void TuneBackground(Widget w, int modStrength);
523  void TuneOrSetBackground(Widget w, const char *color, int modStrength);
524 
525  // *** local modifiers: ********
526  void at(int x, int y); // abs pos of a button (>10,10)
527  void at_x(int x); // abs x pos
528  void at_y(int y); // abs y pos
529  void at_shift(int x, int y); // rel pos of a button
530  void at_newline(); // in auto_space mode only: newline
531 
532  void at(const char *id); /* place the button at the position set in the .fig
533  * file (loaded with load_xfig) by the string $id */
534  bool at_ifdef(const char *id); // check whether 'id' is an element if the .fig file
535 
536  void label(const char *label); // Create a label before the button
537 
538  void get_at_position(int *x, int *y) const;
539  int get_at_xposition() const;
540  int get_at_yposition() const;
541 
542  void dump_at_position(const char *debug_label) const; // for debugging (uses printf)
543 
544  void at_attach(int x, int y); // set "XY:noid" manually (use negative rel. position to attach)
545  void at_attach_to(bool attach_x, bool attach_y, int xoff, int yoff); // set "to:XY:noid" manually
546  void at_unattach(); // unset effects of at_attach() and/or at_attach_to()
547 
548  void unset_at_commands();
549 
550  void store_at_to(AW_at_storage& storage) { storage.store(*_at); }
551  void restore_at_from(const AW_at_storage& stored) { stored.restore(*_at); }
552 
553  void sens_mask(AW_active mask); // Set the sensitivity mask used for following widgets (Note: reset by next at()-command)
554  void help_text(const char *id); // Set the help text of a button
555 
556 private:
557  static void popper(AW_window *, CreateWindowCallback *windowMaker);
558  static void replacer(AW_window *aww, CreateWindowCallback *windowMaker);
559  static void destroyCreateWindowCallback(CreateWindowCallback *windowMaker);
560 public:
561  static WindowCallback makeWindowPopper(const CreateWindowCallback& cwcb) {
562  return makeWindowCallback(popper, destroyCreateWindowCallback, new CreateWindowCallback(cwcb));
563  }
564  static WindowCallback makeWindowReplacer(const CreateWindowCallback& cwcb) {
565  return makeWindowCallback(replacer, destroyCreateWindowCallback, new CreateWindowCallback(cwcb));
566  }
567 
568  // normal callbacks
569  void callback(const WindowCallback& cb);
570 
571  void callback(const CreateWindowCallback& cwcb) { callback(makeWindowPopper(cwcb)); }
572  void callback(CreateWindowCallbackSimple cb) { callback(makeCreateWindowCallback(cb)); }
573  void callback(WindowCallbackSimple cb) { callback(makeWindowCallback(cb)); }
574 
575  void d_callback(const WindowCallback& cb); // secondary callback (called for 'double click into selection list' and 'text field hit ENTER')
576 
577  // *** create the buttons ********
578  void create_button(const char *macro_name, AW_label label, const char *mnemonic = NULp, const char *color = NULp); // simple button; shadow only when callback
579  void create_autosize_button(const char *macro_name, AW_label label, const char *mnemonic = NULp, unsigned xtraSpace = 1); // as above, but ignores button_length
580  Widget get_last_widget() const;
581 
582  void create_toggle(const char *awar_name); // int 0/1 string yes/no float undef
583  void create_inverse_toggle(const char *awar_name); // like create_toggle, but displays inverted toggle value
584 
585  void create_toggle(const char *awar_name, const char *nobitmap, const char *yesbitmap, int buttonWidth = 0);
586  void create_text_toggle(const char *var_name, const char *noText, const char *yesText, int buttonWidth = 0);
587 
588  void create_input_field(const char *awar_name, int columns = 0); // One line textfield
589  void create_text_field(const char *awar_name, int columns = 20, int rows = 4); // Multi line textfield with scrollbars
590  void create_input_field_with_scaler(const char *awar_name, int textcolumns = 4, int scaler_length = 250, AW_ScalerType scalerType = AW_SCALER_LINEAR);
591 
592 
593  // ***** option_menu is a menu where only one selection is visible at a time
595  void clear_option_menu(AW_option_menu_struct *oms); // used to redefine available options
596 
597 private:
598  void insert_option_internal(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color, bool default_option);
599  void insert_option_internal(AW_label choice_label, const char *mnemonic, int var_value, const char *name_of_color, bool default_option);
600  void insert_option_internal(AW_label choice_label, const char *mnemonic, float var_value, const char *name_of_color, bool default_option);
601 
602  void insert_toggle_internal(AW_label toggle_label, const char *mnemonic, const char *var_value, bool default_toggle);
603  void insert_toggle_internal(AW_label toggle_label, const char *mnemonic, int var_value, bool default_toggle);
604  void insert_toggle_internal(AW_label toggle_label, const char *mnemonic, float var_value, bool default_toggle);
605 public:
606 
607  // for string
608  void insert_option (AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color = NULp); // for string
609  void insert_default_option (AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color = NULp);
610  // for int
611  void insert_option (AW_label choice_label, const char *mnemonic, int var_value, const char *name_of_color = NULp); // for int
612  void insert_default_option (AW_label choice_label, const char *mnemonic, int var_value, const char *name_of_color = NULp);
613  // for float
614  void insert_option (AW_label choice_label, const char *mnemonic, float var_value, const char *name_of_color = NULp); // for float
615  void insert_default_option (AW_label choice_label, const char *mnemonic, float var_value, const char *name_of_color = NULp);
616 
617  void update_option_menu();
618  void refresh_option_menu(AW_option_menu_struct *); // don't use this
619 
620 
621  // ***** toggle_field is a static menu (all items are visible and only one is selected)
622  void create_toggle_field(const char *awar_name, AW_label label, AW_orientation orientation = AW_VERTICAL);
623  void create_toggle_field(const char *awar_name, AW_orientation orientation = AW_VERTICAL);
624  // for string
625  void insert_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value);
626  void insert_default_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value);
627  // for int
628  void insert_toggle(AW_label toggle_label, const char *mnemonic, int var_value);
629  void insert_default_toggle(AW_label toggle_label, const char *mnemonic, int var_value);
630  // for float
631  void insert_toggle(AW_label toggle_label, const char *mnemonic, float var_value);
632  void insert_default_toggle(AW_label toggle_label, const char *mnemonic, float var_value);
633 
634  void update_toggle_field();
635 
636  // ***** selection list is a redefinable scrolled list of items
637 
638  AW_selection_list *create_selection_list(const char *awar_name, int columns, int rows);
639  AW_selection_list *create_selection_list(const char *awar_name) { return create_selection_list(awar_name, 4, 4); }
640 };
641 
642 
643 class AW_window_menu_modes : public AW_window { // derived from a Noncopyable
644  void *AW_window_menu_modes_private; // Do not use !!!
645 
646 public:
649  void init(AW_root *root, const char *wid, const char *windowname, int width, int height);
651 };
653 
654 class AW_window_menu : public AW_window {
655 private:
656 public:
657  AW_window_menu();
658  ~AW_window_menu();
659  void init(AW_root *root, const char *wid, const char *windowname, int width, int height);
660 };
661 
663 private:
664 public:
667  void init(AW_root *root, const char *wid, const char *windowname);
668 };
669 
670 
671 class AW_window_simple FINAL_TYPE : public AW_window {
672 private:
673 public:
674  AW_window_simple();
675  ~AW_window_simple();
676  void init(AW_root *root, const char *wid, const char *windowname);
677 };
678 
679 
680 class AW_window_message : public AW_window {
681 private:
682 public:
685  void init(AW_root *root_in, const char *wid, const char *windowname, bool allow_close);
686  void init(AW_root *root_in, const char *windowname, bool allow_close); // auto-generates window id from title
687 };
688 
689 class AW_gc_manager;
690 
691 #else
692 #error aw_window.hxx included twice
693 #endif
void TuneBackground(Widget w, int modStrength)
Definition: AW_window.cxx:3159
void insert_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
bool is_resize_callback(AW_area area, AnyWinCB f)
Definition: AW_window.cxx:1520
AW_ScalerTransformer(AW_ScalerType type_)
Definition: aw_window.hxx:234
void update_scrollbar_settings_from_awars(AW_orientation orientation)
Definition: AW_window.cxx:2037
AW_device_print * get_print_device(AW_area area)
Definition: AW_window.cxx:547
void refresh_option_menu(AW_option_menu_struct *)
AW_cb * _callback
Definition: aw_window.hxx:282
void get_at_position(int *x, int *y) const
Definition: AW_at.cxx:291
AW_bitset AW_active
Definition: aw_base.hxx:45
GB_TYPES type
void insert_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value)
AW_event_type
Definition: aw_window.hxx:62
void set_resize_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:816
void callback(const CreateWindowCallback &cwcb)
Definition: aw_window.hxx:571
char * window_name
Definition: aw_window.hxx:337
void button_length(int length)
Definition: AW_at.cxx:283
AW_pos get_scrolled_picture_height() const
Definition: AW_window.cxx:841
void d_callback(const WindowCallback &cb)
Definition: AW_window.cxx:141
void sens_mask(AW_active mask)
Definition: AW_window.cxx:127
int get_at_xposition() const
Definition: AW_at.cxx:296
AW_device * get_device(AW_area area)
Definition: AW_window.cxx:537
static char * y[maxsp+1]
MARK_NONFINAL_CLASS(AW_window_menu_modes)
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:595
void(* WindowCallbackSimple)(AW_window *)
Definition: cb.h:29
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:720
const char * get_window_id() const
Definition: aw_window.hxx:366
void set_popup_callback(const WindowCallback &wcb)
Definition: AW_window.cxx:792
void update_label(Widget widget, const char *var_value)
Definition: AW_button.cxx:740
void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, WindowCallbackSimple cb)
Definition: aw_window.hxx:445
void at_x(int x)
Definition: AW_at.cxx:98
void reset_scrolled_picture_size()
Definition: AW_window.cxx:845
virtual ~AW_window()
Definition: AW_window.cxx:1120
void on_hide(const WindowCallback &call_on_hide)
Definition: AW_window.cxx:1837
void set_vertical_scrollbar_top_indent(int indent)
Definition: AW_window.cxx:852
void _set_activate_callback(void *widget)
Definition: AW_window.cxx:3092
AW_cb(AW_window *awi, const WindowCallback &wcb, const char *help_texti=NULp, AW_cb *next=NULp)
void at(int x, int y)
Definition: AW_at.cxx:93
AW_window *(* CreateWindowCallbackSimple)(AW_root *)
Definition: cb.h:27
AW_ScalerType
Definition: aw_window.hxx:223
void callback(CreateWindowCallbackSimple cb)
Definition: aw_window.hxx:572
void set_window_title_intern(char *title)
Definition: AW_window.cxx:1065
void(* AW_cb_struct_guard)()
Definition: aw_window.hxx:114
AW_window * aw
Definition: aw_window.hxx:128
void unset_at_commands()
Definition: AW_at.cxx:220
unsigned long click_time
Definition: aw_window.hxx:277
static void set_AW_cb_guards(AW_cb_struct_guard before, AW_cb_struct_guard after)
Definition: aw_window.hxx:154
static WindowCallback makeWindowReplacer(const CreateWindowCallback &cwcb)
Definition: aw_window.hxx:564
AW_screen_area * picture
Definition: aw_window.hxx:345
long color_table_size
Definition: aw_window.hxx:278
void at_shift(int x, int y)
Definition: AW_at.cxx:115
void AW_POPDOWN(AW_window *)
Definition: AW_window.cxx:52
AW_SizeRecalc
Definition: aw_window.hxx:209
const char * title
Definition: readseq.c:22
void get_scrollarea_size(AW_screen_area *square)
Definition: AW_window.cxx:867
void set_background(const char *colorname, Widget w)
Definition: AW_window.cxx:3106
void init(AW_root *root_in, const char *wid, const char *windowname, bool allow_close)
Definition: AW_window.cxx:2910
void allow_delete_window(bool allow_close)
Definition: AW_window.cxx:1630
char * id
Definition: aw_window.hxx:130
unsigned long AW_rgb
Definition: aw_base.hxx:51
AW_color_idx
Definition: aw_base.hxx:83
Definition: aw_at.hxx:18
void _get_area_size(AW_area area, AW_screen_area *square)
Definition: AW_window.cxx:862
AW_pos get_scrolled_picture_width() const
Definition: AW_window.cxx:837
void wm_activate()
Definition: AW_window.cxx:3039
char * window_defaults_name
window title
Definition: aw_window.hxx:338
void update_text_field(Widget widget, const char *var_value)
Definition: AW_button.cxx:1118
int slider_pos_horizontal
current position of the vertical slider
Definition: aw_window.hxx:341
void set_window_title(const char *title)
Definition: AW_window.cxx:1069
unsigned long time
Definition: aw_window.hxx:82
void AW_clock_cursor(AW_root *)
Definition: AW_root.cxx:29
bool is_focus_callback(AnyWinCB f)
Definition: AW_window.cxx:1456
void update_option_menu()
void activate()
Definition: aw_window.hxx:356
#define cb(action)
char character
Definition: aw_window.hxx:91
void set_motion_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:811
AW_device_size * get_size_device(AW_area area)
Definition: AW_window.cxx:552
void update_toggle_field()
void update_toggle(Widget widget, const char *var_value, AW_CL cd)
Definition: AW_button.cxx:758
AW_common * get_common(AW_area area)
Definition: AW_window.cxx:564
AW_area
Definition: aw_base.hxx:76
struct Unfixed_cb_parameter * UNFIXED
Definition: cb_base.h:15
void create_window_variables()
Definition: AW_window.cxx:977
void create_input_field_with_scaler(const char *awar_name, int textcolumns=4, int scaler_length=250, AW_ScalerType scalerType=AW_SCALER_LINEAR)
Definition: AW_button.cxx:1143
void update_input_field(Widget widget, const char *var_value)
Definition: AW_button.cxx:984
const char * window_local_awarname(const char *localname, bool tmp=true)
Definition: AW_window.cxx:964
void AW_openURL(AW_root *aw_root, const char *url)
Definition: AW_help.cxx:35
int create_mode(const char *pixmap, const char *help_text_, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:2973
Definition: aw_select.hxx:26
AliDataPtr after(AliDataPtr data, size_t pos)
Definition: insdel.cxx:593
void show()
Definition: AW_window.cxx:1670
double AW_pos
Definition: aw_base.hxx:29
const char * help_text
Definition: aw_window.hxx:129
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
void create_toggle_field(const char *awar_name, AW_label label, AW_orientation orientation=AW_VERTICAL)
virtual void store(const AW_at &at)=0
bool contains(AnyWinCB g)
Widget get_last_widget() const
Definition: AW_button.cxx:401
bool is_expose_callback(AW_area area, AnyWinCB f)
Definition: AW_window.cxx:1497
AW_VARIABLE_TYPE
Definition: aw_base.hxx:53
void create_devices()
Definition: AW_window.cxx:2111
void get_event(AW_event *eventi) const
Definition: AW_window.cxx:543
AW_MouseButton
Definition: aw_window.hxx:70
void set_double_click_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:1984
void recalc_size_atShow(enum AW_SizeRecalc sr)
Definition: AW_window.cxx:1439
float scaler2awar(float scaler, AW_awar *awar)
Definition: AW_window.cxx:188
void create_inverse_toggle(const char *awar_name)
Definition: AW_button.cxx:848
void force_expose()
Definition: AW_window.cxx:1502
void increment_at_commands(int width, int height)
Definition: AW_at.cxx:234
int compare(const AW_cb &other) const
Definition: aw_window.hxx:147
virtual void restore(AW_at &at) const =0
AW_cb * _d_callback
Definition: aw_window.hxx:283
static void set_AW_postcb_cb(AW_postcb_cb postcb_cb)
Definition: aw_window.hxx:158
bool is_equal(const AW_cb &other) const
void calculate_scrollbars()
Definition: AW_window.cxx:873
AW_device_click * get_click_device(AW_area area, int mousex, int mousey, int max_distance)
Definition: AW_window.cxx:526
void show_modal()
Definition: AW_window.cxx:1816
const char * get_window_title() const
Definition: AW_window.cxx:1074
AW_selection_list * create_selection_list(const char *awar_name)
Definition: aw_window.hxx:639
AW_root * root
Definition: aw_window.hxx:265
void set_expose_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:765
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:472
int number_of_timed_title_changes
Definition: aw_window.hxx:280
void help_text(const char *id)
Definition: AW_window.cxx:116
static char const * macro_name
Definition: mkptypes.cxx:81
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, CreateWindowCallbackSimple cb)
Definition: aw_window.hxx:439
static void error(const char *msg)
Definition: mkptypes.cxx:96
AW_event event
Definition: aw_window.hxx:276
void at_unattach()
Definition: AW_at.cxx:211
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2389
const char * mnemonic
void restore_at_from(const AW_at_storage &stored)
Definition: aw_window.hxx:551
PREPARE_MARK_NONFINAL_CLASS(AW_window_menu_modes)
void message(char *title, int ms)
Definition: AW_window.cxx:231
void * _create_option_entry(AW_VARIABLE_TYPE type, const char *name, const char *mnemonic, const char *name_of_color)
void label(const char *label)
Definition: AW_window.cxx:102
void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:569
bool window_is_shown
current position of the horizontal slider
Definition: aw_window.hxx:343
void TuneOrSetBackground(Widget w, const char *color, int modStrength)
Definition: AW_window.cxx:3128
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const CreateWindowCallback &cwcb)
Definition: aw_window.hxx:437
int label_widget(void *wgt, AW_label str, char *mnemonic=NULp, int width=0, int alignment=0)
void refresh_toggle_field(int toggle_field_number)
AW_orientation
Definition: aw_window.hxx:51
float awar2scaler(AW_awar *awar)
Definition: AW_window.cxx:197
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:645
AW_key_code keycode
Definition: aw_window.hxx:90
void window_fit()
Definition: AW_window.cxx:1086
AW_key_mod keymodifier
Definition: aw_window.hxx:83
int get_button_length() const
Definition: AW_at.cxx:287
char * AW_pixmap
Definition: aw_window.hxx:185
void button_height(int height)
Definition: AW_window.cxx:1082
AliDataPtr before(AliDataPtr data, size_t pos)
Definition: insdel.cxx:592
void AW_help_popup(UNFIXED, const char *help_file)
Definition: AW_help.cxx:628
void create_user_geometry_awars(int posx, int posy, int width, int height)
Definition: AW_window.cxx:1214
void create_autosize_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, unsigned xtraSpace=1)
Definition: AW_button.cxx:421
void set_horizontal_scrollbar_left_indent(int indent)
Definition: AW_window.cxx:857
static AW_at_storage * make(AW_window *aww, AW_at_storage_type type)
Definition: AW_at.cxx:444
void clear_option_menu(AW_option_menu_struct *oms)
void insert_default_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
WindowCallbackSimple AnyWinCB
Definition: aw_window.hxx:115
class AW_awar * window_local_awar(const char *localname, bool tmp=true)
Definition: AW_window.cxx:973
AW_PosRecalc
Definition: aw_window.hxx:216
void tell_scrolled_picture_size(AW_screen_area rectangle)
Definition: AW_window.cxx:823
char * awar_name
Definition: aw_awar.hxx:103
static void set_focus_policy(const char *, long cl_aww, void *)
Definition: AW_root.cxx:251
void set_info_area_height(int height)
Definition: AW_window.cxx:796
virtual ~AW_at_storage()
store/restore some properties from/to AW_at
Definition: aw_window.hxx:200
void create_input_field(const char *awar_name, int columns=0)
Definition: AW_button.cxx:857
AW_rgb * color_table
Definition: aw_window.hxx:279
const char * AW_label
Definition: aw_window.hxx:53
~AW_cb()
Definition: aw_window.hxx:138
AW_event_type type
Definition: aw_window.hxx:81
void set_bottom_area_height(int height)
Definition: AW_window.cxx:801
AW_window_Motif * p_w
Definition: aw_window.hxx:281
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, WindowCallbackSimple cb)
Definition: aw_window.hxx:438
void update_scaler(Widget widget, AW_awar *awar, AW_ScalerType scalerType)
Definition: AW_button.cxx:1187
void auto_space(int xspace, int yspace)
Definition: AW_at.cxx:259
void draw_line(int x1, int y1, int x2, int y2, int width, bool resize)
Definition: AW_window.cxx:512
xml element
long AW_CL
Definition: cb.h:21
void set_focus_callback(const WindowCallback &wcb)
Definition: AW_window.cxx:778
void at_attach(int x, int y)
Definition: AW_at.cxx:157
void create_invisible(int columns)
AW_key_code
Definition: aw_keysym.hxx:14
Definition: output.h:122
AW_MouseButton button
Definition: aw_window.hxx:86
void recalc_pos_atShow(AW_PosRecalc pr)
Definition: AW_window.cxx:1431
AW_selection_list * create_selection_list(const char *awar_name, int columns, int rows)
Definition: AW_button.cxx:1215
void set_horizontal_scrollbar_position(int position)
Definition: AW_window.cxx:998
static WindowCallback makeWindowPopper(const CreateWindowCallback &cwcb)
Definition: aw_window.hxx:561
void close_sub_menu()
Definition: AW_window.cxx:486
static ARB_init_perl_interface init
Definition: ARB_ext.c:101
bool is_shown() const
Definition: AW_window.cxx:1634
void on_hide(WindowCallbackSimple call_on_hide)
Definition: aw_window.hxx:306
void auto_increment(int dx, int dy)
Definition: AW_at.cxx:270
bool at_ifdef(const char *id)
Definition: AW_at.cxx:134
AW_option_menu_struct * create_option_menu(const char *awar_name)
void hide()
Definition: AW_window.cxx:1822
void select_mode(int mode)
Definition: AW_window.cxx:2952
void highlight()
Definition: AW_window.cxx:122
AW_CL get_cd1() const
Definition: aw_window.hxx:150
void insert_default_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value)
AW_root * get_root()
Definition: aw_window.hxx:350
void callback(WindowCallbackSimple cb)
Definition: aw_window.hxx:573
void at_y(int y)
Definition: AW_at.cxx:104
void dump_at_position(const char *debug_label) const
Definition: AW_button.cxx:736
#define NULp
Definition: cxxforward.h:114
void create_text_toggle(const char *var_name, const char *noText, const char *yesText, int buttonWidth=0)
Definition: AW_button.cxx:833
AW_key_mod
Definition: aw_keysym.hxx:46
const char * AW_get_pixmapPath(const char *pixmapName)
Definition: AW_button.cxx:266
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2599
struct AW_awar::@60::@62 f
#define offset(field)
Definition: GLwDrawA.c:73
void run_focus_callback()
Definition: AW_window.cxx:1452
void sep______________()
Definition: AW_window.cxx:753
void set_vertical_scrollbar_position(int position)
Definition: AW_window.cxx:989
const char * local_id(const char *id) const
Definition: AW_window.cxx:747
void store_at_to(AW_at_storage &storage)
Definition: aw_window.hxx:550
static void useraction_init()
Definition: aw_window.hxx:162
AW_PosRecalc get_recalc_pos_atShow() const
Definition: AW_window.cxx:1435
void run_callbacks()
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:133
void set_horizontal_change_callback(const WindowCallback &wcb)
Definition: AW_window.cxx:1049
void set_vertical_change_callback(const WindowCallback &wcb)
Definition: AW_window.cxx:1033
void run_popup_callbacks()
Definition: AW_window.cxx:1463
int get_at_yposition() const
Definition: AW_at.cxx:300
static void useraction_done(AW_window *aw)
Definition: aw_window.hxx:165
AW_at_storage_type
Definition: aw_window.hxx:193
void(* AW_postcb_cb)(AW_window *)
Definition: aw_base.hxx:24
void hide_or_notify(const char *error)
Definition: AW_window.cxx:1832
void shadow_width(int shadow_thickness)
Definition: AW_window.cxx:1078
void AW_help_entry_pressed(AW_window *)
Definition: AW_root.cxx:37
size_t length
void label_length(int length)
Definition: AW_at.cxx:279
int slider_pos_vertical
window id
Definition: aw_window.hxx:340
void at_newline()
Definition: AW_at.cxx:119
void at_attach_to(bool attach_x, bool attach_y, int xoff, int yoff)
Definition: AW_at.cxx:187
void set_input_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:806
struct _WidgetRec * Widget
Definition: aw_base.hxx:48
AW_color_idx alloc_named_data_color(int colnum, const char *colorname)
Definition: AW_window.cxx:2058
void get_window_size(int &width, int &height)
Definition: AW_window.cxx:109
void init(AW_root *root, const char *wid, const char *windowname)
Definition: AW_window.cxx:2832
void AW_normal_cursor(AW_root *)
Definition: AW_root.cxx:33
void create_text_field(const char *awar_name, int columns=20, int rows=4)
Definition: AW_button.cxx:988
AW_CL get_cd2() const
Definition: aw_window.hxx:151
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:448