jpayne@69: /* jpayne@69: * tkMenu.h -- jpayne@69: * jpayne@69: * Declarations shared among all of the files that implement menu jpayne@69: * widgets. jpayne@69: * jpayne@69: * Copyright (c) 1996-1998 by Sun Microsystems, Inc. jpayne@69: * jpayne@69: * See the file "license.terms" for information on usage and redistribution of jpayne@69: * this file, and for a DISCLAIMER OF ALL WARRANTIES. jpayne@69: */ jpayne@69: jpayne@69: #ifndef _TKMENU jpayne@69: #define _TKMENU jpayne@69: jpayne@69: #ifndef _TKINT jpayne@69: #include "tkInt.h" jpayne@69: #endif jpayne@69: jpayne@69: #ifndef _DEFAULT jpayne@69: #include "default.h" jpayne@69: #endif jpayne@69: jpayne@69: /* jpayne@69: * Dummy types used by the platform menu code. jpayne@69: */ jpayne@69: jpayne@69: typedef struct TkMenuPlatformData_ *TkMenuPlatformData; jpayne@69: typedef struct TkMenuPlatformEntryData_ *TkMenuPlatformEntryData; jpayne@69: jpayne@69: /* jpayne@69: * Legal values for the "compound" field of TkMenuEntry and TkMenuButton jpayne@69: * records. jpayne@69: */ jpayne@69: jpayne@69: enum compound { jpayne@69: COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE, jpayne@69: COMPOUND_RIGHT, COMPOUND_TOP jpayne@69: }; jpayne@69: jpayne@69: /* jpayne@69: * Additional menu entry drawing parameters for Windows platform. jpayne@69: * DRAW_MENU_ENTRY_ARROW makes TkpDrawMenuEntry draw the arrow jpayne@69: * itself when cascade entry is disabled. jpayne@69: * DRAW_MENU_ENTRY_NOUNDERLINE forbids underline when ODS_NOACCEL jpayne@69: * is set, thus obeying the system-wide Windows UI setting. jpayne@69: */ jpayne@69: jpayne@69: enum drawingParameters { jpayne@69: DRAW_MENU_ENTRY_ARROW = (1<<0), jpayne@69: DRAW_MENU_ENTRY_NOUNDERLINE = (1<<1) jpayne@69: }; jpayne@69: jpayne@69: /* jpayne@69: * One of the following data structures is kept for each entry of each menu jpayne@69: * managed by this file: jpayne@69: */ jpayne@69: jpayne@69: typedef struct TkMenuEntry { jpayne@69: int type; /* Type of menu entry; see below for valid jpayne@69: * types. */ jpayne@69: struct TkMenu *menuPtr; /* Menu with which this entry is jpayne@69: * associated. */ jpayne@69: Tk_OptionTable optionTable; /* Option table for this menu entry. */ jpayne@69: Tcl_Obj *labelPtr; /* Main text label displayed in entry (NULL if jpayne@69: * no label). */ jpayne@69: int labelLength; /* Number of non-NULL characters in label. */ jpayne@69: int state; /* State of button for display purposes: jpayne@69: * normal, active, or disabled. */ jpayne@69: int underline; /* Value of -underline option: specifies index jpayne@69: * of character to underline (<0 means don't jpayne@69: * underline anything). */ jpayne@69: Tcl_Obj *underlinePtr; /* Index of character to underline. */ jpayne@69: Tcl_Obj *bitmapPtr; /* Bitmap to display in menu entry, or NULL. jpayne@69: * If not NULL then label is ignored. */ jpayne@69: Tcl_Obj *imagePtr; /* Name of image to display, or NULL. If not jpayne@69: * NULL, bitmap, text, and textVarName are jpayne@69: * ignored. */ jpayne@69: Tk_Image image; /* Image to display in menu entry, or NULL if jpayne@69: * none. */ jpayne@69: Tcl_Obj *selectImagePtr; /* Name of image to display when selected, or jpayne@69: * NULL. */ jpayne@69: Tk_Image selectImage; /* Image to display in entry when selected, or jpayne@69: * NULL if none. Ignored if image is NULL. */ jpayne@69: Tcl_Obj *accelPtr; /* Accelerator string displayed at right of jpayne@69: * menu entry. NULL means no such accelerator. jpayne@69: * Malloc'ed. */ jpayne@69: int accelLength; /* Number of non-NULL characters in jpayne@69: * accelerator. */ jpayne@69: int indicatorOn; /* True means draw indicator, false means jpayne@69: * don't draw it. This field is ignored unless jpayne@69: * the entry is a radio or check button. */ jpayne@69: /* jpayne@69: * Display attributes jpayne@69: */ jpayne@69: jpayne@69: Tcl_Obj *borderPtr; /* Structure used to draw background for jpayne@69: * entry. NULL means use overall border for jpayne@69: * menu. */ jpayne@69: Tcl_Obj *fgPtr; /* Foreground color to use for entry. NULL jpayne@69: * means use foreground color from menu. */ jpayne@69: Tcl_Obj *activeBorderPtr; /* Used to draw background and border when jpayne@69: * element is active. NULL means use jpayne@69: * activeBorder from menu. */ jpayne@69: Tcl_Obj *activeFgPtr; /* Foreground color to use when entry is jpayne@69: * active. NULL means use active foreground jpayne@69: * from menu. */ jpayne@69: Tcl_Obj *indicatorFgPtr; /* Color for indicators in radio and check jpayne@69: * button entries. NULL means use indicatorFg jpayne@69: * GC from menu. */ jpayne@69: Tcl_Obj *fontPtr; /* Text font for menu entries. NULL means use jpayne@69: * overall font for menu. */ jpayne@69: int columnBreak; /* If this is 0, this item appears below the jpayne@69: * item in front of it. If this is 1, this jpayne@69: * item starts a new column. This field is jpayne@69: * always 0 for tearoff and separator jpayne@69: * entries. */ jpayne@69: int hideMargin; /* If this is 0, then the item has enough jpayne@69: * margin to accommodate a standard check mark jpayne@69: * and a default right margin. If this is 1, jpayne@69: * then the item has no such margins, and jpayne@69: * checkbuttons and radiobuttons with this set jpayne@69: * will have a rectangle drawn in the jpayne@69: * indicator around the item if the item is jpayne@69: * checked. This is useful for palette menus. jpayne@69: * This field is ignored for separators and jpayne@69: * tearoffs. */ jpayne@69: int indicatorSpace; /* The width of the indicator space for this jpayne@69: * entry. */ jpayne@69: int labelWidth; /* Number of pixels to allow for displaying jpayne@69: * labels in menu entries. */ jpayne@69: int compound; /* Value of -compound option; specifies jpayne@69: * whether the entry should show both an image jpayne@69: * and text, and, if so, how. */ jpayne@69: jpayne@69: /* jpayne@69: * Information used to implement this entry's action: jpayne@69: */ jpayne@69: jpayne@69: Tcl_Obj *commandPtr; /* Command to invoke when entry is invoked. jpayne@69: * Malloc'ed. */ jpayne@69: Tcl_Obj *namePtr; /* Name of variable (for check buttons and jpayne@69: * radio buttons) or menu (for cascade jpayne@69: * entries). Malloc'ed. */ jpayne@69: Tcl_Obj *onValuePtr; /* Value to store in variable when selected jpayne@69: * (only for radio and check buttons). jpayne@69: * Malloc'ed. */ jpayne@69: Tcl_Obj *offValuePtr; /* Value to store in variable when not jpayne@69: * selected (only for check buttons). jpayne@69: * Malloc'ed. */ jpayne@69: jpayne@69: /* jpayne@69: * Information used for drawing this menu entry. jpayne@69: */ jpayne@69: jpayne@69: int width; /* Number of pixels occupied by entry in jpayne@69: * horizontal dimension. Not used except in jpayne@69: * menubars. The width of norma menus is jpayne@69: * dependent on the rest of the menu. */ jpayne@69: int x; /* X-coordinate of leftmost pixel in entry. */ jpayne@69: int height; /* Number of pixels occupied by entry in jpayne@69: * vertical dimension, including raised border jpayne@69: * drawn around entry when active. */ jpayne@69: int y; /* Y-coordinate of topmost pixel in entry. */ jpayne@69: GC textGC; /* GC for drawing text in entry. NULL means jpayne@69: * use overall textGC for menu. */ jpayne@69: GC activeGC; /* GC for drawing text in entry when active. jpayne@69: * NULL means use overall activeGC for jpayne@69: * menu. */ jpayne@69: GC disabledGC; /* Used to produce disabled effect for entry. jpayne@69: * NULL means use overall disabledGC from menu jpayne@69: * structure. See comments for disabledFg in jpayne@69: * menu structure for more information. */ jpayne@69: GC indicatorGC; /* For drawing indicators. NULL means use GC jpayne@69: * from menu. */ jpayne@69: jpayne@69: /* jpayne@69: * Miscellaneous fields. jpayne@69: */ jpayne@69: jpayne@69: int entryFlags; /* Various flags. See below for jpayne@69: * definitions. */ jpayne@69: int index; /* Need to know which index we are. This is jpayne@69: * zero-based. This is the top-left entry of jpayne@69: * the menu. */ jpayne@69: jpayne@69: /* jpayne@69: * Bookeeping for main menus and cascade menus. jpayne@69: */ jpayne@69: jpayne@69: struct TkMenuReferences *childMenuRefPtr; jpayne@69: /* A pointer to the hash table entry for the jpayne@69: * child menu. Stored here when the menu entry jpayne@69: * is configured so that a hash lookup is not jpayne@69: * necessary later.*/ jpayne@69: struct TkMenuEntry *nextCascadePtr; jpayne@69: /* The next cascade entry that is a parent of jpayne@69: * this entry's child cascade menu. NULL end jpayne@69: * of list, this is not a cascade entry, or jpayne@69: * the menu that this entry point to does not jpayne@69: * yet exist. */ jpayne@69: TkMenuPlatformEntryData platformEntryData; jpayne@69: /* The data for the specific type of menu. jpayne@69: * Depends on platform and menu type what kind jpayne@69: * of options are in this structure. */ jpayne@69: } TkMenuEntry; jpayne@69: jpayne@69: /* jpayne@69: * Flag values defined for menu entries: jpayne@69: * jpayne@69: * ENTRY_SELECTED: Non-zero means this is a radio or check button jpayne@69: * and that it should be drawn in the "selected" jpayne@69: * state. jpayne@69: * ENTRY_NEEDS_REDISPLAY: Non-zero means the entry should be redisplayed. jpayne@69: * ENTRY_LAST_COLUMN: Used by the drawing code. If the entry is in jpayne@69: * the last column, the space to its right needs jpayne@69: * to be filled. jpayne@69: * ENTRY_PLATFORM_FLAG1 - 4 These flags are reserved for use by the jpayne@69: * platform-dependent implementation of menus jpayne@69: * and should not be used by anything else. jpayne@69: */ jpayne@69: jpayne@69: #define ENTRY_SELECTED 1 jpayne@69: #define ENTRY_NEEDS_REDISPLAY 2 jpayne@69: #define ENTRY_LAST_COLUMN 4 jpayne@69: #define ENTRY_PLATFORM_FLAG1 (1 << 30) jpayne@69: #define ENTRY_PLATFORM_FLAG2 (1 << 29) jpayne@69: #define ENTRY_PLATFORM_FLAG3 (1 << 28) jpayne@69: #define ENTRY_PLATFORM_FLAG4 (1 << 27) jpayne@69: jpayne@69: /* jpayne@69: * Types defined for MenuEntries: jpayne@69: */ jpayne@69: jpayne@69: #define CASCADE_ENTRY 0 jpayne@69: #define CHECK_BUTTON_ENTRY 1 jpayne@69: #define COMMAND_ENTRY 2 jpayne@69: #define RADIO_BUTTON_ENTRY 3 jpayne@69: #define SEPARATOR_ENTRY 4 jpayne@69: #define TEAROFF_ENTRY 5 jpayne@69: jpayne@69: /* jpayne@69: * Menu states jpayne@69: */ jpayne@69: jpayne@69: #define ENTRY_ACTIVE 0 jpayne@69: #define ENTRY_NORMAL 1 jpayne@69: #define ENTRY_DISABLED 2 jpayne@69: jpayne@69: /* jpayne@69: * A data structure of the following type is kept for each menu widget: jpayne@69: */ jpayne@69: jpayne@69: typedef struct TkMenu { jpayne@69: Tk_Window tkwin; /* Window that embodies the pane. NULL means jpayne@69: * that the window has been destroyed but the jpayne@69: * data structures haven't yet been cleaned jpayne@69: * up. */ jpayne@69: Display *display; /* Display containing widget. Needed, among jpayne@69: * other things, so that resources can be jpayne@69: * freed up even after tkwin has gone away. */ jpayne@69: Tcl_Interp *interp; /* Interpreter associated with menu. */ jpayne@69: Tcl_Command widgetCmd; /* Token for menu's widget command. */ jpayne@69: TkMenuEntry **entries; /* Array of pointers to all the entries in the jpayne@69: * menu. NULL means no entries. */ jpayne@69: int numEntries; /* Number of elements in entries. */ jpayne@69: int active; /* Index of active entry. -1 means nothing jpayne@69: * active. */ jpayne@69: int menuType; /* MAIN_MENU, TEAROFF_MENU, or MENUBAR. See jpayne@69: * below for definitions. */ jpayne@69: Tcl_Obj *menuTypePtr; /* Used to control whether created tkwin is a jpayne@69: * toplevel or not. "normal", "menubar", or jpayne@69: * "toplevel" */ jpayne@69: jpayne@69: /* jpayne@69: * Information used when displaying widget: jpayne@69: */ jpayne@69: jpayne@69: Tcl_Obj *borderPtr; /* Structure used to draw 3-D border and jpayne@69: * background for menu. */ jpayne@69: Tcl_Obj *borderWidthPtr; /* Width of border around whole menu. */ jpayne@69: Tcl_Obj *activeBorderPtr; /* Used to draw background and border for jpayne@69: * active element (if any). */ jpayne@69: Tcl_Obj *activeBorderWidthPtr; jpayne@69: /* Width of border around active element. */ jpayne@69: Tcl_Obj *reliefPtr; /* 3-d effect: TK_RELIEF_RAISED, etc. */ jpayne@69: Tcl_Obj *fontPtr; /* Text font for menu entries. */ jpayne@69: Tcl_Obj *fgPtr; /* Foreground color for entries. */ jpayne@69: Tcl_Obj *disabledFgPtr; /* Foreground color when disabled. NULL means jpayne@69: * use normalFg with a 50% stipple instead. */ jpayne@69: Tcl_Obj *activeFgPtr; /* Foreground color for active entry. */ jpayne@69: Tcl_Obj *indicatorFgPtr; /* Color for indicators in radio and check jpayne@69: * button entries. */ jpayne@69: Pixmap gray; /* Bitmap for drawing disabled entries in a jpayne@69: * stippled fashion. None means not allocated jpayne@69: * yet. */ jpayne@69: GC textGC; /* GC for drawing text and other features of jpayne@69: * menu entries. */ jpayne@69: GC disabledGC; /* Used to produce disabled effect. If jpayne@69: * disabledFg isn't NULL, this GC is used to jpayne@69: * draw text and icons for disabled entries. jpayne@69: * Otherwise text and icons are drawn with jpayne@69: * normalGC and this GC is used to stipple jpayne@69: * background across them. */ jpayne@69: GC activeGC; /* GC for drawing active entry. */ jpayne@69: GC indicatorGC; /* For drawing indicators. */ jpayne@69: GC disabledImageGC; /* Used for drawing disabled images. They have jpayne@69: * to be stippled. This is created when the jpayne@69: * image is about to be drawn the first jpayne@69: * time. */ jpayne@69: jpayne@69: /* jpayne@69: * Information about geometry of menu. jpayne@69: */ jpayne@69: jpayne@69: int totalWidth; /* Width of entire menu. */ jpayne@69: int totalHeight; /* Height of entire menu. */ jpayne@69: jpayne@69: /* jpayne@69: * Miscellaneous information: jpayne@69: */ jpayne@69: jpayne@69: int tearoff; /* 1 means this menu can be torn off. On some jpayne@69: * platforms, the user can drag an outline of jpayne@69: * the menu by just dragging outside of the jpayne@69: * menu, and the tearoff is created where the jpayne@69: * mouse is released. On others, an indicator jpayne@69: * (such as a dashed stripe) is drawn, and jpayne@69: * when the menu is selected, the tearoff is jpayne@69: * created. */ jpayne@69: Tcl_Obj *titlePtr; /* The title to use when this menu is torn jpayne@69: * off. If this is NULL, a default scheme will jpayne@69: * be used to generate a title for tearoff. */ jpayne@69: Tcl_Obj *tearoffCommandPtr; /* If non-NULL, points to a command to run jpayne@69: * whenever the menu is torn-off. */ jpayne@69: Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the jpayne@69: * C code, but used by keyboard traversal jpayne@69: * scripts. Malloc'ed, but may be NULL. */ jpayne@69: Tcl_Obj *cursorPtr; /* Current cursor for window, or NULL. */ jpayne@69: Tcl_Obj *postCommandPtr; /* Used to detect cycles in cascade hierarchy jpayne@69: * trees when preprocessing postcommands on jpayne@69: * some platforms. See PostMenu for more jpayne@69: * details. */ jpayne@69: int postCommandGeneration; /* Need to do pre-invocation post command jpayne@69: * traversal. */ jpayne@69: int menuFlags; /* Flags for use by X; see below for jpayne@69: * definition. */ jpayne@69: TkMenuEntry *postedCascade; /* Points to menu entry for cascaded submenu jpayne@69: * that is currently posted or NULL if no jpayne@69: * submenu posted. */ jpayne@69: struct TkMenu *nextInstancePtr; jpayne@69: /* The next instance of this menu in the jpayne@69: * chain. */ jpayne@69: struct TkMenu *masterMenuPtr; jpayne@69: /* A pointer to the original menu for this jpayne@69: * clone chain. Points back to this structure jpayne@69: * if this menu is a main menu. */ jpayne@69: void *reserved1; /* not used any more. */ jpayne@69: Tk_Window parentTopLevelPtr;/* If this menu is a menubar, this is the jpayne@69: * toplevel that owns the menu. Only jpayne@69: * applicable for menubar clones. */ jpayne@69: struct TkMenuReferences *menuRefPtr; jpayne@69: /* Each menu is hashed into a table with the jpayne@69: * name of the menu's window as the key. The jpayne@69: * information in this hash table includes a jpayne@69: * pointer to the menu (so that cascades can jpayne@69: * find this menu), a pointer to the list of jpayne@69: * toplevel widgets that have this menu as its jpayne@69: * menubar, and a list of menu entries that jpayne@69: * have this menu specified as a cascade. */ jpayne@69: TkMenuPlatformData platformData; jpayne@69: /* The data for the specific type of menu. jpayne@69: * Depends on platform and menu type what kind jpayne@69: * of options are in this structure. */ jpayne@69: Tk_OptionSpec *extensionPtr;/* Needed by the configuration package for jpayne@69: * this widget to be extended. */ jpayne@69: Tk_SavedOptions *errorStructPtr; jpayne@69: /* We actually have to allocate these because jpayne@69: * multiple menus get changed during one jpayne@69: * ConfigureMenu call. */ jpayne@69: } TkMenu; jpayne@69: jpayne@69: /* jpayne@69: * When the toplevel configure -menu command is executed, the menu may not jpayne@69: * exist yet. We need to keep a linked list of windows that reference a jpayne@69: * particular menu. jpayne@69: */ jpayne@69: jpayne@69: typedef struct TkMenuTopLevelList { jpayne@69: struct TkMenuTopLevelList *nextPtr; jpayne@69: /* The next window in the list. */ jpayne@69: Tk_Window tkwin; /* The window that has this menu as its jpayne@69: * menubar. */ jpayne@69: } TkMenuTopLevelList; jpayne@69: jpayne@69: /* jpayne@69: * The following structure is used to keep track of things which reference a jpayne@69: * menu. It is created when: jpayne@69: * - a menu is created. jpayne@69: * - a cascade entry is added to a menu with a non-null name jpayne@69: * - the "-menu" configuration option is used on a toplevel widget with a jpayne@69: * non-null parameter. jpayne@69: * jpayne@69: * One of these three fields must be non-NULL, but any of the fields may be jpayne@69: * NULL. This structure makes it easy to determine whether or not anything jpayne@69: * like recalculating platform data or geometry is necessary when one of the jpayne@69: * three actions above is performed. jpayne@69: */ jpayne@69: jpayne@69: typedef struct TkMenuReferences { jpayne@69: struct TkMenu *menuPtr; /* The menu data structure. This is NULL if jpayne@69: * the menu does not exist. */ jpayne@69: TkMenuTopLevelList *topLevelListPtr; jpayne@69: /* First in the list of all toplevels that jpayne@69: * have this menu as its menubar. NULL if no jpayne@69: * toplevel widgets have this menu as its jpayne@69: * menubar. */ jpayne@69: TkMenuEntry *parentEntryPtr;/* First in the list of all cascade menu jpayne@69: * entries that have this menu as their child. jpayne@69: * NULL means no cascade entries. */ jpayne@69: Tcl_HashEntry *hashEntryPtr;/* This is needed because the pathname of the jpayne@69: * window (which is what we hash on) may not jpayne@69: * be around when we are deleting. */ jpayne@69: } TkMenuReferences; jpayne@69: jpayne@69: /* jpayne@69: * Flag bits for menus: jpayne@69: * jpayne@69: * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has jpayne@69: * already been queued to redraw this window. jpayne@69: * RESIZE_PENDING: Non-zero means a call to ComputeMenuGeometry jpayne@69: * has already been scheduled. jpayne@69: * MENU_DELETION_PENDING Non-zero means that we are currently jpayne@69: * destroying this menu's internal structures. jpayne@69: * This is useful when we are in the middle of jpayne@69: * cleaning this main menu's chain of menus up jpayne@69: * when TkDestroyMenu was called again on this jpayne@69: * menu (via a destroy binding or somesuch). jpayne@69: * MENU_WIN_DESTRUCTION_PENDING Non-zero means we are in the middle of jpayne@69: * destroying this menu's Tk_Window. jpayne@69: * MENU_PLATFORM_FLAG1... Reserved for use by the platform-specific menu jpayne@69: * code. jpayne@69: */ jpayne@69: jpayne@69: #define REDRAW_PENDING 1 jpayne@69: #define RESIZE_PENDING 2 jpayne@69: #define MENU_DELETION_PENDING 4 jpayne@69: #define MENU_WIN_DESTRUCTION_PENDING 8 jpayne@69: #define MENU_PLATFORM_FLAG1 (1 << 30) jpayne@69: #define MENU_PLATFORM_FLAG2 (1 << 29) jpayne@69: #define MENU_PLATFORM_FLAG3 (1 << 28) jpayne@69: jpayne@69: /* jpayne@69: * Each menu created by the user is a MAIN_MENU. When a menu is torn off, a jpayne@69: * TEAROFF_MENU instance is created. When a menu is assigned to a toplevel as jpayne@69: * a menu bar, a MENUBAR instance is created. All instances have the same jpayne@69: * configuration information. If the main instance is deleted, all instances jpayne@69: * are deleted. If one of the other instances is deleted, only that instance jpayne@69: * is deleted. jpayne@69: */ jpayne@69: jpayne@69: #define UNKNOWN_TYPE -1 jpayne@69: #define MAIN_MENU 0 jpayne@69: #define MASTER_MENU 0 jpayne@69: #define TEAROFF_MENU 1 jpayne@69: #define MENUBAR 2 jpayne@69: jpayne@69: /* jpayne@69: * Various geometry definitions: jpayne@69: */ jpayne@69: jpayne@69: #define CASCADE_ARROW_HEIGHT 10 jpayne@69: #define CASCADE_ARROW_WIDTH 8 jpayne@69: #define DECORATION_BORDER_WIDTH 2 jpayne@69: jpayne@69: /* jpayne@69: * Menu-related functions that are shared among Tk modules but not exported to jpayne@69: * the outside world: jpayne@69: */ jpayne@69: jpayne@69: MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, int index); jpayne@69: MODULE_SCOPE void TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr); jpayne@69: MODULE_SCOPE TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp, jpayne@69: const char *name); jpayne@69: MODULE_SCOPE void TkDestroyMenu(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkEventuallyRecomputeMenu(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkEventuallyRedrawMenu(TkMenu *menuPtr, jpayne@69: TkMenuEntry *mePtr); jpayne@69: MODULE_SCOPE TkMenuReferences*TkFindMenuReferences(Tcl_Interp *interp, const char *name); jpayne@69: MODULE_SCOPE TkMenuReferences*TkFindMenuReferencesObj(Tcl_Interp *interp, jpayne@69: Tcl_Obj *namePtr); jpayne@69: MODULE_SCOPE int TkFreeMenuReferences(TkMenuReferences *menuRefPtr); jpayne@69: MODULE_SCOPE Tcl_HashTable *TkGetMenuHashTable(Tcl_Interp *interp); jpayne@69: MODULE_SCOPE int TkGetMenuIndex(Tcl_Interp *interp, TkMenu *menuPtr, jpayne@69: Tcl_Obj *objPtr, int lastOK, int *indexPtr); jpayne@69: MODULE_SCOPE void TkMenuInitializeDrawingFields(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkMenuInitializeEntryDrawingFields(TkMenuEntry *mePtr); jpayne@69: MODULE_SCOPE int TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr, jpayne@69: int index); jpayne@69: MODULE_SCOPE void TkMenuConfigureDrawOptions(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE int TkMenuConfigureEntryDrawOptions( jpayne@69: TkMenuEntry *mePtr, int index); jpayne@69: MODULE_SCOPE void TkMenuFreeDrawOptions(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr); jpayne@69: MODULE_SCOPE void TkMenuEventProc(ClientData clientData, jpayne@69: XEvent *eventPtr); jpayne@69: MODULE_SCOPE void TkMenuImageProc(ClientData clientData, int x, int y, jpayne@69: int width, int height, int imgWidth, jpayne@69: int imgHeight); jpayne@69: MODULE_SCOPE void TkMenuInit(void); jpayne@69: MODULE_SCOPE void TkMenuSelectImageProc(ClientData clientData, int x, jpayne@69: int y, int width, int height, int imgWidth, jpayne@69: int imgHeight); jpayne@69: MODULE_SCOPE Tcl_Obj * TkNewMenuName(Tcl_Interp *interp, jpayne@69: Tcl_Obj *parentNamePtr, TkMenu *menuPtr); jpayne@69: MODULE_SCOPE int TkPostCommand(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE int TkPostSubmenu(Tcl_Interp *interp, TkMenu *menuPtr, jpayne@69: TkMenuEntry *mePtr); jpayne@69: MODULE_SCOPE int TkPostTearoffMenu(Tcl_Interp *interp, TkMenu *menuPtr, jpayne@69: int x, int y); jpayne@69: MODULE_SCOPE int TkPreprocessMenu(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkRecomputeMenu(TkMenu *menuPtr); jpayne@69: jpayne@69: /* jpayne@69: * These routines are the platform-dependent routines called by the common jpayne@69: * code. jpayne@69: */ jpayne@69: jpayne@69: MODULE_SCOPE void TkpComputeMenubarGeometry(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkpComputeStandardMenuGeometry(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE int TkpConfigureMenuEntry(TkMenuEntry *mePtr); jpayne@69: MODULE_SCOPE void TkpDestroyMenu(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE void TkpDestroyMenuEntry(TkMenuEntry *mEntryPtr); jpayne@69: MODULE_SCOPE void TkpDrawMenuEntry(TkMenuEntry *mePtr, jpayne@69: Drawable d, Tk_Font tkfont, jpayne@69: const Tk_FontMetrics *menuMetricsPtr, int x, jpayne@69: int y, int width, int height, int strictMotif, jpayne@69: int drawingParameters); jpayne@69: MODULE_SCOPE void TkpMenuInit(void); jpayne@69: MODULE_SCOPE int TkpMenuNewEntry(TkMenuEntry *mePtr); jpayne@69: MODULE_SCOPE int TkpNewMenu(TkMenu *menuPtr); jpayne@69: MODULE_SCOPE int TkpPostMenu(Tcl_Interp *interp, TkMenu *menuPtr, jpayne@69: int x, int y, int index); jpayne@69: MODULE_SCOPE int TkpPostTearoffMenu(Tcl_Interp *interp, TkMenu *menuPtr, jpayne@69: int x, int y, int index); jpayne@69: MODULE_SCOPE void TkpSetWindowMenuBar(Tk_Window tkwin, TkMenu *menuPtr); jpayne@69: jpayne@69: #endif /* _TKMENU */