File:  [local] / rpl / modules / motif / motif.rplc
Revision 1.5: download - view: text, annotated - select for diffs - revision graph
Tue Jul 11 16:04:53 2017 UTC (6 years, 10 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Patches pour modules/motif.

    1: #define __RPLC_MAIN
    2: #include "src/rplexternals.h"
    3: #include "motif.h"
    4: 
    5: libraryName(motif);
    6: 
    7: exportExternalFunctions(
    8:         XSynchronize,
    9:         XtAddCallback,
   10:         XtAppExitMainLoop,
   11:         XtAppInitialize,
   12:         XtAppMainLoop,
   13:         XtCreatePopupShell,
   14:         XtCreateWidget,
   15:         XtDestroyWidget,
   16:         XtPopdown,
   17:         XtPopup,
   18:         XtRealizeWidget);
   19: 
   20: declareSubroutine(onLoading)
   21:     notice(stdout, "\nMotif library V2R1 for RPL/2 (C) 2017 BERTRAND Joel\n");
   22:     notice(stdout, "Motif library loaded.\n\n");
   23: 
   24:     // Création des variables spécifiques
   25: 
   26:     declareObject(variable);
   27:     declareObject(value);
   28: 
   29: #define createVariable(var) createVariable2(var, var)
   30: #define createVariable2(var, val) \
   31:         do { \
   32:             createNameObject(variable); \
   33:             setSymbolicName(variable, #var); \
   34:             createIntegerObject(value); \
   35:             setInteger(value, val); \
   36:             pushOnStack(variable); \
   37:             pushOnStack(value); \
   38:             intrinsic(over); \
   39:             intrinsic(save); \
   40:             intrinsic(parameter); \
   41:         } while(0)
   42: 
   43:     createVariable2(XmFalse, 0);
   44:     createVariable2(XmTrue, 1);
   45: 
   46:     createVariable(XmATTACH_NONE);
   47:     createVariable(XmATTACH_FORM);
   48:     createVariable(XmATTACH_OPPOSITE_FORM);
   49:     createVariable(XmATTACH_WIDGET);
   50:     createVariable(XmATTACH_OPPOSITE_WIDGET);
   51:     createVariable(XmATTACH_POSITION);
   52:     createVariable(XmATTACH_SELF);
   53: 
   54:     createVariable(XmALIGNMENT_BEGINNING);
   55:     createVariable(XmALIGNMENT_CENTER);
   56:     createVariable(XmALIGNMENT_END);
   57: 
   58:     createVariable(XmHORIZONTAL);
   59:     createVariable(XmVERTICAL);
   60: 
   61:     createVariable(XtGrabNone);
   62:     createVariable(XtGrabNonexclusive);
   63:     createVariable(XtGrabExclusive);
   64: 
   65:     createVariable(XmSTRING);
   66: 
   67:     setFalse(initializationDone);
   68:     lCallbacks = NULL;
   69: endSubroutine
   70: 
   71: declareSubroutine(onClosing)
   72:     // Destruction des variables spécifiques
   73:     declareObject(variable);
   74: 
   75: #define purgeVariable(var) \
   76:         do { \
   77:             createNameObject(variable); \
   78:             setName(variable, #var); \
   79:             pushOnStack(variable); \
   80:             intrinsic(dup); \
   81:             intrinsic(variable); \
   82:             intrinsic(purge); \
   83:         } while(0)
   84: 
   85:     purgeVariable(XmFalse);
   86:     purgeVariable(XmTrue);
   87: 
   88:     purgeVariable(XmATTACH_NONE);
   89:     purgeVariable(XmATTACH_FORM);
   90:     purgeVariable(XmATTACH_OPPOSITE_FORM);
   91:     purgeVariable(XmATTACH_WIDGET);
   92:     purgeVariable(XmATTACH_OPPOSITE_WIDGET);
   93:     purgeVariable(XmATTACH_POSITION);
   94:     purgeVariable(XmATTACH_SELF);
   95: 
   96:     purgeVariable(XmALIGNMENT_BEGINNING);
   97:     purgeVariable(XmALIGNMENT_CENTER);
   98:     purgeVariable(XmALIGNMENT_END);
   99: 
  100:     purgeVariable(XmHORIZONTAL);
  101:     purgeVariable(XmVERTICAL);
  102: 
  103:     purgeVariable(XtGrabNone);
  104:     purgeVariable(XtGrabNonexclusive);
  105:     purgeVariable(XtGrabExclusive);
  106: 
  107:     purgeVariable(XmSTRING);
  108: 
  109:     notice(stdout, "Motif library unloaded.\n\n");
  110: endSubroutine
  111: 
  112: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>