summaryrefslogtreecommitdiff
path: root/src/VarCreate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/VarCreate.c')
-rw-r--r--src/VarCreate.c171
1 files changed, 29 insertions, 142 deletions
diff --git a/src/VarCreate.c b/src/VarCreate.c
index 3d9614d..2aed5d4 100644
--- a/src/VarCreate.c
+++ b/src/VarCreate.c
@@ -52,27 +52,25 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/VarCreate.c,v 3.7 2001/12/14 19:56:32 dawes Exp $ */
#include "IntrinsicI.h"
#include "StringDefs.h"
#include "Shell.h"
#include "VarargsI.h"
+#include "CreateI.h"
#if (defined(SUNSHLIB) || defined(AIXSHLIB)) && defined(SHAREDCODE)
#define XtToolkitInitialize _XtToolkitInitialize
#endif /* (SUNSHLIB || AIXSHLIB) && SHAREDCODE */
-extern Widget _XtCreateWidget();
-extern Widget _XtAppCreateShell();
-extern Widget _XtCreatePopupShell();
-
static Widget
-_XtVaCreateWidget(name, widget_class, parent, var, count)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_list var;
- int count;
+_XtVaCreateWidget(
+ String name,
+ WidgetClass widget_class,
+ Widget parent,
+ va_list var,
+ int count)
{
register Widget widget;
XtTypedArgList typed_args = NULL;
@@ -91,21 +89,12 @@ _XtVaCreateWidget(name, widget_class, parent, var, count)
}
-#if NeedVarargsPrototypes
Widget
XtVaCreateWidget(
_Xconst char* name,
WidgetClass widget_class,
Widget parent,
...)
-#else
-/*VARARGS3*/
-Widget XtVaCreateWidget(name, widget_class, parent, va_alist)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -113,33 +102,25 @@ Widget XtVaCreateWidget(name, widget_class, parent, va_alist)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- Va_start(var,parent);
+ va_start(var,parent);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,parent);
- widget = _XtVaCreateWidget(name, widget_class, parent, var, total_count);
+ va_start(var,parent);
+ widget = _XtVaCreateWidget((String)name, widget_class, parent, var,
+ total_count);
va_end(var);
UNLOCK_APP(app);
return widget;
}
-#if NeedVarargsPrototypes
Widget
XtVaCreateManagedWidget(
_Xconst char* name,
WidgetClass widget_class,
Widget parent,
...)
-#else
-/*VARARGS3*/
-Widget XtVaCreateManagedWidget(name, widget_class, parent, va_alist)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -147,12 +128,13 @@ Widget XtVaCreateManagedWidget(name, widget_class, parent, va_alist)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- Va_start(var,parent);
+ va_start(var,parent);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,parent);
- widget = _XtVaCreateWidget(name, widget_class, parent, var, total_count);
+ va_start(var,parent);
+ widget = _XtVaCreateWidget((String)name, widget_class, parent, var,
+ total_count);
XtManageChild(widget);
va_end(var);
UNLOCK_APP(app);
@@ -160,7 +142,6 @@ Widget XtVaCreateManagedWidget(name, widget_class, parent, va_alist)
}
-#if NeedVarargsPrototypes
Widget
XtVaAppCreateShell(
_Xconst char* name,
@@ -168,15 +149,6 @@ XtVaAppCreateShell(
WidgetClass widget_class,
Display* display,
...)
-#else
-/*VARARGS4*/
-Widget XtVaAppCreateShell(name, class, widget_class, display, va_alist)
- String name;
- String class;
- WidgetClass widget_class;
- Display* display;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -186,15 +158,15 @@ Widget XtVaAppCreateShell(name, class, widget_class, display, va_alist)
DPY_TO_APPCON(display);
LOCK_APP(app);
- Va_start(var,display);
+ va_start(var,display);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,display);
+ va_start(var,display);
_XtVaToTypedArgList(var, total_count, &typed_args, &num_args);
- widget = _XtAppCreateShell(name, class, widget_class, display,
- (ArgList)NULL, (Cardinal)0, typed_args, num_args);
+ widget = _XtAppCreateShell((String)name, (String)class, widget_class,
+ display, (ArgList)NULL, (Cardinal)0, typed_args, num_args);
if (typed_args != NULL) {
XtFree((XtPointer)typed_args);
}
@@ -205,21 +177,12 @@ Widget XtVaAppCreateShell(name, class, widget_class, display, va_alist)
}
-#if NeedVarargsPrototypes
Widget
XtVaCreatePopupShell(
_Xconst char* name,
WidgetClass widget_class,
Widget parent,
...)
-#else
-/*VARARGS3*/
-Widget XtVaCreatePopupShell(name, widget_class, parent, va_alist)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -229,14 +192,14 @@ Widget XtVaCreatePopupShell(name, widget_class, parent, va_alist)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- Va_start(var,parent);
+ va_start(var,parent);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,parent);
+ va_start(var,parent);
_XtVaToTypedArgList(var, total_count, &typed_args, &num_args);
- widget = _XtCreatePopupShell(name, widget_class, parent,
+ widget = _XtCreatePopupShell((String)name, widget_class, parent,
(ArgList)NULL, (Cardinal)0, typed_args, num_args);
if (typed_args != NULL) {
XtFree((XtPointer)typed_args);
@@ -247,15 +210,8 @@ Widget XtVaCreatePopupShell(name, widget_class, parent, va_alist)
return widget;
}
-#if NeedVarargsPrototypes
void
XtVaSetValues(Widget widget, ...)
-#else
-/*VARARGS1*/
-void XtVaSetValues(widget, va_alist)
- Widget widget;
- va_dcl
-#endif
{
va_list var;
ArgList args = NULL;
@@ -264,11 +220,11 @@ void XtVaSetValues(widget, va_alist)
WIDGET_TO_APPCON(widget);
LOCK_APP(app);
- Va_start(var,widget);
+ va_start(var,widget);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,widget);
+ va_start(var,widget);
_XtVaToArgList(widget, var, total_count, &args, &num_args);
XtSetValues(widget, args, num_args);
@@ -279,24 +235,15 @@ void XtVaSetValues(widget, va_alist)
}
-#if NeedVarargsPrototypes
void
XtVaSetSubvalues(XtPointer base, XtResourceList resources, Cardinal num_resources, ...)
-#else
-/*VARARGS3*/
-void XtVaSetSubvalues(base, resources, num_resources, va_alist)
- XtPointer base;
- XtResourceList resources;
- Cardinal num_resources;
- va_dcl
-#endif
{
va_list var;
ArgList args;
Cardinal num_args;
int total_count, typed_count;
- Va_start(var, num_resources);
+ va_start(var, num_resources);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
@@ -304,7 +251,7 @@ void XtVaSetSubvalues(base, resources, num_resources, va_alist)
XtWarning("XtVaTypedArg is not valid in XtVaSetSubvalues()\n");
}
- Va_start(var, num_resources);
+ va_start(var, num_resources);
_XtVaToArgList((Widget)NULL, var, total_count, &args, &num_args);
XtSetSubvalues(base, resources, num_resources, args, num_args);
@@ -316,7 +263,6 @@ void XtVaSetSubvalues(base, resources, num_resources, va_alist)
va_end(var);
}
-#if NeedVarargsPrototypes
Widget
_XtVaOpenApplication(
XtAppContext *app_context_return,
@@ -328,21 +274,6 @@ _XtVaOpenApplication(
String *fallback_resources,
WidgetClass widget_class,
va_list var_args)
-#else
-/*VARARGS8*/
-Widget _XtVaOpenApplication(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, widget_class, var_args)
- XtAppContext *app_context_return;
- char *application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- WidgetClass widget_class;
- va_list var_args;
-#endif
{
XtAppContext app_con;
Display * dpy;
@@ -397,7 +328,6 @@ Widget _XtVaOpenApplication(app_context_return, application_class, options,
return(root);
}
-#if NeedVarargsPrototypes
Widget
_XtVaAppInitialize(
XtAppContext *app_context_return,
@@ -408,20 +338,6 @@ _XtVaAppInitialize(
String *argv_in_out,
String *fallback_resources,
va_list var_args)
-#else
-/*VARARGS7*/
-Widget _XtVaAppInitialize(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, var_args)
- XtAppContext *app_context_return;
- char *application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- va_list var_args;
-#endif
{
return _XtVaOpenApplication(app_context_return, application_class,
options, num_options,
@@ -436,7 +352,6 @@ Widget _XtVaAppInitialize(app_context_return, application_class, options,
* _XtVaOpenApplication and to _XtVaAppInitialize.
*/
-#if NeedVarargsPrototypes
Widget
XtVaOpenApplication(
XtAppContext *app_context_return,
@@ -448,30 +363,15 @@ XtVaOpenApplication(
String *fallback_resources,
WidgetClass widget_class,
...)
-#else
-Widget XtVaOpenApplication(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, widget_class, va_alist)
- XtAppContext *app_context_return;
- String application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- WidgetClass widget_class;
- va_dcl
-#endif
{
va_list var;
- Va_start(var, widget_class);
+ va_start(var, widget_class);
return _XtVaOpenApplication(app_context_return, (String)application_class,
options, num_options, argc_in_out, argv_in_out,
fallback_resources, widget_class, var);
}
-#if NeedVarargsPrototypes
Widget
XtVaAppInitialize(
XtAppContext *app_context_return,
@@ -482,23 +382,10 @@ XtVaAppInitialize(
String *argv_in_out,
String *fallback_resources,
...)
-#else
-Widget XtVaAppInitialize(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, va_alist)
- XtAppContext *app_context_return;
- String application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- va_dcl
-#endif
{
va_list var;
- Va_start(var, fallback_resources);
+ va_start(var, fallback_resources);
return _XtVaOpenApplication(app_context_return, (String)application_class,
options, num_options, argc_in_out, argv_in_out,
fallback_resources,