71 #include <X11/keysymdef.h> 74 #define DIALOG_SUPPORT_C 77 #include "pixmap_helper.h" 80 #include "dialog_support.h" 82 #include "file_help.h" 89 #define THIS_SUBSYSTEM DebugSubSystem_DialogCtrl 94 #define INIT_ATOM(X) if(a##X == None){ a##X = WBGetAtom(WBGetDefaultDisplay(),X##_STR); } 95 #define INIT_ATOM2(X,Y) if(X == None){ X = WBGetAtom(WBGetDefaultDisplay(),Y); } 97 #define DEFAULT_LISTINFO_MAX 16384 473 INIT_ATOM(FRAME_CONTROL);
474 INIT_ATOM(TEXT_CONTROL);
475 INIT_ATOM(ICON_CONTROL);
476 INIT_ATOM(IMAGE_CONTROL);
477 INIT_ATOM(EDIT_CONTROL);
478 INIT_ATOM(PUSHBUTTON_CONTROL);
479 INIT_ATOM(DEFPUSHBUTTON_CONTROL);
480 INIT_ATOM(CANCELBUTTON_CONTROL);
481 INIT_ATOM(RADIOBUTTON_CONTROL);
482 INIT_ATOM(FIRSTRADIOBUTTON_CONTROL);
483 INIT_ATOM(CHECKBUTTON_CONTROL);
484 INIT_ATOM(TRISTATEBUTTON_CONTROL);
485 INIT_ATOM(HSCROLL_CONTROL);
486 INIT_ATOM(VSCROLL_CONTROL);
487 INIT_ATOM(SLIDER_CONTROL);
488 INIT_ATOM(KNOB_CONTROL);
489 INIT_ATOM(LIST_CONTROL);
490 INIT_ATOM(COMBO_CONTROL);
491 INIT_ATOM(TREE_CONTROL);
492 INIT_ATOM(COMBOTREE_CONTROL);
493 INIT_ATOM(FILE_LIST_CONTROL);
494 INIT_ATOM(FILE_COMBO_CONTROL);
495 INIT_ATOM(PATH_TREE_CONTROL);
496 INIT_ATOM(TAB_CONTROL);
539 char *szOldCaption = pCtrl->
pCaption;
566 Display *pDisplay = NULL;
595 XFreePixmap(pDisplay, pxOld);
599 XFreePixmap(pDisplay, pxOld2);
616 XFreePixmap(pDisplay, pxOld);
620 XFreePixmap(pDisplay, pxOld2);
650 Display *pDisplay = NULL;
679 XFreePixmap(pDisplay, pxOld);
683 XFreePixmap(pDisplay, pxOld2);
700 XFreePixmap(pDisplay, pxOld);
704 XFreePixmap(pDisplay, pxOld2);
744 if(!pCtrl || pCtrl->
wID == None)
749 XClientMessageEvent evt = {
760 evt.data.l[1] = iCheck;
767 if(!pCtrl || pCtrl->
wID == None)
772 XClientMessageEvent evt = {
841 return (
void *)(pP->
pVal);
849 #define INITIAL_PROPERTY_MAX 64 877 if(!pCtrl || !pPropVal)
887 if(!(pCtrl->
pPropList = __ConstructPropList()))
889 WB_ERROR_PRINT(
"%s - unable to allocate property list for window %d (%08xH)\n",
890 __FUNCTION__, (
int)pCtrl->
wID, (
int)pCtrl->
wID);
897 aProp = pPropVal->
aProp;
899 for(i1=0; i1 < pPropList->
nProps; i1++)
903 if(pProp0 && pProp0->
aProp == aProp)
914 int iNewSize = (pPropList->
nMaxProps + INITIAL_PROPERTY_MAX / 2)
916 +
sizeof(*pPropList);
921 WB_ERROR_PRINT(
"%s - unable to RE-allocate property list for window %d (%08xH)\n",
922 __FUNCTION__, (
int)pCtrl->
wID, (
int)pCtrl->
wID);
928 pPropList->
nMaxProps += INITIAL_PROPERTY_MAX / 2;
932 WB_ERROR_PRINT(
"%s - internal inconsistency, nProps=%d, nMaxProps=%d\n",
941 pProp->
aProp = aProp;
968 WB_DEBUG_PRINT(DebugLevel_Chatty | DebugSubSystem_DialogCtrl | DebugSubSystem_Dialog,
969 "%s - DLGC_PROP_NOTIFY (set) for window %d (%08xH)\n",
970 __FUNCTION__, (
int)pCtrl->
wID, (
int)pCtrl->
wID);
990 for(i1=0; i1 < pPropList->
nProps; i1++)
994 if(pProp && pProp->
aProp == aProp)
1014 for(i1++; i1 < pPropList->
nProps; i1++)
1039 WB_DEBUG_PRINT(DebugLevel_Chatty | DebugSubSystem_DialogCtrl | DebugSubSystem_Dialog,
1040 "%s - DLGC_PROP_NOTIFY (del) for window %d (%08xH)\n",
1041 __FUNCTION__, (
int)pCtrl->
wID, (
int)pCtrl->
wID);
1058 for(i1=0; i1 < pPropList->
nProps; i1++)
1062 if(pProp && pProp->
aProp == aProp)
1080 for(i1=0; i1 < pPropList->
nProps; i1++)
1099 for(i2=i1+1; i2 < pPropList->
nProps; i2++)
1107 WB_DEBUG_PRINT(DebugLevel_ERROR | DebugSubSystem_DialogCtrl | DebugSubSystem_Dialog,
1108 "%s - %d %d matching property name %d and value %p detected\n",
1109 __FUNCTION__, i1, i2, (
int)(pProp->
aProp), pProp->
pVal);
1112 pProp2->
pVal = NULL;
1120 bzero(pProp,
sizeof(*pProp));
1142 cbData = strlen((
const char *)pData) + 1;
1158 memcpy(pRval, pData, cbData);
1162 bzero(pRval, cbData);
1166 ((
char *)pRval)[cbData] = 0;
1173 void *(*pfnAllocator)(
const void *,
int),
void (*pfnDestructor)(
void *),
1175 int (*pfnSort)(
const void *,
const void *))
1188 pfnAllocator, pfnDestructor, pfnDisplay, NULL);
1192 WB_ERROR_PRINT(
"%s - DLGCListInfoConstructor returns NULL\n", __FUNCTION__);
1200 WB_ERROR_PRINT(
"%s - WBDialogControlSetDialogProp returns %d\n", __FUNCTION__, i1);
1208 int bAllocator,
void *(*pfnAllocator)(
const void *,
int),
1209 int bDestructor,
void (*pfnDestructor)(
void *),
1211 int bSort,
int (*pfnSort)(
const void *,
const void *))
1227 bDestructor ? pfnDestructor :
WBFree,
1228 bDisplay ? pfnDisplay : NULL,
1229 bSort ? pfnSort : NULL);
1232 memcpy(&propTemp, pProp,
sizeof(propTemp));
1236 WB_ERROR_PRINT(
"%s - DLGCListInfoConstructor returns NULL\n", __FUNCTION__);
1279 pLI->
pfnSort = (int (*)(
const void *,
const void *))strcmp;
1287 void *(*pfnAllocator)(
const void *,
int),
void (*pfnDestructor)(
void *),
1289 int (*pfnSort)(
const void *,
const void *))
1291 LISTINFO *pRval =
WBAlloc(
sizeof(*pRval) + nMax *
sizeof(
const void *));
1318 pRval->
pfnSort = (int (*)(
const void *,
const void *))strcmp;
1335 paData = pListInfo->
aItems;
1337 WB_DEBUG_PRINT(DebugLevel_Verbose | DebugSubSystem_DialogCtrl | DebugSubSystem_Dialog,
1338 "%s - destroying %d items using %p for %p\n",
1341 for(i1=0; i1 < pListInfo->
nItems; i1++)
1343 WB_DEBUG_PRINT(DebugLevel_Verbose | DebugSubSystem_DialogCtrl | DebugSubSystem_Dialog,
1344 "%s - destroying item %d, value = %p\n",
1345 __FUNCTION__, i1, paData[i1]);
1365 if(!pProp || !pProp->
pVal)
1374 iIndex = pListInfo->
nItems - 1;
1377 if(iIndex < 0 || iIndex >= pListInfo->
nItems)
1382 if(!(pListInfo->
aItems[iIndex]))
1387 return (
const char *)(pListInfo->
aItems[iIndex]);
1395 if(!pProp || !pProp->
pVal)
1404 iIndex = pListInfo->
nItems - 1;
1407 if(iIndex < 0 || iIndex >= pListInfo->
nItems)
1412 return pListInfo->
aItems[iIndex];
1418 const void *p1a = *((
const void *
const *)p1);
1419 const void *p2a = *((
const void *
const *)p2);
1424 return pListInfo->
pfnSort(p1a, p2a);
1427 return strcmp(p1a, p2a);
1438 if(!pProp || !pProp->
pVal)
1445 WB_ERROR_PRINT(
"%s - control does not support 'LISTINFO'\n", __FUNCTION__);
1462 WB_ERROR_PRINT(
"%s - unable to allocate 'LISTINFO'\n", __FUNCTION__);
1483 iIndex = pListInfo->
nItems - 1;
1485 else if(iIndex < 0 || iIndex >= pListInfo->
nItems)
1497 if((iIndex + 1) >= pListInfo->
nMaxItems)
1502 if(nItems <= 0x40000)
1511 i1 =
sizeof(*pListInfo)
1512 + nItems *
sizeof(pListInfo->
aItems[0]);
1520 WB_ERROR_PRINT(
"%s:%d %s - this should never happen\n", __FILE__, __LINE__, __FUNCTION__);
1541 pTemp = (
void *)pData;
1566 QSORT_R(pListInfo->
aItems, pListInfo->
nItems,
sizeof(
void *), pListInfo, _actual_sort_proc);
1570 if(iIndex < pListInfo->nItems)
1572 for(i1=pListInfo->
nItems; i1 >= iIndex; i1--)
1578 pListInfo->
aItems[iIndex] = (
void *)pTemp;
1607 if(!pProp || !pProp->
pVal)
1609 WB_WARN_PRINT(
"%s - unable to get LISTINFO for window %d (%08xH), pProp=%p\n", __FUNCTION__,
1610 (
int)pCtrl->
wID, (
int)pCtrl->
wID, pProp);
1618 iIndex = pListInfo->
nItems - 1;
1624 for(i1=0; i1 < pListInfo->
nItems; i1++)
1630 pListInfo->
aItems[0] = NULL;
1635 else if(iIndex < 0 || iIndex >= pListInfo->
nItems)
1648 for(i1=iIndex; i1 < pListInfo->
nItems; i1++)
1666 || (
unsigned char *)(pSel + 1) > (((
unsigned char *)pCtrl) + pCtrl->
cbStructSize))
1680 if(!pSel || !pProp || !pProp->
pVal)
1695 if(!pSel || !pProp || !pProp->
pVal)
1697 WB_WARN_PRINT(
"%s - unable to get LISTINFO or 'selection info' for window %d (%08xH), pSel=%p, pProp=%p\n", __FUNCTION__,
1698 (
int)pCtrl->
wID, (
int)pCtrl->
wID, pSel, pProp);
1710 else if((iIndex >= 0 && iIndex < pListInfo->nItems)
1717 WB_WARN_PRINT(
"%s - invalid index %d (nItems=%d)\n", __FUNCTION__, iIndex, pListInfo->
nItems);
1721 if(iOldIndex != pSel->
iCurSel)
1759 Window wID = pList->
wID;
1763 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_DialogCtrl,
1764 "%s - Expose %d (%08xH) pData=%p\n", __FUNCTION__, (
int)wID, (
int)wID, pData);
1779 WB_WARN_PRINT(
"%s - * BUG * line %d\n", __FUNCTION__, __LINE__);
1807 const char *szText = (
const char *)pData;
1810 rctBounds.
left = pGeom->
x + iHPos;
1811 rctBounds.
right = pGeom->
x + pGeom->
width - iHPos;
1812 rctBounds.
top = pGeom->
y;
1852 if(pEvent->type != ClientMessage)
1866 WB_ERROR_PRINT(
"TEMPORARY: %s mouse message %d (%08xH) %d %d %d %d %d\n",
1868 (
int)pEvent->xclient.window, (
int)pEvent->xclient.window,
1869 (
int)pEvent->xclient.data.l[0],
1870 (
int)pEvent->xclient.data.l[1],
1871 (
int)pEvent->xclient.data.l[2],
1872 (
int)pEvent->xclient.data.l[3],
1873 (
int)pEvent->xclient.data.l[4]);
1878 if(pScrollInfo && iRval)
1883 else if(pEvent->xclient.message_type ==
aWB_CHAR)
1887 long lKey = pEvent->xclient.data.l[0];
1888 long lAltCtrlShift = pEvent->xclient.data.l[1];
1890 int nChar = (int)pEvent->xclient.data.l[2];
1891 char *pBuf = (
char *)&(pEvent->xclient.data.l[3]);
1895 WB_ERROR_PRINT(
"TEMPORARY: %s char message %lx %ld %d %s\n", __FUNCTION__, lAltCtrlShift, lKey, nChar, pBuf);
1912 if(iShift || iCtrl || iAlt)
1922 if(iShift || iCtrl || iAlt)
1932 if(iShift || iCtrl || iAlt)
1942 if(iShift || iCtrl || iAlt)
2074 if(!pProp || !pProp->
pVal)
2078 WBDebugPrint(
"%s - control does not support 'LISTINFO'\n", __FUNCTION__);
2082 WBDebugPrint(
"%s - 'LISTINFO' is empty\n", __FUNCTION__);
2092 WBDebugPrint(
"%s - 'LISTINFO' is sorted\n", __FUNCTION__);
2097 for(i1=0; i1 < pListInfo->
nItems; i1++)
WBDialogPropList * pPropList
pointer to the property list (may be NULL)
Atom aLOSTFOCUS
CONTROL_NOTIFY ClientMessage for LOSTFOCUS event.
int iCurSel
current selection
Atom aDLGC_SCROLLINFO
dialog control SCROLLINFO property - see WB_SCROLLINFO structure
2nd parameter (direction) - up, left
'window helper' main header file for the X11workbench Toolkit API
void DLGCListInfoDestructor(LISTINFO *pListInfo)
Destroy a LISTINFO structure.
unsigned long ulFlags
generic flag bits
Atom aGOTFOCUS
CONTROL_NOTIFY ClientMessage for GOTFOCUS event.
Structure containing information about the current selection in a list.
Atom aDLGC_PROP_NOTIFY
DLGC_PROP_NOTIFY ClientMessage, notify control of property change.
Atom aDLGC_LISTINFO
dialog control LISTINFO property - see DLGInitControlListInfo() etc.
#define WB_DEBUG_PRINT(L,...)
Preferred method of implementing conditional debug output.
int nTop
scroll position of the top item currently displayed
void DLGDelControlListEntry(WBDialogControl *pCtrl, int iIndex)
Delete a list entry from a control's list info at a specified index (or deletes ALL entries)
Utilities for copying and drawing text, determining text extents, and so on.
Atom aDLGC_CONTROL_SET
CONTROL_SET ClientMessage - use this to set specific supported control properties by sending it to th...
this control supports a LISTINFO property.
Atom aPATH_TREE_CONTROL
Standard Dialog Control - path tree - directory hierarchy - see PATH_TREE_CONTROL_STR.
int WBFontAvgCharWidth(WB_FONTC pFont0)
Get the average character width for a font.
generic 'NA' or 'UNDEFINED' value
Atom aMOUSE_DBLCLICK
CONTROL_NOTIFY ClientMessage for MOUSE_DBLCLICK event.
int WBScrollBarEvent(Window wID, XEvent *pEvent, WB_SCROLLINFO *pScrollInfo)
Event handler for scroll bars.
Atom aLIST_NOTIFY
CONTROL_NOTIFY ClientMessage for LIST_NOTIFY event.
int nMaxItems
max size of aItems (must re-alloc to increase nMaxItems)
#define WB_KEYEVENT_ALT
'AltCtrlShift' bit flag for ALT modifier for WBKeyEventProcessKey()
void(* pfnDestructor)(void *)
destructor to call for each item that's removed
Static 'Image' control structure.
void DLGCDefaultListControlDisplayProc(WBDialogControl *pList, void *pData, int iSelected, WBGC gc, WB_GEOM *pGeom, WB_FONTC pFont)
The default 'display proc' for displaying a list item from a LISTINFO structure.
Atom aDLGC_CONTROL_GET
CONTROL_GET ClientMessage - use this to get specific supported control properties by sending it to th...
void DLGSetControlListSelection(WBDialogControl *pCtrl, int iIndex)
Assign the current selection index for a single-selection list.
Atom aKEY_DOWN
CONTROL_NOTIFY ClientMessage for KEY_DOWN event.
int WBWindowDispatch(Window wID, XEvent *pEvent)
Dispatches a window XEvent. May be called directly.
int DLGAddControlListEntry(WBDialogControl *pCtrl, const char *pData, long cbData, int iIndex)
Add a list entry to a control's list info.
int DLGInitControlListInfo(WBDialogControl *pCtrl, int nFlags, void *(*pfnAllocator)(const void *, int), void(*pfnDestructor)(void *), void(*pfnDisplay)(WBDialogControl *, void *, int, WBGC, WB_GEOM *, WB_FONTC), int(*pfnSort)(const void *, const void *))
Initialize the 'List Entry' for a control, specifying various callbacks and flags.
1st parameter (bar) - The vertical scroll bar for the control or window.
Atom aDLGC_PATH
dialog control PATH property, for file and directory controls
Atom aDEFPUSHBUTTON_CONTROL
Standard Dialog Control - default Pushbutton control (has dark border, accepts <ENTER> as hotkey) - s...
Atom aLIST_SELCHANGE
LIST_SELCHANGE ClientMessage, notify self of list selection change.
Atom aWB_CHAR
keystroke/character notifications generated by API
const void * DLGGetControlListData(WBDialogControl *pCtrl, int iIndex)
Retrieve the data pointer for a single list entry (listbox, combo, and tree controls only)
static __inline__ Display * WBGetDefaultDisplay(void)
Returns the default Display.
internal wrapper struct for X11 'geometry' definition
'configuration helper' main header file for the X11 Work Bench Toolkit API
void DTDrawSingleLineText(WB_FONTC pFont, const char *szText, Display *pDisplay, WBGC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
draw single-line text
void * WBReAlloc(void *pBuf, int nNewSize)
High performance memory sub-allocator 're-allocate'.
Atom aDIALOG_INIT
DIALOG_INIT ClientMessage, sent to dialog window callback on frame create.
int(* pfnSort)(const void *, const void *)
Optional sort comparison function. NULL implies 'strcmp'.
int WBSetForeground(WBGC hGC, unsigned long foreground)
Assign foreground color, a wrapper for XSetForeground()
int nPos
current scroll position
Atom aWB_POINTER
pointer click/double-click/drag notifications generated by API
Atom aClass
basic control class atom
Atom aMOUSE_CLICK
CONTROL_NOTIFY ClientMessage for MOUSE_CLICK event.
int nFlags
flags (sorted, etc.)
WB_FONTC WBQueryWindowFont(Window wID)
Returns the WB_FONT assigned to the window (may be NULL), not a copy.
Atom aLIST_CONTROL
Standard Dialog Control - list - single, multi, extended select (h, v, multicol) - see LIST_CONTROL_S...
void WBDialogControlDelDialogProp(WBDialogControl *pCtrl, Atom aProp)
Low-level dialog control property removal.
Atom aRADIOBUTTON_CONTROL
Standard Dialog Control - radio button - see RADIOBUTTON_CONTROL_STR.
int nItems
current number of valid entries in 'aItems'
const char * WBDialogControlGetProperty(WBDialogControl *pCtrl, Atom aPropName)
Mid-level dialog control property retrieval (character string)
Atom aSLIDER_CONTROL
Standard Dialog Control - volume control (slider bar) (h or v depending on geometry) - see SLIDER_CON...
void WBInvalidateGeom(Window wID, const WB_GEOM *pGeom, int bPaintNow)
'Paint' helper, invalidates a geometry for asynchronous Expose event generation
int nMaxProps
maximum number of available WB_DIALOG_PROP structures in aDlgProp
1st parameter (bar) - The horizontal scroll bar for the control or window
XColor clrBG
background color
void WBDialogControlSetIconPixmap(WBDialogControl *pCtrl, Pixmap pixmap, Pixmap pixmap2)
Assign the ICON (image) property for a control, which consists of 2 pixmaps.
unsigned long WBGetWindowFGColor(Window wID)
Returns the currently assigned foreground color.
void * pVal
pointer to data, as needed (may be allocated, some property types auto-free the data)
center using entire text height (ascent + descent for single line)
Atom aTAB_CONTROL
Standard Dialog Control -'tab' container (auto enable/disable contents) - see TAB_CONTROL_STR.
2nd parameter (direction) - bottom, end
Atom aTEXT_CONTROL
Standard Dialog Control - static text (single or multi-line) - see TEXT_CONTROL_STR.
Atom aDLGC_FONT
dialog control FONT property - reserved
void * WBAlloc(int nSize)
High performance memory sub-allocator 'allocate'.
#define END_XCALL_DEBUG_WRAPPER
wrapper macro for calls into the X11 library. This macro follows the call(s)
Pixmap WBDialogControlGetPixmap(WBDialogControl *pCtrl)
Obtain the assigned PIXMAP (image) property for a control.
int WBDialogControlSetDialogProp(WBDialogControl *pCtrl, WB_DIALOG_PROP *pPropVal)
Low-level dialog control property assignment.
XColor clrFG
foreground color
Atom aCOMBO_CONTROL
Standard Dialog Control - classic 'combo box' control - see COMBO_CONTROL_STR.
int DLGGetControlListSelectionBits(WBDialogControl *pCtrl, unsigned int *piBits, int nSize)
Query the selection state for multiple items within a control's list info.
#define WB_ERROR_PRINT(...)
Preferred method of implementing an 'error level' debug message for all subsystems.
Atom aDLGC_CAPTION
dialog control CAPTION property - see WBDialogControlGetCaption()
char * DLGGetControlListSelectionText(WBDialogControl *pCtrl)
Query the selection text as multiple strings in an allocated buffer.
Atom aFILE_COMBO_CONTROL
Standard Dialog Control - file combo control - see FILE_COMBO_CONTROL_STR.
int WBDialogControlSetPropList(WBDialogControl *pCtrl, const char *szPropList)
Mid-level dialog control property list assignment.
Atom aVSCROLL_CONTROL
Standard Dialog Control - vertical scroll - see VSCROLL_CONTROL_STR.
XColor clrHFG
highlighted state-based foreground color
Atom aDLGC_TEXT
dialog control TEXT property - see WBDialogControlGetText()
struct s_WB_DIALOG_PROPLIST WBDialogPropList
Dialog Property List, container for WB_DIALOG_PROP.
void WBFree(void *pBuf)
High performance memory sub-allocator 'free'.
Window wID
Window ID of the dialog control window.
XColor clrBD2
3D border color 2 (light)
2nd parameter (direction) - pgup, pgleft
#define WB_KEYEVENT_SHIFT
'AltCtrlShift' bit flag for Shift modifier for WBKeyEventProcessKey()
Atom aCOMBOTREE_CONTROL
Standard Dialog Control - 'combo tree' (tree with interlocked edit/text box like combo box) - see COM...
void *(* pfnAllocator)(const void *, int)
pointer to the copy constructor to call for each item that's added
void WBUpdateWindow(Window wID)
'Paint' helper, generates an asynchronous Expose event for non-empty 'invalid' region
Atom aEDIT_CONTROL
Standard Dialog Control - editable text (single or multi-line, scrollable, clipboard) - see EDIT_CONT...
void(* pfnDisplay)(WBDialogControl *pControl, void *pData, int iSelected, WBGC gcPaint, WB_GEOM *pGeom, WB_FONTC pFont)
display callback function to paint the entry on the display surface
int WBDialogControlGetCheck(WBDialogControl *pCtrl)
Retrieve the 'CHECKED' property from a dialog control. Returns '0' (un-checked) if not applicable.
unsigned long lVal
'long' data value, assigned as needed
A 'C++'-like object for managing text, that can be overridden for custom behavior.
Atom aKEYSTROKE
CONTROL_NOTIFY ClientMessage for KEYSTROKE event.
void WBDrawDashedRect(Display *pDisplay, Drawable wID, WBGC gc, WB_GEOM *pgeomRect, unsigned long lColor)
Draw a 'dashed' rectangle.
void DLGCDestroyProperties(WBDialogPropList *pPropList)
Destroy Properties for a dialog control.
Dialog property storage structure.
XColor clrHBG
highlighted state-based background color
void * WBDialogControlGetProperty2(WBDialogControl *pCtrl, Atom aPropName)
Mid-level dialog control property list retrieval (generic pointer)
Atom aCANCELBUTTON_CONTROL
Standard Dialog Control - cancel pushbutton control (accepts <ESC> as hotkey) - see CANCELBUTTON_CONT...
int nProps
current number of (contiguous) properties in 'aDlgProp'
Atom aHSCROLL_CONTROL
Standard Dialog Control - horizontal scroll - see HSCROLL_CONTROL_STR.
2nd parameter (direction) - home, top
Atom aCHECKBUTTON_CONTROL
Standard Dialog Control - check[box] button - push-on/push-off with 'check mark' (or whatever) - see ...
Atom aKEY_UP
CONTROL_NOTIFY ClientMessage for KEY_UP event.
Atom aMOUSE_DRAG
CONTROL_NOTIFY ClientMessage for MOUSE_DRAG event.
const char * WBDialogControlGetCaption(WBDialogControl *pCtrl)
Obtain a pointer to the assigned text for the 'CAPTION' property of a dialog control.
internal wrapper struct for 'rectangle' definition
int DLGModifyControlListInfo(WBDialogControl *pCtrl, int bFlags, int nFlags, int bAllocator, void *(*pfnAllocator)(const void *, int), int bDestructor, void(*pfnDestructor)(void *), int bDisplay, void(*pfnDisplay)(WBDialogControl *, void *, int, WBGC, WB_GEOM *, WB_FONTC), int bSort, int(*pfnSort)(const void *, const void *))
Modify the 'List Entry' for a control, specifying various callbacks and flags.
const WB_DIALOG_PROP * WBDialogControlGetDialogProp(WBDialogControl *pCtrl, Atom aProp)
Low-level dialog control property retrieval.
Atom aIMAGE_CONTROL
Standard Dialog Control - generic image/pixmap holder - see IMAGE_CONTROL_STR.
Atom aTEXTSELECT_CHANGE
CONTROL_NOTIFY ClientMessage for TEXTSELECT_CHANGE event.
char * pCaption
allocated pointer to caption, in lieu of using a WM_NAME property (may be NULL)
WB_DIALOG_PROP aDlgProp[1]
Pre-allocated array of (contiguous) structures for property storage.
Display * WBGetWindowDisplay(Window wID)
returns the Display associated with a window
void * aItems[1]
The array of item data, integrated into the memory block containing this structure.
int DLGGetControlListSelection(WBDialogControl *pCtrl)
Obtain the current selection index for a single-selection list.
void DLGSetControlListSelectionValue(WBDialogControl *pCtrl, int iIndex, int iSelState)
Assign the selection state for a specific index within a control's list info.
Atom aKNOB_CONTROL
Standard Dialog Control - "volume knob" (270 degrees of rotation, left to right) - see KNOB_CONTROL_S...
2nd parameter (direction) - pgdn, pgright
Atom aFIRSTRADIOBUTTON_CONTROL
Standard Dialog Control - 'first' radio button - defines start of radio button 'group' - see FIRSTRAD...
Atom aTREE_CONTROL
Standard Dialog Control - class 'tree' control - see TREE_CONTROL_STR.
Structure containing data for list-related dialog controls.
#define BEGIN_XCALL_DEBUG_WRAPPER
wrapper macro for calls into the X11 library. This macro precedes the call(s)
int nHeight
height (in items) of display area, recalculated on resize/expose
int DLGScrollBarHandler(Window wID, WBDialogControl *pCtrl, XEvent *pEvent)
Scroll bar event filter for dialog control callback function. Generates scroll events.
int WBFillRectangle(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
Wrapper for XFillRectangle()
Atom aBUTTON_PRESS
CONTROL_NOTIFY ClientMessage for BUTTON_PRESS event.
int WBSetBackground(WBGC hGC, unsigned long background)
Assign background color, a wrapper for XSetBackground()
void WBDebugPrint(const char *pFmt,...) __attribute__((format(printf
conditional debug message output
#define WB_KEYEVENT_CTRL
'AltCtrlShift' bit flag for Control modifier for WBKeyEventProcessKey()
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified...
Atom aICON_CONTROL
Standard Dialog Control - icon container (has a nice 3D border) - see ICON_CONTROL_STR.
Atom aTRISTATEBUTTON_CONTROL
Standard Dialog Control - tristate - like check, but with a third state - see TRISTATEBUTTON_CONTROL_...
static __inline__ void DLGNotifySelf(WBDialogControl *pDialogControl, Atom aNotify, long lData0, long lData1, long lData2, long lData3, long lData4)
Notify 'self' by calling the window's own callback function directly with an event.
char * WBCopyString(const char *pSrc)
A simple utility that returns a WBAlloc() copy of a 0-byte terminated string.
Atom aProp
Atom identifying the property.
Dialog Property List, container for WB_DIALOG_PROP.
Atom aFRAME_CONTROL
Standard Dialog Control - transparent frame with optional text - see FRAME_CONTROL_STR.
internal wrapper struct for GC with local cache
int WBDialogControlSetProperty(WBDialogControl *pCtrl, Atom aPropName, const char *szPropVal)
Mid-level dialog control property assignment (character string)
Atom aFILE_LIST_CONTROL
Standard Dialog Control - File List - see FILE_LIST_CONTROL_STR.
Pixmap WBDialogControlGetIconPixmap(WBDialogControl *pCtrl, Pixmap *pPixmap2)
Obtain the assigned ICON (image) property for a control, which consists of 2 pixmaps.
2nd parameter (direction) - down, right
void * DLGCDefaultListInfoAllocator(const void *pData, int cbData)
The default 'List Info' data allocator for a control's list info.
void WBDialogControlSetCheck(WBDialogControl *pCtrl, int iCheck)
Assign the TEXT property for a control, which is different from the CAPTION or Title.
Atom aPUSHBUTTON_CONTROL
Standard Dialog Control - Pushbutton control - see PUSHBUTTON_CONTROL_STR.
Window wOwner
owning window [to be notified on change]
void WBDialogControlsInit(void)
Initialization function for dialog controls.
void WBDialogControlSetPixmap(WBDialogControl *pCtrl, Pixmap pixmap)
Assign the PIXMAP (image) property for a control.
always insert at beginning
const char * DLGGetControlListText(WBDialogControl *pCtrl, int iIndex)
Retrieve the text poiner for a single list entry (listbox, combo, and tree controls only)
void WBDialogControlSetCaption(WBDialogControl *pCtrl, const char *szCaption)
Assign text to the 'CAPTION' property of a dialog control.
#define WB_WARN_PRINT(...)
Preferred method of implementing a 'warning level' debug message for all subsystems.
Structure identifying the properties of a dialog box control.
int cbStructSize
assigned at allocation time, the total size of this structure
LISTINFO * DLGCListInfoConstructor(Window wOwner, int nMax, int nFlags, void *(*pfnAllocator)(const void *, int), void(*pfnDestructor)(void *), void(*pfnDisplay)(WBDialogControl *, void *, int, WBGC, WB_GEOM *, WB_FONTC), int(*pfnSort)(const void *, const void *))
Create LISTINFO structure for a list type control.
void WBDialogControlSetProperty2(WBDialogControl *pCtrl, Atom aPropName, void *pPropVal)
Mid-level dialog control property list assignment (generic pointer)
Atom aTEXT_CHANGED
CONTROL_NOTIFY ClientMessage for TEXT_CHANGED event.
'checked' flag. when 'setting', -1 'toggles', 1 sets it, 0 clears it. when 'getting',...
static __inline__ WB_UINT64 WBGetDebugLevel(void)
Returns the current debug level assigned by WBSetDebugLevel.
#define WB_KEYEVENT_KEYSYM
'AltCtrlShift' bit flag for 'VK_' keys for WBKeyEventProcessKey()
WB_FONTC WBGetDefaultFont(void)
Returns a pointer to the default font WB_FONT for the default display. This is a shared resource; do ...