X11workbench Toolkit  1.0
window_helper.h File Reference

'window helper' main header file for the X11workbench Toolkit API More...

#include <string.h>

Go to the source code of this file.

Data Structures

struct  s_WBGC
 internal wrapper struct for GC with local cache More...
 
struct  s_WB_POINT
 internal wrapper struct for 'point' definition More...
 
struct  s_WB_EXTENT
 internal wrapper struct for 'extent' definition More...
 
struct  s_WB_RECT
 internal wrapper struct for 'rectangle' definition More...
 
struct  s_WB_GEOM
 internal wrapper struct for X11 'geometry' definition More...
 
struct  s_WB_ERROR_INFO
 Structure definition for X11 error information. More...
 

Macros

#define WB_DEFAULT_CURSOR   XC_left_ptr
 The default window cursor (this is what xterm uses)
 
#define WB_WAIT_CURSOR   XC_watch /*XC_clock*/
 The 'wait' cursor (this is what xterm uses)
 
#define WB_DEFAULT_FONT   "fixed"
 The default X11 font name (currently "fixed")
 
#define WB_DEFAULT_FONT_SIZE   13 /* override via settings */
 The default X11 font size (currently 13)
 
#define WINDOW_DATA_SIZE   4 /* size of a 'void *' array that stores per-window data */
 The 'window data' array size (currently 4 void pointers)
 
#define EVENT_ALL_MASK   0x01ffffffL /* 2^24 | 2^23 ... 2^0 - see X.h */
 An event mask for ALL events, with bits 0 through 24 set - see X.h which only defines bits 0 to 24 for an event mask.
 
#define GCAll
 A bit mask for ALL GC properties (used when copying a GC) More...
 
#define BEGIN_XCALL_DEBUG_WRAPPER   { const char *__szOldXCallFunc__ = sz_xcall_func; int __iOldXCallLine__ = i_xcall_line; sz_xcall_func = __FUNCTION__; i_xcall_line = __LINE__; {
 wrapper macro for calls into the X11 library. This macro precedes the call(s)
 
#define END_XCALL_DEBUG_WRAPPER   } sz_xcall_func = __szOldXCallFunc__; i_xcall_line = __iOldXCallLine__; }
 wrapper macro for calls into the X11 library. This macro follows the call(s)
 
#define WB_STANDARD_INPUT_MASK   (FocusChangeMask | PropertyChangeMask | ExposureMask | StructureNotifyMask | VisibilityChangeMask | SubstructureNotifyMask)
 'Standard' input mask, bit flag for window creation More...
 
#define WB_KEYBOARD_INPUT_MASK   (KeyPressMask | KeyReleaseMask)
 'Keyboard' input mask, bit flag for window creation More...
 
#define WB_MOUSE_INPUT_MASK   (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask)
 'Mouse' input mask, bit flag for window creation More...
 
#define WBGetWindowCopyGC2(wID, gcSrc)   WBCopyDrawableGC(WBGetWindowDisplay(wID), wID, gcSrc)
 makes a copy of the specified WBGC for the desired window More...
 
#define WBPointInRect(X, Y, R)   ((X) >= (R).left && (X) < (R).right && (Y) >= (R).top && (Y) < (R).bottom)
 Returns logical TRUE if the point (X,Y) is within the borders of the rectangle 'R'. More...
 
#define WBPointInGeom(X, Y, G)   ((X) >= (G).x && (X) < ((G).x + (G).width) && (Y) >= (G).y && (Y) < ((G).y + (G).height))
 Returns logical TRUE if the point (X,Y) is within the borders of the geometry 'G'. More...
 
#define WBRectOverlapped(R1, R2)
 Returns logical TRUE if the rectangle R1 overlaps/intersects R2. More...
 
#define WBGeomOverlapped(G1, G2)
 Returns logical TRUE if the geometry G1 overlaps/intersects G2. More...
 
#define WB_KEYEVENT_KEYSYM   8 /* bit flags for 'piAltCtrlShift' below */
 'AltCtrlShift' bit flag for 'VK_' keys for WBKeyEventProcessKey()
 
#define WB_KEYEVENT_ALT   4
 'AltCtrlShift' bit flag for ALT modifier for WBKeyEventProcessKey()
 
#define WB_KEYEVENT_CTRL   2
 'AltCtrlShift' bit flag for Control modifier for WBKeyEventProcessKey()
 
#define WB_KEYEVENT_SHIFT   1
 'AltCtrlShift' bit flag for Shift modifier for WBKeyEventProcessKey()
 
#define WB_KEYEVENT_ACSMASK   7
 'AltCtrlShift' bit mask for Alt+Ctrl+Shift bits for WBKeyEventProcessKey()
 
#define WB_POINTER_UNSPECIFIED   0 /* possible motion or state-change notifications */
 Unspecified event, possible motion or state-chagne notification.
 
#define WB_POINTER_CLICK   1
 Mouse 'click' event.
 
#define WB_POINTER_DBLCLICK   2
 WB_POINTER 'double-click' event, send in lieu of WB_POINTER_CLICK for double-click.
 
#define WB_POINTER_DRAG   3 /* window proc returns window ID to support drag/drop */
 WB_POINTER 'drag' event, window proc MUST return the window ID to auto-support drag/drop.
 
#define WB_POINTER_DROP   4 /* may not happen if drag is canceled */
 WB_POINTER 'drop' event, only sent if drag/drop supported AND was not 'canceled'; see WB_POINTER_CANCEL.
 
#define WB_POINTER_MOVE   5 /* motion notify while dragging */
 WB_POINTER 'move' event, for motion notification during drag/drop.
 
#define WB_POINTER_CANCEL   6 /* reservedly any kind of cancellation, but for now, 'drag cancel' */
 WB_POINTER 'cancel' event, cancels an ongoing operation, such as drag/drop (useful for resource cleanup)
 
#define WB_POINTER_SCROLLUP   7 /* scroll event, mouse button 4 */
 WB_POINTER 'scroll up' event, caused by mouse button 4.
 
#define WB_POINTER_SCROLLDOWN   8 /* scroll event, mouse button 5 */
 WB_POINTER 'scroll down' event, caused by mouse button 5.
 
#define WB_POINTER_BUTTON1   1 /* these are bitmasks */
 WB_POINTER button bitmask indicating that button 1 is pressed.
 
#define WB_POINTER_BUTTON2   2
 WB_POINTER button bitmask indicating that button 2 is pressed.
 
#define WB_POINTER_BUTTON3   4
 WB_POINTER button bitmask indicating that button 3 is pressed.
 
#define WB_POINTER_BUTTON4   8
 WB_POINTER button bitmask indicating that button 4 (scroll wheel 'up') is pressed.
 
#define WB_POINTER_BUTTON5   16
 WB_POINTER button bitmask indicating that button 5 (scroll wheel 'down') is pressed.
 

Typedefs

typedef int(* WBWinEvent) (Window wID, XEvent *pEvent)
 event callback function type for window events More...
 
typedef int(* WBAppEvent) (XEvent *pEvent)
 event callback function type definition for application events More...
 
typedef struct s_WBGCWBGC
 internal wrapper struct for GC with local cache More...
 
typedef struct s_WB_POINT WB_POINT
 internal wrapper struct for 'point' definition More...
 
typedef struct s_WB_EXTENT WB_EXTENT
 
typedef struct s_WB_RECT WB_RECT
 internal wrapper struct for 'rectangle' definition More...
 
typedef struct s_WB_GEOM WB_GEOM
 internal wrapper struct for X11 'geometry' definition More...
 
typedef int(* WBLocateWindowCallback) (Window wID, void *pData)
 callback definition for WBLocateWindow More...
 
typedef struct s_WB_ERROR_INFO WB_ERROR_INFO
 Structure definition for X11 error information. More...
 

Enumerations

enum  WBScrollEventParam {
  WB_SCROLL_DEFAULT = 0,
  WB_SCROLL_HORIZONTAL = 1,
  WB_SCROLL_VERTICAL = 2,
  WB_SCROLL_KNOB = 0,
  WB_SCROLL_FORWARD = 1,
  WB_SCROLL_BACKWARD = -1,
  WB_SCROLL_PAGEFWD = 2,
  WB_SCROLL_PAGEBACK = -2,
  WB_SCROLL_FIRST = -3,
  WB_SCROLL_LAST = 3,
  WB_SCROLL_DBLCLICK = 4,
  WB_SCROLL_ABSOLUTE = 99,
  WB_SCROLL_RELATIVE = -99,
  WB_SCROLL_NA = 0x80000000
}
 Enumeration for aSCROLL_NOTIFY ClientMessage. More...
 
enum  WMPropertiesWindowType {
  WMPropertiesWindowType_TypeMask = 0x3f,
  WMPropertiesWindowType_Normal = 0,
  WMPropertiesWindowType_Desktop = 1,
  WMPropertiesWindowType_Dock = 2,
  WMPropertiesWindowType_ToolBar = 3,
  WMPropertiesWindowType_Menu = 4,
  WMPropertiesWindowType_Utility = 5,
  WMPropertiesWindowType_Splash = 6,
  WMPropertiesWindowType_Dialog = 7,
  WMPropertiesWindowType_DropDownMenu = 8,
  WMPropertiesWindowType_PopupMenu = 9,
  WMPropertiesWindowType_ToolTip = 10,
  WMPropertiesWindowType_Notification = 11,
  WMPropertiesWindowType_Combo = 12,
  WMPropertiesWindowType_Drag_N_Drop = 13,
  WMPropertiesWindowType_Reserved14 = 14,
  WMPropertiesWindowType_Reserved15 = 15,
  WMPropertiesWindowType_StateMask = 0xfffC0,
  WMPropertiesWindowType_NoState = 0,
  WMPropertiesWindowType_Modal = 0x00040,
  WMPropertiesWindowType_Sticky = 0x00080,
  WMPropertiesWindowType_VMax = 0x00100,
  WMPropertiesWindowType_HMax = 0x00200,
  WMPropertiesWindowType_FullScreen = 0x00400,
  WMPropertiesWindowType_Hidden = 0x00800,
  WMPropertiesWindowType_Shaded = 0x01000,
  WMPropertiesWindowType_SkipTaskbar = 0x02000,
  WMPropertiesWindowType_SkipPager = 0x04000,
  WMPropertiesWindowType_Above = 0x08000,
  WMPropertiesWindowType_Below = 0x10000,
  WMPropertiesWindowType_Focused = 0x20000,
  WMPropertiesWindowType_DemandsAttention = 0x40000,
  WMPropertiesWindowType_Reserved80000 = 0x80000,
  WMPropertiesWindowType_Max = 0x80000000
}
 Window type enumeration. Reserved for future implementation. More...
 
enum  WMPropertiesWMProtocols {
  WMPropertiesWMProtocols_Mask = 0xff,
  WMPropertiesWMProtocols_None = 0x0,
  WMPropertiesWMProtocols_DeleteWindow = 0x01,
  WMPropertiesWMProtocols_Reserved2 = 0x02,
  WMPropertiesWMProtocols_Reserved3 = 0x04,
  WMPropertiesWMProtocols_Reserved4 = 0x08,
  WMPropertiesWMProtocols_Reserved5 = 0x10,
  WMPropertiesWMProtocols_Reserved6 = 0x20,
  WMPropertiesWMProtocols_Reserved7 = 0x40,
  WMPropertiesWMProtocols_Reserved8 = 0x80
}
 Window WMProtocols support enumeration. More...
 
enum  WBCreateWindow_flags {
  WBCreateWindow_flagsDefault = 0,
  WBCreateWindow_flagsNoImageCache = 0x100000000LL
}
 WBCreateWindow 'iFlags' additional bits. More...
 

Functions

Display * WBInit (const char *szDisplayName)
 initializes default objects for the specified Display (required) More...
 
int WBInitDisplay (Display *pDisplay)
 initializes default objects for the specified Display More...
 
int WBInitClipboardSystem (Display *pDisplay, const char *szDisplayName)
 initializes clipboard sub-system More...
 
int __StartInitClipboardSystem (Display *pDisplay, const char *szDisplayName)
 initializes clipboard sub-system More...
 
int __FinishInitClipboardSystem (Display *pDisplay, const char *szDisplayName)
 initializes clipboard sub-system More...
 
void WBExit (void)
 deletes any remaining global objects, frees the Display pointer, and terminates event processing More...
 
void WBExitClipboardSystem (Display *pDisplay)
 Shut down the clipboard sub-system. More...
 
Display * WBThreadInitDisplay (void)
 initializes default Display for a thread (must call WBInit() first) More...
 
void WBThreadFreeDisplay (Display *pThreadDisplay)
 un-initializes a Display for a thread that was allocated by WBThreadInitDisplay() More...
 
const char * GetStartupDisplayName (void)
 returns character name of the display to be opened and passed to WBInit More...
 
void GetStartupGeometry (WB_GEOM *pGeom)
 returns the startup geometry based on command line parameters More...
 
int GetStartupMinMax (void)
 returns the min/max/normal window state for startup More...
 
static __inline__ Colormap WBDefaultColormap (Display *pDisplay)
 returns the default colormap for the default screen of the specified display More...
 
void WBInitWindowAttributes (XSetWindowAttributes *pXSWA, unsigned long lBorderPixel, unsigned long lBackgroundPixel, Colormap clrMap, int iBitGravity)
 initializes the XSetWIndowAttributes structure with minimal attributes More...
 
void WBInitSizeHints (XSizeHints *pSH, Display *pDisplay, int iMinHeight, int iMinWidth)
 initializes the XSizeHints structure with standard attributes More...
 
static __inline__ Display * WBGetDefaultDisplay (void)
 Returns the default Display. More...
 
WB_FONTC WBGetDefaultFont (void)
 Returns a pointer to the default font WB_FONT for the default display. This is a shared resource; do NOT free it nor alter it! More...
 
Window WBGetHiddenHelperWindow (void)
 Returns a special 'hidden' window used for information purposes. More...
 
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. More...
 
void WBDestroyWindow (Window wID)
 Destroy a window. More...
 
Window WBGetApplicationWindow (void)
 Get the main 'Application' window. More...
 
void WBSetApplicationWindow (Window wID)
 Assign the main 'Appklication' window. More...
 
int WBDefault (Window wID, XEvent *pEvent)
 implements the default window event callback behavior More...
 
int WBAppDefault (XEvent *pEvent)
 implements the default application event callback behavior More...
 
void WBRegisterAppCallback (WBAppEvent pCallback)
 Registers a callback function for application events. More...
 
void WBUnregisterAppCallback ()
 unregister callback function for application events More...
 
void WBRegisterWindowCallback (Window wID, WBWinEvent pCallback)
 register callback function for a window (required) More...
 
void WBUnregisterWindowCallback (Window wID)
 un-register the window's callback function (implies resource destruction) More...
 
void WBSetWindowTitle (Window wID, const char *szTitle)
 assign window (and icon) title More...
 
void WBSetWMProperties (Window wID, const char *szTitle, XSizeHints *pNormalHints, XWMHints *pWMHints, XClassHint *pClassHints)
 assign standard WM (Window Manager) properties via XSetWMProperties More...
 
void WBSetWMPropertiesWindowType (Window wID, enum WMPropertiesWindowType wmProp)
 assign standard WM (Window Manager) 'window type' properties BEFORE mapping it (reserved) More...
 
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) More...
 
enum WMPropertiesWindowType WBGetWMPropertiesWindowType (Window wID)
 re-assign standard WM (Window Manager) 'window type' properties and notify the root window (reserved) More...
 
void WBSetWMProtocols (Window wID, Atom aProperty,...)
 re-assign standard WM (Window Manager) 'window type' properties and notify the root window (reserved) More...
 
Window WBLocateWindow (WBLocateWindowCallback callback, void *pData)
 Locate a window by enumerating with a callback function. More...
 
void WBSetInputFocus (Window wID)
 set input focus to a specific window More...
 
Display * WBGetWindowDisplay (Window wID)
 returns the Display associated with a window More...
 
void WBSetWindowIcon (Window wID, int idIcon)
 assigns an icon resource (by ID) to a window More...
 
void WBSetWindowFont (Window wID, WB_FONTC pFont)
 assigns the default WB_FONT object for a window More...
 
void WBSetWindowDefaultCursor (Window wID, int idStandardCursor)
 Assigns a default cursor (by ID) to a window. More...
 
int WBGetWindowDefaultCursor (Window wID)
 returns the default cursor ID for a window More...
 
void WBCreateWindowDefaultGC (Window wID, unsigned long clrFG, unsigned long clrBG)
 creates a default WBGC for a window More...
 
void WBSetWindowDefaultGC (Window wID, WBGC hGC)
 assigns a default WBGC to a window More...
 
WBGC WBGetWindowCopyGC (Window wID)
 makes a copy of the default WBGC so that it can be modified More...
 
void WBSetWindowData (Window wID, int iIndex, void *pData)
 assign 'data pointer' for a window and specified index value More...
 
void WBBeginWaitCursor (Window wID)
 increment 'wait cursor' count, set cursor to WB_WAIT_CURSOR More...
 
void WBEndWaitCursor (Window wID)
 decrement 'wait cursor' count, restore to default when zero More...
 
void WBSetWindowCursor (Window wID, int idCursor)
 immediately set the window cursor More...
 
void WBRestoreDefaultCursor (Window wID)
 restore the default cursor More...
 
WBGC WBGetWindowDefaultGC (Window wID)
 Returns the default WBGC currently assigned to the window (not a copy) More...
 
WB_FONTC WBQueryWindowFont (Window wID)
 Returns the WB_FONT assigned to the window (may be NULL), not a copy. More...
 
WB_FONT WBGetWindowFont (Window wID)
 Returns a copy of the current WB_FONT assigned to the window (may be NULL) More...
 
unsigned long WBGetWindowFGColor (Window wID)
 Returns the currently assigned foreground color. More...
 
unsigned long WBGetWindowBGColor (Window wID)
 Returns the currently assigned background color. More...
 
void WBDefaultStandardColormap (Display *pDisplay, XStandardColormap *pMap)
 returns a default XStandardColormap structure for the default screen of the specified display More...
 
void WBSetWindowClassName (Window wID, const char *szClassName)
 Assignes the window's class name pointer. More...
 
const char * WBGetWindowClassName (Window wID)
 Returns the window's assigned class name pointer. More...
 
void * WBGetWindowData (Window wID, int iIndex)
 Gets the data associated with this window and the specified index. More...
 
void WBGetWindowGeom (Window wID, WB_GEOM *pGeom)
 Returns the RAW geometry of the window as reported by the window manager. More...
 
void WBGetWindowGeom2 (Window wID, WB_GEOM *pGeom)
 Returns the geometry of the window relative to the root window. More...
 
void WBGetWindowGeom0 (Window wID, WB_GEOM *pGeom)
 Returns the ABSOLUTE window geometry relative to the screen. More...
 
void WBGetWindowRect (Window wID, WB_RECT *pRect)
 Returns the WB_RECT (rectangle) defined by the window's geometry, including the border area. More...
 
void WBGetClientRect (Window wID, WB_RECT *pRect)
 Returns the WB_RECT (rectangle) defined by the window's geometry, excluding the border area. More...
 
Window WBGetParentWindow (Window wID)
 Returns the window's parent (or None if there is no parent) More...
 
void WBSetParentWindow (Window wID, Window wIDParent)
 Assigns the parent to the specified window within the internal structure. More...
 
int WBReparentWindow (Window wID, Window wIDParent, int iX, int iY)
 Assigns a new parent to the specified window (aka 'Re-parent') More...
 
int WBIsChildWindow (Window wIDParent, Window wIDChild)
 Returns non-zero if wIDParent is in a parent relationsihp with wIDChild. More...
 
void WBXlatCoordPoint (Window wIDSrc, int iXSrc, int iYSrc, Window wIDDest, int *piXDest, int *piYDest)
 Translate X,Y point coordinates relative to a window. More...
 
void WBXlatCoordGeom (Window wIDSrc, const WB_GEOM *pGeomSrc, Window wIDDest, WB_GEOM *pGeomDest)
 Translate geometry coordinates relative to a window. More...
 
void WBXlatCoordRect (Window wIDSrc, const WB_RECT *pRectSrc, Window wIDDest, WB_RECT *pRectDest)
 Translate rectangle coordinates relative to a window. More...
 
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 window. More...
 
int WBKeyEventProcessKey (const XKeyEvent *pEvent, char *pBuf, int *pcbLen, int *piAltCtrlShift)
 Generic keyboard event translation utility. More...
 
void WBRegisterMenuCallback (Window wID, WBWinEvent pCallback)
 (internal) Register a MENU callback for a window More...
 
void WBAddMenuWindow (Window wID, Window wIDMenu)
 Add a MENU WINDOW to a (frame) window. More...
 
Window WBGetMenuWindow (Window wID)
 Returns the Window ID of the (first) menu window assigned to a (frame) window. More...
 
void WBRemoveMenuWindow (Window wID, Window wIDMenu)
 Remove (detach) the specified menu window from a (frame) window. More...
 
int WBIsValid (Display *pDisplay, Window wID)
 returns non-zero if 'valid' (i.e. 'not destroyed') More...
 
Time WBGetLastEventTime (void)
 Main message loop, high level API to check for and retrieve the next event. More...
 
int WBCheckGetEvent (Display *pDisplay, XEvent *pEvent)
 Main message loop, high level API to check for and retrieve the next event. More...
 
void WBWaitForEvent (Display *pDisplay)
 Wait for an event, blocking indefinitely. More...
 
void WBDispatch (XEvent *pEvent)
 Generic Event Dispatcher, using message type to dispatch. More...
 
int WBAppDispatch (XEvent *pEvent)
 Dispatches an application XEvent. May be called directly. More...
 
int WBWindowDispatch (Window wID, XEvent *pEvent)
 Dispatches a window XEvent. May be called directly. More...
 
const char * WBEventName (int iEventID)
 debug function to return the name of an X11 event More...
 
int WBShowModal (Window wID, int bMenuSplashFlag)
 Shows a 'modal' window by processing events until the window closes. More...
 
void WBEndModal (Window wID, int iReturn)
 End a modal window with a specific return value. More...
 
int WBNextEvent (Display *pDisplay, XEvent *pEvent)
 low-level event queue wrapper. Implements the client-side event queue. Does not block if no events available. More...
 
int WBPostEvent (Window wID, XEvent *pEvent)
 Places a copy of the specified event at the end of the regular (internal) event queue. More...
 
int WBPostPriorityEvent (Window wID, XEvent *pEvent)
 Places a copy of the specified event at the end of the priority (internal) event queue. More...
 
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 specified number of milliseconds. More...
 
int WBPostAppEvent (XEvent *pEvent)
 Places a copy of the specified event at the end of the priority (internal) event queue. More...
 
void WBPostDelayedSetFocusAppEvent (Display *pDisplay, Window wID, Window wIDFrom, unsigned int nDelay)
 Creates a 'set focus' ClientMessage event for the application event handler. More...
 
void WBProcessExposeEvent (XExposeEvent *pEvent)
 low-level event processing, internal handling of Expose events More...
 
void WBMouseCancel (Display *pDisplay, Window wID)
 low-level event processing, internal handling of Expose events More...
 
void * WBGetClipboardData (Display *pDisplay, Atom *paType, int *piFormat, unsigned long *pnData)
 Get clipboard data of requested type. More...
 
int WBSetClipboardData (Display *pDisplay, Atom aType, int iFormat, const void *pData, unsigned long nData)
 Get clipboard data of requested type. More...
 
void * WBGetSelectionData (Display *pDisplay, Atom aSelection, Atom *paType, int *piFormat, unsigned long *pnData)
 Get clipboard data of requested type. More...
 
int WBSetSelectionData (Display *pDisplay, Atom aSelection, Atom aType, int iFormat, const void *pData, unsigned long nData)
 Get clipboard data of requested type. More...
 
int WBMapWindow (Display *pDisplay, Window wID)
 Wrapper for XMapWindow, makes window visible. More...
 
int WBMapRaised (Display *pDisplay, Window wID)
 wrapper for XMapRaised, makes window visible and moves to top More...
 
int WBUnmapWindow (Display *pDisplay, Window wID)
 wrapper for XUnmapWindow, makes window invisible without destroying it More...
 
int WBIsMapped (Display *pDisplay, Window wID)
 Returns non-zero if window has been mapped; zero otherwise. More...
 
void WBInvalidateGeom (Window wID, const WB_GEOM *pGeom, int bPaintFlag)
 'Paint' helper, invalidates a geometry for asynchronous Expose event generation More...
 
void WBInvalidateRegion (Window wID, Region rgn, int bPaintFlag)
 'Paint' helper, invalidates a region for asynchronous Expose event generation More...
 
void WBValidateGeom (Window wID, const WB_GEOM *pGeom)
 'Paint' helper, validates a geometry for asynchronous Expose event generation More...
 
void WBValidateRegion (Window wID, Region rgn)
 'Paint' helper, validates a region for asynchronous Expose event generation More...
 
Region WBGetInvalidRegion (Window wID)
 'Paint' helper, returns a copy of the invalid region for a window More...
 
Region WBGetPaintRegion (Window wID)
 'Paint' helper, returns a copy of the current 'paint' region for the window More...
 
Region WBRectToRegion (const WB_RECT *pRect)
 'Paint' helper, converts a WB_RECT structure to a Region. More...
 
Region WBGeomToRegion (const WB_GEOM *pGeom)
 'Paint' helper, converts a WB_GEOM structure to a Region. More...
 
Region WBCopyRegion (Region rgnSource)
 Simple utility to copy a region. More...
 
void WBUpdateWindow (Window wID)
 'Paint' helper, generates an asynchronous Expose event for non-empty 'invalid' region More...
 
void WBUpdateWindowImmediately (Window wID)
 'Paint' helper, generates an immediate Expose event for non-empty 'invalid' region More...
 
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 More...
 
WBGC WBBeginPaintGeom (Window wID, WB_GEOM *pgBounds)
 'Paint' helper, creates a WBGC for use in updating the window for a specified rectangular area More...
 
void WBEndPaint (Window wID, WBGC gc)
 'Paint' helper, frees resources and marks the update region 'valid' More...
 
void WBClearWindow (Window wID, WBGC gc)
 'Paint' helper, erases background by painting the background color within the clipping region More...
 
static __inline__ void WBInvalidateRect (Window wID, const WB_RECT *pRCT, int bPaintFlag)
 'Paint' helper, invalidates a WB_RECT for asynchronous Expose event generation More...
 
static __inline__ void WBValidateRect (Window wID, WB_RECT *pRCT)
 'Paint' helper, validates a WB_RECT for asynchronous Expose event generation More...
 
WBGC WBCreateGC (Display *pDisplay, Drawable dw, unsigned long valuemask, const XGCValues *values)
 Creates a WBGC, wrapper for XCreateGC() More...
 
int WBChangeGC (WBGC hGC, unsigned long valuemask, const XGCValues *values)
 Change a WBGC, a wrapper for XChangeGC() More...
 
Status WBGetGCValues (WBGC hGC, unsigned long valuemask, XGCValues *values)
 Change a WBGC, a wrapper for XGetGCValues() More...
 
unsigned long WBGetGCBGColor (WBGC gc)
 returns the currently assigned background color for a WBGC More...
 
unsigned long WBGetGCFGColor (WBGC gc)
 returns the currently assigned foreground color for a WBGC More...
 
WB_FONTC WBQueryGCFont (WBGC gc)
 return the WB_FONTC object that was assigned to a WBGC More...
 
WB_FONT WBGetGCFont (Display *pDisplay, WBGC gc)
 return a copy of the WB_FONT object that was assigned to a WBGC More...
 
WBGC WBCopyGC (WBGC hGCOrig)
 makes a copy of a WBGC, a more sensible wrapper for XCopyGC() More...
 
int WBCopyGC2 (WBGC hGCOrig, unsigned long valuemask, WBGC hGCDest)
 makes a copy of a WBGC, a wrapper for XCopyGC() More...
 
WBGC WBCopyDrawableGC (Display *pDisplay, Drawable dw, WBGC hGCOrig)
 makes a copy of the specified WBGC for the desired 'Drawable' More...
 
void WBFreeGC (WBGC hGC)
 Free resources for a WBGC, wrapper for XFreeGC() More...
 
GContext WBGContextFromGC (WBGC hGC)
 Free resources for a WBGC, wrapper for XGContextFromGC() More...
 
int WBSetRegion (WBGC hGC, Region rgnClip)
 Assign clipping region, wrapper for XSetRegion() More...
 
int WBSetClipOrigin (WBGC hGC, int clip_x_origin, int clip_y_origin)
 Set clip origin, a wrapper for XSetClipOrigin() More...
 
int WBSetClipMask (WBGC hGC, Pixmap pixmap)
 Set clip mask, a wrapper for XSetClipMask() More...
 
int WBSetFunction (WBGC hGC, int function)
 Set the 'function' for the WBGC, a wrapper for XSetFunction() More...
 
static __inline__ unsigned long WBGetForeground (WBGC hGC)
 Get the (cached) foreground color for a WBGC. More...
 
int WBSetForeground (WBGC hGC, unsigned long foreground)
 Assign foreground color, a wrapper for XSetForeground() More...
 
static __inline__ unsigned long WBGetBackground (WBGC hGC)
 Get the (cached) background color for a WBGC. More...
 
int WBSetBackground (WBGC hGC, unsigned long background)
 Assign background color, a wrapper for XSetBackground() More...
 
int WBSetFont (WBGC hGC, WB_FONTC pFont)
 Assign font to a WBGC, a wrapper for XSetFont() More...
 
int WBSetFontNoCopy (WBGC hGC, WB_FONT pFont)
 Assign font to a WBGC, a wrapper for XSetFont() More...
 
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() More...
 
int WBSetDashes (WBGC hGC, int dash_offset, const char dash_list[], int n)
 Assign font to a WBGC, a wrapper for XSetFont() More...
 
XImage * WBGetWindowImage (Display *pDisplay, Window wID)
 Obtain an XImage for the entire window. More...
 
int WBAssignWindowImage (Display *pDisplay, Window wID, XImage *pImage)
 Assign an XImage for the entire window. More...
 
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. More...
 
void WBUpdateWindowWithImage (Display *pDisplay, Window wID)
 Update the window's appearance with the contents of the cached XImage. More...
 
int WBDrawPoint (Display *display, Drawable d, WBGC gc, int x, int y)
 Wrapper for XDrawPoint() More...
 
int WBDrawPoints (Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int mode)
 Wrapper for XDrawPoints() More...
 
int WBDrawLine (Display *display, Drawable d, WBGC gc, int x1, int y1, int x2, int y2)
 Wrapper for XDrawLines() More...
 
int WBDrawLines (Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int mode)
 Wrapper for XDrawLine() More...
 
int WBDrawRectangle (Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
 Wrapper for XDrawRectangle() More...
 
int WBFillRectangle (Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
 Wrapper for XFillRectangle() More...
 
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() More...
 
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() More...
 
int WBFillPolygon (Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int shape, int mode)
 Wrapper for XFillPolygon() More...
 
int WBDrawString (Display *display, Drawable d, WBGC gc, int x, int y, const char *string, int length)
 wrapper for XDrawString() More...
 
int CreateTimer (Display *pDisplay, Window wID, unsigned long lInterval, long lID, int iPeriodic)
 Creates a one-shot or periodic timer. More...
 
void DeleteTimer (Display *pDisplay, Window wID, long lID)
 Deletes an existing timer's resources. More...
 
static __inline__ void WBSupressErrorOutput (void)
 Supress X11 XErrorEvent output to stderr. More...
 
static __inline__ void WBAllowErrorOutput (void)
 Restore X11 XErrorEvent output to stderr. More...
 
void WBErrorClear (void)
 Clear the 'last error' information obtained via WBGetLastError() More...
 
int WBErrorCheck (void)
 Check to see whether or not an X11 error was detected. More...
 
int WBErrorCheckRetry (void)
 Check to see whether or not an X11 error was detected AND can be re-tried. More...
 
const WB_ERROR_INFOWBGetLastError (void)
 Obtain a const pointer to the internal WB_ERROR_INFO structure. More...
 

Variables

const char * sz_xcall_func
 debug helper variable tracking the function calling into the X11 library
 
int i_xcall_line
 debug helper variable indicating the line number of the function calling into the X11 library
 

Detailed Description

'window helper' main header file for the X11workbench Toolkit API

X11workbench Toolkit Toolkit API This file defines the main 'Window Helpers' including API initialization the main 'Event loop' window callback procedures upper level font management Expose and GC management Window context/state management X11 API 'wrapper' functions

Definition in file window_helper.h.