WArgList.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. * $TOG: WArgList.h /main/4 1998/04/17 11:45:37 mgreess $
  25. *
  26. * Copyright (c) 1991 HaL Computer Systems, Inc. All rights reserved.
  27. * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
  28. * States. Use of a copyright notice is precautionary only and does not
  29. * imply publication or disclosure.
  30. *
  31. * This software contains confidential information and trade secrets of HaL
  32. * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
  33. * without the prior express written permission of HaL Computer Systems, Inc.
  34. *
  35. * RESTRICTED RIGHTS LEGEND
  36. * Use, duplication, or disclosure by the Government is subject to
  37. * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
  38. * Technical Data and Computer Software clause at DFARS 252.227-7013.
  39. * HaL Computer Systems, Inc.
  40. * 1315 Dell Avenue, Campbell, CA 95008
  41. *
  42. */
  43. #ifndef WArgList_h
  44. #define WArgList_h
  45. // Allow setting of resources by name in arg list
  46. #define CASTRNAM (char*)
  47. #define CASTVAL (void*)(size_t)
  48. #define RSRC_SET(RSC,TYP,RNAM) \
  49. inline WArgList& RSC(TYP val) { return Add(CASTRNAM RNAM, CASTVAL val); }
  50. // Use this one to comment out call
  51. #define DONT_SET(RSC,TYP,RNAM)
  52. class WArgList {
  53. protected :
  54. ArgList args;
  55. Cardinal num_args;
  56. Cardinal alloc_args;
  57. Arg& Grow(Cardinal n);
  58. public :
  59. WArgList(String name, XtArgVal value, ...);
  60. inline WArgList() {
  61. args = NULL;
  62. num_args =
  63. alloc_args = 0;
  64. }
  65. inline WArgList(Cardinal len) {
  66. args = new Arg[len];
  67. num_args = 0;
  68. alloc_args = len;
  69. }
  70. inline WArgList(ArgList a, Cardinal n) {
  71. args = a;
  72. num_args = n;
  73. alloc_args = 0;
  74. }
  75. inline ~WArgList() {
  76. if ( alloc_args ) {
  77. delete [] args;
  78. }
  79. }
  80. WArgList(const WArgList &r);
  81. inline ArgList Args() const { return args; }
  82. inline Cardinal NumArgs() const { return num_args; }
  83. inline void Reset() { num_args = 0; }
  84. inline Arg& operator[] (Cardinal n);
  85. WArgList& Add(String name, XtArgVal value);
  86. inline WArgList& Add(String name, void* value) {
  87. return Add(name, (XtArgVal)value);
  88. }
  89. #ifdef XmString_h
  90. inline WArgList& Add(String name, const WXmString& value) {
  91. return Add(name, (XmString)value);
  92. }
  93. #endif
  94. friend class WObject;
  95. friend class CConstraint;
  96. // The following methods allow setting of resources by name in arg list
  97. RSRC_SET(Accelerator, char*, "accelerator")
  98. RSRC_SET(AcceleratorText, XmString, "acceleratorText")
  99. RSRC_SET(Accelerators, XtTranslations, "accelerators")
  100. RSRC_SET(AdjustLast, Boolean, "adjustLast")
  101. RSRC_SET(AdjustMargin, Boolean, "adjustMargin")
  102. RSRC_SET(Alignment, unsigned char, "alignment")
  103. RSRC_SET(AllowOverlap, Boolean, "allowOverlap")
  104. RSRC_SET(AllowResize, Boolean, "allowResize")
  105. RSRC_SET(AllowShellResize, Boolean, "allowShellResize")
  106. RSRC_SET(AncestorSensitive, Boolean, "ancestorSensitive")
  107. RSRC_SET(ApplyLabelString, XmString, "applyLabelString")
  108. RSRC_SET(Argc, int, "argc")
  109. RSRC_SET(Argv, void*, "argv")
  110. RSRC_SET(ArmColor, Pixel, "armColor")
  111. RSRC_SET(ArmPixmap, Pixmap, "armPixmap")
  112. RSRC_SET(ArrowDirection, unsigned char, "arrowDirection")
  113. RSRC_SET(AutoShowCursorPosition, Boolean, "autoShowCursorPosition")
  114. RSRC_SET(AutoUnmanage, Boolean, "autoUnmanage")
  115. RSRC_SET(AutomaticSelection, Boolean, "automaticSelection")
  116. RSRC_SET(Background, Pixel, "background")
  117. RSRC_SET(BackgroundPixmap, Pixmap, "backgroundPixmap")
  118. RSRC_SET(BlinkRate, int, "blinkRate")
  119. RSRC_SET(BorderColor, Pixel, "borderColor")
  120. RSRC_SET(BorderPixmap, Pixmap, "borderPixmap")
  121. RSRC_SET(BorderWidth, Dimension, "borderWidth")
  122. RSRC_SET(BottomAttachment, unsigned char, "bottomAttachment")
  123. RSRC_SET(BottomOffset, int, "bottomOffset")
  124. RSRC_SET(BottomPosition, int, "bottomPosition")
  125. RSRC_SET(BottomShadowColor, Pixel, "bottomShadowColor")
  126. RSRC_SET(BottomShadowPixmap, Pixmap, "bottomShadowPixmap")
  127. RSRC_SET(BottomWidget, Widget, "bottomWidget")
  128. RSRC_SET(ButtonFontList, XmFontList, "buttonFontList")
  129. RSRC_SET(CancelButton, Widget, "cancelButton")
  130. RSRC_SET(CancelLabelString, XmString, "cancelLabelString")
  131. RSRC_SET(CascadePixmap, Pixmap, "cascadePixmap")
  132. RSRC_SET(ClipWindow, Widget, "clipWindow")
  133. RSRC_SET(Colormap, void*, "colormap")
  134. RSRC_SET(Columns, short, "columns")
  135. RSRC_SET(Command, XmString, "command")
  136. RSRC_SET(CommandWindow, Widget, "commandWindow")
  137. DONT_SET(CreatePopupChildProc, XtProc, "createPopupChildProc")
  138. RSRC_SET(CursorPosition, XmTextPosition, "cursorPosition")
  139. RSRC_SET(CursorPositionVisible, Boolean, "cursorPositionVisible")
  140. RSRC_SET(DecimalPoints, short, "decimalPoints")
  141. RSRC_SET(DefaultButton, Widget, "defaultButton")
  142. RSRC_SET(DefaultButtonType, unsigned char, "defaultButtonType")
  143. RSRC_SET(DefaultPosition, Boolean, "defaultPosition")
  144. RSRC_SET(DeleteResponse, unsigned char, "deleteResponse")
  145. RSRC_SET(Depth, int, "depth")
  146. RSRC_SET(DialogStyle, unsigned char, "dialogStyle")
  147. RSRC_SET(DialogTitle, XmString, "dialogTitle")
  148. RSRC_SET(DialogType, unsigned char, "dialogType")
  149. RSRC_SET(DirMask, XmString, "dirMask")
  150. RSRC_SET(DirSpec, XmString, "dirSpec")
  151. RSRC_SET(DoubleClickInterval, int, "doubleClickInterval")
  152. RSRC_SET(EditMode, unsigned char, "editMode")
  153. RSRC_SET(Editable, Boolean, "editable")
  154. RSRC_SET(EntryAlignment, unsigned char, "entryAlignment")
  155. RSRC_SET(EntryBorder, Dimension, "entryBorder")
  156. RSRC_SET(EntryClass, int, "entryClass")
  157. DONT_SET(FileSearchProc, XtProc, "fileSearchProc")
  158. RSRC_SET(FillOnArm, Boolean, "fillOnArm")
  159. RSRC_SET(FillOnSelect, Boolean, "fillOnSelect")
  160. RSRC_SET(FilterLabelString, XmString, "filterLabelString")
  161. RSRC_SET(FontList, XmFontList, "fontList")
  162. RSRC_SET(Foreground, Pixel, "foreground")
  163. RSRC_SET(FractionBase, int, "fractionBase")
  164. RSRC_SET(Geometry, char*, "geometry")
  165. RSRC_SET(Height, Dimension, "height")
  166. RSRC_SET(HeightInc, int, "heightInc")
  167. RSRC_SET(HelpLabelString, XmString, "helpLabelString")
  168. RSRC_SET(HighlightColor, Pixel, "highlightColor")
  169. RSRC_SET(HighlightOnEnter, Boolean, "highlightOnEnter")
  170. RSRC_SET(HighlightPixmap, Pixmap, "highlightPixmap")
  171. RSRC_SET(HighlightThickness, short, "highlightThickness")
  172. RSRC_SET(HistoryItemCount, int, "historyItemCount")
  173. RSRC_SET(HistoryItems, XmStringTable, "historyItems")
  174. RSRC_SET(HistoryMaxItems, int, "historyMaxItems")
  175. RSRC_SET(HistoryVisibleItemCount, int, "historyVisibleItemCount")
  176. RSRC_SET(HorizontalScrollBar, Widget, "horizontalScrollBar")
  177. RSRC_SET(HorizontalSpacing, int, "horizontalSpacing")
  178. RSRC_SET(IconMask, Pixmap, "iconMask")
  179. RSRC_SET(IconName, char*, "iconName")
  180. RSRC_SET(IconPixmap, Pixmap, "iconPixmap")
  181. RSRC_SET(IconWindow, Widget, "iconWindow")
  182. RSRC_SET(IconX, int, "iconX")
  183. RSRC_SET(IconY, int, "iconY")
  184. RSRC_SET(Iconic, Boolean, "iconic")
  185. RSRC_SET(Increment, int, "increment")
  186. RSRC_SET(IndicatorOn, Boolean, "indicatorOn")
  187. RSRC_SET(IndicatorSize, Dimension, "indicatorSize")
  188. RSRC_SET(IndicatorType, unsigned char, "indicatorType")
  189. RSRC_SET(InitialDelay, int, "initialDelay")
  190. RSRC_SET(InitialState, int, "initialState")
  191. RSRC_SET(Input, Boolean, "input")
  192. DONT_SET(InputCreate, XtProc, "inputCreate")
  193. RSRC_SET(InsertPosition, XtOrderProc, "insertPosition")
  194. RSRC_SET(IsAligned, Boolean, "isAligned")
  195. RSRC_SET(IsHomogeneous, Boolean, "isHomogeneous")
  196. RSRC_SET(ItemCount, int, "itemCount")
  197. RSRC_SET(Items, XmStringTable, "items")
  198. RSRC_SET(KeyboardFocusPolicy, unsigned char, "keyboardFocusPolicy")
  199. RSRC_SET(LabelFontList, XmFontList, "labelFontList")
  200. RSRC_SET(LabelInsensitivePixmap, Pixmap, "labelInsensitivePixmap")
  201. RSRC_SET(LabelPixmap, Pixmap, "labelPixmap")
  202. RSRC_SET(LabelString, XmString, "labelString")
  203. RSRC_SET(LabelType, unsigned char, "labelType")
  204. RSRC_SET(LeftAttachment, unsigned char, "leftAttachment")
  205. RSRC_SET(LeftOffset, int, "leftOffset")
  206. RSRC_SET(LeftPosition, int, "leftPosition")
  207. RSRC_SET(LeftWidget, Widget, "leftWidget")
  208. RSRC_SET(ListItemCount, int, "listItemCount")
  209. RSRC_SET(ListItems, XmStringTable, "listItems")
  210. RSRC_SET(ListLabelString, XmString, "listLabelString")
  211. RSRC_SET(ListMarginHeight, short, "listMarginHeight")
  212. RSRC_SET(ListMarginWidth, short, "listMarginWidth")
  213. RSRC_SET(ListSizePolicy, unsigned char, "listSizePolicy")
  214. RSRC_SET(ListSpacing, short, "listSpacing")
  215. RSRC_SET(ListUpdated, Boolean, "listUpdated")
  216. RSRC_SET(ListVisibleItemCount, int, "listVisibleItemCount")
  217. RSRC_SET(MainWindowMarginHeight, short, "mainWindowMarginHeight")
  218. RSRC_SET(MainWindowMarginWidth, short, "mainWindowMarginWidth")
  219. RSRC_SET(MappedWhenManaged, Boolean, "mappedWhenManaged")
  220. RSRC_SET(MappingDelay, int, "mappingDelay")
  221. RSRC_SET(Margin, short, "margin")
  222. RSRC_SET(MarginBottom, short, "marginBottom")
  223. RSRC_SET(MarginHeight, Dimension, "marginHeight")
  224. RSRC_SET(MarginLeft, short, "marginLeft")
  225. RSRC_SET(MarginRight, short, "marginRight")
  226. RSRC_SET(MarginTop, short, "marginTop")
  227. RSRC_SET(MarginWidth, Dimension, "marginWidth")
  228. RSRC_SET(MaxAspectX, int, "maxAspectX")
  229. RSRC_SET(MaxAspectY, int, "maxAspectY")
  230. RSRC_SET(MaxHeight, int, "maxHeight")
  231. RSRC_SET(MaxLength, int, "maxLength")
  232. RSRC_SET(MaxWidth, int, "maxWidth")
  233. RSRC_SET(Maximum, int, "maximum")
  234. RSRC_SET(MenuAccelerator, char*, "menuAccelerator")
  235. RSRC_SET(MenuBar, Widget, "menuBar")
  236. RSRC_SET(MenuHelpWidget, Widget, "menuHelpWidget")
  237. RSRC_SET(MenuHistory, Widget, "menuHistory")
  238. RSRC_SET(MessageAlignment, unsigned char, "messageAlignment")
  239. RSRC_SET(MessageString, XmString, "messageString")
  240. RSRC_SET(MessageWindow, Widget, "messageWindow")
  241. RSRC_SET(MinAspectX, int, "minAspectX")
  242. RSRC_SET(MinAspectY, int, "minAspectY")
  243. RSRC_SET(MinHeight, int, "minHeight")
  244. RSRC_SET(MinWidth, int, "minWidth")
  245. RSRC_SET(MinimizeButtons, Boolean, "minimizeButtons")
  246. RSRC_SET(Minimum, int, "minimum")
  247. RSRC_SET(Mnemonic, char, "mnemonic")
  248. RSRC_SET(MultiClick, unsigned char, "multiClick")
  249. RSRC_SET(MustMatch, Boolean, "mustMatch")
  250. RSRC_SET(MwmDecorations, int, "mwmDecorations")
  251. RSRC_SET(MwmFunctions, int, "mwmFunctions")
  252. RSRC_SET(MwmInputMode, int, "mwmInputMode")
  253. RSRC_SET(MwmMenu, char*, "mwmMenu")
  254. RSRC_SET(NavigationType, XmNavigationType, "navigationType")
  255. RSRC_SET(NoResize, Boolean, "noResize")
  256. RSRC_SET(NumColumns, short, "numColumns")
  257. RSRC_SET(OkLabelString, XmString, "okLabelString")
  258. RSRC_SET(Orientation, unsigned char, "orientation")
  259. DONT_SET(OutputCreate, XtProc, "outputCreate")
  260. RSRC_SET(OverrideRedirect, Boolean, "overrideRedirect")
  261. RSRC_SET(Packing, unsigned char, "packing")
  262. RSRC_SET(PageIncrement, int, "pageIncrement")
  263. RSRC_SET(PaneMaximum, Dimension, "paneMaximum")
  264. RSRC_SET(PaneMinimum, Dimension, "paneMinimum")
  265. RSRC_SET(Pattern, XmString, "pattern")
  266. RSRC_SET(PendingDelete, Boolean, "pendingDelete")
  267. RSRC_SET(PopupEnabled, Boolean, "popupEnabled")
  268. RSRC_SET(PositionIndex, short, "positionIndex")
  269. RSRC_SET(ProcessingDirection, unsigned char, "processingDirection")
  270. RSRC_SET(PromptString, XmString, "promptString")
  271. RSRC_SET(PushButtonEnabled, Boolean, "pushButtonEnabled")
  272. RSRC_SET(RadioAlwaysOne, Boolean, "radioAlwaysOne")
  273. RSRC_SET(RadioBehavior, Boolean, "radioBehavior")
  274. RSRC_SET(RecomputeSize, Boolean, "recomputeSize")
  275. RSRC_SET(RefigureMode, Boolean, "refigureMode")
  276. RSRC_SET(RepeatDelay, int, "repeatDelay")
  277. RSRC_SET(Resizable, Boolean, "resizable")
  278. RSRC_SET(ResizeHeight, Boolean, "resizeHeight")
  279. RSRC_SET(ResizePolicy, unsigned char, "resizePolicy")
  280. RSRC_SET(ResizeWidth, Boolean, "resizeWidth")
  281. RSRC_SET(RightAttachment, unsigned char, "rightAttachment")
  282. RSRC_SET(RightOffset, int, "rightOffset")
  283. RSRC_SET(RightPosition, int, "rightPosition")
  284. RSRC_SET(RightWidget, Widget, "rightWidget")
  285. RSRC_SET(RowColumnType, unsigned char, "rowColumnType")
  286. RSRC_SET(Rows, short, "rows")
  287. RSRC_SET(RubberPositioning, Boolean, "rubberPositioning")
  288. RSRC_SET(SashHeight, Dimension, "sashHeight")
  289. RSRC_SET(SashIndent, Position, "sashIndent")
  290. RSRC_SET(SashShadowThickness, int, "sashShadowThickness")
  291. RSRC_SET(SashWidth, Dimension, "sashWidth")
  292. RSRC_SET(SaveUnder, Boolean, "saveUnder")
  293. RSRC_SET(ScaleHeight, Dimension, "scaleHeight")
  294. RSRC_SET(ScaleWidth, Dimension, "scaleWidth")
  295. RSRC_SET(ScrollBarDisplayPolicy, unsigned char, "scrollBarDisplayPolicy")
  296. RSRC_SET(ScrollBarPlacement, unsigned char, "scrollBarPlacement")
  297. RSRC_SET(ScrollHorizontal, Boolean, "scrollHorizontal")
  298. RSRC_SET(ScrollLeftSide, Boolean, "scrollLeftSide")
  299. RSRC_SET(ScrollTopSide, Boolean, "scrollTopSide")
  300. RSRC_SET(ScrollVertical, Boolean, "scrollVertical")
  301. RSRC_SET(ScrolledWindowMarginHeight, short, "scrolledWindowMarginHeight")
  302. RSRC_SET(ScrolledWindowMarginWidth, short, "scrolledWindowMarginWidth")
  303. RSRC_SET(ScrollingPolicy, unsigned char, "scrollingPolicy")
  304. RSRC_SET(SelectColor, Pixel, "selectColor")
  305. RSRC_SET(SelectInsensitivePixmap, Pixmap, "selectInsensitivePixmap")
  306. RSRC_SET(SelectPixmap, Pixmap, "selectPixmap")
  307. RSRC_SET(SelectThreshold, int, "selectThreshold")
  308. RSRC_SET(SelectedItemCount, int, "selectedItemCount")
  309. RSRC_SET(SelectedItems, XmStringTable, "selectedItems")
  310. RSRC_SET(SelectionArray, XtPointer, "selectionArray")
  311. RSRC_SET(SelectionArrayCount, int, "selectionArrayCount")
  312. RSRC_SET(SelectionLabelString, XmString, "selectionLabelString")
  313. RSRC_SET(SelectionPolicy, unsigned char, "selectionPolicy")
  314. RSRC_SET(Sensitive, Boolean, "sensitive")
  315. RSRC_SET(SeparatorOn, Boolean, "separatorOn")
  316. RSRC_SET(SeparatorType, unsigned char, "separatorType")
  317. RSRC_SET(Set, Boolean, "set")
  318. RSRC_SET(ShadowThickness, short, "shadowThickness")
  319. RSRC_SET(ShadowType, unsigned char, "shadowType")
  320. RSRC_SET(ShellUnitType, unsigned char, "shellUnitType")
  321. RSRC_SET(ShowArrows, Boolean, "showArrows")
  322. RSRC_SET(ShowAsDefault, short, "showAsDefault")
  323. RSRC_SET(ShowSeparator, Boolean, "showSeparator")
  324. RSRC_SET(ShowValue, Boolean, "showValue")
  325. RSRC_SET(SkipAdjust, Boolean, "skipAdjust")
  326. RSRC_SET(SliderSize, int, "sliderSize")
  327. DONT_SET(Source, XmTextSource, "source")
  328. RSRC_SET(Spacing, Dimension, "spacing")
  329. RSRC_SET(StringDirection, unsigned char, "stringDirection")
  330. RSRC_SET(SubMenuId, Widget, "subMenuId")
  331. RSRC_SET(SymbolPixmap, Pixmap, "symbolPixmap")
  332. RSRC_SET(TextAccelerators, XtTranslations, "textAccelerators")
  333. RSRC_SET(TextColumns, short, "textColumns")
  334. RSRC_SET(TextFontList, XmFontList, "textFontList")
  335. RSRC_SET(TextString, XmString, "textString")
  336. RSRC_SET(TextTranslations, XtTranslations, "textTranslations")
  337. RSRC_SET(Title, char*, "title")
  338. RSRC_SET(TitleString, XmString, "titleString")
  339. RSRC_SET(TopAttachment, unsigned char, "topAttachment")
  340. RSRC_SET(TopCharacter, XmTextPosition, "topCharacter")
  341. RSRC_SET(TopItemPosition, int, "topItemPosition")
  342. RSRC_SET(TopOffset, int, "topOffset")
  343. RSRC_SET(TopPosition, int, "topPosition")
  344. RSRC_SET(TopShadowColor, Pixel, "topShadowColor")
  345. RSRC_SET(TopShadowPixmap, Pixmap, "topShadowPixmap")
  346. RSRC_SET(TopWidget, Widget, "topWidget")
  347. RSRC_SET(Transient, Boolean, "transient")
  348. RSRC_SET(Translations, XtTranslations, "translations")
  349. RSRC_SET(TraversalOn, Boolean, "traversalOn")
  350. RSRC_SET(UnitType, unsigned char, "unitType")
  351. RSRC_SET(UserData, void*, "userData")
  352. RSRC_SET(Value, char*, "value")
  353. RSRC_SET(Value, int, "value")
  354. RSRC_SET(VerifyBell, Boolean, "verifyBell")
  355. RSRC_SET(VerticalScrollBar, Widget, "verticalScrollBar")
  356. RSRC_SET(VerticalSpacing, int, "verticalSpacing")
  357. RSRC_SET(VisibleItemCount, int, "visibleItemCount")
  358. RSRC_SET(VisibleWhenOff, Boolean, "visibleWhenOff")
  359. RSRC_SET(VisualPolicy, unsigned char, "visualPolicy")
  360. RSRC_SET(Waitforwm, Boolean, "waitforwm")
  361. RSRC_SET(WhichButton, unsigned int, "whichButton")
  362. RSRC_SET(Width, Dimension, "width")
  363. RSRC_SET(WidthInc, int, "widthInc")
  364. RSRC_SET(WindowGroup, Widget, "windowGroup")
  365. RSRC_SET(WmTimeout, int, "wmTimeout")
  366. RSRC_SET(WordWrap, Boolean, "wordWrap")
  367. RSRC_SET(WorkWindow, Widget, "workWindow")
  368. RSRC_SET(X, Position, "x")
  369. RSRC_SET(Y, Position, "y")
  370. RSRC_SET(_Screen, void*, "screen")
  371. #if XmVersion >= 1002
  372. // Constraint Resources -- Valid only in a frame
  373. RSRC_SET(ChildType, unsigned char, "childType")
  374. RSRC_SET(ChildHorizontalAlignment, unsigned char, "childHorizontalAlignment")
  375. RSRC_SET(ChildHorizontalSpacing, Dimension, "childHorizontalSpacing")
  376. RSRC_SET(ChildVerticalAlignment, unsigned char, "childVerticalAlignment")
  377. #endif
  378. inline WArgList& LeftAttachment(unsigned char to_what, Widget w) {
  379. LeftAttachment(to_what);
  380. LeftWidget(w);
  381. return *this;
  382. }
  383. inline WArgList& LeftAttachment(unsigned char to_what, Widget w,int off) {
  384. LeftAttachment(to_what);
  385. LeftWidget(w);
  386. LeftOffset(off);
  387. return *this;
  388. }
  389. inline WArgList& LeftAttachment(unsigned char to_what, int posoff) {
  390. LeftAttachment(to_what);
  391. if( to_what == XmATTACH_POSITION ) LeftPosition(posoff);
  392. else LeftOffset(posoff);
  393. return *this;
  394. }
  395. inline WArgList& LeftAttachment(unsigned char to_what, int pos, int off) {
  396. LeftAttachment(to_what);
  397. LeftPosition(pos);
  398. LeftOffset(off);
  399. return *this;
  400. }
  401. inline WArgList& RightAttachment(unsigned char to_what, Widget w) {
  402. RightAttachment(to_what);
  403. RightWidget(w);
  404. return *this;
  405. }
  406. inline WArgList& RightAttachment(unsigned char to_what, Widget w,int off) {
  407. RightAttachment(to_what);
  408. RightWidget(w);
  409. RightOffset(off);
  410. return *this;
  411. }
  412. inline WArgList& RightAttachment(unsigned char to_what, int posoff) {
  413. RightAttachment(to_what);
  414. if( to_what == XmATTACH_POSITION ) RightPosition(posoff);
  415. else RightOffset(posoff);
  416. return *this;
  417. }
  418. inline WArgList& RightAttachment(unsigned char to_what, int pos, int off) {
  419. RightAttachment(to_what);
  420. RightPosition(pos);
  421. RightOffset(off);
  422. return *this;
  423. }
  424. inline WArgList& TopAttachment(unsigned char to_what, Widget w) {
  425. TopAttachment(to_what);
  426. TopWidget(w);
  427. return *this;
  428. }
  429. inline WArgList& TopAttachment(unsigned char to_what, Widget w,int off) {
  430. TopAttachment(to_what);
  431. TopWidget(w);
  432. TopOffset(off);
  433. return *this;
  434. }
  435. inline WArgList& TopAttachment(unsigned char to_what, int posoff) {
  436. TopAttachment(to_what);
  437. if( to_what == XmATTACH_POSITION ) TopPosition(posoff);
  438. else TopOffset(posoff);
  439. return *this;
  440. }
  441. inline WArgList& TopAttachment(unsigned char to_what, int pos, int off) {
  442. TopAttachment(to_what);
  443. TopPosition(pos);
  444. TopOffset(off);
  445. return *this;
  446. }
  447. inline WArgList& BottomAttachment(unsigned char to_what, Widget w) {
  448. BottomAttachment(to_what);
  449. BottomWidget(w);
  450. return *this;
  451. }
  452. inline WArgList& BottomAttachment(unsigned char to_what, Widget w,int off) {
  453. BottomAttachment(to_what);
  454. BottomWidget(w);
  455. BottomOffset(off);
  456. return *this;
  457. }
  458. inline WArgList& BottomAttachment(unsigned char to_what, int posoff) {
  459. BottomAttachment(to_what);
  460. if( to_what == XmATTACH_POSITION ) BottomPosition(posoff);
  461. else BottomOffset(posoff);
  462. return *this;
  463. }
  464. inline WArgList& BottomAttachment(unsigned char to_what, int pos, int off) {
  465. BottomAttachment(to_what);
  466. BottomPosition(pos);
  467. BottomOffset(off);
  468. return *this;
  469. }
  470. };
  471. inline Arg&
  472. WArgList::operator [] (Cardinal n)
  473. {
  474. if (n < num_args|| n < alloc_args) return args[n];
  475. else return Grow(n);
  476. }
  477. #endif // WArgList_h