X11 Work Bench Toolkit  1.0
menu.c File Reference

Implementation file for menus. 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 <ctype.h>
#include <X11/cursorfont.h>
#include <X11/keysymdef.h>
#include "window_helper.h"
#include "pixmap_helper.h"
#include "frame_window.h"
#include "menu.h"
#include "conf_help.h"
#include "menu_bar.h"
#include "menu_popup.h"

Go to the source code of this file.

Macros

#define XK_MISCELLANY   /* mostly for interix */
 
#define NEXT_LINE(X, Y)   { while(*X && *X <= ' ' && *X != '\t' && *X != '\n') X++; Y=X; while(*X && *X != '\n') X++; if(*X=='\n') X++; }
 
#define NEXT_COL(X, Y, Z)
 
#define ALT_HOTKEY   0x80000000L
 
#define CTRL_HOTKEY   0x40000000L
 
#define SHIFT_HOTKEY   0x20000000L
 

Functions

static int InternalPopulateMenuFromResource (WBMenu *pMenu, int iID, const char *pszResource)
 
WBMenuMBCreateMenu (int iID, int iPopup, const char *pszResource, int iReserveSpace)
 Create a WBMenu from a text menu resource. More...
 
void MBDestroyMenu (WBMenu *pMenu)
 Destroy a WBMenu created by MBCreateMenu(), freeing up its resources. More...
 
int MBIsMenuValid (const WBMenu *pMenu)
 Check whether a 'WBMenu' pointer is valid. More...
 
int MBIsMenuItemValid (const WBMenuItem *pMenuItem)
 Check whether a 'WBMenuItem' pointer is valid. More...
 
void MBDestroyMenuItem (WBMenuItem *pMenuItem)
 Destroy a WBMenuItem created by MBCreateMenuItem(), freeing up its resources. More...
 
int MBAddMenuItem (WBMenu *pMenu, const WBMenuItem *pItem, int iPos)
 Add a WBMenuItem menu item to an existing WBMenu. More...
 
void MBRemoveMenuItem (WBMenu *pMenu, int iPos)
 Remove a WBMenuItem from a menu created by MBCreateMenu(), freeing up its resources. More...
 
int MBAddPopupMenu (WBMenu *pMenu, const WBMenu *pPopupMenu)
 Add a WBMenuItem menu item to an existing WBMenu. More...
 
WBMenuMBFindPopupMenu (WBMenu *pMenu, int idPopup)
 Locate a WBMenu 'popup' within a menu created by MBCreateMenu() More...
 
void MBRemovePopupMenu (WBMenu *pMenu, int idPopup)
 Remove a WBMenu 'popup' from a menu created by MBCreateMenu(), freeing up its resources. More...
 
WBMenuMBCopyMenu (const WBMenu *pMenu, int iReserveSpace)
 Create a copy of a WBMenu from an existing WBMenu. More...
 
static void InternalLocateMenuInResource (const char *pszResource, int *piID, const char **ppStart, const char **ppEnd)
 
static int TranslateHotKeyText (const char *szText)
 
static int ProcessHotKeyText (const char *szText)
 
WBMenuItemMBCreateMenuItem (const char **ppszResource)
 Create a single allocated WBMenuItem structure from a text menu resource, advancing the source text pointer to the next menu item. More...
 
static void __PostMenuActivateEvent (WBMenu *pMenu, WBMenuItem *pItem, int iIndex, int iIsPopup)
 
static WBMenuItem__HotKeySearchRecurse (WBMenu *pMenu, int iHotKey, int *piIndex, int iLevel)
 
static WBMenuItem__HotKeySearch (WBMenu *pMenu, int iHotKey, int *piIndex)
 
int MBMenuProcessHotKey (WBMenu *pMenu, XKeyEvent *pEvent)
 Event handler for menu hotkeys. More...
 

Detailed Description

Implementation file for menus.

This is the implementation file for menus, their interpretation, construction, manipulation, and destruction

Definition in file menu.c.

Macro Definition Documentation

#define NEXT_COL (   X,
  Y,
 
)
Value:
{ while(*X && *X <= ' ' && *X != '\t' && *X != '\n' && X < Z) X++; \
Y=X; while(*X && *X != '\t' && *X != '\n' && X < Z) X++; if(*X == '\t' || *X == '\n') X++; }

Definition at line 363 of file menu.c.