head	1.18;
access;
symbols
	core-8-5-9:1.14.2.1
	core-8-5-8:1.14
	macosx-cocoa-merge:1.16
	macosx-cocoa-premerge:1.16
	macosx-carbon-freeze:1.16
	core-8-5-7:1.14
	core-8-5-6:1.14
	core-8-6-b1:1.15
	core-8-6-a3:1.14
	core-8-5-5:1.14
	core-8-6-a2:1.14
	core-8-5-4:1.14
	core-8-5-3:1.14
	core-8-6-a1:1.14
	core-8-4-19:1.6.4.1
	core-8-5-branch:1.14.0.2
	core-8-5-2:1.14
	core-8-4-18:1.6.4.1
	core-8-5-1:1.14
	core-8-4-17:1.6.4.1
	core-8-5-0:1.14
	core-8-5-b3:1.13
	core-8-5-b2:1.13
	core-8-4-16:1.6.4.1
	core-8-5-b1:1.13
	core-stablilizer-merge:1.13
	core-stabilizer-branch:1.12.0.2
	core-stabilizer-merge:1.14
	core-8-4-15:1.6.4.1
	core-8-5-a6:1.12
	core-8-5-a5:1.11
	core-8-4-14:1.6.4.1
	core-8-5-a4:1.11
	core-8-4-13:1.6.4.1
	core-8-4-12:1.6.4.1
	core-8-4-11:1.6.4.1
	core-8-5-a3:1.7
	core-8-4-10:1.6.4.1
	core-8-4-9-branch:1.6.4.1.0.2
	core-8-5-a2:1.7
	core-8-4-9:1.6.4.1
	core-8-4-8:1.6.4.1
	core-8-4-7:1.6.4.1
	core-8-5-a1:1.7
	core-8-4-6:1.6.4.1
	core-8-4-5:1.6.4.1
	mistachkin-dev-branch:1.7.0.2
	core-8-4-4:1.6.4.1
	core-8-4-3:1.6
	core-8-4-branch:1.6.0.4
	core-8-4-2:1.6
	core-8-4-1:1.6
	core-8-3-5:1.5
	core-8-4-0:1.6
	macosx-8-4-merge-2002-08-31-trunk:1.6
	macosx-8-4-premerge-2002-08-31-branch:1.6
	macosx-8-4-premerge-2002-08-31-trunk:1.6
	macosx-8-4-merge-2002-08-30-branch:1.6
	macosx-8-4-merge-2002-08-30-trunk:1.6
	macosx-8-4-merge-2002-08-20-branch:1.6
	macosx-8-4-merge-2002-08-20-trunk:1.6
	core-8-4-b2:1.6
	core-8-4-b1:1.6
	macosx-premerge-6-9-02:1.6
	core-8-4-a4:1.6
	core-8-3-4:1.5
	macosx-8-4-branch:1.6.0.2
	macosx-8-4-branchpoint:1.6
	core-8-4-a3:1.5
	core-8-3-3:1.5
	dgp-privates-into-namespace:1.5.0.16
	tclpro-1-5-0:1.5
	core-8-4-win-speedup:1.5.0.14
	core-8-4-a2:1.5
	tclpro-1-4-1:1.5
	tclpro-1-4-0:1.5
	core-8-3-2:1.5
	ajuba-ajuba2-2-1-base:1.5
	ajuba-ajuba2-2-0:1.5
	core-8-4-a1:1.5
	core-8-3-1-branch:1.5.0.12
	core-8-3-1:1.5
	scriptics-sc-2-0-b5:1.5
	scriptics-sc-2-0-fixed:1.5
	scriptics-sc-2-0-b2:1.5
	scriptics-sc-2-0-b1:1.5
	core-8-3-0:1.5
	core-8-3-b2:1.5
	core-8-3-b1:1.5
	scriptics-sc-1-1:1.5
	scriptics-sc-1-1-b1:1.5
	core-8-2-3:1.5
	scriptics-sc-1-1-branch:1.5.0.10
	scriptics-sc-1-1-base:1.5
	scriptics-sc-1-0:1.5
	scriptics-sc-1-0-branch:1.5.0.8
	scriptics-sc-1-0-base:1.5
	core-8-2-2:1.5
	core-8-2-1:1.5
	scriptics-bc-1-0-b1:1.5
	core-8-2-1-branch:1.5.0.6
	scriptics-tclpro-1-3-0:1.5
	core-8-2-0:1.5
	core-8-2-b3-branch:1.5.0.4
	core-8-2-b3-base:1.5
	scriptics-tclpro-1-3-b4:1.5
	core-8-2-b2:1.5
	scriptics-tclpro-1-3-b3:1.5
	core-8-2-b1:1.5
	scriptics-tclpro-1-3-b2:1.5
	merge-to-mainline-5/21/99:1.5
	scriptics-tclpro-1-3-b2-branch:1.5.0.2
	core-8-1-1:1.5
	scriptics-tclpro-1-3-b1:1.5
	core-8-1-1-base:1.5
	core-8-1-0:1.5
	merge-to-mainline-4-29-99:1.5
	merge-to-mainline-4-23-99:1.5
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.4.0.6
	core-8-0-6-base:1.4
	core-8-0-5:1.4
	core-8-1-b3:1.1.4.5
	core-8-1-b2:1.1.4.5
	dev-8-1-stubs-branch:1.1.4.4.0.2
	dev-stubs-branch:1.4.0.4
	scriptics-tclpro-1-2:1.4
	scriptics-tclpro-1-2-b2:1.4
	core-8-1-merge-2/10/99:1.4
	core-8-0-5-branch:1.4.0.2
	core-8-0-5-base:1.4
	scriptics-tclpro-1-2-b1:1.4
	scriptics-tclpro-1-2-a1:1.4
	core-8-1-b1:1.1.4.3
	core-8-0-4:1.4
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.4;
locks; strict;
comment	@ * @;


1.18
date	2010.04.23.08.32.56;	author nijtmans;	state Exp;
branches;
next	1.17;

1.17
date	2010.01.03.19.50.59;	author patthoyts;	state Exp;
branches;
next	1.16;

1.16
date	2009.01.14.22.48.10;	author nijtmans;	state Exp;
branches;
next	1.15;

1.15
date	2008.10.17.23.18.37;	author nijtmans;	state Exp;
branches;
next	1.14;

1.14
date	2007.12.13.15.24.16;	author dgp;	state Exp;
branches
	1.14.2.1;
next	1.13;

1.13
date	2007.06.24.16.07.35;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2007.01.05.00.00.51;	author nijtmans;	state Exp;
branches
	1.12.2.1;
next	1.11;

1.11
date	2005.11.27.02.36.14;	author das;	state Exp;
branches;
next	1.10;

1.10
date	2005.11.14.22.44.11;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2005.10.12.09.43.37;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2005.10.12.09.29.21;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2003.05.30.11.03.00;	author vincentdarley;	state Exp;
branches;
next	1.6;

1.6
date	2001.10.12.13.30.31;	author tmh;	state Exp;
branches
	1.6.4.1;
next	1.5;

1.5
date	99.04.16.01.51.19;	author stanton;	state Exp;
branches
	1.5.14.1;
next	1.4;

1.4
date	98.09.14.18.23.14;	author stanton;	state Exp;
branches;
next	1.3;

1.3
date	98.08.04.12.19.29;	author escoffon;	state Exp;
branches;
next	1.2;

1.2
date	98.07.29.12.39.13;	author escoffon;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.51.48;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.29.00.25.22;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.09.30.02.17.09;	author stanton;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	98.11.24.21.42.43;	author stanton;	state Exp;
branches;
next	1.1.4.4;

1.1.4.4
date	99.03.09.01.52.38;	author lfb;	state Exp;
branches
	1.1.4.4.2.1;
next	1.1.4.5;

1.1.4.5
date	99.03.10.07.13.44;	author stanton;	state Exp;
branches;
next	;

1.1.4.4.2.1
date	99.03.09.18.57.11;	author redman;	state Exp;
branches;
next	;

1.5.14.1
date	2002.04.02.21.00.54;	author hobbs;	state Exp;
branches;
next	;

1.6.4.1
date	2003.07.15.13.59.06;	author vincentdarley;	state Exp;
branches;
next	;

1.12.2.1
date	2007.06.25.19.12.13;	author dgp;	state Exp;
branches;
next	;

1.14.2.1
date	2010.01.03.20.03.55;	author patthoyts;	state Exp;
branches;
next	;


desc
@@


1.18
log
@Formatting
typo fixes
remove not existing tkDisplayList;
Useless re-definitions of TCL_STORAGE_CLASS
@
text
@/*
 * tkMenu.h --
 *
 *	Declarations shared among all of the files that implement menu
 *	widgets.
 *
 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @@(#) $Id: tkMenu.h,v 1.17 2010/01/03 19:50:59 patthoyts Exp $
 */

#ifndef _TKMENU
#define _TKMENU

#ifndef _TK
#include "tk.h"
#endif

#ifndef _TKINT
#include "tkInt.h"
#endif

#ifndef _DEFAULT
#include "default.h"
#endif

/*
 * Dummy types used by the platform menu code.
 */

typedef struct TkMenuPlatformData_ *TkMenuPlatformData;
typedef struct TkMenuPlatformEntryData_ *TkMenuPlatformEntryData;

/*
 * Legal values for the "compound" field of TkMenuEntry and TkMenuButton
 * records.
 */

enum compound {
    COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE,
    COMPOUND_RIGHT, COMPOUND_TOP
};

/*
 * Additional menu entry drawing parameters for Windows platform.
 * DRAW_MENU_ENTRY_ARROW makes TkpDrawMenuEntry draw the arrow
 * itself when cascade entry is disabled.
 * DRAW_MENU_ENTRY_NOUNDERLINE forbids underline when ODS_NOACCEL
 * is set, thus obeying the system-wide Windows UI setting.
 */

enum drawingParameters {
    DRAW_MENU_ENTRY_ARROW = (1<<0),
    DRAW_MENU_ENTRY_NOUNDERLINE = (1<<1)
};

/*
 * One of the following data structures is kept for each entry of each menu
 * managed by this file:
 */

typedef struct TkMenuEntry {
    int type;			/* Type of menu entry; see below for valid
				 * types. */
    struct TkMenu *menuPtr;	/* Menu with which this entry is
				 * associated. */
    Tk_OptionTable optionTable;	/* Option table for this menu entry. */
    Tcl_Obj *labelPtr;		/* Main text label displayed in entry (NULL if
				 * no label). */
    int labelLength;		/* Number of non-NULL characters in label. */
    int state;			/* State of button for display purposes:
				 * normal, active, or disabled. */
    int underline;		/* Value of -underline option: specifies index
				 * of character to underline (<0 means don't
				 * underline anything). */
    Tcl_Obj *underlinePtr;	/* Index of character to underline. */
    Tcl_Obj *bitmapPtr;		/* Bitmap to display in menu entry, or None.
				 * If not None then label is ignored. */
    Tcl_Obj *imagePtr;		/* Name of image to display, or NULL. If not
				 * NULL, bitmap, text, and textVarName are
				 * ignored. */
    Tk_Image image;		/* Image to display in menu entry, or NULL if
				 * none. */
    Tcl_Obj *selectImagePtr;	/* Name of image to display when selected, or
				 * NULL. */
    Tk_Image selectImage;	/* Image to display in entry when selected, or
				 * NULL if none. Ignored if image is NULL. */
    Tcl_Obj *accelPtr;		/* Accelerator string displayed at right of
				 * menu entry. NULL means no such accelerator.
				 * Malloc'ed. */
    int accelLength;		/* Number of non-NULL characters in
				 * accelerator. */
    int indicatorOn;		/* True means draw indicator, false means
				 * don't draw it. This field is ignored unless
				 * the entry is a radio or check button. */
    /*
     * Display attributes
     */

    Tcl_Obj *borderPtr;		/* Structure used to draw background for
				 * entry. NULL means use overall border for
				 * menu. */
    Tcl_Obj *fgPtr;		/* Foreground color to use for entry. NULL
				 * means use foreground color from menu. */
    Tcl_Obj *activeBorderPtr;	/* Used to draw background and border when
				 * element is active. NULL means use
				 * activeBorder from menu. */
    Tcl_Obj *activeFgPtr;	/* Foreground color to use when entry is
				 * active. NULL means use active foreground
				 * from menu. */
    Tcl_Obj *indicatorFgPtr;	/* Color for indicators in radio and check
				 * button entries. NULL means use indicatorFg
				 * GC from menu. */
    Tcl_Obj *fontPtr;		/* Text font for menu entries. NULL means use
				 * overall font for menu. */
    int columnBreak;		/* If this is 0, this item appears below the
				 * item in front of it. If this is 1, this
				 * item starts a new column. This field is
				 * always 0 for tearoff and separator
				 * entries. */
    int hideMargin;		/* If this is 0, then the item has enough
    				 * margin to accomodate a standard check mark
    				 * and a default right margin. If this is 1,
    				 * then the item has no such margins, and
    				 * checkbuttons and radiobuttons with this set
    				 * will have a rectangle drawn in the
    				 * indicator around the item if the item is
    				 * checked. This is useful for palette menus.
    				 * This field is ignored for separators and
    				 * tearoffs. */
    int indicatorSpace;		/* The width of the indicator space for this
				 * entry. */
    int labelWidth;		/* Number of pixels to allow for displaying
				 * labels in menu entries. */
    int compound;		/* Value of -compound option; specifies
				 * whether the entry should show both an image
				 * and text, and, if so, how. */

    /*
     * Information used to implement this entry's action:
     */

    Tcl_Obj *commandPtr;	/* Command to invoke when entry is invoked.
				 * Malloc'ed. */
    Tcl_Obj *namePtr;		/* Name of variable (for check buttons and
				 * radio buttons) or menu (for cascade
				 * entries). Malloc'ed. */
    Tcl_Obj *onValuePtr;	/* Value to store in variable when selected
				 * (only for radio and check buttons).
				 * Malloc'ed. */
    Tcl_Obj *offValuePtr;	/* Value to store in variable when not
				 * selected (only for check buttons).
				 * Malloc'ed. */

    /*
     * Information used for drawing this menu entry.
     */

    int width;			/* Number of pixels occupied by entry in
				 * horizontal dimension. Not used except in
				 * menubars. The width of norma menus is
				 * dependent on the rest of the menu. */
    int x;			/* X-coordinate of leftmost pixel in entry. */
    int height;			/* Number of pixels occupied by entry in
				 * vertical dimension, including raised border
				 * drawn around entry when active. */
    int y;			/* Y-coordinate of topmost pixel in entry. */
    GC textGC;			/* GC for drawing text in entry. NULL means
				 * use overall textGC for menu. */
    GC activeGC;		/* GC for drawing text in entry when active.
				 * NULL means use overall activeGC for
				 * menu. */
    GC disabledGC;		/* Used to produce disabled effect for entry.
				 * NULL means use overall disabledGC from menu
				 * structure. See comments for disabledFg in
				 * menu structure for more information. */
    GC indicatorGC;		/* For drawing indicators. None means use GC
				 * from menu. */

    /*
     * Miscellaneous fields.
     */

    int entryFlags;		/* Various flags. See below for
				 * definitions. */
    int index;			/* Need to know which index we are. This is
    				 * zero-based. This is the top-left entry of
    				 * the menu. */

    /*
     * Bookeeping for master menus and cascade menus.
     */

    struct TkMenuReferences *childMenuRefPtr;
    				/* A pointer to the hash table entry for the
    				 * child menu. Stored here when the menu entry
    				 * is configured so that a hash lookup is not
    				 * necessary later.*/
    struct TkMenuEntry *nextCascadePtr;
    				/* The next cascade entry that is a parent of
    				 * this entry's child cascade menu. NULL end
    				 * of list, this is not a cascade entry, or
    				 * the menu that this entry point to does not
    				 * yet exist. */
    TkMenuPlatformEntryData platformEntryData;
    				/* The data for the specific type of menu.
				 * Depends on platform and menu type what kind
				 * of options are in this structure. */
} TkMenuEntry;

/*
 * Flag values defined for menu entries:
 *
 * ENTRY_SELECTED:		Non-zero means this is a radio or check button
 *				and that it should be drawn in the "selected"
 *				state.
 * ENTRY_NEEDS_REDISPLAY:	Non-zero means the entry should be redisplayed.
 * ENTRY_LAST_COLUMN:		Used by the drawing code. If the entry is in
 *				the last column, the space to its right needs
 *				to be filled.
 * ENTRY_PLATFORM_FLAG1 - 4	These flags are reserved for use by the
 *				platform-dependent implementation of menus
 *				and should not be used by anything else.
 */

#define ENTRY_SELECTED		1
#define ENTRY_NEEDS_REDISPLAY	2
#define ENTRY_LAST_COLUMN	4
#define ENTRY_PLATFORM_FLAG1	(1 << 30)
#define ENTRY_PLATFORM_FLAG2	(1 << 29)
#define ENTRY_PLATFORM_FLAG3	(1 << 28)
#define ENTRY_PLATFORM_FLAG4	(1 << 27)

/*
 * Types defined for MenuEntries:
 */

#define CASCADE_ENTRY 0
#define CHECK_BUTTON_ENTRY 1
#define COMMAND_ENTRY 2
#define RADIO_BUTTON_ENTRY 3
#define SEPARATOR_ENTRY 4
#define TEAROFF_ENTRY 5

/*
 * Menu states
 */

#define ENTRY_ACTIVE 0
#define ENTRY_NORMAL 1
#define ENTRY_DISABLED 2

/*
 * A data structure of the following type is kept for each menu widget:
 */

typedef struct TkMenu {
    Tk_Window tkwin;		/* Window that embodies the pane. NULL means
				 * that the window has been destroyed but the
				 * data structures haven't yet been cleaned
				 * up. */
    Display *display;		/* Display containing widget. Needed, among
				 * other things, so that resources can be
				 * freed up even after tkwin has gone away. */
    Tcl_Interp *interp;		/* Interpreter associated with menu. */
    Tcl_Command widgetCmd;	/* Token for menu's widget command. */
    TkMenuEntry **entries;	/* Array of pointers to all the entries in the
				 * menu. NULL means no entries. */
    int numEntries;		/* Number of elements in entries. */
    int active;			/* Index of active entry. -1 means nothing
				 * active. */
    int menuType;		/* MASTER_MENU, TEAROFF_MENU, or MENUBAR. See
    				 * below for definitions. */
    Tcl_Obj *menuTypePtr;	/* Used to control whether created tkwin is a
				 * toplevel or not. "normal", "menubar", or
				 * "toplevel" */

    /*
     * Information used when displaying widget:
     */

    Tcl_Obj *borderPtr;		/* Structure used to draw 3-D border and
				 * background for menu. */
    Tcl_Obj *borderWidthPtr;	/* Width of border around whole menu. */
    Tcl_Obj *activeBorderPtr;	/* Used to draw background and border for
				 * active element (if any). */
    Tcl_Obj *activeBorderWidthPtr;
				/* Width of border around active element. */
    Tcl_Obj *reliefPtr;		/* 3-d effect: TK_RELIEF_RAISED, etc. */
    Tcl_Obj *fontPtr;		/* Text font for menu entries. */
    Tcl_Obj *fgPtr;		/* Foreground color for entries. */
    Tcl_Obj *disabledFgPtr;	/* Foreground color when disabled. NULL means
				 * use normalFg with a 50% stipple instead. */
    Tcl_Obj *activeFgPtr;	/* Foreground color for active entry. */
    Tcl_Obj *indicatorFgPtr;	/* Color for indicators in radio and check
				 * button entries. */
    Pixmap gray;		/* Bitmap for drawing disabled entries in a
				 * stippled fashion. None means not allocated
				 * yet. */
    GC textGC;			/* GC for drawing text and other features of
				 * menu entries. */
    GC disabledGC;		/* Used to produce disabled effect. If
				 * disabledFg isn't NULL, this GC is used to
				 * draw text and icons for disabled entries.
				 * Otherwise text and icons are drawn with
				 * normalGC and this GC is used to stipple
				 * background across them. */
    GC activeGC;		/* GC for drawing active entry. */
    GC indicatorGC;		/* For drawing indicators. */
    GC disabledImageGC;		/* Used for drawing disabled images. They have
				 * to be stippled. This is created when the
				 * image is about to be drawn the first
				 * time. */

    /*
     * Information about geometry of menu.
     */

    int totalWidth;		/* Width of entire menu. */
    int totalHeight;		/* Height of entire menu. */

    /*
     * Miscellaneous information:
     */

    int tearoff;		/* 1 means this menu can be torn off. On some
    				 * platforms, the user can drag an outline of
    				 * the menu by just dragging outside of the
    				 * menu, and the tearoff is created where the
    				 * mouse is released. On others, an indicator
    				 * (such as a dashed stripe) is drawn, and
    				 * when the menu is selected, the tearoff is
    				 * created. */
    Tcl_Obj *titlePtr;		/* The title to use when this menu is torn
    				 * off. If this is NULL, a default scheme will
    				 * be used to generate a title for tearoff. */
    Tcl_Obj *tearoffCommandPtr;	/* If non-NULL, points to a command to run
				 * whenever the menu is torn-off. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option; not used in the
				 * C code, but used by keyboard traversal
				 * scripts. Malloc'ed, but may be NULL. */
    Tcl_Obj *cursorPtr;		/* Current cursor for window, or None. */
    Tcl_Obj *postCommandPtr;	/* Used to detect cycles in cascade hierarchy
    				 * trees when preprocessing postcommands on
    				 * some platforms. See PostMenu for more
    				 * details. */
    int postCommandGeneration;	/* Need to do pre-invocation post command
				 * traversal. */
    int menuFlags;		/* Flags for use by X; see below for
				 * definition. */
    TkMenuEntry *postedCascade;	/* Points to menu entry for cascaded submenu
				 * that is currently posted or NULL if no
				 * submenu posted. */
    struct TkMenu *nextInstancePtr;
    				/* The next instance of this menu in the
    				 * chain. */
    struct TkMenu *masterMenuPtr;
    				/* A pointer to the original menu for this
    				 * clone chain. Points back to this structure
    				 * if this menu is a master menu. */
    struct TkMenuOptionTables *optionTablesPtr;
				/* A pointer to the collection of option
				 * tables that work with menus and menu
				 * entries. */
    Tk_Window parentTopLevelPtr;/* If this menu is a menubar, this is the
    				 * toplevel that owns the menu. Only
    				 * applicable for menubar clones. */
    struct TkMenuReferences *menuRefPtr;
    				/* Each menu is hashed into a table with the
    				 * name of the menu's window as the key. The
    				 * information in this hash table includes a
    				 * pointer to the menu (so that cascades can
    				 * find this menu), a pointer to the list of
    				 * toplevel widgets that have this menu as its
    				 * menubar, and a list of menu entries that
    				 * have this menu specified as a cascade. */
    TkMenuPlatformData platformData;
				/* The data for the specific type of menu.
				 * Depends on platform and menu type what kind
				 * of options are in this structure. */
    Tk_OptionSpec *extensionPtr;/* Needed by the configuration package for
				 * this widget to be extended. */
    Tk_SavedOptions *errorStructPtr;
				/* We actually have to allocate these because
				 * multiple menus get changed during one
				 * ConfigureMenu call. */
} TkMenu;

/*
 * When the toplevel configure -menu command is executed, the menu may not
 * exist yet. We need to keep a linked list of windows that reference a
 * particular menu.
 */

typedef struct TkMenuTopLevelList {
    struct TkMenuTopLevelList *nextPtr;
    				/* The next window in the list. */
    Tk_Window tkwin;		/* The window that has this menu as its
				 * menubar. */
} TkMenuTopLevelList;

/*
 * The following structure is used to keep track of things which reference a
 * menu. It is created when:
 * - a menu is created.
 * - a cascade entry is added to a menu with a non-null name
 * - the "-menu" configuration option is used on a toplevel widget with a
 *   non-null parameter.
 *
 * One of these three fields must be non-NULL, but any of the fields may be
 * NULL. This structure makes it easy to determine whether or not anything
 * like recalculating platform data or geometry is necessary when one of the
 * three actions above is performed.
 */

typedef struct TkMenuReferences {
    struct TkMenu *menuPtr;	/* The menu data structure. This is NULL if
    				 * the menu does not exist. */
    TkMenuTopLevelList *topLevelListPtr;
    				/* First in the list of all toplevels that
    				 * have this menu as its menubar. NULL if no
    				 * toplevel widgets have this menu as its
    				 * menubar. */
    TkMenuEntry *parentEntryPtr;/* First in the list of all cascade menu
    				 * entries that have this menu as their child.
    				 * NULL means no cascade entries. */
    Tcl_HashEntry *hashEntryPtr;/* This is needed because the pathname of the
    				 * window (which is what we hash on) may not
    				 * be around when we are deleting. */
} TkMenuReferences;

/*
 * This structure contains all of the option tables that are needed by menus.
 */

typedef struct TkMenuOptionTables {
    Tk_OptionTable menuOptionTable;
				/* The option table for menus. */
    Tk_OptionTable entryOptionTables[6];
				/* The tables for menu entries. */
} TkMenuOptionTables;

/*
 * Flag bits for menus:
 *
 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler has
 *				already been queued to redraw this window.
 * RESIZE_PENDING:		Non-zero means a call to ComputeMenuGeometry
 *				has already been scheduled.
 * MENU_DELETION_PENDING	Non-zero means that we are currently
 *				destroying this menu's internal structures.
 *				This is useful when we are in the middle of
 *				cleaning this master menu's chain of menus up
 *				when TkDestroyMenu was called again on this
 *				menu (via a destroy binding or somesuch).
 * MENU_WIN_DESTRUCTION_PENDING Non-zero means we are in the middle of
 *				destroying this menu's Tk_Window.
 * MENU_PLATFORM_FLAG1...	Reserved for use by the platform-specific menu
 *				code.
 */

#define REDRAW_PENDING			1
#define RESIZE_PENDING			2
#define MENU_DELETION_PENDING		4
#define MENU_WIN_DESTRUCTION_PENDING	8
#define MENU_PLATFORM_FLAG1	(1 << 30)
#define MENU_PLATFORM_FLAG2	(1 << 29)
#define MENU_PLATFORM_FLAG3	(1 << 28)

/*
 * Each menu created by the user is a MASTER_MENU. When a menu is torn off, a
 * TEAROFF_MENU instance is created. When a menu is assigned to a toplevel as
 * a menu bar, a MENUBAR instance is created. All instances have the same
 * configuration information. If the master instance is deleted, all instances
 * are deleted. If one of the other instances is deleted, only that instance
 * is deleted.
 */

#define UNKNOWN_TYPE		-1
#define MASTER_MENU 		0
#define TEAROFF_MENU 		1
#define MENUBAR 		2

/*
 * Various geometry definitions:
 */

#define CASCADE_ARROW_HEIGHT	10
#define CASCADE_ARROW_WIDTH	8
#define DECORATION_BORDER_WIDTH	2

/*
 * Menu-related functions that are shared among Tk modules but not exported to
 * the outside world:
 */

MODULE_SCOPE int	TkActivateMenuEntry(TkMenu *menuPtr, int index);
MODULE_SCOPE void	TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr);
MODULE_SCOPE TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp,
			    const char *name);
MODULE_SCOPE void	TkDestroyMenu(TkMenu *menuPtr);
MODULE_SCOPE void	TkEventuallyRecomputeMenu(TkMenu *menuPtr);
MODULE_SCOPE void	TkEventuallyRedrawMenu(TkMenu *menuPtr,
			    TkMenuEntry *mePtr);
MODULE_SCOPE TkMenuReferences*TkFindMenuReferences(Tcl_Interp *interp, const char *name);
MODULE_SCOPE TkMenuReferences*TkFindMenuReferencesObj(Tcl_Interp *interp,
			    Tcl_Obj *namePtr);
MODULE_SCOPE int	TkFreeMenuReferences(TkMenuReferences *menuRefPtr);
MODULE_SCOPE Tcl_HashTable *TkGetMenuHashTable(Tcl_Interp *interp);
MODULE_SCOPE int	TkGetMenuIndex(Tcl_Interp *interp, TkMenu *menuPtr,
			    Tcl_Obj *objPtr, int lastOK, int *indexPtr);
MODULE_SCOPE void	TkMenuInitializeDrawingFields(TkMenu *menuPtr);
MODULE_SCOPE void	TkMenuInitializeEntryDrawingFields(TkMenuEntry *mePtr);
MODULE_SCOPE int	TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr,
			    int index);
MODULE_SCOPE void	TkMenuConfigureDrawOptions(TkMenu *menuPtr);
MODULE_SCOPE int	TkMenuConfigureEntryDrawOptions(
			    TkMenuEntry *mePtr, int index);
MODULE_SCOPE void	TkMenuFreeDrawOptions(TkMenu *menuPtr);
MODULE_SCOPE void	TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr);
MODULE_SCOPE void	TkMenuEventProc(ClientData clientData,
    			    XEvent *eventPtr);
MODULE_SCOPE void	TkMenuImageProc(ClientData clientData, int x, int y,
			    int width, int height, int imgWidth,
			    int imgHeight);
MODULE_SCOPE void	TkMenuInit(void);
MODULE_SCOPE void	TkMenuSelectImageProc(ClientData clientData, int x,
			    int y, int width, int height, int imgWidth,
			    int imgHeight);
MODULE_SCOPE Tcl_Obj *	TkNewMenuName(Tcl_Interp *interp,
			    Tcl_Obj *parentNamePtr, TkMenu *menuPtr);
MODULE_SCOPE int	TkPostCommand(TkMenu *menuPtr);
MODULE_SCOPE int	TkPostSubmenu(Tcl_Interp *interp, TkMenu *menuPtr,
			    TkMenuEntry *mePtr);
MODULE_SCOPE int	TkPostTearoffMenu(Tcl_Interp *interp, TkMenu *menuPtr,
			    int x, int y);
MODULE_SCOPE int	TkPreprocessMenu(TkMenu *menuPtr);
MODULE_SCOPE void	TkRecomputeMenu(TkMenu *menuPtr);

/*
 * These routines are the platform-dependent routines called by the common
 * code.
 */

MODULE_SCOPE void	TkpComputeMenubarGeometry(TkMenu *menuPtr);
MODULE_SCOPE void	TkpComputeStandardMenuGeometry(TkMenu *menuPtr);
MODULE_SCOPE int	TkpConfigureMenuEntry(TkMenuEntry *mePtr);
MODULE_SCOPE void	TkpDestroyMenu(TkMenu *menuPtr);
MODULE_SCOPE void	TkpDestroyMenuEntry(TkMenuEntry *mEntryPtr);
MODULE_SCOPE void	TkpDrawMenuEntry(TkMenuEntry *mePtr,
			    Drawable d, Tk_Font tkfont,
			    const Tk_FontMetrics *menuMetricsPtr, int x,
			    int y, int width, int height, int strictMotif,
			    int drawingParameters);
MODULE_SCOPE void	TkpMenuInit(void);
MODULE_SCOPE int	TkpMenuNewEntry(TkMenuEntry *mePtr);
MODULE_SCOPE int	TkpNewMenu(TkMenu *menuPtr);
MODULE_SCOPE int	TkpPostMenu(Tcl_Interp *interp, TkMenu *menuPtr,
			    int x, int y);
MODULE_SCOPE void	TkpSetWindowMenuBar(Tk_Window tkwin, TkMenu *menuPtr);

#endif /* _TKMENU */
@


1.17
log
@Patch 2848897: Support the system keyboard cues setting on Windows

This patch by Anton Kovalenko adds support for the Windows system-wide
UI setting that prevents accelerators being underlined unless the Alt
key is pressed.

Modified to support the system keyboard cues flag and to handle dynamic
changes to the system parameters by the user.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.16 2009/01/14 22:48:10 nijtmans Exp $
a29 5
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

a564 3
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT

@


1.16
log
@- fix for aMSN compatibility [tcl-Bug 2507326]
- CONSTify Tk(Create|Find)menuReferences
- various internal "const" decorations
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.15 2008/10/17 23:18:37 nijtmans Exp $
d53 13
d562 1
a562 1
			    int drawArrow);
@


1.15
log
@Add "const" to many internal
const tables, so those will be
put by the C-compiler in the
TEXT segment in stead of the
DATA segment. This makes those
table sharable in shared libraries.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.14 2007/12/13 15:24:16 dgp Exp $
d495 1
a495 1
			    char *name);
d500 1
a500 1
MODULE_SCOPE TkMenuReferences*TkFindMenuReferences(Tcl_Interp *interp, char *name);
@


1.14
log
@merge stable branch onto HEAD
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.12.2.1 2007/06/25 19:12:13 dgp Exp $
a243 2
MODULE_SCOPE char *tkMenuStateStrings[];

@


1.14.2.1
log
@Patch 2848897: Support the system keyboard cues setting on Windows
Backported this patch from HEAD (kovalenko, thoyts)
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.14 2007/12/13 15:24:16 dgp Exp $
a52 13
 * Additional menu entry drawing parameters for Windows platform.
 * DRAW_MENU_ENTRY_ARROW makes TkpDrawMenuEntry draw the arrow
 * itself when cascade entry is disabled.
 * DRAW_MENU_ENTRY_NOUNDERLINE forbids underline when ODS_NOACCEL
 * is set, thus obeying the system-wide Windows UI setting.
 */

enum drawingParameters {
    DRAW_MENU_ENTRY_ARROW = (1<<0),
    DRAW_MENU_ENTRY_NOUNDERLINE = (1<<1)
};

/*
d551 1
a551 1
			    int drawingParameters);
@


1.13
log
@Cleaning up whitespace, comments, declarations. No functional changes.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.12 2007/01/05 00:00:51 nijtmans Exp $
@


1.12
log
@various "const" additions, in line with TIP #27
fix bug #1627732
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.11 2005/11/27 02:36:14 das Exp $
d142 1
a142 1
				 * entries).  Malloc'ed.*/
d158 1
a158 1
    int x;			/* X-coordinate of leftmost pixel in entry */
d163 1
a163 1
    GC textGC;			/* GC for drawing text in entry.  NULL means
d170 1
a170 1
				 * structure.  See comments for disabledFg in
d316 2
a317 2
    int totalWidth;		/* Width of entire menu */
    int totalHeight;		/* Height of entire menu */
d338 1
a338 1
				 * scripts.  Malloc'ed, but may be NULL. */
d345 1
a345 1
				 * traversal */
d347 1
a347 1
				   definition */
d376 2
a377 2
  				 * Depends on platform and menu type what kind
  				 * of options are in this structure. */
d394 1
a394 1
    				/* The next window in the list */
d454 1
a454 1
 *                              destroying this menu's Tk_Window.
d459 3
a461 3
#define REDRAW_PENDING		        1
#define RESIZE_PENDING		        2
#define MENU_DELETION_PENDING	        4
d485 3
a487 3
#define CASCADE_ARROW_HEIGHT 10
#define CASCADE_ARROW_WIDTH 8
#define DECORATION_BORDER_WIDTH 2
a562 1

@


1.12.2.1
log
@merge updates from HEAD
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.12 2007/01/05 00:00:51 nijtmans Exp $
d142 1
a142 1
				 * entries). Malloc'ed. */
d158 1
a158 1
    int x;			/* X-coordinate of leftmost pixel in entry. */
d163 1
a163 1
    GC textGC;			/* GC for drawing text in entry. NULL means
d170 1
a170 1
				 * structure. See comments for disabledFg in
d316 2
a317 2
    int totalWidth;		/* Width of entire menu. */
    int totalHeight;		/* Height of entire menu. */
d338 1
a338 1
				 * scripts. Malloc'ed, but may be NULL. */
d345 1
a345 1
				 * traversal. */
d347 1
a347 1
				 * definition. */
d376 2
a377 2
				 * Depends on platform and menu type what kind
				 * of options are in this structure. */
d394 1
a394 1
    				/* The next window in the list. */
d454 1
a454 1
 *				destroying this menu's Tk_Window.
d459 3
a461 3
#define REDRAW_PENDING			1
#define RESIZE_PENDING			2
#define MENU_DELETION_PENDING		4
d485 3
a487 3
#define CASCADE_ARROW_HEIGHT	10
#define CASCADE_ARROW_WIDTH	8
#define DECORATION_BORDER_WIDTH	2
d563 1
@


1.11
log
@	* unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
	add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to
	configure (flag can't be present twice, so can't be in both CFLAGS and
	LDFLAGS during configure), don't use -prebind when deploying on 10.4,
	define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542).
	(SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete
	autoconf macros. Sync with tcl/unix/tcl.m4.

	* unix/configure.in: fix obsolete autoconf macros, sync gratuitous
	formatting/ordering differences with tcl/unix/configure.in.

	* unix/Makefile.in: add CFLAGS to wish/tktest link to make executable
	linking the same as during configure (needed to avoid loosing any linker
	relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS).
	Avoid concurrent linking of wish and compiling of tkTestInit.o during
	parallel make, fix dependencies and flags for building tkMacOSXInit.o
	(checkstubs, checkexports): dependency and Darwin fixes
	(dist): add new macosx files.

	* macosx/tkMacOSXEvent.c (TkMacOSXProcessEvent):
	* macosx/tkMacOSXEvent.h:
	* macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent):
	* macosx/tkMacOSXCarbonEvents.c: install standard application event
	handler, add & call functions to start and stop carbon even timer that
	runs the tcl event loop periodically during a nested carbon event loop
	in the toolbox (e.g. during menutracking) to ensure tcl timers etc
	continue to fire, register app event handler for menu tracking and HI
	command carbon events, move menu event handling to new handlers for
	those carbon events, no longer register for/handle appleevent carbon
	event (now dealt with by standard application event handler), event
	debugging code dynamically acquires carbon event debugging functions to
	allow use on Tiger where they are no longer exported from HIToolbox.

	* macosx/tkMacOSXFont.c (TkMacOSXUseAntialiasedText):
	* macosx/tkMacOSXKeyEvent.c (GetKeyboardLayout):
	* macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
	* macosx/tkMacOSXInit.c:
	* macosx/tkMacOSXInt.h: abstract common code to dynamically acquire
	address of a named symbol (from a loaded dynamic library) into new
	function TkMacOSXGetNamedSymbol() and macro TkMacOSXInitNamedSymbol.

	* macosx/tkMacOSXMenu.c (TkpNewMenu):
	* macosx/tkMacOSXMenubutton.c (MenuButtonInitControl):
	* macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to  modern
	utf8 aware menu manager API, remove obsolete code, add error handling.

	* macosx/tkMacOSXMouseEvent.c: define OSX 10.3 or later only constants
	if necessary to allow compilation on OSX 10.2

	* macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never
	executed.

	* xlib/xgc.c (XCreateGC): sync with core-8-4-branch change.

	* generic/tk.h: add/correct location of version numbers in macosx files.

	* generic/tkInt.h: clarify fat compile comment.

	* macosx/Wish.pbproj/default.pbxuser (new file):
	* macosx/Wish.pbproj/jingham.pbxuser:
	* macosx/Wish.pbproj/project.pbxproj:
	* macosx/Wish.xcode/default.pbxuser:
	* macosx/Wish.xcode/project.pbxproj:
	* macosx/Wish.xcodeproj/default.pbxuser (new file):
	* macosx/Wish.xcodeproj/project.pbxproj (new file): new/updated projects
	for Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with
	native tktest targets and support for universal (fat) compiles.

	* macosx/Tk-Info.plist (removed):
	* macosx/Wish-Info.plist (removed):
	* macosx/buildTkConfig.tcl (removed): remove obsolete build files.

	* macosx/README: clarification/cleanup, document new Xcode projects and
	universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time).

	* unix/Makefile.in:
	* unix/aclocal.m4:
	* unix/configure.in:
	* macosx/configure.ac (new file): add support for inclusion of
	unix/configure.in by macosx/configure.ac, allows generation of a config
	headers enabled configure script in macosx (required by Xcode projects).

	* macosx/GNUmakefile: rename from Makefile to avoid overwriting by
	configure run in tk/macosx, add support for reusing configure cache,
	build target fixes.

	* generic/tk3d.h:
	* generic/tkButton.h:
	* generic/tkCanvas.c:
	* generic/tkCanvas.h:
	* generic/tkColor.h:
	* generic/tkEntry.h:
	* generic/tkFileFilter.h:
	* generic/tkFont.c:
	* generic/tkFont.h:
	* generic/tkImage.c:
	* generic/tkImgPhoto.c:
	* generic/tkInt.h:
	* generic/tkMenu.c:
	* generic/tkMenu.h:
	* generic/tkMenubutton.h:
	* generic/tkScale.h:
	* generic/tkScrollbar.h:
	* generic/tkSelect.h:
	* generic/tkStubInit.c:
	* generic/tkStubLib.c:
	* generic/tkText.h:
	* generic/tkUndo.h:
	* macosx/tkMacOSXButton.c:
	* macosx/tkMacOSXDebug.c:
	* macosx/tkMacOSXDebug.h:
	* macosx/tkMacOSXDialog.c:
	* macosx/tkMacOSXDraw.c:
	* macosx/tkMacOSXEntry.c:
	* macosx/tkMacOSXFont.c:
	* macosx/tkMacOSXInt.h:
	* macosx/tkMacOSXMenu.c:
	* macosx/tkMacOSXMenubutton.c:
	* macosx/tkMacOSXMouseEvent.c:
	* macosx/tkMacOSXSend.c:
	* macosx/tkMacOSXSubwindows.c:
	* macosx/tkMacOSXWindowEvent.c:
	* macosx/tkMacOSXWm.c:
	* macosx/tkMacOSXXStubs.c:
	* unix/tkUnixButton.c:
	* unix/tkUnixMenu.c:
	* xlib/xgc.c: ensure externally visible symbols not contained in stubs
	table are declared as MODULE_SCOPE (or as static if not used outside of
	own source file), #ifdef out a few Xlib and aqua functions that are
	never called. These changes allow 'make checkstubs' to complete without
	error on Darwin with gcc 4.

	* macosx/tkMacOSXTest.c:
	* macosx/tkMacOSXPort.h:
	* win/tkWinTest.c:
	* generic/tkInt.decls: add functions needed by tktest to internal stubs
	table, correct signature of TkMacOSXHandleMenuSelect, add XSync to aqua
	Xlib stubs.

	* unix/tkUnixSend.c:
	* generic/tkText.c:
	* generic/tkTest.c: #ifdef unix only declarations.
	(TestmetricsCmd): unify win and mac implementation.
	(TestsendCmd): move to tkUnixSend.c to avoid access to global var.
	(TesttextCmd): move to tkText.c to avoid having to put all the internal
	text functions it uses into the stubs table.

	* generic/tkTextDisp.c:
	* macosx/tkMacOSXInit.c:
	* macosx/tkMacOSXKeyEvent.c:
	* macosx/tkMacOSXWindowEvent.c:
	* macosx/tkMacOSXXStubs.c: fix gcc 4 warnings.

	* macosx/tkMacOSXNotify.c:
	* macosx/tkMacOSXScrlbr.c: sync with core-8-4-branch.

	* generic/tkIntDecls.h:
	* generic/tkIntPlatDecls.h:
	* generic/tkIntXlibDecls.h:
	* generic/tkStubInit.c:
	* unix/configure:
	* unix/tkConfig.h.in: regen.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.10 2005/11/14 22:44:11 dkf Exp $
d549 1
a549 1
			    CONST Tk_FontMetrics *menuMetricsPtr, int x,
@


1.10
log
@ANSIfy
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.9 2005/10/12 09:43:37 dkf Exp $
d244 1
a244 1
EXTERN char *tkMenuStateStrings[];
d494 3
a496 3
EXTERN int		TkActivateMenuEntry(TkMenu *menuPtr, int index);
EXTERN void		TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr);
EXTERN TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp,
d498 3
a500 3
EXTERN void		TkDestroyMenu(TkMenu *menuPtr);
EXTERN void             TkEventuallyRecomputeMenu(TkMenu *menuPtr);
EXTERN void		TkEventuallyRedrawMenu(TkMenu *menuPtr,
d502 2
a503 2
EXTERN TkMenuReferences*TkFindMenuReferences(Tcl_Interp *interp, char *name);
EXTERN TkMenuReferences*TkFindMenuReferencesObj(Tcl_Interp *interp,
d505 3
a507 3
EXTERN int		TkFreeMenuReferences(TkMenuReferences *menuRefPtr);
EXTERN Tcl_HashTable *	TkGetMenuHashTable(Tcl_Interp *interp);
EXTERN int		TkGetMenuIndex(Tcl_Interp *interp, TkMenu *menuPtr,
d509 3
a511 3
EXTERN void		TkMenuInitializeDrawingFields(TkMenu *menuPtr);
EXTERN void		TkMenuInitializeEntryDrawingFields(TkMenuEntry *mePtr);
EXTERN int		TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr,
d513 2
a514 2
EXTERN void		TkMenuConfigureDrawOptions(TkMenu *menuPtr);
EXTERN int		TkMenuConfigureEntryDrawOptions(
d516 3
a518 3
EXTERN void		TkMenuFreeDrawOptions(TkMenu *menuPtr);
EXTERN void		TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr);
EXTERN void		TkMenuEventProc(ClientData clientData,
d520 1
a520 1
EXTERN void		TkMenuImageProc(ClientData clientData, int x, int y,
d523 2
a524 2
EXTERN void		TkMenuInit(void);
EXTERN void		TkMenuSelectImageProc(ClientData clientData, int x,
d527 1
a527 1
EXTERN Tcl_Obj *	TkNewMenuName(Tcl_Interp *interp,
d529 2
a530 2
EXTERN int		TkPostCommand(TkMenu *menuPtr);
EXTERN int		TkPostSubmenu(Tcl_Interp *interp, TkMenu *menuPtr,
d532 1
a532 1
EXTERN int		TkPostTearoffMenu(Tcl_Interp *interp, TkMenu *menuPtr,
d534 2
a535 2
EXTERN int		TkPreprocessMenu(TkMenu *menuPtr);
EXTERN void             TkRecomputeMenu(TkMenu *menuPtr);
d542 6
a547 6
EXTERN void		TkpComputeMenubarGeometry(TkMenu *menuPtr);
EXTERN void		TkpComputeStandardMenuGeometry(TkMenu *menuPtr);
EXTERN int		TkpConfigureMenuEntry(TkMenuEntry *mePtr);
EXTERN void		TkpDestroyMenu(TkMenu *menuPtr);
EXTERN void		TkpDestroyMenuEntry(TkMenuEntry *mEntryPtr);
EXTERN void		TkpDrawMenuEntry(TkMenuEntry *mePtr,
d552 4
a555 4
EXTERN void		TkpMenuInit(void);
EXTERN int		TkpMenuNewEntry(TkMenuEntry *mePtr);
EXTERN int		TkpNewMenu(TkMenu *menuPtr);
EXTERN int		TkpPostMenu(Tcl_Interp *interp, TkMenu *menuPtr,
d557 1
a557 1
EXTERN void		TkpSetWindowMenuBar(Tk_Window tkwin, TkMenu *menuPtr);
@


1.9
log
@Undo accidental checkin
@
text
@d4 2
a5 1
 *	Declarations shared among all of the files that implement menu widgets.
d9 2
a10 2
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d12 1
a12 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.7 2003/05/30 11:03:00 vincentdarley Exp $
d43 2
a44 1
 * Legal values for the "compound" field of TkMenuEntry and TkMenuButton records.
d49 1
a49 1
	COMPOUND_RIGHT, COMPOUND_TOP
d53 2
a54 2
 * One of the following data structures is kept for each entry of each
 * menu managed by this file:
d58 4
a61 3
    int type;			/* Type of menu entry;  see below for
				 * valid types. */
    struct TkMenu *menuPtr;	/* Menu with which this entry is associated. */
d63 2
a64 2
    Tcl_Obj *labelPtr;		/* Main text label displayed in entry (NULL
				 * if no label). */
d74 3
a76 3
    Tcl_Obj *imagePtr;		/* Name of image to display, or
				 * NULL.  If non-NULL, bitmap, text, and
				 * textVarName are ignored. */
d79 1
a79 1
    Tcl_Obj *selectImagePtr;	/* Name of image to display when selected, or 
d81 5
a85 6
    Tk_Image selectImage;	/* Image to display in entry when selected,
				 * or NULL if none.  Ignored if image is
				 * NULL. */
    Tcl_Obj *accelPtr;		/* Accelerator string displayed at right
				 * of menu entry.  NULL means no such
				 * accelerator.  Malloc'ed. */
d96 3
a98 3
				 * entry.  NULL means use overall border
				 * for menu. */
    Tcl_Obj *fgPtr;		/* Foreground color to use for entry.  NULL
d101 1
a101 1
				 * element is active.  NULL means use
d104 1
a104 1
				 * active.  NULL means use active foreground
d107 1
a107 1
				 * button entries.  NULL means use indicatorFg
d109 6
a114 6
    Tcl_Obj *fontPtr;		/* Text font for menu entries.  NULL means
				 * use overall font for menu. */
    int columnBreak;		/* If this is 0, this item appears below
				 * the item in front of it. If this is
				 * 1, this item starts a new column. This
				 * field is always 0 for tearoff and separator
d119 1
a119 1
    				 * then the item has no such margins.  and
d121 5
a125 4
    				 * will have a rectangle drawn in the indicator
    				 * around the item if the item is checked. This
    				 * is useful for palette menus.  This field is
    				 * ignored for separators and tearoffs. */
d130 3
a132 3
    int compound;		/* Value of -compound option; specifies whether
				 * the entry should show both an image and
				 * text, and, if so, how. */
d149 1
a149 1
    
d153 1
a153 1
     
d155 3
a157 3
				 * horizontal dimension. Not used except
				 * in menubars. The width of norma menus
				 * is dependent on the rest of the menu. */
d160 2
a161 2
				 * vertical dimension, including raised
				 * border drawn around entry when active. */
d169 5
a173 6
				 * NULL means use overall disabledGC from
				 * menu structure.  See comments for
				 * disabledFg in menu structure for more
				 * information. */
    GC indicatorGC;		/* For drawing indicators.  None means use
				 * GC from menu. */
d178 7
a184 7
 
    int entryFlags;		/* Various flags.  See below for
				   definitions. */
    int index;			/* Need to know which index we are. This
    				 * is zero-based. This is the top-left entry
    				 * of the menu. */
				 
d188 1
a188 1
     
d190 4
a193 4
    				/* A pointer to the hash table entry for
    				 * the child menu. Stored here when the menu
    				 * entry is configured so that a hash lookup
    				 * is not necessary later.*/
d196 4
a199 4
    				 * this entry's child cascade menu. NULL
    				 * end of list, this is not a cascade entry,
    				 * or the menu that this entry point to
    				 * does not yet exist. */
d202 2
a203 3
				 * Depends on platform and menu type what
  				 * kind of options are in this structure.
  				 */
d209 3
a211 3
 * ENTRY_SELECTED:		Non-zero means this is a radio or check
 *				button and that it should be drawn in
 *				the "selected" state.
d251 1
a251 2
 * A data structure of the following type is kept for each
 * menu widget:
d255 5
a259 5
    Tk_Window tkwin;		/* Window that embodies the pane.  NULL
				 * means that the window has been destroyed
				 * but the data structures haven't yet been
				 * cleaned up.*/
    Display *display;		/* Display containing widget.  Needed, among
d264 2
a265 2
    TkMenuEntry **entries;	/* Array of pointers to all the entries
				 * in the menu.  NULL means no entries. */
d267 7
a273 7
    int active;			/* Index of active entry.  -1 means
				 * nothing active. */
    int menuType;		/* MASTER_MENU, TEAROFF_MENU, or MENUBAR.
    				 * See below for definitions. */
    Tcl_Obj *menuTypePtr;	/* Used to control whether created tkwin
				 * is a toplevel or not. "normal", "menubar",
				 * or "toplevel" */
d279 2
a280 2
    Tcl_Obj *borderPtr;		/* Structure used to draw 3-D
				 * border and background for menu. */
d289 2
a290 3
    Tcl_Obj *disabledFgPtr;	/* Foreground color when disabled.  NULL
				 * means use normalFg with a 50% stipple
				 * instead. */
d294 6
a299 6
    Pixmap gray;		/* Bitmap for drawing disabled entries in
				 * a stippled fashion.  None means not
				 * allocated yet. */
    GC textGC;			/* GC for drawing text and other features
				 * of menu entries. */
    GC disabledGC;		/* Used to produce disabled effect.  If
d307 4
a310 4
    GC disabledImageGC;		/* Used for drawing disabled images. They
				 * have to be stippled. This is created
				 * when the image is about to be drawn the
				 * first time. */
d315 1
a315 1
    
d318 1
a318 1
   
d324 7
a330 7
    				 * platforms, the user can drag an outline
    				 * of the menu by just dragging outside of
    				 * the menu, and the tearoff is created where
    				 * the mouse is released. On others, an
				 * indicator (such as a dashed stripe) is
				 * drawn, and when the menu is selected, the
				 * tearoff is created. */
d332 6
a337 7
    				 * off. If this is NULL, a default scheme
    				 * will be used to generate a title for
    				 * tearoff. */
    Tcl_Obj *tearoffCommandPtr;	/* If non-NULL, points to a command to
				 * run whenever the menu is torn-off. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;  not used in
				 * the C code, but used by keyboard traversal
d341 3
a343 3
    				 * trees when preprocessing postcommands
    				 * on some platforms. See PostMenu for
    				 * more details. */
d351 1
a351 1
    struct TkMenu *nextInstancePtr;	
d359 3
a361 2
				/* A pointer to the collection of option tables
				 * that work with menus and menu entries. */
d363 3
a365 4
    				 * toplevel that owns the menu. Only applicable
    				 * for menubar clones.
    				 */
    struct TkMenuReferences *menuRefPtr;	
d367 7
a373 8
    				 * name of the menu's window as the key.
    				 * The information in this hash table includes
    				 * a pointer to the menu (so that cascades
    				 * can find this menu), a pointer to the
    				 * list of toplevel widgets that have this
    				 * menu as its menubar, and a list of menu
    				 * entries that have this menu specified
    				 * as a cascade. */    
d376 3
a378 5
  				 * Depends on platform and menu type what
  				 * kind of options are in this structure.
  				 */
    Tk_OptionSpec *extensionPtr;
				/* Needed by the configuration package for
d388 2
a389 2
 * exist yet. We need to keep a linked list of windows that reference
 * a particular menu.
d400 2
a401 2
 * The following structure is used to keep track of things which
 * reference a menu. It is created when:
d404 2
a405 2
 * - the "-menu" configuration option is used on a toplevel widget
 * with a non-null parameter.
d407 4
a410 4
 * One of these three fields must be non-NULL, but any of the fields may
 * be NULL. This structure makes it easy to determine whether or not
 * anything like recalculating platform data or geometry is necessary
 * when one of the three actions above is performed.
d414 2
a415 2
    struct TkMenu *menuPtr;	/* The menu data structure. This is NULL
    				 * if the menu does not exist. */
d417 2
a418 2
    				/* First in the list of all toplevels that 
    				 * have this menu as its menubar. NULL if no 
d421 1
a421 1
    TkMenuEntry *parentEntryPtr;/* First in the list of all cascade menu 
d426 1
a426 2
    				 * be around when we are deleting.
    				 */
d430 1
a430 2
 * This structure contains all of the option tables that are needed
 * by menus.
d434 4
a437 2
    Tk_OptionTable menuOptionTable;	/* The option table for menus. */
    Tk_OptionTable entryOptionTables[6];/* The tables for menu entries. */
d443 2
a444 3
 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler
 *				has already been queued to redraw
 *				this window.
d447 5
a451 5
 * MENU_DELETION_PENDING	Non-zero means that we are currently destroying
 *				this menu's internal structures. This is useful 
 *				when we are in the middle of cleaning
 *				this master menu's chain of menus up when
 *				TkDestroyMenu was called again on this
d453 1
a453 1
 * MENU_WIN_DESTRUCTION_PENDING Non-zero means we are in the middle of 
d468 3
a470 3
 * Each menu created by the user is a MASTER_MENU. When a menu is torn off,
 * a TEAROFF_MENU instance is created. When a menu is assigned to a toplevel
 * as a menu bar, a MENUBAR instance is created. All instances have the same
d475 1
a475 1
 
d490 2
a491 2
 * Menu-related procedures that are shared among Tk modules but not exported
 * to the outside world:
d494 27
a520 45
EXTERN int		TkActivateMenuEntry _ANSI_ARGS_((TkMenu *menuPtr,
			    int index));
EXTERN void		TkBindMenu _ANSI_ARGS_((
			    Tk_Window tkwin, TkMenu *menuPtr));
EXTERN TkMenuReferences *
			TkCreateMenuReferences _ANSI_ARGS_((Tcl_Interp *interp,
			    char *name));
EXTERN void		TkDestroyMenu _ANSI_ARGS_((TkMenu *menuPtr));
EXTERN void             TkEventuallyRecomputeMenu _ANSI_ARGS_((
			    TkMenu *menuPtr));
EXTERN void		TkEventuallyRedrawMenu _ANSI_ARGS_((
    			    TkMenu *menuPtr, TkMenuEntry *mePtr));
EXTERN TkMenuReferences *
			TkFindMenuReferences _ANSI_ARGS_((Tcl_Interp *interp,
			    char *name));
EXTERN TkMenuReferences *
			TkFindMenuReferencesObj _ANSI_ARGS_((
			    Tcl_Interp *interp, Tcl_Obj *namePtr));
EXTERN int		TkFreeMenuReferences _ANSI_ARGS_((
			    TkMenuReferences *menuRefPtr));
EXTERN Tcl_HashTable *	TkGetMenuHashTable _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int		TkGetMenuIndex _ANSI_ARGS_((Tcl_Interp *interp,
			    TkMenu *menuPtr, Tcl_Obj *objPtr, int lastOK,
			    int *indexPtr));
EXTERN void		TkMenuInitializeDrawingFields _ANSI_ARGS_((
			    TkMenu *menuPtr));
EXTERN void		TkMenuInitializeEntryDrawingFields _ANSI_ARGS_((
			    TkMenuEntry *mePtr));
EXTERN int		TkInvokeMenu _ANSI_ARGS_((Tcl_Interp *interp,
			    TkMenu *menuPtr, int index));
EXTERN void		TkMenuConfigureDrawOptions _ANSI_ARGS_((
			    TkMenu *menuPtr));
EXTERN int		TkMenuConfigureEntryDrawOptions _ANSI_ARGS_((
			    TkMenuEntry *mePtr, int index));
EXTERN void		TkMenuFreeDrawOptions _ANSI_ARGS_((TkMenu *menuPtr));
EXTERN void		TkMenuEntryFreeDrawOptions _ANSI_ARGS_((
			    TkMenuEntry *mePtr));
EXTERN void		TkMenuEventProc _ANSI_ARGS_((ClientData clientData,
    			    XEvent *eventPtr));
EXTERN void		TkMenuImageProc _ANSI_ARGS_((
    			    ClientData clientData, int x, int y, int width,
			    int height, int imgWidth, int imgHeight));
EXTERN void		TkMenuInit _ANSI_ARGS_((void));
EXTERN void		TkMenuSelectImageProc _ANSI_ARGS_
			    ((ClientData clientData, int x, int y,
d522 27
a548 27
			    int imgHeight));
EXTERN Tcl_Obj *	TkNewMenuName _ANSI_ARGS_((Tcl_Interp *interp, 
			    Tcl_Obj *parentNamePtr, TkMenu *menuPtr));
EXTERN int		TkPostCommand _ANSI_ARGS_((TkMenu *menuPtr));
EXTERN int		TkPostSubmenu _ANSI_ARGS_((Tcl_Interp *interp,
			    TkMenu *menuPtr, TkMenuEntry *mePtr));
EXTERN int		TkPostTearoffMenu _ANSI_ARGS_((Tcl_Interp *interp,
			    TkMenu *menuPtr, int x, int y));
EXTERN int		TkPreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
EXTERN void             TkRecomputeMenu _ANSI_ARGS_((TkMenu *menuPtr));

/*
 * These routines are the platform-dependent routines called by the
 * common code.
 */

EXTERN void		TkpComputeMenubarGeometry _ANSI_ARGS_((
			    TkMenu *menuPtr));
EXTERN void		TkpComputeStandardMenuGeometry _ANSI_ARGS_
			    ((TkMenu *menuPtr));
EXTERN int		TkpConfigureMenuEntry
                            _ANSI_ARGS_((TkMenuEntry *mePtr));
EXTERN void		TkpDestroyMenu _ANSI_ARGS_((TkMenu *menuPtr));
EXTERN void		TkpDestroyMenuEntry
			    _ANSI_ARGS_((TkMenuEntry *mEntryPtr));
EXTERN void		TkpDrawMenuEntry _ANSI_ARGS_((TkMenuEntry *mePtr,
			    Drawable d, Tk_Font tkfont, 
d551 7
a557 8
			    int drawArrow));
EXTERN void		TkpMenuInit _ANSI_ARGS_((void));
EXTERN int		TkpMenuNewEntry _ANSI_ARGS_((TkMenuEntry *mePtr));
EXTERN int		TkpNewMenu _ANSI_ARGS_((TkMenu *menuPtr));
EXTERN int		TkpPostMenu _ANSI_ARGS_((Tcl_Interp *interp,
			    TkMenu *menuPtr, int x, int y));
EXTERN void		TkpSetWindowMenuBar _ANSI_ARGS_((Tk_Window tkwin,
			    TkMenu *menuPtr));
@


1.8
log
@Arrange the test suite so that it only accesses images in the same directory.
This enables packaging of the test suite as a starkit.
@
text
@a388 1
    int refCount;
@


1.7
log
@fix to menu clone deletion bug
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.6 2001/10/12 13:30:31 tmh Exp $
d389 1
@


1.6
log
@implementation of TIP 63 (accepted) -compound option to menu items.
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.5 1999/04/16 01:51:19 stanton Exp $
d454 7
a460 4
 *				this menu. This is useful when we are in the 
 *				middle of cleaning this master menu's chain of 
 *				menus up when TkDestroyMenu was called again on
 *				this menu (via a destroy binding or somesuch).
d465 4
a468 3
#define REDRAW_PENDING		1
#define RESIZE_PENDING		2
#define MENU_DELETION_PENDING	4
d518 1
a518 1
EXTERN void		TkFreeMenuReferences _ANSI_ARGS_((
@


1.6.4.1
log
@menu clone cleanup bug fix
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.7 2003/05/30 11:03:00 vincentdarley Exp $
d454 4
a457 7
 *				this menu's internal structures. This is useful 
 *				when we are in the middle of cleaning
 *				this master menu's chain of menus up when
 *				TkDestroyMenu was called again on this
 *				menu (via a destroy binding or somesuch).
 * MENU_WIN_DESTRUCTION_PENDING Non-zero means we are in the middle of 
 *                              destroying this menu's Tk_Window.
d462 3
a464 4
#define REDRAW_PENDING		        1
#define RESIZE_PENDING		        2
#define MENU_DELETION_PENDING	        4
#define MENU_WIN_DESTRUCTION_PENDING	8
d514 1
a514 1
EXTERN int		TkFreeMenuReferences _ANSI_ARGS_((
@


1.5
log
@* Merged 8.1 branch into the main trunk
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id$
d42 9
d127 3
@


1.5.14.1
log
@sync with head
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.6 2001/10/12 13:30:31 tmh Exp $
a41 9
 * Legal values for the "compound" field of TkMenuEntry and TkMenuButton records.
 */

enum compound {
    COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE,
	COMPOUND_RIGHT, COMPOUND_TOP
};

/*
a117 3
    int compound;		/* Value of -compound option; specifies whether
				 * the entry should show both an image and
				 * text, and, if so, how. */
@


1.4
log
@Replaced SCCS strings, fixed binary files
@
text
@d6 1
a6 1
 * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
d50 3
a52 2
    char *label;		/* Main text label displayed in entry (NULL
				 * if no label).  Malloc'ed. */
d54 1
a54 1
    Tk_Uid state;		/* State of button for display purposes:
d56 5
a60 2
    int underline;		/* Index of character to underline. */
    Pixmap bitmap;		/* Bitmap to display in menu entry, or None.
d62 1
a62 1
    char *imageString;		/* Name of image to display (malloc'ed), or
d67 2
a68 2
    char *selectImageString;	/* Name of image to display when selected
				 * (malloc'ed), or NULL. */
d72 1
a72 1
    char *accel;		/* Accelerator string displayed at right
d78 2
a79 1
				 * don't draw it. */
d84 1
a84 1
    Tk_3DBorder border;		/* Structure used to draw background for
d87 1
a87 1
    XColor *fg;			/* Foreground color to use for entry.  NULL
d89 1
a89 1
    Tk_3DBorder activeBorder;	/* Used to draw background and border when
d92 1
a92 1
    XColor *activeFg;		/* Foreground color to use when entry is
d95 1
a95 1
    XColor *indicatorFg;	/* Color for indicators in radio and check
d98 1
a98 1
    Tk_Font tkfont;		/* Text font for menu entries.  NULL means
d102 3
a104 1
				 * 1, this item starts a new column. */
d106 8
a113 8
    				 * margin to accomodate a standard check
    				 * mark and a default right margin. If this 
    				 * is 1, then the item has no such margins.
    				 * and checkbuttons and radiobuttons with
    				 * this set will have a rectangle drawn
    				 * in the indicator around the item if
    				 * the item is checked.
    				 * This is useful palette menus.*/ 
d115 1
a115 2
				 * entry.
				 */
d123 1
a123 1
    char *command;		/* Command to invoke when entry is invoked.
d125 1
a125 1
    char *name;			/* Name of variable (for check buttons and
d128 1
a128 1
    char *onValue;		/* Value to store in variable when selected
d131 1
a131 1
    char *offValue;		/* Value to store in variable when not
d188 1
a188 1
  				 * Depends on platform and menu type what
d200 3
a202 3
 * ENTRY_LAST_COLUMN:		Used by the drawing code. If the entry is in the
 *				last column, the space to its right needs to
 *				be filled.
d220 16
a235 19
#define COMMAND_ENTRY		0
#define SEPARATOR_ENTRY		1
#define CHECK_BUTTON_ENTRY	2
#define RADIO_BUTTON_ENTRY	3
#define CASCADE_ENTRY		4
#define TEAROFF_ENTRY		5

/*
 * Mask bits for above types:
 */

#define COMMAND_MASK		TK_CONFIG_USER_BIT
#define SEPARATOR_MASK		(TK_CONFIG_USER_BIT << 1)
#define CHECK_BUTTON_MASK	(TK_CONFIG_USER_BIT << 2)
#define RADIO_BUTTON_MASK	(TK_CONFIG_USER_BIT << 3)
#define CASCADE_MASK		(TK_CONFIG_USER_BIT << 4)
#define TEAROFF_MASK		(TK_CONFIG_USER_BIT << 5)
#define ALL_MASK		(COMMAND_MASK | SEPARATOR_MASK \
	| CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | CASCADE_MASK | TEAROFF_MASK)
d259 1
a259 1
    char *menuTypeName;		/* Used to control whether created tkwin
d267 1
a267 1
    Tk_3DBorder border;		/* Structure used to draw 3-D
d269 2
a270 2
    int borderWidth;		/* Width of border around whole menu. */
    Tk_3DBorder activeBorder;	/* Used to draw background and border for
d272 6
a277 5
    int activeBorderWidth;	/* Width of border around active element. */
    int relief;			/* 3-d effect: TK_RELIEF_RAISED, etc. */
    Tk_Font tkfont;		/* Text font for menu entries. */
    XColor *fg;			/* Foreground color for entries. */
    XColor *disabledFg;		/* Foreground color when disabled.  NULL
d280 2
a281 2
    XColor *activeFg;		/* Foreground color for active entry. */
    XColor *indicatorFg;	/* Color for indicators in radio and check
d312 1
a312 1
    int tearOff;		/* 1 means this menu can be torn off. On some
d320 1
a320 1
    char *title;		/* The title to use when this menu is torn
d324 1
a324 1
    char *tearOffCommand;	/* If non-NULL, points to a command to
d326 1
a326 1
    char *takeFocus;		/* Value of -takefocus option;  not used in
d329 2
a330 2
    Tk_Cursor cursor;		/* Current cursor for window, or None. */
    char *postCommand;		/* Used to detect cycles in cascade hierarchy
d348 3
d370 7
d424 10
a479 7
 * Configuration specs. Needed for platform-specific default initializations.
 */

EXTERN Tk_ConfigSpec tkMenuEntryConfigSpecs[];
EXTERN Tk_ConfigSpec tkMenuConfigSpecs[];

/*
d490 1
a490 1
			    char *pathName));
d492 2
a493 1
EXTERN void             TkEventuallyRecomputeMenu _ANSI_ARGS_((TkMenu *menuPtr));
d498 4
a501 1
			    char *pathName));
d506 1
a506 1
			    TkMenu *menuPtr, char *string, int lastOK,
d508 2
a509 1
EXTERN void		TkMenuInitializeDrawingFields _ANSI_ARGS_((TkMenu *menuPtr));
d531 2
a532 2
EXTERN char *		TkNewMenuName _ANSI_ARGS_((Tcl_Interp *interp, 
			    char *parentName, TkMenu *menuPtr));
d546 2
a547 1
EXTERN void		TkpComputeMenubarGeometry _ANSI_ARGS_((TkMenu *menuPtr));
@


1.3
log
@EXPORT is now TCL_STORAGE_CLASS
@
text
@d11 1
a11 1
 * SCCS: @@(#) tkMenu.h 1.60 97/06/20 14:43:21
@


1.2
log
@added support for export/import of DLL symbols. If BUILD_tk is defined,
EXPORT is mapped to DLLEXPORT, otherwise it is DLLIMPORT.
@
text
@d30 2
a31 2
# undef EXPORT
# define EXPORT DLLEXPORT
d545 2
a546 2
#undef EXPORT
#define EXPORT DLLIMPORT
@


1.1
log
@Initial revision
@
text
@d29 5
d545 3
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d6 1
a6 1
 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
d11 1
a11 1
 * SCCS: @@(#) tkMenu.h 1.71 98/01/20 16:39:03
d45 2
a46 3
    Tk_OptionTable optionTable;	/* Option table for this menu entry. */
    Tcl_Obj *labelPtr;		/* Main text label displayed in entry (NULL
				 * if no label). */
d48 1
a48 1
    Tcl_Obj *statePtr;		/* State of button for display purposes:
d50 2
a51 5
    int underline;		/* Value of -underline option: specifies index
				 * of character to underline (<0 means don't
				 * underline anything). */
    Tcl_Obj *underlinePtr;	/* Index of character to underline. */
    Tcl_Obj *bitmapPtr;		/* Bitmap to display in menu entry, or None.
d53 1
a53 1
    Tcl_Obj *imagePtr;		/* Name of image to display, or
d58 2
a59 2
    Tcl_Obj *selectImagePtr;	/* Name of image to display when selected, or 
				 * NULL. */
d63 1
a63 1
    Tcl_Obj *accelPtr;		/* Accelerator string displayed at right
d68 1
a68 1
    Tcl_Obj *indicatorOnPtr;	/* True means draw indicator, false means
d74 1
a74 1
    Tcl_Obj *borderPtr;		/* Structure used to draw background for
d77 1
a77 1
    Tcl_Obj *fgPtr;		/* Foreground color to use for entry.  NULL
d79 1
a79 1
    Tcl_Obj *activeBorderPtr;	/* Used to draw background and border when
d82 1
a82 1
    Tcl_Obj *activeFgPtr;	/* Foreground color to use when entry is
d85 1
a85 1
    Tcl_Obj *indicatorFgPtr;	/* Color for indicators in radio and check
d88 1
a88 1
    Tcl_Obj *fontPtr;		/* Text font for menu entries.  NULL means
d90 1
a90 1
    Tcl_Obj *columnBreakPtr;	/* If this is 0, this item appears below
d93 1
a93 1
    Tcl_Obj *hideMarginPtr;	/* If this is 0, then the item has enough
d112 1
a112 1
    Tcl_Obj *commandPtr;	/* Command to invoke when entry is invoked.
d114 1
a114 1
    Tcl_Obj *namePtr;		/* Name of variable (for check buttons and
d117 1
a117 1
    Tcl_Obj *onValuePtr;	/* Value to store in variable when selected
d120 1
a120 1
    Tcl_Obj *offValuePtr;	/* Value to store in variable when not
d177 1
a177 1
				 * Depends on platform and menu type what
d189 3
a191 3
 * ENTRY_LAST_COLUMN:		Used by the drawing code. If the entry is in
 *				the last column, the space to its right needs
 *				to be filled.
d209 19
a227 16
#define CASCADE_ENTRY 0
#define CHECK_BUTTON_ENTRY 1
#define COMMAND_ENTRY 2
#define RADIO_BUTTON_ENTRY 3
#define SEPARATOR_ENTRY 4
#define TEAROFF_ENTRY 5

/*
 * Menu states
 */

EXTERN char *tkMenuStateStrings[];

#define ENTRY_ACTIVE 0
#define ENTRY_NORMAL 1
#define ENTRY_DISABLED 2
d251 1
a251 1
    Tcl_Obj *menuTypePtr;	/* Used to control whether created tkwin
d259 1
a259 1
    Tcl_Obj *borderPtr;		/* Structure used to draw 3-D
d261 2
a262 2
    Tcl_Obj *borderWidthPtr;	/* Width of border around whole menu. */
    Tcl_Obj *activeBorderPtr;	/* Used to draw background and border for
d264 5
a268 6
    Tcl_Obj *activeBorderWidthPtr;
				/* Width of border around active element. */
    Tcl_Obj *reliefPtr;		/* 3-d effect: TK_RELIEF_RAISED, etc. */
    Tcl_Obj *fontPtr;		/* Text font for menu entries. */
    Tcl_Obj *fgPtr;		/* Foreground color for entries. */
    Tcl_Obj *disabledFgPtr;	/* Foreground color when disabled.  NULL
d271 2
a272 2
    Tcl_Obj *activeFgPtr;	/* Foreground color for active entry. */
    Tcl_Obj *indicatorFgPtr;	/* Color for indicators in radio and check
d303 1
a303 1
    Tcl_Obj *tearoffPtr;	/* 1 means this menu can be torn off. On some
d311 1
a311 1
    Tcl_Obj *titlePtr;		/* The title to use when this menu is torn
d315 1
a315 1
    Tcl_Obj *tearoffCommandPtr;	/* If non-NULL, points to a command to
d317 1
a317 1
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;  not used in
d320 2
a321 2
    Tcl_Obj *cursorPtr;		/* Current cursor for window, or None. */
    Tcl_Obj *postCommandPtr;	/* Used to detect cycles in cascade hierarchy
a338 3
    struct TkMenuOptionTables *optionTablesPtr;
				/* A pointer to the collection of option tables
				 * that work with menus and menu entries. */
a357 7
    Tk_OptionSpec *extensionPtr;
				/* Needed by the configuration package for
				 * this widget to be extended. */
    Tk_SavedOptions *errorStructPtr;
				/* We actually have to allocate these because
				 * multiple menus get changed during one
				 * ConfigureMenu call. */
a404 10
 * This structure contains all of the option tables that are needed
 * by menus.
 */

typedef struct TkMenuOptionTables {
    Tk_OptionTable menuOptionTable;	/* The option table for menus. */
    Tk_OptionTable entryOptionTables[6];/* The tables for menu entries. */
} TkMenuOptionTables;

/*
d451 7
d468 1
a468 1
			    char *name));
d470 1
a470 2
EXTERN void             TkEventuallyRecomputeMenu _ANSI_ARGS_((
			    TkMenu *menuPtr));
d475 1
a475 4
			    char *name));
EXTERN TkMenuReferences *
			TkFindMenuReferencesObj _ANSI_ARGS_((
			    Tcl_Interp *interp, Tcl_Obj *namePtr));
d480 1
a480 1
			    TkMenu *menuPtr, Tcl_Obj *objPtr, int lastOK,
d482 1
a482 2
EXTERN void		TkMenuInitializeDrawingFields _ANSI_ARGS_((
			    TkMenu *menuPtr));
d504 2
a505 2
EXTERN Tcl_Obj *	TkNewMenuName _ANSI_ARGS_((Tcl_Interp *interp, 
			    Tcl_Obj *parentNamePtr, TkMenu *menuPtr));
d519 1
a519 2
EXTERN void		TkpComputeMenubarGeometry _ANSI_ARGS_((
			    TkMenu *menuPtr));
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.4 1998/09/14 18:23:14 stanton Exp $
a28 5
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

a559 3

# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
@


1.1.4.3
log
@* tkMacMenu.c, tkUnixMenu.c, tkWinMenu.c, tkMenuDraw.c, tkMenu.h,
* tkMenu.c: Backed out the previous fix for bug 620 and
eliminated a bunch of code that created unnecessary objects.
Changed back to using internal types instead of objects for many
configuration options.  There are many more fixes like this that
could be made, but some require a little restructuring of the
code. In any case the leaks are fixed and there is a lot less
allocation happening. [Bug: 620]
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.1.4.2 1998/09/30 02:17:09 stanton Exp $
d54 1
a54 1
    int state;			/* State of button for display purposes:
d77 2
a78 3
    int indicatorOn;		/* True means draw indicator, false means
				 * don't draw it. This field is ignored unless
				 * the entry is a radio or check button. */
d99 1
a99 1
    int columnBreak;		/* If this is 0, this item appears below
d101 10
a110 12
				 * 1, this item starts a new column. This
				 * field is always 0 for tearoff and separator
				 * entries. */
    int hideMargin;		/* If this is 0, then the item has enough
    				 * margin to accomodate a standard check mark
    				 * and a default right margin. If this is 1,
    				 * then the item has no such margins.  and
    				 * checkbuttons and radiobuttons with this set
    				 * will have a rectangle drawn in the indicator
    				 * around the item if the item is checked. This
    				 * is useful for palette menus.  This field is
    				 * ignored for separators and tearoffs. */
d112 2
a113 1
				 * entry. */
d310 1
a310 1
    int tearoff;		/* 1 means this menu can be torn off. On some
@


1.1.4.4
log
@Added forward reference for TkpMenuThreadInit().
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.1.4.3 1998/11/24 21:42:43 stanton Exp $
a560 1
EXTERN void		TkpMenuThreadInit _ANSI_ARGS_((void));
@


1.1.4.5
log
@integrated stubs from development branch
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.1.4.4 1999/03/09 01:52:38 lfb Exp $
d561 1
@


1.1.4.4.2.1
log
@Added files new to 8.1, from 8.0.6 dev-stubs-branch.
@
text
@d11 1
a11 1
 * RCS: @@(#) $Id: tkMenu.h,v 1.1.4.4 1999/03/09 01:52:38 lfb Exp $
d561 1
@


