1 typedef struct Pop Pop; 2 typedef struct Iop Iop; 3 typedef struct IPoint IPoint; 4 typedef struct IRectangle IRectangle; 5 typedef struct Plugin Plugin; 6 7 enum { 8 // messages from Plugin to Inferno 9 Pgfxkey, 10 Pmouse, 11 12 // message from Inferno to Plugin 13 Iattachscr, 14 Iflushscr, 15 Isetcur, 16 Idrawcur, 17 Iquit, 18 }; 19 20 struct Pop { 21 int op; 22 union { 23 int key; // Pgfxkey 24 struct { 25 int x; 26 int y; 27 int b; 28 int modify; 29 } m; // Pmouse 30 } u; 31 }; 32 33 struct IPoint 34 { 35 LONG x; 36 LONG y; 37 }; 38 39 struct IRectangle 40 { 41 IPoint min; 42 IPoint max; 43 }; 44 45 struct Iop { 46 int op; 47 int val; 48 union { 49 IRectangle r; // Iflushscr 50 // need additional support for Isetcur & Idrawcur 51 } u; 52 }; 53 #define PI_NCLOSE 2 54 55 struct Plugin { 56 LONG sz; // size of this data struct (including screen mem) 57 HANDLE conin; // console input (from plugin) - never NULL 58 HANDLE conout; // console output (to plugin) - can be NULL 59 HANDLE datain; // #C data file for initialisation (HACK!) 60 HANDLE dopop; // new Pop available 61 HANDLE popdone; // acknowledgement of Pop 62 HANDLE doiop; // new Iop available 63 HANDLE iopdone; // acknowledgement of Iop 64 HANDLE closehandles[PI_NCLOSE]; 65 Pop pop; 66 Iop iop; 67 int Xsize; // screen dimensions 68 int Ysize; 69 ULONG cdesc; // display chans descriptor 70 int cflag; 71 ULONG screen[1]; 72 }; 73 74 #define IOP (plugin->iop) 75 #define POP (plugin->pop) 76