1 /*************************************<+>************************************* 2 ***************************************************************************** 3 ** 4 ** File: Xw.h 5 ** 6 ** Project: X Widgets 7 ** 8 ** Description: This include file contains public defines and structures 9 ** needed by all XToolkit applications using the X Widget Set. 10 ** Included in the file are the definitions for all common 11 ** resource types, defines for resource or arg list values, 12 ** and the class and instance record definitions for all meta 13 ** classes. 14 ** 15 ***************************************************************************** 16 ** 17 ** Copyright (c) 1988 by Hewlett-Packard Company 18 ** Copyright (c) 1988 by the Massachusetts Institute of Technology 19 ** 20 ** Permission to use, copy, modify, and distribute this software 21 ** and its documentation for any purpose and without fee is hereby 22 ** granted, provided that the above copyright notice appear in all 23 ** copies and that both that copyright notice and this permission 24 ** notice appear in supporting documentation, and that the names of 25 ** Hewlett-Packard or M.I.T. not be used in advertising or publicity 26 ** pertaining to distribution of the software without specific, written 27 ** prior permission. 28 ** 29 ***************************************************************************** 30 *************************************<+>*************************************/ 31 32 33 #ifndef _XtXw_h 34 #define _XtXw_h 35 36 /************************************************************************ 37 * 38 * Good 'ole Max and Min from the defunct <X11/Misc.h> 39 * 40 ************************************************************************/ 41 #define Max(x, y) (((x) > (y)) ? (x) : (y)) 42 #define Min(x, y) (((x) > (y)) ? (y) : (x)) 43 44 /************************************************************************ 45 * 46 * Resource manager definitions 47 * 48 ************************************************************************/ 49 50 #define XtRLong "Long" 51 52 #define XtNtraversalOn "traversalOn" 53 #define XtCTraversalOn "TraversalOn" 54 55 #define XtNtraversalType "traversalType" 56 #define XtCTraversalType "TraversalType" 57 #define XtRTraversalType "TraversalType" 58 59 #define XtNhighlightStyle "highlightStyle" 60 #define XtCHighlightStyle "HighlightStyle" 61 #define XtNhighlightTile "highlightTile" 62 #define XtCHighlightTile "HighlightTile" 63 #define XtRHighlightStyle "HighlightStyle" 64 #define XtNhighlightThickness "highlightThickness" 65 #define XtCHighlightThickness "HighlightThickness" 66 #define XtNhighlightColor "highlightColor" 67 68 #define XtNbackgroundTile "backgroundTile" 69 #define XtCBackgroundTile "BackgroundTile" 70 71 #define XtNcursor "cursor" 72 73 #define XtNrecomputeSize "recomputeSize" 74 #define XtCRecomputeSize "RecomputeSize" 75 76 #define XtNlayout "layout" 77 #define XtCLayout "Layout" 78 #define XtRLayout "Layout" 79 80 #define XtRTileType "tileType" 81 82 /* #define XtRTranslationTable "TranslationTable" */ 83 #define XtNlabelLocation "labelLocation" 84 #define XtCLabelLocation "LabelLocation" 85 #define XtRLabelLocation "LabelLocation" 86 #define XtNsensitiveTile "sensitiveTile" 87 #define XtCSensitiveTile "SensitiveTile" 88 89 #define XtNcolumns "columns" 90 #define XtCColumns "Columns" 91 #define XtNmode "mode" 92 #define XtCMode "Mode" 93 #define XtRRCMode "Mode" 94 #define XtNset "set" 95 #define XtCSet "Set" 96 97 #define XtNselect "select" 98 #define XtNrelease "release" 99 #define XtNnextTop "nextTop" 100 101 #define XtNtitleShowing "titleShowing" 102 #define XtCTitleShowing "TitleShowing" 103 #define XtNmgrTitleOverride "mgrTitleOverride" 104 #define XtCTitleOverride "TitleOverride" 105 #define XtNtitleType "titleType" 106 #define XtCTitleType "TitleType" 107 #define XtRTitleType "TitleType" 108 #define XtNtitleString "titleString" 109 #define XtCTitleString "TitleString" 110 #define XtNtitleImage "titleImage" 111 #define XtCTitleImage "TitleImage" 112 #define XtNfontColor "fontColor" 113 #define XtNmnemonic "mnemonic" 114 #define XtCMnemonic "Mnemonic" 115 #define XtNunderlineTitle "underlineTitle" 116 #define XtCUnderlineTitle "UnderlineTitle" 117 #define XtNmgrUnderlineOverride "mgrUnderlineOverride" 118 #define XtCUnderlineOverride "UnderlineOverride" 119 #define XtNunderlinePosition "underlinePosition" 120 #define XtCUnderlinePosition "UnderlinePosition" 121 #define XtNattachTo "attachTo" 122 #define XtCAttachTo "AttachTo" 123 #define XtNkbdAccelerator "kbdAccelerator" 124 #define XtCKbdAccelerator "KbdAccelerator" 125 126 #define XtNassociateChildren "associateChildren" 127 #define XtCAssociateChildren "AssociateChildren" 128 #define XtNmenuPost "menuPost" 129 #define XtCMenuPost "MenuPost" 130 #define XtNmenuSelect "menuSelect" 131 #define XtCMenuSelect "MenuSelect" 132 #define XtNpostAccelerator "postAccelerator" 133 #define XtCPostAccelerator "PostAccelerator" 134 #define XtNmenuUnpost "menuUnpost" 135 #define XtCMenuUnpost "MenuUnpost" 136 #define XtNkbdSelect "kbdSelect" 137 #define XtCKbdSelect "KbdSelect" 138 139 140 /**************************************************************** 141 * 142 * TextEdit widget 143 * 144 ****************************************************************/ 145 146 #define XtNdisplayPosition "displayPosition" 147 /* #define XtNinsertPosition "insertPosition" */ 148 #define XtNleftMargin "leftMargin" 149 #define XtNrightMargin "rightMargin" 150 #define XtNtopMargin "topMargin" 151 #define XtNbottomMargin "bottomMargin" 152 /* #define XtNselectionArray "selectionArray" 153 #define XtNtextSource "textSource" 154 #define XtNselection "selection" */ 155 #define XtNmaximumSize "maximumSize" 156 #define XtCMaximumSize "MaximumSize" 157 158 /* #define XtNeditType "editType" 159 #define XtNfile "file" 160 #define XtNstring "string" 161 #define XtNlength "length" 162 #define XtNfont "font" */ 163 #define XtNdiskSrc "disksrc" 164 #define XtNstringSrc "stringsrc" 165 #define XtNexecute "execute" 166 167 #define XtNsourceType "sourceType" 168 #define XtCSourceType "SourceType" 169 #define XtRSourceType "SourceType" 170 171 #define XtNmotionVerification "motionVerification" 172 #define XtNmodifyVerification "modifyVerification" 173 #define XtNleaveVerification "leaveVerification" 174 175 #define XtNwrap "wrap" 176 #define XtCWrap "Wrap" 177 #define XtRWrap "Wrap" 178 179 #define XtNwrapForm "wrapForm" 180 #define XtCWrapForm "WrapForm" 181 #define XtRWrapForm XtCWrapForm 182 183 #define XtNwrapBreak "wrapBreak" 184 #define XtCWrapBreak "WrapBreak" 185 #define XtRWrapBreak XtCWrapBreak 186 187 #define XtNscroll "scroll" 188 #define XtCScroll "Scroll" 189 #define XtRScroll XtCScroll 190 191 #define XtNgrow "grow" 192 #define XtCGrow "Grow" 193 #define XtRGrow XtCGrow 194 195 #define XwAutoScrollOff 0 196 #define XwAutoScrollHorizontal 1 197 #define XwAutoScrollVertical 2 198 #define XwAutoScrollBoth 3 /* must be bitwise OR of horiz. and vert. */ 199 200 #define XwGrowOff 0 201 #define XwGrowHorizontal 1 202 #define XwGrowVertical 2 203 #define XwGrowBoth 3 /* must be bitwise OR of horiz. and vert. */ 204 205 /* Valid Label Location Settings for Button */ 206 207 #define XwRIGHT 0 208 #define XwLEFT 1 209 #define XwCENTER 2 210 211 /* Valid Title Type Values For MenuPane */ 212 213 #define XwSTRING 0 214 #define XwIMAGE 1 215 #define XwRECT 2 216 217 218 /* New resource manager types */ 219 220 #define XrmRImage "Image" 221 #define XtRImage XrmRImage 222 #define XtNalignment "alignment" 223 #define XtCAlignment "Alignment" 224 #define XtRAlignment "Alignment" 225 #define XtNlineSpace "lineSpace" 226 #define XtCLineSpace "LineSpace" 227 228 #define XtNgravity "gravity" 229 #define XtCGravity "Gravity" 230 #ifndef XtRGravity 231 #define XtRGravity "Gravity" 232 #endif 233 234 typedef enum { 235 XwALIGN_NONE, 236 XwALIGN_LEFT, 237 XwALIGN_CENTER, 238 XwALIGN_RIGHT 239 } XwAlignment; 240 241 typedef enum { 242 XwUNKNOWN, 243 XwPULLDOWN, 244 XwTITLE, 245 XwWORK_SPACE 246 } XwWidgetType; 247 248 /* Form resource definitions */ 249 250 #define XwHORIZONTAL 0 251 #define XwVERTICAL 1 252 253 #define XtNxRefName "xRefName" 254 #define XtCXRefName "XRefName" 255 #define XtNxRefWidget "xRefWidget" 256 #define XtCXRefWidget "XRefWidget" 257 #define XtNxOffset "xOffset" 258 #define XtCXOffset "XOffset" 259 #define XtNxAddWidth "xAddWidth" 260 #define XtCXAddWidth "XAddWidth" 261 #define XtNxVaryOffset "xVaryOffset" 262 #define XtCXVaryOffset "XVaryOffset" 263 #define XtNxResizable "xResizable" 264 #define XtCXResizable "XResizable" 265 #define XtNxAttachRight "xAttachRight" 266 #define XtCXAttachRight "XAttachRight" 267 #define XtNxAttachOffset "xAttachOffset" 268 #define XtCXAttachOffset "XAttachOffset" 269 270 #define XtNyRefName "yRefName" 271 #define XtCYRefName "YRefName" 272 #define XtNyRefWidget "yRefWidget" 273 #define XtCYRefWidget "YRefWidget" 274 #define XtNyOffset "yOffset" 275 #define XtCYOffset "YOffset" 276 #define XtNyAddHeight "yAddHeight" 277 #define XtCYAddHeight "YAddHeight" 278 #define XtNyVaryOffset "yVaryOffset" 279 #define XtCYVaryOffset "YVaryOffset" 280 #define XtNyResizable "yResizable" 281 #define XtCYResizable "YResizable" 282 #define XtNyAttachBottom "yAttachBottom" 283 #define XtCYAttachBottom "YAttachBottom" 284 #define XtNyAttachOffset "yAttachOffset" 285 #define XtCYAttachOffset "YAttachOffset" 286 287 /* MenuBtn esource manager definitions */ 288 289 #define XtNlabelType "labelType" 290 #define XtCLabelType "LabelType" 291 #define XtRLabelType "LabelType" 292 #define XtNlabelImage "labelImage" 293 #define XtCLabelImage "LabelImage" 294 #define XtNrectColor "rectColor" 295 #define XtCRectColor "RectColor" 296 #define XtNrectStipple "rectStipple" 297 #define XtCRectStipple "RectStipple" 298 #define XtNcascadeImage "cascadeImage" 299 #define XtCCascadeImage "CascadeImage" 300 #define XtNmarkImage "markImage" 301 #define XtCMarkImage "MarkImage" 302 #define XtNsetMark "setMark" 303 #define XtCSetMark "SetMark" 304 #define XtNnoPad "noPad" 305 #define XtCNoPad "NoPad" 306 #define XtNcascadeOn "cascadeOn" 307 #define XtCCascadeOn "CascadeOn" 308 #define XtNinvertOnEnter "invertOnEnter" 309 #define XtCInvertOnEnter "InvertOnEnter" 310 #define XtNmgrOverrideMnemonic "mgrOverrideMnemonic" 311 #define XtCMgrOverrideMnemonic "MgrOverrideMnemonic" 312 #define XtNcascadeSelect "cascadeSelect" 313 #define XtNcascadeUnselect "cascadeUnselect" 314 #define XtNmenuMgrId "menuMgrId" 315 #define XtCMenuMgrId "MenuMgrId" 316 #define XtNhint "hint" 317 #define XtCHint "Hint" 318 #define XtNhintProc "hintProc" 319 #define XtCHintProc "HintProc" 320 321 /* Resources for PushButton */ 322 323 #define XtNinvertOnSelect "invertOnSelect" 324 #define XtCInvertOnSelect "InvertOnSelect" 325 #define XtNtoggle "toggle" 326 #define XtCToggle "Toggle" 327 328 /* Resources for Toggle */ 329 330 #define XtNsquare "square" 331 #define XtCSquare "Square" 332 #define XtNselectColor "selectColor" 333 334 /* WorkSpace resources */ 335 336 #define XtNexpose "expose" 337 #ifndef XtNresize 338 #define XtNresize "resize" 339 #endif 340 #define XtNkeyDown "keyDown" 341 #define XtNkeyUp "keyUp" 342 343 344 /*********************************************************************** 345 * 346 * Cascading MenuPane Widget Resources 347 * 348 ***********************************************************************/ 349 350 #define XtRTitlePositionType "TitlePositionType" 351 #define XtNtitlePosition "titlePosition" 352 #define XtCTitlePosition "TitlePosition" 353 354 /*********************************************************************** 355 * 356 * Popup Menu Manager Widget Resources 357 * 358 ***********************************************************************/ 359 360 #define XtNstickyMenus "stickyMenus" 361 #define XtCStickyMenus "StickyMenus" 362 363 /*********************************************************************** 364 * 365 * Pulldown Menu Manager Widget Resources 366 * 367 ***********************************************************************/ 368 369 370 #define XtNallowCascades "allowCascades" 371 #define XtCAllowCascades "AllowCascades" 372 #define XtNpulldownBarId "pulldownBarId" 373 #define XtCPulldownBarId "PulldownBarId" 374 375 376 /*********************************************************************** 377 * 378 * Cascading MenuPane Widget Attribute Definitions 379 * 380 ***********************************************************************/ 381 382 #define XwTOP 0x01 383 #define XwBOTTOM 0x02 384 #define XwBOTH XwTOP|XwBOTTOM 385 386 /*********************************************************************** 387 * 388 * Static Text resource string definitions 389 * 390 ***********************************************************************/ 391 #define XtNstrip "strip" 392 #define XtCStrip "Strip" 393 394 /************************************************************************ 395 * 396 * Class record constants for Primitive Widget Meta Class 397 * 398 ************************************************************************/ 399 400 extern WidgetClass XwprimitiveWidgetClass; 401 402 typedef struct _XwPrimitiveClassRec * XwPrimitiveWidgetClass; 403 typedef struct _XwPrimitiveRec * XwPrimitiveWidget; 404 405 406 /* Tile types used for area filling and patterned text placement */ 407 408 #define XwFOREGROUND 0 409 #define XwBACKGROUND 1 410 411 /* Traversal type definitions */ 412 413 #define XwHIGHLIGHT_OFF 0 414 #define XwHIGHLIGHT_ENTER 1 415 #define XwHIGHLIGHT_TRAVERSAL 2 416 417 418 /* Border highlighting type defines */ 419 420 #define XwPATTERN_BORDER 1 421 #define XwWIDGET_DEFINED 2 422 423 424 /* Manager Layout Info */ 425 426 #define XwIGNORE 0 427 #define XwMINIMIZE 1 428 #define XwMAXIMIZE 2 429 #define XwSWINDOW 3 /* Special Setting for Scrolled Window */ 430 431 #define XtNwidgetType "widgetType" 432 #define XtCWidgetType "WidgetType" 433 #define XtRWidgetType "WidgetType" 434 435 /************************************************************************ 436 * 437 * Class record constants for Meta Class Widgets 438 * 439 ************************************************************************/ 440 441 extern WidgetClass XwmanagerWidgetClass; 442 443 typedef struct _XwManagerClassRec * XwManagerWidgetClass; 444 typedef struct _XwManagerRec * XwManagerWidget; 445 446 447 448 extern WidgetClass XwbuttonWidgetClass; 449 450 typedef struct _XwButtonClassRec * XwButtonWidgetClass; 451 typedef struct _XwButtonRec * XwButtonWidget; 452 453 454 extern WidgetClass XwmenupaneWidgetClass; 455 456 typedef struct _XwMenuPaneClassRec *XwMenuPaneWidgetClass; 457 typedef struct _XwMenuPaneRec *XwMenuPaneWidget; 458 459 460 extern WidgetClass XwmenumgrWidgetClass; 461 462 typedef struct _XwMenuMgrClassRec *XwMenuMgrWidgetClass; 463 typedef struct _XwMenuMgrRec *XwMenuMgrWidget; 464 465 466 467 #endif 468 /* DON'T ADD STUFF AFTER THIS #endif */ 469 470 471