00001 /* 00002 * $XConsortium: Toggle.h,v 1.16 94/04/17 20:13:19 kaleb Exp $ 00003 * 00004 Copyright (c) 1989, 1994 X Consortium 00005 00006 Permission is hereby granted, free of charge, to any person obtaining a copy 00007 of this software and associated documentation files (the "Software"), to deal 00008 in the Software without restriction, including without limitation the rights 00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00010 copies of the Software, and to permit persons to whom the Software is 00011 furnished to do so, subject to the following conditions: 00012 00013 The above copyright notice and this permission notice shall be included in 00014 all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00019 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00022 00023 Except as contained in this notice, the name of the X Consortium shall not be 00024 used in advertising or otherwise to promote the sale, use or other dealings 00025 in this Software without prior written authorization from the X Consortium. 00026 */ 00027 00028 /* 00029 * ToggleP.h - Private definitions for Toggle widget 00030 * 00031 * Author: Chris D. Peterson 00032 * MIT X Consortium 00033 * kit@expo.lcs.mit.edu 00034 * 00035 * Date: January 12, 1989 00036 */ 00037 00038 #ifndef _XawToggle_h 00039 #define _XawToggle_h 00040 00041 /*********************************************************************** 00042 * 00043 * Toggle Widget 00044 * 00045 ***********************************************************************/ 00046 00047 #include <X11/Xaw3d/Command.h> 00048 00049 /* Resources: 00050 00051 Name Class RepType Default Value 00052 ---- ----- ------- ------------- 00053 radioGroup RadioGroup Widget NULL + 00054 radioData RadioData Pointer (XPointer) Widget ++ 00055 state State Boolean Off 00056 00057 background Background Pixel XtDefaultBackground 00058 bitmap Pixmap Pixmap None 00059 border BorderColor Pixel XtDefaultForeground 00060 borderWidth BorderWidth Dimension 1 00061 callback Callback Pointer NULL 00062 cursor Cursor Cursor None 00063 destroyCallback Callback Pointer NULL 00064 font Font XFontStructx* XtDefaultFont 00065 foreground Foreground Pixel XtDefaultForeground 00066 height Height Dimension text height 00067 highlightThickness Thickness Dimension 2 00068 insensitiveBorder Insensitive Pixmap Gray 00069 internalHeight Height Dimension 2 00070 internalWidth Width Dimension 4 00071 justify Justify XtJustify XtJustifyCenter 00072 label Label String NULL 00073 mappedWhenManaged MappedWhenManaged Boolean True 00074 resize Resize Boolean True 00075 sensitive Sensitive Boolean True 00076 width Width Dimension text width 00077 x Position Position 0 00078 y Position Position 0 00079 00080 + To use the toggle as a radio toggle button, set this resource to point to 00081 any other widget in the radio group. 00082 00083 ++ This is the data returned from a call to XtToggleGetCurrent, by default 00084 this is set to the name of toggle widget. 00085 00086 */ 00087 00088 /* 00089 * These should be in StringDefs.h but aren't so we will define 00090 * them here if they are needed. 00091 */ 00092 00093 00094 #define XtCWidget "Widget" 00095 #define XtCState "State" 00096 #define XtCRadioGroup "RadioGroup" 00097 #define XtCRadioData "RadioData" 00098 00099 #ifndef _XtStringDefs_h_ 00100 #define XtRWidget "Widget" 00101 #endif 00102 00103 #define XtNstate "state" 00104 #define XtNradioGroup "radioGroup" 00105 #define XtNradioData "radioData" 00106 00107 extern WidgetClass toggleWidgetClass; 00108 00109 typedef struct _ToggleClassRec *ToggleWidgetClass; 00110 typedef struct _ToggleRec *ToggleWidget; 00111 00112 00113 /************************************************************ 00114 * 00115 * Public Functions 00116 * 00117 ************************************************************/ 00118 00119 _XFUNCPROTOBEGIN 00120 00121 /* Function Name: XawToggleChangeRadioGroup 00122 * Description: Allows a toggle widget to change radio lists. 00123 * Arguments: w - The toggle widget to change lists. 00124 * radio_group - any widget in the new list. 00125 * Returns: none. 00126 */ 00127 00128 extern void XawToggleChangeRadioGroup( 00129 #if NeedFunctionPrototypes 00130 Widget /* w */, 00131 Widget /* radio_group */ 00132 #endif 00133 ); 00134 00135 /* Function Name: XawToggleGetCurrent 00136 * Description: Returns the RadioData associated with the toggle 00137 * widget that is currently active in a toggle list. 00138 * Arguments: radio_group - any toggle widget in the toggle list. 00139 * Returns: The XtNradioData associated with the toggle widget. 00140 */ 00141 00142 extern XtPointer XawToggleGetCurrent( 00143 #if NeedFunctionPrototypes 00144 Widget /* radio_group */ 00145 #endif 00146 ); 00147 00148 /* Function Name: XawToggleSetCurrent 00149 * Description: Sets the Toggle widget associated with the 00150 * radio_data specified. 00151 * Arguments: radio_group - any toggle widget in the toggle list. 00152 * radio_data - radio data of the toggle widget to set. 00153 * Returns: none. 00154 */ 00155 00156 extern void XawToggleSetCurrent( 00157 #if NeedFunctionPrototypes 00158 Widget /* radio_group */, 00159 XtPointer /* radio_data */ 00160 #endif 00161 ); 00162 00163 /* Function Name: XawToggleUnsetCurrent 00164 * Description: Unsets all Toggles in the radio_group specified. 00165 * Arguments: radio_group - any toggle widget in the toggle list. 00166 * Returns: none. 00167 */ 00168 00169 extern void XawToggleUnsetCurrent( 00170 #if NeedFunctionPrototypes 00171 Widget /* radio_group */ 00172 #endif 00173 ); 00174 00175 _XFUNCPROTOEND 00176 00177 #endif /* _XawToggle_h */
1.5.1