X11 Work Bench Toolkit  1.0
menu_bar.c File Reference

Implementation file for menu bar windows. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <time.h>
#include <X11/cursorfont.h>
#include "window_helper.h"
#include "pixmap_helper.h"
#include "frame_window.h"
#include "menu_bar.h"
#include "menu_popup.h"
#include "conf_help.h"

Go to the source code of this file.


#define BORDER   32 /* was 1 */
#define MENU_FONT   "fixed"
#define MENU_ALT_FONT   "*-fixed-*"
#define MENU_FONT_SIZE   13
#define DEBUG_VALIDATE(X)   if(!(X)) { WB_WARN_PRINT("%s:%d - %s\n", __FUNCTION__, __LINE__, "WARNING - " #X " failed!\n"); }
#define LOAD_COLOR(X, Y, Z)   if(CHGetResourceString(WBGetDefaultDisplay(), X, Y, sizeof(Y)) <= 0){ WB_WARN_PRINT("%s - WARNING: can't find color %s, using default value %s\n", __FUNCTION__, X, Z); strcpy(Y,Z); }


int MBMenuParentEvent (Window wIDMenu, XEvent *pEvent)
int MBMenuWinEvent (Window wID, XEvent *pEvent)
static int MenuBarDoExposeEvent (XExposeEvent *pEvent, WBMenu *pMenu, Display *pDisplay, Window wID, WBMenuBarWindow *pSelf)
int MBInitGlobal (void)
 Initialize global resources for Menu Bar windows. More...
XFontStruct * MBGetDefaultMenuFont (void)
 Get a pointer to the default 'Menu Bar' font structure. More...
WBMenuBarWindowMBCreateMenuBarWindow (Window wIDParent, const char *pszResource, int iFlags)
 Create a Menu Bar windows and its associated WBMenuBarWindow structure. More...
static int __FindMenuBarWindowCallback (Window wID, void *pData)
WBMenuBarWindowMBFindMenuBarWindow (WBMenu *pMenu)
 Locate the first WBMenuBarWindow that is using a WBMenu structure. More...
void MBReCalcMenuBarWindow (WBMenuBarWindow *pMenuBar)
 Cause a 'layout recalculation' for a Menu Bar window. More...
void MBDestroyMenuBarWindow (WBMenuBarWindow *pMenuBar)
 Destroy a 'Menu Bar' window. More...
void MBSetMenuBarMenuResource (WBMenuBarWindow *pMenuBar, const char *pszResource)
 Assign a new WBMenu for a Menu Bar window. More...
static void MBMenuHandleMenuItem (Display *pDisplay, WBMenuBarWindow *pSelf, WBMenu *pMenu, WBMenuItem *pItem)


XColor clrMenuFG
 menu foreground color
XColor clrMenuBG
 menu background color
XColor clrMenuActiveFG
 menu 'active' foreground color
XColor clrMenuActiveBG
 menu 'active' background color
XColor clrMenuBorder1
 menu border color 1
XColor clrMenuBorder2
 menu border color 2
XColor clrMenuBorder3
 menu border color 3
XColor clrMenuDisabledFG
 menu 'disabled' foreground color
XColor clrMenuActiveDisabledFG
 menu 'disabled but active' foreground color
static int iInitColorFlag = 0
static XFontStruct * pDefaultMenuFont = NULL
 Internal Client Message Atom for 'RESIZE' notification (tells menu bar to resize itself) More...
 Internal Client Message Atom for 'ACTIVATE' notification. More...
 Internal Client Message Atom for 'DISPLAY POPUP' action. More...

Detailed Description

Implementation file for menu bar windows.

This is the implementation file for menus bars, which virtualize the menu structure's contents and handle user interaction

Definition in file menu_bar.c.