--- rpl/modules/motif/types.rplc 2017/07/12 15:42:23 1.3 +++ rpl/modules/motif/types.rplc 2017/07/30 21:59:41 1.6 @@ -8,36 +8,47 @@ declareTypeExtension(dup) oObject = (*((structObject **) arg)); - if (nullified(nObject = allocation(s_etat_processus, EXT))) + if (subType(oObject) == APPCONTEXT) { - typeSystemError; - } + if (nullified(nObject = allocation(s_etat_processus, EXT))) + { + typeSystemError; + } - initializeObject(nObject, oObject); + initializeObject(nObject, oObject); - if (subType(oObject) == APPCONTEXT) - { - if (nullified(objectContainer(nObject) = + if (nullified(objectOf(nObject) = malloc(sizeof(XtAppContext)))) { typeSystemError; } - target((sXtAppContext *) objectContainer(nObject)).widget = - target((sXtAppContext *) objectContainer(oObject)).widget; - target((sXtAppContext *) objectContainer(nObject)).context = - target((sXtAppContext *) objectContainer(oObject)).context; + target(objectContainer(sXtAppContext, nObject)).widget = + target(objectContainer(sXtAppContext, oObject)).widget; + target(objectContainer(sXtAppContext, nObject)).context = + target(objectContainer(sXtAppContext, oObject)).context; + } + else if (subType(oObject) == CALLBACK) + { + typeError; } else if (subType(oObject) == WIDGET) { - if (nullified(objectContainer(nObject) = + if (nullified(nObject = allocation(s_etat_processus, EXT))) + { + typeSystemError; + } + + initializeObject(nObject, oObject); + + if (nullified(objectOf(nObject) = malloc(sizeof(sXtAppContext)))) { typeSystemError; } - target((Widget *) objectContainer(nObject)) = - target((Widget *) objectContainer(oObject)); + target(objectContainer(Widget, nObject)) = + target(objectContainer(Widget, oObject)); } else { @@ -55,11 +66,15 @@ declareTypeExtension(drop) if (subType(oObject) == APPCONTEXT) { - free(objectContainer(oObject)); + free(objectOf(oObject)); + } + else if (subType(oObject) == CALLBACK) + { + free(objectOf(oObject)); } else if (subType(oObject) == WIDGET) { - free(objectContainer(oObject)); + free(objectOf(oObject)); } else { @@ -84,7 +99,17 @@ declareTypeExtension(disp) } sprintf(s, "XtAppContext $ %016llX", - (long long unsigned int) objectContainer(oObject)); + (long long unsigned int) objectOf(oObject)); + } + else if (subType(oObject) == CALLBACK) + { + if ((s = malloc(28 * sizeof(unsigned char))) == NULL) + { + typeSystemError; + } + + sprintf(s, "Callback $ %016llX", + (long long unsigned int) objectOf(oObject)); } else if (subType(oObject) == WIDGET) { @@ -94,7 +119,7 @@ declareTypeExtension(disp) } sprintf(s, "Widget $ %016llX", - (long long unsigned int) objectContainer(oObject)); + (long long unsigned int) objectOf(oObject)); } else {