Annotation of rpl/modules/motif/XtAppInitialize.rplc, revision 1.1
1.1 ! bertrand 1: #include "src/rplexternals.h"
! 2: #include "motif.h"
! 3:
! 4: declareExternalFunction(XtAppInitialize)
! 5: int argc;
! 6: String *argv;
! 7: char *name;
! 8:
! 9: declareObject(appObject);
! 10: declareObject(nameObject);
! 11: declareObject(widgetObject);
! 12:
! 13: HEADER
! 14: declareHelpString("Initialize application context\n"
! 15: " 1: \"application name\"\n"
! 16: " -> 2: AppContext\n"
! 17: " 1: Widget\n");
! 18: numberOfArguments(1);
! 19: FUNCTION
! 20: pullFromStack(nameObject, string);
! 21: returnOnError(freeObject(nameObject));
! 22: getString(nameObject, name);
! 23:
! 24: argc = 0;
! 25: nullify(argv);
! 26:
! 27: createExternalObject(appObject, APPCONTEXT);
! 28: createExternalObject(widgetObject, WIDGET);
! 29:
! 30: objectContainer(appObject) = allocate(size(sXtAppContext));
! 31: objectContainer(widgetObject) = allocate(size(Widget));
! 32:
! 33: target((Widget *) objectContainer(widgetObject)) =
! 34: XtVaAppInitialize(address(target((sXtAppContext *)
! 35: objectContainer(appObject)).context),
! 36: name, NULL, 0, address(argc), argv, NULL, NULL);
! 37: target((sXtAppContext *) objectContainer(appObject)).widget =
! 38: target((Widget *) objectContainer(widgetObject));
! 39:
! 40: freeObject(nameObject);
! 41:
! 42: if (nullified(objectContainer(appObject))) then
! 43: executionError("Nullified XtAppContext");
! 44: freeObject(appObject);
! 45: freeObject(widgetObject);
! 46: returnOnError();
! 47: endIf
! 48:
! 49: pushOnStack(appObject);
! 50: pushOnStack(widgetObject);
! 51:
! 52: setFalse(exitMainLoop);
! 53: setTrue(initializationDone);
! 54: END
! 55: endExternalFunction
CVSweb interface <joel.bertrand@systella.fr>