home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / intrinsicp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  9.9 KB  |  363 lines

  1. /* $XConsortium: IntrinsicP.h,v 1.66 94/04/17 20:14:25 converse Exp $ */
  2.  
  3. /***********************************************************
  4.  
  5. Copyright (c) 1987, 1988, 1994  X Consortium
  6.  
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13.  
  14. The above copyright notice and this permission notice shall be included in
  15. all copies or substantial portions of the Software.
  16.  
  17. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  20. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  21. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23.  
  24. Except as contained in this notice, the name of the X Consortium shall not be
  25. used in advertising or otherwise to promote the sale, use or other dealings
  26. in this Software without prior written authorization from the X Consortium.
  27.  
  28.  
  29. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
  30.  
  31.                         All Rights Reserved
  32.  
  33. Permission to use, copy, modify, and distribute this software and its 
  34. documentation for any purpose and without fee is hereby granted, 
  35. provided that the above copyright notice appear in all copies and that
  36. both that copyright notice and this permission notice appear in 
  37. supporting documentation, and that the name of Digital not be
  38. used in advertising or publicity pertaining to distribution of the
  39. software without specific, written prior permission.  
  40.  
  41. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  42. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  43. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  44. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  45. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  46. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  47. SOFTWARE.
  48.  
  49. ******************************************************************/
  50.  
  51. #ifndef _XtintrinsicP_h
  52. #define _XtintrinsicP_h
  53.  
  54. #include <X11/Intrinsic.h>
  55.  
  56. /*
  57.  * Field sizes and offsets of XrmResource must match those of XtResource.
  58.  * Type long is used instead of XrmQuark here because XrmQuark and String
  59.  * are not the same size on all systems.
  60.  */
  61. typedef struct {
  62.     long    xrm_name;      /* Resource name quark        */
  63.     long    xrm_class;      /* Resource class quark        */
  64.     long    xrm_type;      /* Resource representation type quark */
  65.     Cardinal    xrm_size;      /* Size in bytes of representation    */
  66.     int        xrm_offset;      /* -offset-1                */
  67.     long    xrm_default_type; /* Default representation type quark    */
  68.     XtPointer    xrm_default_addr; /* Default resource address        */
  69. } XrmResource, *XrmResourceList;
  70.  
  71. typedef unsigned long XtVersionType;
  72.  
  73. #define XT_VERSION 11
  74. #ifndef XT_REVISION
  75. #define XT_REVISION 6
  76. #endif
  77. #define XtVersion (XT_VERSION * 1000 + XT_REVISION)
  78. #define XtVersionDontCheck 0
  79.  
  80. typedef void (*XtProc)(
  81. #if NeedFunctionPrototypes
  82.     void
  83. #endif
  84. );
  85.  
  86. typedef void (*XtWidgetClassProc)(
  87. #if NeedFunctionPrototypes
  88.     WidgetClass /* class */
  89. #endif
  90. );
  91.  
  92. typedef void (*XtWidgetProc)(
  93. #if NeedFunctionPrototypes
  94.     Widget    /* widget */
  95. #endif
  96. );
  97.  
  98. typedef Boolean (*XtAcceptFocusProc)(
  99. #if NeedFunctionPrototypes
  100.     Widget    /* widget */,
  101.     Time*    /* time */
  102. #endif
  103. );
  104.  
  105. typedef void (*XtArgsProc)(
  106. #if NeedFunctionPrototypes
  107.     Widget    /* widget */,
  108.     ArgList    /* args */,
  109.     Cardinal*    /* num_args */
  110. #endif
  111. );
  112.  
  113. typedef void (*XtInitProc)(
  114. #if NeedFunctionPrototypes
  115.     Widget    /* request */,
  116.     Widget    /* new */,
  117.     ArgList    /* args */,
  118.     Cardinal*    /* num_args */
  119. #endif
  120. );
  121.  
  122. typedef Boolean (*XtSetValuesFunc)(
  123. #if NeedFunctionPrototypes
  124.     Widget     /* old */,
  125.     Widget     /* request */,
  126.     Widget     /* new */,
  127.     ArgList     /* args */,
  128.     Cardinal*    /* num_args */
  129. #endif
  130. );
  131.  
  132. typedef Boolean (*XtArgsFunc)(
  133. #if NeedFunctionPrototypes
  134.     Widget    /* widget */,
  135.     ArgList    /* args */,
  136.     Cardinal*    /* num_args */
  137. #endif
  138. );
  139.  
  140. typedef void (*XtAlmostProc)(
  141. #if NeedFunctionPrototypes
  142.     Widget        /* old */,
  143.     Widget        /* new */,
  144.     XtWidgetGeometry*    /* request */,
  145.     XtWidgetGeometry*    /* reply */
  146. #endif
  147. );
  148.  
  149. typedef void (*XtExposeProc)(
  150. #if NeedFunctionPrototypes
  151.     Widget    /* widget */,
  152.     XEvent*    /* event */,
  153.     Region    /* region */
  154. #endif
  155. );
  156.  
  157. /* compress_exposure options*/
  158. #define XtExposeNoCompress        ((XtEnum)False)
  159. #define XtExposeCompressSeries        ((XtEnum)True)
  160. #define XtExposeCompressMultiple    2
  161. #define XtExposeCompressMaximal        3
  162.  
  163. /* modifiers */
  164. #define XtExposeGraphicsExpose          0x10
  165. #define XtExposeGraphicsExposeMerged    0x20
  166. #define XtExposeNoExpose          0x40
  167. #define XtExposeNoRegion        0x80
  168.  
  169. typedef void (*XtRealizeProc)(
  170. #if NeedFunctionPrototypes
  171.     Widget           /* widget */,
  172.     XtValueMask*       /* mask */,
  173.     XSetWindowAttributes* /* attributes */
  174. #endif
  175. );
  176.  
  177. typedef XtGeometryResult (*XtGeometryHandler)(
  178. #if NeedFunctionPrototypes
  179.     Widget        /* widget */,
  180.     XtWidgetGeometry*    /* request */,
  181.     XtWidgetGeometry*    /* reply */
  182. #endif
  183. );
  184.  
  185. typedef void (*XtStringProc)(
  186. #if NeedFunctionPrototypes
  187.     Widget    /* widget */,
  188.     String    /* str */
  189. #endif
  190. );
  191.  
  192. typedef struct {
  193.     String    name;    /* resource name */
  194.     String    type;    /* representation type name */
  195.     XtArgVal    value;    /* representation */
  196.     int        size;    /* size of representation */
  197. } XtTypedArg, *XtTypedArgList;
  198.  
  199. typedef void (*XtAllocateProc)(
  200. #if NeedFunctionPrototypes
  201.     WidgetClass        /* widget_class */,
  202.     Cardinal *        /* constraint_size */,
  203.     Cardinal *        /* more_bytes */,
  204.     ArgList        /* args */,
  205.     Cardinal *        /* num_args */,
  206.     XtTypedArgList    /* typed_args */,
  207.     Cardinal *        /* num_typed_args */,
  208.     Widget *        /* widget_return */,
  209.     XtPointer *        /* more_bytes_return */
  210. #endif
  211. );
  212.  
  213. typedef void (*XtDeallocateProc)(
  214. #if NeedFunctionPrototypes
  215.     Widget        /* widget */,
  216.     XtPointer        /* more_bytes */
  217. #endif
  218. );
  219.  
  220. struct _XtStateRec;    /* Forward declare before use for C++ */
  221.  
  222. typedef struct _XtTMRec {
  223.     XtTranslations  translations;    /* private to Translation Manager    */
  224.     XtBoundActions  proc_table;        /* procedure bindings for actions    */
  225.     struct _XtStateRec *current_state;  /* Translation Manager state ptr     */
  226.     unsigned long   lastEventTime;
  227. } XtTMRec, *XtTM;
  228.  
  229. #include <X11/CoreP.h>
  230. #include <X11/CompositeP.h>
  231. #include <X11/ConstrainP.h>
  232. #include <X11/ObjectP.h>
  233. #include <X11/RectObjP.h>
  234.  
  235. #define XtDisplay(widget)    DisplayOfScreen((widget)->core.screen)
  236. #define XtScreen(widget)    ((widget)->core.screen)
  237. #define XtWindow(widget)    ((widget)->core.window)
  238.  
  239. #define XtClass(widget)        ((widget)->core.widget_class)
  240. #define XtSuperclass(widget)    (XtClass(widget)->core_class.superclass)
  241. #define XtIsRealized(object)    (XtWindowOfObject(object) != None)
  242. #define XtParent(widget)    ((widget)->core.parent)
  243.  
  244. #undef XtIsRectObj
  245. #define XtIsRectObj(obj) \
  246.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x02)
  247.  
  248. #undef XtIsWidget
  249. #define XtIsWidget(obj) \
  250.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x04)
  251.  
  252. #undef XtIsComposite
  253. #define XtIsComposite(obj) \
  254.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x08)
  255.  
  256. #undef XtIsConstraint
  257. #define XtIsConstraint(obj) \
  258.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x10)
  259.  
  260. #undef XtIsShell
  261. #define XtIsShell(obj) \
  262.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x20)
  263.  
  264. #undef XtIsWMShell
  265. #define XtIsWMShell(obj) \
  266.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x40)
  267.  
  268. #undef XtIsTopLevelShell
  269. #define XtIsTopLevelShell(obj) \
  270.     (((Object)(obj))->object.widget_class->core_class.class_inited & 0x80)
  271.  
  272. #ifdef DEBUG
  273. #define XtCheckSubclass(w, widget_class_ptr, message)    \
  274.     if (!XtIsSubclass(((Widget)(w)), (widget_class_ptr))) {    \
  275.         String params[3];                \
  276.         Cardinal num_params = 3;            \
  277.         params[0] = ((Widget)(w))->core.widget_class->core_class.class_name;\
  278.         params[1] = (widget_class_ptr)->core_class.class_name;         \
  279.         params[2] = (message);                         \
  280.         XtAppErrorMsg(XtWidgetToApplicationContext((Widget)(w)),         \
  281.             "subclassMismatch", "xtCheckSubclass", "XtToolkitError", \
  282.             "Widget class %s found when subclass of %s expected: %s",\
  283.             params, &num_params);        \
  284.     }
  285. #else
  286. #define XtCheckSubclass(w, widget_class, message)    /* nothing */
  287. #endif
  288.  
  289. _XFUNCPROTOBEGIN
  290.  
  291. extern Widget _XtWindowedAncestor( /* internal; implementation-dependent */
  292. #if NeedFunctionPrototypes
  293.     Widget         /* object */
  294. #endif
  295. );
  296.  
  297. extern void _XtInherit(
  298. #if NeedFunctionPrototypes
  299.     void
  300. #endif
  301. );
  302.  
  303. extern void XtCreateWindow(
  304. #if NeedFunctionPrototypes
  305.     Widget         /* widget */,
  306.     unsigned int     /* window_class */,
  307.     Visual*        /* visual */,
  308.     XtValueMask        /* value_mask */,
  309.     XSetWindowAttributes* /* attributes */
  310. #endif
  311. );
  312.  
  313. extern void XtResizeWidget(
  314. #if NeedFunctionPrototypes
  315.     Widget         /* widget */,
  316.     _XtDimension    /* width */,
  317.     _XtDimension    /* height */,
  318.     _XtDimension    /* border_width */
  319. #endif
  320. );
  321.  
  322. extern void XtMoveWidget(
  323. #if NeedFunctionPrototypes
  324.     Widget         /* widget */,
  325.     _XtPosition        /* x */,
  326.     _XtPosition        /* y */
  327. #endif
  328. );
  329.  
  330. extern void XtConfigureWidget(
  331. #if NeedFunctionPrototypes
  332.     Widget         /* widget */,
  333.     _XtPosition        /* x */,
  334.     _XtPosition        /* y */,
  335.     _XtDimension    /* width */,
  336.     _XtDimension    /* height */,
  337.     _XtDimension    /* border_width */
  338. #endif
  339. );
  340.  
  341. extern void XtResizeWindow(
  342. #if NeedFunctionPrototypes
  343.     Widget         /* widget */
  344. #endif
  345. );
  346.  
  347. extern void XtProcessLock(
  348. #if NeedFunctionPrototypes
  349.     void
  350. #endif
  351. );
  352.  
  353. extern void XtProcessUnlock(
  354. #if NeedFunctionPrototypes
  355.     void
  356. #endif
  357. );
  358.  
  359. _XFUNCPROTOEND
  360.  
  361. #endif /* _XtIntrinsicP_h */
  362. /* DON'T ADD STUFF AFTER THIS #endif */
  363.