Annotation of rpl/modules/motif/types.rplc, revision 1.5
1.1 bertrand 1: #define TYPE_DECLARATION
2: #include "src/rplexternals.h"
3: #include "motif.h"
4:
5: declareTypeExtension(dup)
6: declareObject(nObject);
7: declareObject(oObject);
8:
9: oObject = (*((structObject **) arg));
10:
1.4 bertrand 11: if (subType(oObject) == APPCONTEXT)
1.1 bertrand 12: {
1.4 bertrand 13: if (nullified(nObject = allocation(s_etat_processus, EXT)))
14: {
15: typeSystemError;
16: }
1.1 bertrand 17:
1.4 bertrand 18: initializeObject(nObject, oObject);
1.1 bertrand 19:
20: if (nullified(objectContainer(nObject) =
21: malloc(sizeof(XtAppContext))))
22: {
23: typeSystemError;
24: }
25:
26: target((sXtAppContext *) objectContainer(nObject)).widget =
27: target((sXtAppContext *) objectContainer(oObject)).widget;
28: target((sXtAppContext *) objectContainer(nObject)).context =
29: target((sXtAppContext *) objectContainer(oObject)).context;
30: }
1.4 bertrand 31: else if (subType(oObject) == CALLBACK)
32: {
33: typeError;
34: }
1.1 bertrand 35: else if (subType(oObject) == WIDGET)
36: {
1.4 bertrand 37: if (nullified(nObject = allocation(s_etat_processus, EXT)))
38: {
39: typeSystemError;
40: }
41:
42: initializeObject(nObject, oObject);
43:
1.1 bertrand 44: if (nullified(objectContainer(nObject) =
45: malloc(sizeof(sXtAppContext))))
46: {
47: typeSystemError;
48: }
49:
50: target((Widget *) objectContainer(nObject)) =
51: target((Widget *) objectContainer(oObject));
52: }
53: else
54: {
55: typeError;
56: }
57:
1.3 bertrand 58: target((struct_objet **) arg) = nObject;
1.1 bertrand 59: typeSuccess;
60: endTypeExtension
61:
62: declareTypeExtension(drop)
63: declareObject(oObject);
64:
65: oObject = (*((structObject **) arg));
66:
67: if (subType(oObject) == APPCONTEXT)
68: {
69: free(objectContainer(oObject));
70: }
1.4 bertrand 71: else if (subType(oObject) == CALLBACK)
72: {
73: free(objectContainer(oObject));
74: }
1.1 bertrand 75: else if (subType(oObject) == WIDGET)
76: {
77: free(objectContainer(oObject));
78: }
79: else
80: {
81: typeError;
82: }
83:
84: typeSuccess;
85: endTypeExtension
86:
87: declareTypeExtension(disp)
88: declareObject(oObject);
89:
90: string s;
91:
92: oObject = (*((structObject **) arg));
93:
94: if (subType(oObject) == APPCONTEXT)
95: {
96: if ((s = malloc(32 * sizeof(unsigned char))) == NULL)
97: {
98: typeSystemError;
99: }
100:
101: sprintf(s, "XtAppContext $ %016llX",
102: (long long unsigned int) objectContainer(oObject));
103: }
1.4 bertrand 104: else if (subType(oObject) == CALLBACK)
105: {
106: if ((s = malloc(28 * sizeof(unsigned char))) == NULL)
107: {
108: typeSystemError;
109: }
110:
111: sprintf(s, "Callback $ %016llX",
112: (long long unsigned int) objectContainer(oObject));
113: }
1.1 bertrand 114: else if (subType(oObject) == WIDGET)
115: {
116: if ((s = malloc(26 * sizeof(unsigned char))) == NULL)
117: {
118: typeSystemError;
119: }
120:
121: sprintf(s, "Widget $ %016llX",
122: (long long unsigned int) objectContainer(oObject));
123: }
124: else
125: {
126: typeSystemError;
127: }
128:
129: (*arg) = s;
130: typeSuccess;
131: endTypeExtension
132:
133: // vim: ts=4
CVSweb interface <joel.bertrand@systella.fr>