home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / Xt / Functions.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-21  |  3.1 KB  |  157 lines

  1. /* $XConsortium: Functions.c,v 1.6 92/06/30 10:45:22 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.     return _XtIsSubclassOf(object,
  94. #ifdef notdef
  95. /*
  96.  * We don't refer to vendorShell directly, because some shared libraries
  97.  * bind local references tightly.
  98.  */
  99.                (WidgetClass)vendorShellWidgetClass,
  100. #endif
  101.                transientShellWidgetClass->core_class.superclass,
  102.                (WidgetClass)wmShellWidgetClass, 0x40);
  103. }
  104.  
  105.  
  106. #undef XtIsTransientShell
  107. Boolean XtIsTransientShell(object)
  108.     Widget object;
  109. {
  110.     return _XtIsSubclassOf(object, (WidgetClass)transientShellWidgetClass,
  111.                (WidgetClass)wmShellWidgetClass, 0x40);
  112. }
  113.  
  114.  
  115. #undef XtIsTopLevelShell
  116. Boolean XtIsTopLevelShell(object)
  117.     Widget object;
  118. {
  119.     return _XtCheckSubclassFlag(object, 0x80);
  120. }
  121.  
  122.  
  123. #undef XtIsApplicationShell
  124. Boolean XtIsApplicationShell(object)
  125.     Widget object;
  126. {
  127.     return _XtIsSubclassOf(object, (WidgetClass)applicationShellWidgetClass,
  128.                (WidgetClass)topLevelShellWidgetClass, 0x80);
  129. }
  130.  
  131.  
  132. #undef XtMapWidget
  133. void XtMapWidget(w)
  134.     Widget w;
  135. {
  136.     XMapWindow(XtDisplay(w), XtWindow(w));
  137. }
  138.  
  139.  
  140. #undef XtUnmapWidget
  141. void XtUnmapWidget(w)
  142.     Widget w;
  143. {
  144.     XUnmapWindow(XtDisplay(w), XtWindow(w));
  145. }
  146.  
  147.  
  148. #undef XtNewString
  149. String XtNewString(str)
  150.     String str;
  151. {
  152.     if (str == NULL)
  153.     return NULL;
  154.     else
  155.     return strcpy(XtMalloc((unsigned)strlen(str) + 1), str);
  156. }
  157.