home *** CD-ROM | disk | FTP | other *** search
- /* wwrap.c generated from wwrap.psw
- by unix pswrap V1.009 Wed Apr 19 17:50:24 PDT 1989
- */
-
- #include <dpsclient/dpsfriends.h>
- #include <string.h>
-
- #line 1 "wwrap.psw"
- /*
- * Winfo
- * by Paul S. Kleppner
- *
- * This program may be freely distributed, but not sold.
- * It is provided without warranty of any kind, expressed or
- * implied, as to its fitness for any particular use.
- */
-
- /*
- * This file contains DPS wrappers for a number of
- * functions which deal with windows. We have to write our
- * own wrappers because we are dealing with true DPS window numbers
- * as known by the window server. The appkit, and the standard wrappers,
- * seem to use "logical" window numbers which are local to each app.
- */
-
- // Look up the window at the given location; returns its
- // number, and whether or not one was found.
- #line 29 "wwrap.c"
- void myFindWindow(float x, float y, int where, int initWin, float *lx, float *ly, int *winFound, int *didFind)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjReal obj0;
- DPSBinObjReal obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- DPSBinObjGeneric obj4;
- DPSBinObjGeneric obj5;
- DPSBinObjGeneric obj6;
- DPSBinObjGeneric obj7;
- DPSBinObjGeneric obj8;
- DPSBinObjGeneric obj9;
- DPSBinObjGeneric obj10;
- DPSBinObjGeneric obj11;
- DPSBinObjGeneric obj12;
- DPSBinObjGeneric obj13;
- DPSBinObjGeneric obj14;
- DPSBinObjGeneric obj15;
- DPSBinObjGeneric obj16;
- char obj17[10];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 17, 150,
- {DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: x */
- {DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: y */
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: where */
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: initWin */
- {DPS_EXEC|DPS_NAME, 0, 10, 136}, /* findwindow */
- {DPS_LITERAL|DPS_INT, 0, 0, 3},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 2},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 1},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_LITERAL|DPS_INT, 0, 0, 4},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70}, /* flush */
- {'f','i','n','d','w','i','n','d','o','w'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- DPSResultsRec _dpsR[4];
- static const DPSResultsRec _dpsRstat[] = {
- { dps_tFloat, -1 },
- { dps_tFloat, -1 },
- { dps_tInt, -1 },
- { dps_tBoolean, -1 },
- };
- _dpsR[0] = _dpsRstat[0];
- _dpsR[0].value = (char *)lx;
- _dpsR[1] = _dpsRstat[1];
- _dpsR[1].value = (char *)ly;
- _dpsR[2] = _dpsRstat[2];
- _dpsR[2].value = (char *)winFound;
- _dpsR[3] = _dpsRstat[3];
- _dpsR[3].value = (char *)didFind;
-
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.realVal = x;
- _dpsP[1].val.realVal = y;
- _dpsP[2].val.integerVal = where;
- _dpsP[3].val.integerVal = initWin;
- DPSSetResultTable(_dpsCurCtxt, _dpsR, 4);
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,150);
- DPSAwaitReturnValues(_dpsCurCtxt);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 25 "wwrap.psw"
-
-
- // Return alpha value for current window
- #line 112 "wwrap.c"
- void myCurrentWindowAlpha(int win, int *alpha)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- DPSBinObjGeneric obj4;
- DPSBinObjGeneric obj5;
- DPSBinObjGeneric obj6;
- DPSBinObjGeneric obj7;
- char obj8[18];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 8, 86,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: win */
- {DPS_EXEC|DPS_NAME, 0, 18, 64}, /* currentwindowalpha */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_LITERAL|DPS_INT, 0, 0, 1},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70}, /* flush */
- {'c','u','r','r','e','n','t','w','i','n','d','o','w','a','l','p','h','a'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- DPSResultsRec _dpsR[1];
- static const DPSResultsRec _dpsRstat[] = {
- { dps_tInt, -1 },
- };
- _dpsR[0] = _dpsRstat[0];
- _dpsR[0].value = (char *)alpha;
-
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = win;
- DPSSetResultTable(_dpsCurCtxt, _dpsR, 1);
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,86);
- DPSAwaitReturnValues(_dpsCurCtxt);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 30 "wwrap.psw"
-
-
- // Return bounds of current window
- #line 165 "wwrap.c"
- void myCurrentWindowBounds(int win, float *x, float *y, float *w, float *h)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- DPSBinObjGeneric obj4;
- DPSBinObjGeneric obj5;
- DPSBinObjGeneric obj6;
- DPSBinObjGeneric obj7;
- DPSBinObjGeneric obj8;
- DPSBinObjGeneric obj9;
- DPSBinObjGeneric obj10;
- DPSBinObjGeneric obj11;
- DPSBinObjGeneric obj12;
- DPSBinObjGeneric obj13;
- char obj14[19];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 14, 135,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: win */
- {DPS_EXEC|DPS_NAME, 0, 19, 112}, /* currentwindowbounds */
- {DPS_LITERAL|DPS_INT, 0, 0, 3},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 2},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 1},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_LITERAL|DPS_INT, 0, 0, 4},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70}, /* flush */
- {'c','u','r','r','e','n','t','w','i','n','d','o','w','b','o','u','n','d','s'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- DPSResultsRec _dpsR[4];
- static const DPSResultsRec _dpsRstat[] = {
- { dps_tFloat, -1 },
- { dps_tFloat, -1 },
- { dps_tFloat, -1 },
- { dps_tFloat, -1 },
- };
- _dpsR[0] = _dpsRstat[0];
- _dpsR[0].value = (char *)x;
- _dpsR[1] = _dpsRstat[1];
- _dpsR[1].value = (char *)y;
- _dpsR[2] = _dpsRstat[2];
- _dpsR[2].value = (char *)w;
- _dpsR[3] = _dpsRstat[3];
- _dpsR[3].value = (char *)h;
-
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = win;
- DPSSetResultTable(_dpsCurCtxt, _dpsR, 4);
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,135);
- DPSAwaitReturnValues(_dpsCurCtxt);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 36 "wwrap.psw"
-
-
-
- // Return depth of current window
- #line 240 "wwrap.c"
- void myCurrentWindowDepth(int win, int *depth)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- DPSBinObjGeneric obj4;
- DPSBinObjGeneric obj5;
- DPSBinObjGeneric obj6;
- DPSBinObjGeneric obj7;
- char obj8[18];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 8, 86,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: win */
- {DPS_EXEC|DPS_NAME, 0, 18, 64}, /* currentwindowdepth */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_LITERAL|DPS_INT, 0, 0, 1},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70}, /* flush */
- {'c','u','r','r','e','n','t','w','i','n','d','o','w','d','e','p','t','h'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- DPSResultsRec _dpsR[1];
- static const DPSResultsRec _dpsRstat[] = {
- { dps_tInt, -1 },
- };
- _dpsR[0] = _dpsRstat[0];
- _dpsR[0].value = (char *)depth;
-
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = win;
- DPSSetResultTable(_dpsCurCtxt, _dpsR, 1);
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,86);
- DPSAwaitReturnValues(_dpsCurCtxt);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 42 "wwrap.psw"
-
-
- // Returns owner (i.e. context value) for current window
- #line 293 "wwrap.c"
- void myCurrentOwner(int win, int *context)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- DPSBinObjGeneric obj4;
- DPSBinObjGeneric obj5;
- DPSBinObjGeneric obj6;
- DPSBinObjGeneric obj7;
- char obj8[12];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 8, 80,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: win */
- {DPS_EXEC|DPS_NAME, 0, 12, 64}, /* currentowner */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_LITERAL|DPS_INT, 0, 0, 1},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70}, /* flush */
- {'c','u','r','r','e','n','t','o','w','n','e','r'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- DPSResultsRec _dpsR[1];
- static const DPSResultsRec _dpsRstat[] = {
- { dps_tInt, -1 },
- };
- _dpsR[0] = _dpsRstat[0];
- _dpsR[0].value = (char *)context;
-
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = win;
- DPSSetResultTable(_dpsCurCtxt, _dpsR, 1);
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,80);
- DPSAwaitReturnValues(_dpsCurCtxt);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 47 "wwrap.psw"
-
-
- // Sets level of current window
- #line 346 "wwrap.c"
- void mySetCurrentWindowLevel(int level)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- char obj3[14];
- char obj4[13];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 3, 55,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: level */
- {DPS_EXEC|DPS_NAME, 0, 13, 38}, /* currentwindow */
- {DPS_EXEC|DPS_NAME, 0, 14, 24}, /* setwindowlevel */
- {'s','e','t','w','i','n','d','o','w','l','e','v','e','l'},
- {'c','u','r','r','e','n','t','w','i','n','d','o','w'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = level;
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,55);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 52 "wwrap.psw"
-
-
- // Returns level of current window
- #line 382 "wwrap.c"
- void myCurrentWindowLevel(int win, int *level)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- DPSBinObjGeneric obj4;
- DPSBinObjGeneric obj5;
- DPSBinObjGeneric obj6;
- DPSBinObjGeneric obj7;
- char obj8[12];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 8, 80,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: win */
- {DPS_EXEC|DPS_NAME, 0, 12, 64}, /* currentowner */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_LITERAL|DPS_INT, 0, 0, 0},
- {DPS_LITERAL|DPS_INT, 0, 0, 1},
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119}, /* printobject */
- {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70}, /* flush */
- {'c','u','r','r','e','n','t','o','w','n','e','r'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- DPSResultsRec _dpsR[1];
- static const DPSResultsRec _dpsRstat[] = {
- { dps_tInt, -1 },
- };
- _dpsR[0] = _dpsRstat[0];
- _dpsR[0].value = (char *)level;
-
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = win;
- DPSSetResultTable(_dpsCurCtxt, _dpsR, 1);
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,80);
- DPSAwaitReturnValues(_dpsCurCtxt);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 57 "wwrap.psw"
-
-
- // Orders given window on the screen list
- #line 435 "wwrap.c"
- void myOrderWindow(int place, int otherwin, int win)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- char obj4[11];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 4, 47,
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: place */
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: otherwin */
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: win */
- {DPS_EXEC|DPS_NAME, 0, 11, 32}, /* orderwindow */
- {'o','r','d','e','r','w','i','n','d','o','w'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[0].val.integerVal = place;
- _dpsP[1].val.integerVal = otherwin;
- _dpsP[2].val.integerVal = win;
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,47);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 62 "wwrap.psw"
-
-
-
- // Fills window w2 with contents of all windows below level of w1
- #line 474 "wwrap.c"
- void fillBelowWin(int w1, int w2)
- {
- typedef struct {
- unsigned char tokenType;
- unsigned char topLevelCount;
- unsigned short nBytes;
-
- DPSBinObjGeneric obj0;
- DPSBinObjGeneric obj1;
- DPSBinObjGeneric obj2;
- DPSBinObjGeneric obj3;
- char obj4[10];
- char obj5[5];
- } _dpsQ;
- static const _dpsQ _dpsStat = {
- DPS_DEF_TOKENTYPE, 4, 51,
- {DPS_EXEC|DPS_NAME, 0, 5, 42}, /* Below */
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: w1 */
- {DPS_LITERAL|DPS_INT, 0, 0, 0}, /* param: w2 */
- {DPS_EXEC|DPS_NAME, 0, 10, 32}, /* fillwindow */
- {'f','i','l','l','w','i','n','d','o','w'},
- {'B','e','l','o','w'},
- }; /* _dpsQ */
- _dpsQ _dpsF; /* local copy */
- register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
- char pad[3];
- register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
- _dpsF = _dpsStat; /* assign automatic variable */
-
- _dpsP[1].val.integerVal = w1;
- _dpsP[2].val.integerVal = w2;
- DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,51);
- if (0) *pad = 0; /* quiets compiler warnings */
- }
- #line 68 "wwrap.psw"
-
-