home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / Xt / Create.c.orig < prev    next >
Encoding:
Text File  |  1993-07-21  |  18.4 KB  |  564 lines

  1. /* $XConsortium: Create.c,v 1.89 92/08/26 14:09:28 converse Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  5. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  6.  
  7.                         All Rights Reserved
  8.  
  9. Permission to use, copy, modify, and distribute this software and its 
  10. documentation for any purpose and without fee is hereby granted, 
  11. provided that the above copyright notice appear in all copies and that
  12. both that copyright notice and this permission notice appear in 
  13. supporting documentation, and that the names of Digital or MIT not be
  14. used in advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.  
  16.  
  17. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  19. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24.  
  25. ******************************************************************/
  26.  
  27. #include "IntrinsicI.h"
  28. #include "VarargsI.h"
  29. #include "StringDefs.h"
  30. #include "Shell.h"
  31. #include "ShellP.h"
  32. #include <stdio.h>
  33.  
  34. static String XtNxtCreateWidget = "xtCreateWidget";
  35. static String XtNxtCreatePopupShell = "xtCreatePopupShell";
  36.  
  37. static void CallClassPartInit(ancestor, wc)
  38.      WidgetClass ancestor, wc;
  39. {
  40.     if (ancestor->core_class.superclass != NULL) {
  41.     CallClassPartInit(ancestor->core_class.superclass, wc);
  42.     }
  43.     if (ancestor->core_class.class_part_initialize != NULL) {
  44.     (*(ancestor->core_class.class_part_initialize)) (wc);
  45.     }
  46. }
  47.  
  48. void XtInitializeWidgetClass(wc)
  49.     WidgetClass wc;
  50. {
  51.     XtEnum inited;
  52.     if (wc->core_class.class_inited) return;
  53.     inited = 0x01;
  54.     {
  55.     WidgetClass pc;
  56. #define LeaveIfClass(c, d) if (pc == c) { inited = d; break; }
  57.     for (pc = wc; pc; pc = pc->core_class.superclass) {
  58.         LeaveIfClass(rectObjClass, 0x01 |
  59.              RectObjClassFlag);
  60.         LeaveIfClass(coreWidgetClass, 0x01 |
  61.              RectObjClassFlag |
  62.              WidgetClassFlag);
  63.         LeaveIfClass(compositeWidgetClass, 0x01 |
  64.              RectObjClassFlag |
  65.              WidgetClassFlag |
  66.              CompositeClassFlag);
  67.         LeaveIfClass(constraintWidgetClass, 0x01 |
  68.              RectObjClassFlag |
  69.              WidgetClassFlag |
  70.              CompositeClassFlag |
  71.              ConstraintClassFlag);
  72.         LeaveIfClass(shellWidgetClass, 0x01 |
  73.              RectObjClassFlag |
  74.              WidgetClassFlag |
  75.              CompositeClassFlag |
  76.              ShellClassFlag);
  77.         LeaveIfClass(wmShellWidgetClass, 0x01 |
  78.              RectObjClassFlag |
  79.              WidgetClassFlag |
  80.              CompositeClassFlag |
  81.              ShellClassFlag |
  82.              WMShellClassFlag);
  83.         LeaveIfClass(topLevelShellWidgetClass, 0x01 |
  84.              RectObjClassFlag |
  85.              WidgetClassFlag |
  86.              CompositeClassFlag |
  87.              ShellClassFlag |
  88.              WMShellClassFlag |
  89.              TopLevelClassFlag);
  90.     }
  91. #undef LeaveIfClass
  92.     }
  93.     if (wc->core_class.version != XtVersion &&
  94.     wc->core_class.version != XtVersionDontCheck &&
  95.     wc->core_class.version != (11 * 1000 + 4)) { /* MIT R4 is OK */
  96.     String param[3];
  97.         param[0] = wc->core_class.class_name;
  98.     if (wc->core_class.version == (11 * 1000 + 3)) { /* MIT X11R3 */
  99.         if (inited & ShellClassFlag) {
  100.         Cardinal num_params=1;
  101.         XtWarningMsg("r3versionMismatch","widget",XtCXtToolkitError,
  102.                  "Shell Widget class %s binary compiled for R3",
  103.                  param,&num_params);
  104.         }
  105.     }
  106.     else {
  107.         Cardinal num_params=3;
  108.         param[1] = (String)wc->core_class.version;
  109.         param[2] = (String)XtVersion;
  110.         XtWarningMsg("versionMismatch","widget",XtCXtToolkitError,
  111.              "Widget class %s version mismatch (recompilation needed):\n  widget %d vs. intrinsics %d.",
  112.              param,&num_params);
  113.         if (wc->core_class.version == (2 * 1000 + 2)) /* MIT X11R2 */ {
  114.         Cardinal num_params=1;
  115.         XtErrorMsg("r2versionMismatch","widget",XtCXtToolkitError,
  116.                "Widget class %s must be re-compiled.",
  117.                param, &num_params);
  118.         }
  119.     }
  120.     }
  121.  
  122.     if ((wc->core_class.superclass != NULL) 
  123.         && (!(wc->core_class.superclass->core_class.class_inited)))
  124.      XtInitializeWidgetClass(wc->core_class.superclass);
  125.  
  126.     if (wc->core_class.class_initialize != NULL)
  127.     (*(wc->core_class.class_initialize))();
  128.     CallClassPartInit(wc, wc);
  129.     wc->core_class.class_inited = inited;
  130. }
  131.  
  132. static void CallInitialize (class, req_widget, new_widget, args, num_args)
  133.     WidgetClass class;
  134.     Widget      req_widget;
  135.     Widget      new_widget;
  136.     ArgList     args;
  137.     Cardinal    num_args;
  138. {
  139.     if (class->core_class.superclass)
  140.         CallInitialize (class->core_class.superclass,
  141.         req_widget, new_widget, args, num_args);
  142.     if (class->core_class.initialize != NULL)
  143.     (*class->core_class.initialize)
  144.         (req_widget, new_widget, args, &num_args);
  145.     if (class->core_class.initialize_hook != NULL)
  146.     (*class->core_class.initialize_hook) (new_widget, args, &num_args);
  147. }
  148.  
  149. static void CallConstraintInitialize (class, req_widget, new_widget, args, num_args)
  150.     ConstraintWidgetClass class;
  151.     Widget    req_widget, new_widget;
  152.     ArgList    args;
  153.     Cardinal    num_args;
  154. {
  155.     if (class->core_class.superclass != constraintWidgetClass)
  156.     CallConstraintInitialize(
  157.         (ConstraintWidgetClass) class->core_class.superclass,
  158.         req_widget, new_widget, args, num_args);
  159.     if (class->constraint_class.initialize != NULL)
  160.         (*class->constraint_class.initialize)
  161.         (req_widget, new_widget, args, &num_args);
  162. }
  163.  
  164. static Widget _XtCreate(
  165.     name, class, widget_class, parent, default_screen,
  166.     args, num_args, typed_args, num_typed_args, parent_constraint_class)
  167.     char        *name, *class;
  168.     WidgetClass widget_class;
  169.     Widget      parent;
  170.     Screen*     default_screen; /* undefined when creating a nonwidget */
  171.     ArgList     args;        /* must be NULL if typed_args is non-NULL */
  172.     Cardinal    num_args;
  173.     XtTypedArgList typed_args;    /* must be NULL if args is non-NULL */
  174.     Cardinal    num_typed_args;
  175.     ConstraintWidgetClass parent_constraint_class;
  176.         /* NULL if not a subclass of Constraint or if child is popup shell */
  177. {
  178.     register CallbackTable  offsets;
  179.     InternalCallbackList    *cl;
  180.     /* need to use strictest alignment rules possible in next two decls. */
  181.     double                  widget_cache[100];
  182.     double                  constraint_cache[20];
  183.     Widget                  req_widget;
  184.     XtPointer               req_constraints;
  185.     Cardinal                wsize, csize;
  186.     register Widget        widget;
  187.     XtCacheRef            *cache_refs;
  188.     register int        i;
  189.  
  190.     if (! (widget_class->core_class.class_inited))
  191.     XtInitializeWidgetClass(widget_class);
  192.     wsize = widget_class->core_class.widget_size;
  193.     csize = 0;
  194.     if (parent_constraint_class) {
  195.     csize = parent_constraint_class->constraint_class.constraint_size;
  196.     if (sizeof(struct {char a; double b;}) !=
  197.         (sizeof(struct {char a; unsigned long b;}) -
  198.          sizeof(unsigned long) + sizeof(double))) {
  199.         if (csize && !(csize & (sizeof(double) - 1)))
  200.         wsize = (wsize + sizeof(double) - 1) & ~(sizeof(double)-1);
  201.     }
  202.     }
  203.     widget = (Widget) XtMalloc((unsigned)(wsize + csize));
  204.     widget->core.self = widget;
  205.     widget->core.parent = parent;
  206.     widget->core.widget_class = widget_class;
  207.     widget->core.xrm_name = StringToName((name != NULL) ? name : "");
  208.     widget->core.being_destroyed =
  209.     (parent != NULL ? parent->core.being_destroyed : FALSE);
  210.     if (csize)
  211.     widget->core.constraints = (XtPointer)((char *)widget + wsize);
  212.     else
  213.     widget->core.constraints = NULL;
  214.     if (XtIsWidget(widget)) {
  215.     widget->core.name = XrmNameToString(widget->core.xrm_name);
  216.         widget->core.screen = default_screen;
  217.         widget->core.tm.translations = NULL;
  218.     };
  219.     if (XtIsApplicationShell(widget)) {
  220.     ApplicationShellWidget a = (ApplicationShellWidget) widget;
  221.     if (class != NULL)
  222.         a->application.xrm_class = StringToClass(class);
  223.     else
  224.         a->application.xrm_class = widget_class->core_class.xrm_class;
  225.     a->application.class = XrmQuarkToString(a->application.xrm_class);
  226.     }
  227.  
  228.     /* fetch resources */
  229.     cache_refs = _XtGetResources(widget, args, num_args, 
  230.                       typed_args, &num_typed_args);
  231.  
  232.     /* Convert typed arg list to arg list */
  233.     if (typed_args != NULL && num_typed_args > 0) {
  234.     args = (ArgList)ALLOCATE_LOCAL(sizeof(Arg) * num_typed_args);
  235.     if (args == NULL) _XtAllocError(NULL);
  236.     for (i = 0; i < num_typed_args; i++) {
  237.         args[i].name = typed_args[i].name;
  238.         args[i].value = typed_args[i].value;
  239.     }
  240.     num_args = num_typed_args;
  241.     }
  242.     
  243.     /* Compile any callback lists into internal form */
  244.     offsets = (CallbackTable)
  245.     widget->core.widget_class->core_class.callback_private;
  246.  
  247.     for (i = (int) *(offsets++); --i >= 0; offsets++) {
  248.     cl = (InternalCallbackList *)
  249.         ((char *) widget - (*offsets)->xrm_offset - 1);
  250.     if (*cl)
  251.         *cl = _XtCompileCallbackList((XtCallbackList) *cl);
  252.     }
  253.  
  254.     if (cache_refs != NULL) {
  255.     extern void _XtCallbackReleaseCacheRefs();
  256.     XtAddCallback( widget, XtNdestroyCallback,
  257.                XtCallbackReleaseCacheRefList, (XtPointer)cache_refs );
  258.     }
  259.  
  260.     wsize = widget_class->core_class.widget_size;
  261.     req_widget = (Widget) XtStackAlloc(wsize, widget_cache);
  262.     bcopy ((char *) widget, (char *) req_widget, (int) wsize);
  263.     CallInitialize (XtClass(widget), req_widget, widget, args, num_args);
  264.     if (parent_constraint_class != NULL) {
  265.     if (csize) {
  266.         req_constraints = XtStackAlloc(csize, constraint_cache);
  267.         bcopy(widget->core.constraints, (char*)req_constraints,(int)csize);
  268.         req_widget->core.constraints = req_constraints;
  269.     } else req_widget->core.constraints = NULL;
  270.     CallConstraintInitialize(parent_constraint_class, req_widget, widget,
  271.                  args, num_args);
  272.     if (csize) XtStackFree(req_constraints, constraint_cache);
  273.     }
  274.     XtStackFree((XtPointer)req_widget, widget_cache);
  275.  
  276.     if (typed_args != NULL) {
  277.     while (num_typed_args-- > 0) {
  278.     
  279.         /* In GetResources we may have dynamically alloc'd store to hold */
  280.         /* a copy of a resource which was larger then sizeof(XtArgVal). */
  281.         /* We must free this store now in order to prevent a memory leak */
  282.         /* A typed arg that has a converted value in dynamic store has a */
  283.         /* negated size field. */
  284.  
  285.         if (typed_args->type != NULL && typed_args->size < 0) {
  286.         XtFree((char*)typed_args->value);
  287.         typed_args->size = -(typed_args->size);
  288.         }
  289.         typed_args++;
  290.     }
  291.     DEALLOCATE_LOCAL((char*)args);
  292.     }
  293.     return (widget);
  294. }
  295.  
  296.  
  297. Widget _XtCreateWidget(name, widget_class, parent, args, num_args,
  298.                typed_args, num_typed_args)
  299.     String      name;
  300.     WidgetClass widget_class;
  301.     Widget      parent;
  302.     ArgList     args;
  303.     Cardinal    num_args;
  304.     XtTypedArgList typed_args;
  305.     Cardinal    num_typed_args;
  306. {
  307.     register Widget        widget;
  308.     ConstraintWidgetClass   cwc;
  309.     XtWidgetProc        insert_child;
  310.     Screen*                 default_screen;
  311.  
  312.     if (parent == NULL) {
  313.     XtErrorMsg("invalidParent",XtNxtCreateWidget,XtCXtToolkitError,
  314.                 "XtCreateWidget requires non-NULL parent",
  315.                   (String *)NULL, (Cardinal *)NULL);
  316.     } else if (widget_class == NULL) {
  317.     XtAppErrorMsg(XtWidgetToApplicationContext(parent),
  318.         "invalidClass",XtNxtCreateWidget,XtCXtToolkitError,
  319.                 "XtCreateWidget requires non-NULL widget class",
  320.                   (String *)NULL, (Cardinal *)NULL);
  321.     }
  322.     if (!widget_class->core_class.class_inited)
  323.     XtInitializeWidgetClass(widget_class);
  324.     if ((widget_class->core_class.class_inited & WidgetClassFlag) == 0) {
  325.     /* not a widget */
  326.     if (XtIsComposite(parent)) {
  327.         CompositeClassExtension ext;
  328.         for (ext = (CompositeClassExtension)
  329.                ((CompositeWidgetClass)XtClass(parent))
  330.              ->composite_class.extension;
  331.          ext != NULL && ext->record_type != NULLQUARK;
  332.          ext = (CompositeClassExtension)ext->next_extension);
  333.         if (ext != NULL &&
  334.         (ext->version != XtCompositeExtensionVersion
  335.          || ext->record_size != sizeof(CompositeClassExtensionRec))) {
  336.         String params[1];
  337.         Cardinal num_params = 1;
  338.         params[0] = XtClass(parent)->core_class.class_name;
  339.         XtAppWarningMsg(XtWidgetToApplicationContext(parent),
  340.           "invalidExtension", XtNxtCreateWidget, XtCXtToolkitError,
  341.           "widget class %s has invalid CompositeClassExtension record",
  342.           params, &num_params);
  343.         ext = NULL;
  344.         }
  345.         if (ext == NULL || !ext->accepts_objects) {
  346.         String params[2];
  347.         Cardinal num_params = 2;
  348.         params[0] = name;
  349.         params[1] = XtName(parent);
  350.         XtAppErrorMsg(XtWidgetToApplicationContext(parent),
  351.                   "nonWidget",XtNxtCreateWidget,XtCXtToolkitError,
  352.                   "attempt to add non-widget child \"%s\" to parent \"%s\" which supports only widgets",
  353.                   params, &num_params);
  354.         }
  355.     }
  356.     } else {
  357.     default_screen = parent->core.screen;
  358.     }
  359.  
  360.     if (XtIsConstraint(parent)) {
  361.     cwc = (ConstraintWidgetClass) parent->core.widget_class;
  362.     } else {
  363.     cwc = NULL;
  364.     }
  365.     widget = _XtCreate(name, (char *)NULL, widget_class, parent,
  366.                default_screen, args, num_args,
  367.                typed_args, num_typed_args, cwc);
  368.     if (XtIsComposite(parent)) {
  369.         insert_child = ((CompositeWidgetClass) parent->core.widget_class)->
  370.         composite_class.insert_child;
  371.     } else {
  372.     return(widget);
  373.     }
  374.     if (insert_child == NULL) {
  375.     XtAppErrorMsg(XtWidgetToApplicationContext(parent),
  376.         "nullProc","insertChild",XtCXtToolkitError,
  377.                 "NULL insert_child procedure",
  378.                   (String *)NULL, (Cardinal *)NULL);
  379.     } else {
  380.     (*insert_child) (widget);
  381.     }
  382.     return (widget);
  383. }
  384.  
  385. #if NeedFunctionPrototypes
  386. Widget XtCreateWidget(
  387.     _Xconst char* name,
  388.     WidgetClass widget_class,
  389.     Widget       parent,
  390.     ArgList     args,
  391.     Cardinal    num_args
  392.     )
  393. #else
  394. Widget XtCreateWidget(name, widget_class, parent, args, num_args)
  395.     String    name;
  396.     WidgetClass widget_class;
  397.     Widget       parent;
  398.     ArgList     args;
  399.     Cardinal    num_args;
  400. #endif
  401. {
  402.     return(_XtCreateWidget(name, widget_class, parent, args, num_args,
  403.                (XtTypedArgList)NULL, (Cardinal)0));
  404. }
  405.  
  406.  
  407. #if NeedFunctionPrototypes
  408. Widget XtCreateManagedWidget(
  409.     _Xconst char* name,
  410.     WidgetClass widget_class,
  411.     Widget      parent,
  412.     ArgList     args,
  413.     Cardinal    num_args
  414.     )
  415. #else
  416. Widget XtCreateManagedWidget(name, widget_class, parent, args, num_args)
  417.     String      name;
  418.     WidgetClass widget_class;
  419.     Widget      parent;
  420.     ArgList     args;
  421.     Cardinal    num_args;
  422. #endif
  423. {
  424.     register Widget        widget;
  425.  
  426.     XtCheckSubclass(parent, compositeWidgetClass, "in XtCreateManagedWidget");
  427.     widget = XtCreateWidget(name, widget_class, parent, args, num_args);
  428.     XtManageChild(widget);
  429.     return widget;
  430. }
  431.  
  432. Widget _XtCreatePopupShell(name, widget_class, parent, args, num_args,
  433.                typed_args, num_typed_args)
  434.     String      name;
  435.     WidgetClass widget_class;
  436.     Widget      parent;
  437.     ArgList     args;
  438.     Cardinal    num_args;
  439.     XtTypedArgList      typed_args;
  440.     Cardinal            num_typed_args;
  441. {
  442.     register Widget widget;
  443.     Screen* default_screen;
  444.  
  445.     if (parent == NULL) {
  446.     XtErrorMsg("invalidParent",XtNxtCreatePopupShell,XtCXtToolkitError,
  447.                 "XtCreatePopupShell requires non-NULL parent",
  448.                   (String *)NULL, (Cardinal *)NULL);
  449.     } else if (widget_class == NULL) {
  450.     XtAppErrorMsg(XtWidgetToApplicationContext(parent),
  451.         "invalidClass",XtNxtCreatePopupShell,XtCXtToolkitError,
  452.                 "XtCreatePopupShell requires non-NULL widget class",
  453.                   (String *)NULL, (Cardinal *)NULL);
  454.     }
  455.     XtCheckSubclass(parent, coreWidgetClass, "in XtCreatePopupShell");
  456.     default_screen = parent->core.screen;
  457.     widget = _XtCreate(
  458.                name, (char *)NULL, widget_class, parent,
  459.                default_screen, args, num_args, typed_args,
  460.                num_typed_args, (ConstraintWidgetClass)NULL);
  461.  
  462.     parent->core.popup_list =
  463.     (WidgetList) XtRealloc((char*) parent->core.popup_list,
  464.                (unsigned) (parent->core.num_popups+1) * sizeof(Widget));
  465.     parent->core.popup_list[parent->core.num_popups++] = widget;
  466.     return(widget);
  467. }
  468.  
  469.  
  470. #if NeedFunctionPrototypes
  471. Widget XtCreatePopupShell(
  472.     _Xconst char* name,
  473.     WidgetClass widget_class,
  474.     Widget      parent,
  475.     ArgList     args,
  476.     Cardinal    num_args
  477.     )
  478. #else
  479. Widget XtCreatePopupShell(name, widget_class, parent, args, num_args)
  480.     String      name;
  481.     WidgetClass widget_class;
  482.     Widget      parent;
  483.     ArgList     args;
  484.     Cardinal    num_args;
  485. #endif
  486. {
  487.     return _XtCreatePopupShell(name, widget_class, parent, args, num_args,
  488.                    (XtTypedArgList)NULL, (Cardinal)0);
  489. }
  490.  
  491.  
  492. Widget _XtAppCreateShell(name, class, widget_class, display, args, num_args,
  493.              typed_args, num_typed_args)
  494.     String      name, class;
  495.     WidgetClass widget_class;
  496.     Display*    display;
  497.     ArgList     args;
  498.     Cardinal    num_args;
  499.     XtTypedArgList typed_args;
  500.     Cardinal    num_typed_args;
  501. {
  502.     if (widget_class == NULL) {
  503.     XtAppErrorMsg(XtDisplayToApplicationContext(display),
  504.            "invalidClass","xtAppCreateShell",XtCXtToolkitError,
  505.                "XtAppCreateShell requires non-NULL widget class",
  506.                  (String *)NULL, (Cardinal *)NULL);
  507.     }
  508.  
  509.     if (name == NULL)
  510.     name = XrmNameToString(_XtGetPerDisplay(display)->name);
  511.  
  512.     return _XtCreate(name, class, widget_class, (Widget)NULL,
  513.         (Screen*)DefaultScreenOfDisplay(display),
  514.         args, num_args, typed_args, num_typed_args,
  515.         (ConstraintWidgetClass) NULL);
  516. }
  517.  
  518. #if NeedFunctionPrototypes
  519. Widget XtAppCreateShell(
  520.     _Xconst char*       name,
  521.     _Xconst char*       class,
  522.     WidgetClass         widget_class,
  523.     Display             *display,
  524.     ArgList             args,
  525.     Cardinal            num_args
  526.     )
  527. #else
  528. Widget XtAppCreateShell(name, class, widget_class, display, args, num_args)
  529.     String              name, class;
  530.     WidgetClass         widget_class;
  531.     Display             *display;
  532.     ArgList             args;
  533.     Cardinal            num_args;
  534. #endif
  535. {
  536.     return _XtAppCreateShell(name, class, widget_class, display, args, 
  537.                  num_args, (XtTypedArgList)NULL, (Cardinal)0);
  538. }
  539.  
  540. /* ARGSUSED */
  541. #if NeedFunctionPrototypes
  542. Widget XtCreateApplicationShell(
  543.     _Xconst char* name,        /* unused in R3 and later */
  544.     WidgetClass widget_class,
  545.     ArgList     args,
  546.     Cardinal    num_args
  547.     )
  548. #else
  549. Widget XtCreateApplicationShell(name, widget_class, args, num_args)
  550.     String      name;        /* unused in R3 and later */
  551.     WidgetClass widget_class;
  552.     ArgList     args;
  553.     Cardinal    num_args;
  554. #endif
  555. {
  556.     Display *dpy = _XtDefaultAppContext()->list[0];
  557.     XrmClass class = _XtGetPerDisplay(dpy)->class;
  558.  
  559.     return _XtAppCreateShell((String)NULL, XrmQuarkToString((XrmQuark)class),
  560.                  widget_class, dpy, args, num_args,
  561.                  (XtTypedArgList)NULL, (Cardinal)0);
  562. }
  563.  
  564.