Annotation of rpl/modules/motif/motif.rplc, revision 1.10
1.1 bertrand 1: #define __RPLC_MAIN
2: #include "src/rplexternals.h"
3: #include "motif.h"
4:
5: libraryName(motif);
6:
7: exportExternalFunctions(
1.4 bertrand 8: XSynchronize,
1.9 bertrand 9: XStoreName,
1.4 bertrand 10: XtAddCallback,
1.3 bertrand 11: XtAppExitMainLoop,
1.1 bertrand 12: XtAppInitialize,
13: XtAppMainLoop,
1.4 bertrand 14: XtCreatePopupShell,
1.8 bertrand 15: XtCreateManagedWidget,
1.4 bertrand 16: XtCreateWidget,
17: XtDestroyWidget,
1.10 ! bertrand 18: XtOpenApplication,
1.4 bertrand 19: XtPopdown,
20: XtPopup,
1.6 bertrand 21: XtRealizeWidget,
22: XtRemoveCallback);
1.1 bertrand 23:
24: declareSubroutine(onLoading)
1.2 bertrand 25: notice(stdout, "\nMotif library V2R1 for RPL/2 (C) 2017 BERTRAND Joel\n");
1.1 bertrand 26: notice(stdout, "Motif library loaded.\n\n");
27:
28: // Création des variables spécifiques
29:
30: declareObject(variable);
31: declareObject(value);
32:
33: #define createVariable(var) createVariable2(var, var)
34: #define createVariable2(var, val) \
35: do { \
36: createNameObject(variable); \
37: setSymbolicName(variable, #var); \
38: createIntegerObject(value); \
39: setInteger(value, val); \
40: pushOnStack(variable); \
41: pushOnStack(value); \
42: intrinsic(over); \
43: intrinsic(save); \
44: intrinsic(parameter); \
45: } while(0)
46:
47: createVariable2(XmFalse, 0);
48: createVariable2(XmTrue, 1);
49:
50: createVariable(XmATTACH_NONE);
51: createVariable(XmATTACH_FORM);
52: createVariable(XmATTACH_OPPOSITE_FORM);
53: createVariable(XmATTACH_WIDGET);
54: createVariable(XmATTACH_OPPOSITE_WIDGET);
55: createVariable(XmATTACH_POSITION);
56: createVariable(XmATTACH_SELF);
57:
58: createVariable(XmALIGNMENT_BEGINNING);
59: createVariable(XmALIGNMENT_CENTER);
60: createVariable(XmALIGNMENT_END);
61:
62: createVariable(XmHORIZONTAL);
63: createVariable(XmVERTICAL);
64:
65: createVariable(XtGrabNone);
66: createVariable(XtGrabNonexclusive);
67: createVariable(XtGrabExclusive);
68:
69: createVariable(XmSTRING);
1.4 bertrand 70:
71: setFalse(initializationDone);
1.6 bertrand 72: nullify(lCallbacks);
1.1 bertrand 73: endSubroutine
74:
75: declareSubroutine(onClosing)
1.7 bertrand 76: // Destruction des variables spécifiques et des callbacks
1.1 bertrand 77: declareObject(variable);
1.6 bertrand 78: declareDaisyChain(current);
79: declareDaisyChain(next);
80:
81: current = lCallbacks;
82:
83: repeatWhile(not nullified(current))
1.7 bertrand 84: next = nextElementOfDaisyChain(current);
1.6 bertrand 85: variable = fetchElementFromDaisyChain(current);
86: freeObject(variable);
87: free(current);
88: current = next;
89: endWhile
90:
91: nullify(lCallbacks);
1.1 bertrand 92:
93: #define purgeVariable(var) \
94: do { \
95: createNameObject(variable); \
96: setName(variable, #var); \
97: pushOnStack(variable); \
98: intrinsic(dup); \
99: intrinsic(variable); \
100: intrinsic(purge); \
101: } while(0)
102:
103: purgeVariable(XmFalse);
104: purgeVariable(XmTrue);
105:
106: purgeVariable(XmATTACH_NONE);
107: purgeVariable(XmATTACH_FORM);
108: purgeVariable(XmATTACH_OPPOSITE_FORM);
109: purgeVariable(XmATTACH_WIDGET);
110: purgeVariable(XmATTACH_OPPOSITE_WIDGET);
111: purgeVariable(XmATTACH_POSITION);
112: purgeVariable(XmATTACH_SELF);
113:
114: purgeVariable(XmALIGNMENT_BEGINNING);
115: purgeVariable(XmALIGNMENT_CENTER);
116: purgeVariable(XmALIGNMENT_END);
117:
118: purgeVariable(XmHORIZONTAL);
119: purgeVariable(XmVERTICAL);
120:
121: purgeVariable(XtGrabNone);
122: purgeVariable(XtGrabNonexclusive);
123: purgeVariable(XtGrabExclusive);
124:
125: purgeVariable(XmSTRING);
126:
127: notice(stdout, "Motif library unloaded.\n\n");
128: endSubroutine
129:
130: // vim: ts=4
CVSweb interface <joel.bertrand@systella.fr>