diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:48:49 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:48:49 +0000 |
commit | bdc0667ef29e24b1a2188b11546d843a7d3e5ef6 (patch) | |
tree | e0a23167aca0fb1127f4cd78edf458b633b31eac /src/Create.c | |
parent | 6a13c9e08bb042c81ae904c44a38a50d785c824e (diff) |
XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1
Diffstat (limited to 'src/Create.c')
-rw-r--r-- | src/Create.c | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/Create.c b/src/Create.c index 212ebd8..a172e52 100644 --- a/src/Create.c +++ b/src/Create.c @@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/lib/Xt/Create.c,v 3.10 2002/12/17 04:50:58 dawes Exp $ */ /* @@ -62,6 +63,7 @@ in this Software without prior written authorization from The Open Group. #include "IntrinsicI.h" #include "VarargsI.h" #include "ShellP.h" +#include "CreateI.h" #ifndef X_NO_RESOURCE_CONFIGURATION_MANAGEMENT #include "ResConfigP.h" #endif @@ -71,8 +73,7 @@ static String XtNxtCreateWidget = "xtCreateWidget"; static String XtNxtCreatePopupShell = "xtCreatePopupShell"; static void -CallClassPartInit(ancestor, wc) - WidgetClass ancestor, wc; +CallClassPartInit(WidgetClass ancestor, WidgetClass wc) { if (ancestor->core_class.superclass != NULL) { CallClassPartInit(ancestor->core_class.superclass, wc); @@ -192,12 +193,12 @@ XtInitializeWidgetClass(wc) } static void -CallInitialize (class, req_widget, new_widget, args, num_args) - WidgetClass class; - Widget req_widget; - Widget new_widget; - ArgList args; - Cardinal num_args; +CallInitialize ( + WidgetClass class, + Widget req_widget, + Widget new_widget, + ArgList args, + Cardinal num_args) { WidgetClass superclass; XtInitProc initialize; @@ -221,11 +222,12 @@ CallInitialize (class, req_widget, new_widget, args, num_args) } static void -CallConstraintInitialize (class, req_widget, new_widget, args, num_args) - ConstraintWidgetClass class; - Widget req_widget, new_widget; - ArgList args; - Cardinal num_args; +CallConstraintInitialize ( + ConstraintWidgetClass class, + Widget req_widget, + Widget new_widget, + ArgList args, + Cardinal num_args) { WidgetClass superclass; XtInitProc initialize; @@ -244,16 +246,15 @@ CallConstraintInitialize (class, req_widget, new_widget, args, num_args) } static Widget -xtWidgetAlloc(widget_class, parent_constraint_class, parent, name, - args, num_args, typed_args, num_typed_args) - WidgetClass widget_class; - ConstraintWidgetClass parent_constraint_class; - Widget parent; - String name; - ArgList args; /* must be NULL if typed_args is non-NULL */ - Cardinal num_args; - XtTypedArgList typed_args; /* must be NULL if args is non-NULL */ - Cardinal num_typed_args; +xtWidgetAlloc( + WidgetClass widget_class, + ConstraintWidgetClass parent_constraint_class, + Widget parent, + String name, + ArgList args, /* must be NULL if typed_args is non-NULL */ + Cardinal num_args, + XtTypedArgList typed_args, /* must be NULL if args is non-NULL */ + Cardinal num_typed_args) { Widget widget; Cardinal wsize, csize = 0; @@ -290,6 +291,7 @@ xtWidgetAlloc(widget_class, parent_constraint_class, parent, name, } } widget = (Widget) __XtMalloc((unsigned)(wsize + csize)); + bzero(widget, wsize + csize); widget->core.constraints = (csize ? (XtPointer)((char *)widget + wsize) : NULL); } @@ -303,8 +305,8 @@ xtWidgetAlloc(widget_class, parent_constraint_class, parent, name, } static void -CompileCallbacks(widget) - Widget widget; +CompileCallbacks( + Widget widget) { CallbackTable offsets; InternalCallbackList* cl; @@ -314,7 +316,7 @@ CompileCallbacks(widget) offsets = (CallbackTable) widget->core.widget_class->core_class.callback_private; - for (i = (int) *(offsets++); --i >= 0; offsets++) { + for (i = (int)(long) *(offsets++); --i >= 0; offsets++) { cl = (InternalCallbackList *) ((char *) widget - (*offsets)->xrm_offset - 1); if (*cl) @@ -324,26 +326,25 @@ CompileCallbacks(widget) } static Widget -xtCreate(name, class, widget_class, parent, default_screen, - args, num_args, typed_args, num_typed_args, parent_constraint_class, - post_proc) - char *name, *class; - WidgetClass widget_class; - Widget parent; - Screen* default_screen; /* undefined when creating a nonwidget */ - ArgList args; /* must be NULL if typed_args is non-NULL */ - Cardinal num_args; - XtTypedArgList typed_args; /* must be NULL if args is non-NULL */ - Cardinal num_typed_args; - ConstraintWidgetClass parent_constraint_class; +xtCreate( + char *name, + char *class, + WidgetClass widget_class, + Widget parent, + Screen* default_screen, /* undefined when creating a nonwidget */ + ArgList args, /* must be NULL if typed_args is non-NULL */ + Cardinal num_args, + XtTypedArgList typed_args, /* must be NULL if args is non-NULL */ + Cardinal num_typed_args, + ConstraintWidgetClass parent_constraint_class, /* NULL if not a subclass of Constraint or if child is popup shell */ - XtWidgetProc post_proc; + XtWidgetProc post_proc) { /* need to use strictest alignment rules possible in next two decls. */ double widget_cache[100]; double constraint_cache[20]; Widget req_widget; - XtPointer req_constraints; + XtPointer req_constraints = NULL; Cardinal wsize, csize; Widget widget; XtCacheRef *cache_refs; @@ -413,7 +414,9 @@ xtCreate(name, class, widget_class, parent, default_screen, } else req_widget->core.constraints = NULL; CallConstraintInitialize(parent_constraint_class, req_widget, widget, args, num_args); - if (csize) XtStackFree(req_constraints, constraint_cache); + if (csize) { + XtStackFree(req_constraints, constraint_cache); + } } XtStackFree((XtPointer)req_widget, widget_cache); if (post_proc != (XtWidgetProc) NULL) { @@ -454,8 +457,7 @@ xtCreate(name, class, widget_class, parent, default_screen, } static void -widgetPostProc(w) - Widget w; +widgetPostProc(Widget w) { XtWidgetProc insert_child; Widget parent = XtParent(w); @@ -481,15 +483,14 @@ widgetPostProc(w) } Widget -_XtCreateWidget(name, widget_class, parent, - args, num_args, typed_args, num_typed_args) - String name; - WidgetClass widget_class; - Widget parent; - ArgList args; - Cardinal num_args; - XtTypedArgList typed_args; - Cardinal num_typed_args; +_XtCreateWidget( + String name, + WidgetClass widget_class, + Widget parent, + ArgList args, + Cardinal num_args, + XtTypedArgList typed_args, + Cardinal num_typed_args) { register Widget widget; ConstraintWidgetClass cwc; @@ -585,7 +586,7 @@ XtCreateWidget(name, widget_class, parent, args, num_args) WIDGET_TO_APPCON(parent); LOCK_APP(app); - retval = _XtCreateWidget(name, widget_class, parent, args, num_args, + retval = _XtCreateWidget((String)name, widget_class, parent, args, num_args, (XtTypedArgList)NULL, (Cardinal)0); UNLOCK_APP(app); return retval; @@ -616,16 +617,15 @@ XtCreateManagedWidget(name, widget_class, parent, args, num_args) LOCK_APP(app); XtCheckSubclass(parent, compositeWidgetClass, "in XtCreateManagedWidget"); - widget = _XtCreateWidget(name, widget_class, parent, args, num_args, - (XtTypedArgList)NULL, (Cardinal) 0); + widget = _XtCreateWidget((String)name, widget_class, parent, args, + num_args, (XtTypedArgList)NULL, (Cardinal) 0); XtManageChild(widget); UNLOCK_APP(app); return widget; } static void -popupPostProc(w) - Widget w; +popupPostProc(Widget w) { Widget parent = XtParent(w); @@ -696,8 +696,8 @@ XtCreatePopupShell(name, widget_class, parent, args, num_args) WIDGET_TO_APPCON(parent); LOCK_APP(app); - retval = _XtCreatePopupShell(name, widget_class, parent, args, num_args, - (XtTypedArgList)NULL, (Cardinal)0); + retval = _XtCreatePopupShell((String)name, widget_class, parent, args, + num_args, (XtTypedArgList)NULL, (Cardinal)0); UNLOCK_APP(app); return retval; } @@ -760,8 +760,8 @@ XtAppCreateShell(name, class, widget_class, display, args, num_args) DPY_TO_APPCON(display); LOCK_APP(app); - retval = _XtAppCreateShell(name, class, widget_class, display, args, - num_args, (XtTypedArgList)NULL, (Cardinal)0); + retval = _XtAppCreateShell((String)name, (String)class, widget_class, + display, args, num_args, (XtTypedArgList)NULL, (Cardinal)0); UNLOCK_APP(app); return retval; } |