MacrosP.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. /* $XConsortium: MacrosP.h /main/5 1996/03/27 20:16:40 drk $
  24. *
  25. * (c) Copyright 1996 Digital Equipment Corporation.
  26. * (c) Copyright 1990,1996 Hewlett-Packard Company.
  27. * (c) Copyright 1996 International Business Machines Corp.
  28. * (c) Copyright 1996 Sun Microsystems, Inc.
  29. * (c) Copyright 1996 Novell, Inc.
  30. * (c) Copyright 1996 FUJITSU LIMITED.
  31. * (c) Copyright 1996 Hitachi.
  32. */
  33. /**---------------------------------------------------------------------
  34. ***
  35. *** file: MacrosP.h
  36. ***
  37. *** project: MotifPlus Widgets
  38. ***
  39. *** description: Private include file with macros for MotifPlus
  40. *** widgets and gadgets.
  41. ***
  42. ***-------------------------------------------------------------------*/
  43. #ifndef _DtMacrosP_h
  44. #define _DtMacrosP_h
  45. #define XmUNSPECIFIED_STRING (XmString) 3
  46. /*-------------------------------------------------------------
  47. ** Widget Class Macros
  48. */
  49. /* Core Class Macros
  50. */
  51. /*** WARNING: These macros are not thread-safe! ***/
  52. #define C_WidgetClass(wc) (wc -> core_class.widget_class)
  53. #define C_Superclass(wc) (wc -> core_class.superclass)
  54. #define C_ClassName(wc) (wc -> core_class.class_name)
  55. #define C_ClassInited(wc) (wc -> core_class.class_inited)
  56. #define C_NumResources(wc) (wc -> core_class.num_resources)
  57. /* Composite Class Macros
  58. */
  59. #ifdef _XtCompositeP_h
  60. #define C_ChangeManaged(wc) (wc -> composite_class.change_managed)
  61. #endif /* _XtCompositeP_h */
  62. /* Constraint Class Macros
  63. */
  64. #ifdef _XtConstraintP_h
  65. #define C_ConstraintResources(wc) (wc -> constraint_class.resources)
  66. #define C_ConstraintNumResources(wc) (wc -> constraint_class.num_resources)
  67. #endif /* _XtConstraintP_h */
  68. /* XmGadget Class Macros
  69. */
  70. #define XmInheritBorderHighlight ((XtWidgetProc) _XtInherit)
  71. #define XmInheritBorderUnhighlight ((XtWidgetProc) _XtInherit)
  72. #define XmInheritVisualChange ((XmVisualChangeProc) _XtInherit)
  73. /*-------------------------------------------------------------
  74. ** Primitive Macros
  75. */
  76. #define P_X(w) (w -> core.x)
  77. #define P_Y(w) (w -> core.y)
  78. #define P_Width(w) (w -> core.width)
  79. #define P_Height(w) (w -> core.height)
  80. #define P_BorderWidth(w) (w -> core.border_width)
  81. #define P_XrmName(w) (w -> core.xrm_name)
  82. #define P_PopupList(w) (w -> core.popup_list)
  83. #define P_NumPopups(w) (w -> core.num_popups)
  84. /*-------------------------------------------------------------
  85. ** Gadget Macros
  86. */
  87. /* Object Macros
  88. */
  89. #define G_XrmName(r) (r -> object.xrm_name)
  90. #define G_Class(r) (r -> object.widget_class)
  91. /* RectObject Macros
  92. */
  93. #define G_X(r) (r -> rectangle.x)
  94. #define G_Y(r) (r -> rectangle.y)
  95. #define G_Width(r) (r -> rectangle.width)
  96. #define G_Height(r) (r -> rectangle.height)
  97. #define G_BorderWidth(r) (r -> rectangle.border_width)
  98. /* XmGadget Macros
  99. */
  100. #define G_HelpCB(g) (g -> gadget.help_callback)
  101. #define G_EventMask(g) (g -> gadget.event_mask)
  102. #define G_Highlighted(g) (g -> gadget.highlighted)
  103. #define G_UnitType(g) (g -> gadget.unit_type)
  104. /*-------------------------------------------------------------
  105. ** Manager Macros
  106. */
  107. /* Core Macros
  108. */
  109. #define M_X(w) (w -> core.x)
  110. #define M_Y(w) (w -> core.y)
  111. #define M_Width(w) (w -> core.width)
  112. #define M_Height(w) (w -> core.height)
  113. #define M_BorderWidth(w) (w -> core.border_width)
  114. #define M_Background(w) (w -> core.background_pixel)
  115. #define M_Sensitive(w) (w->core.sensitive && w->core.ancestor_sensitive)
  116. #define M_Name(w) (w -> core.name)
  117. #define M_Accelerators(w) (w -> core.accelerators)
  118. #define M_TmTranslations(w) (w -> core.tm.translations)
  119. #define M_PopupList(w) (w -> core.popup_list)
  120. #define M_NumPopups(w) (w -> core.num_popups)
  121. /* Composite and Constraint Macros
  122. */
  123. #define M_Children(m) (m -> composite.children)
  124. #define M_NumChildren(m) (m -> composite.num_children)
  125. /* XmManager Macros
  126. */
  127. #ifdef _XmManagerP_h
  128. #define M_Foreground(m) (m -> manager.foreground)
  129. #define M_HighlightThickness(m) (m -> manager.highlight_thickness)
  130. #define M_ShadowThickness(m) (m -> manager.shadow_thickness)
  131. #define M_TopShadowGC(m) (m -> manager.top_shadow_GC)
  132. #define M_BottomShadowGC(m) (m -> manager.bottom_shadow_GC)
  133. #define M_BackgroundGC(m) (m -> manager.background_GC)
  134. #define M_SelectedGadget(m) (m -> manager.selected_gadget)
  135. #define M_HelpCB(m) (m -> manager.help_callback)
  136. #define M_UnitType(m) (m -> manager.unit_type)
  137. #endif /* _XmManagerP_h */
  138. /* XmDrawingArea Macros
  139. */
  140. #ifdef _XmDrawingAreaP_h
  141. #define M_MarginWidth(m) (m -> drawing_area.margin_width)
  142. #define M_MarginHeight(m) (m -> drawing_area.margin_height)
  143. #endif /* _XmDrawingAreaP_h */
  144. /* XmBulletinBoard Macros
  145. */
  146. #ifdef _XmBulletinBoardP_h
  147. #define M_ButtonFontList(m) (m -> bulletin_board.button_font_list)
  148. #define M_LabelFontList(m) (m -> bulletin_board.label_font_list)
  149. #define M_TextFontList(m) (m -> bulletin_board.text_font_list)
  150. #define M_MarginWidth(m) (m -> bulletin_board.margin_width)
  151. #define M_MarginHeight(m) (m -> bulletin_board.margin_height)
  152. #endif /* _XmBulletinBoardP_h */
  153. #ifdef MAYBE
  154. /* DtIconBox Macros
  155. */
  156. #ifdef _DtIconBoxP_h
  157. #define M_Timer(m) (m -> icon_box.timer)
  158. #define M_ShellX(m) (m -> icon_box.shell_x)
  159. #define M_ShellY(m) (m -> icon_box.shell_y)
  160. #define M_DragShell(m) (m -> icon_box.drag_shell)
  161. #define M_DragWidget(m) (m -> icon_box.drag_widget)
  162. #define M_DragIcon(m) (m -> icon_box.drag_icon)
  163. #define M_XCursor(m) (m -> icon_box.x_cursor)
  164. #define M_CrossCursor(m) (m -> icon_box.cross_cursor)
  165. #endif /* _DtIconBoxP_h */
  166. #endif /* MAYBE */
  167. #endif /* _DtMacrosP_h */
  168. /* DON'T ADD ANYTHING AFTER THIS #endif */