File:  [local] / rpl / modules / motif / XtAppInitialize.rplc
Revision 1.5: download - view: text, annotated - select for diffs - revision graph
Mon Aug 21 11:33:21 2017 UTC (6 years, 9 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Cohérence.

    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:         objectOf(appObject) = allocate(size(sXtAppContext));
   31:         objectOf(widgetObject) = allocate(size(Widget));
   32: 
   33:         target(objectContainer(Widget, widgetObject)) =
   34:                 XtVaAppInitialize(address(target(
   35:                 objectContainer(sXtAppContext, appObject)).context),
   36:                 name, NULL, 0, address(argc), argv, NULL, NULL);
   37:         target(objectContainer(sXtAppContext, appObject)).widget =
   38:                 target(objectContainer(Widget, widgetObject));
   39: 
   40:         freeObject(nameObject);
   41: 
   42:         if (nullified(objectOf(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
   56: 
   57: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>