home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / Xt / Functions.c.orig < prev    next >
Encoding:
Text File  |  1991-05-03  |  3.1 KB  |  155 lines

  1. /* $XConsortium: Functions.c,v 1.5 91/05/03 15:31:31 rws Exp $ */
  2.  
  3. /*
  4.  
  5. Copyright 1985, 1986, 1987, 1988, 1989 by the
  6. Massachusetts Institute of Technology
  7.  
  8. Permission to use, copy, modify, and distribute this
  9. software and its documentation for any purpose and without
  10. fee is hereby granted, provided that the above copyright
  11. notice appear in all copies and that both that copyright
  12. notice and this permission notice appear in supporting
  13. documentation, and that the name of M.I.T. not be used in
  14. advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.
  16. M.I.T. makes no representations about the suitability of
  17. this software for any purpose.  It is provided "as is"
  18. without express or implied warranty.
  19.  
  20. */
  21.  
  22. #include "IntrinsicI.h"
  23. #include <X11/Shell.h>
  24. #include <X11/Vendor.h>
  25.  
  26. /*
  27.  * This file defines functional equivalents to all macros defined
  28.  * in Intrinsic.h
  29.  *
  30.  */
  31.  
  32. #undef XtIsRectObj
  33. Boolean XtIsRectObj(object)
  34.     Widget object;
  35. {
  36.     return _XtCheckSubclassFlag(object, 0x02);
  37. }
  38.  
  39.  
  40. #undef XtIsWidget
  41. Boolean XtIsWidget(object)
  42.     Widget object;
  43. {
  44.     return _XtCheckSubclassFlag(object, 0x04);
  45. }
  46.  
  47.  
  48. #undef XtIsComposite
  49. Boolean XtIsComposite(object)
  50.     Widget object;
  51. {
  52.     return _XtCheckSubclassFlag(object, 0x08);
  53. }
  54.  
  55.  
  56. #undef XtIsConstraint
  57. Boolean XtIsConstraint(object)
  58.     Widget object;
  59. {
  60.     return _XtCheckSubclassFlag(object, 0x10);
  61. }
  62.  
  63.  
  64. #undef XtIsShell
  65. Boolean XtIsShell(object)
  66.     Widget object;
  67. {
  68.     return _XtCheckSubclassFlag(object, 0x20);
  69. }
  70.  
  71.  
  72. #undef XtIsOverrideShell
  73. Boolean XtIsOverrideShell(object)
  74.     Widget object;
  75. {
  76.     return _XtIsSubclassOf(object, (WidgetClass)overrideShellWidgetClass,
  77.                (WidgetClass)shellWidgetClass, 0x20);
  78. }
  79.  
  80.  
  81. #undef XtIsWMShell
  82. Boolean XtIsWMShell(object)
  83.     Widget object;
  84. {
  85.     return _XtCheckSubclassFlag(object, 0x40);
  86. }
  87.  
  88.  
  89. #undef XtIsVendorShell
  90. Boolean XtIsVendorShell(object)
  91.     Widget object;
  92. {
  93. #if defined(AIXSHLIB) && defined(SHAREDCODE)
  94.     return _XtIsSubclassOf(object,
  95.                transientShellWidgetClass->core_class.superclass,
  96.                (WidgetClass)wmShellWidgetClass, 0x40);
  97. #else
  98.     return _XtIsSubclassOf(object, (WidgetClass)vendorShellWidgetClass,
  99.                (WidgetClass)wmShellWidgetClass, 0x40);
  100. #endif
  101. }
  102.  
  103.  
  104. #undef XtIsTransientShell
  105. Boolean XtIsTransientShell(object)
  106.     Widget object;
  107. {
  108.     return _XtIsSubclassOf(object, (WidgetClass)transientShellWidgetClass,
  109.                (WidgetClass)wmShellWidgetClass, 0x40);
  110. }
  111.  
  112.  
  113. #undef XtIsTopLevelShell
  114. Boolean XtIsTopLevelShell(object)
  115.     Widget object;
  116. {
  117.     return _XtCheckSubclassFlag(object, 0x80);
  118. }
  119.  
  120.  
  121. #undef XtIsApplicationShell
  122. Boolean XtIsApplicationShell(object)
  123.     Widget object;
  124. {
  125.     return _XtIsSubclassOf(object, (WidgetClass)applicationShellWidgetClass,
  126.                (WidgetClass)topLevelShellWidgetClass, 0x80);
  127. }
  128.  
  129.  
  130. #undef XtMapWidget
  131. void XtMapWidget(w)
  132.     Widget w;
  133. {
  134.     XMapWindow(XtDisplay(w), XtWindow(w));
  135. }
  136.  
  137.  
  138. #undef XtUnmapWidget
  139. void XtUnmapWidget(w)
  140.     Widget w;
  141. {
  142.     XUnmapWindow(XtDisplay(w), XtWindow(w));
  143. }
  144.  
  145.  
  146. #undef XtNewString
  147. String XtNewString(str)
  148.     String str;
  149. {
  150.     if (str == NULL)
  151.     return NULL;
  152.     else
  153.     return strcpy(XtMalloc((unsigned)strlen(str) + 1), str);
  154. }
  155.