X11workbench Toolkit  1.0
window_helper.h
Go to the documentation of this file.
1 // _ _ _ _ _ //
3 // __ __(_) _ __ __| | ___ __ __ | |__ ___ | | _ __ ___ _ __ | |__ //
4 // \ \ /\ / /| || '_ \ / _` | / _ \\ \ /\ / / | '_ \ / _ \| || '_ \ / _ \| '__|| '_ \ //
5 // \ V V / | || | | || (_| || (_) |\ V V / | | | || __/| || |_) || __/| | _ | | | | //
6 // \_/\_/ |_||_| |_| \__,_| \___/ \_/\_/_____|_| |_| \___||_|| .__/ \___||_|(_)|_| |_| //
7 // |_____| |_| //
8 // //
9 // basic window creation and message handling //
10 // //
11 // NOTE: 'WB' is for 'Work Bench', aka 'X11workbench Toolkit' //
12 // //
14 
15 /*****************************************************************************
16 
17  X11workbench - X11 programmer's 'work bench' application and toolkit
18  Copyright (c) 2010-2019 by Bob Frazier (aka 'Big Bad Bombastic Bob')
19 
20  DISCLAIMER: The X11workbench application and toolkit software are supplied
21  'as-is', with no warranties, either implied or explicit.
22  Any claims to alleged functionality or features should be
23  considered 'preliminary', and might not function as advertised.
24 
25  MIT-like license:
26 
27  There is no restriction as to what you can do with this software, so long
28  as you include the above copyright notice and DISCLAIMER for any distributed
29  work that is equal to or derived from this one, along with this paragraph
30  that explains the terms of the license if the source is also being made
31  available. A "derived work" describes a work that uses a significant portion
32  of the source files or algorithms that are included with this one.
33  Specifically excluded from this are files that were generated by the software,
34  or anything that is included with the software that is part of another package
35  (such as files that were created or added during the 'configure' process).
36  Specifically included is the use of part or all of any of the X11 workbench
37  toolkit source or header files in your distributed application. If you do not
38  ship the source, the above copyright statement is still required to be placed
39  in a reasonably prominent place, such as documentation, splash screens, and/or
40  'about the application' dialog boxes.
41 
42  Use and distribution are in accordance with GPL, LGPL, and/or the above
43  MIT-like license. See COPYING and README files for more information.
44 
45 
46  Additional information at http://sourceforge.net/projects/X11workbench
47 
48 ******************************************************************************/
49 
50 
52 // - DOXYGEN RELATED STUFF - //
54 
108 // doxygen top-level stuff has been moved to doxy_comments.dox
109 
111 // - END DOXYGEN RELATED STUFF - //
113 
114 
115 // window helpers - defines manager for callback procs, font, GC, and a generic event dispatcher
116 
117 #ifndef WINDOW_HELPER_H_INCLUDED
118 #define WINDOW_HELPER_H_INCLUDED
119 
120 
121 #ifndef WIN32
122 #ifdef COMPILER_HAS_PRAGMA_FOR_INCOMPATIBLE_POINTER_TYPES
123 // the 'incompatible pointer types' is now an error (not all gcc supports this)
124 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
125 #endif // COMPILER_HAS_PRAGMA_FOR_INCOMPATIBLE_POINTER_TYPES
126 #endif // !WIN32
127 
128 
129 // headers that must be included or I break
130 
131 #include <string.h> // for memset, mostly
132 
133 #ifndef __DOXYGEN__ /* exclude these so I don't mess up the docs */
134 #include "platform_helper.h"
135 #include "debug_helper.h"
136 #include "font_helper.h"
137 #endif // __DOXYGEN__
138 
139 #ifdef __cplusplus
140 extern "C" {
141 #endif // __cplusplus
142 
146 #define WB_DEFAULT_CURSOR XC_left_ptr
147 
150 #define WB_WAIT_CURSOR XC_watch /*XC_clock*/
151 
154 #define WB_DEFAULT_FONT "fixed"
155 
158 #define WB_DEFAULT_FONT_SIZE 13 /* override via settings */
159 
162 #define WINDOW_DATA_SIZE 4 /* size of a 'void *' array that stores per-window data */
163 
167 #define EVENT_ALL_MASK 0x01ffffffL /* 2^24 | 2^23 ... 2^0 - see X.h */
168 
169 
173 #define GCAll (GCFunction | GCPlaneMask | GCForeground | GCBackground | GCLineWidth | \
174  GCLineStyle | GCCapStyle | GCJoinStyle | GCFillStyle | GCFillRule | \
175  GCTile | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin | GCFont | \
176  GCSubwindowMode | GCGraphicsExposures | GCClipXOrigin | GCClipYOrigin | \
177  GCClipMask | GCDashOffset | GCDashList | GCArcMode)
178 
179 
180 
181 // debug helpers (may be eliminated at some point)
182 
186 extern const char *sz_xcall_func;
190 extern int i_xcall_line;
195 #define BEGIN_XCALL_DEBUG_WRAPPER { const char *__szOldXCallFunc__ = sz_xcall_func; int __iOldXCallLine__ = i_xcall_line; sz_xcall_func = __FUNCTION__; i_xcall_line = __LINE__; {
196 
200 #define END_XCALL_DEBUG_WRAPPER } sz_xcall_func = __szOldXCallFunc__; i_xcall_line = __iOldXCallLine__; }
201 
202 
221 typedef int (* WBWinEvent)(Window wID, XEvent *pEvent);
239 typedef int (* WBAppEvent)(XEvent *pEvent);
240 
241 
243 // //
244 // ____ ____ _ _ //
245 // / ___| ___ _ __ ___ / ___| | |_ _ __ _ _ ___ | |_ _ _ _ __ ___ ___ //
246 // | | / _ \ | '__|/ _ \ \___ \ | __|| '__|| | | | / __|| __|| | | || '__|/ _ \/ __| //
247 // | |___| (_) || | | __/ ___) || |_ | | | |_| || (__ | |_ | |_| || | | __/\__ \ //
248 // \____|\___/ |_| \___| |____/ \__||_| \__,_| \___| \__| \__,_||_| \___||___/ //
249 // //
250 // //
252 
253 
397 typedef struct s_WBGC
398 {
399  Display *display;
400  Drawable dw;
401  GC gc;
402  XGCValues values;
404  Region clip_rgn;
405  XImage *clip_image;
406  XImage *tile_image;
407  XImage *stip_image;
408 } * WBGC;
409 
444 typedef struct s_WB_POINT
445 {
446  int x;
447  int y;
448 } WB_POINT;
449 
473 typedef struct s_WB_EXTENT
474 {
475  unsigned int width;
476  unsigned int height;
477 } WB_EXTENT;
478 
514 typedef struct s_WB_RECT
515 {
516  int left;
517  int top;
518  int right;
519  int bottom;
520 } WB_RECT;
521 
560 typedef struct s_WB_GEOM
561 {
562  int x;
563  int y;
564  unsigned int width;
565  unsigned int height;
566  unsigned int border;
567 } WB_GEOM;
568 
569 
570 
572 // //
573 // ____ _ _ _ _ ____ _ _ _ //
574 // / ___| | |_ __ _ _ __ | |_ _ _ _ __ / \ _ __ __| | / ___| | |__ _ _ | |_ __| | ___ __ __ _ __ //
575 // \___ \ | __|/ _` || '__|| __|| | | || '_ \ / _ \ | '_ \ / _` | \___ \ | '_ \ | | | || __|/ _` | / _ \\ \ /\ / /| '_ \ //
576 // ___) || |_| (_| || | | |_ | |_| || |_) | / ___ \ | | | || (_| | ___) || | | || |_| || |_| (_| || (_) |\ V V / | | | | //
577 // |____/ \__|\__,_||_| \__| \__,_|| .__/ /_/ \_\|_| |_| \__,_| |____/ |_| |_| \__,_| \__|\__,_| \___/ \_/\_/ |_| |_| //
578 // |_| //
579 // //
581 
582 
584 // window-specific initialization
586 
601 Display *WBInit(const char *szDisplayName);
602 
619 int WBInitDisplay(Display *pDisplay);
620 
639 int WBInitClipboardSystem(Display *pDisplay, const char *szDisplayName);
640 
646 int __StartInitClipboardSystem(Display *pDisplay, const char *szDisplayName);
647 
653 int __FinishInitClipboardSystem(Display *pDisplay, const char *szDisplayName);
654 
655 
665 void WBExit(void);
666 
674 void WBExitClipboardSystem(Display *pDisplay);
675 
687 Display *WBThreadInitDisplay(void);
688 
699 void WBThreadFreeDisplay(Display *pThreadDisplay);
700 
701 
712 const char *GetStartupDisplayName(void);
713 
723 void GetStartupGeometry(WB_GEOM *pGeom);
732 int GetStartupMinMax(void);
733 
742 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
743 static __inline__ Colormap WBDefaultColormap(Display *pDisplay)
744 {
745  return DefaultColormap(pDisplay, DefaultScreen(pDisplay));
746 }
747 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
748 #define WBDefaultColormap(X) DefaultColormap(pDisplay, DefaultScreen(pDisplay))
749 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
750 
751 
771 void WBInitWindowAttributes(XSetWindowAttributes *pXSWA, unsigned long lBorderPixel,
772  unsigned long lBackgroundPixel, Colormap clrMap, int iBitGravity);
773 
789 void WBInitSizeHints(XSizeHints *pSH, Display *pDisplay, int iMinHeight, int iMinWidth);
790 
791 
792 
794 // ____ _____ _____ _ _ _ _ _____ ____ //
795 // | _ \ | ____|| ___|/ \ | | | || | |_ _|/ ___| //
796 // | | | || _| | |_ / _ \ | | | || | | | \___ \ //
797 // | |_| || |___ | _|/ ___ \| |_| || |___ | | ___) | //
798 // |____/ |_____||_| /_/ \_\\___/ |_____||_| |____/ //
799 // //
801 
813 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
814 static __inline__ Display * WBGetDefaultDisplay(void)
815 {
816  extern Display *pDefaultDisplay;
817  return pDefaultDisplay;
818 }
819 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
820 Display *WBGetDefaultDisplay();
821 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
822 
836 
846 Window WBGetHiddenHelperWindow(void); // if you need "a window" for the default display, use this
847 
848 
849 
850 
852 // ____ _ ___ ____ _ _ _ _____ ___ __ __ ____ //
853 // / ___|| | / _ \ | __ ) / \ | | / \ |_ _|/ _ \ | \/ |/ ___| //
854 // | | _ | | | | | || _ \ / _ \ | | / _ \ | | | | | || |\/| |\___ \ //
855 // | |_| || |___| |_| || |_) |/ ___ \ | |___ / ___ \ | | | |_| || | | | ___) | //
856 // \____||_____|\___/ |____//_/ \_\|_____| /_/ \_\|_| \___/ |_| |_||____/ //
857 // //
859 
860 // global atoms (for convenience they are referenced directly via global variables)
861 
862 #if !defined(_WINDOW_HELPER_C_) && !defined(_CLIPBOARD_HELPER_C) && !defined(__DOXYGEN__)
863  /* this declares the atoms 'const' outside of window_helper.c, and does NOT declare them in clipboard_helper.c */
864  /* These atoms are GLOBAL variables, assigned by the DEFAULT Display, and may not work for other threads. */
865 extern const Atom aMENU_COMMAND; // commands sent by menus via ClientMessage
866 extern const Atom aMENU_UI_COMMAND; // UI notification sent by menus to owning frame windows via ClientMessage using WBWindowDispatch
867 extern const Atom aRESIZE_NOTIFY; // notification of window re-size via ClientMessage
868 extern const Atom aDESTROY_NOTIFY; // notify parent that child is being destroyed
869 extern const Atom aCONTROL_NOTIFY; // dialog control and child window notification messages
870  // l[0] contains control ID or -1, l[1] is notify code, l[2] is window ID
871 extern const Atom aSCROLL_NOTIFY; // specific notification for scrollbars (see enumeration, below)
872  // data.l[0] is scrollbar enum, data.l[1] is notification enum, data.l[2] is optional position modifier
873 extern const Atom aQUERY_CLOSE; // command sent by Client Message - return 0 if ok to close, 1 if not ok to close, -1 on error
874 extern const Atom aRECALC_LAYOUT; // notify window that it should re-calculate things like scrollbars and viewports
875 
876 extern const Atom aDLG_FOCUS; // dialog focus messages: l[0] is <,0,> for prev, 'set to', next. For 'set to' l[1] is control ID
877 extern const Atom aSET_FOCUS; // 'set focus' messages (send/post to application)
878 extern const Atom aWB_CHAR; // character notifications (generated by API; avoids key up/down handling)
879 extern const Atom aWB_TIMER; // timer notifications (generated by API)
880 extern const Atom aWB_POINTER; // pointer notifications (generated by API)
881 
882 // things used by window managers
883 extern const Atom aWM_PROTOCOLS; // WM supported protocols (see 'freedesktop.org' WM docs)
884 extern const Atom aWM_DELETE_WINDOW; // WM command to delete a window (a click on the 'x')
885 extern const Atom aWM_TAKE_FOCUS; // WM protocol (part of WM_PROTOCOLS spec, ICCCM, assoc with focus bit in WM_HINTS)
886 
887 // things used by fonts
888 extern const Atom aAVERAGE_WIDTH; // Average Character Width (font property)
889 
890 // things used by the clipboard
891 extern const Atom aCLIPBOARD; // Atom for 'CLIPBOARD'
892 extern const Atom aPRIMARY; // Atom for 'PRIMARY'
893 extern const Atom aSECONDARY; // Atom for 'SECONDARY'
894 extern const Atom aMANAGER; // Atom for 'MANAGER'
895 extern const Atom aTARGET; // Atom for 'TARGET'
896 extern const Atom aINCR; // Atom for 'INCR' (incremental transfers)
897 extern const Atom aWINDOW; // Atom for 'WINDOW'
898 extern const Atom aBITMAP; // Atom for 'BITMAP'
899 extern const Atom aDRAWABLE; // Atom for 'DRAWABLE'
900 extern const Atom aCOLORMAP; // Atom for 'COLORMAP'
901 extern const Atom aPIXEL; // Atom for 'PIXEL'
902 extern const Atom aPIXMAP; // Atom for 'PIXMAP'
903 extern const Atom aTEXT; // Atom for 'TEXT'
904 extern const Atom aSTRING; // Atom for 'STRING'
905 extern const Atom aUTF8_STRING; // Atom for 'UTF8_STRING'
906 extern const Atom aC_STRING; // Atom for 'C_STRING'
907 extern const Atom aCOMPOUND_TEXT; // Atom for 'COMPOUND_TEXT'
908 extern const Atom aTARGETS; // Atom for 'TARGETS'
909 extern const Atom aMULTIPLE; // Atom for 'MULTIPLE'
910 extern const Atom aTIMESTAMP; // Atom for 'TIMESTAMP'
911 extern const Atom aNULL; // Atom for 'NULL'
912 #endif // !_WINDOW_HELPER_C, !_CLIPBOARD_HELPER_C
913 
914 
915 
916 // parameter enumerations for aSCROLL_NOTIFY ClientMessage
917 
926 {
930 
938 
940 
943 
944  WB_SCROLL_NA = 0x80000000
945 };
946 
947 
948 
949 
950 
951 
952 
954 // ____ ___ ____ _____ _ ____ ___ //
955 // / ___|/ _ \ | _ \ | ____| / \ | _ \|_ _| //
956 // | | | | | || |_) || _| / _ \ | |_) || | //
957 // | |___| |_| || _ < | |___ / ___ \ | __/ | | //
958 // \____|\___/ |_| \_\|_____| /_/ \_\|_| |___| //
959 // //
961 
968 #define WB_STANDARD_INPUT_MASK (FocusChangeMask | PropertyChangeMask | ExposureMask | StructureNotifyMask | VisibilityChangeMask | SubstructureNotifyMask)
969 
976 #define WB_KEYBOARD_INPUT_MASK (KeyPressMask | KeyReleaseMask)
977 
984 #define WB_MOUSE_INPUT_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask)
985 
986 
994 {
995  // must be ONLY ONE of the items below
996  WMPropertiesWindowType_TypeMask = 0x3f,
997  WMPropertiesWindowType_Normal = 0,
998  WMPropertiesWindowType_Desktop = 1,
999  WMPropertiesWindowType_Dock = 2,
1000  WMPropertiesWindowType_ToolBar = 3,
1001  WMPropertiesWindowType_Menu = 4,
1002  WMPropertiesWindowType_Utility = 5,
1003  WMPropertiesWindowType_Splash = 6,
1004  WMPropertiesWindowType_Dialog = 7,
1005  WMPropertiesWindowType_DropDownMenu = 8,
1006  WMPropertiesWindowType_PopupMenu = 9,
1007  WMPropertiesWindowType_ToolTip = 10,
1008  WMPropertiesWindowType_Notification = 11,
1009  WMPropertiesWindowType_Combo = 12,
1010  WMPropertiesWindowType_Drag_N_Drop = 13,
1011  WMPropertiesWindowType_Reserved14 = 14,
1012  WMPropertiesWindowType_Reserved15 = 15,
1013 
1014 
1015  // may be A COMBINATION of the items below
1016  WMPropertiesWindowType_StateMask = 0xfffC0,
1017 
1018  WMPropertiesWindowType_NoState = 0,
1019  WMPropertiesWindowType_Modal = 0x00040,
1020  WMPropertiesWindowType_Sticky = 0x00080,
1021  WMPropertiesWindowType_VMax = 0x00100,
1022  WMPropertiesWindowType_HMax = 0x00200,
1023  WMPropertiesWindowType_FullScreen = 0x00400,
1024  WMPropertiesWindowType_Hidden = 0x00800,
1025  WMPropertiesWindowType_Shaded = 0x01000,
1026  WMPropertiesWindowType_SkipTaskbar = 0x02000,
1027  WMPropertiesWindowType_SkipPager = 0x04000,
1028  WMPropertiesWindowType_Above = 0x08000,
1029  WMPropertiesWindowType_Below = 0x10000,
1030  WMPropertiesWindowType_Focused = 0x20000,
1031  WMPropertiesWindowType_DemandsAttention = 0x40000,
1032  WMPropertiesWindowType_Reserved80000 = 0x80000,
1033 
1034 
1035  // TODO: other stuff
1036 
1037  WMPropertiesWindowType_Max = 0x80000000
1038 };
1039 
1047 {
1048  // The following flags indicate WM_PROTOCOLS support
1049  // Assigning these directly can have unexpected consequences
1050  WMPropertiesWMProtocols_Mask = 0xff,
1052  WMPropertiesWMProtocols_DeleteWindow = 0x01,
1053  WMPropertiesWMProtocols_Reserved2 = 0x02,
1054  WMPropertiesWMProtocols_Reserved3 = 0x04,
1055  WMPropertiesWMProtocols_Reserved4 = 0x08,
1056  WMPropertiesWMProtocols_Reserved5 = 0x10,
1057  WMPropertiesWMProtocols_Reserved6 = 0x20,
1058  WMPropertiesWMProtocols_Reserved7 = 0x40,
1059  WMPropertiesWMProtocols_Reserved8 = 0x80,
1060 };
1061 
1069 {
1070  // The following flags indicate WM_PROTOCOLS support
1071  // Assigning these directly can have unexpected consequences
1073 #if defined(__DOXYGEN__) || defined(HAS_WB_UINT64_BUILTIN)
1075 #endif // HAS_WB_UINT64_BUILTIN
1076 };
1077 
1078 // TODO: equivalents for when WBUINT64 is NOT supported as a native 'long long' data type (rare, if ever)
1079 
1080 
1117 Window WBCreateWindow(Display *pDisplay, Window wIDParent,
1118  WBWinEvent pProc, const char *szClass,
1119  int iX, int iY, int iWidth, int iHeight, int iBorder, int iIO,
1120  WB_UINT64 iFlags, XSetWindowAttributes *pXSWA);
1121 
1129 void WBDestroyWindow(Window wID);
1130 
1141 Window WBGetApplicationWindow(void);
1142 
1155 void WBSetApplicationWindow(Window wID);
1156 
1162 int WBDefault(Window wID, XEvent *pEvent);
1163 
1169 int WBAppDefault(XEvent *pEvent);
1170 
1180 void WBRegisterAppCallback(WBAppEvent pCallback);
1181 
1188 
1194 void WBRegisterWindowCallback(Window wID, WBWinEvent pCallback);
1195 
1201 void WBUnregisterWindowCallback(Window wID);
1202 
1211 void WBSetWindowTitle(Window wID, const char *szTitle);
1212 
1224 void WBSetWMProperties(Window wID, const char *szTitle, XSizeHints *pNormalHints,
1225  XWMHints *pWMHints, XClassHint *pClassHints);
1237 void WBSetWMPropertiesWindowType(Window wID, enum WMPropertiesWindowType wmProp);
1238 
1251 void WBChangeWMPropertiesWindowType(Window wID, enum WMPropertiesWindowType wmPropSet, enum WMPropertiesWindowType wmChangeMask);
1252 
1253 
1265 
1279 void WBSetWMProtocols(Window wID, Atom aProperty, ...);
1280 
1281 
1291 typedef int (*WBLocateWindowCallback)(Window wID, void *pData);
1292 
1312 Window WBLocateWindow(WBLocateWindowCallback callback, void *pData);
1313 
1324 void WBSetInputFocus(Window wID);
1325 
1334 Display * WBGetWindowDisplay(Window wID);
1335 
1344 void WBSetWindowIcon(Window wID, int idIcon);
1345 
1354 void WBSetWindowFont(Window wID, WB_FONTC pFont);
1355 
1364 void WBSetWindowDefaultCursor(Window wID, int idStandardCursor);
1365 
1374 int WBGetWindowDefaultCursor(Window wID);
1375 
1385 void WBCreateWindowDefaultGC(Window wID, unsigned long clrFG, unsigned long clrBG);
1386 
1395 void WBSetWindowDefaultGC(Window wID, WBGC hGC);
1396 
1405 WBGC WBGetWindowCopyGC(Window wID);
1406 
1419 #define WBGetWindowCopyGC2(wID, gcSrc) WBCopyDrawableGC(WBGetWindowDisplay(wID), wID, gcSrc)
1420 
1430 void WBSetWindowData(Window wID, int iIndex, void *pData);
1431 
1439 void WBBeginWaitCursor(Window wID);
1440 
1448 void WBEndWaitCursor(Window wID);
1449 
1458 void WBSetWindowCursor(Window wID, int idCursor);
1459 
1467 void WBRestoreDefaultCursor(Window wID);
1468 
1485 WBGC WBGetWindowDefaultGC(Window wID);
1486 
1495 WB_FONTC WBQueryWindowFont(Window wID);
1496 
1505 WB_FONT WBGetWindowFont(Window wID);
1506 
1517 unsigned long WBGetWindowFGColor(Window wID);
1518 
1529 unsigned long WBGetWindowBGColor(Window wID);
1530 
1551 void WBDefaultStandardColormap(Display *pDisplay, XStandardColormap *pMap);
1552 
1566 void WBSetWindowClassName(Window wID, const char *szClassName);
1567 
1580 const char *WBGetWindowClassName(Window wID);
1581 
1598 void *WBGetWindowData(Window wID, int iIndex);
1599 
1608 void WBGetWindowGeom(Window wID, WB_GEOM *pGeom);
1609 
1618 void WBGetWindowGeom2(Window wID, WB_GEOM *pGeom);
1619 
1620 
1638 void WBGetWindowGeom0(Window wID, WB_GEOM *pGeom); // absolute window geometry (from latest notification)
1639 
1648 void WBGetWindowRect(Window wID, WB_RECT *pRect);
1649 
1658 void WBGetClientRect(Window wID, WB_RECT *pRect);
1659 
1660 
1669 Window WBGetParentWindow(Window wID);
1670 
1671 
1686 void WBSetParentWindow(Window wID, Window wIDParent);
1687 
1703 int WBReparentWindow(Window wID, Window wIDParent, int iX, int iY); // keeps internal info up to date
1704 
1719 int WBIsChildWindow(Window wIDParent, Window wIDChild); // non-zero if 'wIDParent' is in a parent relationship with 'wIDChild'
1720 
1729 #define WBPointInRect(X,Y,R) ((X) >= (R).left && (X) < (R).right && (Y) >= (R).top && (Y) < (R).bottom)
1730 
1738 #define WBPointInGeom(X,Y,G) ((X) >= (G).x && (X) < ((G).x + (G).width) && (Y) >= (G).y && (Y) < ((G).y + (G).height))
1739 
1746 #define WBRectOverlapped(R1,R2) \
1747  ((((R1).left >= (R2).left && (R1).left < (R2).right) || \
1748  ((R2).left >= (R1).left && (R2).left < (R1).right)) && \
1749  (((R1).top >= (R2).top && (R1).top < (R2).bottom) || \
1750  ((R2).top >= (R1).top && (R2).top < (R1).bottom)))
1751 
1758 #define WBGeomOverlapped(G1,G2) \
1759  ((((G1).x >= (G2).x && (G1).x < (G2).x + (G2).width) || \
1760  ((G2).x >= (G1).x && (G2).x < (G1).x + (G1).width)) && \
1761  (((G1).y >= (G2).y && (G1).y < (G2).y + (G2).height) || \
1762  ((G2).y >= (G1).y && (G2).y < (G1).y + (G1).height)))
1763 
1781 void WBXlatCoordPoint(Window wIDSrc, int iXSrc, int iYSrc, Window wIDDest, int *piXDest, int *piYDest);
1782 
1798 void WBXlatCoordGeom(Window wIDSrc, const WB_GEOM *pGeomSrc, Window wIDDest, WB_GEOM *pGeomDest);
1799 
1815 void WBXlatCoordRect(Window wIDSrc, const WB_RECT *pRectSrc, Window wIDDest, WB_RECT *pRectDest);
1816 
1832 int WBPointInWindow(Window wIDRef, int iX, int iY, Window wIDQuery);
1833 
1834 // keyboard translation helpers
1835 
1839 #define WB_KEYEVENT_KEYSYM 8 /* bit flags for 'piAltCtrlShift' below */
1840 
1844 #define WB_KEYEVENT_ALT 4
1845 
1849 #define WB_KEYEVENT_CTRL 2
1850 
1854 #define WB_KEYEVENT_SHIFT 1
1855 
1859 #define WB_KEYEVENT_ACSMASK 7
1860 
1861 
1882 int WBKeyEventProcessKey(const XKeyEvent *pEvent, char *pBuf, int *pcbLen, int *piAltCtrlShift);
1883  // NOTE: WB_CHAR notification messages (related to WBKeyEventProcessKey)
1884  // message_type == aWB_CHAR
1885  // data.l[0] is return frmo WBKeyEventProcessKey
1886  // data.l[1] is *piAltCtrlShift from WBKeyEventProcessKey
1887  // data.l[2] is number of characters decoded into data.l[3..4]
1888  // data.l[3..4] (as char[]) is decode buffer (at least 8 chars long, possibly 16 for 64-bit)
1889 
1890 
1891 
1892 // pointer event definitions - WB_POINTER
1893 // data.l[0] is notification code (below)
1894 // data.l[1] is bitmap of mouse button state (button 1 is bit 0, button 2 is bit 1, etc.)
1895 // data.l[2] is 'WB_KEYEVENT_' mask for CTRL+ALT+SHIFT
1896 // data.l[3] is translated X coordinate
1897 // data.l[4] is translated Y coordinate
1898 
1902 #define WB_POINTER_UNSPECIFIED 0 /* possible motion or state-change notifications */
1903 
1907 #define WB_POINTER_CLICK 1
1908 
1912 #define WB_POINTER_DBLCLICK 2
1913 
1917 #define WB_POINTER_DRAG 3 /* window proc returns window ID to support drag/drop */
1918 
1922 #define WB_POINTER_DROP 4 /* may not happen if drag is canceled */
1923 
1927 #define WB_POINTER_MOVE 5 /* motion notify while dragging */
1928 
1932 #define WB_POINTER_CANCEL 6 /* reservedly any kind of cancellation, but for now, 'drag cancel' */
1933 
1937 #define WB_POINTER_SCROLLUP 7 /* scroll event, mouse button 4 */
1938 
1942 #define WB_POINTER_SCROLLDOWN 8 /* scroll event, mouse button 5 */
1943 
1947 #define WB_POINTER_BUTTON1 1 /* these are bitmasks */
1948 
1951 #define WB_POINTER_BUTTON2 2
1952 
1955 #define WB_POINTER_BUTTON3 4
1956 
1959 #define WB_POINTER_BUTTON4 8
1960 
1963 #define WB_POINTER_BUTTON5 16
1964 
1976 void WBRegisterMenuCallback(Window wID, WBWinEvent pCallback);
1977 
1996 void WBAddMenuWindow(Window wID, Window wIDMenu);
2005 Window WBGetMenuWindow(Window wID); // returns ID of menu window assigned by above (one only)
2014 void WBRemoveMenuWindow(Window wID, Window wIDMenu);
2015 
2030 int WBIsValid(Display *pDisplay, Window wID);
2031 
2032 
2033 
2035 // _____ __ __ _____ _ _ _____ ____ //
2036 // | ____|\ \ / /| ____|| \ | ||_ _|/ ___| //
2037 // | _| \ \ / / | _| | \| | | | \___ \ //
2038 // | |___ \ V / | |___ | |\ | | | ___) | //
2039 // |_____| \_/ |_____||_| \_| |_| |____/ //
2040 // //
2042 
2043 // message loop helpers
2044 
2056 Time WBGetLastEventTime(void);
2057 
2058 
2107 int WBCheckGetEvent(Display *pDisplay, XEvent *pEvent);
2108 
2122 void WBWaitForEvent(Display *pDisplay);
2123 
2124 
2136 void WBDispatch(XEvent *pEvent);
2137 
2149 int WBAppDispatch(XEvent *pEvent);
2150 
2167 int WBWindowDispatch(Window wID, XEvent *pEvent);
2168 
2181 const char * WBEventName(int iEventID);
2182 
2200 int WBShowModal(Window wID, int bMenuSplashFlag); // modal window - returns 'EndModal' value or -1 on error
2201 
2213 void WBEndModal(Window wID, int iReturn);
2214 
2215 // client-side message queue (avoids XSendEvent)
2216 // to send a message directly use WBAppDispatch and WBWindowDispatch
2217 
2236 int WBNextEvent(Display *pDisplay, XEvent *pEvent);
2237 
2254 int WBPostEvent(Window wID, XEvent *pEvent);
2255 
2269 int WBPostPriorityEvent(Window wID, XEvent *pEvent); // like above but it goes at the beginning of the queue
2270 
2285 void WBPostDelayedEvent(XEvent *pEvent, unsigned int nDelay);
2286 
2299 int WBPostAppEvent(XEvent *pEvent);
2300 
2320 void WBPostDelayedSetFocusAppEvent(Display *pDisplay, Window wID, Window wIDFrom, unsigned int nDelay);
2321 
2338 void WBProcessExposeEvent(XExposeEvent *pEvent); // paint optimization
2339 
2340 
2341 
2343 // //
2344 // _ _ ___ _ _ _ //
2345 // | | | ||_ _| | | | | ___ | | _ __ ___ _ __ ___ //
2346 // | | | | | | | |_| | / _ \| || '_ \ / _ \| '__|/ __| //
2347 // | |_| | | | | _ || __/| || |_) || __/| | \__ \ //
2348 // \___/ |___| |_| |_| \___||_|| .__/ \___||_| |___/ //
2349 // |_| //
2350 // //
2352 
2353 
2370 void WBMouseCancel(Display *pDisplay, Window wID);
2371 
2372 
2373 
2374 
2376 // ____ _ ___ ____ ____ ___ _ ____ ____ //
2377 // / ___| | |_ _| _ \| __ ) / _ \ / \ | _ \| _ \ //
2378 // | | | | | || |_) | _ \| | | |/ _ \ | |_) | | | | //
2379 // | |___| |___ | || __/| |_) | |_| / ___ \| _ <| |_| | //
2380 // \____|_____|___|_| |____/ \___/_/ \_\_| \_\____/ //
2381 // //
2383 
2401 void * WBGetClipboardData(Display *pDisplay, Atom *paType, int *piFormat, unsigned long *pnData);
2402 
2418 int WBSetClipboardData(Display *pDisplay, Atom aType, int iFormat, const void *pData, unsigned long nData);
2419 
2420 
2421 // lower level functions for 'Selections'
2422 
2441 void * WBGetSelectionData(Display *pDisplay, Atom aSelection, Atom *paType, int *piFormat, unsigned long *pnData);
2442 
2443 
2460 int WBSetSelectionData(Display *pDisplay, Atom aSelection, Atom aType, int iFormat, const void *pData, unsigned long nData);
2461 
2462 
2463 
2464 
2466 // _____ __ __ ____ ___ ____ _ _ ____ _____ //
2467 // | ____|\ \/ /| _ \ / _ \ / ___| | | | || _ \ | ____| //
2468 // | _| \ / | |_) || | | |\___ \ | | | || |_) || _| //
2469 // | |___ / \ | __/ | |_| | ___) || |_| || _ < | |___ //
2470 // |_____|/_/\_\|_| \___/ |____/ \___/ |_| \_\|_____| //
2471 // //
2473 
2486 int WBMapWindow(Display *pDisplay, Window wID);
2499 int WBMapRaised(Display *pDisplay, Window wID);
2512 int WBUnmapWindow(Display *pDisplay, Window wID);
2513 
2528 int WBIsMapped(Display *pDisplay, Window wID); // non-zero if mapped, zero otherwise
2529  // NOTE: this only works for windows that have been registered with a callback
2530 
2531 
2532 // paint helpers (working in conjunction with 'WBProcessExposeEvent')
2533 
2549 void WBInvalidateGeom(Window wID, const WB_GEOM *pGeom, int bPaintFlag);
2565 void WBInvalidateRegion(Window wID, Region rgn, int bPaintFlag);
2579 void WBValidateGeom(Window wID, const WB_GEOM *pGeom);
2593 void WBValidateRegion(Window wID, Region rgn);
2594 
2606 Region WBGetInvalidRegion(Window wID);
2607 
2621 Region WBGetPaintRegion(Window wID);
2622 
2634 Region WBRectToRegion(const WB_RECT *pRect);
2635 
2647 Region WBGeomToRegion(const WB_GEOM *pGeom);
2648 
2660 Region WBCopyRegion(Region rgnSource);
2661 
2672 void WBUpdateWindow(Window wID); // posts an expose event for the specified window
2673 
2685 void WBUpdateWindowImmediately(Window wID); // sends expose event synchronously (can cause recursion)
2686 
2706 WBGC WBBeginPaint(Window wID, XExposeEvent *pEvent, WB_GEOM *pgRet); // WBGC has invalid region assigned
2707 
2724 WBGC WBBeginPaintGeom(Window wID, WB_GEOM *pgBounds); // WBGC has invalid region assigned
2725 
2742 void WBEndPaint(Window wID, WBGC gc); // frees the 'paint WBGC' and also resets the invalid region
2743 
2755 void WBClearWindow(Window wID, WBGC gc);
2756 
2757 
2758 // RECT versions (as inline)
2759 
2775 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
2776 static __inline__ void WBInvalidateRect(Window wID, const WB_RECT *pRCT, int bPaintFlag)
2777 {
2778  WB_GEOM geom;
2779 
2780  if(!pRCT)
2781  {
2782  WBInvalidateGeom(wID, NULL, bPaintFlag);
2783  return;
2784  }
2785 
2786  geom.x = pRCT->left;
2787  geom.y = pRCT->top;
2788  geom.width = pRCT->right - pRCT->left;
2789  geom.height = pRCT->bottom - pRCT->top;
2790  geom.border = 0;
2791 
2792  WBInvalidateGeom(wID, &geom, bPaintFlag);
2793 }
2794 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
2795 void WBInvalidateRect(Window wID, const WB_RECT *pRCT, int bPaintFlag);
2796 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
2797 
2811 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
2812 static __inline__ void WBValidateRect(Window wID, WB_RECT *pRCT)
2813 {
2814  WB_GEOM geom;
2815 
2816  if(!pRCT)
2817  {
2818  WBValidateGeom(wID, NULL);
2819  return;
2820  }
2821 
2822  geom.x = pRCT->left;
2823  geom.y = pRCT->top;
2824  geom.width = pRCT->right - pRCT->left;
2825  geom.height = pRCT->bottom - pRCT->top;
2826  geom.border = 0;
2827 
2828  WBValidateGeom(wID, &geom);
2829 }
2830 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
2831 void WBValidateRect(Window wID, WB_RECT *pRCT);
2832 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
2833 
2834 
2836 // ____ _ _ ____ _ _ //
2837 // / ___| _ __ __ _ _ __ | |__ (_) ___ ___ / ___| ___ _ __ | |_ ___ __ __| |_ //
2838 // | | _ | '__|/ _` || '_ \ | '_ \ | | / __|/ __| | | / _ \ | '_ \ | __|/ _ \\ \/ /| __| //
2839 // | |_| || | | (_| || |_) || | | || || (__ \__ \ | |___| (_) || | | || |_| __/ > < | |_ //
2840 // \____||_| \__,_|| .__/ |_| |_||_| \___||___/ \____|\___/ |_| |_| \__|\___|/_/\_\ \__| //
2841 // |_| //
2843 
2861 WBGC WBCreateGC(Display *pDisplay, Drawable dw, unsigned long valuemask,
2862  const XGCValues *values);
2863 
2880 int WBChangeGC(WBGC hGC, unsigned long valuemask,
2881  const XGCValues *values);
2882 
2901 Status WBGetGCValues(WBGC hGC, unsigned long valuemask,
2902  XGCValues *values);
2903 
2917 unsigned long WBGetGCBGColor(WBGC gc);
2918 
2932 unsigned long WBGetGCFGColor(WBGC gc);
2933 
2953 
2972 WB_FONT WBGetGCFont(Display *pDisplay, WBGC gc);
2973 
2982 WBGC WBCopyGC(WBGC hGCOrig);
2983 
2994 int WBCopyGC2(WBGC hGCOrig, unsigned long valuemask, WBGC hGCDest);
2995 
3009 WBGC WBCopyDrawableGC(Display *pDisplay, Drawable dw, WBGC hGCOrig);
3010 
3018 void WBFreeGC(WBGC hGC);
3019 
3037 GContext WBGContextFromGC(WBGC hGC);
3038 
3048 int WBSetRegion(WBGC hGC, Region rgnClip);
3049 
3066 int WBSetClipOrigin(WBGC hGC, int clip_x_origin, int clip_y_origin);
3067 
3077 int WBSetClipMask(WBGC hGC, Pixmap pixmap);
3078 
3094 int WBSetFunction(WBGC hGC, int function);
3095 
3104 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3105 static __inline__ unsigned long WBGetForeground(WBGC hGC) { return hGC->values.foreground; }
3106 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3107 #define WBGetForeground(X) ((X)->values.foreground)
3108 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3109 
3125 int WBSetForeground(WBGC hGC, unsigned long foreground);
3126 
3135 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3136 static __inline__ unsigned long WBGetBackground(WBGC hGC) { return hGC->values.background; }
3137 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3138 #define WBGetBackground(X) ((X)->values.background)
3139 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3140 
3156 int WBSetBackground(WBGC hGC, unsigned long background);
3157 
3169 int WBSetFont(WBGC hGC, WB_FONTC pFont);
3170 
3186 int WBSetFontNoCopy(WBGC hGC, WB_FONT pFont);
3187 
3206 int WBSetLineAttributes(WBGC hGC, unsigned int line_width,
3207  int line_style, int cap_style, int join_style);
3208 
3226 int WBSetDashes(WBGC hGC, int dash_offset, const char dash_list[], int n);
3227 
3228 
3229 
3231 // ___ ____ _ //
3232 // |_ _|_ __ ___ __ _ __ _ ___ / ___|__ _ ___| |__ ___ //
3233 // | || '_ ` _ \ / _` |/ _` |/ _ \ | | / _` |/ __| '_ \ / _ \ //
3234 // | || | | | | | (_| | (_| | __/ | |__| (_| | (__| | | | __/ //
3235 // |___|_| |_| |_|\__,_|\__, |\___| \____\__,_|\___|_| |_|\___| //
3236 // |___/ //
3237 // //
3239 
3240 
3261 XImage *WBGetWindowImage(Display *pDisplay, Window wID);
3262 
3283 int WBAssignWindowImage(Display *pDisplay, Window wID, XImage *pImage);
3284 
3311 int WBCopyIntoWindowImage(Display *pDisplay, Window wID, XImage *pSrcImage,
3312  int xSrc, int ySrc, int width, int height,
3313  int xOffs, int yOffs);
3314 
3331 void WBUpdateWindowWithImage(Display *pDisplay, Window wID);
3332 
3333 
3334 
3336 // ____ _ _ _ _ _ //
3337 // / ___| _ __ __ _ _ __ | |__ (_) ___ ___ | | | | ___ | | _ __ ___ _ __ ___ //
3338 // | | _ | '__|/ _` || '_ \ | '_ \ | | / __|/ __| | |_| | / _ \| || '_ \ / _ \| '__|/ __| //
3339 // | |_| || | | (_| || |_) || | | || || (__ \__ \ | _ || __/| || |_) || __/| | \__ \ //
3340 // \____||_| \__,_|| .__/ |_| |_||_| \___||___/ |_| |_| \___||_|| .__/ \___||_| |___/ //
3341 // |_| |_| //
3342 // //
3343 // Wrapper functions for X11 'primitive' operations that can use a window's cached XImage //
3344 // //
3346 
3347 
3365 int WBDrawPoint(Display *display, Drawable d, WBGC gc, int x, int y);
3366 
3367 
3386 int WBDrawPoints(Display *display, Drawable d, WBGC gc, XPoint *points,
3387  int npoints, int mode);
3388 
3389 
3409 int WBDrawLine(Display *display, Drawable d, WBGC gc,
3410  int x1, int y1, int x2, int y2);
3411 
3412 
3431 int WBDrawLines(Display *display, Drawable d, WBGC gc, XPoint *points,
3432  int npoints, int mode);
3433 
3434 
3454 int WBDrawRectangle(Display *display, Drawable d, WBGC gc, int x, int y,
3455  unsigned int width, unsigned int height);
3456 
3457 
3477 int WBFillRectangle(Display *display, Drawable d, WBGC gc, int x, int y,
3478  unsigned int width, unsigned int height);
3479 
3480 
3502 int WBDrawArc(Display *display, Drawable d, WBGC gc, int x, int y,
3503  unsigned int width, unsigned int height,
3504  int angle1, int angle2);
3505 
3506 
3528 int WBFillArc(Display *display, Drawable d, WBGC gc, int x, int y,
3529  unsigned int width, unsigned int height,
3530  int angle1, int angle2);
3531 
3532 
3552 int WBFillPolygon(Display *display, Drawable d, WBGC gc, XPoint *points,
3553  int npoints, int shape, int mode);
3554 
3555 
3575 int WBDrawString(Display *display, Drawable d, WBGC gc, int x, int y,
3576  const char *string, int length);
3577 
3578 
3579 
3581 // _____ ___ __ __ _____ ____ ____ //
3582 // |_ _||_ _|| \/ || ____|| _ \ / ___| //
3583 // | | | | | |\/| || _| | |_) |\___ \ //
3584 // | | | | | | | || |___ | _ < ___) | //
3585 // |_| |___||_| |_||_____||_| \_\|____/ //
3586 // //
3588 
3606 int CreateTimer(Display *pDisplay, Window wID, unsigned long lInterval, long lID, int iPeriodic);
3607  // NOTE: 'iPeriodic' non-zero for periodic, zero for one-shot. 'lInterval' is in microseconds
3608  // Assign 'lID' to a unique value for the specified pDisplay and wID
3609 
3624 void DeleteTimer(Display *pDisplay, Window wID, long lID); // deletes entry with matching Display, Window, ID
3625 
3626 
3627 
3628 // ****************************************************
3629 //
3630 // E R R O R H A N D L I N G
3631 //
3632 // ****************************************************
3633 
3658 typedef struct s_WB_ERROR_INFO
3659 {
3660  Display *pDisplay;
3661  const char *pFunc;
3662  int iLine;
3663  unsigned long serial;
3668 } WB_ERROR_INFO;
3669 
3670 
3671 
3681 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3682 static __inline__ void WBSupressErrorOutput(void)
3683 {
3684 extern int bIgnoreXErrors;
3685 
3686  // TODO: serialize this with a mutex or other sync object?
3687  bIgnoreXErrors++;
3688 }
3689 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3690 void WBSupressErrorOutput(void);
3691 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3692 
3702 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3703 static __inline__ void WBAllowErrorOutput(void)
3704 {
3705 extern int bIgnoreXErrors;
3706 
3707  // TODO: serialize this with a mutex or other sync object?
3708  if(bIgnoreXErrors > 0)
3709  {
3710  bIgnoreXErrors--;
3711  }
3712  else
3713  {
3714  bIgnoreXErrors = 0;
3715  }
3716 }
3717 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3718 void WBAllowErrorOutput(void);
3719 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER)
3720 
3721 
3727 void WBErrorClear(void);
3728 
3740 int WBErrorCheck(void);
3741 
3754 int WBErrorCheckRetry(void);
3755 
3768 const WB_ERROR_INFO * WBGetLastError(void);
3769 
3770 
3771 
3772 #ifdef __cplusplus
3773 };
3774 #endif // __cplusplus
3775 
3776 #endif // WINDOW_HELPER_H_INCLUDED
3777 
GC gc
the associated 'GC'
XImage * clip_image
cached XImage for the GC, for 'clip mask'
int WBPointInWindow(Window wIDRef, int iX, int iY, Window wIDQuery)
Returna a non-zero value if X,Y coordinates relative to the reference window are within the query win...
void WBSetWMProperties(Window wID, const char *szTitle, XSizeHints *pNormalHints, XWMHints *pWMHints, XClassHint *pClassHints)
assign standard WM (Window Manager) properties via XSetWMProperties
int WBDrawPoints(Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int mode)
Wrapper for XDrawPoints()
Atom aPRIMARY
PRIMARY Atom for the clipboard - uses XA_PRIMARY.
2nd parameter (direction) - up, left
XImage * tile_image
cached XImage for the GC, for 'tile'
Atom aMENU_UI_COMMAND
UI notifications sent by menus to owning Frame windows via ClientMessage using 'WBWindowDispatch'.
static __inline__ void WBValidateRect(Window wID, WB_RECT *pRCT)
'Paint' helper, validates a WB_RECT for asynchronous Expose event generation
Structure definition for X11 error information.
Atom aCOMPOUND_TEXT
COMPOUND_TEXT Atom for the clipboard.
int WBChangeGC(WBGC hGC, unsigned long valuemask, const XGCValues *values)
Change a WBGC, a wrapper for XChangeGC()
Display * display
the Display associated with the WBGC (NULL implies 'Default Display')
Atom aSECONDARY
SECONDARY Atom for the clipboard - uses XA_SECONDARY.
int WBDrawLine(Display *display, Drawable d, WBGC gc, int x1, int y1, int x2, int y2)
Wrapper for XDrawLines()
void WBAddMenuWindow(Window wID, Window wIDMenu)
Add a MENU WINDOW to a (frame) window.
void WBClearWindow(Window wID, WBGC gc)
'Paint' helper, erases background by painting the background color within the clipping region
static __inline__ Colormap WBDefaultColormap(Display *pDisplay)
returns the default colormap for the default screen of the specified display
void * WBGetWindowData(Window wID, int iIndex)
Gets the data associated with this window and the specified index.
unsigned int width
the 'width' value of the extent.
void WBUnregisterAppCallback()
unregister callback function for application events
void WBDefaultStandardColormap(Display *pDisplay, XStandardColormap *pMap)
returns a default XStandardColormap structure for the default screen of the specified display
int x
the 'x' value of the point. can be negative.
int WBKeyEventProcessKey(const XKeyEvent *pEvent, char *pBuf, int *pcbLen, int *piAltCtrlShift)
Generic keyboard event translation utility.
struct s_WB_GEOM WB_GEOM
internal wrapper struct for X11 'geometry' definition
Atom aMULTIPLE
MULTIPLE Atom for the clipboard.
int WBUnmapWindow(Display *pDisplay, Window wID)
wrapper for XUnmapWindow, makes window invisible without destroying it
void WBPostDelayedEvent(XEvent *pEvent, unsigned int nDelay)
Delays placing a copy of the specified event at the end of the regular (internal) event queue by a sp...
Display * WBThreadInitDisplay(void)
initializes default Display for a thread (must call WBInit() first)
void WBRestoreDefaultCursor(Window wID)
restore the default cursor
void WBExit(void)
deletes any remaining global objects, frees the Display pointer, and terminates event processing
int WBSetLineAttributes(WBGC hGC, unsigned int line_width, int line_style, int cap_style, int join_style)
Assign font to a WBGC, a wrapper for XSetLineAttributes()
static __inline__ void WBSupressErrorOutput(void)
Supress X11 XErrorEvent output to stderr.
XImage * WBGetWindowImage(Display *pDisplay, Window wID)
Obtain an XImage for the entire window.
generic 'NA' or 'UNDEFINED' value
void WBCreateWindowDefaultGC(Window wID, unsigned long clrFG, unsigned long clrBG)
creates a default WBGC for a window
void WBWaitForEvent(Display *pDisplay)
Wait for an event, blocking indefinitely.
void WBGetWindowRect(Window wID, WB_RECT *pRect)
Returns the WB_RECT (rectangle) defined by the window's geometry, including the border area.
void WBInitWindowAttributes(XSetWindowAttributes *pXSWA, unsigned long lBorderPixel, unsigned long lBackgroundPixel, Colormap clrMap, int iBitGravity)
initializes the XSetWIndowAttributes structure with minimal attributes
Display * WBInit(const char *szDisplayName)
initializes default objects for the specified Display (required)
int WBCheckGetEvent(Display *pDisplay, XEvent *pEvent)
Main message loop, high level API to check for and retrieve the next event.
int WBNextEvent(Display *pDisplay, XEvent *pEvent)
low-level event queue wrapper. Implements the client-side event queue. Does not block if no events av...
void WBSetWindowClassName(Window wID, const char *szClassName)
Assignes the window's class name pointer.
void WBSetParentWindow(Window wID, Window wIDParent)
Assigns the parent to the specified window within the internal structure.
struct s_WB_EXTENT WB_EXTENT
internal wrapper struct for 'extent' definition
Definition: font_helper.h:79
int __StartInitClipboardSystem(Display *pDisplay, const char *szDisplayName)
initializes clipboard sub-system
int WBDrawPoint(Display *display, Drawable d, WBGC gc, int x, int y)
Wrapper for XDrawPoint()
int WBShowModal(Window wID, int bMenuSplashFlag)
Shows a 'modal' window by processing events until the window closes.
Window WBLocateWindow(WBLocateWindowCallback callback, void *pData)
Locate a window by enumerating with a callback function.
void WBGetWindowGeom0(Window wID, WB_GEOM *pGeom)
Returns the ABSOLUTE window geometry relative to the screen.
unsigned int border
unsigned int width
Atom aINCR
INCR Atom for the clipboard.
Definition file for font helper functions and structures.
unsigned long serial
serial number from XErrorEvent
const char * GetStartupDisplayName(void)
returns character name of the display to be opened and passed to WBInit
int WBWindowDispatch(Window wID, XEvent *pEvent)
Dispatches a window XEvent. May be called directly.
equivalent to 'CWBorderPixel | CWBackPixel | CWColormap | CWBitGravity' when specified without any ad...
int WBSetSelectionData(Display *pDisplay, Atom aSelection, Atom aType, int iFormat, const void *pData, unsigned long nData)
Get clipboard data of requested type.
void GetStartupGeometry(WB_GEOM *pGeom)
returns the startup geometry based on command line parameters
const char * WBEventName(int iEventID)
debug function to return the name of an X11 event
1st parameter (bar) - The vertical scroll bar for the control or window.
static __inline__ void WBAllowErrorOutput(void)
Restore X11 XErrorEvent output to stderr.
static __inline__ unsigned long WBGetForeground(WBGC hGC)
Get the (cached) foreground color for a WBGC.
Drawable dw
the Drawable for which this WBGC was created (None implies default Window)
2nd parameter (direction) - 'knob track' - pos in data.l[2]
int WBCopyIntoWindowImage(Display *pDisplay, Window wID, XImage *pSrcImage, int xSrc, int ySrc, int width, int height, int xOffs, int yOffs)
Copy an XImage into the cached XImage for the entire window.
XImage * stip_image
cached XImage for the GC, for 'stipple'
int WBFillPolygon(Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int shape, int mode)
Wrapper for XFillPolygon()
Atom aWM_DELETE_WINDOW
Delete Window notification event.
Atom aWM_PROTOCOLS
WM supported protocols.
WB_FONT pFont
cached default font
void WBUpdateWindowImmediately(Window wID)
'Paint' helper, generates an immediate Expose event for non-empty 'invalid' region
int WBPostPriorityEvent(Window wID, XEvent *pEvent)
Places a copy of the specified event at the end of the priority (internal) event queue.
Atom aWB_CHAR
keystroke/character notifications generated by API
void WBGetClientRect(Window wID, WB_RECT *pRect)
Returns the WB_RECT (rectangle) defined by the window's geometry, excluding the border area.
static __inline__ Display * WBGetDefaultDisplay(void)
Returns the default Display.
internal wrapper struct for X11 'geometry' definition
Region WBCopyRegion(Region rgnSource)
Simple utility to copy a region.
Atom aRECALC_LAYOUT
notify window that it should re-calculate things like scrollbars and viewports
Window WBGetApplicationWindow(void)
Get the main 'Application' window.
int WBSetFont(WBGC hGC, WB_FONTC pFont)
Assign font to a WBGC, a wrapper for XSetFont()
Atom aDLG_FOCUS
dialog focus messages
Atom aTIMESTAMP
TIMESTAMP Atom for the clipboard.
int WBDrawString(Display *display, Drawable d, WBGC gc, int x, int y, const char *string, int length)
wrapper for XDrawString()
void WBInvalidateRegion(Window wID, Region rgn, int bPaintFlag)
'Paint' helper, invalidates a region for asynchronous Expose event generation
int WBSetForeground(WBGC hGC, unsigned long foreground)
Assign foreground color, a wrapper for XSetForeground()
Atom aDRAWABLE
DRAWABLE Atom for the clipboard - uses XA_DRAWABLE.
int WBSetClipboardData(Display *pDisplay, Atom aType, int iFormat, const void *pData, unsigned long nData)
Get clipboard data of requested type.
int WBAssignWindowImage(Display *pDisplay, Window wID, XImage *pImage)
Assign an XImage for the entire window.
int WBDrawArc(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
Wrapper for XDrawArc()
Atom aWB_POINTER
pointer click/double-click/drag notifications generated by API
WMPropertiesWindowType
Window type enumeration. Reserved for future implementation.
do not use a 'backing store' when drawing the window (native X11 calls)
WB_FONTC WBQueryWindowFont(Window wID)
Returns the WB_FONT assigned to the window (may be NULL), not a copy.
void WBRegisterWindowCallback(Window wID, WBWinEvent pCallback)
register callback function for a window (required)
Atom aMANAGER
MANAGER Atom for the clipboard.
Atom aMENU_COMMAND
commands sent by menus via ClientMessage
int(* WBAppEvent)(XEvent *pEvent)
event callback function type definition for application events
Atom aPIXEL
PIXEL Atom for the clipboard.
void DeleteTimer(Display *pDisplay, Window wID, long lID)
Deletes an existing timer's resources.
Atom aSCROLL_NOTIFY
void WBInvalidateGeom(Window wID, const WB_GEOM *pGeom, int bPaintFlag)
'Paint' helper, invalidates a geometry for asynchronous Expose event generation
int WBDrawRectangle(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
Wrapper for XDrawRectangle()
1st parameter (bar) - The horizontal scroll bar for the control or window
int WBDrawLines(Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int mode)
Wrapper for XDrawLine()
void WBSetWindowCursor(Window wID, int idCursor)
immediately set the window cursor
void WBSetWMPropertiesWindowType(Window wID, enum WMPropertiesWindowType wmProp)
assign standard WM (Window Manager) 'window type' properties BEFORE mapping it (reserved)
Region WBGetPaintRegion(Window wID)
'Paint' helper, returns a copy of the current 'paint' region for the window
Region WBRectToRegion(const WB_RECT *pRect)
'Paint' helper, converts a WB_RECT structure to a Region.
unsigned long WBGetWindowFGColor(Window wID)
Returns the currently assigned foreground color.
void WBSetApplicationWindow(Window wID)
Assign the main 'Appklication' window.
WB_FONT WBGetWindowFont(Window wID)
Returns a copy of the current WB_FONT assigned to the window (may be NULL)
void WBGetWindowGeom2(Window wID, WB_GEOM *pGeom)
Returns the geometry of the window relative to the root window.
2nd parameter (direction) - bottom, end
Atom aWINDOW
WINDOW Atom for the clipboard - uses XA_WINDOW.
Atom aAVERAGE_WIDTH
Atoms for fonts - Average Character Width.
Window WBGetParentWindow(Window wID)
Returns the window's parent (or None if there is no parent)
GContext WBGContextFromGC(WBGC hGC)
Free resources for a WBGC, wrapper for XGContextFromGC()
int WBSetFontNoCopy(WBGC hGC, WB_FONT pFont)
Assign font to a WBGC, a wrapper for XSetFont()
unsigned long long WB_UINT64
Platform abstract unsigned 64-bit integer.
2nd parameter (direction) - relative scroll - rel pos in data.l[2]
void WBProcessExposeEvent(XExposeEvent *pEvent)
low-level event processing, internal handling of Expose events
int WBPostAppEvent(XEvent *pEvent)
Places a copy of the specified event at the end of the priority (internal) event queue.
void WBValidateGeom(Window wID, const WB_GEOM *pGeom)
'Paint' helper, validates a geometry for asynchronous Expose event generation
int WBSetRegion(WBGC hGC, Region rgnClip)
Assign clipping region, wrapper for XSetRegion()
Region WBGetInvalidRegion(Window wID)
'Paint' helper, returns a copy of the invalid region for a window
int WBIsMapped(Display *pDisplay, Window wID)
Returns non-zero if window has been mapped; zero otherwise.
Window WBGetMenuWindow(Window wID)
Returns the Window ID of the (first) menu window assigned to a (frame) window.
WBGC WBCopyGC(WBGC hGCOrig)
makes a copy of a WBGC, a more sensible wrapper for XCopyGC()
int WBFillArc(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
Wrapper for XFillArc()
unsigned long WBGetWindowBGColor(Window wID)
Returns the currently assigned background color.
int WBAppDispatch(XEvent *pEvent)
Dispatches an application XEvent. May be called directly.
Window WBGetHiddenHelperWindow(void)
Returns a special 'hidden' window used for information purposes.
static __inline__ void WBInvalidateRect(Window wID, const WB_RECT *pRCT, int bPaintFlag)
'Paint' helper, invalidates a WB_RECT for asynchronous Expose event generation
int WBPostEvent(Window wID, XEvent *pEvent)
Places a copy of the specified event at the end of the regular (internal) event queue.
int WBMapRaised(Display *pDisplay, Window wID)
wrapper for XMapRaised, makes window visible and moves to top
void WBDestroyWindow(Window wID)
Destroy a window.
2nd parameter (direction) - pgup, pgleft
XGCValues values
cached XGCValues for the GC
WBGC WBCreateGC(Display *pDisplay, Drawable dw, unsigned long valuemask, const XGCValues *values)
Creates a WBGC, wrapper for XCreateGC()
void WBSetWindowFont(Window wID, WB_FONTC pFont)
assigns the default WB_FONT object for a window
int iLine
Line number of the function as assigned by BEGIN_XCALL_DEBUG_WRAPPER.
int y
the 'y' value of the point. can be negative.
void WBXlatCoordPoint(Window wIDSrc, int iXSrc, int iYSrc, Window wIDDest, int *piXDest, int *piYDest)
Translate X,Y point coordinates relative to a window.
void * WBGetSelectionData(Display *pDisplay, Atom aSelection, Atom *paType, int *piFormat, unsigned long *pnData)
Get clipboard data of requested type.
void WBUpdateWindow(Window wID)
'Paint' helper, generates an asynchronous Expose event for non-empty 'invalid' region
void WBSetWindowIcon(Window wID, int idIcon)
assigns an icon resource (by ID) to a window
int WBCopyGC2(WBGC hGCOrig, unsigned long valuemask, WBGC hGCDest)
makes a copy of a WBGC, a wrapper for XCopyGC()
2nd parameter (direction) - absolute scroll - pos in data.l[2]
Window WBCreateWindow(Display *pDisplay, Window wIDParent, WBWinEvent pProc, const char *szClass, int iX, int iY, int iWidth, int iHeight, int iBorder, int iIO, WB_UINT64 iFlags, XSetWindowAttributes *pXSWA)
Create a window.
Atom aCLIPBOARD
CLIPBOARD Atom for the clipboard.
int WBSetClipMask(WBGC hGC, Pixmap pixmap)
Set clip mask, a wrapper for XSetClipMask()
WBScrollEventParam
Enumeration for aSCROLL_NOTIFY ClientMessage.
WBGC WBGetWindowDefaultGC(Window wID)
Returns the default WBGC currently assigned to the window (not a copy)
int WBIsChildWindow(Window wIDParent, Window wIDChild)
Returns non-zero if wIDParent is in a parent relationsihp with wIDChild.
int WBInitDisplay(Display *pDisplay)
initializes default objects for the specified Display
void WBDispatch(XEvent *pEvent)
Generic Event Dispatcher, using message type to dispatch.
int WBGetWindowDefaultCursor(Window wID)
returns the default cursor ID for a window
void WBInitSizeHints(XSizeHints *pSH, Display *pDisplay, int iMinHeight, int iMinWidth)
initializes the XSizeHints structure with standard attributes
2nd parameter (direction) - double-clicked item (no selection change info) (sent to list control's ow...
static __inline__ unsigned long WBGetBackground(WBGC hGC)
Get the (cached) background color for a WBGC.
int WBIsValid(Display *pDisplay, Window wID)
returns non-zero if 'valid' (i.e. 'not destroyed')
void WBUnregisterWindowCallback(Window wID)
un-register the window's callback function (implies resource destruction)
void WBErrorClear(void)
Clear the 'last error' information obtained via WBGetLastError()
const char * sz_xcall_func
debug helper variable tracking the function calling into the X11 library
Definition: window_helper.c:98
WB_FONT WBGetGCFont(Display *pDisplay, WBGC gc)
return a copy of the WB_FONT object that was assigned to a WBGC
WBGC WBBeginPaint(Window wID, XExposeEvent *pEvent, WB_GEOM *pgRet)
'Paint' helper, creates a WBGC for use in updating the window in an Expose event handler
int(* WBWinEvent)(Window wID, XEvent *pEvent)
event callback function type for window events
WBGC WBGetWindowCopyGC(Window wID)
makes a copy of the default WBGC so that it can be modified
int minor_code
minor code from XErrorEvent
Atom aWM_TAKE_FOCUS
'Take Focus' - TODO document this properly
Display * pDisplay
Display pointer passed into error handler function (NULL if no error)
2nd parameter (direction) - home, top
struct s_WB_POINT WB_POINT
internal wrapper struct for 'point' definition
int WBReparentWindow(Window wID, Window wIDParent, int iX, int iY)
Assigns a new parent to the specified window (aka 'Re-parent')
Atom aPIXMAP
PIXMAP Atom for the clipboard - uses XA_PIXMAP.
void WBMouseCancel(Display *pDisplay, Window wID)
low-level event processing, internal handling of Expose events
internal wrapper struct for 'extent' definition
enum WMPropertiesWindowType WBGetWMPropertiesWindowType(Window wID)
re-assign standard WM (Window Manager) 'window type' properties and notify the root window (reserved)
void WBXlatCoordRect(Window wIDSrc, const WB_RECT *pRectSrc, Window wIDDest, WB_RECT *pRectDest)
Translate rectangle coordinates relative to a window.
void WBBeginWaitCursor(Window wID)
increment 'wait cursor' count, set cursor to WB_WAIT_CURSOR
unsigned int height
const char * WBGetWindowClassName(Window wID)
Returns the window's assigned class name pointer.
int WBAppDefault(XEvent *pEvent)
implements the default application event callback behavior
internal wrapper struct for 'rectangle' definition
int(* WBLocateWindowCallback)(Window wID, void *pData)
callback definition for WBLocateWindow
int WBErrorCheckRetry(void)
Check to see whether or not an X11 error was detected AND can be re-tried.
int WBSetClipOrigin(WBGC hGC, int clip_x_origin, int clip_y_origin)
Set clip origin, a wrapper for XSetClipOrigin()
int WBErrorCheck(void)
Check to see whether or not an X11 error was detected.
Atom aQUERY_CLOSE
query if it's ok to close (and optionally destroy yourself if ok) a window
void WBSetWindowDefaultCursor(Window wID, int idStandardCursor)
Assigns a default cursor (by ID) to a window.
WMPropertiesWMProtocols
Window WMProtocols support enumeration.
void WBRegisterMenuCallback(Window wID, WBWinEvent pCallback)
(internal) Register a MENU callback for a window
Display * WBGetWindowDisplay(Window wID)
returns the Display associated with a window
Atom aCONTROL_NOTIFY
dialog control and child window notification messages
void WBFreeGC(WBGC hGC)
Free resources for a WBGC, wrapper for XFreeGC()
int WBInitClipboardSystem(Display *pDisplay, const char *szDisplayName)
initializes clipboard sub-system
int error_code
error code from XErrorEvent
struct s_WB_ERROR_INFO WB_ERROR_INFO
Structure definition for X11 error information.
void WBSetWindowData(Window wID, int iIndex, void *pData)
assign 'data pointer' for a window and specified index value
void WBChangeWMPropertiesWindowType(Window wID, enum WMPropertiesWindowType wmPropSet, enum WMPropertiesWindowType wmChangeMask)
re-assign standard WM (Window Manager) 'window type' properties and notify the root window (reserved)
XID resourceid
resource ID (usually a Window) from XErrorEvent
Atom aTARGETS
TARGETS Atom for the clipboard.
2nd parameter (direction) - pgdn, pgright
struct s_WB_RECT WB_RECT
internal wrapper struct for 'rectangle' definition
WBCreateWindow_flags
WBCreateWindow 'iFlags' additional bits.
Atom aTARGET
TARGET Atom for the clipboard.
void WBSetWMProtocols(Window wID, Atom aProperty,...)
re-assign standard WM (Window Manager) 'window type' properties and notify the root window (reserved)
Status WBGetGCValues(WBGC hGC, unsigned long valuemask, XGCValues *values)
Change a WBGC, a wrapper for XGetGCValues()
void WBRegisterAppCallback(WBAppEvent pCallback)
Registers a callback function for application events.
unsigned long WBGetGCFGColor(WBGC gc)
returns the currently assigned foreground color for a WBGC
void WBThreadFreeDisplay(Display *pThreadDisplay)
un-initializes a Display for a thread that was allocated by WBThreadInitDisplay()
unsigned long WBGetGCBGColor(WBGC gc)
returns the currently assigned background color for a WBGC
void WBSetWindowDefaultGC(Window wID, WBGC hGC)
assigns a default WBGC to a window
void WBSetInputFocus(Window wID)
set input focus to a specific window
struct s_WBGC * WBGC
internal wrapper struct for GC with local cache
WBGC WBCopyDrawableGC(Display *pDisplay, Drawable dw, WBGC hGCOrig)
makes a copy of the specified WBGC for the desired 'Drawable'
Atom aCOLORMAP
COLORMAP Atom for the clipboard - uses XA_COLORMAP.
Region clip_rgn
clipping region (or None to use clip_image) - owned by the object
Atom aBITMAP
BITMAP Atom for the clipboard - uses XA_BITMAP.
int WBFillRectangle(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
Wrapper for XFillRectangle()
void WBGetWindowGeom(Window wID, WB_GEOM *pGeom)
Returns the RAW geometry of the window as reported by the window manager.
Region WBGeomToRegion(const WB_GEOM *pGeom)
'Paint' helper, converts a WB_GEOM structure to a Region.
int WBSetBackground(WBGC hGC, unsigned long background)
Assign background color, a wrapper for XSetBackground()
1st parameter (bar) - 'Default Bar', currently not implemented, probably won't be used
Atom aWB_TIMER
timer notifications generated by API
Atom aDESTROY_NOTIFY
notify parent that child is being destroyed
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified...
Definition: font_helper.h:152
int WBDefault(Window wID, XEvent *pEvent)
implements the default window event callback behavior
int CreateTimer(Display *pDisplay, Window wID, unsigned long lInterval, long lID, int iPeriodic)
Creates a one-shot or periodic timer.
void WBEndWaitCursor(Window wID)
decrement 'wait cursor' count, restore to default when zero
void WBEndModal(Window wID, int iReturn)
End a modal window with a specific return value.
int GetStartupMinMax(void)
returns the min/max/normal window state for startup
void WBUpdateWindowWithImage(Display *pDisplay, Window wID)
Update the window's appearance with the contents of the cached XImage.
Definition file for platform-specific utility functions.
unsigned int height
the 'height' value of the extent.
Atom aNULL
NULL Atom for the clipboard.
internal wrapper struct for 'point' definition
void * WBGetClipboardData(Display *pDisplay, Atom *paType, int *piFormat, unsigned long *pnData)
Get clipboard data of requested type.
void WBSetWindowTitle(Window wID, const char *szTitle)
assign window (and icon) title
void WBEndPaint(Window wID, WBGC gc)
'Paint' helper, frees resources and marks the update region 'valid'
internal wrapper struct for GC with local cache
Atom aRESIZE_NOTIFY
notification of window re-size via ClientMessage
int WBSetDashes(WBGC hGC, int dash_offset, const char dash_list[], int n)
Assign font to a WBGC, a wrapper for XSetFont()
Atom aTEXT
TEXT Atom for the clipboard.
Atom aSET_FOCUS
dialog focus messages
const char * pFunc
Name of the function as assigned by BEGIN_XCALL_DEBUG_WRAPPER.
Time WBGetLastEventTime(void)
Main message loop, high level API to check for and retrieve the next event.
2nd parameter (direction) - down, right
Atom aC_STRING
C_STRING Atom for the clipboard.
int WBMapWindow(Display *pDisplay, Window wID)
Wrapper for XMapWindow, makes window visible.
int __FinishInitClipboardSystem(Display *pDisplay, const char *szDisplayName)
initializes clipboard sub-system
Atom aSTRING
STRING Atom for the clipboard - uses XA_STRING.
int request_code
request code from XErrorEvent
int WBSetFunction(WBGC hGC, int function)
Set the 'function' for the WBGC, a wrapper for XSetFunction()
void WBExitClipboardSystem(Display *pDisplay)
Shut down the clipboard sub-system.
void WBValidateRegion(Window wID, Region rgn)
'Paint' helper, validates a region for asynchronous Expose event generation
Atom aUTF8_STRING
UTF8_STRING Atom for the clipboard.
int i_xcall_line
debug helper variable indicating the line number of the function calling into the X11 library
Definition: window_helper.c:99
void WBRemoveMenuWindow(Window wID, Window wIDMenu)
Remove (detach) the specified menu window from a (frame) window.
const WB_ERROR_INFO * WBGetLastError(void)
Obtain a const pointer to the internal WB_ERROR_INFO structure.
WB_FONTC WBQueryGCFont(WBGC gc)
return the WB_FONTC object that was assigned to a WBGC
void WBPostDelayedSetFocusAppEvent(Display *pDisplay, Window wID, Window wIDFrom, unsigned int nDelay)
Creates a 'set focus' ClientMessage event for the application event handler.
WBGC WBBeginPaintGeom(Window wID, WB_GEOM *pgBounds)
'Paint' helper, creates a WBGC for use in updating the window for a specified rectangular area
void WBXlatCoordGeom(Window wIDSrc, const WB_GEOM *pGeomSrc, Window wIDDest, WB_GEOM *pGeomDest)
Translate geometry coordinates relative to a window.
WB_FONTC WBGetDefaultFont(void)
Returns a pointer to the default font WB_FONT for the default display. This is a shared resource; do ...