/* TUIpeer works in conjunction with an implementation of java.awt.Toolkit to provide a Text User Interface for programs using the Java AWT. Copyright (C) 1997-2000 Stuart D. Gathman This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef REMOTEPEER_H #define REMOTEPEER_H #pragma interface #include "toolkit.h" // a Java toolkit Component Peer class RemotePeer { friend class Toolkit; // sets toolkit, compID; uses methodIDs protected: enum methodIDs { // these method ids are copied to/from Java RemotePeer DISABLE = 1, ENABLE = 2, HIDE = 3, SHOW = 4, NEXTFOCUS = 5, REQUESTFOCUS = 6, RESHAPE = 7, // IIII SETBACKGROUND = 8, // I SETFOREGROUND = 9, // I SETFONT = 10, // sII SETALIGNMENT = 12, // I SETTEXT = 13, // s GETSELECTEND = 14, // Ri GETSELECTBEG = 15, // Ri GETTEXT = 16, // Rs SELECT = 17, // II SETEDITABLE = 18, // I SETECHOCHAR = 19, // I ADDCHOICEITEM = 20, // s REPLACETEXT = 21, // sII TOBACK = 22, TOFRONT = 23, SETCURSOR = 24, // I (mouse cursor type) SETMENU = 25, // o SETRESIZABLE = 26, // I SETTITLE = 27, // s ADDCOMPONENT = 28, // o REPAINT = 29, // IIII SELECTCHOICE = 30, // I SETSTATE = 31, // I ADDLISTITEM = ADDCHOICEITEM, CLEARLIST = 32, DELITEMS = 33, // II DESELECT = 34, // I REMOVECHOICE = 35, // I MAKEVISIBLE = 36, // I SELECTLIST = SELECTCHOICE, SETMULTIPLE = 37, // I SCROLL_LINEINC = 38, // I SCROLL_PAGEINC = 39, // I SETVALUE = 40, // I SETVALUES = 41, // IIII KEYPRESS = 42, // II BEEP = 43, SETMODIFIED = 44, SCROLL_LINEDEC = 45, SCROLL_PAGEDEC = 46, SETCOLUMNS = 47, // I SETSCROLLBARS = 48, // I MOUSE_CLICK = 49, // I NEWFRAME = 100, // I NEWWINDOW = 101, // I SYNC = 102, NEWMENU = 103, // I NEWMENUITEM = 104, // I NEWMENUBAR = 105, // I RETSHORT = 106, // I SCREENSIZE = 107, // II NEWLABEL = 108, // I RETSTRING = 109, // s NEWTEXTAREA = 110, // I NEWTEXTFIELD = 111, // I NEWPANEL = 112, // I NEWBUTTON = 113, // I NEWCANVAS = 114, // I NEWCHOICE = 115, // I NEWLIST = 116, // I NEWCHECKBOX = 117, // I NEWCHECKMENUITEM = 118, // I NEWSCROLLPANE = 119,// I NEWDIALOG = 120, // I NEWFILEDIALOG = 121,// I NEWPOPUPMENU = 122, // I NEWHORZSCROLL = 123,// I NEWVERTSCROLL = 124,// I RETFONT = 125, // sII SETPARM = 126, // ab // MenuBar ADDHELPMENU = 200, // o ADDMENU = 201, // o DELMENU = 202, // I // MenuItem SETLABEL = SETTEXT, // s // Menu ADDITEM = 203, // o ADDSEP = 204, DELITEM = 205, // I MENUPICK = 206, SHOWPOPUP = 207, // oII // Programs RUNCLASS = 500, // s SETEXTENSION = 501, // s SETSCALE = 502, // II SHOWURL = 503, // s DISPOSE = 0 }; Toolkit *toolkit; short compID; // object ID RemotePeer(); void writeShort(int val) { toolkit->writeShort(val); } int readShort() { return toolkit->readShort(); } class string readUTF(); virtual void remoteMethod(int cmd) = 0; virtual ~RemotePeer(); }; #endif