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>
66 typedef std::map<CreateWindowCallback, AW_window*> window_map;
68 static window_map window;
69 CreateWindowCallback& maker = *windowMaker;
71 if (window.find(maker) == window.end()) {
83 fputs(
"Bug(?): window factory did not create a window\n", stderr);
95 void AW_window::popper(
AW_window *, CreateWindowCallback *windowMaker) {
99 void AW_window::replacer(
AW_window *caller, CreateWindowCallback *windowMaker) {
106 void AW_window::destroyCreateWindowCallback(CreateWindowCallback *windowMaker) {
119 unsigned short hoffset = 0;
166 switch (scalerType) {
172 if (inverse) res = pow(val, 1/3.0);
173 else res = pow(val, 3.0);
201 float aval = amin + modScaleRel*(amax-amin);
213 awarRel = (awar->
read_float()-amin) / (amax-amin);
217 awarRel = (awar->
read_int()-amin) / (amax-amin);
234 #define CHECK_DUPLICATED_MNEMONICS
237 #ifdef CHECK_DUPLICATED_MNEMONICS
239 inline char oppositeCase(
char c) {
240 return isupper(c) ? tolower(c) : toupper(c);
242 static void strcpy_overlapping(
char *dest,
char *src) {
243 int src_len = strlen(src);
244 memmove(dest, src, src_len+1);
246 static const char *possible_mnemonics(
const char *used_mnemonics,
bool top_level,
const char *topic_name) {
248 for (
int fromTopic = 1; fromTopic>=0; --fromTopic) {
249 freedup(unused, fromTopic ? topic_name :
"abcdefghijklmnopqrstuvwxyz");
251 for (
int t = 0; unused[t]; ++t) {
253 if ((top_level && !isalpha(unused[t])) || !isalnum(unused[t])) {
257 char *dup = strchr(unused, unused[t]);
258 if (dup && (dup-unused)<t) {
262 dup = strchr(unused, oppositeCase(unused[t]));
263 if (dup && (dup-unused)<t) {
264 dup[0] = toupper(dup[0]);
270 strcpy_overlapping(unused+t, unused+t+1);
275 for (
int t = 0; used_mnemonics[t]; ++t) {
276 char c = used_mnemonics[t];
277 char *u = strchr(unused, c);
278 if (u) strcpy_overlapping(u, u+1);
279 u = strchr(unused, tolower(c));
280 if (u) strcpy_overlapping(u, u+1);
294 typedef std::map<char,std::string> Char2Topic;
297 MnemonicScope *parent;
301 void print_at_menu(FILE *out) {
303 parent->print_at_menu(out);
306 fputs(name.c_str(), out);
308 void print_at_location(FILE *out,
const char *topic) {
311 fprintf(out,
"|%s)\n", topic);
314 void requestPossibilities(
const char *topic_name) {
316 if (requested.index_of(topic_name) == -1) {
317 requested.put(strdup(topic_name));
321 void showRequestedPossibilities() {
322 unsigned size = accepted.size();
323 char *used =
new char[size+1];
326 for (Char2Topic::iterator a = accepted.begin(); a != accepted.end(); ++a) {
327 used[i++] = a->first;
331 for (i = 0; requested[i]; ++i) {
332 const char *possible = possible_mnemonics(used, !parent, requested[i]);
333 fprintf(stderr,
"Warning: Possible mnemonics for '%s': '%s'\n", requested[i], possible);
339 void warn_mnemonic(
const char *topic_name,
const char *
mnemonic,
const char *
warning) {
340 fprintf(stderr,
"Warning: mnemonic '%s' %s", mnemonic, warning);
341 print_at_location(stderr, topic_name);
346 MnemonicScope(
const char *name_, MnemonicScope *parent_)
352 showRequestedPossibilities();
355 void add(
const char *topic_name,
const char *
mnemonic);
357 MnemonicScope *get_parent() {
return parent; }
360 static MnemonicScope *current_mscope =
NULp;
361 static MnemonicScope *help_mscope =
NULp;
364 if (mnemonic && mnemonic[0] != 0) {
366 warn_mnemonic(topic_name, mnemonic,
"is too long; only 1 character allowed");
371 warn_mnemonic(topic_name, mnemonic,
"is useless for graphical menu entry");
374 else if (!isalpha(mnemonic[0]) && !get_parent()) {
375 warn_mnemonic(topic_name, mnemonic,
"is invalid (allowed: a-z)");
376 requestPossibilities(topic_name);
378 else if (!isalnum(mnemonic[0])) {
379 warn_mnemonic(topic_name, mnemonic,
"is invalid (allowed: a-z and 0-9)");
380 requestPossibilities(topic_name);
384 char HOTKEY = toupper(mnemonic[0]);
386 if (strchr(TOPIC_NAME, HOTKEY)) {
387 Char2Topic::iterator found = accepted.find(HOTKEY);
389 if (found != accepted.end()) {
390 warn_mnemonic(topic_name, mnemonic,
"is used multiple times");
391 requestPossibilities(topic_name);
392 requestPossibilities(found->second.c_str());
395 accepted[HOTKEY] = topic_name;
397 if (!strchr(topic_name, mnemonic[0])) {
399 warn_mnemonic(topic_name, mnemonic, warning);
405 warn_mnemonic(topic_name, mnemonic,
"is useless; does not occur in text");
406 requestPossibilities(topic_name);
413 fputs(
"Warning: mnemonic is missing", stderr);
414 print_at_location(stderr, topic_name);
415 requestPossibilities(topic_name);
420 static void open_test_duplicate_mnemonics(
const char *sub_menu_name,
const char *mnemonic) {
422 current_mscope->add(sub_menu_name, mnemonic);
424 MnemonicScope *prev = current_mscope;
425 current_mscope =
new MnemonicScope(sub_menu_name, prev);
428 static void close_test_duplicate_mnemonics() {
429 MnemonicScope *prev = current_mscope->get_parent();
430 delete current_mscope;
431 current_mscope = prev;
434 static void init_duplicate_mnemonic(
const char *window_name) {
435 if (!current_mscope) {
436 current_mscope =
new MnemonicScope(window_name,
NULp);
437 help_mscope =
new MnemonicScope(
"<HELP>", current_mscope);
440 while (current_mscope->get_parent()) {
441 close_test_duplicate_mnemonics();
446 static void test_duplicate_mnemonics(
const char *topic_name,
const char *mnemonic) {
448 current_mscope->add(topic_name, mnemonic);
451 static void exit_duplicate_mnemonic() {
452 delete help_mscope; help_mscope =
NULp;
453 while (current_mscope) close_test_duplicate_mnemonics();
463 #ifdef CHECK_DUPLICATED_MNEMONICS
464 init_duplicate_mnemonic(window_title);
467 #if defined(DUMP_MENU_LIST)
468 dumpCloseAllSubMenus();
469 #endif // DUMP_MENU_LIST
478 #ifdef CHECK_DUPLICATED_MNEMONICS
479 close_test_duplicate_mnemonics();
481 #if defined(DUMP_MENU_LIST)
483 #endif // DUMP_MENU_LIST
488 void AW_window::all_menus_created()
const {
492 #ifdef CHECK_DUPLICATED_MNEMONICS
493 exit_duplicate_mnemonic();
502 xfig_data->
add_line(x1, y1, x2, y2, width);
515 AW_device_click *click_device =
NULp;
541 if (!aram)
return NULp;
546 size_device->
reset();
557 const char *mnemonic,
const char *helpText,
562 #ifdef CHECK_DUPLICATED_MNEMONICS
563 if (!current_mscope) init_duplicate_mnemonic(window_title);
564 MnemonicScope *tmp = current_mscope;
565 current_mscope = help_mscope;
566 test_duplicate_mnemonics(labeli, mnemonic);
567 current_mscope = tmp;
571 button = XtVaCreateManagedWidget(
"", xmPushButtonWidgetClass,
575 XtAddCallback(button, XmNactivateCallback,
577 (XtPointer)
new AW_cb(
this, cb, helpText));
583 const char *mnemonic,
const char *helpText,
584 AW_active mask,
const WindowCallback& wcb) {
590 #if defined(DUMP_MENU_LIST)
592 #endif // DUMP_MENU_LIST
594 #ifdef CHECK_DUPLICATED_MNEMONICS
595 test_duplicate_mnemonics(labeltext, mnemonic);
598 Label topiclabel(labeltext,
this);
599 if (mnemonic && *mnemonic && strchr(labeltext, mnemonic[0])) {
601 button = XtVaCreateManagedWidget(
"", xmPushButtonWidgetClass,
608 button = XtVaCreateManagedWidget(
"",
609 xmPushButtonWidgetClass,
618 XtAddCallback(button, XmNactivateCallback,
622 #if defined(DEVEL_RALF) // wanted version
624 #else // !defined(DEVEL_RALF)
625 if (!topic_id) topic_id = labeltext;
627 cbs->id = strdup(topic_id);
640 #if defined(DUMP_MENU_LIST)
641 dumpOpenSubMenu(name);
642 #endif // DUMP_MENU_LIST
644 #ifdef CHECK_DUPLICATED_MNEMONICS
645 open_test_duplicate_mnemonics(labeli, mnemonic);
649 shell = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
653 XmNallowShellResize,
true,
654 XmNoverrideRedirect,
true,
660 xmRowColumnWidgetClass, shell,
661 XmNrowColumnType, XmMENU_PULLDOWN,
662 XmNtearOffModel, XmTEAR_OFF_ENABLED,
666 if (mnemonic && *mnemonic && strchr(labeli, mnemonic[0])) {
668 Label = XtVaCreateManagedWidget(
"menu1_top_b1",
676 Label = XtVaCreateManagedWidget(
"menu1_top_b1",
677 xmCascadeButtonWidgetClass,
702 void AW_window::get_font_size(
int& width,
int& height) {
709 get_font_size(width, height);
711 if (file) xfig_data =
new AW_xfig(file, width, height);
712 else xfig_data =
new AW_xfig(width, height);
717 int xsize = xfig_data->
maxx - xfig_data->
minx;
718 int ysize = xfig_data->
maxy - xfig_data->
miny;
743 static char *last_local_id =
NULp;
745 return last_local_id;
755 return local_awarnamef(tmp ?
"tmp/window/%s/%s" :
"window/%s/%s",
this, common_name);
765 XtVaCreateManagedWidget(
"", xmSeparatorWidgetClass,
794 focus_cb =
new AW_cb(
this, wcb,
NULp, focus_cb);
864 top_indent_of_vertical_scrollbar = indent;
869 left_indent_of_horizontal_scrollbar = indent;
879 square->
r -= left_indent_of_horizontal_scrollbar;
880 square->
b -= top_indent_of_vertical_scrollbar;
895 bool use_horizontal_bar =
true;
896 int slider_size_horizontal = scrollArea.
r;
898 if (slider_size_horizontal < 1) slider_size_horizontal = 1;
899 if (slider_size_horizontal > slider_max) {
900 slider_size_horizontal = slider_max;
902 use_horizontal_bar =
false;
906 int position_of_slider;
908 if (position_of_slider > (slider_max-slider_size_horizontal)) {
909 position_of_slider = slider_max-slider_size_horizontal;
910 if (position_of_slider < 0) position_of_slider = 0;
934 bool use_vertical_bar =
true;
935 int slider_size_vertical = scrollArea.
b;
937 if (slider_size_vertical < 1) slider_size_vertical = 1;
938 if (slider_size_vertical > slider_max) {
939 slider_size_vertical = slider_max;
941 use_vertical_bar =
false;
945 int position_of_slider;
947 if (position_of_slider > (slider_max-slider_size_vertical)) {
948 position_of_slider = slider_max-slider_size_vertical;
949 if (position_of_slider < 0) position_of_slider = 0;
987 #if defined(DEBUG) && 0
988 fprintf(stderr,
"set_vertical_scrollbar_position to %i\n", position);
996 #if defined(DEBUG) && 0
997 fprintf(stderr,
"set_horizontal_scrollbar_position to %i\n", position);
1005 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1011 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1013 (cbs->
aw)->slider_pos_horizontal = sbcbs->value;
1018 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1024 XmScrollBarCallbackStruct *sbcbs = (XmScrollBarCallbackStruct *)call_data;
1026 (cbs->
aw)->slider_pos_horizontal = sbcbs->value;
1033 (XtPointer)
new AW_cb(
this, wcb,
""));
1036 (XtPointer)
new AW_cb(
this, wcb,
""));
1039 (XtCallbackProc) drag_scroll_bar_vertical,
1040 (XtPointer)
new AW_cb(
this, wcb,
""));
1042 (XtCallbackProc) drag_scroll_bar_vertical,
1043 (XtPointer)
new AW_cb(
this, wcb,
""));
1049 (XtPointer)
new AW_cb(
this, wcb,
""));
1052 (XtPointer)
new AW_cb(
this, wcb,
""));
1058 void AW_window::set_window_size(
int width,
int height) {
1059 XtVaSetValues(
p_w->
shell, XmNwidth, (
int)width, XmNheight, (
int)height,
NULp);
1064 freedup(window_title, title);
1068 return window_title;
1082 set_window_size(width, height);
1089 expose_callback_added(
false),
1093 left_indent_of_horizontal_scrollbar(0),
1094 top_indent_of_vertical_scrollbar(0),
1095 layout_reset_wanted(
NULp),
1100 color_table_size(0),
1105 slider_pos_vertical(0),
1106 slider_pos_horizontal(0),
1107 window_is_shown(
false),
1122 #if defined(DUMP_MENU_LIST)
1124 static char *window_name = 0;
1125 static char *sub_menu = 0;
1127 static void initMenuListing(
const char *win_name) {
1130 freedup(window_name, win_name);
1133 printf(
"---------------------------------------- list of menus for '%s'\n", window_name);
1136 static void dumpMenuEntry(
const char *entry) {
1139 printf(
"'%s/%s/%s'\n", window_name, sub_menu, entry);
1142 printf(
"'%s/%s'\n", window_name, entry);
1146 static void dumpOpenSubMenu(
const char *sub_name) {
1149 dumpMenuEntry(sub_name);
1152 else sub_menu = strdup(sub_name);
1155 static void dumpCloseSubMenu() {
1157 char *lslash = strrchr(sub_menu,
'/');
1161 else freenull(sub_menu);
1164 static void dumpCloseAllSubMenus() {
1168 #endif // DUMP_MENU_LIST
1176 AW_window_simple::AW_window_simple() {}
1177 AW_window_simple::~AW_window_simple() {}
1185 #define LAYOUT_AWAR_ROOT "window/windows"
1191 #define local_posx_awarname(aww) local_layout_awarname((aww), "posx")
1192 #define local_posy_awarname(aww) local_layout_awarname((aww), "posy")
1193 #define local_width_awarname(aww) local_layout_awarname((aww), "width")
1194 #define local_height_awarname(aww) local_layout_awarname((aww), "height")
1195 #define local_reset_awarname(aww) local_layout_awarname((aww), "reset")
1203 if (layout_reset_wanted) {
1206 int cmp = strcmp(last_reset, layout_reset_wanted);
1209 reset_geometry_awars();
1215 void AW_window::store_size_in_awars(
int width,
int height) {
1220 void AW_window::get_size_from_awars(
int& width,
int& height) {
1225 void AW_window::store_pos_in_awars(
int posx,
int posy) {
1230 void AW_window::get_pos_from_awars(
int& posx,
int& posy) {
1235 void AW_window::reset_geometry_awars() {
1247 #undef local_posx_awarname
1248 #undef local_posy_awarname
1249 #undef local_width_awarname
1250 #undef local_height_awarname
1251 #undef local_reset_awarname
1259 int posx, posy; aww->get_window_content_pos(posx, posy);
1261 bool knows_window_position = posx != 0 || posy != 0;
1263 if (!knows_window_position) {
1267 int oposx, oposy; aww->get_pos_from_awars(oposx, oposy);
1268 aww->set_window_frame_pos(oposx, oposy);
1275 int oposx, oposy; aww->get_pos_from_awars(oposx, oposy);
1278 int left = posx-oposx;
1279 int top = posy-oposy;
1281 if (top == 0 || left == 0) {
1284 #if defined(TRACE_WM_OFFSETS)
1285 fprintf(stderr,
"aw_onExpose_calc_WM_offsets: failed to detect framesize (shift window 1 pixel and retry)\n");
1287 oposx = oposx>10 ? oposx-1 : oposx+1;
1288 oposy = oposy>10 ? oposy-1 : oposy+1;
1290 aww->set_window_frame_pos(oposx, oposy);
1291 aww->store_pos_in_awars(oposx, oposy);
1301 if (top == 0 || left == 0) {
1314 #if defined(TRACE_WM_OFFSETS)
1315 fprintf(stderr,
"WM_top_offset=%i WM_left_offset=%i (pos from awar: %i/%i, content-pos: %i/%i)\n",
1317 oposx, oposy, posx, posy);
1323 : last_widget(
NULp),
1326 toplevel_widget(
NULp),
1329 message_shell(
NULp),
1333 option_menu_list(
NULp),
1334 last_option_menu(
NULp),
1335 current_option_menu(
NULp),
1336 toggle_field_list(
NULp),
1337 last_toggle_field(
NULp),
1338 selection_list(
NULp),
1339 last_selection_list(
NULp),
1346 old_cursor_display(
NULp),
1347 old_cursor_window(0),
1359 XSetWindowAttributes attrs;
1366 attrs.cursor = None;
1369 XChangeWindowAttributes(d, w, CWCursor, &attrs);
1403 XtWindow(
p_aww(cbs->
aw)->shell),
1408 while (XCheckMaskEvent(XtDisplay(
p_global->toplevel_widget),
1409 ButtonPressMask|ButtonReleaseMask|ButtonMotionMask|
1410 KeyPressMask|KeyReleaseMask|PointerMotionMask, &event)) {
1415 XtWindow(
p_aww(cbs->
aw)->shell),
1420 XtWindow(
p_aww(cbs->
aw)->shell),
1426 recalc_pos_at_show = pr;
1430 return recalc_pos_at_show;
1437 recalc_size_at_show = sr;
1451 return focus_cb && focus_cb->
contains(f);
1471 XEvent *ev = call_data->event;
1473 if (ev->xexpose.count == 0) {
1481 XtAddCallback(area, XmNexposeCallback, (XtCallbackProc)
AW_exposeCB,
1484 expose_cb =
new AW_cb(aww, cb,
NULp, expose_cb);
1488 return expose_cb && expose_cb->
contains(f);
1497 XmDrawingAreaCallbackStruct da_struct;
1499 da_struct.reason = XmCR_EXPOSE;
1500 da_struct.event =
NULp;
1501 da_struct.window = XtWindow(
p_w->
shell);
1503 XtCallCallbacks(
p_w->
shell, XmNexposeCallback, (XtPointer) &da_struct);
1511 return resize_cb && resize_cb->
contains(f);
1519 void AW_window::set_window_frame_pos(
int x,
int y) {
1521 XtVaSetValues(
p_w->
shell, XmNx, (
int)x, XmNy, (
int)y,
NULp);
1523 void AW_window::get_window_content_pos(
int& xpos,
int& ypos) {
1525 unsigned short x,
y;
1531 void AW_window::get_screen_size(
int &width,
int &height) {
1532 Screen *screen = XtScreen(
p_w->
shell);
1534 width = WidthOfScreen(screen);
1535 height = HeightOfScreen(screen);
1538 bool AW_window::get_mouse_pos(
int& x,
int&
y) {
1539 Display *d = XtDisplay(
p_w->
shell);
1547 Bool ok = XQueryPointer(d, w1, &w2, &w3, &rx, &ry, &wx, &wy, &mask);
1550 #if defined(DEBUG) && 0
1551 printf(
"get_mouse_pos: rx/ry=%i/%i wx/wy=%i/%i\n", rx, ry, wx, wy);
1561 if (event && (event->type == ResizeRequest || event->type
1562 == ConfigureNotify) && event->xany.display == display) {
1571 XLockDisplay(display);
1578 XPutBackEvent(display, &event);
1580 XUnlockDisplay(display);
1585 aw_message(
"If YOU do not know what to answer, how should ARB know?\nPlease think again and answer the prompt!");
1589 aw_message(
"While recording a macro, you cannot use that [X] to hide this window.");
1600 aw_message(
"While recording a macro, you cannot use that [X] to quit.");
1604 if (!
aw_ask_sure(
"quit_by_X",
"Are you sure to quit?"))
return;
1615 Atom WM_DELETE_WINDOW = XmInternAtom(XtDisplay(shell), (
char*)
"WM_DELETE_WINDOW", False);
1620 XmRemoveWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)
aw_window_destroy_cb, (caddr_t)aww);
1623 XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)aw_window_avoid_destroy_cb, (caddr_t)aww);
1626 AW_root *root = aww->get_root();
1628 XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)aw_window_noexit_destroy_cb, (caddr_t)aww);
1631 XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, (XtCallbackProc)aw_window_destroy_cb, (caddr_t)aww);
1650 unsigned short width, height, borderwidth;
1651 XtVaGetValues(motif->
shell,
1652 XmNborderWidth, &borderwidth,
1663 if (posx<0) posx = 0;
1664 if (posy<0) posy = 0;
1666 aww->store_pos_in_awars(posx, posy);
1668 #if defined(TRACE_WM_OFFSETS)
1670 fprintf(stderr,
"Warning: WM_offsets unknown => did not update awars for window '%s'\n", aww->
get_window_title());
1673 aww->store_size_in_awars(width, height);
1677 bool was_shown =
true;
1679 all_menus_created();
1698 int user_width, user_height; get_size_from_awars(user_width, user_height);
1700 if (user_width <min_width) user_width = min_width;
1701 if (user_height<min_height) user_height = min_height;
1703 set_window_size(user_width, user_height);
1706 height = user_height;
1711 #define LOWEST_SUPPORTED_SCREEN_X 1280 // @@@ this size is wrong when 'window/font' has changed (e.g. to "9x15bold")
1712 #define LOWEST_SUPPORTED_SCREEN_Y 800
1714 if (min_width>LOWEST_SUPPORTED_SCREEN_X || min_height>LOWEST_SUPPORTED_SCREEN_Y) {
1716 "Warning: Window '%s' won't fit on %ix%i (win=%ix%i)\n",
1718 LOWEST_SUPPORTED_SCREEN_X, LOWEST_SUPPORTED_SCREEN_Y,
1719 min_width, min_height);
1720 #if defined(DEVEL_RALF)
1727 store_size_in_awars(width, height);
1736 int swidth, sheight; get_screen_size(swidth, sheight);
1737 bool posIsFrame =
false;
1739 switch (recalc_pos_at_show) {
1745 if (!get_mouse_pos(mx, my))
goto FALLBACK_CENTER;
1753 posx = (swidth-width)/2;
1754 posy = (sheight-height)/4;
1762 get_pos_from_awars(posx, posy);
1763 get_size_from_awars(width, height);
1768 int frameWidth, frameHeight;
1781 posy -= frameHeight;
1787 int maxx = swidth - 2*frameWidth - width;
1788 int maxy = sheight - frameWidth-frameHeight - height;
1790 if (posx>maxx) posx = maxx;
1791 if (posy>maxy) posy = maxy;
1794 if (posx<0) posx = 0;
1795 if (posy<0) posy = 0;
1800 if (posx<frameWidth) posx = frameWidth;
1801 if (posy<frameHeight) posy = frameHeight;
1808 store_pos_in_awars(posx, posy);
1809 set_window_frame_pos(posx, posy);
1816 if (!expose_callback_added) {
1818 expose_callback_added =
true;
1831 if (hide_cb) (*hide_cb)(
this);
1844 hide_cb =
new WindowCallback(call_on_hide);
1860 XtAddCallback(area, XmNresizeCallback,
1863 resize_cb =
new AW_cb(aww, cb,
NULp, resize_cb);
1871 XEvent *ev = call_data->event;
1875 bool run_callback =
false;
1876 bool run_double_click_callback =
false;
1882 if (
p_aww(aww)->areas[i]->get_area() == wgt) {
1883 area =
p_aww(aww)->areas[i];
1889 if (ev->xbutton.type == ButtonPress || ev->xbutton.type == ButtonRelease) {
1892 bool ignore_this_event =
false;
1899 if (!ignore_this_event) {
1901 aww->
event.
x = ev->xbutton.x;
1902 aww->
event.
y = ev->xbutton.y;
1907 if (ev->xbutton.type == ButtonPress) {
1911 run_double_click_callback =
true;
1914 run_callback =
true;
1919 run_callback =
true;
1923 else if (ev->xbutton.type == ButtonRelease) {
1925 run_callback =
true;
1930 else if (ev->xkey.type == KeyPress || ev->xkey.type == KeyRelease) {
1945 if (ev->xkey.type == KeyPress) {
1952 aww->
event.
x = ev->xbutton.x;
1953 aww->
event.
y = ev->xbutton.y;
1961 run_callback =
true;
1965 if (run_double_click_callback) {
1981 XtAddCallback(area, XmNinputCallback,
1983 (XtPointer)
new AW_cb(aww, wcb));
1987 double_click_cb =
new AW_cb(aww, wcb,
NULp, double_click_cb);
2011 XtAddEventHandler(area, ButtonMotionMask, False,
2020 void AW_root::exit_variables() {
2032 if (application_database) {
2033 GBDATA *prop_main = application_database;
2034 application_database =
NULp;
2039 void AW_root::exit_root() {
2072 long new_size = colnum+8;
2080 XColor xcolor_returned, xcolor_exakt;
2086 if (strcmp(colorname,
"white"))
2103 if (XAllocNamedColor(
p_global->display,
p_global->colormap, colorname, &xcolor_returned, &xcolor_exakt) == 0) {
2118 unsigned long background_color;
2152 len = aww->get_at().length_of_buttons - 2;
2153 if (len < 1) len = 1;
2156 memset(label,
'y', len);
2174 if (!display[0]) freeset(display, strdup(
" "));
2191 ((
AW_window*)val)->reset_geometry_awars();
2222 return icon_fullname;
2226 static Pixmap
getIcon(Screen *screen,
const char *iconName, Pixel foreground, Pixel background) {
2228 if (icon_hash.isNull()) {
2234 if (!pixmap && iconName) {
2238 char *ico = strdup(iconFile);
2239 pixmap = XmGetPixmap(screen, ico, foreground, background);
2249 #define CopyFromParent_AsPtr NULp
2256 if (width >aww->get_at().max_x_size) aww->get_at().max_x_size = width;
2257 if (height>aww->get_at().max_y_size) aww->get_at().max_y_size = height;
2259 bool has_user_geometry =
false;
2266 int user_width, user_height; aww->get_size_from_awars(user_width, user_height);
2267 int user_posx, user_posy; aww->get_pos_from_awars(user_posx, user_posy);
2270 if (width != user_width) { width = user_width; has_user_geometry =
true; }
2271 if (height != user_height) { height = user_height; has_user_geometry =
true; }
2276 if (posx != user_posx) { posx = user_posx; has_user_geometry =
true; }
2277 if (posy != user_posy) { posy = user_posy; has_user_geometry =
true; }
2279 if (has_user_geometry) {
2299 Screen *screen = XtScreen(father);
2309 else if (icon_pixmap == XmUNSPECIFIED_PIXMAP) {
2318 args.
add(XmNwidth, width);
2319 args.
add(XmNheight, height);
2320 args.
add(XmNx, posx);
2321 args.
add(XmNy, posy);
2324 args.
add(XmNkeyboardFocusPolicy, focusPolicy);
2325 args.
add(XmNdeleteResponse, XmDO_NOTHING);
2326 args.
add(XtNiconPixmap, icon_pixmap);
2329 shell = XtCreatePopupShell(
"editor", applicationShellWidgetClass, father, args.
list(), args.
size());
2332 shell = XtCreatePopupShell(
"transient", transientShellWidgetClass, father, args.
list(), args.
size());
2341 if (!
p_global->main_aww->is_shown()) {
2352 XtVaGetValues(shell, XmNiconWindow, &icon_window,
NULp);
2354 Display *
dpy = XtDisplay(shell);
2356 XSetWindowAttributes attr;
2357 attr.background_pixmap = icon_pixmap;
2360 unsigned int xsize, ysize, borderwidth, depth;
2363 if (XGetGeometry(dpy, icon_pixmap, &wroot, &xpos, &ypos, &xsize, &ysize, &borderwidth, &depth)) {
2364 icon_window = XCreateWindow(dpy, wroot, 0, 0, xsize, ysize, 0, depth, CopyFromParent,
CopyFromParent_AsPtr, CWBackPixmap, &attr);
2368 XtVaSetValues(shell, XmNiconPixmap, icon_pixmap,
NULp);
2371 XtVaSetValues(shell, XmNiconWindow, icon_window,
NULp);
2372 XSetWindowBackgroundPixmap(dpy, icon_window, icon_pixmap);
2373 XClearWindow(dpy, icon_window);
2391 XtRealizeWidget(
p_aww(aww)->shell);
2396 window_title = strdup(title);
2407 const char *help_button =
"HELP";
2408 const char *help_mnemonic =
"H";
2410 #if defined(DUMP_MENU_LIST)
2411 initMenuListing(windowname);
2412 #endif // DUMP_MENU_LIST
2421 main_window = XtVaCreateManagedWidget(
"mainWindow1",
2422 xmMainWindowWidgetClass,
p_w->
shell,
2425 p_w->
menu_bar[0] = XtVaCreateManagedWidget(
"menu1", xmRowColumnWidgetClass,
2427 XmNrowColumnType, XmMENU_BAR,
2431 help_popup = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
2435 XmNallowShellResize,
true,
2436 XmNoverrideRedirect,
true,
2441 xmRowColumnWidgetClass, help_popup,
2442 XmNrowColumnType, XmMENU_PULLDOWN,
2446 help_label = XtVaCreateManagedWidget(
"menu1_top_b1",
2454 form1 = XtVaCreateManagedWidget(
"form1",
2459 XmNresizePolicy, XmRESIZE_NONE,
2465 xmDrawingAreaWidgetClass,
2467 XmNresizePolicy, XmRESIZE_NONE,
2474 XmNbottomAttachment, XmATTACH_FORM,
2475 XmNleftAttachment, XmATTACH_POSITION,
2476 XmNtopAttachment, XmATTACH_POSITION,
2481 separator = XtVaCreateManagedWidget(
"separator",
2482 xmSeparatorWidgetClass,
2485 XmNshadowThickness, 4,
2486 XmNorientation, XmVERTICAL,
2487 XmNbottomAttachment, XmATTACH_FORM,
2488 XmNtopAttachment, XmATTACH_FORM,
2489 XmNleftAttachment, XmATTACH_NONE,
2490 XmNleftWidget,
NULp,
2491 XmNrightAttachment, XmATTACH_NONE,
2496 form2 = XtVaCreateManagedWidget(
"form2",
2505 XmNrightAttachment, XmATTACH_FORM,
2506 XmNbottomAttachment, XmATTACH_FORM,
2507 XmNleftAttachment, XmATTACH_WIDGET,
2508 XmNleftWidget, separator,
2509 XmNtopAttachment, XmATTACH_POSITION,
2510 XmNresizePolicy, XmRESIZE_NONE,
2516 xmDrawingAreaWidgetClass,
2519 XmNbottomAttachment, XmATTACH_NONE,
2520 XmNtopAttachment, XmATTACH_FORM,
2521 XmNleftAttachment, XmATTACH_FORM,
2522 XmNrightAttachment, XmATTACH_FORM,
2529 xmDrawingAreaWidgetClass,
2532 XmNbottomAttachment, XmATTACH_FORM,
2533 XmNtopAttachment, XmATTACH_NONE,
2534 XmNleftAttachment, XmATTACH_FORM,
2535 XmNrightAttachment, XmATTACH_FORM,
2539 xmScrollBarWidgetClass,
2546 XmNrightAttachment, XmATTACH_FORM,
2547 XmNbottomAttachment, XmATTACH_FORM,
2549 XmNleftAttachment, XmATTACH_FORM,
2550 XmNtopAttachment, XmATTACH_NONE,
2551 XmNorientation, XmHORIZONTAL,
2556 xmScrollBarWidgetClass,
2563 XmNrightAttachment, XmATTACH_FORM,
2564 XmNbottomAttachment, XmATTACH_WIDGET,
2569 XmNleftAttachment, XmATTACH_NONE,
2570 XmNtopAttachment, XmATTACH_WIDGET,
2574 p_w->
frame = XtVaCreateManagedWidget(
"draw_area",
2577 XmNshadowType, XmSHADOW_IN,
2578 XmNshadowThickness, 2,
2583 XmNbottomAttachment, XmATTACH_WIDGET,
2585 XmNtopAttachment, XmATTACH_FORM,
2587 XmNleftAttachment, XmATTACH_FORM,
2588 XmNrightAttachment, XmATTACH_WIDGET,
2594 xmDrawingAreaWidgetClass,
2616 const char *help_button =
"HELP";
2617 const char *help_mnemonic =
"H";
2619 #if defined(DUMP_MENU_LIST)
2620 initMenuListing(windowname);
2621 #endif // DUMP_MENU_LIST
2630 main_window = XtVaCreateManagedWidget(
"mainWindow1",
2631 xmMainWindowWidgetClass,
p_w->
shell,
2634 p_w->
menu_bar[0] = XtVaCreateManagedWidget(
"menu1", xmRowColumnWidgetClass,
2636 XmNrowColumnType, XmMENU_BAR,
2640 help_popup = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
2644 XmNallowShellResize,
true,
2645 XmNoverrideRedirect,
true,
2650 xmRowColumnWidgetClass, help_popup,
2651 XmNrowColumnType, XmMENU_PULLDOWN,
2655 help_label = XtVaCreateManagedWidget(
"menu1_top_b1",
2663 form1 = XtVaCreateManagedWidget(
"form1",
2668 XmNresizePolicy, XmRESIZE_NONE,
2674 xmDrawingAreaWidgetClass,
2676 XmNresizePolicy, XmRESIZE_NONE,
2683 XmNbottomAttachment, XmATTACH_FORM,
2684 XmNleftAttachment, XmATTACH_POSITION,
2685 XmNtopAttachment, XmATTACH_POSITION,
2692 form2 = XtVaCreateManagedWidget(
"form2",
2701 XmNrightAttachment, XmATTACH_FORM,
2702 XmNbottomAttachment, XmATTACH_FORM,
2703 XmNleftAttachment, XmATTACH_WIDGET,
2704 XmNleftWidget, separator,
2705 XmNtopAttachment, XmATTACH_POSITION,
2706 XmNresizePolicy, XmRESIZE_NONE,
2712 xmDrawingAreaWidgetClass,
2715 XmNbottomAttachment, XmATTACH_NONE,
2716 XmNtopAttachment, XmATTACH_FORM,
2717 XmNleftAttachment, XmATTACH_FORM,
2718 XmNrightAttachment, XmATTACH_FORM,
2725 xmDrawingAreaWidgetClass,
2728 XmNbottomAttachment, XmATTACH_FORM,
2729 XmNtopAttachment, XmATTACH_NONE,
2730 XmNleftAttachment, XmATTACH_FORM,
2731 XmNrightAttachment, XmATTACH_FORM,
2735 xmScrollBarWidgetClass,
2742 XmNrightAttachment, XmATTACH_FORM,
2743 XmNbottomAttachment, XmATTACH_FORM,
2745 XmNleftAttachment, XmATTACH_FORM,
2746 XmNtopAttachment, XmATTACH_NONE,
2747 XmNorientation, XmHORIZONTAL,
2752 xmScrollBarWidgetClass,
2759 XmNrightAttachment, XmATTACH_FORM,
2760 XmNbottomAttachment, XmATTACH_WIDGET,
2765 XmNleftAttachment, XmATTACH_NONE,
2766 XmNtopAttachment, XmATTACH_WIDGET,
2770 p_w->
frame = XtVaCreateManagedWidget(
"draw_area",
2773 XmNshadowType, XmSHADOW_IN,
2774 XmNshadowThickness, 2,
2779 XmNbottomAttachment, XmATTACH_WIDGET,
2781 XmNtopAttachment, XmATTACH_FORM,
2783 XmNleftAttachment, XmATTACH_FORM,
2784 XmNrightAttachment, XmATTACH_WIDGET,
2790 xmDrawingAreaWidgetClass,
2813 set_title_and_id(windowname, wid);
2815 p_w->shell =
aw_create_shell(
this,
true,
true, width, height, posx, posy);
2820 Widget form1 = XtVaCreateManagedWidget(
"forms", xmFormWidgetClass,
2826 xmDrawingAreaWidgetClass,
2828 XmNbottomAttachment, XmATTACH_FORM,
2829 XmNtopAttachment, XmATTACH_FORM,
2830 XmNleftAttachment, XmATTACH_FORM,
2831 XmNrightAttachment, XmATTACH_FORM,
2843 const char *help_button =
"HELP";
2844 const char *help_mnemonic =
"H";
2860 main_window = XtVaCreateManagedWidget(
"mainWindow1",
2861 xmMainWindowWidgetClass,
p_w->
shell,
2864 p_w->
menu_bar[0] = XtVaCreateManagedWidget(
"menu1", xmRowColumnWidgetClass,
2866 XmNrowColumnType, XmMENU_BAR,
2870 help_popup = XtVaCreatePopupShell(
"menu_shell", xmMenuShellWidgetClass,
2874 XmNallowShellResize,
true,
2875 XmNoverrideRedirect,
true,
2880 xmRowColumnWidgetClass, help_popup,
2881 XmNrowColumnType, XmMENU_PULLDOWN,
2885 help_label = XtVaCreateManagedWidget(
"menu1_top_b1",
2893 form1 = XtVaCreateManagedWidget(
"form1",
2897 XmNresizePolicy, XmRESIZE_NONE,
2902 xmDrawingAreaWidgetClass,
2904 XmNbottomAttachment, XmATTACH_FORM,
2905 XmNtopAttachment, XmATTACH_FORM,
2906 XmNleftAttachment, XmATTACH_FORM,
2907 XmNrightAttachment, XmATTACH_FORM,
2932 XtVaSetValues(
p_w->
shell, XmNmwmFunctions, MWM_FUNC_MOVE | MWM_FUNC_CLOSE,
2937 xmDrawingAreaWidgetClass,
2940 XmNbottomAttachment, XmATTACH_NONE,
2941 XmNtopAttachment, XmATTACH_FORM,
2942 XmNleftAttachment, XmATTACH_FORM,
2943 XmNrightAttachment, XmATTACH_FORM,
2950 init(root_in, wid, windowname, allow_close);
2955 int focusPolicy = follow_mouse ? XmPOINTER : XmEXPLICIT;
2956 XtVaSetValues(
p_w->
shell, XmNkeyboardFocusPolicy, focusPolicy,
NULp);
2966 XtVaSetValues(oldwidget, XmNbackground,
p_global->background,
NULp);
2967 XtVaSetValues(widget, XmNbackground,
p_global->foreground,
NULp);
2975 #define MODE_BUTTON_OFFSET 34
2989 button = XtVaCreateManagedWidget(
"", xmPushButtonWidgetClass,
p_w->
mode_area,
2992 XmNlabelType, XmPIXMAP,
2993 XmNshadowThickness, 1,
2997 XtVaGetValues(button, XmNforeground, &
p_global->foreground,
NULp);
3001 XtAddCallback(button, XmNactivateCallback, (XtCallbackProc)
AW_server_callback, (XtPointer)cb2);
3027 if (!device) device =
new AW_device_Xm(common);
3037 if (!print_device) print_device =
new AW_device_print(common);
3038 return print_device;
3042 if (!click_device) click_device =
new AW_device_click(common);
3043 return click_device;
3051 if (iconic == True) {
3060 Display *xdpy = XtDisplay(
p_w->
shell);
3061 Window window = XtWindow(
p_w->
shell);
3062 Atom netactivewindow = XInternAtom(xdpy,
"_NET_ACTIVE_WINDOW", False);
3064 if (netactivewindow) {
3066 XClientMessageEvent ce;
3067 ce.type = ClientMessage;
3070 ce.message_type = netactivewindow;
3073 ce.data.l[1] = None;
3074 ce.data.l[2] = Above;
3081 XSendEvent(xdpy, XDefaultRootWindow(xdpy),
3083 SubstructureRedirectMask | SubstructureNotifyMask,
3087 if (!ret) { fprintf(stderr,
"Failed to send _NET_ACTIVE_WINDOW to WM (XSendEvent returns %i)\n", ret); }
3093 fputs(
"No such atom '_NET_ACTIVE_WINDOW'\n", stderr);
3106 XtAddCallback((
Widget) widget, XmNactivateCallback,
3114 bool colorSet =
false;
3117 XColor unused, color;
3119 if (XAllocNamedColor(
p_global->display,
p_global->colormap, colorname, &color, &unused)
3121 fprintf(stderr,
"XAllocColor failed: %s\n", colorname);
3183 XtVaGetValues(w, XmNbackground, &bg,
NULp);
3187 XQueryColor(XtDisplay(w),
p_global->colormap, &xc);
3189 col[0] = xc.red >> 8;
3190 col[1] = xc.green >> 8;
3191 col[2] = xc.blue >> 8;
3194 int mod = modStrength;
3195 int preferredDir = 0;
3196 bool invertedMod =
false;
3198 if (modStrength>0) {
3199 if (modStrength>255) {
3205 if (modStrength<-255) {
3206 mod = -modStrength-256;
3218 bool incPossible[3];
3219 bool decPossible[3];
3223 for (
int i = 0; i<3; ++i) {
3224 if ((incPossible[i] = ((col[i]+mod) <= 255)))
3226 if ((decPossible[i] = ((col[i]-mod) >= 0)))
3232 switch (preferredDir) {
3235 preferredDir = decs ? -1 : 1;
3237 preferredDir = incs ? 1 : -1;
3249 aw_assert(preferredDir == 1 || preferredDir == -1);
3251 if (preferredDir == 1) {
3252 for (
int i=0; i<3; ++i) col[i] += (incPossible[i] ? mod : 0);
3254 else if (preferredDir == -1) {
3255 for (
int i=0; i<3; ++i) col[i] -= (decPossible[i] ? mod : 0);
3260 sprintf(hex_color,
"#%2.2X%2.2X%2.2X", col[0], col[1], col[2]);
3270 layout_reset_wanted = YYYYMMDD;
3279 char *registered_localAction =
local_id_copy(registered_action);
3280 const char *localAction_alias =
local_id(action_alias);
3283 free(registered_localAction);
3299 if (!(mask &
global_mask)) XtSetSensitive(w, False);
3307 XtSetSensitive(w, active);
3324 bool removed =
false;
3325 if (button_sens_list) {
3330 if (bl->
button == button)
break;
3338 else button_sens_list = bl->
next;
3369 Widget label_widgeti,
int correct) {
3384 scroll_bar_vertical(
NULp),
3385 scroll_bar_horizontal(
NULp),
3387 help_pull_down(
NULp),
3390 modes_f_callbacks(
NULp),
3391 modes_widgets(
NULp),
3397 toggle_field_var_name(
NULp),
3398 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 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 *)
static const char * local_layout_awarname(AW_window *aww, const char *sub_name)
AliDataPtr format(AliDataPtr data, const size_t wanted_len, GB_ERROR &error)
AW_pos get_scrolled_picture_height() const
void d_callback(const WindowCallback &cb)
void sens_mask(AW_active mask)
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
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)
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
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)
const char * local_awarname(const char *common_name, bool tmp=true)
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)
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
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
#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)
static void aw_window_destroy_cb(Widget w, AW_window *aww, XmAnyCallbackStruct *)
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)
#define local_posx_awarname(aww)
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)
void set_title_and_id(const char *title, const char *id)
AW_device_click * get_click_device()
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()
class AW_awar * local_awar(const char *common_name, bool tmp=true)
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)
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 *)
#define local_width_awarname(aww)
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)
#define local_height_awarname(aww)
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)
static const char * local_awarnamef(const char *format, AW_window *aww, const char *common_name)
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)
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 alias_remote_command(const char *action_alias, const char *registered_action)
void set_expose_callback(AW_window *aww, const WindowCallback &cb)
char * local_id_copy(const char *id) const
static void aw_set_delete_window_cb(AW_window *aww, Widget shell, bool allow_close)
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)
#define local_reset_awarname(aww)
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,...)
#define local_posy_awarname(aww)
void GB_close(GBDATA *gbd)
void alias_remote_command(const char *action_alias, const char *registered_action)
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)