Annotation of rpl/modules/motif/XtAppMainLoop.rplc, revision 1.3

1.1       bertrand    1: #include "src/rplexternals.h"
                      2: #include "motif.h"
                      3: 
                      4: declareExternalFunction(XtAppMainLoop)
                      5:    XEvent      event;
                      6: 
                      7:    declareObject(appObject);
                      8: 
                      9:    HEADER
                     10:        declareHelpString("Main loop of a Motif application\n"
                     11:                "    1: AppContext\n");
                     12:        numberOfArguments(1);
                     13:    FUNCTION
                     14:        if (initializationDone eq true) then
                     15:            pullFromStack(appObject, external);
                     16:            returnOnError(freeObject(appObject));
                     17: 
1.3     ! bertrand   18:            ifIsExternal(appObject, APPCONTEXT) then
        !            19:            orElse
1.1       bertrand   20:                executionError("Type mismatch");
                     21:                returnOnError(freeObject(appObject));
                     22:            endIf
                     23: 
1.3     ! bertrand   24:            intrinsic(pshcntxt);
        !            25: 
1.1       bertrand   26:            doUntil
                     27:                if (XtAppPending(target((sXtAppContext *)
                     28:                        objectContainer(appObject)).context) ne 0) then
                     29:                    XtAppNextEvent(target((sXtAppContext *)
                     30:                            objectContainer(appObject)).context, &event);
                     31: 
                     32:                    if (event.type eq DestroyNotify) then
                     33:                        if (event.xdestroywindow.window eq
                     34:                                XtWindow(target((sXtAppContext *)
                     35:                                objectContainer(appObject)).widget)) then
                     36:                            XtAppSetExitFlag(target((sXtAppContext *)
                     37:                                    objectContainer(appObject)).context);
                     38:                        endIf
                     39:                    endIf
                     40: 
                     41:                    XtDispatchEvent(&event);
                     42:                orElse
                     43:                    pollSignalsAndInterrupts();
                     44:                    usleep(10000);
                     45:                endIf
                     46:            repeatUntil(XtAppGetExitFlag(target((sXtAppContext *)
                     47:                    objectContainer(appObject)).context) or
                     48:                    (stopRequest eq -1) or
                     49:                    (exitMainLoop ne 0))
                     50: 
1.3     ! bertrand   51:            intrinsic(pulcntxt);
        !            52: 
1.1       bertrand   53:            XtDestroyApplicationContext(target((sXtAppContext *)
                     54:                    objectContainer(appObject)).context);
                     55:        orElse
                     56:            executionError("Application not initialized");
                     57:            returnOnError();
                     58:        endIf
                     59: 
                     60:        setFalse(initializationDone);
                     61:    END
                     62: endExternalFunction
1.2       bertrand   63: 
                     64: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>