66 #define _FRAME_WINDOW_C_ 69 #include "pixmap_helper.h" 77 #define TAB_BAR_HEIGHT 24 78 #define TAB_BAR_TAB_WIDTH 20 79 #define TAB_BAR_SCROLL_WIDTH 12 80 #define TAB_BAR_ADD_BUTTON_WIDTH 12 81 #define STATUS_BAR_HEIGHT 20 82 #define DEFAULT_STATUS_BAR_TAB 16 84 #define DEFAULT_STATUS_STRING "Status: none" 87 #define FRAME_WINDOW_MIN_WIDTH (100 + 12 * TAB_BAR_TAB_WIDTH) 88 #define FRAME_WINDOW_MIN_HEIGHT (100 + TAB_BAR_HEIGHT + STATUS_BAR_HEIGHT) 90 #define NEW_TAB_MESSAGE 1 91 #define NEXT_TAB_MESSAGE 2 92 #define PREV_TAB_MESSAGE 3 93 #define SET_TAB_MESSAGE 4 94 #define CLOSE_TAB_MESSAGE 5 95 #define REORDER_TAB_MESSAGE 6 98 typedef struct __FRAME_WINDOW__
114 int nLeftTab, nRightTab;
123 char *pDefaultMenuResource;
125 int (* pFWCallback)(Window wID, XEvent *pEvent);
127 int bTabBarRectAntiRecurse;
130 int nTabBarButtonFlags;
140 struct __FRAME_WINDOW__ *pNext;
144 struct __status_tab_cols__
151 enum __tab_bar_button_flags__
153 tab_bar_button_PREV = 1,
154 tab_bar_button_NEXT = 2,
155 tab_bar_button_NEW = 4,
156 tab_bar_button_BUTTONMASK = 7,
157 tab_bar_button_GRAB = 8
163 int FWDefaultCallback(Window wID, XEvent *pEvent);
165 static FRAME_WINDOW *InternalGet_FRAME_WINDOW(
WBFrameWindow *pFW);
167 static void InternalPaintTabBar(FRAME_WINDOW *pFrameWindow, XExposeEvent *pEvent);
168 static void InternalPaintStatusBar(FRAME_WINDOW *pFrameWindow, XExposeEvent *pEvent);
170 static int Internal_Tab_Bar_Event(FRAME_WINDOW *pFrameWindow, XEvent *pEvent);
172 static void InternalCalcStatusBarRect(FRAME_WINDOW *pFrameWindow,
WB_RECT *pRect);
173 static void InternalCalcTabBarRect(FRAME_WINDOW *pFrameWindow,
WB_RECT *pRect);
175 int __internal_do_status_tab_cols(FRAME_WINDOW *pFrameWindow,
const WB_RECT *prct,
char ***pppCols,
char **ppData,
176 struct __status_tab_cols__ **ppTabs,
int *pnCol);
179 static FRAME_WINDOW *pFrames = NULL;
181 static XColor clrFG, clrBG, clrBD, clrBD2, clrBD3, clrHBG;
182 static int iInitColorFlag = 0;
198 static void __internal_destroy_frame_window(FRAME_WINDOW *pTemp)
208 if(pTemp->ppChildFrames)
210 for(i1=pTemp->nChildFrames - 1; i1 >= 0; i1--)
213 "%s - Destroy contents %d\n",
214 __FUNCTION__, i1 + 1);
222 pTemp->ppChildFrames[i1] = NULL;
227 WBFree(pTemp->ppChildFrames);
229 pTemp->ppChildFrames = NULL;
230 pTemp->nChildFrames = 0;
231 pTemp->nMaxChildFrames = 0;
251 pTemp->szTitle = NULL;
257 pTemp->szStatus = NULL;
260 if(pTemp->pStatusBarTabs)
262 WBFree(pTemp->pStatusBarTabs);
263 pTemp->pStatusBarTabs = NULL;
266 if(pTemp->pDefMenuHandler)
268 WBFree(pTemp->pDefMenuHandler);
269 pTemp->pDefMenuHandler = NULL;
272 if(pTemp->pDefaultMenuResource)
274 WBFree(pTemp->pDefaultMenuResource);
275 pTemp->pDefaultMenuResource = NULL;
287 pTemp->pBoldFont = NULL;
292 void WBFrameWindowExit()
298 FRAME_WINDOW *pTemp = pFrames;
299 pFrames = pFrames->pNext;
303 __internal_destroy_frame_window(pTemp);
311 static void InternalCheckFWAtoms(
void)
322 WB_ERROR_PRINT(
"ERROR: %s - unable to initialize atom(s)\n", __FUNCTION__);
330 #define COPY_COLOR_NAME(X,Y,Z) {const char *pX = X(WBGetDefaultDisplay()); if(pX) strncpy(Y,pX,sizeof(Y)); else strncpy(Y,Z,sizeof(Y));} 332 static void InternalCheckFWColors(
void)
335 int iY, iU, iV, iR, iG, iB;
345 char szFG[16], szBG[16], szBD[16], szHBG[16];
361 LOAD_COLOR0(
"*Frame.foreground",szFG)
else LOAD_COLOR0(
"*Form.foreground", szFG)
362 else LOAD_COLOR0(
"*WmFrame.foreground",szFG)
else LOAD_COLOR0(
"*WmForm.foreground", szFG)
363 else LOAD_COLOR(
"*foreground", szFG,
"#000000");
364 LOAD_COLOR0(
"*Frame.background",szBG)
else LOAD_COLOR0(
"*Form.background", szBG)
365 else LOAD_COLOR0(
"*WmFrame.background",szBG)
else LOAD_COLOR0(
"*WmForm.background", szBG)
366 else LOAD_COLOR(
"*background", szBG,
"#dcdad5");
367 LOAD_COLOR0(
"*Frame.border",szBD)
else LOAD_COLOR0(
"*Form.border", szBD)
368 else LOAD_COLOR0(
"*WmFrame.border",szBD)
else LOAD_COLOR0(
"*WmForm.border", szBD)
369 else LOAD_COLOR0(
"*borderColor", szBD)
370 else LOAD_COLOR(
"*border", szBD,
"black");
372 LOAD_COLOR(
"selected_bg_color", szABG,
"#0040FF");
391 if((clrBG.flags & (DoRed | DoGreen | DoBlue)) != (DoRed | DoGreen | DoBlue))
403 PXM_YUVToRGB((3 * iY + 256) / 4, iU, iV, &iR, &iG, &iB);
426 InternalCheckFWColors();
433 InternalCheckFWColors();
440 InternalCheckFWColors();
447 FRAME_WINDOW *pFrameWindow;
450 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
454 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
459 return pFrameWindow->pFont;
464 FRAME_WINDOW *pFrameWindow;
467 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
471 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
476 return pFrameWindow->pBoldFont;
480 static FRAME_WINDOW *InternalGet_FRAME_WINDOW(
WBFrameWindow *pFW)
494 while(pTemp && pTemp != (FRAME_WINDOW *)pFW)
496 pTemp = pTemp->pNext;
509 int iX,
int iY,
int iWidth,
int iHeight,
514 XSetWindowAttributes xswa;
519 pNew = (FRAME_WINDOW *)
WBAlloc(
sizeof(*pNew));
528 InternalCheckFWColors();
529 InternalCheckFWAtoms();
532 bzero(pNew,
sizeof(*pNew));
536 pNew->wbFW.iFlags = iFlags;
540 pNew->szTitle =
WBAlloc(strlen(szTitle) + 1);
546 strcpy(pNew->szTitle, szTitle);
549 pNew->nStatusBarTabs = 0;
550 pNew->pStatusBarTabs = NULL;
552 pNew->bTabBarRectAntiRecurse = 0;
553 pNew->nTabBarButtonFlags = 0;
554 pNew->nCloseTab = -1;
558 pNew->szStatus = NULL;
569 if(!pNew->pFont || !pNew->pBoldFont)
571 WB_ERROR_PRINT(
"ERROR: %s - unable to create frame window (font functions failed)\r\n", __FUNCTION__);
583 pNew->nFontHeight = pNew->nFontAscent + pNew->nFontDescent;
592 pNew->pNext = pFrames;
606 DefaultColormap(pDisplay, DefaultScreen(pDisplay)),
609 pNew->wbFW.wID =
WBCreateWindow(pDisplay, None, FWDefaultCallback,
"FrameWindow",
610 iX, iY, iWidth, iHeight, 1, InputOutput,
611 CWBorderPixel | CWBackPixel | CWColormap | CWBitGravity,
614 if(pNew->wbFW.wID == None)
618 WB_ERROR_PRINT(
"ERROR: %s - unable to create frame window (WBCreateWindow failed)\r\n", __FUNCTION__);
625 pNew->pFWCallback = pUserCallback;
627 bzero(&xsh,
sizeof(xsh));
629 xsh.flags = (USPosition | USSize | PBaseSize | PWinGravity);
633 xsh.height = iHeight;
634 xsh.base_width = iWidth / 8 > FRAME_WINDOW_MIN_WIDTH ? iWidth / 8 : FRAME_WINDOW_MIN_WIDTH;
635 xsh.base_height = iHeight / 8 > FRAME_WINDOW_MIN_HEIGHT ? iHeight / 8 : FRAME_WINDOW_MIN_HEIGHT;
640 xsh.base_height += STATUS_BAR_HEIGHT;
643 xsh.win_gravity = NorthWestGravity;
645 bzero(&xwmh,
sizeof(xwmh));
646 xwmh.flags = InputHint;
685 aProto[
sizeof(aProto)/
sizeof(aProto[0]) - 1] = None;
687 XSetWMProtocols(pDisplay, pNew->wbFW.wID, aProto,
sizeof(aProto)/
sizeof(aProto[0]) - 1);
696 XSelectInput(pDisplay, pNew->wbFW.wID,
702 if(szMenuResource && *szMenuResource)
706 pNew->pDefaultMenuResource =
WBCopyString(szMenuResource);
708 if(!pNew->pDefaultMenuResource)
752 FRAME_WINDOW *pTemp = pFrames;
753 FRAME_WINDOW *pPrev = NULL;
759 WB_ERROR_PRINT(
"ERROR: %s - invalid frame window pointer!\n", __FUNCTION__);
764 wID = pFrameWindow->
wID;
768 while(pTemp && pTemp != (FRAME_WINDOW *)pFrameWindow)
771 pTemp = pTemp->pNext;
778 pPrev->pNext = pTemp->pNext;
780 else if(pFrames == pTemp)
782 pFrames = pTemp->pNext;
794 __internal_destroy_frame_window((FRAME_WINDOW *)pFrameWindow);
801 FRAME_WINDOW *pFrameWindow;
809 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
813 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
818 pFrameWindow->pFWCallback = pCallBack;
825 FRAME_WINDOW *pFrameWindow;
833 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
837 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
842 if(pFrameWindow->pDefMenuHandler)
844 if(pFrameWindow->pMenuHandler == pFrameWindow->pDefMenuHandler)
846 pFrameWindow->pMenuHandler = NULL;
849 WBFree(pFrameWindow->pDefMenuHandler);
851 pFrameWindow->pDefMenuHandler = NULL;
869 if(pFrameWindow->pDefMenuHandler)
871 memcpy(pFrameWindow->pDefMenuHandler, pHandlerArray,
875 if(!pFrameWindow->pMenuHandler)
877 pFrameWindow->pMenuHandler = pFrameWindow->pDefMenuHandler;
882 static void InternalCalcStatusBarRect(FRAME_WINDOW *pFrameWindow,
WB_RECT *pRect)
892 iBarHeight = pFrameWindow->nFontHeight + 8;
894 if(iBarHeight < STATUS_BAR_HEIGHT)
896 iBarHeight = STATUS_BAR_HEIGHT;
902 static void InternalCalcTabBarRect(FRAME_WINDOW *pFrameWindow,
WB_RECT *pRect)
907 int iBarHeight, nVisibleTabs;
911 if(pFrameWindow->bTabBarRectAntiRecurse)
913 memcpy(pRect, &(pFrameWindow->rctLastTabBarRect),
sizeof(*pRect));
923 pFrameWindow->nFocusTab = 0;
924 pFrameWindow->nLastTab = -1;
925 pFrameWindow->nLeftTab = 0;
926 pFrameWindow->nRightTab = 0;
930 memcpy(&(pFrameWindow->rctLastTabBarRect), pRect,
sizeof(*pRect));
937 iBarHeight = pFrameWindow->nFontHeight + 14;
939 if(iBarHeight < TAB_BAR_HEIGHT)
941 iBarHeight = TAB_BAR_HEIGHT;
968 if(memcmp(&(pFrameWindow->rctLastTabBarRect), pRect,
sizeof(*pRect)))
978 memcpy(&(pFrameWindow->rctLastTabBarRect), pRect,
sizeof(*pRect));
983 if(!pFrameWindow->nChildFrames)
985 pFrameWindow->nFocusTab = 0;
986 pFrameWindow->nLastTab = -1;
987 pFrameWindow->nLeftTab = 0;
988 pFrameWindow->nRightTab = 0;
995 if(pFrameWindow->nFocusTab < 0)
997 pFrameWindow->bTabBarRectAntiRecurse = 1;
1001 pFrameWindow->bTabBarRectAntiRecurse = 0;
1003 else if(pFrameWindow->nFocusTab >= pFrameWindow->nChildFrames)
1005 pFrameWindow->bTabBarRectAntiRecurse = 1;
1007 WB_ERROR_PRINT(
"WARN: %s - focus tab exceeds # child frames - %d >= %d (fixing it)\n",
1008 __FUNCTION__, pFrameWindow->nFocusTab, pFrameWindow->nChildFrames);
1012 pFrameWindow->bTabBarRectAntiRecurse = 0;
1017 pFrameWindow->nTabBarTabWidth = (TAB_BAR_TAB_WIDTH * pFrameWindow->nAvgCharWidth)
1024 nVisibleTabs = pRect->
right - pRect->
left 1025 - TAB_BAR_SCROLL_WIDTH * 2
1026 - TAB_BAR_ADD_BUTTON_WIDTH
1029 nVisibleTabs /= pFrameWindow->nTabBarTabWidth;
1031 if(nVisibleTabs <= 0)
1040 pFrameWindow->nTabBarTabWidth = (pRect->
right - pRect->
left 1041 - TAB_BAR_SCROLL_WIDTH * 2
1042 - TAB_BAR_ADD_BUTTON_WIDTH
1046 if(nVisibleTabs >= pFrameWindow->nChildFrames)
1048 pFrameWindow->nLeftTab = 0;
1049 pFrameWindow->nRightTab = pFrameWindow->nChildFrames - 1;
1057 if(pFrameWindow->nRightTab >= pFrameWindow->nChildFrames)
1059 pFrameWindow->nRightTab = pFrameWindow->nChildFrames - 1;
1060 pFrameWindow->nLeftTab = pFrameWindow->nChildFrames - nVisibleTabs;
1063 if(pFrameWindow->nLeftTab < 0)
1065 pFrameWindow->nLeftTab = 0;
1066 pFrameWindow->nRightTab = pFrameWindow->nLeftTab + nVisibleTabs - 1;
1070 if(pFrameWindow->nRightTab >= pFrameWindow->nLeftTab + nVisibleTabs)
1072 pFrameWindow->nRightTab = pFrameWindow->nLeftTab + nVisibleTabs - 1;
1076 if((
unsigned int)pFrameWindow->nLeftTab + (
unsigned int)nVisibleTabs >= (
unsigned int)pFrameWindow->nRightTab)
1080 pFrameWindow->nLeftTab = pFrameWindow->nRightTab - nVisibleTabs + 1;
1082 if(pFrameWindow->nLeftTab < 0)
1084 pFrameWindow->nRightTab -= pFrameWindow->nLeftTab;
1085 pFrameWindow->nLeftTab = 0;
1089 if(pFrameWindow->nFocusTab < pFrameWindow->nLeftTab)
1091 pFrameWindow->nLeftTab = pFrameWindow->nFocusTab;
1092 pFrameWindow->nRightTab = pFrameWindow->nLeftTab + nVisibleTabs - 1;
1094 else if(pFrameWindow->nFocusTab > pFrameWindow->nRightTab)
1096 pFrameWindow->nRightTab = pFrameWindow->nFocusTab;
1097 pFrameWindow->nLeftTab = pFrameWindow->nRightTab - nVisibleTabs +1;
1110 FRAME_WINDOW *pFrameWindow;
1122 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1142 InternalCalcTabBarRect(pFrameWindow, &rct2);
1165 InternalCalcStatusBarRect(pFrameWindow, &rct2);
1178 if(pFrameWindow->wbFW.iClientX == rct.
left &&
1179 pFrameWindow->wbFW.iClientY == rct.
top &&
1180 pFrameWindow->wbFW.iClientWidth == rct.
right &&
1181 pFrameWindow->wbFW.iClientHeight == rct.
bottom)
1188 pFrameWindow->wbFW.iClientX = rct.
left;
1189 pFrameWindow->wbFW.iClientY = rct.
top;
1190 pFrameWindow->wbFW.iClientWidth = rct.
right;
1191 pFrameWindow->wbFW.iClientHeight = rct.
bottom;
1201 for(i1=0; i1 < iMax; i1++)
1215 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
1216 "%s - %d, %d, %d, %d\n", __FUNCTION__,
1217 pFrameWindow->wbFW.iClientX, pFrameWindow->wbFW.iClientY,
1218 pFrameWindow->wbFW.iClientWidth, pFrameWindow->wbFW.iClientHeight);
1229 pFrameWindow->nLastTab = -1;
1238 if(pFrameWindow->nFocusTab != pFrameWindow->nLastTab)
1240 pFrameWindow->nLastTab = pFrameWindow->nFocusTab;
1254 if(pCW && fPaintNow)
1268 const FRAME_WINDOW *pFrameWindow;
1271 pFrameWindow = InternalGet_FRAME_WINDOW((
WBFrameWindow *)pFW);
1275 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1280 if(!pFrameWindow->ppChildFrames)
1285 return pFrameWindow->nChildFrames;
1290 const FRAME_WINDOW *pFrameWindow;
1293 pFrameWindow = InternalGet_FRAME_WINDOW((
WBFrameWindow *)pFW);
1297 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1302 if(pFrameWindow->nChildFrames <= 0)
1304 WB_WARN_PRINT(
"WARNING: %s.%d called with no child frames, returning NULL\n",
1305 __FUNCTION__, __LINE__);
1312 iIndex = pFrameWindow->nFocusTab;
1316 !pFrameWindow->ppChildFrames || iIndex >= pFrameWindow->nChildFrames)
1318 if(pFrameWindow->ppChildFrames)
1320 WB_ERROR_PRINT(
"ERROR: %s - bad index %d - %d frames, array=%p\n",
1321 __FUNCTION__, iIndex, pFrameWindow->nChildFrames, pFrameWindow->ppChildFrames);
1325 WB_DEBUG_PRINT(DebugLevel_Medium,
"ERROR: %s - bad index %d - %d frames, array=%p\n",
1326 __FUNCTION__, iIndex, pFrameWindow->nChildFrames, pFrameWindow->ppChildFrames);
1332 return pFrameWindow->ppChildFrames[iIndex];
1337 FRAME_WINDOW *pFrameWindow;
1341 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1345 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1350 if(!pFrameWindow->ppChildFrames)
1352 pFrameWindow->nMaxChildFrames = 256;
1355 if(!pFrameWindow->ppChildFrames)
1357 pFrameWindow->nMaxChildFrames = 0;
1365 pFrameWindow->nChildFrames = 0;
1367 else if((pFrameWindow->nChildFrames + 1) >= pFrameWindow->nMaxChildFrames)
1369 void *pTemp =
WBReAlloc(pFrameWindow->ppChildFrames,
1370 (pFrameWindow->nMaxChildFrames + 128) *
sizeof(
WBChildFrame *));
1379 pFrameWindow->nMaxChildFrames += 128;
1384 iRval = pFrameWindow->nChildFrames;
1385 (pFrameWindow->nChildFrames)++;
1386 pFrameWindow->ppChildFrames[iRval] = pNew;
1388 pNew->
pOwner = &(pFrameWindow->wbFW);
1403 FRAME_WINDOW *pFrameWindow;
1406 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1408 if(!pFrameWindow || !pCont)
1410 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer or invalid child window pointer!\n", __FUNCTION__);
1415 if(!pFrameWindow->ppChildFrames || !pFrameWindow->nChildFrames)
1420 for(iIndex=0; iIndex < pFrameWindow->nChildFrames; iIndex++)
1422 if(pFrameWindow->ppChildFrames[iIndex] == pCont)
1425 if(pCont->
pOwner != &(pFrameWindow->wbFW))
1427 WB_ERROR_PRINT(
"ERROR: %s - tab's owner %p does not match this frame window (%p)!\n",
1428 __FUNCTION__, (
void *)pCont->
pOwner, (
void *)&(pFrameWindow->wbFW));
1432 if(pCont->
wID != None)
1439 for(i2=iIndex + 1; i2 < pFrameWindow->nChildFrames; i2++)
1441 pFrameWindow->ppChildFrames[i2 - 1] = pFrameWindow->ppChildFrames[i2];
1444 pFrameWindow->nChildFrames --;
1445 pFrameWindow->ppChildFrames[pFrameWindow->nChildFrames] = NULL;
1447 if(pFrameWindow->nFocusTab >= pFrameWindow->nChildFrames)
1449 pFrameWindow->nFocusTab = pFrameWindow->nChildFrames - 1;
1451 else if(pFrameWindow->nFocusTab > iIndex)
1454 pFrameWindow->nFocusTab--;
1460 if(pFrameWindow->nChildFrames <= 0)
1476 pFrameWindow->pMenuHandler = pFrameWindow->pDefMenuHandler;
1478 pFrameWindow->nChildFrames = 0;
1485 else if(iIndex == pFrameWindow->nFocusTab)
1491 if(iIndex < pFrameWindow->nChildFrames)
1516 FRAME_WINDOW *pFrameWindow;
1520 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1522 if(!pFrameWindow || !pCont || !pContNew)
1524 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer or invalid child frame pointer!\n", __FUNCTION__);
1529 if(!pFrameWindow->ppChildFrames || !pFrameWindow->nChildFrames)
1536 for(iIndex=0; iIndex < pFrameWindow->nChildFrames; iIndex++)
1538 if(pFrameWindow->ppChildFrames[iIndex] == pCont)
1540 if(pCont->
wID != None)
1549 pFrameWindow->ppChildFrames[iIndex] = pContNew;
1551 pContNew->
pOwner = &(pFrameWindow->wbFW);
1559 if(iIndex == pFrameWindow->nFocusTab)
1570 FRAME_WINDOW *pFrameWindow;
1573 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1577 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1584 if(!pFrameWindow->ppChildFrames || !pFrameWindow->nChildFrames)
1589 for(iIndex=0; iIndex < pFrameWindow->nChildFrames; iIndex++)
1591 if(pFrameWindow->ppChildFrames[iIndex] == pCont)
1601 FRAME_WINDOW *pFrameWindow;
1609 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1613 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1620 if(!pFrameWindow->ppChildFrames || !pFrameWindow->nChildFrames)
1625 if(iIndex >= pFrameWindow->nChildFrames)
1627 iIndex = pFrameWindow->nChildFrames - 1;
1634 pFrameWindow->nFocusTab = iIndex;
1635 pFrameWindow->nCloseTab = -1;
1643 pC = pFrameWindow->ppChildFrames[iIndex];
1654 for(i1=0; i1 < pFrameWindow->nChildFrames; i1++)
1661 pC = pFrameWindow->ppChildFrames[i1];
1703 pFrameWindow->pMenuHandler = pFrameWindow->pDefMenuHandler;
1713 FRAME_WINDOW *pFrameWindow;
1716 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1720 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1727 if(!pFrameWindow->ppChildFrames || !pFrameWindow->nChildFrames)
1734 return pFrameWindow->nFocusTab;
1737 for(iIndex=0; iIndex < pFrameWindow->nChildFrames; iIndex++)
1739 if(pFrameWindow->ppChildFrames[iIndex] == pCont)
1750 FRAME_WINDOW *pFrameWindow;
1755 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1759 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1766 if(!pFrameWindow->ppChildFrames || !pFrameWindow->nChildFrames)
1789 else if(iIndex == -2)
1796 if(iIndex >= pFrameWindow->nChildFrames)
1798 iIndex = pFrameWindow->nChildFrames - 1;
1805 pC = pFrameWindow->ppChildFrames[iI];
1807 for(i1=iI; i1 > iIndex; i1--)
1809 pFrameWindow->ppChildFrames[i1] = pFrameWindow->ppChildFrames[i1 - 1];
1812 pFrameWindow->ppChildFrames[iIndex] = pC;
1814 if(pFrameWindow->nFocusTab == iI)
1816 pFrameWindow->nFocusTab = iIndex;
1818 else if(pFrameWindow->nFocusTab >= iIndex && pFrameWindow->nFocusTab < iI)
1820 pFrameWindow->nFocusTab ++;
1822 if(pFrameWindow->nFocusTab >= pFrameWindow->nChildFrames)
1824 pFrameWindow->nFocusTab = pFrameWindow->nChildFrames - 1;
1828 else if(iI < iIndex)
1830 pC = pFrameWindow->ppChildFrames[iI];
1832 for(i1=iI; i1 < iIndex; i1++)
1834 pFrameWindow->ppChildFrames[i1] = pFrameWindow->ppChildFrames[i1 + 1];
1837 pFrameWindow->ppChildFrames[iIndex] = pC;
1839 if(pFrameWindow->nFocusTab == iI)
1841 pFrameWindow->nFocusTab = iIndex;
1843 else if(pFrameWindow->nFocusTab > iI && pFrameWindow->nFocusTab <= iIndex)
1845 pFrameWindow->nFocusTab --;
1847 if(pFrameWindow->nFocusTab < 0)
1849 pFrameWindow->nFocusTab = 0;
1860 if(pFrameWindow->nFocusTab >= 0 && pFrameWindow->nFocusTab < pFrameWindow->nChildFrames)
1864 pC = pFrameWindow->ppChildFrames[pFrameWindow->nFocusTab];
1876 FRAME_WINDOW *pFrameWindow;
1879 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1883 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1888 if(pFrameWindow->szStatus)
1890 WBFree(pFrameWindow->szStatus);
1891 pFrameWindow->szStatus = NULL;
1898 if(!pFrameWindow->szStatus)
1904 InternalCalcStatusBarRect(pFrameWindow, &rct);
1912 FRAME_WINDOW *pFrameWindow;
1915 pFrameWindow = InternalGet_FRAME_WINDOW(pFW);
1919 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
1924 if(pFrameWindow->pStatusBarTabs)
1926 WBFree(pFrameWindow->pStatusBarTabs);
1928 pFrameWindow->pStatusBarTabs = NULL;
1931 pFrameWindow->nStatusBarTabs = nTabs;
1935 pFrameWindow->pStatusBarTabs = (
int *)
WBAlloc(
sizeof(
int) * (nTabs + 1));
1937 if(!pFrameWindow->pStatusBarTabs)
1939 WB_ERROR_PRINT(
"ERROR: %s - no memory (attempt to allocate %d integers)\n", __FUNCTION__, nTabs);
1944 memcpy(pFrameWindow->pStatusBarTabs, pTabs,
sizeof(
int) * nTabs);
1945 pFrameWindow->pStatusBarTabs[nTabs] = 0;
1948 InternalCalcTabBarRect(pFrameWindow, &rct);
1969 static void Internal_CalcTabRect(FRAME_WINDOW *pFrameWindow,
int iIndex,
WB_RECT *prctTab)
1971 if(!pFrameWindow->ppChildFrames || iIndex >= pFrameWindow->nChildFrames ||
1972 iIndex < pFrameWindow->nLeftTab || iIndex > pFrameWindow->nRightTab)
1978 prctTab->
top = pFrameWindow->rctLastTabBarRect.top + 2;
1979 prctTab->
bottom = pFrameWindow->rctLastTabBarRect.bottom;
1980 prctTab->
left = (iIndex - pFrameWindow->nLeftTab) * pFrameWindow->nTabBarTabWidth
1981 + TAB_BAR_SCROLL_WIDTH + 2;
1982 prctTab->
right = prctTab->
left + pFrameWindow->nTabBarTabWidth;
1985 static void Internal_CalcTabGeom(FRAME_WINDOW *pFrameWindow,
int iIndex,
WB_GEOM *pgTab)
1987 if(!pFrameWindow->ppChildFrames || iIndex >= pFrameWindow->nChildFrames ||
1988 iIndex < pFrameWindow->nLeftTab || iIndex > pFrameWindow->nRightTab)
1994 pgTab->
y = pFrameWindow->rctLastTabBarRect.top + 2;
1995 pgTab->
height = pFrameWindow->rctLastTabBarRect.bottom - pgTab->
y;
1996 pgTab->
x = (iIndex - pFrameWindow->nLeftTab) * pFrameWindow->nTabBarTabWidth
1997 + TAB_BAR_SCROLL_WIDTH + 2;
1998 pgTab->
width = pFrameWindow->nTabBarTabWidth;
2001 static int Internal_Tab_Bar_Event(FRAME_WINDOW *pFrameWindow, XEvent *pEvent)
2003 WB_RECT rctLeft, rctRight, rctNew, rctTemp;
2005 XClientMessageEvent evt;
2009 if(pEvent->type == ButtonPress)
2014 XGrabPointer(pDisplay, pFrameWindow->wbFW.wID, 1,
2015 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask
2016 | EnterWindowMask | LeaveWindowMask,
2019 None, None, CurrentTime);
2022 pFrameWindow->nTabBarButtonFlags |= tab_bar_button_GRAB;
2023 pFrameWindow->nTabBarButtonFlags &= ~tab_bar_button_BUTTONMASK;
2032 rctLeft.
top = rctRight.
top = rctNew.
top = pFrameWindow->rctLastTabBarRect.top + 2;
2033 rctLeft.
bottom = rctRight.
bottom = rctNew.
bottom = pFrameWindow->rctLastTabBarRect.bottom - 2;
2035 rctLeft.
left = pFrameWindow->rctLastTabBarRect.left + 2;
2036 rctLeft.
right = rctLeft.
left + TAB_BAR_SCROLL_WIDTH - 2;
2038 rctRight.
right = pFrameWindow->rctLastTabBarRect.right - 2;
2039 rctRight.
left = rctRight.
right - TAB_BAR_SCROLL_WIDTH + 2;
2042 rctNew.
right = rctRight.
right - TAB_BAR_SCROLL_WIDTH - 2;
2043 rctNew.
left = rctNew.
right - TAB_BAR_ADD_BUTTON_WIDTH - 2;
2045 if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, rctLeft))
2047 pFrameWindow->nTabBarButtonFlags |= tab_bar_button_PREV;
2049 else if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, rctRight))
2051 pFrameWindow->nTabBarButtonFlags |= tab_bar_button_NEXT;
2053 else if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, rctNew))
2055 pFrameWindow->nTabBarButtonFlags |= tab_bar_button_NEW;
2058 if(pFrameWindow->nTabBarButtonFlags & tab_bar_button_BUTTONMASK)
2067 WBInvalidateRect(pFrameWindow->wbFW.wID, &(pFrameWindow->rctLastTabBarRect), 1);
2076 if(pFrameWindow->nChildFrames)
2078 for(i1=pFrameWindow->nLeftTab; i1 <= pFrameWindow->nRightTab; i1++)
2080 Internal_CalcTabRect(pFrameWindow, i1, &rctTemp);
2082 if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, rctTemp))
2087 rctTemp.
left = rctTemp.
right - (pFrameWindow->nFontHeight + 2);
2089 rctTemp.
bottom = rctTemp.
top + pFrameWindow->nFontHeight;
2094 if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, rctTemp))
2098 pFrameWindow->nCloseTab = i1;
2100 WBInvalidateRect(pFrameWindow->wbFW.wID, &(pFrameWindow->rctLastTabBarRect), 1);
2104 pFrameWindow->nCloseTab = -1;
2108 if(i1 == pFrameWindow->nFocusTab)
2113 bzero(&evt,
sizeof(evt));
2114 evt.type = ClientMessage;
2116 evt.display = pDisplay;
2117 evt.window = pFrameWindow->wbFW.wID;
2120 evt.data.l[0] = SET_TAB_MESSAGE;
2124 WBPostEvent(pFrameWindow->wbFW.wID, (XEvent *)&evt);
2133 pFrameWindow->nCloseTab = -1;
2137 else if(pEvent->type == ButtonRelease)
2139 if(!(pFrameWindow->nTabBarButtonFlags & tab_bar_button_GRAB))
2141 pFrameWindow->nCloseTab = -1;
2142 pFrameWindow->nTabBarButtonFlags &= ~tab_bar_button_BUTTONMASK;
2148 XUngrabPointer(pDisplay, CurrentTime);
2151 pFrameWindow->nTabBarButtonFlags &= ~tab_bar_button_GRAB;
2153 if(pFrameWindow->nCloseTab < 0 &&
2154 !(pFrameWindow->nTabBarButtonFlags & tab_bar_button_BUTTONMASK))
2162 WB_ERROR_PRINT(
"TODO: %s - handle tab-drags, except when I clicked the 'delete tab' button\n", __FUNCTION__);
2168 bzero(&evt,
sizeof(evt));
2169 evt.type = ClientMessage;
2171 evt.display = pDisplay;
2172 evt.window = pFrameWindow->wbFW.wID;
2175 if(pFrameWindow->nCloseTab >= 0)
2177 evt.data.l[0] = CLOSE_TAB_MESSAGE;
2178 evt.data.l[1] = pFrameWindow->nCloseTab;
2182 pFrameWindow->nCloseTab = -1;
2184 else if(pFrameWindow->nTabBarButtonFlags & tab_bar_button_NEXT)
2186 if(pFrameWindow->nRightTab < (pFrameWindow->nChildFrames - 1))
2188 evt.data.l[0] = NEXT_TAB_MESSAGE;
2195 else if(pFrameWindow->nTabBarButtonFlags & tab_bar_button_PREV)
2197 if(pFrameWindow->nLeftTab > 0)
2199 evt.data.l[0] = PREV_TAB_MESSAGE;
2206 else if(pFrameWindow->nTabBarButtonFlags & tab_bar_button_NEW)
2208 evt.data.l[0] = NEW_TAB_MESSAGE;
2213 WBPostEvent(pFrameWindow->wbFW.wID, (XEvent *)&evt);
2217 pFrameWindow->nTabBarButtonFlags &= ~tab_bar_button_BUTTONMASK;
2220 WBInvalidateRect(pFrameWindow->wbFW.wID, &(pFrameWindow->rctLastTabBarRect), 1);
2225 else if(pEvent->type == MotionNotify)
2227 if(pFrameWindow->nTabBarButtonFlags & tab_bar_button_GRAB)
2229 if(!(pFrameWindow->nTabBarButtonFlags & tab_bar_button_BUTTONMASK))
2231 WB_ERROR_PRINT(
"TODO: %s - handle tab-drags via visual feedback\n", __FUNCTION__);
2242 static void InternalPaintTabBar(FRAME_WINDOW *pFrameWindow, XExposeEvent *pEvent)
2256 memcpy(&rct0, &(pFrameWindow->rctLastTabBarRect),
sizeof(rct0));
2260 pFrameWindow->rctTabBar.left = rct0.
left + 1;
2261 pFrameWindow->rctTabBar.top = rct0.
top + 1;
2262 pFrameWindow->rctTabBar.right = rct0.
right - 1;
2263 pFrameWindow->rctTabBar.bottom = rct0.
bottom - 1;
2268 rctExpose.
left = pEvent->x;
2269 rctExpose.
top = pEvent->y;
2270 rctExpose.
right = rctExpose.
left + pEvent->width;
2271 rctExpose.
bottom = rctExpose.
top + pEvent->height;
2282 if(rctExpose.
top < rct0.
top)
2284 rctExpose.
top = rct0.
top;
2304 geom0.
x = rctExpose.
left;
2305 geom0.
y = rctExpose.
top;
2316 WB_ERROR_PRINT(
"ERROR: %s - no GC from WBBeginPaintGeom\n", __FUNCTION__);
2338 iDepth = DefaultDepth(pDisplay, DefaultScreen(pDisplay));
2339 WB_DEBUG_PRINT((DebugLevel_Heavy | DebugSubSystem_Expose),
"InternalPaintTabBar() - depth is %d\n", iDepth);
2342 dw = (Drawable)XCreatePixmap(pDisplay, pFrameWindow->wbFW.wID,
2347 if(gc == None || dw == None)
2357 XFreePixmap(pDisplay, (Pixmap)dw);
2361 dw = pFrameWindow->wbFW.wID;
2364 memcpy(&rct, &rct0,
sizeof(rct));
2365 memcpy(&geom, &geom0,
sizeof(geom));
2367 WB_ERROR_PRINT(
"ERROR: %s - unable to create pixmap or 2nd gc; fallback invoked\n", __FUNCTION__);
2378 geom.
x = geom.
y = 0;
2391 XDestroyRegion(rgn);
2420 g2.
x = rct.
left + 1;
2422 g2.
width = TAB_BAR_SCROLL_WIDTH;
2425 if((pFrameWindow->nTabBarButtonFlags & tab_bar_button_PREV) && pFrameWindow->nLeftTab > 0)
2438 (pFrameWindow->nLeftTab > 0) ? clrFG.pixel : clrBD3.pixel);
2443 g2.
x = rct.
right - TAB_BAR_SCROLL_WIDTH - 1;
2445 g2.
width = TAB_BAR_SCROLL_WIDTH;
2448 if((pFrameWindow->nTabBarButtonFlags & tab_bar_button_NEXT) && pFrameWindow->nRightTab < (pFrameWindow->nChildFrames - 1))
2461 (pFrameWindow->nRightTab < (pFrameWindow->nChildFrames - 1)) ? clrFG.pixel : clrBD3.pixel);
2466 g2.
x = (rct.
right - TAB_BAR_SCROLL_WIDTH - 1) - (TAB_BAR_ADD_BUTTON_WIDTH + 1);
2468 g2.
width = TAB_BAR_ADD_BUTTON_WIDTH;
2471 if(pFrameWindow->nTabBarButtonFlags & tab_bar_button_NEW)
2494 rctTemp.
left = g2.
x;
2501 "+", pDisplay, gc, dw, 0, 0, &rctTemp,
2514 if(pFrameWindow->ppChildFrames && pFrameWindow->nChildFrames)
2524 for(i1=pFrameWindow->nRightTab; i1 >= pFrameWindow->nLeftTab; i1--)
2526 if(i1 != pFrameWindow->nFocusTab)
2528 if(i1 >= pFrameWindow->nChildFrames)
2533 pC = pFrameWindow->ppChildFrames[i1];
2540 Internal_CalcTabGeom(pFrameWindow, i1, &g2);
2545 pFrameWindow->nCloseTab == i1 ? -2 : 0,
2546 clrFG.pixel, clrBG.pixel,
2547 clrBD2.pixel, clrBD3.pixel, clrHBG.pixel,
2548 pFrameWindow->pFont, pFrameWindow->pBoldFont,
2553 i1 = pFrameWindow->nFocusTab;
2555 if(i1 < pFrameWindow->nChildFrames)
2557 pC = pFrameWindow->ppChildFrames[i1];
2561 Internal_CalcTabGeom(pFrameWindow, i1, &g2);
2566 pFrameWindow->nCloseTab == i1 ? -1 : 1,
2567 clrFG.pixel, clrBG.pixel,
2568 clrBD2.pixel, clrBD3.pixel, clrHBG.pixel,
2569 pFrameWindow->pFont, pFrameWindow->pBoldFont,
2577 if(dw != pFrameWindow->wbFW.wID)
2582 XCopyArea(pDisplay, dw, pFrameWindow->wbFW.wID, gc0->
gc,
2597 if(dw != pFrameWindow->wbFW.wID)
2600 XFreePixmap(pDisplay, (Pixmap)dw);
2612 if(pEvent->y < rct0.
bottom)
2616 if(pEvent->y >= rct0.
top && pEvent->y < rct0.
bottom)
2618 pEvent->height -= rct0.
bottom - pEvent->y;
2621 if(pEvent->height < 0)
2630 static void InternalPaintStatusBar(FRAME_WINDOW *pFrameWindow, XExposeEvent *pEvent)
2632 WB_RECT rct, rctExpose, rctTemp, rctPrev;
2636 const char *pszStatus;
2646 InternalCalcStatusBarRect(pFrameWindow, &rct);
2650 rctExpose.
left = pEvent->x;
2651 rctExpose.
top = pEvent->y;
2652 rctExpose.
right = rctExpose.
left + pEvent->width;
2653 rctExpose.
bottom = rctExpose.
top + pEvent->height;
2664 if(rctExpose.
top < rct.
top)
2686 geom.
x = rctExpose.
left;
2687 geom.
y = rctExpose.
top;
2695 WB_ERROR_PRINT(
"ERROR: %s - no GC from WBBeginPaintGeom\n", __FUNCTION__);
2699 WB_FONT pFont = pFrameWindow->pFont;
2715 xpt[2].x=rct.
right - 2;
2718 WBDrawLines(pDisplay, pFrameWindow->wbFW.wID, gc, xpt, 3, CoordModeOrigin);
2721 xpt[0].x=rct.
right - 1;
2722 xpt[0].y=rct.
top + 1;
2723 xpt[1].x=rct.
right - 1;
2725 xpt[2].x=rct.
left + 1;
2728 WBDrawLines(pDisplay, pFrameWindow->wbFW.wID, gc, xpt, 3, CoordModeOrigin);
2735 rctTemp.
top = rct.
top + 2;
2739 if(!pFrameWindow->pStatusBarTabs || !pFrameWindow->nStatusBarTabs)
2741 int iFixedTab = pFrameWindow->nStatusBarTabs;
2745 iFixedTab = DEFAULT_STATUS_BAR_TAB;
2748 iFixedTab *= pFrameWindow->nAvgCharWidth;
2750 pszStatus = pFrameWindow->szStatus;
2754 pszStatus = DEFAULT_STATUS_STRING;
2758 pszStatus, pDisplay,
2759 gc, pFrameWindow->wbFW.wID,
2765 char **ppCols = NULL;
2767 struct __status_tab_cols__ *pTabs;
2772 if(!__internal_do_status_tab_cols(pFrameWindow, &rctTemp, &ppCols, &pData, &pTabs, &nCol))
2774 memcpy(&rctPrev, &rctTemp,
sizeof(rctTemp));
2776 for(i1=0; i1 < nCol && ppCols[i1]; i1++)
2778 rctTemp.
left = pTabs[i1].left;
2779 rctTemp.
right = pTabs[i1].right;
2782 pDisplay, gc, pFrameWindow->wbFW.wID,
2786 rctTemp.
top = rctPrev.
top;
2803 if(pEvent->height + pEvent->x > rct.
top)
2807 pEvent->height = rct.
top - pEvent->x;
2808 if(pEvent->height < 0)
2819 int __internal_do_status_tab_cols(FRAME_WINDOW *pFrameWindow,
const WB_RECT *prct,
char ***pppCols,
char **ppData,
2820 struct __status_tab_cols__ **ppTabs,
int *pnCol)
2822 int i1, i2, i3, i4, iTab, nCol;
2838 if(pFrameWindow->szStatus)
2864 for(nCol = 1; *p1; )
2866 while(*p1 && *p1 !=
'\t')
2881 if(nCol > pFrameWindow->nStatusBarTabs)
2883 nCol = pFrameWindow->nStatusBarTabs;
2890 *pppCols = (
char **)
WBAlloc(
sizeof(
char *)*(nCol + 2));
2902 *ppTabs = (
struct __status_tab_cols__ *)
WBAlloc(
sizeof(**ppTabs) * (pFrameWindow->nStatusBarTabs + 1));
2914 for(i1=0; i1 < nCol; i1++)
2916 (*pppCols)[i1] = p1;
2918 p1 += strlen(p1) + 1;
2925 for(i1=0, iTab=0; i1 < pFrameWindow->nStatusBarTabs; i1++)
2927 i2 = pFrameWindow->pStatusBarTabs[i1];
2935 (*ppTabs)[iTab].left = -1;
2936 (*ppTabs)[iTab].right = prct->
right 2942 (*ppTabs)[iTab].left = prct->
left 2944 (*ppTabs)[iTab].right = -1;
2957 for(i1=0; i1 < iTab; i1++)
2959 if((*ppTabs)[i1].left < 0)
2968 for(i2=0; i2 < pFrameWindow->nStatusBarTabs; i2++)
2972 i4 = pFrameWindow->pStatusBarTabs[i2];
2983 if((*ppTabs)[iTab].left < 0)
2985 if(i4 >= (*ppTabs)[iTab].right)
2997 if(i4 <= (*ppTabs)[iTab].left)
3009 if((*ppTabs)[i1].left < 0)
3011 (*ppTabs)[i1].left = i3;
3015 (*ppTabs)[i1].right = i3;
3023 int FWDefaultCallback(Window wID, XEvent *pEvent)
3025 FRAME_WINDOW *pFrameWindow;
3030 int nChar =
sizeof(tbuf);
3034 if(pEvent->type == DestroyNotify)
3036 if(pEvent->xdestroywindow.window != wID)
3045 memcpy(&evt, pEvent,
sizeof(evt));
3047 evt.xany.window = pEvent->xdestroywindow.window;
3059 WB_ERROR_PRINT(
"ERROR: %s - no frame window pointer!\n", __FUNCTION__);
3070 switch(pEvent->type)
3074 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3075 "%s - BUTTON PRESS/RELEASE\n", __FUNCTION__);
3078 if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, pFrameWindow->rctTabBar) ||
3079 (pFrameWindow->nTabBarButtonFlags & tab_bar_button_GRAB))
3081 return Internal_Tab_Bar_Event(pFrameWindow, pEvent);
3085 if(
WBPointInWindow(pEvent->xbutton.window, pEvent->xbutton.x, pEvent->xbutton.y, wIDMenu))
3093 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3094 "%s - MOTION NOTIFY\n", __FUNCTION__);
3097 if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, pFrameWindow->rctTabBar) ||
3098 (pFrameWindow->nTabBarButtonFlags & tab_bar_button_GRAB))
3100 return Internal_Tab_Bar_Event(pFrameWindow, pEvent);
3103 if(
WBPointInWindow(pEvent->xmotion.window, pEvent->xmotion.x, pEvent->xmotion.y, wIDMenu))
3110 case ConfigureNotify:
3111 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3112 "%s - CONFIGURE NOTIFY\n", __FUNCTION__);
3123 XClientMessageEvent evt;
3127 bzero(&evt,
sizeof(evt));
3128 evt.type = ClientMessage;
3130 evt.display = pDisplay;
3134 evt.data.l[0] = pEvent->xconfigure.x;
3135 evt.data.l[1] = pEvent->xconfigure.y;
3136 evt.data.l[2] = pEvent->xconfigure.x + pEvent->xconfigure.width;
3137 evt.data.l[3] = pEvent->xconfigure.y + pEvent->xconfigure.height;
3138 evt.data.l[4] = pEvent->xconfigure.border_width;
3152 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3153 "%s - CLIENT MESSAGE: %s\n", __FUNCTION__, p1);
3162 if(pEvent->xclient.message_type ==
aSET_FOCUS)
3166 if(pEvent->xclient.data.l[0] == None)
3214 WB_ERROR_PRINT(
"TEMPORARY: %s - child frame handles the menu\n", __FUNCTION__);
3220 if(pFrameWindow->pMenuHandler)
3227 uintptr_t lID = pHandler->
lMenuID;
3229 if(pHandler->
lMenuID >= 0x10000L)
3231 #warning is this still potentially dangerous code? 3240 if(pEvent->xclient.data.l[0] == lID)
3244 if(pHandler->
callback(&(pEvent->xclient)))
3281 WB_ERROR_PRINT(
"TEMPORARY: %s - child frame handles the menu UI thingy\n", __FUNCTION__);
3289 if(pFrameWindow->pMenuHandler)
3295 uintptr_t lID = pHandler->
lMenuID;
3297 if(pHandler->
lMenuID >= 0x10000L)
3299 #warning is this still potentially dangerous code? 3308 if(pEvent->xclient.data.l[0] == lID)
3341 if(!pMenu || !pItem)
3343 WB_ERROR_PRINT(
"** ERROR: %s - window=%08xH pMenu=%p, pItem=%p\n", __FUNCTION__, (
int)wID, pMenu, pItem);
3365 else if(pEvent->xclient.message_type ==
aWB_CHAR)
3380 if(pEvent->xclient.data.l[0] == XK_F10 &&
3395 XClientMessageEvent evt;
3399 bzero(&evt,
sizeof(evt));
3400 evt.type = ClientMessage;
3402 evt.window = wIDMenu;
3410 WB_DEBUG_PRINT(DebugLevel_Chatty | DebugSubSystem_Menu | DebugSubSystem_Frame,
3411 "%s - posting client event message to display menu\n", __FUNCTION__);
3422 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3423 "%s - Client message %s not handled by frame window\n",
3441 if(pEvent->xclient.message_type ==
aWB_CHAR)
3456 if(pEvent->xclient.data.l[0] == XK_F10 &&
3475 if(pEvent->type == ButtonPress ||
3476 pEvent->type == ButtonRelease ||
3477 pEvent->type == MotionNotify)
3479 if(
WBPointInRect(pEvent->xbutton.x, pEvent->xbutton.y, pFrameWindow->rctTabBar) ||
3480 (pFrameWindow->nTabBarButtonFlags & tab_bar_button_GRAB))
3482 return Internal_Tab_Bar_Event(pFrameWindow, pEvent);
3485 else if(pEvent->type == Expose)
3487 InternalPaintTabBar(pFrameWindow, &(pEvent->xexpose));
3489 else if(pEvent->type == ClientMessage &&
3494 if(pEvent->xclient.data.l[0] == NEW_TAB_MESSAGE)
3497 XClientMessageEvent evt;
3504 bzero(&evt,
sizeof(evt));
3505 evt.type = ClientMessage;
3507 evt.display = pDisplay;
3517 else if(pEvent->xclient.data.l[0] == PREV_TAB_MESSAGE)
3519 if(pFrameWindow->nFocusTab > 0)
3524 else if(pEvent->xclient.data.l[0] == NEXT_TAB_MESSAGE)
3526 if((pFrameWindow->nFocusTab + 1) < pFrameWindow->nChildFrames)
3531 else if(pEvent->xclient.data.l[0] == SET_TAB_MESSAGE)
3533 if((
int)pEvent->xclient.data.l[1] >= 0 &&
3534 (
int)pEvent->xclient.data.l[1] < pFrameWindow->nChildFrames)
3539 else if(pEvent->xclient.data.l[0] == CLOSE_TAB_MESSAGE)
3541 if((
int)pEvent->xclient.data.l[1] >= 0 &&
3542 (
int)pEvent->xclient.data.l[1] < pFrameWindow->nChildFrames)
3544 WBChildFrame *pC = pFrameWindow->ppChildFrames[pEvent->xclient.data.l[1]];
3558 if(pEvent->type == Expose &&
3561 InternalPaintStatusBar(pFrameWindow, &(pEvent->xexpose));
3567 if(pFrameWindow->pFWCallback)
3571 iRval = (pFrameWindow->pFWCallback)(wID, pEvent);
3573 WB_DEBUG_PRINT(DebugLevel_Chatty | DebugSubSystem_Event | DebugSubSystem_Frame,
3574 "%s - %s event and user callback returns %d\n", __FUNCTION__,
WBEventName(pEvent->type), iRval);
3581 switch(pEvent->type)
3584 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3585 "%s DestroyNotify and user callback returned a non-zero value\n", __FUNCTION__);
3593 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3594 "%s Expose event and user callback returns %d\n", __FUNCTION__, iRval);
3599 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3600 "%s - %s event and user callback returns %d\n", __FUNCTION__,
WBEventName(pEvent->type), iRval);
3608 if(pEvent->type == ClientMessage &&
3616 if(pFrameWindow->ppChildFrames && pFrameWindow->nChildFrames > 0)
3618 for(i1=0; i1 < pFrameWindow->nChildFrames; i1++)
3620 XClientMessageEvent evt;
3622 bzero(&evt,
sizeof(evt));
3623 evt.type = ClientMessage;
3624 evt.display = pDisplay;
3625 evt.window = pFrameWindow->ppChildFrames[i1]->wID;
3632 WB_DEBUG_PRINT(DebugLevel_Light | DebugSubSystem_Event | DebugSubSystem_Frame,
3633 "%s - QUERY CLOSE returning 1 (child refuses to close)\n", __FUNCTION__);
3642 if(pEvent->xclient.data.l[0])
3646 if(pFrameWindow->ppChildFrames && pFrameWindow->nChildFrames > 0)
3648 for(i1=pFrameWindow->nChildFrames - 1; i1 >= 0; i1--)
3650 WB_ERROR_PRINT(
"TEMPORARY: %s - destroying child frame %d\n", __FUNCTION__, i1);
3655 pFrameWindow->ppChildFrames[i1] = NULL;
3659 pFrameWindow->nChildFrames = 0;
3665 if(pFrameWindow->pFWCallback)
3667 XDestroyWindowEvent evt;
3669 bzero(&evt,
sizeof(evt));
3670 evt.type = DestroyNotify;
3671 evt.display = pDisplay;
3672 evt.event = evt.window = pFrameWindow->wbFW.wID;
3674 pFrameWindow->pFWCallback(evt.event, (XEvent *)&evt);
3677 WB_ERROR_PRINT(
"TEMPORARY: %s - destroying internal data, etc.\n", __FUNCTION__);
3681 __internal_destroy_frame_window(pFrameWindow);
3687 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3688 "%s - QUERY CLOSE returning zero\n", __FUNCTION__);
3702 switch(pEvent->type)
3710 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame | DebugSubSystem_Keyboard,
3711 "%s KEY PRESS for KEY %d KEYCODE %d MASK=%d (%xH)\n",
3712 __FUNCTION__, iKey, ((XKeyEvent *)pEvent)->keycode,
3713 ((XKeyEvent *)pEvent)->state, ((XKeyEvent *)pEvent)->state);
3723 WB_DEBUG_PRINT(DebugLevel_Excessive | DebugSubSystem_Menu | DebugSubSystem_Frame | DebugSubSystem_Keyboard,
3724 "%s call to MBMenuProcessHotKey for menu window %d (%08xH)\n",
3725 __FUNCTION__, (
int)pMenuBar->
wSelf, (
int)pMenuBar->
wSelf);
3741 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame | DebugSubSystem_Keyboard,
3742 "%s KEY RELEASE for KEY %d KEYCODE %d MASK=%d (%xH)\n",
3743 __FUNCTION__, iKey, ((XKeyEvent *)pEvent)->keycode,
3744 ((XKeyEvent *)pEvent)->state, ((XKeyEvent *)pEvent)->state);
3755 case SelectionRequest:
3756 case SelectionClear:
3757 case SelectionNotify:
3779 if(pEvent->type == DestroyNotify &&
3780 pEvent->xdestroywindow.window == wID)
3784 WB_DEBUG_PRINT(DebugLevel_Heavy | DebugSubSystem_Event | DebugSubSystem_Frame,
3785 "%s - DestroyNotify\n", __FUNCTION__);
3789 __internal_destroy_frame_window(pFrameWindow);
3797 "%s - frame window destroyed\n", __FUNCTION__);
3801 WB_DEBUG_PRINT(DebugLevel_Excessive | DebugSubSystem_Event | DebugSubSystem_Frame,
3802 "%s - frame window callback returns %d\n", __FUNCTION__, iRval);
void FWReplaceContainedWindow(WBFrameWindow *pFW, WBChildFrame *pCont, WBChildFrame *pContNew)
Replace a 'contained' window from a frame window.
Window wID
Window id for the frame window.
int WBPointInWindow(Window wIDRef, int iX, int iY, Window wIDQuery)
Returna a non-zero value if X,Y coordinates relative to the reference window are within the query win...
void WBSetWMProperties(Window wID, const char *szTitle, XSizeHints *pNormalHints, XWMHints *pWMHints, XClassHint *pClassHints)
assign standard WM (Window Manager) properties via XSetWMProperties
#define WBRectOverlapped(R1, R2)
Returns logical TRUE if the rectangle R1 overlaps/intersects R2.
static __inline__ XStandardColormap * PXM_StandardColormapFromColormap(Display *pDisplay, Colormap colormap)
create temporary XStandardColormap from a Colormap
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.
set this to disable tabs (single child frame only)
'window helper' main header file for the X11workbench Toolkit API
void WBFreeFont(Display *pDisplay, WB_FONT pFont)
free a WB_FONT that was created using one of the WBFont APIs
void FWRemoveContainedWindow(WBFrameWindow *pFW, WBChildFrame *pCont)
Removes a 'contained' window from a frame window. Does not destroy the 'contained' window.
void WBClearWindow(Window wID, WBGC gc)
'Paint' helper, erases background by painting the background color within the clipping region
#define WB_DEBUG_PRINT(L,...)
Preferred method of implementing conditional debug output.
set this flag for application top-level window and whenever it is destroyed the application will exit
int WBFontAscent(WB_FONTC pFont0)
Get the maximum character ascent from a WB_FONT.
Utilities for copying and drawing text, determining text extents, and so on.
void FWDestroyFrameWindow2(WBFrameWindow *pFrameWindow)
Function to destroy a frame window based on the WBFrameWindow structure.
bold font weight (mutually exclusive0
int WBKeyEventProcessKey(const XKeyEvent *pEvent, char *pBuf, int *pcbLen, int *piAltCtrlShift)
Generic keyboard event translation utility.
int WBUnmapWindow(Display *pDisplay, Window wID)
wrapper for XUnmapWindow, makes window invisible without destroying it
#define WBPointInRect(X, Y, R)
Returns logical TRUE if the point (X,Y) is within the borders of the rectangle 'R'.
int WBFontAvgCharWidth(WB_FONTC pFont0)
Get the average character width for a font.
void FWDestroyFrameWindow(Window wID)
Function to destroy a frame window based on the Window id.
void WBCreateWindowDefaultGC(Window wID, unsigned long clrFG, unsigned long clrBG)
creates a default WBGC for a window
void WBGetWindowRect(Window wID, WB_RECT *pRect)
Returns the WB_RECT (rectangle) defined by the window's geometry, including the border area.
void WBInitWindowAttributes(XSetWindowAttributes *pXSWA, unsigned long lBorderPixel, unsigned long lBackgroundPixel, Colormap clrMap, int iBitGravity)
initializes the XSetWIndowAttributes structure with minimal attributes
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.
WBFWMenuHandler * pMenuHandler
menu handler for this child frame's menu (NULL = 'use default')
structure for managing menu callbacks
int FWGetChildFrameIndex(WBFrameWindow *pFW, WBChildFrame *pCont)
Sets the focus to a specific contained window using its tab order index.
WB_FONT WBCopyFont(Display *pDisplay, WB_FONTC pOldFont)
make a copy of an existing font (best when assigning to a window)
Window wID
window identifier for the 'Child Frame' window. may contain 'None' while being destroyed
#define FRAME_WINDOW_TAG
TAG for the WBFrameWindow structure.
const char * CHGetStaticBackgroundColor(Display *pDisplay)
returns background color for static elements
mask for the 'justification' value
static __inline__ WBFrameWindow * FWGetFrameWindowStruct(Window wID)
Obtain the associated WBFrameWindow structure pointer for a frame window's Window ID.
int WBWindowDispatch(Window wID, XEvent *pEvent)
Dispatches a window XEvent. May be called directly.
const char * WBEventName(int iEventID)
debug function to return the name of an X11 event
WB_FONT WBCopyModifyFont(Display *pDisplay, WB_FONTC pOriginal, int iFontSize, int iFlags)
load and modify a font according to the specified size and flags
WB_FONTC FWGetFont(WBFrameWindow *pFW)
Get the frame window WB_FONTC.
Atom aWM_DELETE_WINDOW
Delete Window notification event.
horizontally centered text. tabs are treated as white space
void WBDrawLeftArrow(Display *pDisplay, Drawable wID, WBGC gc, WB_GEOM *pgeomRect, unsigned long lColor)
Draw a left arrow in a window within a specified geometry.
void FWSetMenuHandlers(WBFrameWindow *pFW, const WBFWMenuHandler *pHandlerArray)
Function to assign the default menu handler to a frame window.
int WBPostPriorityEvent(Window wID, XEvent *pEvent)
Places a copy of the specified event at the end of the priority (internal) event queue.
WB_FONTC FWGetBoldFont(WBFrameWindow *pFW)
Get the frame window bold WB_FONTC.
Atom aWB_CHAR
keystroke/character notifications generated by API
void WBGetClientRect(Window wID, WB_RECT *pRect)
Returns the WB_RECT (rectangle) defined by the window's geometry, excluding the border area.
static __inline__ Display * WBGetDefaultDisplay(void)
Returns the default Display.
internal wrapper struct for X11 'geometry' definition
'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.
set this to make window immediately visible
void FWChildFrameStatusChanged(WBChildFrame *pChildFrame)
Notify Child Frame to update status text in Frame Window.
void FWRecalcLayout(Window wID)
Force a frame window to recalculate its layout, which may involve resizing multiple contained windows...
void PXM_PixelToRGB(XStandardColormap *pMap, XColor *pColor)
Convert the pixel menber of an XColor to RGB.
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
uintptr_t lMenuID
menu ID (< 0x10000L) or const pointer to string
void * WBReAlloc(void *pBuf, int nNewSize)
High performance memory sub-allocator 're-allocate'.
int WBSetForeground(WBGC hGC, unsigned long foreground)
Assign foreground color, a wrapper for XSetForeground()
XColor FWGetDefaultFG(void)
Get the default foreground color.
#define COPY_COLOR_NAME(X, Y, Z)
macro to get a color name or use default if it does not exist in settings
#define WBGetWindowCopyGC2(wID, gcSrc)
makes a copy of the specified WBGC for the desired window
void FWSetFocusWindow(WBFrameWindow *pFW, WBChildFrame *pCont)
Sets the focus to a specific contained window using the Window ID.
#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
void FWChildFrameRecalcLayout(WBChildFrame *pChildFrame)
Child frame notification callback (called by frame window)
XColor FWGetDefaultBD(void)
Get the default border color.
int WBDrawLines(Display *display, Drawable d, WBGC gc, XPoint *points, int npoints, int mode)
Wrapper for XDrawLine()
Atom aTAB_MESSAGE
command sent by Client Message related to 'tab' operations
Child Frame API functions.
void WBDrawRightArrow(Display *pDisplay, Drawable wID, WBGC gc, WB_GEOM *pgeomRect, unsigned long lColor)
Draw a right arrow in a window within a specified geometry.
Region WBRectToRegion(const WB_RECT *pRect)
'Paint' helper, converts a WB_RECT structure to a Region.
void WBSetApplicationWindow(Window wID)
Assign the main 'Appklication' window.
center using entire text height (ascent + descent for single line)
const char * CHGetTextColor(Display *pDisplay)
returns text color
void * WBAlloc(int nSize)
High performance memory sub-allocator 'allocate'.
int FWAddContainedWindow(WBFrameWindow *pFW, WBChildFrame *pNew)
Adds a 'contained' window and returns the tab order index.
Window WBGetParentWindow(Window wID)
Returns the window's parent (or None if there is no parent)
#define END_XCALL_DEBUG_WRAPPER
wrapper macro for calls into the X11 library. This macro follows the call(s)
void FWSetFocusWindowIndex(WBFrameWindow *pFW, int iIndex)
Sets the focus to a specific contained window using its tab order index.
int FWGetNumContWindows(const WBFrameWindow *pFW)
Returns the total number of 'contained' windows.
void FWSetUserCallback(WBFrameWindow *pFW, WBWinEvent pCallBack)
assign a new WBWinEvent callback function for a frame window
int WBSetRegion(WBGC hGC, Region rgnClip)
Assign clipping region, wrapper for XSetRegion()
Window WBGetMenuWindow(Window wID)
Returns the Window ID of the (first) menu window assigned to a (frame) window.
const char * CHGetHighlightBackgroundColor(Display *pDisplay)
returns highlight background color
#define WB_ERROR_PRINT(...)
Preferred method of implementing an 'error level' debug message for all subsystems.
void WBFree(void *pBuf)
High performance memory sub-allocator 'free'.
static __inline__ void WBInvalidateRect(Window wID, const WB_RECT *pRCT, int bPaintFlag)
'Paint' helper, invalidates a WB_RECT for asynchronous Expose event generation
int WBPostEvent(Window wID, XEvent *pEvent)
Places a copy of the specified event at the end of the regular (internal) event queue.
void WBDestroyWindow(Window wID)
Destroy a window.
represents a 'break' (marks end of a column)
#define WB_KEYEVENT_SHIFT
'AltCtrlShift' bit flag for Shift modifier for WBKeyEventProcessKey()
int(* UIcallback)(WBMenu *, WBMenuItem *)
menu 'UI' callback to handle displaying menu states.
mask for the actual tab value
#define WB_MOUSE_INPUT_MASK
'Mouse' input mask, bit flag for window creation
void FWSetStatusTabInfo(WBFrameWindow *pFW, int nTabs, const int *pTabs)
Sets the 'status' tab info for a Frame Window with a status bar.
void WBUpdateWindow(Window wID)
'Paint' helper, generates an asynchronous Expose event for non-empty 'invalid' region
void WBSetWindowIcon(Window wID, int idIcon)
assigns an icon resource (by ID) to a window
void FWDestroyChildFrame(WBChildFrame *pChildFrame)
Destroy an Child Frame.
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.
void WBDispatch(XEvent *pEvent)
Generic Event Dispatcher, using message type to dispatch.
#define WB_STANDARD_INPUT_MASK
'Standard' input mask, bit flag for window creation
#define WB_KEYEVENT_ACSMASK
'AltCtrlShift' bit mask for Alt+Ctrl+Shift bits for WBKeyEventProcessKey()
int(* WBWinEvent)(Window wID, XEvent *pEvent)
event callback function type for window events
Atom aWM_TAKE_FOCUS
'Take Focus' - TODO document this properly
XColor FWGetDefaultBG(void)
Get the default background color.
main controlling structure for frame windows
bit flag to 'right justify' the column location
internal wrapper struct for 'rectangle' definition
int WBFontDescent(WB_FONTC pFont0)
Get the maximum character descent from a WB_FONT.
Atom aQUERY_CLOSE
query if it's ok to close (and optionally destroy yourself if ok) a window
int(* callback)(XClientMessageEvent *)
menu callback (gets pointer to the 'XClientMessageEvent').
WBFrameWindow * pOwner
a pointer to the WBFrameWindow owner
WBChildFrame * FWGetContainedWindowByIndex(const WBFrameWindow *pFW, int iIndex)
Returns the Window ID for the specified 'contained' window. The index follows the tab order.
Display * WBGetWindowDisplay(Window wID)
returns the Display associated with a window
void WBFreeGC(WBGC hGC)
Free resources for a WBGC, wrapper for XFreeGC()
void WBSetWindowData(Window wID, int iIndex, void *pData)
assign 'data pointer' for a window and specified index value
void WBSetWMProtocols(Window wID, Atom aProperty,...)
re-assign standard WM (Window Manager) 'window type' properties and notify the root window (reserved)
void WBDraw3DBorderRect(Display *pDisplay, Drawable wID, WBGC gc, WB_GEOM *pgeomBorder, unsigned long lBorderColor1, unsigned long lBorderColor2)
Draw a 3D 'border' rectangle.
unsigned int ulTag
tag indicating I'm a frame window
#define BEGIN_XCALL_DEBUG_WRAPPER
wrapper macro for calls into the X11 library. This macro precedes the call(s)
void WBSetInputFocus(Window wID)
set input focus to a specific window
int WBFillRectangle(Display *display, Drawable d, WBGC gc, int x, int y, unsigned int width, unsigned int height)
Wrapper for XFillRectangle()
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified...
char * WBCopyString(const char *pSrc)
A simple utility that returns a WBAlloc() copy of a 0-byte terminated string.
#define WB_KEYBOARD_INPUT_MASK
'Keyboard' input mask, bit flag for window creation
WBFrameWindow * FWCreateFrameWindow(const char *szTitle, int idIcon, const char *szMenuResource, int iX, int iY, int iWidth, int iHeight, WBWinEvent pUserCallback, int iFlags)
Create a frame window.
set this to enable a 'status bar' at the bottom
void WBEndPaint(Window wID, WBGC gc)
'Paint' helper, frees resources and marks the update region 'valid'
internal wrapper struct for GC with local cache
Structure that defines a Child Frame within a Frame Window.
Atom aRESIZE_NOTIFY
notification of window re-size via ClientMessage
Atom aSET_FOCUS
dialog focus messages
void FWSetStatusText(WBFrameWindow *pFW, const char *szText)
Sets the 'status' text for a Frame Window with a status bar, forcing a re-paint.
const char * CHGetBorderColor(Display *pDisplay)
returns border color
int WBMapWindow(Display *pDisplay, Window wID)
Wrapper for XMapWindow, makes window visible.
Frame Window API functions and definitions.
void FWMoveChildFrameTabIndex(WBFrameWindow *pFW, WBChildFrame *pCont, int iIndex)
Sets the specific contained window to a particular index in the tab order.
Atom aImageAtom
'image' atom for display in tabs. default is 'None'. You should not alter this member directly.
char * szDisplayName
display name shown in tab and title bar. You should not alter this member directly.
#define WB_WARN_PRINT(...)
Preferred method of implementing a 'warning level' debug message for all subsystems.
void WBDraw3DBorderTab(Display *pDisplay, Drawable dw, WBGC gc, WB_GEOM *pgeomOutline, int fFocus, unsigned long lFGColor, unsigned long lBGColor, unsigned long lBorderColor1, unsigned long lBorderColor2, unsigned long lHighlightColor, WB_FONTC pFont, WB_FONTC pFontBold, Atom aGraphic, const char *szText)
Draw a 'tab' within a specified 'outline' rectangle.
char * pszMenuResource
resource string for this child frame's menu (NULL = 'use default')
void WBRemoveMenuWindow(Window wID, Window wIDMenu)
Remove (detach) the specified menu window from a (frame) window.
WBGC WBBeginPaintGeom(Window wID, WB_GEOM *pgBounds)
'Paint' helper, creates a WBGC for use in updating the window for a specified rectangular area
#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 ...