Annotation of rpl/modules/motif/types.rplc, revision 1.6

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: 
1.6     ! bertrand   20:        if (nullified(objectOf(nObject) =
1.1       bertrand   21:                malloc(sizeof(XtAppContext))))
                     22:        {
                     23:            typeSystemError;
                     24:        }
                     25: 
1.6     ! bertrand   26:        target(objectContainer(sXtAppContext, nObject)).widget =
        !            27:                target(objectContainer(sXtAppContext, oObject)).widget;
        !            28:        target(objectContainer(sXtAppContext, nObject)).context =
        !            29:                target(objectContainer(sXtAppContext, oObject)).context;
1.1       bertrand   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.6     ! bertrand   44:        if (nullified(objectOf(nObject) =
1.1       bertrand   45:                malloc(sizeof(sXtAppContext))))
                     46:        {
                     47:            typeSystemError;
                     48:        }
                     49: 
1.6     ! bertrand   50:        target(objectContainer(Widget, nObject)) =
        !            51:                target(objectContainer(Widget, oObject));
1.1       bertrand   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:    {
1.6     ! bertrand   69:        free(objectOf(oObject));
1.1       bertrand   70:    }
1.4       bertrand   71:    else if (subType(oObject) == CALLBACK)
                     72:    {
1.6     ! bertrand   73:        free(objectOf(oObject));
1.4       bertrand   74:    }
1.1       bertrand   75:    else if (subType(oObject) == WIDGET)
                     76:    {
1.6     ! bertrand   77:        free(objectOf(oObject));
1.1       bertrand   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",
1.6     ! bertrand  102:                (long long unsigned int) objectOf(oObject));
1.1       bertrand  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",
1.6     ! bertrand  112:                (long long unsigned int) objectOf(oObject));
1.4       bertrand  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",
1.6     ! bertrand  122:                (long long unsigned int) objectOf(oObject));
1.1       bertrand  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>