68 #include <X11/keysymdef.h> 72 #include "pixmap_helper.h" 76 #include "file_help.h" 80 #define THIS_SUBSYSTEM DebugSubSystem_Dialog 101 const char *szMessage;
104 static int GetMessageBoxIconPixmapID(
int iMBIconMask)
115 return ID_ICON_SPLAT;
119 return ID_ICON_WHAT_BOLD;
125 return ID_ICON_TRIANGLE;
127 return ID_ICON_DEATH;
129 return ID_ICON_SKULL;
131 return ID_ICON_THUMBUP;
133 return ID_ICON_THUMBDOWN;
135 return ID_ICON_FINGER;
139 return ID_ICON_BARNEY;
150 static int MessageBoxCallback(Window wID, XEvent *pEvent)
153 struct _MESSAGE_BOX_ *pUserData = (
struct _MESSAGE_BOX_ *)(pDlg ? pDlg->
pUserData : NULL);
159 if(pEvent->type == ClientMessage && pEvent->xclient.message_type ==
aDIALOG_INIT)
163 WB_ERROR_PRINT(
"MessageBoxCallback - no WBDialogWindow structure in DIALOG_INIT for %d (%08xH) %p %08xH %08xH\n",
176 Pixmap pixmap2 = None;
198 WB_WARN_PRINT(
"MessageBoxCallback - no WBDialogWindow structure\n");
202 if(pEvent->type == ClientMessage && pEvent->xclient.message_type ==
aCONTROL_NOTIFY)
204 WB_DEBUG_PRINT(DebugLevel_Light | DebugSubSystem_Event | DebugSubSystem_Dialog,
205 "%s - MessageBox ClientMessage CONTROL_NOTIFY\n", __FUNCTION__);
207 switch(pEvent->xclient.data.l[1])
218 WB_WARN_PRINT(
"%s - MessageBox ClientMessage CONTROL_NOTIFY client id=%lx\n",
219 __FUNCTION__, pEvent->xclient.data.l[1]);
231 int DLGMessageBox(
int iType, Window wIDOwner,
const char *szTitle,
const char *szMessage)
233 static const char szOKBox[]=
234 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 235 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 236 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 237 " CONTROL:DefPushButton ID:IDOK TITLE:OK X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 239 static const char szNoBox[]=
240 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 241 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 242 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 243 " CONTROL:DefPushButton ID:IDCANCEL TITLE:No X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 245 static const char szYesBox[]=
246 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 247 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 248 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 249 " CONTROL:DefPushButton ID:IDYES TITLE:Yes X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 251 static const char szCancelBox[]=
252 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 253 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 254 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 255 " CONTROL:DefPushButton ID:IDCANCEL TITLE:Cancel X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 257 static const char szAbortBox[]=
258 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 259 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 260 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 261 " CONTROL:DefPushButton ID:IDABORT TITLE:Abort X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 263 static const char szRetryBox[]=
264 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 265 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 266 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 267 " CONTROL:DefPushButton ID:IDRETRY TITLE:Retry X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 269 static const char szIgnoreBox[]=
270 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK Box\"\n" 271 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 272 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 273 " CONTROL:DefPushButton ID:IDIGNORE TITLE:Ignore X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 275 static const char szOKCancelBox[]=
276 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"OK/Cancel Box\"\n" 277 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 278 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 279 " CONTROL:DefPushButton ID:IDOK TITLE:OK X:40 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 280 " CONTROL:CancelButton ID:IDCANCEL TITLE:Cancel X:120 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 282 static const char szYesNoBox[]=
283 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"Yes/No Box\"\n" 284 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 285 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 286 " CONTROL:DefPushButton ID:IDYES TITLE:_Yes X:40 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 287 " CONTROL:CancelButton ID:IDNO TITLE:_No X:120 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 289 static const char szYesNoCancelBox[]=
290 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"Yes/No Box\"\n" 291 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 292 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 293 " CONTROL:DefPushButton ID:IDYES TITLE:_Yes X:20 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 294 " CONTROL:PushButton ID:IDNO TITLE:_No X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 295 " CONTROL:CancelButton ID:IDCANCEL TITLE:Cancel X:140 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 297 static const char szAbortRetryBox[]=
298 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"Yes/No Box\"\n" 299 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 300 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 301 " CONTROL:DefPushButton ID:IDABORT TITLE:_Abort X:40 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 302 " CONTROL:CancelButton ID:IDRETRY TITLE:_Retry X:120 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 304 static const char szAbortRetryIgnoreBox[]=
305 "BEGIN_DIALOG FONT:Variable HEIGHT:50 WIDTH:200 TITLE:\"Yes/No Box\"\n" 306 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 307 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 308 " CONTROL:DefPushButton ID:IDYES TITLE:_Abort X:20 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 309 " CONTROL:PushButton ID:IDRETRY TITLE:_Retry X:80 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 310 " CONTROL:CancelButton ID:IDIGNORE TITLE:_Ignore X:140 Y:28 WIDTH:40 HEIGHT:18 VISIBLE\n" 313 struct _MESSAGE_BOX_ mbox;
322 #define MESSAGE_BOX_WIDTH 400 323 #define MESSAGE_BOX_HEIGHT 100 324 #define MESSAGE_BOX_OFFSET 50 327 mbox.szTitle = szTitle;
328 mbox.szMessage = szMessage;
330 bzero(&geomParent,
sizeof(geomParent));
336 iX = geomParent.
x + geomParent.
border + MESSAGE_BOX_OFFSET;
337 iY = geomParent.
y + geomParent.
border + MESSAGE_BOX_OFFSET;
343 - MESSAGE_BOX_HEIGHT + MESSAGE_BOX_OFFSET - (int)(
WBGetTimeIndex() % (2 * MESSAGE_BOX_OFFSET)))
347 - MESSAGE_BOX_WIDTH + MESSAGE_BOX_OFFSET - (int)((~
WBGetTimeIndex()) % (2 * MESSAGE_BOX_OFFSET)))
382 pRes = szOKCancelBox;
390 pRes = szYesNoCancelBox;
394 pRes = szAbortRetryBox;
398 pRes = szAbortRetryIgnoreBox;
404 pRes = szAbortRetryIgnoreBox;
408 pRes = szYesNoCancelBox;
418 iX, iY, MESSAGE_BOX_WIDTH, MESSAGE_BOX_HEIGHT,
446 const char *szMessage;
451 static int InputBoxCallback(Window wID, XEvent *pEvent)
454 struct _INPUT_BOX_ *pUserData = (
struct _INPUT_BOX_ *)(pDlg ? pDlg->
pUserData : NULL);
460 if(pEvent->type == ClientMessage && pEvent->xclient.message_type ==
aDIALOG_INIT)
468 Pixmap pixmap2 = None;
482 if(pUserData->szRval)
490 if(pEvent->type == ClientMessage && pEvent->xclient.message_type ==
aCONTROL_NOTIFY)
492 WB_DEBUG_PRINT(DebugLevel_Light | DebugSubSystem_Event | DebugSubSystem_Dialog,
493 "%s - MessageBox ClientMessage CONTROL_NOTIFY\n", __FUNCTION__);
495 switch(pEvent->xclient.data.l[1])
503 if(pUserData->szRval)
505 WBFree(pUserData->szRval);
513 WB_ERROR_PRINT(
"TEMPORARY: %s - NULL 'pText' for edit control\n", __FUNCTION__);
514 pUserData->szRval = NULL;
522 WB_DEBUG_PRINT(DebugLevel_Light | DebugSubSystem_Event | DebugSubSystem_Dialog,
523 "%s - INPUT BOX 'EDIT' NOTIFICATION %ld\n",
524 __FUNCTION__, pEvent->xclient.data.l[0]);
530 WB_WARN_PRINT(
"%s - MessageBox ClientMessage CONTROL_NOTIFY client id=%lx\n",
531 __FUNCTION__, pEvent->xclient.data.l[0]);
538 #define INPUT_BOX_WIDTH 400 539 #define INPUT_BOX_HEIGHT 120 541 char *
DLGInputBox(Window wIDOwner,
const char *szTitle,
const char *szPrompt,
const char *szDefault,
542 int iWidth,
int iMaxChar)
544 static const char szInputDialogRes[]=
545 "BEGIN_DIALOG FONT:Variable HEIGHT:60 WIDTH:200 TITLE:\"User Input\"\n" 546 " CONTROL:Icon ID:1000 X:2 Y:2 HEIGHT:20 WIDTH:20 VISIBLE\n" 547 " CONTROL:Text ID:1001 X:24 Y:2 HEIGHT:20 WIDTH:172 VISIBLE HALIGN_TEXT_CENTER\n" 548 " CONTROL:Edit ID:1002 X:2 Y:22 WIDTH:196 HEIGHT:16 VISIBLE\n" 549 " CONTROL:DefPushButton ID:IDOK TITLE:OK X:40 Y:40 WIDTH:40 HEIGHT:18 VISIBLE\n" 550 " CONTROL:CancelButton ID:IDCANCEL TITLE:Cancel X:120 Y:40 WIDTH:40 HEIGHT:18 VISIBLE\n" 553 struct _INPUT_BOX_ sRval;
559 sRval.szTitle = szTitle;
560 sRval.szMessage = szPrompt;
561 if(szDefault && *szDefault)
570 bzero(&geomParent,
sizeof(geomParent));
576 iX = geomParent.
x + geomParent.
border + MESSAGE_BOX_OFFSET;
577 iY = geomParent.
y + geomParent.
border + MESSAGE_BOX_OFFSET;
583 - INPUT_BOX_HEIGHT + MESSAGE_BOX_OFFSET - (int)(
WBGetTimeIndex() % (2 * MESSAGE_BOX_OFFSET)))
587 - INPUT_BOX_WIDTH + MESSAGE_BOX_OFFSET - (int)((~
WBGetTimeIndex()) % (2 * MESSAGE_BOX_OFFSET)))
593 iX,iY,INPUT_BOX_WIDTH,INPUT_BOX_HEIGHT,
609 WB_ERROR_PRINT(
"TEMPORARY - %s - iRval is %d\n", __FUNCTION__, iRval);
631 const char *szDefPath;
632 const char *szDefName;
633 const char *szExtAndDescList;
638 #define FILE_DIALOG_PATH_TREE_CONTROL 1000 639 #define FILE_DIALOG_FILE_LIST_CONTROL 1001 640 #define FILE_DIALOG_FILE_NAME_CONTROL 1002 642 static int FileDialogCallback(Window wID, XEvent *pEvent)
645 struct _FILE_DIALOG_ *pUserData = (
struct _FILE_DIALOG_ *)(pDlg ? pDlg->
pUserData : NULL);
653 if(pEvent->type == ClientMessage && pEvent->xclient.message_type ==
aDIALOG_INIT)
655 if(!pUserData->szPathName || !*(pUserData->szPathName) ||
656 (!strchr(pUserData->szPathName,
'/') && !
WBIsDirectory(pUserData->szPathName)))
658 if(!pUserData->szDefPath || !*(pUserData->szDefPath))
675 WB_ERROR_PRINT(
"%s - no memory to copy path string (a)\n", __FUNCTION__);
679 p2 = strrchr(p1,
'/');
695 if(pEvent->type != ClientMessage)
707 switch(pEvent->xclient.data.l[1])
713 if(pEvent->xclient.data.l[1] ==
IDOK)
718 if(pUserData->szPathName)
720 WBFree(pUserData->szPathName);
723 if(pPath && pPath[0] ==
'/')
733 if(pUserData->szPathName && *pUserData->szPathName &&
734 pUserData->szPathName[strlen(pUserData->szPathName) - 1] !=
'/')
746 if(pUserData->szPathName && pPath)
752 if(pUserData->szPathName &&
753 (strstr(pUserData->szPathName,
"/../") ||
754 (strlen(pUserData->szPathName) > 3 &&
755 (!memcmp(pUserData->szPathName,
"../", 3) ||
756 !memcmp(pUserData->szPathName + strlen(pUserData->szPathName) - 3,
"/..", 3)))))
761 WBFree(pUserData->szPathName);
762 pUserData->szPathName = p1;
766 WB_ERROR_PRINT(
"ERROR - %s - Unable to get canonical path for \"%s\"\n", __FUNCTION__, pUserData->szPathName);
771 if(pUserData->szPathName && *pUserData->szPathName &&
772 (pUserData->szPathName[strlen(pUserData->szPathName) - 1] ==
'/' ||
WBIsDirectory(pUserData->szPathName)))
776 if(p1 && (!*p1 || p1[strlen(p1) - 1] !=
'/'))
783 WB_ERROR_PRINT(
"%s - no memory to copy path string (b)\n", __FUNCTION__);
809 case FILE_DIALOG_FILE_LIST_CONTROL:
815 if(pEvent->xclient.data.l[3] >= 0)
880 WB_WARN_PRINT(
"%s - LIST_NOTIFY WB_LIST_DBLCLICK control notification message %ld (%s) %ld (%08lxH), %ld (%08lxH)\n",
881 __FUNCTION__, pEvent->xclient.data.l[0], p1,
882 pEvent->xclient.data.l[1], pEvent->xclient.data.l[1],
883 pEvent->xclient.data.l[2], pEvent->xclient.data.l[2]);
905 WB_WARN_PRINT(
"%s - TODO: control notification message %ld (%s) %ld (%08lxH), %ld (%08lxH)\n",
906 __FUNCTION__, pEvent->xclient.data.l[0], p1,
907 pEvent->xclient.data.l[1], pEvent->xclient.data.l[1],
908 pEvent->xclient.data.l[2], pEvent->xclient.data.l[2]);
918 else if(pEvent->xclient.message_type ==
aGOTFOCUS)
923 else if(pEvent->xclient.message_type ==
aLOSTFOCUS)
934 WB_WARN_PRINT(
"%s - unhandled notification %s %ld (%s) %ld (%08lxH), %ld (%08lxH)\n",
936 pEvent->xclient.data.l[0], p2,
937 pEvent->xclient.data.l[1], pEvent->xclient.data.l[1],
938 pEvent->xclient.data.l[2], pEvent->xclient.data.l[2]);
954 #define FILE_DIALOG_WIDTH 520 955 #define FILE_DIALOG_HEIGHT 500 957 char *
DLGFileDialog(
int iType, Window wIDOwner,
const char *szDefPath,
const char *szDefName,
958 const char *szExtAndDescList)
960 static const char szFileDialogRes[]=
961 "BEGIN_DIALOG FONT:Variable HEIGHT:250 WIDTH:260 TITLE:\"File Dialog\"\n" 962 " CONTROL:PathTree ID:1000 X:2 Y:2 HEIGHT:200 WIDTH:116 VISIBLE\n" 963 " CONTROL:FileList ID:1001 X:122 Y:2 HEIGHT:200 WIDTH:136 VISIBLE\n" 964 " CONTROL:Edit ID:1002 X:2 Y:206 WIDTH:296 HEIGHT:16 VISIBLE\n" 965 " CONTROL:DefPushButton ID:IDOK TITLE:OK X:40 Y:230 WIDTH:40 HEIGHT:18 VISIBLE\n" 966 " CONTROL:CancelButton ID:IDCANCEL TITLE:Cancel X:180 Y:230 WIDTH:40 HEIGHT:18 VISIBLE\n" 969 struct _FILE_DIALOG_ data;
975 bzero(&geomParent,
sizeof(geomParent));
981 iX = geomParent.
x + geomParent.
border + MESSAGE_BOX_OFFSET;
982 iY = geomParent.
y + geomParent.
border + MESSAGE_BOX_OFFSET;
988 - FILE_DIALOG_HEIGHT + MESSAGE_BOX_OFFSET - (int)(
WBGetTimeIndex() % (2 * MESSAGE_BOX_OFFSET)))
992 - FILE_DIALOG_WIDTH + MESSAGE_BOX_OFFSET - (int)((~
WBGetTimeIndex()) % (2 * MESSAGE_BOX_OFFSET)))
996 data.szDefPath = szDefPath;
997 data.szDefName = szDefName;
998 data.szExtAndDescList = szExtAndDescList;
999 data.szPathName = NULL;
1003 iX, iY,FILE_DIALOG_WIDTH,FILE_DIALOG_HEIGHT,
1017 return data.szPathName;
1041 struct _COLOR_DIALOG_
1043 int iLuma, iChroma, iSaturation;
1044 int iRed, iGreen, iBlue;
1045 unsigned long lPixel;
1046 XStandardColormap stdColorMap;
1050 int iOldL, iOldC, iOldS, iOldR, iOldG, iOldB;
1051 unsigned long lOldP;
1055 int iXLumaSat, iYLumaSat, iXChroma, iOldXLS, iOldYLS, iOldXC;
1056 XImage *pimgLumaSat, *pimgChroma;
1057 Pixmap pixmapLumaSat, pixmapChroma;
1060 #define LUMA_SAT_PICKER 1001 1061 #define CHROMA_PICKER 1002 1062 #define LUMA_BOX 1003 1063 #define CHROMA_BOX 1004 1064 #define SAT_BOX 1005 1065 #define RED_BOX 1006 1066 #define GREEN_BOX 1007 1067 #define BLUE_BOX 1008 1068 #define COLORBOX 1009 1069 #define COLORBOX_VALUE 1010 1071 #define COLOR_IMAGE_SIZE 256 1072 #define CHROMA_RIBBON_HEIGHT 24 1073 #define COLOR_IMAGE_COLOR_FACTOR 1 1074 #define COLORBOX_PIXMAP_WIDTH 96 1075 #define COLORBOX_PIXMAP_HEIGHT 24 1077 #ifdef COMPILER_SUPPORTS_UNUSED_ATTRIBUTE 1079 static void ColorDialogDumpData(
const char *szCaption,
struct _COLOR_DIALOG_ *pData)
WB_UNUSED;
1080 #endif // COMPILER_SUPPORTS_UNUSED_ATTRIBUTE 1082 static void ColorDialogDumpData(
const char *szCaption,
struct _COLOR_DIALOG_ *pData)
1085 WBDebugPrint(
" iLuma=%-3d iChroma=%-3d iSaturation=%-3d\n",
1086 pData->iLuma, pData->iChroma, pData->iSaturation);
1088 pData->iRed, pData->iGreen, pData->iBlue);
1091 pData->iOldL, pData->iOldC, pData->iOldS);
1093 pData->iOldR, pData->iOldG, pData->iOldB);
1095 WBDebugPrint(
" lPixel = %-8lu \"#%-6.6lX\"\n", pData->lPixel, pData->lPixel);
1096 WBDebugPrint(
" lOldP = %-8lu \"#%-6.6lX\"\n\n", pData->lOldP, pData->lOldP);
1098 WBDebugPrint(
" iXLumaSat = %-3d iYLumaSat = %-3d iXChroma = %-3d\n" 1099 " iOldXLS = %-3d iOldYLS = %-3d iOldXC = %-3d\n\n",
1100 pData->iXLumaSat, pData->iYLumaSat, pData->iXChroma,
1101 pData->iOldXLS, pData->iOldYLS, pData->iOldXC);
1103 WBDebugPrint(
" pimgLumaSat = %p\n", pData->pimgLumaSat);
1107 (
unsigned long)pData->pimgLumaSat, (
unsigned long)pData->pimgLumaSat);
1109 (
unsigned long)pData->pimgChroma, (
unsigned long)pData->pimgChroma);
1110 WBDebugPrint(
"**********************************************************************\n");
1113 static XImage * CreateLumaSaturationImage(Display *pDisplay, XStandardColormap *pSCM,
int nChroma)
1115 int iR, iG, iB, iSat, iLum;
1120 0xffffffff, XYPixmap);
1137 for(iSat = COLOR_IMAGE_SIZE - 1; iSat >= 0; iSat--)
1139 for(iLum = 0; iLum < COLOR_IMAGE_SIZE; iLum++)
1144 iSat * COLOR_IMAGE_COLOR_FACTOR,
1145 iLum * COLOR_IMAGE_COLOR_FACTOR,
1153 XPutPixel(pImage, iLum, iSat, clr.pixel);
1160 static XImage * CreateChromaImage(Display *pDisplay, XStandardColormap *pSCM)
1162 int iR, iG, iB, iChroma, iRow;
1166 pImage =
WBXGetImage(pDisplay, None, 0, 0, COLOR_IMAGE_SIZE, CHROMA_RIBBON_HEIGHT,
1167 0xffffffff, XYPixmap);
1174 for(iChroma=0; iChroma < COLOR_IMAGE_SIZE; iChroma++)
1179 255, 255, &iR, &iG, &iB);
1185 for(iRow=0; iRow < CHROMA_RIBBON_HEIGHT; iRow++)
1187 XPutPixel(pImage, iChroma, iRow, clr.pixel);
1194 static void ColorDialogImagesFromData(Display *pDisplay,
WBDialogControl *pctrlLumaSat,
1203 static void ColorDialogDataFromPixel(
struct _COLOR_DIALOG_ *pUserData)
1207 clr.pixel = pUserData->lPixel;
1213 PXM_RGBToHSV(pUserData->iRed, pUserData->iGreen, pUserData->iBlue,
1214 &pUserData->iChroma,
1215 &pUserData->iSaturation,
1220 pUserData->iOldR = pUserData->iRed;
1221 pUserData->iOldG = pUserData->iGreen;
1222 pUserData->iOldB = pUserData->iBlue;
1224 pUserData->iOldC = pUserData->iChroma;
1225 pUserData->iOldL = pUserData->iLuma;
1226 pUserData->iOldS = pUserData->iSaturation;
1228 pUserData->lOldP = pUserData->lPixel;
1231 static int ColorDialogRGBFromHSV(
struct _COLOR_DIALOG_ *pUserData)
1236 PXM_HSVToRGB(pUserData->iChroma, pUserData->iSaturation, pUserData->iLuma,
1241 RGB255_TO_XCOLOR(pUserData->iRed, pUserData->iGreen, pUserData->iBlue, clr);
1244 pUserData->lPixel = clr.pixel;
1246 iRval = pUserData->lOldP != pUserData->lPixel ||
1247 pUserData->iOldR != pUserData->iRed ||
1248 pUserData->iOldG != pUserData->iGreen ||
1249 pUserData->iOldB != pUserData->iBlue ||
1250 pUserData->iOldC != pUserData->iChroma ||
1251 pUserData->iOldL != pUserData->iLuma ||
1252 pUserData->iOldS != pUserData->iSaturation;
1255 pUserData->iOldR = pUserData->iRed;
1256 pUserData->iOldG = pUserData->iGreen;
1257 pUserData->iOldB = pUserData->iBlue;
1259 pUserData->iOldC = pUserData->iChroma;
1260 pUserData->iOldL = pUserData->iLuma;
1261 pUserData->iOldS = pUserData->iSaturation;
1263 pUserData->lOldP = pUserData->lPixel;
1268 static int ColorDialogHSVFromRGB(
struct _COLOR_DIALOG_ *pUserData)
1273 PXM_RGBToHSV(pUserData->iRed, pUserData->iGreen, pUserData->iBlue,
1274 &pUserData->iChroma,
1275 &pUserData->iSaturation,
1278 RGB255_TO_XCOLOR(pUserData->iRed, pUserData->iGreen, pUserData->iBlue, clr);
1281 pUserData->lPixel = clr.pixel;
1283 iRval = pUserData->lOldP != pUserData->lPixel ||
1284 pUserData->iOldR != pUserData->iRed ||
1285 pUserData->iOldG != pUserData->iGreen ||
1286 pUserData->iOldB != pUserData->iBlue ||
1287 pUserData->iOldC != pUserData->iChroma ||
1288 pUserData->iOldL != pUserData->iLuma ||
1289 pUserData->iOldS != pUserData->iSaturation;
1292 pUserData->iOldR = pUserData->iRed;
1293 pUserData->iOldG = pUserData->iGreen;
1294 pUserData->iOldB = pUserData->iBlue;
1296 pUserData->iOldC = pUserData->iChroma;
1297 pUserData->iOldL = pUserData->iLuma;
1298 pUserData->iOldS = pUserData->iSaturation;
1300 pUserData->lOldP = pUserData->lPixel;
1305 static void ColorDialogAssignColorboxPixmap(Display *pDisplay,
WBDialogControl *pCtrl,
unsigned long lPixel)
1310 int iW = COLORBOX_PIXMAP_WIDTH;
1311 int iH = COLORBOX_PIXMAP_HEIGHT;
1329 bzero(&xgcv,
sizeof(xgcv));
1330 xgcv.foreground = lPixel;
1331 xgcv.background = lPixel;
1332 xgcv.line_width = 1;
1333 xgcv.function = GXcopy;
1334 xgcv.cap_style = CapProjecting;
1337 (GCForeground | GCBackground | GCCapStyle | GCFunction | GCLineWidth),
1342 WB_ERROR_PRINT(
"ERROR: %s - unable to create gc for pixmap\n", __FUNCTION__);
1351 pxTemp = XCreatePixmap(pDisplay, pCtrl->
wID, iW, iH,
1352 DefaultDepth(pDisplay, DefaultScreen(pDisplay)));
1356 WB_ERROR_PRINT(
"ERROR: %s - unable to create pixmap\n", __FUNCTION__);
1372 static void ColorDialogAssignLumaSatPixmap(Display *pDisplay,
WBDialogControl *pCtrl,
int iS,
int iV)
1376 static void ColorDialogAssignChromaPixmap(Display *pDisplay,
WBDialogControl *pCtrl,
int iH)
1380 static unsigned long ColorDialogGetPixelValueFromControl(
WBDialogControl *pCtrl)
1384 unsigned long lPixel;
1394 while(*p3 && *p3 <=
' ')
1400 sscanf(p3 + 1,
"%lX", &lPixel);
1402 else if(!strncasecmp(
"0x", p3, 2))
1404 sscanf(p3,
"%lX", &lPixel);
1408 sscanf(p3,
"%ld", &lPixel);
1411 lPixel &= 0xffffffff;
1418 static int ColorDialogCallback(Window wID, XEvent *pEvent)
1422 struct _COLOR_DIALOG_ *pUserData = (
struct _COLOR_DIALOG_ *)(pDlg ? pDlg->
pUserData : NULL);
1426 if(!pDlg || !pUserData)
1431 if(pEvent->type == ClientMessage && pEvent->xclient.message_type ==
aDIALOG_INIT)
1435 ColorDialogDataFromPixel(pUserData);
1438 if(pUserData->lPixel == 0)
1440 pUserData->iXLumaSat = 0;
1441 pUserData->iYLumaSat = 0;
1445 pUserData->iXLumaSat = (pUserData->iLuma + (COLOR_IMAGE_COLOR_FACTOR - 1))
1446 / COLOR_IMAGE_COLOR_FACTOR;
1447 pUserData->iYLumaSat = COLOR_IMAGE_SIZE
1448 - (pUserData->iSaturation + (COLOR_IMAGE_COLOR_FACTOR - 1))
1449 / COLOR_IMAGE_COLOR_FACTOR;
1452 pUserData->iXChroma = (pUserData->iChroma + (COLOR_IMAGE_COLOR_FACTOR - 1))
1453 / COLOR_IMAGE_COLOR_FACTOR;
1455 pUserData->iOldXLS = pUserData->iOldYLS = pUserData->iOldXC = -1;
1461 pUserData->iLuma, NULL);
1463 pUserData->iChroma, NULL);
1465 pUserData->iSaturation, NULL);
1468 pUserData->iRed, NULL);
1470 pUserData->iGreen, NULL);
1472 pUserData->iBlue, NULL);
1475 pUserData->lPixel,
"#%-08.8lX");
1481 pUserData->iSaturation, pUserData->iLuma);
1483 pUserData->iChroma);
1488 if(pEvent->type != ClientMessage)
1504 switch(pEvent->xclient.data.l[1])
1508 if(pEvent->xclient.data.l[1] ==
IDOK)
1516 if(pUserData->iRed != pUserData->iOldR ||
1517 pUserData->iGreen != pUserData->iOldG ||
1518 pUserData->iBlue != pUserData->iOldB)
1520 ColorDialogHSVFromRGB(pUserData);
1526 if(pUserData->lPixel != pUserData->lOldP)
1528 ColorDialogDataFromPixel(pUserData);
1536 if(pUserData->iLuma != pUserData->iOldL ||
1537 pUserData->iChroma != pUserData->iOldC ||
1538 pUserData->iSaturation != pUserData->iOldS)
1540 ColorDialogRGBFromHSV(pUserData);
1545 if(pUserData->pColor)
1547 pUserData->pColor->pixel = pUserData->lPixel;
1563 WB_LIKELY(pEvent->xclient.data.l[1] == LUMA_SAT_PICKER ||
1564 pEvent->xclient.data.l[1] == CHROMA_PICKER))
1569 WB_ERROR_PRINT(
"%s - TODO: control MOUSE notification message %ld (%s) %ld (%08lxH), %ld (%08lxH), %ld (%08lxH), %ld (%08lxH)\n",
1570 __FUNCTION__, pEvent->xclient.data.l[0], p1,
1571 pEvent->xclient.data.l[1], pEvent->xclient.data.l[1],
1572 pEvent->xclient.data.l[2], pEvent->xclient.data.l[2],
1573 pEvent->xclient.data.l[3], pEvent->xclient.data.l[3],
1574 pEvent->xclient.data.l[4], pEvent->xclient.data.l[4]);
1587 WB_WARN_PRINT(
"%s - TODO: control notification message %ld (%s) %ld (%08lxH), %ld (%08lxH)\n",
1588 __FUNCTION__, pEvent->xclient.data.l[0], p1,
1589 pEvent->xclient.data.l[1], pEvent->xclient.data.l[1],
1590 pEvent->xclient.data.l[2], pEvent->xclient.data.l[2]);
1599 else if(pEvent->xclient.message_type ==
aLOSTFOCUS)
1601 switch(pEvent->xclient.data.l[0])
1607 case COLORBOX_VALUE:
1610 if(pUserData->lPixel != pUserData->lOldP)
1612 WB_ERROR_PRINT(
"TEMPORARY: %s - Color Value Box Changed from %ld to %ld\n", __FUNCTION__, pUserData->lOldP, pUserData->lPixel);
1614 ColorDialogDataFromPixel(pUserData);
1616 goto fix_rgb_hsv_and_colors;
1621 case LUMA_SAT_PICKER:
1626 if(ColorDialogRGBFromHSV(pUserData))
1628 fix_rgb_hsv_and_colors:
1630 pUserData->iLuma, NULL);
1632 pUserData->iChroma, NULL);
1634 pUserData->iSaturation, NULL);
1637 pUserData->iRed, NULL);
1639 pUserData->iGreen, NULL);
1641 pUserData->iBlue, NULL);
1645 pUserData->lPixel,
"#%-08.8lX");
1649 if(pEvent->xclient.data.l[1] == COLORBOX_VALUE)
1652 pUserData->iSaturation, pUserData->iLuma);
1654 pUserData->iChroma);
1662 if(pUserData->iLuma != pUserData->iOldL)
1664 WB_ERROR_PRINT(
"TEMPORARY: %s - Luma Box Changed from %d to %d\n", __FUNCTION__, pUserData->iOldL, pUserData->iLuma);
1666 ColorDialogRGBFromHSV(pUserData);
1669 pUserData->iRed, NULL);
1671 pUserData->iGreen, NULL);
1673 pUserData->iBlue, NULL);
1676 pUserData->lPixel,
"#%-08.8lX");
1680 pUserData->iSaturation, pUserData->iLuma);
1682 pUserData->iChroma);
1689 if(pUserData->iChroma != pUserData->iOldC)
1691 WB_ERROR_PRINT(
"TEMPORARY: %s - Chroma Box Changed from %d to %d\n", __FUNCTION__, pUserData->iOldC, pUserData->iChroma);
1692 goto fix_rgb_and_colors;
1699 if(pUserData->iSaturation != pUserData->iOldS)
1701 WB_ERROR_PRINT(
"TEMPORARY: %s - Sat Box Changed from %d to %d\n", __FUNCTION__, pUserData->iOldS, pUserData->iSaturation);
1702 goto fix_rgb_and_colors;
1710 if(pUserData->iRed != pUserData->iOldR)
1712 WB_ERROR_PRINT(
"TEMPORARY: %s - Red Box Changed from %d to %d\n", __FUNCTION__, pUserData->iOldR, pUserData->iRed);
1714 ColorDialogHSVFromRGB(pUserData);
1717 pUserData->iLuma, NULL);
1719 pUserData->iChroma, NULL);
1721 pUserData->iSaturation, NULL);
1724 pUserData->lPixel,
"#%-08.8lX");
1728 pUserData->iSaturation, pUserData->iLuma);
1730 pUserData->iChroma);
1737 if(pUserData->iGreen != pUserData->iOldG)
1739 WB_ERROR_PRINT(
"TEMPORARY: %s - Green Box Changed from %d to %d\n", __FUNCTION__, pUserData->iOldG, pUserData->iGreen);
1740 goto fix_hsv_and_colors;
1747 if(pUserData->iBlue != pUserData->iOldB)
1749 WB_ERROR_PRINT(
"TEMPORARY: %s - Blue Box Changed from %d to %d\n", __FUNCTION__, pUserData->iOldB, pUserData->iBlue);
1750 goto fix_hsv_and_colors;
1757 else if(pEvent->xclient.message_type ==
aGOTFOCUS)
1785 WB_WARN_PRINT(
"%s - unhandled ClientMessage %d (%s) %ld (%s) %ld (%08lxH), %ld (%08lxH)\n",
1786 __FUNCTION__, (
int)pEvent->xclient.message_type, (
const char *)(p1 ? p1 :
"(Null)"),
1787 pEvent->xclient.data.l[0], (
const char *)(p2 ? p2 :
"(Null)"),
1788 pEvent->xclient.data.l[1], pEvent->xclient.data.l[1],
1789 pEvent->xclient.data.l[2], pEvent->xclient.data.l[2]);
1805 #define COLOR_DIALOG_WIDTH 560 1806 #define COLOR_DIALOG_HEIGHT 364 1810 static const char szColorDialogRes[]=
1811 "BEGIN_DIALOG FONT:Variable HEIGHT:182 WIDTH:280 TITLE:\"Color Chooser\"\n" 1814 " CONTROL:Image ID:1009 X:150 Y:120 WIDTH:50 HEIGHT:14 VISIBLE\n" 1815 " CONTROL:Text TITLE:\"Value:\" X:200 Y:122 WIDTH:24 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1816 " CONTROL:Edit ID:1010 X:228 Y:122 WIDTH:40 HEIGHT:10 VISIBLE\n" 1819 " CONTROL:DefPushButton ID:IDOK TITLE:OK X:60 Y:160 WIDTH:40 HEIGHT:18 VISIBLE\n" 1820 " CONTROL:CancelButton ID:IDCANCEL TITLE:Cancel X:180 Y:160 WIDTH:40 HEIGHT:18 VISIBLE\n" 1823 " CONTROL:Image ID:1001 X:2 Y:2 HEIGHT:132 WIDTH:132 VISIBLE CLICKABLE\n" 1824 " CONTROL:Image ID:1002 X:2 Y:136 HEIGHT:16 WIDTH:132 VISIBLE CLICKABLE\n" 1827 " CONTROL:Text TITLE:\"Lum:\" X:140 Y:22 WIDTH:22 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1828 " CONTROL:Edit ID:1003 X:164 Y:22 WIDTH:28 HEIGHT:10 VISIBLE\n" 1829 " CONTROL:Text TITLE:\"Chr:\" X:140 Y:44 WIDTH:22 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1830 " CONTROL:Edit ID:1004 X:164 Y:44 WIDTH:28 HEIGHT:10 VISIBLE\n" 1831 " CONTROL:Text TITLE:\"Sat:\" X:140 Y:66 WIDTH:22 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1832 " CONTROL:Edit ID:1005 X:164 Y:66 WIDTH:28 HEIGHT:10 VISIBLE\n" 1834 " CONTROL:Text TITLE:\"Red:\" X:210 Y:22 WIDTH:22 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1835 " CONTROL:Edit ID:1006 X:234 Y:22 WIDTH:28 HEIGHT:10 VISIBLE\n" 1836 " CONTROL:Text TITLE:\"Grn:\" X:210 Y:44 WIDTH:22 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1837 " CONTROL:Edit ID:1007 X:234 Y:44 WIDTH:28 HEIGHT:10 VISIBLE\n" 1838 " CONTROL:Text TITLE:\"Blu:\" X:210 Y:66 WIDTH:22 HEIGHT:10 NOBORDER VISIBLE VALIGN_TEXT_CENTER HALIGN_TEXT_RIGHT\n" 1839 " CONTROL:Edit ID:1008 X:234 Y:66 WIDTH:28 HEIGHT:10 VISIBLE\n" 1844 struct _COLOR_DIALOG_ data;
1864 memset(&data, 0,
sizeof(data));
1868 memcpy(&(data.stdColorMap), pColorMap,
sizeof(data.stdColorMap));
1875 bzero(&geomParent,
sizeof(geomParent));
1877 if(wIDOwner != None)
1881 iX = geomParent.
x + geomParent.
border + MESSAGE_BOX_OFFSET;
1882 iY = geomParent.
y + geomParent.
border + MESSAGE_BOX_OFFSET;
1888 - MESSAGE_BOX_HEIGHT + MESSAGE_BOX_OFFSET - (int)(
WBGetTimeIndex() % (2 * MESSAGE_BOX_OFFSET)))
1892 - MESSAGE_BOX_WIDTH + MESSAGE_BOX_OFFSET - (int)((~
WBGetTimeIndex()) % (2 * MESSAGE_BOX_OFFSET)))
1896 data.pColor = pColor;
1897 data.pimgLumaSat = NULL;
1898 data.pimgChroma = NULL;
1899 data.pixmapLumaSat = None;
1900 data.pixmapChroma = None;
1902 data.lPixel = pColor->pixel;
1907 100,100,300,100,ColorDialogCallback,
1953 typedef struct _SPLASH_
1955 Pixmap pixmap, pixmap2;
1963 XStandardColormap cmap;
1966 unsigned long cbImageData;
1967 unsigned long clrText, clrBlack, clrWhite;
1970 static int splash_callback(Window wID, XEvent *pEvent);
1971 static int SplashDoExposeEvent(XExposeEvent *pEvent, Display *pDisplay,
1972 Window wID,
struct _SPLASH_ *pData);
1974 #define SPLASH_FRAMERATE 30 1975 #define SPLASH_TIME 1500 1980 XSetWindowAttributes xswa;
1987 unsigned int ai1[3];
1990 bzero(&data,
sizeof(data));
1991 bzero(&xattr,
sizeof(xattr));
1994 aXPM, &(data.pixmap), &(data.pixmap2), &xattr))
2000 iW = xattr.
width + 4;
2002 data.iDepth = xattr.
depth;
2008 if(!iW || !iH || data.pixmap == None)
2011 __FUNCTION__, iW, iH, (
int)data.pixmap, (
int)data.pixmap);
2029 data.clrText = clrText;
2032 data.iW = xattr.
width;
2037 data.pImageData = NULL;
2038 data.cbImageData = 0;
2040 bzero(&xswa,
sizeof(xswa));
2042 xswa.border_pixel = data.clrBlack;
2043 xswa.background_pixel = data.clrWhite;
2045 xswa.bit_gravity = CenterGravity;
2048 splash_callback,
"Splash",
2051 CWBorderPixel | CWBackPixel | CWColormap | CWBitGravity | CWOverrideRedirect,
2062 bzero(&xsh,
sizeof(xsh));
2064 xsh.flags = (USPosition | USSize | PBaseSize | PMinSize | PMaxSize | PWinGravity);
2067 xsh.width = xsh.base_width = xsh.min_width = xsh.max_width = iW;
2068 xsh.height = xsh.base_height = xsh.min_height = xsh.max_height = iH;
2069 xsh.win_gravity = NorthWestGravity;
2071 bzero(&xwmh,
sizeof(xwmh));
2072 xwmh.flags = InputHint;
2081 XChangeProperty(
WBGetDefaultDisplay(), wID, a1, XA_ATOM, 32, PropModeReplace, (
unsigned char *)ai1, 1);
2088 XChangeProperty(
WBGetDefaultDisplay(), wID, a1, XA_ATOM, 32, PropModeReplace, (
unsigned char *)ai1, 3);
2106 if(data.szCopyright)
2108 WBFree((
void *)data.szCopyright);
2122 if(data.pixmap != None)
2128 if(data.pixmap2 != None)
2131 data.pixmap2 = None;
2141 static int splash_callback(Window wID, XEvent *pEvent)
2147 if(pData && pEvent->type == Expose)
2149 return SplashDoExposeEvent((XExposeEvent *)pEvent, pDisplay, wID, pData);
2152 if(pEvent->type == ClientMessage &&
2153 pEvent->xclient.message_type ==
aWB_TIMER)
2165 if(pData->nIter * 1000 >= SPLASH_FRAMERATE * (SPLASH_TIME + 1000))
2180 if(pEvent->type == DestroyNotify &&
2181 pEvent->xdestroywindow.window == wID)
2183 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_DialogCtrl,
2184 "%s - DestroyNotify\n", __FUNCTION__);
2194 static int SplashDoExposeEvent(XExposeEvent *pEvent, Display *pDisplay,
2195 Window wID,
struct _SPLASH_ *pData)
2202 int iX, iY, iTimeStart, iTimeEnd;
2212 if(pData->pFont == NULL && pData->szCopyright && *(pData->szCopyright))
2215 pData->szCopyright, &geomText);
2222 pData->pFont = pFont;
2226 pFont = pData->pFont;
2229 bzero(&xgcv,
sizeof(xgcv));
2235 xgcv.foreground = pData->clrText;
2236 xgcv.background = pData->clrWhite;
2237 xgcv.line_width = 1;
2238 xgcv.function = GXcopy;
2239 xgcv.cap_style = CapProjecting;
2242 (GCForeground | GCBackground | GCCapStyle | GCFunction | GCLineWidth),
2247 WB_WARN_PRINT(
"%s - * BUG * line %d\n", __FUNCTION__, __LINE__);
2255 pData->geomBorder.x = pData->geomBorder.y = 0;
2264 if(pData->pixmap2 != None)
2266 pxTemp = pData->pixmap2;
2271 pxTemp = XCreatePixmap(pDisplay, wID, pData->iW + 4, pData->iH + 4,
2272 DefaultDepth(pDisplay, DefaultScreen(pDisplay)));
2277 WB_ERROR_PRINT(
"%s - * BUG * line %d\n", __FUNCTION__, __LINE__);
2283 if(pData->pixmap != None)
2286 XCopyArea(pDisplay, pData->pixmap, pxTemp, gc->
gc,
2287 0, 0, pData->iW, pData->iH,
2288 pData->geomBorder.x + 2, pData->geomBorder.y + 2);
2298 xgcv.line_width = 3;
2299 xgcv.function = GXcopy;
2300 xgcv.cap_style = CapProjecting;
2302 WBChangeGC(gc, GCCapStyle | GCFunction | GCLineWidth, &xgcv);
2304 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, 0,0, pData->iW + 3, 0);
2305 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, pData->iW + 3, 0, pData->iW + 3, pData->iH + 3);
2306 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, pData->iW + 3, pData->iH + 3, 0, pData->iH + 3);
2307 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, 0, pData->iH + 3, 0, 0);
2309 pData->pixmap2 = pxTemp;
2314 pxTemp = XCreatePixmap(pDisplay, wID, pData->iW + 4, pData->iH + 4,
2315 DefaultDepth(pDisplay, DefaultScreen(pDisplay)));
2320 WB_ERROR_PRINT(
"%s - * BUG * line %d\n", __FUNCTION__, __LINE__);
2325 pData->pixmap2 = None;
2331 if(pData->pixmap != None)
2336 pData->pixmap = pData->pixmap2;
2337 pData->pixmap2 = pxTemp;
2341 XCopyArea(pDisplay, pData->pixmap, pxTemp, gc->
gc,
2342 0, 0, pData->iW + 4, pData->iH + 4, 0, 0);
2346 if(pData->nIter <= 1)
2352 XClearWindow(pDisplay, wID);
2355 else if(pData->nIter == SPLASH_FRAMERATE / 2)
2357 geomText.
x = pData->geomBorder.x + 2;
2358 geomText.
y = pData->geomBorder.y + 2;
2359 geomText.
width = pData->geomBorder.width - 4;
2360 geomText.
height = pData->geomBorder.height - 4;
2362 geomText.
y += (geomText.
height * 2) / 3;
2370 rctBounds.
left = geomText.
x;
2371 rctBounds.
top = geomText.
y;
2378 p1 = pData->szCopyright;
2379 p2 = strchr(p1,
'\n');
2388 iX = geomText.
x + (geomText.
width - XTextWidth(pFont, p1, strlen(p1))) / 2;
2392 WBDrawString(pDisplay, pxTemp ? pxTemp : wID, gc, iX, iY, p1, strlen(p1));
2396 iX = geomText.
x + (geomText.
width - XTextWidth(pFont, p1, strlen(p1))) / 2;
2400 WBDrawString(pDisplay, pxTemp ? pxTemp : wID, gc, iX, iY, p1, strlen(p1));
2402 iX = geomText.
x + (geomText.
width - XTextWidth(pFont, p2, strlen(p2))) / 2;
2405 WBDrawString(pDisplay, pxTemp ? pxTemp : wID, gc, iX, iY, p2, strlen(p2));
2416 fprintf(stderr,
"NO FONT, iter=%d\n", pData->nIter);
2422 XCopyArea(pDisplay, pData->pixmap, pxTemp, gc->
gc,
2423 0, 0, pData->iW + 4, pData->iH + 4, 0, 0);
2428 pData->pImage =
WBXGetImage(pDisplay, pxTemp, 0, 0, pData->iW + 4, pData->iH + 4,
2429 0xffffffff, XYPixmap);
2434 if(pData->nIter >= SPLASH_FRAMERATE / 2)
2436 iTimeStart = 1250 * SPLASH_FRAMERATE;
2437 iTimeEnd = (SPLASH_TIME + 1000) * SPLASH_FRAMERATE
2438 - 500 * SPLASH_FRAMERATE;
2440 if(iTimeStart + 1000 * SPLASH_FRAMERATE / 2 > iTimeEnd)
2442 iTimeStart = iTimeEnd - SPLASH_FRAMERATE / 2;
2448 if(pData->nIter * 1000 > iTimeEnd)
2452 WBXPutImage(pDisplay, pData->pixmap2, gc, pData->pImage, 0, 0, 0, 0, pData->iW + 4, pData->iH + 4);
2455 pData->pImage = NULL;
2458 else if(pData->nIter * 1000 >= iTimeStart && pData->nIter * 1000 <= iTimeEnd)
2460 int iDelta = iTimeEnd - iTimeStart + 1;
2464 iTemp = pData->nIter * 1000L - iTimeStart;
2465 iTemp = (int)(((
long long)iTemp * (
long long)iTemp) / (iTimeEnd - iTimeStart));
2468 iX = 2 * (pData->iW * iTemp / iDelta + pData->iW / (2 * iDelta) / 1000);
2469 iY = 2 * (pData->iH * iTemp / iDelta + pData->iH / (2 * iDelta) / 1000);
2475 pData->pImage =
WBXGetImage(pDisplay, pData->pixmap2, 0, 0, pData->iW + 4, pData->iH + 4,
2482 if(pI && !pData->pImageData)
2494 pData->pImageData =
WBAlloc(pData->cbImageData + 4);
2496 if(pData->pImageData)
2508 #if defined(GLEAM_OLD) 2509 #define GLEAM_WIDTH 10 2510 static int aLuma[GLEAM_WIDTH + 1] = { 255, 249, 231, 202, 167, 128, 88, 53, 24, 6, 0 };
2511 #elif defined(GLEAM_NARROW) 2512 #define GLEAM_WIDTH 17 2513 static int aLuma[GLEAM_WIDTH + 1] = { 255, 202, 161, 128, 101, 80, 64, 51, 40,
2514 32, 25, 20, 16, 13, 10, 8, 6, 5 };
2516 #define GLEAM_WIDTH 29 2517 static int aLuma[GLEAM_WIDTH + 1] = { 255,225,198,175,154,136,120,106,93,82,72,64,
2518 56,50,44,39,34,30,26,23,21,18,16,14,12,11,10,8,7,7 };
2519 #endif // GLEAM_OLD, GLEAM_NARROW 2521 int iX0, iY0, iX1, i1, i2, iW, iL, iMaxX, iMaxY;
2537 for(iX0 = -GLEAM_WIDTH, iY0 = iY + GLEAM_WIDTH; iX0 < iMaxX + GLEAM_WIDTH && iY0 > -GLEAM_WIDTH; iX0++)
2539 i1 = (int)(((iX - iX0) * (
long long)iMaxY) / iMaxX);
2543 for(; iY0 > i1; iY0--)
2546 i2 = iX0 + GLEAM_WIDTH;
2547 for(iX1=iX0 - GLEAM_WIDTH, iW = -GLEAM_WIDTH; iX1 <= i2; iX1++, iW++)
2552 if(iX1 > 2 && iX1 < iMaxX &&
2553 iY0 > 2 && iY0 < iMaxY)
2555 XColor clrTemp, clrPixel;
2556 int iY, iU, iV, iR, iG, iB;
2558 clrPixel.pixel = XGetPixel(pI, iX1 + 2, iY0 + 2);
2561 PXM_RGBToYUV(clrPixel.red >> 8, clrPixel.green >> 8, clrPixel.blue >> 8,
2564 iL = aLuma[abs(iW)];
2571 iY = ((short)iY * ((
short)256 + (short)iL)) / (
short)256;
2575 iU = (short)128 + (((
short)iU - (short)128) * (short)256) / (short)iY;
2576 iV = (short)128 + (((
short)iV - (short)128) * (short)256) / (short)iY;
2582 clrTemp.red = iR << 8;
2583 clrTemp.green = iG << 8;
2584 clrTemp.blue = iB << 8;
2585 clrTemp.flags = DoRed | DoGreen | DoBlue;
2589 XPutPixel(pI, iX1 + 2, iY0 + 2, clrTemp.pixel);
2600 WBXPutImage(pDisplay, pData->pixmap2, gc, pI, 0, 0, 0, 0, pData->iW + 4, pData->iH + 4);
2608 if(pData->pImageData)
2616 pData->pImage = NULL;
2626 XSetForeground(pDisplay, gc, pData->clrWhite & 0x404040);
2628 xgcv.line_width = 19;
2629 xgcv.function = GXor;
2630 xgcv.cap_style = CapProjecting;
2632 XChangeGC(pDisplay, gc, GCCapStyle | GCFunction | GCLineWidth, &xgcv);
2636 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, -2, iY, iX, -2);
2640 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, iX, pData->iH + 4, pData->iW + 4, iY);
2643 XSetForeground(pDisplay, gc, pData->clrWhite & 0x808080);
2645 xgcv.line_width = 11;
2646 xgcv.function = GXor;
2647 xgcv.cap_style = CapProjecting;
2649 XChangeGC(pDisplay, gc, GCCapStyle | GCFunction | GCLineWidth, &xgcv);
2653 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, -2, iY, iX, -2);
2657 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, iX, pData->iH + 4, pData->iW + 4, iY);
2660 XSetForeground(pDisplay, gc, pData->clrWhite & 0xc0c0c0);
2662 xgcv.line_width = 5;
2663 xgcv.function = GXor;
2664 xgcv.cap_style = CapProjecting;
2666 XChangeGC(pDisplay, gc, GCCapStyle | GCFunction | GCLineWidth, &xgcv);
2670 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, -2, iY, iX, -2);
2674 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, iX, pData->iH + 4, pData->iW + 4, iY);
2677 XSetForeground(pDisplay, gc, pData->clrWhite);
2679 xgcv.line_width = 1;
2680 xgcv.function = GXcopy;
2681 xgcv.cap_style = CapProjecting;
2683 XChangeGC(pDisplay, gc, GCCapStyle | GCFunction | GCLineWidth, &xgcv);
2687 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, -2, iY, iX, -2);
2691 WBDrawLine(pDisplay, pxTemp ? pxTemp : wID, gc, iX, pData->iH + 4, pData->iW + 4, iY);
2699 XCopyArea(pDisplay, pxTemp, wID, gc->
gc, 0, 0, pData->iW + 4, pData->iH + 4, pData->geomBorder.x, pData->geomBorder.y);
Icon - multiple question marks in red triangle.
Atom aLOSTFOCUS
CONTROL_NOTIFY ClientMessage for LOSTFOCUS event.
void WBSetWMProperties(Window wID, const char *szTitle, XSizeHints *pNormalHints, XWMHints *pWMHints, XClassHint *pClassHints)
assign standard WM (Window Manager) properties via XSetWMProperties
Pixmap PXM_GetIconPixmap(int idIcon, XPM_ATTRIBUTES *pAttr, Pixmap *pMask)
Create Icon pixmap pair using pre-defined resource ID.
void PXM_RGBToYUV(int iR, int iG, int iB, int *piY, int *piU, int *piV)
Convert R, G, B values to Y, U, V with 0-255 range.
int WBChangeGC(WBGC hGC, unsigned long valuemask, const XGCValues *values)
Change a WBGC, a wrapper for XChangeGC()
'window helper' main header file for the X11workbench Toolkit API
#define WB_LIST_SELCHANGE
static __inline__ const char * DLGGetControlProperty(WBDialogWindow *pDialog, int iControlID, Atom aPropName)
Convenience function to query a text property for a dialog control based on its control ID.
Atom aGOTFOCUS
CONTROL_NOTIFY ClientMessage for GOTFOCUS event.
int WBDrawLine(Display *display, Drawable d, WBGC gc, int x1, int y1, int x2, int y2)
Wrapper for XDrawLines()
static __inline__ unsigned long PXM_GetImageDataLength(XImage *pImage)
Returns the length of XImage data.
void WBFreeFont(Display *pDisplay, WB_FONT pFont)
free a WB_FONT that was created using one of the WBFont APIs
#define WB_DEBUG_PRINT(L,...)
Preferred method of implementing conditional debug output.
void * WBGetWindowData(Window wID, int iIndex)
Gets the data associated with this window and the specified index.
int WBFontHeight(WB_FONTC pFont0)
Get the maximum character height from a WB_FONT.
int WBFontAscent(WB_FONTC pFont0)
Get the maximum character ascent from a WB_FONT.
void WBDefaultStandardColormap(Display *pDisplay, XStandardColormap *pMap)
returns a default XStandardColormap structure for the default screen of the specified display
Utilities for copying and drawing text, determining text extents, and so on.
Icon - black question mark in yellow triangle.
int WBUnmapWindow(Display *pDisplay, Window wID)
wrapper for XUnmapWindow, makes window invisible without destroying it
Icon - white skull and crossbones on black square.
static __inline__ void DLGNotifyDlg(WBDialogWindow *pDLG, Atom aNotify, long lData0, long lData1, long lData2, long lData3, long lData4)
Notify dialog window by calling the window's own callback function directly with an event.
Icon - white question mark in green triangle.
Atom aMOUSE_DBLCLICK
CONTROL_NOTIFY ClientMessage for MOUSE_DBLCLICK event.
void WBCreateWindowDefaultGC(Window wID, unsigned long clrFG, unsigned long clrBG)
creates a default WBGC for a window
static __inline__ WBDialogControl * DLGGetDialogControlStructFromID(WBDialogWindow *pDialog, int iControlID)
Returns a pointer to the WBDialogControl structure for a dialog control with validation....
Button Bits - Cancel button.
void PXM_YUVToRGB(int iY, int iU, int iV, int *piR, int *piG, int *piB)
Convert Y, U, V values to R, G, B with 0-255 range.
Atom aLIST_NOTIFY
CONTROL_NOTIFY ClientMessage for LIST_NOTIFY event.
WB_FONT WBCopyFont(Display *pDisplay, WB_FONTC pOldFont)
make a copy of an existing font (best when assigning to a window)
int WBShowModal(Window wID, int bMenuSplashFlag)
Shows a 'modal' window by processing events until the window closes.
int DLGColorDialog(Window wIDOwner, XStandardColormap *pColorMap, XColor *pColor)
Display a modal Color Dialog window, returning the selected color in the XColor structure pointed to ...
void WBGetWindowGeom0(Window wID, WB_GEOM *pGeom)
Returns the ABSOLUTE window geometry relative to the screen.
char * DLGInputBox(Window wIDOwner, const char *szTitle, const char *szPrompt, const char *szDefault, int iWidth, int iMaxChar)
Displays a special purpose dialog window that retrieves a character string as input.
Icon - white asterisk on blue circle.
Compatibility structure for use with MyLoadPixmapFromData() whenever libXpm is not in use.
Atom aDLGC_PATH
dialog control PATH property, for file and directory controls
int WBXPutImage(Display *pDisplay, Drawable dw, WBGC gc, XImage *pImage, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)
Write contents of an XImage onto a Drawable.
Icon - yellow triangle (nothing else)
WB_FONT DTCalcIdealFont(Display *pDisplay, WB_FONTC pRefFont, const char *szText, WB_GEOM *geomBounds)
Calculate the ideal font based on the text and rectangle.
horizontally centered text. tabs are treated as white space
void * pUserData
user data that's assignable via API
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 PXM_RGBToPixel(XStandardColormap *pMap, XColor *pColor)
Icon Registration for application 'large' and 'small' icons.
#define RGB255_TO_XCOLOR(R, G, B, X)
Simple RGB assignment to pixel, 0-255 RGB.
int width
The width of the returned pixmaps.
static __inline__ void DLGSetControlCaption(WBDialogWindow *pDialog, int iControlID, const char *szCaption)
Convenience function to assign a dialog control's caption based on its control ID.
Button Bits - Yes button.
void PXM_PixelToRGB(XStandardColormap *pMap, XColor *pColor)
Convert the pixel menber of an XColor to RGB.
Atom aDIALOG_INIT
DIALOG_INIT ClientMessage, sent to dialog window callback on frame create.
int WBDrawString(Display *display, Drawable d, WBGC gc, int x, int y, const char *string, int length)
wrapper for XDrawString()
Icon - white fright mask on black circle.
WBDialogWindow * DLGCreateDialogWindow(Window wIDOwner, const char *szTitle, const char *szDialogResource, int iX, int iY, int iWidth, int iHeight, WBWinEvent pUserCallback, int iFlags, void *pUserData)
create a dialog window using a text resource
Atom aMOUSE_CLICK
CONTROL_NOTIFY ClientMessage for MOUSE_CLICK event.
Structure identifying a dialog (frame) window.
static __inline__ int DLGSetControlProperty(WBDialogWindow *pDialog, int iControlID, Atom aPropName, const char *szPropVal)
Convenience function to assign a text property for a dialog control based on its control ID.
Icon - white thumb up on green square.
void DeleteTimer(Display *pDisplay, Window wID, long lID)
Deletes an existing timer's resources.
#define RGB255_FROM_XCOLOR(X, R, G, B)
Simple RGB assignment from pixel, 0-255 RGB.
void WBInvalidateGeom(Window wID, const WB_GEOM *pGeom, int bPaintNow)
'Paint' helper, invalidates a geometry for asynchronous Expose event generation
#define DIALOG_WINDOW_TAG
Icon - white 'middle finger' on red triangle.
void WBDialogControlSetIconPixmap(WBDialogControl *pCtrl, Pixmap pixmap, Pixmap pixmap2)
Assign the ICON (image) property for a control, which consists of 2 pixmaps.
static __inline__ void WBDialogControlInvalidateGeom(WBDialogControl *pDialogControl, const WB_GEOM *pGeom, int bPaintFlag)
Convenience function, invalidates a Geom for a dialog box control.
static __inline__ void DLGNotifyDlgAsync(WBDialogWindow *pDLG, Atom aNotify, long lData0, long lData1, long lData2, long lData3, long lData4)
Notify dialog window by posting an event that will ASYNCHRONOUSLY be sent to the dialog window's call...
center using entire text height (ascent + descent for single line)
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)
Window DLGGetDialogControl(WBDialogWindow *pDialog, int iControlID)
returns the Window ID of a member control of the dialog window using the 'control ID'
static __inline__ void * PXM_GetImageDataPtr(XImage *pImage)
Returns pointer to XImage data.
void WBValidateGeom(Window wID, const WB_GEOM *pGeom)
'Paint' helper, validates a geometry for asynchronous Expose event generation
void DLGSplashScreen(char *aXPM[], const char *szCopyright, unsigned long clrText)
Display a splash screen for 5 seconds (with animation and copyright string), and then return.
#define WB_ERROR_PRINT(...)
Preferred method of implementing an 'error level' debug message for all subsystems.
Window WBGetHiddenHelperWindow(void)
Returns a special 'hidden' window used for information purposes.
int WBIsDirectory(const char *szFileName)
Return whether a file is a directory or a symlink to a directory.
void WBFree(void *pBuf)
High performance memory sub-allocator 'free'.
Window wID
Window ID of the dialog control window.
void WBDestroyWindow(Window wID)
Destroy a window.
Button Bits - Retry button.
WBGC WBCreateGC(Display *pDisplay, Drawable dw, unsigned long valuemask, const XGCValues *values)
Creates a WBGC, wrapper for XCreateGC()
Icon - brown and tan teddy bear on grey circle.
static __inline__ int WBDialogControlGetCaptionInt(WBDialogControl *pCtrl)
Returns an integer from the text of the 'CAPTION' property of a dialog control.
void WBSetWindowIcon(Window wID, int idIcon)
assigns an icon resource (by ID) to a window
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.
#define WB_STANDARD_INPUT_MASK
'Standard' input mask, bit flag for window creation
XImage * WBXGetImage(Display *pDisplay, Drawable dw, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format)
Read contents of a Drawable onto an XImage.
void PXM_RGBToHSV(int iR, int iG, int iB, int *piH, int *piS, int *piV)
Convert R, G, B values to H, S, V with 0-255 range.
static __inline__ const char * DLGGetControlCaption(WBDialogWindow *pDialog, int iControlID)
Convenience function to query a dialog control's caption based on its control ID.
int WBXDestroyImage(XImage *pImage)
Destroy an XImage - call this instead of XDestroyImage()
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
Icon - purple T-Rex head on white circle (more like mozilla)
int WBFontDescent(WB_FONTC pFont0)
Get the maximum character descent from a WB_FONT.
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()
Button Bits - Ignore button.
static __inline__ WBDialogWindow * DLGGetDialogWindowStruct(Window wID)
Returns a pointer to the dialog window's WBDialogWindow structure.
WB_FONT DLGFontDialog(Display *pDisplay, Window wIDOwner, WB_FONTC pDefault)
Display a modal Font Dialog window, returning the selected font in the XColor structure pointed to by...
void WBSetWindowData(Window wID, int iIndex, void *pData)
assign 'data pointer' for a window and specified index value
static __inline__ void WBDialogControlSetCaptionLong(WBDialogControl *pCtrl, long lValue, const char *szFormat)
Assign a long integer as text to the 'CAPTION' property of a dialog control.
int depth
depth of the returned 'image' pixmap. The mask pixmap always has a depth of '1'.
char * WBGetCanonicalPath(const char *szFileName)
Return the canonical path for a file name (similar to POSIX 'realpath()' funtion)
#define BEGIN_XCALL_DEBUG_WRAPPER
wrapper macro for calls into the X11 library. This macro precedes the call(s)
int WBFillRectangle(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
Wrapper for XFillRectangle()
Icon - application icon (from icon_app.xpm)
void WBGetWindowGeom(Window wID, WB_GEOM *pGeom)
Returns the RAW geometry of the window as reported by the window manager.
Atom aBUTTON_PRESS
CONTROL_NOTIFY ClientMessage for BUTTON_PRESS event.
void WBDebugPrint(const char *pFmt,...) __attribute__((format(printf
conditional debug message output
Icon - exclamation point on yellow triangle.
Atom aWB_TIMER
timer notifications generated by API
void DTDrawMultiLineText(WB_FONTC pFont, const char *szText, Display *pDisplay, WBGC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
draw multi-line text
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified...
char * DLGFileDialog(int iType, Window wIDOwner, const char *szDefPath, const char *szDefName, const char *szExtAndDescList)
Display a modal File Dialog window, returning a WBAlloc'd pointer to a null-byte terminated string co...
int CreateTimer(Display *pDisplay, Window wID, unsigned long lInterval, long lID, int iPeriodic)
Creates a one-shot or periodic timer.
void WBEndModal(Window wID, int iRval)
End a modal window with a specific return value.
char * WBCopyString(const char *pSrc)
A simple utility that returns a WBAlloc() copy of a 0-byte terminated string.
#define XPM_CREATE_PIXMAP_FROM_DATA(A, B, C, D, E, F)
Platform helper macro to create a pixmap from data.
internal wrapper struct for GC with local cache
void PXM_HSVToRGB(int iH, int iS, int iV, int *piR, int *piG, int *piB)
Convert H, S, V values to R, G, B with 0-255 range.
Icon - white thumb down on red square.
int WBMapWindow(Display *pDisplay, Window wID)
Wrapper for XMapWindow, makes window visible.
Window wID
window ID of the dialog (frame) window
Button Bits - Abort button.
void WBDialogControlSetPixmap(WBDialogControl *pCtrl, Pixmap pixmap)
Assign the PIXMAP (image) property for a control.
static __inline__ WBDialogControl * WBGetDialogEntryControlStruct(WBDialogWindow *pDialog, int iControlID)
Returns a pointer to the WBDialogControl structure for a dialog control based on its ID and containin...
const char * DLGGetControlListText(WBDialogControl *pCtrl, int iIndex)
Retrieve the text poiner for a single list entry (listbox, combo, and tree controls only)
static __inline__ void WBDialogControlSetCaptionInt(WBDialogControl *pCtrl, int iValue, const char *szFormat)
Assign an integer as text to the 'CAPTION' property of a dialog control.
int height
height of the returned pixmaps
#define WB_WARN_PRINT(...)
Preferred method of implementing a 'warning level' debug message for all subsystems.
static __inline__ WBDialogControl * DLGGetDialogControlStruct(Window wID)
Returns a pointer to the WBDialogControl structure for a dialog control with validation....
Structure identifying the properties of a dialog box control.
Icon - yellow circle with white exclamation point.
int DLGMessageBox(int iType, Window wIDOwner, const char *szTitle, const char *szMessage)
Display a modal 'message box' dialog window with a specific title, message, and button combination.
void WBCatString(char **ppDest, const char *pSrc)
A simple utility that concatenates a string onto the end of a 0-byte terminated WBAlloc() string.
WB_FONTC WBGetDefaultFont(void)
Returns a pointer to the default font WB_FONT for the default display. This is a shared resource; do ...