File:  [local] / rpl / modules / motif / XtAppInitialize.rplc
Revision 1.7: download - view: text, annotated - select for diffs - revision graph
Tue Aug 22 12:13:55 2017 UTC (7 years, 8 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Initialisation des locales.

    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:         XtSetLanguageProc(NULL, NULL, NULL);
   34: 
   35:         target(objectContainer(Widget, widgetObject)) =
   36:                 XtVaAppInitialize(address(target(
   37:                 objectContainer(sXtAppContext, appObject)).context),
   38:                 name, NULL, 0, address(argc), argv, NULL, NULL);
   39:         target(objectContainer(sXtAppContext, appObject)).widget =
   40:                 target(objectContainer(Widget, widgetObject));
   41: 
   42:         freeObject(nameObject);
   43: 
   44:         if (nullified(objectOf(appObject))) then
   45:             executionError("Nullified XtAppContext");
   46:             freeObject(appObject);
   47:             freeObject(widgetObject);
   48:             returnOnError();
   49:         endIf
   50: 
   51:         pushOnStack(appObject);
   52:         pushOnStack(widgetObject);
   53: 
   54:         setFalse(exitMainLoop);
   55:         setTrue(initializationDone);
   56:     END
   57: endExternalFunction
   58: 
   59: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>