117 #ifndef WINDOW_HELPER_H_INCLUDED 118 #define WINDOW_HELPER_H_INCLUDED 122 #ifdef COMPILER_HAS_PRAGMA_FOR_INCOMPATIBLE_POINTER_TYPES 124 #pragma GCC diagnostic error "-Wincompatible-pointer-types" 125 #endif // COMPILER_HAS_PRAGMA_FOR_INCOMPATIBLE_POINTER_TYPES 135 #include "debug_helper.h" 137 #endif // __DOXYGEN__ 141 #endif // __cplusplus 146 #define WB_DEFAULT_CURSOR XC_left_ptr 150 #define WB_WAIT_CURSOR XC_watch 154 #define WB_DEFAULT_FONT "fixed" 158 #define WB_DEFAULT_FONT_SIZE 13 162 #define WINDOW_DATA_SIZE 4 167 #define EVENT_ALL_MASK 0x01ffffffL 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) 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__; { 200 #define END_XCALL_DEBUG_WRAPPER } sz_xcall_func = __szOldXCallFunc__; i_xcall_line = __iOldXCallLine__; } 601 Display *
WBInit(
const char *szDisplayName);
742 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 745 return DefaultColormap(pDisplay, DefaultScreen(pDisplay));
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) 772 unsigned long lBackgroundPixel, Colormap clrMap,
int iBitGravity);
789 void WBInitSizeHints(XSizeHints *pSH, Display *pDisplay,
int iMinHeight,
int iMinWidth);
813 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 816 extern Display *pDefaultDisplay;
817 return pDefaultDisplay;
819 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 821 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 862 #if !defined(_WINDOW_HELPER_C_) && !defined(_CLIPBOARD_HELPER_C) && !defined(__DOXYGEN__) 896 extern const Atom
aINCR;
903 extern const Atom
aTEXT;
911 extern const Atom
aNULL;
912 #endif // !_WINDOW_HELPER_C, !_CLIPBOARD_HELPER_C 968 #define WB_STANDARD_INPUT_MASK (FocusChangeMask | PropertyChangeMask | ExposureMask | StructureNotifyMask | VisibilityChangeMask | SubstructureNotifyMask) 976 #define WB_KEYBOARD_INPUT_MASK (KeyPressMask | KeyReleaseMask) 984 #define WB_MOUSE_INPUT_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask) 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,
1016 WMPropertiesWindowType_StateMask = 0xfffC0,
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,
1037 WMPropertiesWindowType_Max = 0x80000000
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,
1073 #if defined(__DOXYGEN__) || defined(HAS_WB_UINT64_BUILTIN) 1075 #endif // HAS_WB_UINT64_BUILTIN 1119 int iX,
int iY,
int iWidth,
int iHeight,
int iBorder,
int iIO,
1120 WB_UINT64 iFlags, XSetWindowAttributes *pXSWA);
1162 int WBDefault(Window wID, XEvent *pEvent);
1224 void WBSetWMProperties(Window wID,
const char *szTitle, XSizeHints *pNormalHints,
1225 XWMHints *pWMHints, XClassHint *pClassHints);
1419 #define WBGetWindowCopyGC2(wID, gcSrc) WBCopyDrawableGC(WBGetWindowDisplay(wID), wID, gcSrc) 1729 #define WBPointInRect(X,Y,R) ((X) >= (R).left && (X) < (R).right && (Y) >= (R).top && (Y) < (R).bottom) 1738 #define WBPointInGeom(X,Y,G) ((X) >= (G).x && (X) < ((G).x + (G).width) && (Y) >= (G).y && (Y) < ((G).y + (G).height)) 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))) 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))) 1781 void WBXlatCoordPoint(Window wIDSrc,
int iXSrc,
int iYSrc, Window wIDDest,
int *piXDest,
int *piYDest);
1839 #define WB_KEYEVENT_KEYSYM 8 1844 #define WB_KEYEVENT_ALT 4 1849 #define WB_KEYEVENT_CTRL 2 1854 #define WB_KEYEVENT_SHIFT 1 1859 #define WB_KEYEVENT_ACSMASK 7 1882 int WBKeyEventProcessKey(
const XKeyEvent *pEvent,
char *pBuf,
int *pcbLen,
int *piAltCtrlShift);
1902 #define WB_POINTER_UNSPECIFIED 0 1907 #define WB_POINTER_CLICK 1 1912 #define WB_POINTER_DBLCLICK 2 1917 #define WB_POINTER_DRAG 3 1922 #define WB_POINTER_DROP 4 1927 #define WB_POINTER_MOVE 5 1932 #define WB_POINTER_CANCEL 6 1937 #define WB_POINTER_SCROLLUP 7 1942 #define WB_POINTER_SCROLLDOWN 8 1947 #define WB_POINTER_BUTTON1 1 1951 #define WB_POINTER_BUTTON2 2 1955 #define WB_POINTER_BUTTON3 4 1959 #define WB_POINTER_BUTTON4 8 1963 #define WB_POINTER_BUTTON5 16 2030 int WBIsValid(Display *pDisplay, Window wID);
2236 int WBNextEvent(Display *pDisplay, XEvent *pEvent);
2401 void *
WBGetClipboardData(Display *pDisplay, Atom *paType,
int *piFormat,
unsigned long *pnData);
2418 int WBSetClipboardData(Display *pDisplay, Atom aType,
int iFormat,
const void *pData,
unsigned long nData);
2441 void *
WBGetSelectionData(Display *pDisplay, Atom aSelection, Atom *paType,
int *piFormat,
unsigned long *pnData);
2460 int WBSetSelectionData(Display *pDisplay, Atom aSelection, Atom aType,
int iFormat,
const void *pData,
unsigned long nData);
2528 int WBIsMapped(Display *pDisplay, Window wID);
2775 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 2786 geom.
x = pRCT->
left;
2794 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 2796 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 2811 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 2822 geom.
x = pRCT->
left;
2830 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 2832 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 2861 WBGC WBCreateGC(Display *pDisplay, Drawable dw,
unsigned long valuemask,
2862 const XGCValues *values);
2881 const XGCValues *values);
3104 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 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) 3135 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 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) 3207 int line_style,
int cap_style,
int join_style);
3226 int WBSetDashes(
WBGC hGC,
int dash_offset,
const char dash_list[],
int n);
3312 int xSrc,
int ySrc,
int width,
int height,
3313 int xOffs,
int yOffs);
3387 int npoints,
int mode);
3410 int x1,
int y1,
int x2,
int y2);
3431 int WBDrawLines(Display *display, Drawable d,
WBGC gc, XPoint *points,
3432 int npoints,
int mode);
3455 unsigned int width,
unsigned int height);
3478 unsigned int width,
unsigned int height);
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);
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);
3553 int npoints,
int shape,
int mode);
3576 const char *
string,
int length);
3606 int CreateTimer(Display *pDisplay, Window wID,
unsigned long lInterval,
long lID,
int iPeriodic);
3624 void DeleteTimer(Display *pDisplay, Window wID,
long lID);
3681 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 3684 extern int bIgnoreXErrors;
3689 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 3691 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 3702 #if defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 3705 extern int bIgnoreXErrors;
3708 if(bIgnoreXErrors > 0)
3717 #else // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 3719 #endif // defined(__DOXYGEN__) || defined(__GNUC__) || defined(_MSVC_VER) 3774 #endif // __cplusplus 3776 #endif // WINDOW_HELPER_H_INCLUDED
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'
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
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.
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.
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.
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()
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
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
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...
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.
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
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 ...