X11workbench Toolkit  1.0
window_helper.c File Reference

'window helper' main implementation file for the X11 Work Bench Toolkit API More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <limits.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/time.h>
#include <pthread.h>
#include <X11/cursorfont.h>
#include <X11/keysymdef.h>
#include "window_helper.h"
#include "pixmap_helper.h"
#include "conf_help.h"
#include <X11/Xproto.h>

Go to the source code of this file.

Data Structures

struct  s_internal_window_entry
 
struct  s_EVENT_ENTRY
 Core (internal) structure for storing and dispatching events. More...
 
struct  s_TIMER_ENTRY
 Core (internal) structure for managing timers. More...
 
struct  s_DELAYED_EVENT_ENTRY
 Core (internal) structure for managing delayed events. More...
 

Macros

#define XK_MISCELLANY   /* mostly for interix */
 
#define _WINDOW_HELPER_C_   /*this causes some header definitions to change slightly */
 
#define MIN_EVENT_LOOP_SLEEP_PERIOD   100 /* 0.1 millisec */
 
#define MAX_EVENT_LOOP_SLEEP_PERIOD   50000 /* 50 msecs - better for Linux within a VM - worst was 3.6% during idle */
 
#define WINDOW_ENTRY_ARRAY_SIZE   2048 /* must be a power of 2 and twice the max expected # of windows */
 
#define WINDOW_ENTRY_ARRAY_MAX   2047 /* must be the above value minus 1 */
 
#define WINDOW_ENTRY_HASH(X)
 
#define WINDOW_ENTRY_UNUSED   ((Window)-1)
 
#define WB_WINDOW_DELETE   -3 /* entry to be deleted during cleanup phase */
 
#define WB_WINDOW_DESTROYED   -2 /* window has been destroyed, entry remains */
 
#define WB_WINDOW_DESTROYING   -1 /* not destroyed yet - prevent recursion */
 
#define WB_WINDOW_UNMAPPED   0 /* window created, but not yet mapped */
 
#define WB_WINDOW_MAPPED   1 /* window mapped */
 
#define WB_WINDOW_SET_FOCUS_ON_MAP   2 /* focus is to be set when the window is mapped */
 
#define WB_WINDOW_DELETE_TIMEOUT   5 /* seconds to wait before deleting hash entry (was 30, now 5) */
 
#define WB_CHECK_SET_FOCUS_ON_MAP(X)   ((X).iWindowState == WB_WINDOW_SET_FOCUS_ON_MAP)
 
#define WB_IS_WINDOW_UNMAPPED(X)   ((X).iWindowState == WB_WINDOW_UNMAPPED || (X).iWindowState == WB_WINDOW_SET_FOCUS_ON_MAP)
 
#define WB_IS_WINDOW_MAPPED(X)   ((X).iWindowState == WB_WINDOW_MAPPED)
 
#define WB_IS_WINDOW_BEING_DESTROYED(X)   ((X).iWindowState == WB_WINDOW_DESTROYING)
 
#define WB_IS_WINDOW_DESTROYED(X)   ((X).iWindowState == WB_WINDOW_DESTROYED || (X).iWindowState == WB_WINDOW_DELETE)
 
#define WB_TO_DELETE_WINDOW_ENTRY(X)   ((X).iWindowState == WB_WINDOW_DELETE)
 
#define EVENT_ARRAY_SIZE   0x2000 /* this many events maximum */
 
#define EVENT_ARRAY_MASK   0x1fff /* 'and' this for modular math */
 
#define TIMER_ARRAY_SIZE   512
 
#define WBGetWindowEntry(X)   Debug_WBGetWindowEntry(X, __FUNCTION__, __LINE__)
 
#define MIN_STARTUP_DELAY   250000LL
 
#define WBInitSizeHints__max(X, Y)   ((X) > (Y) ? (X) : (Y))
 
#define WBGetWindowEntry(X)   Debug_WBGetWindowEntry(X, __FUNCTION__, __LINE__)
 
#define WB_IS_WINDOW_UNMAPPED(X)   ((X).iWindowState == WB_WINDOW_UNMAPPED || (X).iWindowState == WB_WINDOW_SET_FOCUS_ON_MAP)
 
#define WB_IS_WINDOW_MAPPED(X)   ((X).iWindowState == WB_WINDOW_MAPPED)
 
#define WB_IS_WINDOW_BEING_DESTROYED(X)   ((X).iWindowState == WB_WINDOW_DESTROYING)
 
#define WB_IS_WINDOW_DESTROYED(X)   ((X).iWindowState == WB_WINDOW_DESTROYED || (X).iWindowState == WB_WINDOW_DELETE)
 
#define EVENT_NAME_ENTRY(X)   { X, #X }
 
#define X_PROTO_ENTRY(X)   { X, #X },
 

Typedefs

typedef struct s_internal_window_entry _WINDOW_ENTRY_
 
typedef struct s_EVENT_ENTRY EVENT_ENTRY
 Core (internal) structure for storing and dispatching events.
 
typedef struct s_TIMER_ENTRY TIMER_ENTRY
 Core (internal) structure for managing timers.
 
typedef struct s_DELAYED_EVENT_ENTRY DELAYED_EVENT_ENTRY
 Core (internal) structure for managing delayed events.
 

Enumerations

enum  {
  MouseState_NONE = 0,
  MouseState_LCLICK = 1,
  MouseState_WAS_LCLICK,
  MouseState_LDRAG,
  MouseState_RCLICK,
  MouseState_WAS_RCLICK,
  MouseState_RDRAG,
  MouseState_CCLICK,
  MouseState_WAS_CCLICK,
  MouseState_CDRAG
}
 

Functions

static __inline__ _WINDOW_ENTRY_Debug_WBGetWindowEntry (Window wID, const char *szFunction, int nLine)
 
static void __WBInitEvent ()
 
static int __WBAddEvent (Display *pDisp, Window wID, XEvent *pEvent)
 
static void __WBDelWindowPaintEvents (Display *pDisp, Window wID)
 
static void __WBDelWindowEvents (Display *pDisp, Window wID)
 
static int __WBInsertPriorityEvent (Display *pDisp, Window wID, XEvent *pEvent)
 
static int __WBNextPaintEvent (Display *pDisp, XEvent *pEvent, Window wID)
 
static int __WBNextDisplayEvent (Display *pDisp, XEvent *pEvent)
 
static void WBInternalProcessExposeEvent (XExposeEvent *pEvent)
 
static int __internal_alloc_WMHints (_WINDOW_ENTRY_ *pEntry)
 
static Window __internal_GetParent (Display *pDisplay, Window wID, Window *pwRoot)
 
static const char * __internal_event_type_string (int iEventType)
 
static int __InternalCheckGetEvent (Display *pDisplay, XEvent *pEvent, Window wIDModal)
 
static void DeletAllTimersForWindow (Display *pDisplay, Window wID)
 
void __InternalDestroyWindow (Display *pDisp, Window wID, _WINDOW_ENTRY_ *pEntry)
 
static int WBXIOErrorHandler (Display *pDisp)
 
static int WBXErrorHandler (Display *pDisplay, XErrorEvent *pError)
 
void __internal_startup_display (const char *szVal)
 
void __internal_startup_minimize (void)
 
void __internal_startup_maximize (void)
 
void __internal_startup_geometry (const char *szVal)
 
void __internal_disable_imagecache (void)
 
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...
 
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...
 
void WBExit ()
 deletes any remaining global objects, frees the Display pointer, and terminates event processing 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...
 
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...
 
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...
 
int WBShowModal (Window wID, int bMenuSplashFlag)
 Shows a 'modal' window by processing events until the window closes. More...
 
void WBEndModal (Window wID, int iRval)
 End a modal window with a specific return value. More...
 
void WBSetInputFocus (Window wID)
 set input focus to a specific window More...
 
void WBDestroyWindow (Window wID)
 Destroy a window. More...
 
void WBRegisterAppCallback (WBAppEvent pCallback)
 Registers a callback function for application events. More...
 
void WBUnregisterAppCallback ()
 unregister callback function for application events More...
 
static __inline__ void InternalRestoreWindowDefaults (int iIndex)
 
static _WINDOW_ENTRY___AddOrLocateEntry (Window wID)
 
static void __WindowEntryRestoreDefaultResources (int iIndex)
 
static void __WindowEntryDestructor (int iIndex)
 
static void __PeriodicWindowEntryCleanup (void)
 
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 WBSetWMProperties (Window wID, const char *szTitle, XSizeHints *pNormalHints, XWMHints *pWMHints, XClassHint *pClassHints)
 assign standard WM (Window Manager) properties via XSetWMProperties More...
 
void WBSetWindowTitle (Window wID, const char *szTitle)
 assign window (and icon) title 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 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 wmProp, 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...
 
Window WBGetApplicationWindow (void)
 Get the main 'Application' window. More...
 
void WBSetApplicationWindow (Window wID)
 Assign the main 'Appklication' window. More...
 
int CreateTimer (Display *pDisplay, Window wID, unsigned long lInterval, long lID, int iPeriodic)
 Creates a one-shot or periodic timer. More...
 
static void __DeleteTimer (TIMER_ENTRY *pPrev, TIMER_ENTRY *pEntry)
 
void DeleteTimer (Display *pDisplay, Window wID, long lID)
 Deletes an existing timer's resources. More...
 
static int __CheckTimers (Display *pDisplay, XEvent *pEvent)
 
static void __CreateDelayedEvent (XEvent *pEvent, unsigned int uiInterval)
 
static void __DeleteDelayedEvent (DELAYED_EVENT_ENTRY *pPrev, DELAYED_EVENT_ENTRY *pEntry)
 
static int __attribute__ ((noinline))
 
static Bool __WBCheckIfEventPredicate (Display *pDisplay, XEvent *pEvent, XPointer arg)
 
static Bool __WBCheckIfEventPredicate0 (Display *pDisplay, XEvent *pEvent, XPointer arg)
 
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...
 
int WBAppDispatch (XEvent *pEvent)
 Dispatches an application XEvent. May be called directly. More...
 
void WBDispatch (XEvent *pEvent)
 Generic Event Dispatcher, using message type to dispatch. More...
 
int WBWindowDispatch (Window wID, XEvent *pEvent)
 Dispatches a window XEvent. May be called directly. More...
 
int WBAppDefault (XEvent *pEvent)
 implements the default application event callback behavior More...
 
int WBDefault (Window wID, XEvent *pEvent)
 implements the default window event callback behavior 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...
 
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...
 
int WBIsValid (Display *pDisplay, Window wID)
 returns non-zero if 'valid' (i.e. 'not destroyed') 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 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...
 
void WBSetWindowData (Window wID, int iIndex, void *pData)
 assign 'data pointer' for a window and specified index value More...
 
WBGC WBGetWindowDefaultGC (Window wID)
 Returns the default WBGC currently assigned to the window (not a copy) More...
 
WBGC WBGetWindowCopyGC (Window wID)
 makes a copy of the default WBGC so that it can be modified 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...
 
unsigned long WBGetGCFGColor (WBGC gc)
 returns the currently assigned foreground color for a WBGC More...
 
unsigned long WBGetGCBGColor (WBGC gc)
 returns the currently assigned background color for a WBGC More...
 
void WBDefaultStandardColormap (Display *pDisplay, XStandardColormap *pMap)
 returns a default XStandardColormap structure for the default screen of the specified display 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...
 
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...
 
static void __InternalSetWindowCursor (Window wID, int idCursor)
 
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 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...
 
void WBGetWindowGeom0 (Window wID, WB_GEOM *pGeom)
 Returns the ABSOLUTE window geometry relative to the screen. 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 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...
 
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...
 
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 WBRegisterMenuCallback (Window wID, WBWinEvent pMenuCallback)
 (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...
 
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...
 
void WBInvalidateGeom (Window wID, const WB_GEOM *pGeom, int bPaintNow)
 '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 WBCopyRegion (Region rgnSource)
 Simple utility to copy a region. 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...
 
WBGC WBBeginPaint (Window wID, XExposeEvent *pEvent, WB_GEOM *pgBounds)
 '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 WBClearWindow (Window wID, WBGC gc)
 'Paint' helper, erases background by painting the background color within the clipping region More...
 
void WBEndPaint (Window wID, WBGC gc)
 'Paint' helper, frees resources and marks the update region 'valid' 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 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...
 
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 WBPostPriorityEvent (Window wID, XEvent *pEvent)
 Places a copy of the specified event at the end of the priority (internal) event queue. 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 iDelay)
 Creates a 'set focus' ClientMessage event for the application event handler. More...
 
const char * WBEventName (int iEventID)
 debug function to return the name of an X11 event More...
 
void WBDebugDumpGC (Display *pDisplay, WBGC hGC)
 dumps a GC's settings More...
 
void WBDebugDumpEvent (XEvent *pEvent)
 dumps the contents of an XEvent More...
 
void WBDebugDumpRegion (Region hRgn, int bRotate)
 dumps contents of a region 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 = NULL
 debug helper variable tracking the function calling into the X11 library
 
int i_xcall_line = 0
 debug helper variable indicating the line number of the function calling into the X11 library
 
WB_FONT pDefaultFont = NULL
 
Display * pDefaultDisplay = NULL
 
int iStartupMinMax = 0
 
Atom aMENU_COMMAND
 commands sent by menus via ClientMessage More...
 
Atom aMENU_UI_COMMAND
 UI notifications sent by menus to owning Frame windows via ClientMessage using 'WBWindowDispatch'. More...
 
Atom aRESIZE_NOTIFY
 notification of window re-size via ClientMessage More...
 
Atom aDESTROY_NOTIFY
 notify parent that child is being destroyed More...
 
Atom aCONTROL_NOTIFY
 dialog control and child window notification messages More...
 
Atom aSCROLL_NOTIFY
 
Atom aQUERY_CLOSE
 query if it's ok to close (and optionally destroy yourself if ok) a window More...
 
Atom aRECALC_LAYOUT
 notify window that it should re-calculate things like scrollbars and viewports More...
 
Atom aDLG_FOCUS
 dialog focus messages More...
 
Atom aSET_FOCUS
 dialog focus messages More...
 
Atom aWB_CHAR
 keystroke/character notifications generated by API More...
 
Atom aWB_TIMER
 timer notifications generated by API More...
 
Atom aWB_POINTER
 pointer click/double-click/drag notifications generated by API More...
 
Atom aWM_PROTOCOLS
 WM supported protocols. More...
 
Atom aWM_DELETE_WINDOW
 Delete Window notification event. More...
 
Atom aWM_TAKE_FOCUS
 'Take Focus' - TODO document this properly More...
 
Atom aAVERAGE_WIDTH
 Atoms for fonts - Average Character Width. More...
 
Atom aCLIPBOARD
 CLIPBOARD Atom for the clipboard. More...
 
Atom aPRIMARY
 PRIMARY Atom for the clipboard - uses XA_PRIMARY. More...
 
Atom aSECONDARY
 SECONDARY Atom for the clipboard - uses XA_SECONDARY. More...
 
Atom aMANAGER
 MANAGER Atom for the clipboard. More...
 
Atom aTARGET
 TARGET Atom for the clipboard. More...
 
Atom aINCR
 INCR Atom for the clipboard. More...
 
Atom aWINDOW
 WINDOW Atom for the clipboard - uses XA_WINDOW. More...
 
Atom aBITMAP
 BITMAP Atom for the clipboard - uses XA_BITMAP. More...
 
Atom aDRAWABLE
 DRAWABLE Atom for the clipboard - uses XA_DRAWABLE. More...
 
Atom aCOLORMAP
 COLORMAP Atom for the clipboard - uses XA_COLORMAP. More...
 
Atom aPIXEL
 PIXEL Atom for the clipboard. More...
 
Atom aPIXMAP
 PIXMAP Atom for the clipboard - uses XA_PIXMAP. More...
 
Atom aTEXT
 TEXT Atom for the clipboard. More...
 
Atom aSTRING
 STRING Atom for the clipboard - uses XA_STRING. More...
 
Atom aUTF8_STRING
 UTF8_STRING Atom for the clipboard. More...
 
Atom aC_STRING
 C_STRING Atom for the clipboard. More...
 
Atom aCOMPOUND_TEXT
 COMPOUND_TEXT Atom for the clipboard. More...
 
Atom aTARGETS
 TARGETS Atom for the clipboard. More...
 
Atom aMULTIPLE
 MULTIPLE Atom for the clipboard. More...
 
Atom aTIMESTAMP
 TIMESTAMP Atom for the clipboard. More...
 
Atom aNULL
 NULL Atom for the clipboard. More...
 
static _WINDOW_ENTRY_ sWBHashEntries [WINDOW_ENTRY_ARRAY_SIZE] ={{0,0}}
 
static volatile int nWBHashEntries = 0
 
static Window wWBFakeWindow = 0
 
static Window wIDApplication = None
 
int bIgnoreXErrors = 0
 
static WB_ERROR_INFO xErrorInfo = {NULL, NULL, 0, 0, 0, 0, 0, None}
 
Time tmDefaultDisplay = 0
 
WB_UINT64 qwDefaultDisplayTick = 0LL
 
int bStandardColormap = 0
 
XStandardColormap cmapDefault
 
static EVENT_ENTRY axWBEvt [EVENT_ARRAY_SIZE]
 
static int iWBQueuedEvent = -1
 
static int iWBQueueLast = -1
 
static int iWBPaintEvent = -1
 
static int iWBPaintLast = -1
 
static int iWBFreeEvent = -1
 
static int iInitEventFlag = 0
 
static int(* pAppEventCallback )(XEvent *pEvent) = NULL
 
static TIMER_ENTRY axWBTimer [TIMER_ARRAY_SIZE]
 
static TIMER_ENTRYpTimerEntryActive = NULL
 
static TIMER_ENTRYpTimerEntryFree = NULL
 
static DELAYED_EVENT_ENTRY axWBDelayedEvent [TIMER_ARRAY_SIZE]
 
static DELAYED_EVENT_ENTRYpDelayedEventEntryActive = NULL
 
static DELAYED_EVENT_ENTRYpDelayedEventEntryFree = NULL
 
static int disable_imagecache = 0
 
static int(* pOldDisplayIOErrorHandler )(Display *) = NULL
 
static int hBogus [3]
 
static WB_GEOM geomStartup = {0,0,0,0,0}
 
static char szStartupDisplayName [512] =":0.0"
 
static char szDefaultDisplayName [512] = ""
 
static int iMouseState = 0
 
static int iMouseModShiftCtrl = 0
 
static int iMouseDragButtonState = 0
 
static WB_UINT64 tmMouse
 
static Window wMouseCapture = None
 
static int iMouseX = 0
 
static int iMouseY = 0
 
struct {
   int   iID
 
   const char *   szName
 
aIDName []
 
struct {
   int   iProto
 
   const char *   szProto
 
aXProto []
 

Detailed Description

'window helper' main implementation file for the X11 Work Bench Toolkit API

X11 Work Bench Toolkit Toolkit API This file implements 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.c.

Macro Definition Documentation

◆ WINDOW_ENTRY_HASH

#define WINDOW_ENTRY_HASH (   X)
Value:
(((((unsigned long)X & 0xf00) + \
(((unsigned long)X >> 3) & 0x1f) + \
(((unsigned long)X << 5) & 0xe0)) ^ \
((unsigned long)X >> 12)) & WINDOW_ENTRY_ARRAY_MAX)

Definition at line 808 of file window_helper.c.