| 1 | /* |
| 2 | * |
| 3 | Copyright 1989, 1994, 1998 The Open Group |
| 4 | |
| 5 | Permission to use, copy, modify, distribute, and sell this software and its |
| 6 | documentation for any purpose is hereby granted without fee, provided that |
| 7 | the above copyright notice appear in all copies and that both that |
| 8 | copyright notice and this permission notice appear in supporting |
| 9 | documentation. |
| 10 | |
| 11 | The above copyright notice and this permission notice shall be included in |
| 12 | all copies or substantial portions of the Software. |
| 13 | |
| 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 20 | |
| 21 | Except as contained in this notice, the name of The Open Group shall not be |
| 22 | used in advertising or otherwise to promote the sale, use or other dealings |
| 23 | in this Software without prior written authorization from The Open Group. |
| 24 | * |
| 25 | * Author: Chris D. Peterson, MIT X Consortium |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * SimpleMenu.h - Public Header file for SimpleMenu widget. |
| 30 | * |
| 31 | * This is the public header file for the Athena SimpleMenu widget. |
| 32 | * It is intended to provide one pane pulldown and popup menus within |
| 33 | * the framework of the X Toolkit. As the name implies it is a first and |
| 34 | * by no means complete implementation of menu code. It does not attempt to |
| 35 | * fill the needs of all applications, but does allow a resource oriented |
| 36 | * interface to menus. |
| 37 | * |
| 38 | * Date: April 3, 1989 |
| 39 | * |
| 40 | * By: Chris D. Peterson |
| 41 | * MIT X Consortium |
| 42 | * kit@expo.lcs.mit.edu |
| 43 | */ |
| 44 | |
| 45 | #ifndef _SimpleMenu_h |
| 46 | #define _SimpleMenu_h |
| 47 | |
| 48 | #include <X11/Shell.h> |
| 49 | #include <X11/Xmu/Converters.h> |
| 50 | |
| 51 | /* |
| 52 | * SimpleMenu widget |
| 53 | */ |
| 54 | |
| 55 | /* Resources: |
| 56 | |
| 57 | Name Class RepType Default Value |
| 58 | ---- ----- ------- ------------- |
| 59 | background Background Pixel XtDefaultBackground |
| 60 | backgroundPixmap BackgroundPixmap Pixmap None |
| 61 | borderColor BorderColor Pixel XtDefaultForeground |
| 62 | borderPixmap BorderPixmap Pixmap None |
| 63 | borderWidth BorderWidth Dimension 1 |
| 64 | bottomMargin VerticalMargins Dimension VerticalSpace |
| 65 | columnWidth ColumnWidth Dimension Width of widest text |
| 66 | cursor Cursor Cursor None |
| 67 | destroyCallback Callback Pointer NULL |
| 68 | displayList DisplayList XawDisplayList* NULL |
| 69 | height Height Dimension 0 |
| 70 | label Label String NULL (No label) |
| 71 | labelClass LabelClass Pointer smeBSBObjectClass |
| 72 | leftMargin HorizontalMargins Dimension 0 |
| 73 | mappedWhenManaged MappedWhenManaged Boolean True |
| 74 | rightMargin HorizontalMargins Dimension 0 |
| 75 | rowHeight RowHeight Dimension Height of Font |
| 76 | sensitive Sensitive Boolean True |
| 77 | topMargin VerticalMargins Dimension VerticalSpace |
| 78 | width Width Dimension 0 |
| 79 | x Position Position 0 |
| 80 | y Position Position 0 |
| 81 | |
| 82 | */ |
| 83 | |
| 84 | typedef struct _SimpleMenuClassRec* SimpleMenuWidgetClass; |
| 85 | typedef struct _SimpleMenuRec* SimpleMenuWidget; |
| 86 | |
| 87 | extern WidgetClass simpleMenuWidgetClass; |
| 88 | |
| 89 | #define XtNcursor "cursor" |
| 90 | #define XtNbottomMargin "bottomMargin" |
| 91 | #define XtNcolumnWidth "columnWidth" |
| 92 | #define XtNlabelClass "labelClass" |
| 93 | #define XtNmenuOnScreen "menuOnScreen" |
| 94 | #define XtNpopupOnEntry "popupOnEntry" |
| 95 | #define XtNrowHeight "rowHeight" |
| 96 | #define XtNtopMargin "topMargin" |
| 97 | #define XtNleftMargin "leftMargin" |
| 98 | #define XtNrightMargin "rightMargin" |
| 99 | |
| 100 | #define XtCColumnWidth "ColumnWidth" |
| 101 | #define XtCLabelClass "LabelClass" |
| 102 | #define XtCMenuOnScreen "MenuOnScreen" |
| 103 | #define XtCPopupOnEntry "PopupOnEntry" |
| 104 | #define XtCRowHeight "RowHeight" |
| 105 | |
| 106 | #define XtCVerticalMargins "VerticalMargins" |
| 107 | |
| 108 | #ifndef OLDXAW |
| 109 | #define XtCHorizontalMargins "HorizontalMargins" |
| 110 | #define XawNdisplayList "displayList" |
| 111 | #define XawCDisplayList "DisplayList" |
| 112 | #define XawRDisplayList "XawDisplayList" |
| 113 | #endif |
| 114 | |
| 115 | /* |
| 116 | * Public Functions |
| 117 | */ |
| 118 | |
| 119 | _XFUNCPROTOBEGIN |
| 120 | |
| 121 | /* |
| 122 | * Function: |
| 123 | * XawSimpleMenuAddGlobalActions |
| 124 | * |
| 125 | * Parameters: |
| 126 | * app_con - appcontext |
| 127 | * |
| 128 | * Description: |
| 129 | * Adds the global actions to the simple menu widget. |
| 130 | */ |
| 131 | void XawSimpleMenuAddGlobalActions |
| 132 | ( |
| 133 | XtAppContext app_con |
| 134 | ); |
| 135 | |
| 136 | /* |
| 137 | * Function: |
| 138 | * XawSimpleMenuGetActiveEntry |
| 139 | * |
| 140 | * Parameters: |
| 141 | * w - smw widget |
| 142 | * |
| 143 | * Description: |
| 144 | * Gets the currently active (set) entry. |
| 145 | * |
| 146 | * Returns: |
| 147 | * The currently set entry or NULL if none is set |
| 148 | */ |
| 149 | Widget XawSimpleMenuGetActiveEntry |
| 150 | ( |
| 151 | Widget w |
| 152 | ); |
| 153 | |
| 154 | /* |
| 155 | * Function: |
| 156 | * XawSimpleMenuClearActiveEntry |
| 157 | * |
| 158 | * Parameters: |
| 159 | * w - smw widget |
| 160 | * |
| 161 | * Description: |
| 162 | * Unsets the currently active (set) entry. |
| 163 | */ |
| 164 | void XawSimpleMenuClearActiveEntry |
| 165 | ( |
| 166 | Widget w |
| 167 | ); |
| 168 | |
| 169 | _XFUNCPROTOEND |
| 170 | |
| 171 | #endif /* _SimpleMenu_h */ |