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 26 /* 27 * ToggleP.h - Private definitions for Toggle widget 28 * 29 * Author: Chris D. Peterson 30 * MIT X Consortium 31 * kit@expo.lcs.mit.edu 32 * 33 * Date: January 12, 1989 34 */ 35 36 #ifndef _XawToggle_h 37 #define _XawToggle_h 38 39 #include <X11/Xaw/Command.h> 40 41 /* Resources: 42 43 Name Class RepType Default Value 44 ---- ----- ------- ------------- 45 radioGroup RadioGroup Widget NULL + 46 radioData RadioData Pointer (XPointer) Widget ++ 47 state State Boolean Off 48 49 background Background Pixel XtDefaultBackground 50 bitmap Pixmap Pixmap None 51 border BorderColor Pixel XtDefaultForeground 52 borderWidth BorderWidth Dimension 1 53 callback Callback Pointer NULL 54 cursor Cursor Cursor None 55 destroyCallback Callback Pointer NULL 56 displayList DisplayList XawDisplayList* NULL 57 font Font XFontStructx* XtDefaultFont 58 foreground Foreground Pixel XtDefaultForeground 59 height Height Dimension text height 60 highlightThickness Thickness Dimension 2 61 insensitiveBorder Insensitive Pixmap Gray 62 internalHeight Height Dimension 2 63 internalWidth Width Dimension 4 64 justify Justify XtJustify XtJustifyCenter 65 label Label String NULL 66 mappedWhenManaged MappedWhenManaged Boolean True 67 resize Resize Boolean True 68 sensitive Sensitive Boolean True 69 width Width Dimension text width 70 x Position Position 0 71 y Position Position 0 72 73 + To use the toggle as a radio toggle button, set this resource to point to 74 any other widget in the radio group. 75 76 ++ This is the data returned from a call to XtToggleGetCurrent, by default 77 this is set to the name of toggle widget. 78 79 */ 80 81 /* 82 * These should be in StringDefs.h but aren't so we will define 83 * them here if they are needed 84 */ 85 #define XtCWidget "Widget" 86 #define XtCState "State" 87 #define XtCRadioGroup "RadioGroup" 88 #define XtCRadioData "RadioData" 89 90 #ifndef _XtStringDefs_h_ 91 #define XtRWidget "Widget" 92 #endif 93 94 #define XtNstate "state" 95 #define XtNradioGroup "radioGroup" 96 #define XtNradioData "radioData" 97 98 extern WidgetClass toggleWidgetClass; 99 100 typedef struct _ToggleClassRec *ToggleWidgetClass; 101 typedef struct _ToggleRec *ToggleWidget; 102 103 /* 104 * Public Functions 105 */ 106 107 _XFUNCPROTOBEGIN 108 109 /* 110 * Function: 111 * XawToggleChangeRadioGroup 112 * 113 * Parameters: 114 * w - toggle widget to change lists 115 * radio_group - any widget in the new list 116 * 117 * Description: 118 * Allows a toggle widget to change radio lists. 119 */ 120 void XawToggleChangeRadioGroup 121 ( 122 Widget w, 123 Widget radio_group 124 ); 125 126 /* 127 * Function: 128 * XawToggleGetCurrent 129 * 130 * Parameters: 131 * radio_group - any toggle widget in the toggle list 132 * 133 * Description: 134 * Returns the RadioData associated with the toggle 135 * widget that is currently active in a toggle list. 136 * Returns: 137 * The XtNradioData associated with the toggle widget 138 */ 139 140 XtPointer XawToggleGetCurrent 141 ( 142 Widget radio_group 143 ); 144 145 /* 146 * Function: 147 * XawToggleSetCurrent 148 * 149 * Parameters: 150 * radio_group - any toggle widget in the toggle list 151 * radio_data - radio data of the toggle widget to set 152 * 153 * Description: 154 * Sets the Toggle widget associated with the radio_data specified. 155 */ 156 void XawToggleSetCurrent 157 ( 158 Widget radio_group, 159 XtPointer radio_data 160 ); 161 162 /* 163 * Function: 164 * XawToggleUnsetCurrent 165 * 166 * Parameters: 167 * radio_group - any toggle widget in the toggle list 168 * 169 * Description: 170 * Unsets all Toggles in the radio_group specified. 171 */ 172 void XawToggleUnsetCurrent 173 ( 174 Widget radio_group 175 ); 176 177 _XFUNCPROTOEND 178 179 #endif /* _XawToggle_h */ 180