31 #include <X11/Shell.h>
32 #include <Xm/AtomMgr.h>
35 #include <Xm/Protocols.h>
36 #include <Xm/RowColumn.h>
37 #include <Xm/DrawingA.h>
39 #include <Xm/Separator.h>
41 #include <Xm/CascadeB.h>
42 #include <Xm/MenuShell.h>
43 #include <Xm/ScrollBar.h>
44 #include <Xm/MwmUtil.h>
62 #define NOWINWARN() fputs("window factory did not create a window\n", stderr)
72 typedef std::map<CreateWindowCallback, AW_window*> window_map;
74 static window_map window;
75 CreateWindowCallback& maker = *windowMaker;
77 if (window.find(maker) == window.end()) {
86 void AW_window::popper(
AW_window *, CreateWindowCallback *windowMaker) {
90 void AW_window::replacer(
AW_window *caller, CreateWindowCallback *windowMaker) {
97 void AW_window::destroyCreateWindowCallback(CreateWindowCallback *windowMaker) {
110 unsigned short hoffset = 0;
157 switch (scalerType) {
163 if (inverse) res = pow(val, 1/3.0);
164 else res = pow(val, 3.0);
192 float aval = amin + modScaleRel*(amax-amin);
204 awarRel = (awar->
read_float()-amin) / (amax-amin);
208 awarRel = (awar->
read_int()-amin) / (amax-amin);
232 char *old_title =
NULp;
247 #define CHECK_DUPLICATED_MNEMONICS
250 #ifdef CHECK_DUPLICATED_MNEMONICS
252 inline char oppositeCase(
char c) {
253 return isupper(c) ? tolower(c) : toupper(c);
255 static void strcpy_overlapping(
char *dest,
char *src) {
256 int src_len = strlen(src);
257 memmove(dest, src, src_len+1);
259 static const char *possible_mnemonics(
const char *used_mnemonics,
bool top_level,
const char *topic_name) {
261 for (
int fromTopic = 1; fromTopic>=0; --fromTopic) {
262 freedup(unused, fromTopic ? topic_name :
"abcdefghijklmnopqrstuvwxyz");
264 for (
int t = 0; unused[t]; ++t) {
266 if ((top_level && !isalpha(unused[t])) || !isalnum(unused[t])) {
270 char *dup = strchr(unused, unused[t]);
271 if (dup && (dup-unused)<t) {
275 dup = strchr(unused, oppositeCase(unused[t]));
276 if (dup && (dup-unused)<t) {
277 dup[0] = toupper(dup[0]);
283 strcpy_overlapping(unused+t, unused+t+1);
288 for (
int t = 0; used_mnemonics[t]; ++t) {
289 char c = used_mnemonics[t];
290 char *u = strchr(unused, c);
291 if (u) strcpy_overlapping(u, u+1);
292 u = strchr(unused, tolower(c));
293 if (u) strcpy_overlapping(u, u+1);
307 typedef std::map<char,std::string> Char2Topic;
310 MnemonicScope *parent;
314 void print_at_menu(FILE *out) {
316 parent->print_at_menu(out);
319 fputs(name.c_str(), out);
321 void print_at_location(FILE *out,
const char *topic) {
324 fprintf(out,
"|%s)\n", topic);
327 void requestPossibilities(
const char *topic_name) {
329 if (requested.index_of(topic_name) == -1) {
330 requested.put(strdup(topic_name));
334 void showRequestedPossibilities() {
335 unsigned size = accepted.size();
336 char *used =
new char[size+1];
339 for (Char2Topic::iterator a = accepted.begin(); a != accepted.end(); ++a) {
340 used[i++] = a->first;
344 for (i = 0; requested[i]; ++i) {
345 const char *possible = possible_mnemonics(used, !parent, requested[i]);
346 fprintf(stderr,
"Warning: Possible mnemonics for '%s': '%s'\n", requested[i], possible);
352 void warn_mnemonic(
const char *topic_name,
const char *
mnemonic,
const char *
warning) {
353 fprintf(stderr,
"Warning: mnemonic '%s' %s", mnemonic, warning);
354 print_at_location(stderr, topic_name);
359 MnemonicScope(
const char *name_, MnemonicScope *parent_)
365 showRequestedPossibilities();
368 void add(
const char *topic_name,
const char *
mnemonic);
370 MnemonicScope *get_parent() {
return parent; }
373 static MnemonicScope *current_mscope =
NULp;
374 static MnemonicScope *help_mscope =
NULp;
377 if (mnemonic && mnemonic[0] != 0) {
379 warn_mnemonic(topic_name, mnemonic,
"is too long; only 1 character allowed");
384 warn_mnemonic(topic_name, mnemonic,
"is useless for graphical menu entry");
387 else if (!isalpha(mnemonic[0]) && !get_parent()) {
388 warn_mnemonic(topic_name, mnemonic,
"is invalid (allowed: a-z)");
389 requestPossibilities(topic_name);
391 else if (!isalnum(mnemonic[0])) {
392 warn_mnemonic(topic_name, mnemonic,
"is invalid (allowed: a-z and 0-9)");
393 requestPossibilities(topic_name);
397 char HOTKEY = toupper(mnemonic[0]);
399 if (strchr(TOPIC_NAME, HOTKEY)) {
400 Char2Topic::iterator found = accepted.find(HOTKEY);
402 if (found != accepted.end()) {
403 warn_mnemonic(topic_name, mnemonic,
"is used multiple times");
404 requestPossibilities(topic_name);
405 requestPossibilities(found->second.c_str());
408 accepted[HOTKEY] = topic_name;
410 if (!strchr(topic_name, mnemonic[0])) {
412 warn_mnemonic(topic_name, mnemonic, warning);
418 warn_mnemonic(topic_name, mnemonic,
"is useless; does not occur in text");
419 requestPossibilities(topic_name);
426 fputs(
"Warning: mnemonic is missing", stderr);
427 print_at_location(stderr, topic_name);
428 requestPossibilities(topic_name);
433 static void open_test_duplicate_mnemonics(
const char *sub_menu_name,
const char *mnemonic) {
435 current_mscope->add(sub_menu_name, mnemonic);
437 MnemonicScope *prev = current_mscope;
438 current_mscope =
new MnemonicScope(sub_menu_name, prev);
441 static void close_test_duplicate_mnemonics() {
442 MnemonicScope *prev = current_mscope->get_parent();
443 delete current_mscope;
444 current_mscope = prev;
447 static void init_duplicate_mnemonic(
const char *window_name) {
448 if (!current_mscope) {
449 current_mscope =
new MnemonicScope(window_name,
NULp);
450 help_mscope =
new MnemonicScope(
"<HELP>", current_mscope);
453 while (current_mscope->get_parent()) {
454 close_test_duplicate_mnemonics();
459 static void test_duplicate_mnemonics(
const char *topic_name,
const char *mnemonic) {
461 current_mscope->add(topic_name, mnemonic);
464 static void exit_duplicate_mnemonic() {
465 delete help_mscope; help_mscope =
NULp;
466 while (current_mscope) close_test_duplicate_mnemonics();
476 #ifdef CHECK_DUPLICATED_MNEMONICS
477 init_duplicate_mnemonic(window_name);
480 #if defined(DUMP_MENU_LIST)
481 dumpCloseAllSubMenus();
482 #endif // DUMP_MENU_LIST
491 #ifdef CHECK_DUPLICATED_MNEMONICS
492 close_test_duplicate_mnemonics();
494 #if defined(DUMP_MENU_LIST)
496 #endif // DUMP_MENU_LIST
501 void AW_window::all_menus_created()
const {
505 #ifdef CHECK_DUPLICATED_MNEMONICS
506 exit_duplicate_mnemonic();
515 xfig_data->
add_line(x1, y1, x2, y2, width);
528 AW_device_click *click_device =
NULp;
554 if (!aram)
return NULp;
559 size_device->
reset();
570 const char *mnemonic,
const char *helpText,
575 #ifdef CHECK_DUPLICATED_MNEMONICS
576 if (!current_mscope) init_duplicate_mnemonic(window_name);
577 MnemonicScope *tmp = current_mscope;
578 current_mscope = help_mscope;
579 test_duplicate_mnemonics(labeli, mnemonic);
580 current_mscope = tmp;
584 button = XtVaCreateManagedWidget(
"", xmPushButtonWidgetClass,
588 XtAddCallback(button, XmNactivateCallback,
590 (XtPointer)
new AW_cb(
this, cb, helpText));
596 const char *mnemonic,
const char *helpText,
597 AW_active mask,
const WindowCallback& wcb) {
603 #if defined(DUMP_MENU_LIST)
605 #endif // DUMP_MENU_LIST
607 #ifdef CHECK_DUPLICATED_MNEMONICS
608 test_duplicate_mnemonics(labeltext, mnemonic);
611 Label topiclabel(labeltext,
this);
612 if (mnemonic && *mnemonic && strchr(labeltext, mnemonic[0])) {
614 button = XtVaCreateManagedWidget(
"", xmPushButtonWidgetClass,
621 button = XtVaCreateManagedWidget(
"",
622 xmPushButtonWidgetClass,
631 XtAddCallback(button, XmNactivateCallback,
635 #if defined(DEVEL_RALF) // wanted version
637 #else // !defined(DEVEL_RALF)
638 if (!topic_id) topic_id = labeltext;
640 cbs->id = strdup(topic_id);
653 #if defined(DUMP_MENU_LIST)
654 dumpOpenSubMenu(name);
655 #endif // DUMP_MENU_LIST
657 #ifdef CHECK_DUPLICATED_MNEMONICS
658 open_test_duplicate_mnemonics(labeli, mnemonic);
662 shell = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
666 XmNallowShellResize,
true,
667 XmNoverrideRedirect,
true,
673 xmRowColumnWidgetClass, shell,
674 XmNrowColumnType, XmMENU_PULLDOWN,
675 XmNtearOffModel, XmTEAR_OFF_ENABLED,
679 if (mnemonic && *mnemonic && strchr(labeli, mnemonic[0])) {
681 Label = XtVaCreateManagedWidget(
"menu1_top_b1",
689 Label = XtVaCreateManagedWidget(
"menu1_top_b1",
690 xmCascadeButtonWidgetClass,
715 void AW_window::get_font_size(
int& width,
int& height) {
722 get_font_size(width, height);
724 if (file) xfig_data =
new AW_xfig(file, width, height);
725 else xfig_data =
new AW_xfig(width, height);
730 int xsize = xfig_data->
maxx - xfig_data->
minx;
731 int ysize = xfig_data->
maxy - xfig_data->
miny;
748 static char *last_local_id =
NULp;
750 return last_local_id;
755 XtVaCreateManagedWidget(
"", xmSeparatorWidgetClass,
784 focus_cb =
new AW_cb(
this, wcb,
NULp, focus_cb);
854 top_indent_of_vertical_scrollbar = indent;
859 left_indent_of_horizontal_scrollbar = indent;
869 square->
r -= left_indent_of_horizontal_scrollbar;
870 square->
b -= top_indent_of_vertical_scrollbar;
885 bool use_horizontal_bar =
true;
886 int slider_size_horizontal = scrollArea.
r;
888 if (slider_size_horizontal < 1) slider_size_horizontal = 1;
889 if (slider_size_horizontal > slider_max) {
890 slider_size_horizontal = slider_max;
892 use_horizontal_bar =
false;
896 int position_of_slider;
898 if (position_of_slider > (slider_max-slider_size_horizontal)) {
899 position_of_slider = slider_max-slider_size_horizontal;
900 if (position_of_slider < 0) position_of_slider = 0;
924 bool use_vertical_bar =
true;
925 int slider_size_vertical = scrollArea.
b;
927 if (slider_size_vertical < 1) slider_size_vertical = 1;
928 if (slider_size_vertical > slider_max) {
929 slider_size_vertical = slider_max;
931 use_vertical_bar =
false;
935 int position_of_slider;
937 if (position_of_slider > (slider_max-slider_size_vertical)) {
938 position_of_slider = slider_max-slider_size_vertical;
939 if (position_of_slider < 0) position_of_slider = 0;
968 tmp ?
"tmp/window/%s/%s" :
"window/%s/%s",
990 #if defined(DEBUG) && 0
991 fprintf(stderr,
"set_vertical_scrollbar_position to %i\n", position);
999 #if defined(DEBUG) && 0
1000 fprintf(stderr,
"set_horizontal_scrollbar_position to %i\n", position);
1008 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1014 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1016 (cbs->
aw)->slider_pos_horizontal = sbcbs->value;
1021 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1027 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1029 (cbs->
aw)->slider_pos_horizontal = sbcbs->value;
1036 (XtPointer)
new AW_cb(
this, wcb,
""));
1039 (XtPointer)
new AW_cb(
this, wcb,
""));
1042 (XtCallbackProc) drag_scroll_bar_vertical,
1043 (XtPointer)
new AW_cb(
this, wcb,
""));
1045 (XtCallbackProc) drag_scroll_bar_vertical,
1046 (XtPointer)
new AW_cb(
this, wcb,
""));
1052 (XtPointer)
new AW_cb(
this, wcb,
""));
1055 (XtPointer)
new AW_cb(
this, wcb,
""));
1061 void AW_window::set_window_size(
int width,
int height) {
1062 XtVaSetValues(
p_w->
shell, XmNwidth, (
int)width, XmNheight, (
int)height,
NULp);
1071 freedup(window_name, title);
1089 set_window_size(width, height);
1096 expose_callback_added(
false),
1100 left_indent_of_horizontal_scrollbar(0),
1101 top_indent_of_vertical_scrollbar(0),
1102 layout_reset_wanted(
NULp),
1105 color_table_size(0),
1107 number_of_timed_title_changes(0),
1112 window_defaults_name(
NULp),
1113 slider_pos_vertical(0),
1114 slider_pos_horizontal(0),
1115 window_is_shown(
false),
1130 #if defined(DUMP_MENU_LIST)
1132 static char *window_name = 0;
1133 static char *sub_menu = 0;
1135 static void initMenuListing(
const char *win_name) {
1138 freedup(window_name, win_name);
1141 printf(
"---------------------------------------- list of menus for '%s'\n", window_name);
1144 static void dumpMenuEntry(
const char *entry) {
1147 printf(
"'%s/%s/%s'\n", window_name, sub_menu, entry);
1150 printf(
"'%s/%s'\n", window_name, entry);
1154 static void dumpOpenSubMenu(
const char *sub_name) {
1157 dumpMenuEntry(sub_name);
1160 else sub_menu = strdup(sub_name);
1163 static void dumpCloseSubMenu() {
1165 char *lslash = strrchr(sub_menu,
'/');
1169 else freenull(sub_menu);
1172 static void dumpCloseAllSubMenus() {
1176 #endif // DUMP_MENU_LIST
1184 AW_window_simple::AW_window_simple() {}
1185 AW_window_simple::~AW_window_simple() {}
1193 #define LAYOUT_AWAR_ROOT "window/windows"
1210 #define aw_awar_name_posx(aww) aw_size_awar_name((aww), "posx")
1211 #define aw_awar_name_posy(aww) aw_size_awar_name((aww), "posy")
1212 #define aw_awar_name_width(aww) aw_size_awar_name((aww), "width")
1213 #define aw_awar_name_height(aww) aw_size_awar_name((aww), "height")
1214 #define aw_awar_name_reset(aww) aw_size_awar_name((aww), "reset")
1222 if (layout_reset_wanted) {
1225 int cmp = strcmp(last_reset, layout_reset_wanted);
1228 reset_geometry_awars();
1234 void AW_window::store_size_in_awars(
int width,
int height) {
1239 void AW_window::get_size_from_awars(
int& width,
int& height) {
1244 void AW_window::store_pos_in_awars(
int posx,
int posy) {
1249 void AW_window::get_pos_from_awars(
int& posx,
int& posy) {
1254 void AW_window::reset_geometry_awars() {
1266 #undef aw_awar_name_posx
1267 #undef aw_awar_name_posy
1268 #undef aw_awar_name_width
1269 #undef aw_awar_name_height
1270 #undef aw_awar_name_reset
1278 int posx, posy; aww->get_window_content_pos(posx, posy);
1280 bool knows_window_position = posx != 0 || posy != 0;
1282 if (!knows_window_position) {
1286 int oposx, oposy; aww->get_pos_from_awars(oposx, oposy);
1287 aww->set_window_frame_pos(oposx, oposy);
1294 int oposx, oposy; aww->get_pos_from_awars(oposx, oposy);
1297 int left = posx-oposx;
1298 int top = posy-oposy;
1300 if (top == 0 || left == 0) {
1303 #if defined(TRACE_WM_OFFSETS)
1304 fprintf(stderr,
"aw_onExpose_calc_WM_offsets: failed to detect framesize (shift window 1 pixel and retry)\n");
1306 oposx = oposx>10 ? oposx-1 : oposx+1;
1307 oposy = oposy>10 ? oposy-1 : oposy+1;
1309 aww->set_window_frame_pos(oposx, oposy);
1310 aww->store_pos_in_awars(oposx, oposy);
1320 if (top == 0 || left == 0) {
1333 #if defined(TRACE_WM_OFFSETS)
1334 fprintf(stderr,
"WM_top_offset=%i WM_left_offset=%i (pos from awar: %i/%i, content-pos: %i/%i)\n",
1336 oposx, oposy, posx, posy);
1342 : last_widget(
NULp),
1345 toplevel_widget(
NULp),
1348 message_shell(
NULp),
1352 option_menu_list(
NULp),
1353 last_option_menu(
NULp),
1354 current_option_menu(
NULp),
1355 toggle_field_list(
NULp),
1356 last_toggle_field(
NULp),
1357 selection_list(
NULp),
1358 last_selection_list(
NULp),
1365 old_cursor_display(
NULp),
1366 old_cursor_window(0),
1378 XSetWindowAttributes attrs;
1385 attrs.cursor = None;
1388 XChangeWindowAttributes(d, w, CWCursor, &attrs);
1422 XtWindow(
p_aww(cbs->
aw)->shell),
1427 while (XCheckMaskEvent(XtDisplay(
p_global->toplevel_widget),
1428 ButtonPressMask|ButtonReleaseMask|ButtonMotionMask|
1429 KeyPressMask|KeyReleaseMask|PointerMotionMask, &event)) {
1434 XtWindow(
p_aww(cbs->
aw)->shell),
1439 XtWindow(
p_aww(cbs->
aw)->shell),
1445 recalc_pos_at_show = pr;
1449 return recalc_pos_at_show;
1456 recalc_size_at_show = sr;
1470 return focus_cb && focus_cb->
contains(f);
1490 XEvent *ev = call_data->event;
1492 if (ev->xexpose.count == 0) {
1500 XtAddCallback(area, XmNexposeCallback, (XtCallbackProc)
AW_exposeCB,
1503 expose_cb =
new AW_cb(aww, cb,
NULp, expose_cb);
1507 return expose_cb && expose_cb->
contains(f);
1516 XmDrawingAreaCallbackStruct da_struct;
1518 da_struct.reason = XmCR_EXPOSE;
1519 da_struct.event =
NULp;
1520 da_struct.window = XtWindow(
p_w->
shell);
1522 XtCallCallbacks(
p_w->
shell, XmNexposeCallback, (XtPointer) &da_struct);
1530 return resize_cb && resize_cb->
contains(f);
1538 void AW_window::set_window_frame_pos(
int x,
int y) {
1540 XtVaSetValues(
p_w->
shell, XmNx, (
int)x, XmNy, (
int)y,
NULp);
1542 void AW_window::get_window_content_pos(
int& xpos,
int& ypos) {
1544 unsigned short x,
y;
1550 void AW_window::get_screen_size(
int &width,
int &height) {
1551 Screen *screen = XtScreen(
p_w->
shell);
1553 width = WidthOfScreen(screen);
1554 height = HeightOfScreen(screen);
1557 bool AW_window::get_mouse_pos(
int& x,
int&
y) {
1558 Display *d = XtDisplay(
p_w->
shell);
1566 Bool ok = XQueryPointer(d, w1, &w2, &w3, &rx, &ry, &wx, &wy, &mask);
1569 #if defined(DEBUG) && 0
1570 printf(
"get_mouse_pos: rx/ry=%i/%i wx/wy=%i/%i\n", rx, ry, wx, wy);
1580 if (event && (event->type == ResizeRequest || event->type
1581 == ConfigureNotify) && event->xany.display == display) {
1590 XLockDisplay(display);
1597 XPutBackEvent(display, &event);
1599 XUnlockDisplay(display);
1604 aw_message(
"If YOU do not know what to answer, how should ARB know?\nPlease think again and answer the prompt!");
1614 if (!
aw_ask_sure(
"quit_by_X",
"Are you sure to quit?"))
return;
1622 Atom WM_DELETE_WINDOW = XmInternAtom(XtDisplay(shell), (
char*)
"WM_DELETE_WINDOW", False);
1627 XmRemoveWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)
aw_window_destroy_cb, (caddr_t)aww);
1630 XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)aw_window_avoid_destroy_cb, (caddr_t)aww);
1633 AW_root *root = aww->get_root();
1635 XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)aw_window_noexit_destroy_cb, (caddr_t)aww);
1638 XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)aw_window_destroy_cb, (caddr_t)aww);
1657 unsigned short width, height, borderwidth;
1658 XtVaGetValues(motif->
shell,
1659 XmNborderWidth, &borderwidth,
1670 if (posx<0) posx = 0;
1671 if (posy<0) posy = 0;
1673 aww->store_pos_in_awars(posx, posy);
1675 #if defined(TRACE_WM_OFFSETS)
1677 fprintf(stderr,
"Warning: WM_offsets unknown => did not update awars for window '%s'\n", aww->
get_window_title());
1680 aww->store_size_in_awars(width, height);
1684 bool was_shown =
true;
1686 all_menus_created();
1705 int user_width, user_height; get_size_from_awars(user_width, user_height);
1707 if (user_width <min_width) user_width = min_width;
1708 if (user_height<min_height) user_height = min_height;
1710 set_window_size(user_width, user_height);
1713 height = user_height;
1718 #define LOWEST_SUPPORTED_SCREEN_X 1280 // @@@ this size is wrong when 'window/font' has changed (e.g. to "9x15bold")
1719 #define LOWEST_SUPPORTED_SCREEN_Y 800
1721 if (min_width>LOWEST_SUPPORTED_SCREEN_X || min_height>LOWEST_SUPPORTED_SCREEN_Y) {
1723 "Warning: Window '%s' won't fit on %ix%i (win=%ix%i)\n",
1725 LOWEST_SUPPORTED_SCREEN_X, LOWEST_SUPPORTED_SCREEN_Y,
1726 min_width, min_height);
1727 #if defined(DEVEL_RALF)
1734 store_size_in_awars(width, height);
1743 int swidth, sheight; get_screen_size(swidth, sheight);
1744 bool posIsFrame =
false;
1746 switch (recalc_pos_at_show) {
1752 if (!get_mouse_pos(mx, my))
goto FALLBACK_CENTER;
1760 posx = (swidth-width)/2;
1761 posy = (sheight-height)/4;
1769 get_pos_from_awars(posx, posy);
1770 get_size_from_awars(width, height);
1775 int frameWidth, frameHeight;
1788 posy -= frameHeight;
1794 int maxx = swidth - 2*frameWidth - width;
1795 int maxy = sheight - frameWidth-frameHeight - height;
1797 if (posx>maxx) posx = maxx;
1798 if (posy>maxy) posy = maxy;
1801 if (posx<0) posx = 0;
1802 if (posy<0) posy = 0;
1807 if (posx<frameWidth) posx = frameWidth;
1808 if (posy<frameHeight) posy = frameHeight;
1815 store_pos_in_awars(posx, posy);
1816 set_window_frame_pos(posx, posy);
1823 if (!expose_callback_added) {
1825 expose_callback_added =
true;
1838 if (hide_cb) (*hide_cb)(
this);
1851 hide_cb =
new WindowCallback(call_on_hide);
1867 XtAddCallback(area, XmNresizeCallback,
1870 resize_cb =
new AW_cb(aww, cb,
NULp, resize_cb);
1878 XEvent *ev = call_data->event;
1882 bool run_callback =
false;
1883 bool run_double_click_callback =
false;
1889 if (
p_aww(aww)->areas[i]->get_area() == wgt) {
1890 area =
p_aww(aww)->areas[i];
1896 if (ev->xbutton.type == ButtonPress || ev->xbutton.type == ButtonRelease) {
1899 bool ignore_this_event =
false;
1906 if (!ignore_this_event) {
1908 aww->
event.
x = ev->xbutton.x;
1909 aww->
event.
y = ev->xbutton.y;
1914 if (ev->xbutton.type == ButtonPress) {
1918 run_double_click_callback =
true;
1921 run_callback =
true;
1926 run_callback =
true;
1930 else if (ev->xbutton.type == ButtonRelease) {
1932 run_callback =
true;
1937 else if (ev->xkey.type == KeyPress || ev->xkey.type == KeyRelease) {
1952 if (ev->xkey.type == KeyPress) {
1959 aww->
event.
x = ev->xbutton.x;
1960 aww->
event.
y = ev->xbutton.y;
1968 run_callback =
true;
1972 if (run_double_click_callback) {
1988 XtAddCallback(area, XmNinputCallback,
1990 (XtPointer)
new AW_cb(aww, wcb));
1994 double_click_cb =
new AW_cb(aww, wcb,
NULp, double_click_cb);
2018 XtAddEventHandler(area, ButtonMotionMask, False,
2027 void AW_root::exit_variables() {
2039 if (application_database) {
2040 GBDATA *prop_main = application_database;
2041 application_database =
NULp;
2046 void AW_root::exit_root() {
2079 long new_size = colnum+8;
2087 XColor xcolor_returned, xcolor_exakt;
2093 if (strcmp(colorname,
"white"))
2110 if (XAllocNamedColor(
p_global->display,
p_global->colormap, colorname, &xcolor_returned, &xcolor_exakt) == 0) {
2125 unsigned long background_color;
2159 len = aww->get_at().length_of_buttons - 2;
2160 if (len < 1) len = 1;
2163 memset(label,
'y', len);
2181 if (!display[0]) freeset(display, strdup(
" "));
2198 ((
AW_window*)val)->reset_geometry_awars();
2229 return icon_fullname;
2233 static Pixmap
getIcon(Screen *screen,
const char *iconName, Pixel foreground, Pixel background) {
2235 if (icon_hash.isNull()) {
2241 if (!pixmap && iconName) {
2245 char *ico = strdup(iconFile);
2246 pixmap = XmGetPixmap(screen, ico, foreground, background);
2256 #define CopyFromParent_AsPtr NULp
2263 if (width >aww->get_at().max_x_size) aww->get_at().max_x_size = width;
2264 if (height>aww->get_at().max_y_size) aww->get_at().max_y_size = height;
2266 bool has_user_geometry =
false;
2273 int user_width, user_height; aww->get_size_from_awars(user_width, user_height);
2274 int user_posx, user_posy; aww->get_pos_from_awars(user_posx, user_posy);
2277 if (width != user_width) { width = user_width; has_user_geometry =
true; }
2278 if (height != user_height) { height = user_height; has_user_geometry =
true; }
2283 if (posx != user_posx) { posx = user_posx; has_user_geometry =
true; }
2284 if (posy != user_posy) { posy = user_posy; has_user_geometry =
true; }
2286 if (has_user_geometry) {
2306 Screen *screen = XtScreen(father);
2316 else if (icon_pixmap == XmUNSPECIFIED_PIXMAP) {
2325 args.
add(XmNwidth, width);
2326 args.
add(XmNheight, height);
2327 args.
add(XmNx, posx);
2328 args.
add(XmNy, posy);
2331 args.
add(XmNkeyboardFocusPolicy, focusPolicy);
2332 args.
add(XmNdeleteResponse, XmDO_NOTHING);
2333 args.
add(XtNiconPixmap, icon_pixmap);
2336 shell = XtCreatePopupShell(
"editor", applicationShellWidgetClass, father, args.
list(), args.
size());
2339 shell = XtCreatePopupShell(
"transient", transientShellWidgetClass, father, args.
list(), args.
size());
2348 if (!
p_global->main_aww->is_shown()) {
2359 XtVaGetValues(shell, XmNiconWindow, &icon_window,
NULp);
2361 Display *
dpy = XtDisplay(shell);
2363 XSetWindowAttributes attr;
2364 attr.background_pixmap = icon_pixmap;
2367 unsigned int xsize, ysize, borderwidth, depth;
2370 if (XGetGeometry(dpy, icon_pixmap, &wroot, &xpos, &ypos, &xsize, &ysize, &borderwidth, &depth)) {
2371 icon_window = XCreateWindow(dpy, wroot, 0, 0, xsize, ysize, 0, depth, CopyFromParent,
CopyFromParent_AsPtr, CWBackPixmap, &attr);
2375 XtVaSetValues(shell, XmNiconPixmap, icon_pixmap,
NULp);
2378 XtVaSetValues(shell, XmNiconWindow, icon_window,
NULp);
2379 XSetWindowBackgroundPixmap(dpy, icon_window, icon_pixmap);
2380 XClearWindow(dpy, icon_window);
2398 XtRealizeWidget(
p_aww(aww)->shell);
2409 const char *help_button =
"HELP";
2410 const char *help_mnemonic =
"H";
2412 #if defined(DUMP_MENU_LIST)
2413 initMenuListing(windowname);
2414 #endif // DUMP_MENU_LIST
2416 window_name = strdup(windowname);
2424 main_window = XtVaCreateManagedWidget(
"mainWindow1",
2425 xmMainWindowWidgetClass,
p_w->
shell,
2428 p_w->
menu_bar[0] = XtVaCreateManagedWidget(
"menu1", xmRowColumnWidgetClass,
2430 XmNrowColumnType, XmMENU_BAR,
2434 help_popup = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
2438 XmNallowShellResize,
true,
2439 XmNoverrideRedirect,
true,
2444 xmRowColumnWidgetClass, help_popup,
2445 XmNrowColumnType, XmMENU_PULLDOWN,
2449 help_label = XtVaCreateManagedWidget(
"menu1_top_b1",
2457 form1 = XtVaCreateManagedWidget(
"form1",
2462 XmNresizePolicy, XmRESIZE_NONE,
2468 xmDrawingAreaWidgetClass,
2470 XmNresizePolicy, XmRESIZE_NONE,
2477 XmNbottomAttachment, XmATTACH_FORM,
2478 XmNleftAttachment, XmATTACH_POSITION,
2479 XmNtopAttachment, XmATTACH_POSITION,
2484 separator = XtVaCreateManagedWidget(
"separator",
2485 xmSeparatorWidgetClass,
2488 XmNshadowThickness, 4,
2489 XmNorientation, XmVERTICAL,
2490 XmNbottomAttachment, XmATTACH_FORM,
2491 XmNtopAttachment, XmATTACH_FORM,
2492 XmNleftAttachment, XmATTACH_NONE,
2493 XmNleftWidget,
NULp,
2494 XmNrightAttachment, XmATTACH_NONE,
2499 form2 = XtVaCreateManagedWidget(
"form2",
2508 XmNrightAttachment, XmATTACH_FORM,
2509 XmNbottomAttachment, XmATTACH_FORM,
2510 XmNleftAttachment, XmATTACH_WIDGET,
2511 XmNleftWidget, separator,
2512 XmNtopAttachment, XmATTACH_POSITION,
2513 XmNresizePolicy, XmRESIZE_NONE,
2519 xmDrawingAreaWidgetClass,
2522 XmNbottomAttachment, XmATTACH_NONE,
2523 XmNtopAttachment, XmATTACH_FORM,
2524 XmNleftAttachment, XmATTACH_FORM,
2525 XmNrightAttachment, XmATTACH_FORM,
2532 xmDrawingAreaWidgetClass,
2535 XmNbottomAttachment, XmATTACH_FORM,
2536 XmNtopAttachment, XmATTACH_NONE,
2537 XmNleftAttachment, XmATTACH_FORM,
2538 XmNrightAttachment, XmATTACH_FORM,
2542 xmScrollBarWidgetClass,
2549 XmNrightAttachment, XmATTACH_FORM,
2550 XmNbottomAttachment, XmATTACH_FORM,
2552 XmNleftAttachment, XmATTACH_FORM,
2553 XmNtopAttachment, XmATTACH_NONE,
2554 XmNorientation, XmHORIZONTAL,
2559 xmScrollBarWidgetClass,
2566 XmNrightAttachment, XmATTACH_FORM,
2567 XmNbottomAttachment, XmATTACH_WIDGET,
2572 XmNleftAttachment, XmATTACH_NONE,
2573 XmNtopAttachment, XmATTACH_WIDGET,
2577 p_w->
frame = XtVaCreateManagedWidget(
"draw_area",
2580 XmNshadowType, XmSHADOW_IN,
2581 XmNshadowThickness, 2,
2586 XmNbottomAttachment, XmATTACH_WIDGET,
2588 XmNtopAttachment, XmATTACH_FORM,
2590 XmNleftAttachment, XmATTACH_FORM,
2591 XmNrightAttachment, XmATTACH_WIDGET,
2597 xmDrawingAreaWidgetClass,
2619 const char *help_button =
"HELP";
2620 const char *help_mnemonic =
"H";
2622 #if defined(DUMP_MENU_LIST)
2623 initMenuListing(windowname);
2624 #endif // DUMP_MENU_LIST
2626 window_name = strdup(windowname);
2634 main_window = XtVaCreateManagedWidget(
"mainWindow1",
2635 xmMainWindowWidgetClass,
p_w->
shell,
2638 p_w->
menu_bar[0] = XtVaCreateManagedWidget(
"menu1", xmRowColumnWidgetClass,
2640 XmNrowColumnType, XmMENU_BAR,
2644 help_popup = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
2648 XmNallowShellResize,
true,
2649 XmNoverrideRedirect,
true,
2654 xmRowColumnWidgetClass, help_popup,
2655 XmNrowColumnType, XmMENU_PULLDOWN,
2659 help_label = XtVaCreateManagedWidget(
"menu1_top_b1",
2667 form1 = XtVaCreateManagedWidget(
"form1",
2672 XmNresizePolicy, XmRESIZE_NONE,
2678 xmDrawingAreaWidgetClass,
2680 XmNresizePolicy, XmRESIZE_NONE,
2687 XmNbottomAttachment, XmATTACH_FORM,
2688 XmNleftAttachment, XmATTACH_POSITION,
2689 XmNtopAttachment, XmATTACH_POSITION,
2696 form2 = XtVaCreateManagedWidget(
"form2",
2705 XmNrightAttachment, XmATTACH_FORM,
2706 XmNbottomAttachment, XmATTACH_FORM,
2707 XmNleftAttachment, XmATTACH_WIDGET,
2708 XmNleftWidget, separator,
2709 XmNtopAttachment, XmATTACH_POSITION,
2710 XmNresizePolicy, XmRESIZE_NONE,
2716 xmDrawingAreaWidgetClass,
2719 XmNbottomAttachment, XmATTACH_NONE,
2720 XmNtopAttachment, XmATTACH_FORM,
2721 XmNleftAttachment, XmATTACH_FORM,
2722 XmNrightAttachment, XmATTACH_FORM,
2729 xmDrawingAreaWidgetClass,
2732 XmNbottomAttachment, XmATTACH_FORM,
2733 XmNtopAttachment, XmATTACH_NONE,
2734 XmNleftAttachment, XmATTACH_FORM,
2735 XmNrightAttachment, XmATTACH_FORM,
2739 xmScrollBarWidgetClass,
2746 XmNrightAttachment, XmATTACH_FORM,
2747 XmNbottomAttachment, XmATTACH_FORM,
2749 XmNleftAttachment, XmATTACH_FORM,
2750 XmNtopAttachment, XmATTACH_NONE,
2751 XmNorientation, XmHORIZONTAL,
2756 xmScrollBarWidgetClass,
2763 XmNrightAttachment, XmATTACH_FORM,
2764 XmNbottomAttachment, XmATTACH_WIDGET,
2769 XmNleftAttachment, XmATTACH_NONE,
2770 XmNtopAttachment, XmATTACH_WIDGET,
2774 p_w->
frame = XtVaCreateManagedWidget(
"draw_area",
2777 XmNshadowType, XmSHADOW_IN,
2778 XmNshadowThickness, 2,
2783 XmNbottomAttachment, XmATTACH_WIDGET,
2785 XmNtopAttachment, XmATTACH_FORM,
2787 XmNleftAttachment, XmATTACH_FORM,
2788 XmNrightAttachment, XmATTACH_WIDGET,
2794 xmDrawingAreaWidgetClass,
2817 window_name = strdup(windowname);
2820 p_w->shell =
aw_create_shell(
this,
true,
true, width, height, posx, posy);
2825 Widget form1 = XtVaCreateManagedWidget(
"forms", xmFormWidgetClass,
2831 xmDrawingAreaWidgetClass,
2833 XmNbottomAttachment, XmATTACH_FORM,
2834 XmNtopAttachment, XmATTACH_FORM,
2835 XmNleftAttachment, XmATTACH_FORM,
2836 XmNrightAttachment, XmATTACH_FORM,
2848 const char *help_button =
"HELP";
2849 const char *help_mnemonic =
"H";
2850 window_name = strdup(windowname);
2865 main_window = XtVaCreateManagedWidget(
"mainWindow1",
2866 xmMainWindowWidgetClass,
p_w->
shell,
2869 p_w->
menu_bar[0] = XtVaCreateManagedWidget(
"menu1", xmRowColumnWidgetClass,
2871 XmNrowColumnType, XmMENU_BAR,
2875 help_popup = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
2879 XmNallowShellResize,
true,
2880 XmNoverrideRedirect,
true,
2885 xmRowColumnWidgetClass, help_popup,
2886 XmNrowColumnType, XmMENU_PULLDOWN,
2890 help_label = XtVaCreateManagedWidget(
"menu1_top_b1",
2898 form1 = XtVaCreateManagedWidget(
"form1",
2902 XmNresizePolicy, XmRESIZE_NONE,
2907 xmDrawingAreaWidgetClass,
2909 XmNbottomAttachment, XmATTACH_FORM,
2910 XmNtopAttachment, XmATTACH_FORM,
2911 XmNleftAttachment, XmATTACH_FORM,
2912 XmNrightAttachment, XmATTACH_FORM,
2931 window_name = strdup(windowname);
2938 XtVaSetValues(
p_w->
shell, XmNmwmFunctions, MWM_FUNC_MOVE | MWM_FUNC_CLOSE,
2943 xmDrawingAreaWidgetClass,
2946 XmNbottomAttachment, XmATTACH_NONE,
2947 XmNtopAttachment, XmATTACH_FORM,
2948 XmNleftAttachment, XmATTACH_FORM,
2949 XmNrightAttachment, XmATTACH_FORM,
2956 init(root_in, wid, windowname, allow_close);
2961 int focusPolicy = follow_mouse ? XmPOINTER : XmEXPLICIT;
2962 XtVaSetValues(
p_w->
shell, XmNkeyboardFocusPolicy, focusPolicy,
NULp);
2972 XtVaSetValues(oldwidget, XmNbackground,
p_global->background,
NULp);
2973 XtVaSetValues(widget, XmNbackground,
p_global->foreground,
NULp);
2981 #define MODE_BUTTON_OFFSET 34
2995 button = XtVaCreateManagedWidget(
"", xmPushButtonWidgetClass,
p_w->
mode_area,
2998 XmNlabelType, XmPIXMAP,
2999 XmNshadowThickness, 1,
3003 XtVaGetValues(button, XmNforeground, &
p_global->foreground,
NULp);
3007 XtAddCallback(button, XmNactivateCallback, (XtCallbackProc)
AW_server_callback, (XtPointer)cb2);
3033 if (!device) device =
new AW_device_Xm(common);
3043 if (!print_device) print_device =
new AW_device_print(common);
3044 return print_device;
3048 if (!click_device) click_device =
new AW_device_click(common);
3049 return click_device;
3057 if (iconic == True) {
3066 Display *xdpy = XtDisplay(
p_w->
shell);
3067 Window window = XtWindow(
p_w->
shell);
3068 Atom netactivewindow = XInternAtom(xdpy,
"_NET_ACTIVE_WINDOW", False);
3070 if (netactivewindow) {
3072 XClientMessageEvent ce;
3073 ce.type = ClientMessage;
3076 ce.message_type = netactivewindow;
3079 ce.data.l[1] = None;
3080 ce.data.l[2] = Above;
3087 XSendEvent(xdpy, XDefaultRootWindow(xdpy),
3089 SubstructureRedirectMask | SubstructureNotifyMask,
3093 if (!ret) { fprintf(stderr,
"Failed to send _NET_ACTIVE_WINDOW to WM (XSendEvent returns %i)\n", ret); }
3099 fputs(
"No such atom '_NET_ACTIVE_WINDOW'\n", stderr);
3112 XtAddCallback((
Widget) widget, XmNactivateCallback,
3120 bool colorSet =
false;
3123 XColor unused, color;
3125 if (XAllocNamedColor(
p_global->display,
p_global->colormap, colorname, &color, &unused)
3127 fprintf(stderr,
"XAllocColor failed: %s\n", colorname);
3189 XtVaGetValues(w, XmNbackground, &bg,
NULp);
3193 XQueryColor(XtDisplay(w),
p_global->colormap, &xc);
3195 col[0] = xc.red >> 8;
3196 col[1] = xc.green >> 8;
3197 col[2] = xc.blue >> 8;
3200 int mod = modStrength;
3201 int preferredDir = 0;
3202 bool invertedMod =
false;
3204 if (modStrength>0) {
3205 if (modStrength>255) {
3211 if (modStrength<-255) {
3212 mod = -modStrength-256;
3224 bool incPossible[3];
3225 bool decPossible[3];
3229 for (
int i = 0; i<3; ++i) {
3230 if ((incPossible[i] = ((col[i]+mod) <= 255)))
3232 if ((decPossible[i] = ((col[i]-mod) >= 0)))
3238 switch (preferredDir) {
3241 preferredDir = decs ? -1 : 1;
3243 preferredDir = incs ? 1 : -1;
3255 aw_assert(preferredDir == 1 || preferredDir == -1);
3257 if (preferredDir == 1) {
3258 for (
int i=0; i<3; ++i) col[i] += (incPossible[i] ? mod : 0);
3260 else if (preferredDir == -1) {
3261 for (
int i=0; i<3; ++i) col[i] -= (decPossible[i] ? mod : 0);
3266 sprintf(hex_color,
"#%2.2X%2.2X%2.2X", col[0], col[1], col[2]);
3276 layout_reset_wanted = YYYYMMDD;
3292 if (!(mask &
global_mask)) XtSetSensitive(w, False);
3300 XtSetSensitive(w, active);
3317 bool removed =
false;
3318 if (button_sens_list) {
3323 if (bl->
button == button)
break;
3331 else button_sens_list = bl->
next;
3362 Widget label_widgeti,
int correct) {
3377 scroll_bar_vertical(
NULp),
3378 scroll_bar_horizontal(
NULp),
3380 help_pull_down(
NULp),
3383 modes_f_callbacks(
NULp),
3384 modes_widgets(
NULp),
3390 toggle_field_var_name(
NULp),
3391 toggle_field_var_type(
AW_NONE),
void TuneBackground(Widget w, int modStrength)
void aw_realize_widget(AW_window *aww)
AW_widget_value_pair * first_toggle
static void aw_window_destroy_cb(Widget, AW_window *aww, XmAnyCallbackStruct *)
static void horizontal_scrollbar_redefinition_cb(AW_root *, AW_window *aw)
bool is_resize_callback(AW_area area, AnyWinCB f)
enum AW_root::@65 color_mode
void set_input_callback(AW_window *aww, const WindowCallback &wcb)
virtual void clear(AW_bitset filteri)
void update_scrollbar_settings_from_awars(AW_orientation orientation)
AW_device_print * get_print_device(AW_area area)
void set_resize_callback(AW_area area, const WindowCallback &wcb)
#define AW_CALC_OFFSET_ON_EXPOSE
AW_cb * get_double_click_cb()
void set_last_widget(Widget w)
void define_remote_command(class AW_cb *cbs)
static void aw_loop_forget_window_geometry(const char *, long val, void *)
AW_pos get_scrolled_picture_height() const
void d_callback(const WindowCallback &cb)
void sens_mask(AW_active mask)
#define aw_awar_name_reset(aww)
AW_device * get_device(AW_area area)
static AW_window * find_or_createAndRegisterWindow(CreateWindowCallback *windowMaker)
GBDATA * GB_child(GBDATA *father)
#define implicated(hypothesis, conclusion)
const AW_screen_area & get_screen() const
static void AW_exposeCB(Widget, XtPointer aw_cb_struct, XmDrawingAreaCallbackStruct *call_data)
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
STATIC_ASSERT_ANNOTATED(CopyFromParent==0,"value of CopyFromParent changed. Check use below")
return string(buffer, length)
bool is_resize_callback(AnyWinCB f)
Widget menu_bar[AW_MAX_MENU_DEEP]
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
GB_HASH * hash_for_windows
bool remove_button_from_sens_list(Widget button)
void load_xfig(const char *file, bool resize=true)
AW_awar * label_is_awar(const char *label)
const char * get_window_id() const
void set_popup_callback(const WindowCallback &wcb)
void update_label(Widget widget, const char *var_value)
#define ASSERT_NO_ERROR(errorExpr)
static void drag_scroll_bar_horizontal(Widget, XtPointer aw_cb_struct, XtPointer call_data)
const char * GBS_global_string_to_buffer(char *buffer, size_t bufsize, const char *templat,...)
void reset_scrolled_picture_size()
void run_expose_callback()
void on_hide(const WindowCallback &call_on_hide)
void set_vertical_scrollbar_top_indent(int indent)
void _set_activate_callback(void *widget)
#define WIDER_THAN_SCREEN
static void aw_loop_get_window_geometry(const char *, long val, void *)
static long destroy_awar(const char *, long val, void *)
static int WM_max_left_offset
void set_window_title_intern(char *title)
#define aw_awar_name_posx(aww)
AW_window * current_modal_window
AW_VARIABLE_TYPE variable_type
const char * GBS_global_string(const char *templat,...)
void warning(int warning_num, const char *warning_message)
void get_scrollarea_size(AW_screen_area *square)
void GBK_terminatef(const char *templat,...)
void set_background(const char *colorname, Widget w)
void init(AW_root *root_in, const char *wid, const char *windowname, bool allow_close)
void AW_POPDOWN(AW_window *window)
void allow_delete_window(bool allow_close)
AW_area_management(Widget form, Widget widget)
void GBS_free_hash(GB_HASH *hs)
char * GBS_string_2_key(const char *str)
void reset_layout(const char *YYYYMMDD)
#define aw_awar_name_width(aww)
void add_timed_callback(int ms, const TimedCallback &tcb)
int correct_for_at_center_intern
void _get_area_size(AW_area area, AW_screen_area *square)
AW_pos get_scrolled_picture_width() const
void set_offset(const AW::Vector &off)
const AW_bitset AW_ALL_DEVICES
char * window_defaults_name
window title
int slider_pos_horizontal
current position of the vertical slider
static void aw_window_avoid_destroy_cb(Widget, AW_window *, XmAnyCallbackStruct *)
void set_window_title(const char *title)
static Pixmap getIcon(Screen *screen, const char *iconName, Pixel foreground, Pixel background)
bool is_focus_callback(AnyWinCB f)
char buffer[MESSAGE_BUFFERSIZE]
static void AW_xfigCB_info_area(AW_window *aww, AW_xfig *xfig)
void set_motion_callback(AW_area area, const WindowCallback &wcb)
AW_device_size * get_size_device(AW_area area)
AW_common * get_common(AW_area area)
AW_awar * add_callback(const RootCallback &cb)
GB_ERROR GB_delete(GBDATA *&source)
static void AW_inputCB_draw_area(Widget wgt, XtPointer aw_cb_struct, XmDrawingAreaCallbackStruct *call_data)
void create_window_variables()
bool AW_IS_IMAGEREF(const char *label)
const char * window_local_awarname(const char *localname, bool tmp=true)
static void value_changed_scroll_bar_vertical(Widget, XtPointer aw_cb_struct, XtPointer call_data)
const char * read_char_pntr() const
#define SmartCustomPtr(type, deallocator)
GB_HASH * hash_table_for_variables
int create_mode(const char *pixmap, const char *help_text_, AW_active mask, const WindowCallback &cb)
static AW_root * SINGLETON
static unsigned timed_window_title_cb(AW_root *, char *title, AW_window *aw)
WindowCallback makeHelpCallback(const char *helpfile)
char * ARB_strduplen(const char *p, unsigned len)
static int WM_max_top_offset
bool contains(AnyWinCB g)
TYPE * ARB_alloc(size_t nelem)
GB_CSTR GB_read_key_pntr(GBDATA *gbd)
bool is_expose_callback(AW_area area, AnyWinCB f)
Widget scroll_bar_horizontal
static const char * aw_size_awar_name(AW_window *aww, const char *sub_entry)
#define RES_LABEL_CONVERT(label)
void get_event(AW_event *eventi) const
void set_double_click_callback(AW_area area, const WindowCallback &wcb)
void recalc_size_atShow(enum AW_SizeRecalc sr)
AW_default check_properties(AW_default aw_props)
void GBS_hash_do_const_loop(const GB_HASH *hs, gb_hash_const_loop_type func, void *client_data)
void create_devices(AW_window *aww, AW_area ar)
void set_double_click_callback(AW_window *aww, const WindowCallback &wcb)
AW_cb ** modes_f_callbacks
Display * get_display() const
static unsigned aw_calc_WM_offsets_delayed(AW_root *, AW_window *aww)
void calculate_scrollbars()
AW_device_click * get_click_device(AW_area area, int mousex, int mousey, int max_distance)
char * helptext_for_next_button
const char * get_window_title() const
void set_expose_callback(AW_area area, const WindowCallback &wcb)
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
int number_of_timed_title_changes
int yoffset_for_mode_button(int button_number)
void help_text(const char *id)
static void error(const char *msg)
void set_active(Widget w, bool active)
AW_device_click * get_click_device()
void message(char *title, int ms)
AW_toggle_field_struct * next
bool knows_WM_offset() const
AW_area_management * areas[AW_MAX_AREA]
static void vertical_scrollbar_redefinition_cb(AW_root *, AW_window *aw)
void label(const char *label)
void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, const WindowCallback &cb)
static void value_changed_scroll_bar_horizontal(Widget, XtPointer aw_cb_struct, XtPointer call_data)
char * read_as_string() const
bool window_is_shown
current position of the horizontal slider
void TuneOrSetBackground(Widget w, const char *color, int modStrength)
GB_ERROR reset_to_default()
#define HIGHER_THAN_SCREEN
Widget scroll_bar_vertical
AW_device_Xm * get_screen_device()
Label(const char *labeltext, AW_window *aww)
const awXKeymap * aw_xkey_2_awkey(XKeyEvent *xkeyevent)
static void aw_onExpose_calc_WM_offsets(AW_window *aww)
AW_awar * awar(const char *awar)
const int AW_NUMBER_OF_F_KEYS
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
void button_height(int height)
char * ARB_strupper(char *s)
static void AW_motionCB(Widget, XtPointer aw_cb_struct, XEvent *ev, Boolean *)
static void aw_window_noexit_destroy_cb(Widget, AW_window *aww, XmAnyCallbackStruct *)
void create_user_geometry_awars(int posx, int posy, int width, int height)
void GBS_hash_do_loop(GB_HASH *hs, gb_hash_loop_type func, void *client_data)
void set_horizontal_scrollbar_left_indent(int indent)
static const char * existingPixmap(const char *icon_relpath, const char *name)
Widget aw_create_shell(AW_window *aww, bool allow_resize, bool allow_close, int width, int height, int posx, int posy)
WindowCallbackSimple AnyWinCB
#define RES_CONVERT(res_name, res_value)
bool is_expose_callback(AnyWinCB f)
class AW_awar * window_local_awar(const char *localname, bool tmp=true)
void set_click_time(long click_time_)
void tell_scrolled_picture_size(AW_screen_area rectangle)
bool aw_ask_sure(const char *unique_id, const char *msg)
static void set_focus_policy(const char *, long cl_aww, void *)
void set_info_area_height(int height)
AW_widget_value_pair * last_toggle
fputs(TRACE_PREFIX, stderr)
void create_gcs(AW_device *device, int screen_depth)
unsigned long int background_color
void set_bottom_area_height(int height)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
TYPE * ARB_calloc(size_t nelem)
void draw_line(int x1, int y1, int x2, int y2, int width, bool resize)
static void drag_scroll_bar_vertical(Widget, XtPointer aw_cb_struct, XtPointer call_data)
void AW_help_entry_pressed(AW_window *aww)
void set_focus_callback(const WindowCallback &wcb)
void AW_forget_all_window_geometry(AW_window *aww)
AW_device_size * get_size_device()
static float apply_ScalerType(float val, AW_ScalerType scalerType, bool inverse)
void set_resize_callback(AW_window *aww, const WindowCallback &cb)
void run_resize_callback()
void ARB_realloc(TYPE *&tgt, size_t nelem)
void make_sensitive(Widget w, AW_active mask)
void recalc_pos_atShow(AW_PosRecalc pr)
void set_horizontal_scrollbar_position(int position)
char * strdup_getlen(const char *str, int &len)
static ARB_init_perl_interface init
static void AW_resizeCB_draw_area(Widget, XtPointer aw_cb_struct, XtPointer)
AW_device_print * get_print_device()
void aw_message(const char *msg)
void select_mode(int mode)
AW_common_Xm * get_common() const
Display * old_cursor_display
long get_click_time() const
void add_line(int x1, int y1, int x2, int y2, int width)
static int is_resize_event(Display *display, XEvent *event, XPointer)
bool GB_is_regularfile(const char *path)
char * label_for_inputfield
static void aw_mode_callback(AW_window *aww, short mode, AW_cb *cbs)
void AW_help_popup(UNFIXED, const char *help_file)
GB_ERROR write_string(const char *aw_string)
AW_VARIABLE_TYPE variable_type
void run_focus_callback()
void aw_uninstall_xkeys()
void set_vertical_scrollbar_position(int position)
AW_toggle_field_struct(int toggle_field_numberi, const char *variable_namei, AW_VARIABLE_TYPE variable_typei, Widget label_widgeti, int correct)
void AW_label_in_awar_list(AW_window *aww, Widget widget, const char *str)
const char * local_id(const char *id) const
void set_cursor(Display *d, Window w, Cursor c)
#define aw_awar_name_posy(aww)
void AW_server_callback(Widget, XtPointer aw_cb_struct, XtPointer)
GBDATA * GB_nextChild(GBDATA *child)
AW_PosRecalc get_recalc_pos_atShow() const
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
void set_horizontal_change_callback(const WindowCallback &wcb)
void set_vertical_change_callback(const WindowCallback &wcb)
static void aw_update_window_geometry_awars(AW_window *aww)
void run_popup_callbacks()
void aw_insert_default_help_entries(AW_window *aww)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
void print(AW_device *device)
bool GBS_string_matches(const char *str, const char *expr, GB_CASE case_sens)
#define MODE_BUTTON_OFFSET
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
void hide_or_notify(const char *error)
void shadow_width(int shadow_thickness)
void set_expose_callback(AW_window *aww, const WindowCallback &cb)
static void aw_set_delete_window_cb(AW_window *aww, Widget shell, bool allow_close)
#define aw_awar_name_height(aww)
int slider_pos_vertical
window id
void add(String name, XtArgVal value)
static void cleanupResizeEvents(Display *display)
void set_motion_callback(AW_window *aww, const WindowCallback &wcb)
#define CopyFromParent_AsPtr
void aw_update_all_window_geometry_awars(AW_root *awr)
static void AW_focusCB(Widget, XtPointer cl_aww, XEvent *, Boolean *)
void set_input_callback(AW_area area, const WindowCallback &wcb)
GB_ERROR write_int(long aw_int)
struct _WidgetRec * Widget
long GBS_read_hash(const GB_HASH *hs, const char *key)
AW_color_idx alloc_named_data_color(int colnum, const char *colorname)
void window_hide(AW_window *aww)
void get_window_size(int &width, int &height)
void aw_message_if(GB_ERROR error)
char * GBS_global_string_copy(const char *templat,...)
void GB_close(GBDATA *gbd)
static char aw_size_awar_name_buffer[BUFSIZE]
void tie_widget(AW_CL cd1, Widget widget, AW_widget_type type, AW_window *aww)
AW_widget_value_pair * default_toggle
void track_action(const char *action_id)
GB_HASH * GBS_create_hash(long estimated_elements, GB_CASE case_sens)