home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / generic / tkMenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-15  |  20.0 KB  |  542 lines  |  [TEXT/CWIE]

  1. /*
  2.  * tkMenu.h --
  3.  *
  4.  *    Declarations shared among all of the files that implement menu widgets.
  5.  *
  6.  * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
  7.  *
  8.  * See the file "license.terms" for information on usage and redistribution
  9.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10.  *
  11.  * SCCS: @(#) tkMenu.h 1.60 97/06/20 14:43:21
  12.  */
  13.  
  14. #ifndef _TKMENU
  15. #define _TKMENU
  16.  
  17. #ifndef _TK
  18. #include "tk.h"
  19. #endif
  20.  
  21. #ifndef _TKINT
  22. #include "tkInt.h"
  23. #endif
  24.  
  25. #ifndef _DEFAULT
  26. #include "default.h"
  27. #endif
  28.  
  29. /*
  30.  * Dummy types used by the platform menu code.
  31.  */
  32.  
  33. typedef struct TkMenuPlatformData_ *TkMenuPlatformData;
  34. typedef struct TkMenuPlatformEntryData_ *TkMenuPlatformEntryData;
  35.  
  36. /*
  37.  * One of the following data structures is kept for each entry of each
  38.  * menu managed by this file:
  39.  */
  40.  
  41. typedef struct TkMenuEntry {
  42.     int type;            /* Type of menu entry;  see below for
  43.                  * valid types. */
  44.     struct TkMenu *menuPtr;    /* Menu with which this entry is associated. */
  45.     char *label;        /* Main text label displayed in entry (NULL
  46.                  * if no label).  Malloc'ed. */
  47.     int labelLength;        /* Number of non-NULL characters in label. */
  48.     Tk_Uid state;        /* State of button for display purposes:
  49.                  * normal, active, or disabled. */
  50.     int underline;        /* Index of character to underline. */
  51.     Pixmap bitmap;        /* Bitmap to display in menu entry, or None.
  52.                  * If not None then label is ignored. */
  53.     char *imageString;        /* Name of image to display (malloc'ed), or
  54.                  * NULL.  If non-NULL, bitmap, text, and
  55.                  * textVarName are ignored. */
  56.     Tk_Image image;        /* Image to display in menu entry, or NULL if
  57.                  * none. */
  58.     char *selectImageString;    /* Name of image to display when selected
  59.                  * (malloc'ed), or NULL. */
  60.     Tk_Image selectImage;    /* Image to display in entry when selected,
  61.                  * or NULL if none.  Ignored if image is
  62.                  * NULL. */
  63.     char *accel;        /* Accelerator string displayed at right
  64.                  * of menu entry.  NULL means no such
  65.                  * accelerator.  Malloc'ed. */
  66.     int accelLength;        /* Number of non-NULL characters in
  67.                  * accelerator. */
  68.     int indicatorOn;        /* True means draw indicator, false means
  69.                  * don't draw it. */
  70.     /*
  71.      * Display attributes
  72.      */
  73.  
  74.     Tk_3DBorder border;        /* Structure used to draw background for
  75.                  * entry.  NULL means use overall border
  76.                  * for menu. */
  77.     XColor *fg;            /* Foreground color to use for entry.  NULL
  78.                  * means use foreground color from menu. */
  79.     Tk_3DBorder activeBorder;    /* Used to draw background and border when
  80.                  * element is active.  NULL means use
  81.                  * activeBorder from menu. */
  82.     XColor *activeFg;        /* Foreground color to use when entry is
  83.                  * active.  NULL means use active foreground
  84.                  * from menu. */
  85.     XColor *indicatorFg;    /* Color for indicators in radio and check
  86.                  * button entries.  NULL means use indicatorFg
  87.                  * GC from menu. */
  88.     Tk_Font tkfont;        /* Text font for menu entries.  NULL means
  89.                  * use overall font for menu. */
  90.     int columnBreak;        /* If this is 0, this item appears below
  91.                  * the item in front of it. If this is
  92.                  * 1, this item starts a new column. */
  93.     int hideMargin;        /* If this is 0, then the item has enough
  94.                      * margin to accomodate a standard check
  95.                      * mark and a default right margin. If this 
  96.                      * is 1, then the item has no such margins.
  97.                      * and checkbuttons and radiobuttons with
  98.                      * this set will have a rectangle drawn
  99.                      * in the indicator around the item if
  100.                      * the item is checked.
  101.                      * This is useful palette menus.*/ 
  102.     int indicatorSpace;        /* The width of the indicator space for this
  103.                  * entry.
  104.                  */
  105.     int labelWidth;        /* Number of pixels to allow for displaying
  106.                  * labels in menu entries. */
  107.  
  108.     /*
  109.      * Information used to implement this entry's action:
  110.      */
  111.  
  112.     char *command;        /* Command to invoke when entry is invoked.
  113.                  * Malloc'ed. */
  114.     char *name;            /* Name of variable (for check buttons and
  115.                  * radio buttons) or menu (for cascade
  116.                  * entries).  Malloc'ed.*/
  117.     char *onValue;        /* Value to store in variable when selected
  118.                  * (only for radio and check buttons).
  119.                  * Malloc'ed. */
  120.     char *offValue;        /* Value to store in variable when not
  121.                  * selected (only for check buttons).
  122.                  * Malloc'ed. */
  123.     
  124.     /*
  125.      * Information used for drawing this menu entry.
  126.      */
  127.      
  128.     int width;            /* Number of pixels occupied by entry in
  129.                  * horizontal dimension. Not used except
  130.                  * in menubars. The width of norma menus
  131.                  * is dependent on the rest of the menu. */
  132.     int x;            /* X-coordinate of leftmost pixel in entry */
  133.     int height;            /* Number of pixels occupied by entry in
  134.                  * vertical dimension, including raised
  135.                  * border drawn around entry when active. */
  136.     int y;            /* Y-coordinate of topmost pixel in entry. */
  137.     GC textGC;            /* GC for drawing text in entry.  NULL means
  138.                  * use overall textGC for menu. */
  139.     GC activeGC;        /* GC for drawing text in entry when active.
  140.                  * NULL means use overall activeGC for
  141.                  * menu. */
  142.     GC disabledGC;        /* Used to produce disabled effect for entry.
  143.                  * NULL means use overall disabledGC from
  144.                  * menu structure.  See comments for
  145.                  * disabledFg in menu structure for more
  146.                  * information. */
  147.     GC indicatorGC;        /* For drawing indicators.  None means use
  148.                  * GC from menu. */
  149.  
  150.     /*
  151.      * Miscellaneous fields.
  152.      */
  153.  
  154.     int entryFlags;        /* Various flags.  See below for
  155.                    definitions. */
  156.     int index;            /* Need to know which index we are. This
  157.                      * is zero-based. This is the top-left entry
  158.                      * of the menu. */
  159.                  
  160.     /*
  161.      * Bookeeping for master menus and cascade menus.
  162.      */
  163.      
  164.     struct TkMenuReferences *childMenuRefPtr;
  165.                     /* A pointer to the hash table entry for
  166.                      * the child menu. Stored here when the menu
  167.                      * entry is configured so that a hash lookup
  168.                      * is not necessary later.*/
  169.     struct TkMenuEntry *nextCascadePtr;
  170.                     /* The next cascade entry that is a parent of
  171.                      * this entry's child cascade menu. NULL
  172.                      * end of list, this is not a cascade entry,
  173.                      * or the menu that this entry point to
  174.                      * does not yet exist. */
  175.     TkMenuPlatformEntryData platformEntryData;
  176.                     /* The data for the specific type of menu.
  177.                    * Depends on platform and menu type what
  178.                    * kind of options are in this structure.
  179.                    */
  180. } TkMenuEntry;
  181.  
  182. /*
  183.  * Flag values defined for menu entries:
  184.  *
  185.  * ENTRY_SELECTED:        Non-zero means this is a radio or check
  186.  *                button and that it should be drawn in
  187.  *                the "selected" state.
  188.  * ENTRY_NEEDS_REDISPLAY:    Non-zero means the entry should be redisplayed.
  189.  * ENTRY_LAST_COLUMN:        Used by the drawing code. If the entry is in the
  190.  *                last column, the space to its right needs to
  191.  *                be filled.
  192.  * ENTRY_PLATFORM_FLAG1 - 4    These flags are reserved for use by the
  193.  *                platform-dependent implementation of menus
  194.  *                and should not be used by anything else.
  195.  */
  196.  
  197. #define ENTRY_SELECTED        1
  198. #define ENTRY_NEEDS_REDISPLAY    2
  199. #define ENTRY_LAST_COLUMN    4
  200. #define ENTRY_PLATFORM_FLAG1    (1 << 30)
  201. #define ENTRY_PLATFORM_FLAG2    (1 << 29)
  202. #define ENTRY_PLATFORM_FLAG3    (1 << 28)
  203. #define ENTRY_PLATFORM_FLAG4    (1 << 27)
  204.  
  205. /*
  206.  * Types defined for MenuEntries:
  207.  */
  208.  
  209. #define COMMAND_ENTRY        0
  210. #define SEPARATOR_ENTRY        1
  211. #define CHECK_BUTTON_ENTRY    2
  212. #define RADIO_BUTTON_ENTRY    3
  213. #define CASCADE_ENTRY        4
  214. #define TEAROFF_ENTRY        5
  215.  
  216. /*
  217.  * Mask bits for above types:
  218.  */
  219.  
  220. #define COMMAND_MASK        TK_CONFIG_USER_BIT
  221. #define SEPARATOR_MASK        (TK_CONFIG_USER_BIT << 1)
  222. #define CHECK_BUTTON_MASK    (TK_CONFIG_USER_BIT << 2)
  223. #define RADIO_BUTTON_MASK    (TK_CONFIG_USER_BIT << 3)
  224. #define CASCADE_MASK        (TK_CONFIG_USER_BIT << 4)
  225. #define TEAROFF_MASK        (TK_CONFIG_USER_BIT << 5)
  226. #define ALL_MASK        (COMMAND_MASK | SEPARATOR_MASK \
  227.     | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | CASCADE_MASK | TEAROFF_MASK)
  228.  
  229. /*
  230.  * A data structure of the following type is kept for each
  231.  * menu widget:
  232.  */
  233.  
  234. typedef struct TkMenu {
  235.     Tk_Window tkwin;        /* Window that embodies the pane.  NULL
  236.                  * means that the window has been destroyed
  237.                  * but the data structures haven't yet been
  238.                  * cleaned up.*/
  239.     Display *display;        /* Display containing widget.  Needed, among
  240.                  * other things, so that resources can be
  241.                  * freed up even after tkwin has gone away. */
  242.     Tcl_Interp *interp;        /* Interpreter associated with menu. */
  243.     Tcl_Command widgetCmd;    /* Token for menu's widget command. */
  244.     TkMenuEntry **entries;    /* Array of pointers to all the entries
  245.                  * in the menu.  NULL means no entries. */
  246.     int numEntries;        /* Number of elements in entries. */
  247.     int active;            /* Index of active entry.  -1 means
  248.                  * nothing active. */
  249.     int menuType;        /* MASTER_MENU, TEAROFF_MENU, or MENUBAR.
  250.                      * See below for definitions. */
  251.     char *menuTypeName;        /* Used to control whether created tkwin
  252.                  * is a toplevel or not. "normal", "menubar",
  253.                  * or "toplevel" */
  254.  
  255.     /*
  256.      * Information used when displaying widget:
  257.      */
  258.  
  259.     Tk_3DBorder border;        /* Structure used to draw 3-D
  260.                  * border and background for menu. */
  261.     int borderWidth;        /* Width of border around whole menu. */
  262.     Tk_3DBorder activeBorder;    /* Used to draw background and border for
  263.                  * active element (if any). */
  264.     int activeBorderWidth;    /* Width of border around active element. */
  265.     int relief;            /* 3-d effect: TK_RELIEF_RAISED, etc. */
  266.     Tk_Font tkfont;        /* Text font for menu entries. */
  267.     XColor *fg;            /* Foreground color for entries. */
  268.     XColor *disabledFg;        /* Foreground color when disabled.  NULL
  269.                  * means use normalFg with a 50% stipple
  270.                  * instead. */
  271.     XColor *activeFg;        /* Foreground color for active entry. */
  272.     XColor *indicatorFg;    /* Color for indicators in radio and check
  273.                  * button entries. */
  274.     Pixmap gray;        /* Bitmap for drawing disabled entries in
  275.                  * a stippled fashion.  None means not
  276.                  * allocated yet. */
  277.     GC textGC;            /* GC for drawing text and other features
  278.                  * of menu entries. */
  279.     GC disabledGC;        /* Used to produce disabled effect.  If
  280.                  * disabledFg isn't NULL, this GC is used to
  281.                  * draw text and icons for disabled entries.
  282.                  * Otherwise text and icons are drawn with
  283.                  * normalGC and this GC is used to stipple
  284.                  * background across them. */
  285.     GC activeGC;        /* GC for drawing active entry. */
  286.     GC indicatorGC;        /* For drawing indicators. */
  287.     GC disabledImageGC;        /* Used for drawing disabled images. They
  288.                  * have to be stippled. This is created
  289.                  * when the image is about to be drawn the
  290.                  * first time. */
  291.  
  292.     /*
  293.      * Information about geometry of menu.
  294.      */
  295.     
  296.     int totalWidth;        /* Width of entire menu */
  297.     int totalHeight;        /* Height of entire menu */
  298.    
  299.     /*
  300.      * Miscellaneous information:
  301.      */
  302.  
  303.     int tearOff;        /* 1 means this menu can be torn off. On some
  304.                      * platforms, the user can drag an outline
  305.                      * of the menu by just dragging outside of
  306.                      * the menu, and the tearoff is created where
  307.                      * the mouse is released. On others, an
  308.                  * indicator (such as a dashed stripe) is
  309.                  * drawn, and when the menu is selected, the
  310.                  * tearoff is created. */
  311.     char *title;        /* The title to use when this menu is torn
  312.                      * off. If this is NULL, a default scheme
  313.                      * will be used to generate a title for
  314.                      * tearoff. */
  315.     char *tearOffCommand;    /* If non-NULL, points to a command to
  316.                  * run whenever the menu is torn-off. */
  317.     char *takeFocus;        /* Value of -takefocus option;  not used in
  318.                  * the C code, but used by keyboard traversal
  319.                  * scripts.  Malloc'ed, but may be NULL. */
  320.     Tk_Cursor cursor;        /* Current cursor for window, or None. */
  321.     char *postCommand;        /* Used to detect cycles in cascade hierarchy
  322.                      * trees when preprocessing postcommands
  323.                      * on some platforms. See PostMenu for
  324.                      * more details. */
  325.     int postCommandGeneration;    /* Need to do pre-invocation post command
  326.                  * traversal */
  327.     int menuFlags;        /* Flags for use by X; see below for
  328.                    definition */
  329.     TkMenuEntry *postedCascade;    /* Points to menu entry for cascaded submenu
  330.                  * that is currently posted or NULL if no
  331.                  * submenu posted. */
  332.     struct TkMenu *nextInstancePtr;    
  333.                     /* The next instance of this menu in the
  334.                      * chain. */
  335.     struct TkMenu *masterMenuPtr;
  336.                     /* A pointer to the original menu for this
  337.                      * clone chain. Points back to this structure
  338.                      * if this menu is a master menu. */
  339.     Tk_Window parentTopLevelPtr;/* If this menu is a menubar, this is the
  340.                      * toplevel that owns the menu. Only applicable
  341.                      * for menubar clones.
  342.                      */
  343.     struct TkMenuReferences *menuRefPtr;    
  344.                     /* Each menu is hashed into a table with the
  345.                      * name of the menu's window as the key.
  346.                      * The information in this hash table includes
  347.                      * a pointer to the menu (so that cascades
  348.                      * can find this menu), a pointer to the
  349.                      * list of toplevel widgets that have this
  350.                      * menu as its menubar, and a list of menu
  351.                      * entries that have this menu specified
  352.                      * as a cascade. */    
  353.     TkMenuPlatformData platformData;
  354.                 /* The data for the specific type of menu.
  355.                    * Depends on platform and menu type what
  356.                    * kind of options are in this structure.
  357.                    */
  358. } TkMenu;
  359.  
  360. /*
  361.  * When the toplevel configure -menu command is executed, the menu may not
  362.  * exist yet. We need to keep a linked list of windows that reference
  363.  * a particular menu.
  364.  */
  365.  
  366. typedef struct TkMenuTopLevelList {
  367.     struct TkMenuTopLevelList *nextPtr;
  368.                     /* The next window in the list */
  369.     Tk_Window tkwin;        /* The window that has this menu as its
  370.                  * menubar. */
  371. } TkMenuTopLevelList;
  372.  
  373. /*
  374.  * The following structure is used to keep track of things which
  375.  * reference a menu. It is created when:
  376.  * - a menu is created.
  377.  * - a cascade entry is added to a menu with a non-null name
  378.  * - the "-menu" configuration option is used on a toplevel widget
  379.  * with a non-null parameter.
  380.  *
  381.  * One of these three fields must be non-NULL, but any of the fields may
  382.  * be NULL. This structure makes it easy to determine whether or not
  383.  * anything like recalculating platform data or geometry is necessary
  384.  * when one of the three actions above is performed.
  385.  */
  386.  
  387. typedef struct TkMenuReferences {
  388.     struct TkMenu *menuPtr;    /* The menu data structure. This is NULL
  389.                      * if the menu does not exist. */
  390.     TkMenuTopLevelList *topLevelListPtr;
  391.                     /* First in the list of all toplevels that 
  392.                      * have this menu as its menubar. NULL if no 
  393.                      * toplevel widgets have this menu as its
  394.                      * menubar. */
  395.     TkMenuEntry *parentEntryPtr;/* First in the list of all cascade menu 
  396.                      * entries that have this menu as their child.
  397.                      * NULL means no cascade entries. */
  398.     Tcl_HashEntry *hashEntryPtr;/* This is needed because the pathname of the
  399.                      * window (which is what we hash on) may not
  400.                      * be around when we are deleting.
  401.                      */
  402. } TkMenuReferences;
  403.  
  404. /*
  405.  * Flag bits for menus:
  406.  *
  407.  * REDRAW_PENDING:        Non-zero means a DoWhenIdle handler
  408.  *                has already been queued to redraw
  409.  *                this window.
  410.  * RESIZE_PENDING:        Non-zero means a call to ComputeMenuGeometry
  411.  *                has already been scheduled.
  412.  * MENU_DELETION_PENDING    Non-zero means that we are currently destroying
  413.  *                this menu. This is useful when we are in the 
  414.  *                middle of cleaning this master menu's chain of 
  415.  *                menus up when TkDestroyMenu was called again on
  416.  *                this menu (via a destroy binding or somesuch).
  417.  * MENU_PLATFORM_FLAG1...    Reserved for use by the platform-specific menu
  418.  *                code.
  419.  */
  420.  
  421. #define REDRAW_PENDING        1
  422. #define RESIZE_PENDING        2
  423. #define MENU_DELETION_PENDING    4
  424. #define MENU_PLATFORM_FLAG1    (1 << 30)
  425. #define MENU_PLATFORM_FLAG2    (1 << 29)
  426. #define MENU_PLATFORM_FLAG3    (1 << 28)
  427.  
  428. /*
  429.  * Each menu created by the user is a MASTER_MENU. When a menu is torn off,
  430.  * a TEAROFF_MENU instance is created. When a menu is assigned to a toplevel
  431.  * as a menu bar, a MENUBAR instance is created. All instances have the same
  432.  * configuration information. If the master instance is deleted, all instances
  433.  * are deleted. If one of the other instances is deleted, only that instance
  434.  * is deleted.
  435.  */
  436.  
  437. #define UNKNOWN_TYPE        -1
  438. #define MASTER_MENU         0
  439. #define TEAROFF_MENU         1
  440. #define MENUBAR         2
  441.  
  442. /*
  443.  * Various geometry definitions:
  444.  */
  445.  
  446. #define CASCADE_ARROW_HEIGHT 10
  447. #define CASCADE_ARROW_WIDTH 8
  448. #define DECORATION_BORDER_WIDTH 2
  449.  
  450. /*
  451.  * Configuration specs. Needed for platform-specific default initializations.
  452.  */
  453.  
  454. EXTERN Tk_ConfigSpec tkMenuEntryConfigSpecs[];
  455. EXTERN Tk_ConfigSpec tkMenuConfigSpecs[];
  456.  
  457. /*
  458.  * Menu-related procedures that are shared among Tk modules but not exported
  459.  * to the outside world:
  460.  */
  461.  
  462. EXTERN int        TkActivateMenuEntry _ANSI_ARGS_((TkMenu *menuPtr,
  463.                 int index));
  464. EXTERN void        TkBindMenu _ANSI_ARGS_((
  465.                 Tk_Window tkwin, TkMenu *menuPtr));
  466. EXTERN TkMenuReferences *
  467.             TkCreateMenuReferences _ANSI_ARGS_((Tcl_Interp *interp,
  468.                 char *pathName));
  469. EXTERN void        TkDestroyMenu _ANSI_ARGS_((TkMenu *menuPtr));
  470. EXTERN void             TkEventuallyRecomputeMenu _ANSI_ARGS_((TkMenu *menuPtr));
  471. EXTERN void        TkEventuallyRedrawMenu _ANSI_ARGS_((
  472.                     TkMenu *menuPtr, TkMenuEntry *mePtr));
  473. EXTERN TkMenuReferences *
  474.             TkFindMenuReferences _ANSI_ARGS_((Tcl_Interp *interp,
  475.                 char *pathName));
  476. EXTERN void        TkFreeMenuReferences _ANSI_ARGS_((
  477.                 TkMenuReferences *menuRefPtr));
  478. EXTERN Tcl_HashTable *    TkGetMenuHashTable _ANSI_ARGS_((Tcl_Interp *interp));
  479. EXTERN int        TkGetMenuIndex _ANSI_ARGS_((Tcl_Interp *interp,
  480.                 TkMenu *menuPtr, char *string, int lastOK,
  481.                 int *indexPtr));
  482. EXTERN void        TkMenuInitializeDrawingFields _ANSI_ARGS_((TkMenu *menuPtr));
  483. EXTERN void        TkMenuInitializeEntryDrawingFields _ANSI_ARGS_((
  484.                 TkMenuEntry *mePtr));
  485. EXTERN int        TkInvokeMenu _ANSI_ARGS_((Tcl_Interp *interp,
  486.                 TkMenu *menuPtr, int index));
  487. EXTERN void        TkMenuConfigureDrawOptions _ANSI_ARGS_((
  488.                 TkMenu *menuPtr));
  489. EXTERN int        TkMenuConfigureEntryDrawOptions _ANSI_ARGS_((
  490.                 TkMenuEntry *mePtr, int index));
  491. EXTERN void        TkMenuFreeDrawOptions _ANSI_ARGS_((TkMenu *menuPtr));
  492. EXTERN void        TkMenuEntryFreeDrawOptions _ANSI_ARGS_((
  493.                 TkMenuEntry *mePtr));
  494. EXTERN void        TkMenuEventProc _ANSI_ARGS_((ClientData clientData,
  495.                     XEvent *eventPtr));
  496. EXTERN void        TkMenuImageProc _ANSI_ARGS_((
  497.                     ClientData clientData, int x, int y, int width,
  498.                 int height, int imgWidth, int imgHeight));
  499. EXTERN void        TkMenuInit _ANSI_ARGS_((void));
  500. EXTERN void        TkMenuSelectImageProc _ANSI_ARGS_
  501.                 ((ClientData clientData, int x, int y,
  502.                 int width, int height, int imgWidth,
  503.                 int imgHeight));
  504. EXTERN char *        TkNewMenuName _ANSI_ARGS_((Tcl_Interp *interp, 
  505.                 char *parentName, TkMenu *menuPtr));
  506. EXTERN int        TkPostCommand _ANSI_ARGS_((TkMenu *menuPtr));
  507. EXTERN int        TkPostSubmenu _ANSI_ARGS_((Tcl_Interp *interp,
  508.                 TkMenu *menuPtr, TkMenuEntry *mePtr));
  509. EXTERN int        TkPostTearoffMenu _ANSI_ARGS_((Tcl_Interp *interp,
  510.                 TkMenu *menuPtr, int x, int y));
  511. EXTERN int        TkPreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
  512. EXTERN void             TkRecomputeMenu _ANSI_ARGS_((TkMenu *menuPtr));
  513.  
  514. /*
  515.  * These routines are the platform-dependent routines called by the
  516.  * common code.
  517.  */
  518.  
  519. EXTERN void        TkpComputeMenubarGeometry _ANSI_ARGS_((TkMenu *menuPtr));
  520. EXTERN void        TkpComputeStandardMenuGeometry _ANSI_ARGS_
  521.                 ((TkMenu *menuPtr));
  522. EXTERN int        TkpConfigureMenuEntry
  523.                             _ANSI_ARGS_((TkMenuEntry *mePtr));
  524. EXTERN void        TkpDestroyMenu _ANSI_ARGS_((TkMenu *menuPtr));
  525. EXTERN void        TkpDestroyMenuEntry
  526.                 _ANSI_ARGS_((TkMenuEntry *mEntryPtr));
  527. EXTERN void        TkpDrawMenuEntry _ANSI_ARGS_((TkMenuEntry *mePtr,
  528.                 Drawable d, Tk_Font tkfont, 
  529.                 CONST Tk_FontMetrics *menuMetricsPtr, int x,
  530.                 int y, int width, int height, int strictMotif,
  531.                 int drawArrow));
  532. EXTERN void        TkpMenuInit _ANSI_ARGS_((void));
  533. EXTERN int        TkpMenuNewEntry _ANSI_ARGS_((TkMenuEntry *mePtr));
  534. EXTERN int        TkpNewMenu _ANSI_ARGS_((TkMenu *menuPtr));
  535. EXTERN int        TkpPostMenu _ANSI_ARGS_((Tcl_Interp *interp,
  536.                 TkMenu *menuPtr, int x, int y));
  537. EXTERN void        TkpSetWindowMenuBar _ANSI_ARGS_((Tk_Window tkwin,
  538.                 TkMenu *menuPtr));
  539.  
  540. #endif /* _TKMENU */
  541.  
  542.