Home
GROUPKIT USER'S GUIDE
Contents
1. const char ask Window win const char prompt const char init Pop up a dialog box over the indicated window displaying a prompt and asking the user to input a string which starts out as the value of the init parameter Return the input string or nil if the user hit Cancel int confirm Window win const char prompt Pop up a dialog box over the indicated window displaying a prompt and asking the user to press Yes No or Cancel Return 1 2 or 3 respectively void report Window win const char prompt Pop up a dialog box over the indicated window displaying the prompt and asking the user to press OK Usage example dlgmgr new DialogManager char s if s char dlgmgr gt choose win Pick a file c nil open up s and process if s char dlgmgr gt ask win Name Mark Roseman nil do something with s if dlgmgr gt confirm win Delete all files 1 delete the files dlgmgr gt report win Operation completed Notes This class is copied from the InterViews sample application Doc Groupkit Reference Manual 3 2 93 Page 31 REGISTRATION Facilities are provided in GroupKit to allow users to create join leave and destroy conferences This registration system is decoupled from the conference applications using it allowing the same registration system to be used for all conference ap
2. A WRITER allows sending messages across a socket connection Synopsis Hinclude lt gk writer h gt Writer const char host int port Create a WRITER which will initiate a socket connection to the given machine at the given port number Writer int fd Writer rpcstream server Create a WRITER which accepts a socket connection initiated by a remote host void sendMsg int message type char option string Send a message across the socket connection Predefined message types can be found in groupkit h O E i ere el CLASS CALLBACKRPCREADER CATEGORY COMMUNICATIONS SUPERCLASS RPCREADER A CALLBACKRPCREADER receives socket messages and calls a user specified routine Synopsis include lt gk reader h gt CallbackRpcReader rpcstream server ReaderCallbackTable callbacks nil int id 1 RpcAction close nil CallbackRpcReader int fd ReaderCallbackTable callbacks nil int id 1 RpcAction close nil Create a CALLBACKRPCREADER based upon either an existing file descriptor or RPCSTREAM Typically the RPCSTREAM Is Obtained from WRITER SERVER A previously created table of callbacks for different message types may be specified to permit sharing or by default a new table will be created An id number may optionally be specified which is available for client use Finally a callback can be specified which will be activated if the socket connection is closed down void registerCallback StrActi
3. 1 ReaderCallbackTable callbacks nil int info message type ConnAction info action InfoConnection int fd int id 1 ReaderCallbackTable callbacks nil int info message type ConnAction info action InfoConnection rpcstream server int id 1 ReaderCallbackTable callbacks nil int info message type ConnAction info action Create an INFOCONNECTION either connecting to a specified host and port or accepting a connection from a file descriptor or rpcstream An id number may optionally be specified which is available for client use A previously created table of callbacks for different message types may be specified to permit sharing or by default a new table will be created The message type of an initialization message should be specified along with a callback to be activated when the message type is received over the socket Notes INFOCONNECTIONS are used extensively in GroupKit because CONNECTIONS are typically accessed by their id number specifying the id of a remote user in a CONNECTIONLIST Those id numbers are not initialized when the socket is first created so therefore they could not be easily accessed By passing information in these initialization messages a callback routine can interpret that information and set appropriate fields in the CONNECTION Object which is passed as a parameter to the callback routine CLASS INFOCONNECTIONLIST CATEGORY COMMUNICATIONS SUPERCLASS CONNECTIONLIST An I
4. name msg gt field s attrs gt remove id patch gt redraw 3 2 93 Page 14 Defining New Registration Methods Why Define New Registration Methods Creating a New Registration Semantics Coding the Registrar Client GroupKit Tutorial Different groups will work in different ways Its important that the software allow the group to work in ways that are natural for them One of the things that varies from group to group is how users are allowed to create enter and leave conferences For example some groups may have meetings where anyone is allowed to join conferences Others may have meetings where new users can join only if they are on a specific list or are approved by a user already in the conference GroupKit allows developers to define new registration methods using its open protocols feature for more details see the CSCW paper This section briefly describes the process a developer would go through in order to create a new registration method The distribution includes three registrar clients supporting three different registration methods The first is the startup client seen earlier which provides an open registration policy where any user can join any conference The second is a master client src examples reg master which is suitable for use by a facilitator in a strictly facilitated conference controls what applications other users will see Finally a s
5. for example a brainstorming tool used in the facilitated conference 3 2 93 Page 15 Master join user int confnum int usernum char s 80 AttrListTable fc usrs AttributeList user first find the user in the overall facilitated conference so we can use their host and port number etc users tbl gt find fc usrs confnum_ fc usrs gt find user usernum copy the attribute list but change the conference number from that of the facilitated conference to that of the subconference e g brainstorming tool sprintf s d confnum user gt attribute confnum s now send the new user message to the registrar callJoinConference user The slave registrar client would receive a new user message from the registrar and might handle it as follows void Slave foundNewUser AttributeList al char conf 80 usernum 80 hostname 80 port 80 hostnm 80 portnm 80 AttrListTable usrs AttributeList conf_al extract info from attribute list and insert the new user into the users tbl for the conference al gt find attribute confnum conf al gt find attribute usernum usernum al gt find attribute host hostname al gt find attribute port port if users tbl gt find usrs atoi conf usrs gt insert atoi usernum al check if we re the user if stremp hostname GroupSession host name 0 atoi
6. gt find_attribute usernum id al gt find_attribute username name users_ gt Append name lines_ gt insert users_ gt Count 1 atoi id attrs_ gt insert atoi id al sprintf s s has entered name msg_ gt field s patch gt redraw The selectUser routine is called when the user clicks on one of the conference users in the top browser It displays the attribute list for the selected user in the lower browser void UserMonitor selectUser 1 AttributeList al int id char s 100 info gt Clear if users gt selected gt 0 if lines gt find id users gt selected if attrs gt find al id for ListItr AVPairList i al gt list i more i next sprintt s s s i cur gt attr i cur gt val info gt Append s patch_ gt redraw As users leave the conference the userLeaving routine is called passing the id number of the user as a parameter The UserMonitor updates the two internal tables not shown here deletes the user from the string browser and writes a message saying the user has left void UserMonitor userLeaving int id char s 80 name 80 AttributeList al int line update the tables and set line to be the line in the browser the user name was on users_ gt remove line if attrs_ gt find al id al gt find_attribute username name sporintti s ts has lett
7. gt style confer sesslon gt style confer ja Notes The following resources shown here with default values are currently used CursorOverlay foreground black color of bitmap cursors CursorOverlay localBitmapCursor off display bitmap cursor for local user CursorOverlay localRealCursor on use the X cursor for local user The CursorOverlay will eventually use the following resources to specify its behavior CursorOverlay bitmap cursor bit bitmap used for cursors CursorOverlay annotate WithNames off display user s name under bitmap Groupkit Reference Manual 3 2 93 Page 16 CONFERENCE SUPPORT GroupKit applications are called conferences Facilities are provided in GroupKit to minimize the work needed to maintain conferences The center of this is the CONFERENCE object It provides facilities for e accepting new users into the conference e maintaining a list of users in the conference e sending messages to one or more users in the conference setting up callbacks for messages received notifying other objects when users enter or leave the conference Much of the application specific functionality tends to reside in the user interface portions of the application in CONFERENCEGLYPHS These glyphs will use the facilities provided by the CoNFERENCE object for their communications needs If these glyphs need to know about users entering or leaving the conference they can be subclassed f
8. Monitoring the User List Monitoring GroupKit allows objects such as a ConferenceGlyph subclass to be notified when users enter or leave the conference This is handy for maintaining data structures for each conference user This section describes how to do this using the example of a glyph which simply monitors the users in a conference displaying who is currently in the conference and information about each users Various details particularly to do with updating data structures will be omitted here for the sake of clarity A complete listing of the program is available in Appendix A A UserMonitor class is defined which is a subclass of both ConferenceGlyph and also ConferenceMonitor ConferenceMonitor is a Groupkit Tutorial 3 2 93 Page 12 New Users Groupkit Tutorial virtual class which can be notified about users entering or leaving a conference class UserMonitor public ConferenceMonitor public ConferenceGlyph public UserMonitor WidgetKit Conference virtual void newUser AttributeList virtual void userLeaving int id various glyphs for the display a The constructor defines the interface in this case a message field giving the last person who entered or left the conference a string browser with the list of users and a string browser giving information all available attributes for the user selected in the top browser Two tables are used one to hold the attribute lists for each u
9. RA E ARA K void UserMonitor newUser AttributeList al char id 80 name 80 s 80 al gt find_attribute usernum id al gt find attribute username name users gt Append name lines gt insert users gt Count 1 atoi id attrs_ gt insert atol id al sprintf s s has entered name msg_ gt field s patch_ gt redraw RRR KKK RRR RE KERR RK RRR KK RK KKK RK ER EKA KK KKK KEKE KKK KARARRKK KKK KK RR KK RR KK a user is leaving remove them from the users browser and place a message in the static text field have to muck with the table so that every user who was below the removed one gets moved up a line K ER EEEE EERE EL AA PA O A OP void UserMonitor userLeaving int id char s 80 name 80 AttributeList al int line IntTable tbl for TablelIterator IntTable j lines j more j next if j cur value id line j cur kev fprintf stderr line is d n line tbl new IntTable 20 for TablelIterator IntTable i lines i more i next if i eur key gt gt line tbl gt insert i cur key 1 i cur_value else if i cur_key lt line tbl gt insert i cur key i cur value delete lines lines tbl users gt remove line if attrs_ gt find al id al gt find attribute username name sprintf s s has left name msg_ gt field s attrs_ gt remove id patch gt redraw Gro
10. SAAS SSL EEA ES SSAA ES Ae AKC void DeckFlip flip GlyphIndex cur char s 10 real_flip cur Sprintt s td cur conference gt connections gt toAll new StrMsgSender DEMOCALLBACK s RRR RK KK KK RK RK RR KR KR KKK KKK KKK KKK KKK KKK KKK KK RK KR RK RK KKK KAKA KK RK EK K KKK RK EEK change glyph to appropriate card RRR RK RR RRR KR RR RR KK RR RR KERR RRR ERR KK RRR RRR KER KERR KERR RK RRR RR RK KR RK RK void DeckFlip real flip GlyphIndex cur deck_ gt flip_to cur patch_ gt redraw RRR R KKK KKK RK RRR KEKE KKK KAR KR RK KK KKK KK KKK KK KAR K KKK RK KKK KR KE KARR RR RK RR KK Groupkit Tutorial 3 2 93 Page 18 remote user changed the card P A o p oP eb vold DeckFlip remoteFlip char s int which sscanf s d amp which real flip which DeckEg c Main Program Kinclude lt gk groupsession h gt include lt InterViews window h gt include lt stdio h gt include deckflip h int main int argc char argv GroupSession session new GroupSession DeckFlip arge argv sesslon gt run window new ApplicationWindow new DeckFlip session gt style session gt conference UserMonitor Program UserMon h Header file for conference glyph 1ifndef _ usermon h define __usermon_h Hinclude lt gk confmonitor h gt Hinclude lt gk confglyph h gt class UserMonitor public ConferenceMonitor public ConferenceGlyph public UserM
11. descriptor to be passed to the callback routine Usage example class App various routines void App closing CallbackRpcReader int fd Clean up socket Ja declareRpcActionCallback App implementRpcActionCallback App App myapp new App conn gt reader gt closeCallback new RpcActionCallback App myapp amp App close Notes RPCACTIONS are typically used in GroupKit to trap closed socket connections A CONNECTIONLIST for example uses an RPCACTION so that when one of its sockets closes it can find it and remove it from the list Groupkit Reference Manual 3 2 93 Page 11 GRAPHICS AND OVERLAYS GroupKit relies on the InterViews glyph mechanism as a base for its user interfaces Glyphs are lightweight objects composed using a TeX boxes and glue strategy Several GroupKit glyphs are defined CONFERENCEGLYPH is the primary building block for GroupKit user interfaces referencing a Conference object so that its methods can send and receive messages OVERLAY is a base class allowing the construction of glyphs which overlay other ConferenceGlyphs SKETCHPAD is an overlay which allows multi user bitmap sketching or annotation on top of other glyphs CURSOROVERLAY is an overlay which allows gesturing via multiple cursors on top of other glyphs Groupkit Reference Manual 3 2 93 Page 12 CLASS CONFERENCEGLYPH CATEGORY GRAPHICS AND OVERLAYS SUPERCLASS ACTIVEHANDLER A CONFERENCEGLYPH is a GLYPH c
12. gt connections gt toAll new StrMsgSender SETCURVALUE s Groupkit Reference Manual 3 2 93 Page 4 O ne et CLASS CONNECTION CATEGORY COMMUNICATIONS SUPERCLASS lt NONE gt A CONNECTION combines a WRITER and a CALLBACKRPCREADER to make a bi directional socket connection Synopsis include lt gk connection h gt Connection const char host int port int id 1 ReaderCallbackTable callbacks nil Connection int fd int id 1 ReaderCallbackTable callbacks nil Connection rpcstream server int id 1 ReaderCallbackTable callbacks nil Create a CONNECTION either connecting to a specified host and port or accepting a connection from a file descriptor or RPCSTREAM An id number may optionally be specified which is available for client use A previously created table of callbacks for different message types may be specified to permit sharing or by default a new table will be created int id An id number which may be used by clients In GroupKit this is normally used to specify the id number of the remote user of the socket CallbackRpcReader reader Writer writer ReaderCallbackTable callbacks Methods for accessing the CALLBACKRPCREADER the WRITER e g for sending messages on the connection and the READERCALLBACKTABLE used by the connection The definition of READERCALLBACKTABLE can be found in reader h Groupkit Reference Manual 3 2 93 Page 5 au 0 O ee CLASS CONNE
13. list of all the conferences active on the system including their users The Registrar itself implements no policy on how conferences are created or deleted or how users join or leave them but simply maintains these lists The Registrar Client one per user allows users to create delete join or leave conferences It interacts with other Registrar Clients through the central list provided by the Registrar The Registrar Client provides both a user interface as well as a policy dictating how conferences are created or deleted and how users enter or leave conferences Different Registrar Clients can be created to suit different registration needs The Coordinator one per user acts as an interface between application conferences and the registration system The Coordinator creates and maintains connections to any number of conferences allowing them all to share the same registration mechanism The Conference is the heart of the groupware application itself separate from the registration system Conference applications maintain communication facilities necessary for exchanging messages with other Conferences The user interface portions of groupware applications use these facilities extensively 3 2 93 Page 2 A Simple Example About the Example This section will start to build a GroupKit program The example will be a multi user version of the patch example contained in the InterViews distribution The program uses an InterVi
14. other users create conferences but also when the local user creates a conference Subclasses should handle protected void foundDeletedConference int conf_id 0 A deleted conference has been found Subclasses should handle protected void foundNewUser AttributeList 0 A new user for a conference has been found This may also be the local user joining a conference Subclasses should handle protected void foundDeletedUser int conf_id int user_id 0 A user has been deleted from a conference This may also include the local user Subclasses should handle Groupkit Reference Manual 3 2 93 Page 34 protected void UpdateConferenceList char info This routine accepts a list of current conferences from the REGISTRAR The list is parsed updating internal data structures the CONFERENCELIST This routine calls FOUNDNEWCONFERENCE and FOUNDDELETEDCONFERENCE when changes in the list are found protected void UpdateUserList char info This routine accepts a list of users of one of the conferences from the REGISTRAR The list is parsed updating internal data structures one of the user lists in the CONFERENCELIST This routine calls FOUNDNEWUSER and FOUNDDELETEDUSER when changes in the list are found protected boolean createReaderAndWriter const char host int port This routine is used to connect up to the central REGISTRAR protected void createReaderAndWriter int fd This routine is called when remote COOR
15. port lPort 4 create the conference and join to it conference tbl gt find conf al atoi conf coord gt createConference conf al coord gt setLocailInfo al join to all the other existing users in the conference code omitted here Groupkit Tutorial 3 2 93 Page 16 Building an Interface Finally an interface for the new registrar client must be constructed The master program provides an example of how one such interface could be constructed and linked to the registrar client Appendix A Program Listings Deck Flip Program DeckFlip h Header file for Conference Glyph ifndef o deckflip_h define _ deckflip_h include lt gk confglyph h gt class DeckFlip public ConferenceGlyph public DeckFlip class Style class Conference private void prev void next void flip GlyphIndex cur void real_flip GlyphIndex cur vold remoteFlip char class Patch patch_ class Deck deck_ fendif DeckFlip c Source file for Conference Glyph declareActionCallback DeckFlip implementActionCallback DeckFlip declareStrActionCallback DeckFlip implementStrActionCallback DeckFlip define DEMOCALLBACK 200 RRR RRR KR KKK KERR KK RK EK KR KK RRR KKK KEK RAK KKK KEK KKK KK EKER KKK KEKE KEE KEK KK EKKK KE construct the glyph set up callbacks etc REALE LAA RE ELAS A EE ELAS SSAA bo AL TA ARR ERAS ORR RAE AS A A ee DeckFlip DeckFlip Style
16. use the following commands gt gkmkmf o make Makefiles make depend make GroupKit conference programs are not run directly by the user but instead started by the registration system which informs the conference program through a number of command line arguments about various things it needs to run such as the location of the registration system so that the conference can connect to the registration system and receive information about other users The registration system needs to know two things about each program that it can start The first is the name including path of the executable programs which run the conference applications The second is a brief description of the conference program suitable for displaying to the user These are specified through the standard X resources mechanism i e Xdefaults file Assuming the deck flip executable was renamed to deckeg and placed in the home grouplab bin SUN4 directory the following lines could be added to the Xdefaults file startup GroupKitBinDir home grouplab bin SUN4 startup conferenceTypes 1 startup confl desc Deck Flip Example startup confl prog deckeg Here startup is the name of the user registration program Any number of conferences can be specified by altering the conferenceTypes resource Each program must have both a conf lt n gt desc resource and also a conf lt n gt prog resource To run the program fi
17. users in the other list s m startup miididincsidninhinsninnadisinindiidisiitimigictidin Conferences Other users may join the conference by selecting the conference name and pressing the Join button This will bring up copies of the Deck Flip program on their screens but right now the programs are behaving independently the next section describes the routines necessary to communicate between the programs Groupkit Tutorial 3 2 93 Page 7 Using Messages GroupKit Communications Defining Message Types Sending Messages Receiving Messages Groupkit Tutorial GroupKit uses messages to communicate between different applications A message consists of a message type which identifies the message and an option string which provides any information needed by the message type Message types are just integers a number are predefined in core hdr groupkit h but others can be trivially added Option strings are just normal strings in any format provided the message sender and message receiver use the same format The remainder of this section will illustrate the use of messages by adding them to the Deck Flip example above The first step is defining the message types used by the application In the Deck Flip case only one message type is needed which will be used to tell other users to flip to a particular card in the deck The option string will consist of just a single integer coded into a string
18. CKS SUPERCLASS RESOURCE A CONNACTION specifies a callback routine taking a string and a CONNECTION as parameters Synopsis finclude lt gk connaction h gt ConnAction Create a new CONNACTION void execute char Connection Activate the callback specifying the string and CONNECTION to be passed to the callback routine Usage example class App various routines void App init char s Connection c initialize the Connection declareConnAct ionCallback App implementConnActionCal lback App App myapp new App conns new InfoConnectionList INFOMSG new ConnActionCallback App myapp amp App init Notes CONNACTIONS are typically used in GroupKit with INFOCONNECTION objects to initialize a CONNECTION object when information such as id number is received from the other end of the CONNECTION The callback would receive the option string in the string parameter and interpret it to fill in fields in the CONNECTION object passed as the other parameter Groupkit Reference Manual 3 2 93 Page 10 M i EEO OO EO OE a CLASS RPCACTION CATEGORY CALLBACKS SUPERCLASS RESOURCE A RPCACTION specifies a callback routine taking a CALLBACKRPCREADER and a file descriptor as parameters Synopsis include lt gk rpcaction h gt RpcAction Create a new RPCACTION void execute CallbackRpcReader int fd Activate the callback specifying the CALLBACKRPCREADER and file
19. CTIONLIST CATEGORY COMMUNICATIONS SUPERCLASS LIST A CONNECTIONLIST manages a list of CONNECTIONS with a shared READERCALLBACKTABLE Synopsis include lt gk connection h gt ConnectionList Create a new CONNECTIONLIST Connection add char host int port int id 1 Connection add int fd int id 1 Connection add rpcstream server int id 1 Create and add a new CONNECTION to the list long find int id Search the list for a CONNECTION having the given value in its ID field and return its index in the list Return 1 if there is no such CONNECTION is found void sendTo int id MsgSender messenger void toAll MsgSender messenger Send a message either on the socket connection with the given value in its m_ field or on every socket connection in the list ConnList list Return the underlying list created using the InterViews List class permitting operations such as LIST INSERT LIST APPEND etc ReaderCallbackTable callbacks Return the table of callbacks used by the CoNNECTIONLIST The definition of READERCALLBACKTABLE can be found in reader h GroupKit Reference Manual 3 2 93 Page 6 CLASS INFOCONNECTION CATEGORY COMMUNICATIONS SUPERCLASS CONNECTION An INFOCONNECTION is a CONNECTION which accepts a special message containing information about the remote socket CONNECTION Synopsis include lt gk infoconn h gt InfoConnection const char host int port int id
20. DINATOR objects connect to us in search of CONFERENCE objects we ve created This is done because the central REGISTRAR maintains the host and port numbers of each user s REGISTRARCLIENT not the CONFERENCE objects themselves Therefore to connect to a remote CONFERENCE A COORDINATOR first asks the REGISTRARCLIENT what the CONFERENCE object s host and port number is This routine delegates this request to the local COORDINATOR which maintains host and port numbers for the CONFERENCES it created protected CallbackRpcReader reader protected Writer writer_ These maintain the connection to the central Registrar protected AttrListTable conference tbl protected UserListTbl users tbl This list mirrors the tables stored in the central REGISTRAR of active conferences and their users protected Coordinator coord This points to our COORDINATOR which actually maintains connections to and information about CONFERENCE objects that were created using this REGISTRARCLIENT Groupkit Reference Manual 3 2 93 Page 35 CLASS OPENREGCLIENT CATEGORY REGISTRATION SUPERCLASS REGISTRARCLIENT An OPENREGCLIENT is a REGISTRARCLIENT which uses an open registration policy Synopsis This class is part of the startup program in src examples reg open Intended as an example OpenRegClient const char host int port Coordinator coord Create anew OPENREGCLIENT void addDisplay RegClientDisplay display Ass
21. E U CLASS ATTRIBUTELIST CATEGORY CONFERENCE SUPPORT SUPERCLASS LIST An ATTRIBUTELIST holds a list of AVPAIRs Synopsis f finclude lt gk attrlist h gt AttributeList Create a new ATTRIBUTELIST void attribute const char attr const char val Add a new attribute to the list replacing any existing attributes with the same attribute name void remove attribute const char attr Remove the indicated attribute from the list if present boolean find attr const char attr char value Given the attribute name look up its value and store it in the second parameter Return true if the attribute was found void write char output Write out a representation of the ATTRIBUTELIST suitable for transmission in the output string static AttributeList read const char input Take an input string presumably generated by WRITE and rebuild the original ATTRIBUTELIST from it AVPairList list Return the InterViews LIST used to hold the AVPAIRS Groupkit Reference Manual 3 2 93 Page 23 Usage example main AttributeList al new AttributeList char p 80 q 80 r 80 s 1000 al gt attribute id 123 al gt attribute desc blah hi if al gt find_attribute id p printf id is lt s gt n p if al gt find_attribute desc p printf desc is lt s gt n p al gt attribute id 45 if al gt find_attribute id p printf id is lt s gt n p al gt wri
22. GROUPKIT USER S GUIDE Mark Roseman Department of Computer Science University of Calgary Introduction Calgary Alberta Canada T2N 1N4 Phone 1 403 220 7691 E mail roseman cpsc ucalgary ca GroupKit overview About this Tutorial Previous Knowledge Remainder of this Document For Further Information Groupkit Tutorial GroupKit is a toolkit for developing real time groupware applications It consists of a set of C classes and applications providing a number of common groupware components GroupKit programs run on Unix machines under X Windows GroupKit is based on the Inter Views user interface toolkit developed at Stanford University This tutorial provides by way of several examples an introduction into developing groupware applications using GroupKit By the end of this tutorial it should be possible to develop and run simple groupware applications using many of the important concepts and components provided by the toolkit This tutorial and the remainder of the GroupKit documentation assumes a familiarity with C and InterViews as well as some knowledge about groupware systems and their features The tutorial also assumes that a C compiler InterViews and GroupKit have been installed on the development system The tutorial consists of a number of parts 1 A high level view of the GroupKit application architecture 2 Designing implementing compiling and running a simple program under the Grou
23. HELL CATEGORY WIDGETS SUPERCLASS INPUTHANDLER IOHANDLER A SHELL is a GLYPH which supports running a Unix shell inside a VT100 terminal Synopsis include lt gk ui shell h Shell WidgetKit kit Create a new SHELL returning an 80x24 glyph which is connected by a pty to a process running a normal Unix shell int inputReady int fd Some characters have been received on the file descriptor associated with the Unix shell process These are interpreted and placed into the SHELL glyph void keystroke const Event amp e The user has typed a character which is sent through the pty to the Unix shell process Usage example sesslon gt run window new ApplicationWindow new BackGround new Shell WidgetKit instance WidgetKit instance gt background E Notes The SHELL relies on two other objects A TEXTBUF is a MONOGLYPH which maintains the 80x24 array of characters and provides editing operations to change the array An EMULATOR which was adapted from the EMULATOR found in InterViews 2 5 accepts a stream of characters i e from the Unix shell process and translates that stream into the text editing operations defined by the TEXTBUF according to the VT100 command set The TEXTBUF at this time is also incomplete i e some of the operations have not been implemented yet As well it needs much performance tuning Hoewever it does support enough functionality for most Emacs functions etc Group
24. MSG new StrActionCallback FlipGlyph this amp FlipGlyph remoteFlip 3 2 93 Page 8 Here the ConnectionList in the Conference object maintains a table of callback routines used by every Connection in the list The insert routine adds another callback to the table StrActionCallback is a callback class specifying a routine taking a single string parameter used here to specify the option string As with other InterViews callbacks the StrActionCallback must be previously declared Finally the target of the callback must be provided This routine takes the parameters in this case the single integer for the card index from the string and acts upon it The action in this case will be to update the deck as was done when the Next or Previous buttons were pushed This is a common circumstance having the same routine invoked locally through the user interface and remotely by a message It is useful to rearrange the code to provide one routine here real_flip which performs the action callable by two other routines One of these routines flip responds to local actions and the other remoteFlip responds to remote actions This is illustrated in the code below void FlipGlyph real_flip GlyphIndex cur deck gt flip to cur patch gt redraw void FlipGlyph flip GlyphIndex cur char s 10 real_flip cur Ssprintt s 3a cur conference gt connections gt toAll new
25. NFOCONNECTIONLIST manages a list of INFOCONNECTIONs Synopsis include lt gk infoconn h gt InfoConnectionList int info message type class ConnAction info action Create a new INFOCONNECTIONLIST Groupkit Reference Manual 3 2 93 Page 7 CALLBACKS Callbacks are used in GroupKit in the same manner as in standard InterViews programming They allow a user defined method of a particular object to be notified as the result of a particular action Three types of callbacks specific to GroupKit are defined STRACTION specifices a callback routine taking a string as a parameter CONNACTION specifies a callback routine taking a string and a CONNECTION object as parameters RPCACTION specifies a callback routine taking a CALLBACKRPCREADER and a file descriptor as parameters Callbacks must be defined for each class of object accepting a callback This is basically templates however not all compilers support templates GroupKit follows InterViews style of defining template behavior using preprocessor macros To use callbacks therefore requires two extra steps declare lt TYPE gt Act ionCal lback lt CLASS gt implement lt TYPE gt Act ionCal lback lt CLASS gt The first line writes out a C class declaration for a callback of type lt TYPE gt Str Conn or Rpc where the callback activates a method in class lt CLASS gt The second line writes out the body of the class the actual definition of each of the methods for the callback Cr
26. Notes Typically a CONFERENCEMONITOR is used as one of the base classes along with a CONFERENCEGLYPH perhaps for a new class that is interested in knowing when users enter or leave the CONFERENCE To register a CONFERENCEMONITOR with a given CONFERENCE from the CONFERENCEMONITOR constructor the following code might be used conference gt monitors gt append this Groupkit Reference Manual 3 2 93 Page 19 ul eee CLASS COORDINATOR CATEGORY CONFERENCE SUPPORT SUPERCLASS RPCPEER A COORDINATOR acts as an intermediary between the registration system and one or more CONFERENCES Synopsis include lt gk reg coordinator h gt Coordinator Style style Create a new Coordinator virtual void createReaderAndWriter int fd Accept a connection from one of the CONFERENCE objects we spawned A callback is set up so the Conference can send us information to identify itself virtual boolean createConference char name char type int id Create a new CONFERENCE in response to a request from the registration mechanisms The type of CONFERENCE to Create is specified by the second parameter which maps to a conference description resource Resources are specified in the following manner GroupKitBinDir lt location of GroupKit binaries gt conferenceTypes 2 confl desc Group Sketchpad confl prog gs conf2 desc Brainstorming Tool conf2 prog bstorm The command to start the conference is found by concaten
27. ONNECTION to a new CONFERENCE USET void youAreID char msg This routine is activated as a callback from the COORDINATOR and provides the CONFERENCE object with information such as the id number etc After this information is received the NEWUSER method is called so care should be taken so as not to add the local user twice void removeUser char msg This routine is activated as a callback from the COORDINATOR and signifies a user is leaving The default behavior is to call USERLEAVING void deleteConference char msg This routine is activated as a callback from the COORDINATOR signifying that the CONFERENCE should be destroyed int localIDQ InfoConnectionList connections ConferenceMonitorList monitors These three routines allow access to some of the CONFERENCE objects internal data structures the id number of the CONFERENCE the list of CONNECTIONS to other CONFERENCE objects useful for sending messages and the list of CONFERENCEMONITORS which can be manipulated using methods such as LIST APPEND Groupkit Reference Manual 3 2 93 Page 18 CLASS CONFERENCEMONITOR CATEGORY CONFERENCE SUPPORT SUPERCLASS lt NONE gt A CONFERENCEMONITOR can be notified when users enter or leave a CONFERENCE Synopsis inelude lt gk confmonitor h gt virtual void newUser AttributeList user attrs 0 virtual void userLeaving int id 0 These methods are called when users enter or leave the CONFERENCE
28. Only stores information on the REGISTRARCLIENT To get around this the JOINTo routine initiates a connection to the specified REGISTRARCLIENT to find out the CONFERENCE S Groupkit Reference Manual 3 2 93 Page 20 host and port number The REGISTRARCLIENT delegates this request to its attached COORDINATOR specifically the ADDRREO method The ADDRREO method in the remote COORDINATOR looks up the host and port number of the CONFERENCE and sends it back to the local COORDINATOR This information is received by the ADDRRESP routine which then passes on all the required information to the CONFERENCE object to connect to the remote CONFERENCE RegistrarClient rc A pointer back to our REGISTRARCLIENT mainly used to inform the REGISTRARCLIENT when one of our attached CONFERENCES dies Notes Because the CONFERENCE objects are running as separate processes which need to connect to the COORDINATOR there is some time between when a CONFERENCE is created and the COORDINATOR can send it messages As a result all messages to the CONFERENCE are queued up before the CONFERENCE has hooked up and these are sent as soon as the CONFERENCE does hook up Groupkit Reference Manual 3 2 93 Page 21 a eee CLASS GROUPSESSION CATEGORY CONFERENCE SUPPORT SUPERCLASS SESSION A GROUPSESSION is a SESSION which helps manage a GroupKit application Synopsis include lt gk groupsession h gt sroupSession const char name int argc char argv const
29. OptionDesc nil const PropertyData nil Create a new GROUPSESSION specifying the name used for looking up resources command line arguments and any user defined properties resources or options mappings of command line options onto resources The GRouPSEssion augments these with standard InterViews properties and options as well as GroupKit specific ones Conference conference Create a new CONFERENCE object based upon information which should be present in the command line arguments static const char host_name Return the name including internet domain of the host the program is running on Usage example Static PropertyData props width 750 2 height 300 nil a static OptionDesc options width width OptionValueAfter height height OptionValueAfter nil Er int main int argc char argv GroupSession session new GroupSession BrainStorm argc argv options props sesslon gt run window new ApplicationWindow new BrainStormGlyph session gt style session gt conference Groupkit Reference Manual 3 2 93 Page 22 O CLASS A VPAIR CATEGORY CONFERENCE SUPPORT SUPERCLASS lt NONE gt An AVPAIR holds a single lt attrivute value gt pair Synopsis include lt gk attrlist h gt AVPair const char attribute const char value Create a new AVPAIR char attr char val Attribute name and value a EE E
30. SOROVERLAY CATEGORY GRAPHICS AND OVERLAYS SUPERCLASS OVERLAY CONFERENCEMONITOR A CURSOROVERLAY permits gesturing using multiple cursors over another glyph Synopsis include lt gk cursor h gt CursorOverlay ActiveHandler inside class Style style class Conference conference Create a new CursoROVERLAY A PAGE is used to place cursor bitmaps over the inside glyph void move const Event amp e void drag const Event amp e void enter void leave These routines handle events from the local host moving the local cursor broadcasting changes to the other CURSOROVERLAYS and then passing the events to the inside glyph void moveCursor int id int x int y This routine actually moves one of the cursors specified by id number of its associated user to the appropriate spot on the PAGE void remoteMove char msg This callback routine is used to get the coordinates of one of the remote users cursors void newUser AttributeList user_attrs void userLeaving int id These two routines are called to indicate users entering or leaving the CONFERENCE Cursors in the PAGE are added or removed and internal data structures are updated appropriately Usage example int main int argc char argv Groupsession session new GroupSession CursorDemo argc argv Conference confer session gt conference session gt run_window new ApplicationWindow new CursorOverlay new PictureConfGlyph session
31. StrMsgSender DECKFLIPMSG s void FlipGlyph remoteFlip char s int which sscanf s d amp which real_flip which Several more include files are now necessary at the beginning of the program include lt gk infoconn h gt include lt gk straction h gt include lt gk msgsender h gt include lt gk reader h gt The program will now provide a multi user deck flip where changes made by one user will be mirrored on other users programs A complete listing of the program can be found in Appendix A Groupkit Tutorial 3 2 93 Page 9 Using Attribute Lists What Attribute Lists Provide Making an Attribute List Transmitting an Attribute List Groupkit Tutorial The previous section used sprintf and sscanf to encode and decode option strings for transmission This works well for simple situations However often a large number of parameters must be transmitted in the option string They are usually separated by some character such as a colon However problems can arise when some of the parameters may be string potentially containing colons or during development changes in the order or number of parameters must be carefully reflected in both sending and receiving routines Attribute Lists provide a general list of lt name value gt pairs where both attribute names and values are specified as strings The information in these lists can be written onto a string for transmission and a rec
32. ack ShowString this amp ShowString Change void ShowString press conference gt connections gt toAll new StrMsgSender STRINGMSG str void ShowString Change char str patch gt body WidgetKit instance gt label str patch gt reallocate patch redraw Groupkit Reference Manual 3 2 93 Page 13 EA CLASS OVERLAY CATEGORY GRAPHICS AND OVERLAYS SUPERCLASS ACTIVEHANDLER An OVERLAY permits one layer of graphics to be placed on top of another Synopsis include lt gk overlay h gt Overlay ActiveHandler inside class Style style class Conference conference Create an OVERLAY on top of the specified ACTIVEHANDLER The default OVERLAY will essentially do nothing so subclasses will add specific functionality arranging the graphics using LAYOUTKIT OVERLAY for example void move const Event amp e void press const Event amp e void drag const Event amp e void release const Event amp e void keystroke const Event amp e void double click const Event amp e void enter void leave Handle events The default behavior is to call the appropriate method of the inside glyph specified in the constructor Subclasses can override but should call the appropriate method in OVERLAY if the event should also be passed on to the inside glyph Conference conference Return the CONFERENCE object associated with the OVERLAY protected void p
33. al separates the GroupKit classes into a number of categories e Communications Support e Callbacks e Graphics and Overlays e Conference Support e Widgets Registration Extending the Toolkit The structure of the classes is designed to allow for extending by the developer i e most implementation specific instance variables for classes are declared protected not private If a component does not provide the exact functionality required for an application it may be straightforward to add that functionality by subclassing For Further Information The README file in the GroupKit distribution provides details for installing GroupKit on the development system The GroupKit Tutorial provides a basic understanding of how to build applications with GroupKit The paper GroupKit A Groupware Toolkit for Building Real Time Conferencing Applications Proc CSCW 92 Toronto Ontario describes the motivation for GroupKit s design as well as its implementation The InterViews Reference Manual from the InterViews distribution available from Stanford University provides details of the InterViews class library The document A Not Entirely Gentle Introduction to InterViews included in this distribution provides a brief introduction to InterViews Groupkit Reference Manual 3 2 93 Page 1 COMMUNICATIONS SUPPORT Communications in GroupKit relies on the InterViews Dispatch library Dispatch provi
34. ating the GroupKitBinDir resource with the appropriate conf prog resource determined by searching the conf desc resources for a match with the type parameter Command line options are appended which specify the name and id number of the conference as well as the local host and port number for the COORDINATOR used so the CONFERENCE can connect to us when it is created This command line is then used to spawn a new process to run the CONFERENCE A sample command line might be home grouplab bin SUN4 bstorm confname Ideas confid 23 coordhost janu coordport 1500 void deleteConference int id Delete the specified CONFERENCE by passing on the request to the appropriate CONFERENCE object void deleteUser int conf id int user id Delete the specfied user from the specfified CONFERENCE by passing on the reguest to the appropriate CONFERENCE Object void setLocalInfo int conf id int user id char userid char name Information for one of our CONFERENCES has been received which we pass on to the CONFERENCE object itself void joinTo int conf id int user id char userid char name char host int port void addrReq char s class Connection void addrResp char s The JoINTo routine specifies that one of our CONFERENCES should connect to the CONFERENCE run by the indicated user However the host and port number specify the address of the user s REGISTRARCLIENT not the CONFERENCE itself since the REGISTRAR
35. d be reconstructed into an Attribute List using the static method read string coming into our routine as s char id 80 AttributeList al AttributeList read s if al gt find attribute id id About Overlays The SketchPad Overlay Groupkit Tutorial Human factors work in groupware systems has suggested that there are several activities which are common to a number of different types of conferences These meta level activities include gesturing and annotating and are used to communicate information about the underlying artifacts in the conference GroupKit provides support for these activities using overlays Conceptually overlays act as transparent windows and can be placed on top of any conference glyph or in fact on top of other overlays Overlays draw on top of the conference glyph and handle mouse events before passing them on to the underlying conference glyph Two overlays are provided one for graphical annotation sketching and one for gesturing using multiple cursors Other overlays could be designed derived from the GroupKit Overlay class The first overlay allows annotating using simple freehand bitmap drawing with the mouse All annotations created are immediately transmitted to other conference users Though the Sketchpad can overlay any conference glyph for the sake of example an empty glyph can be created class EmptyGlyph public ConferenceGlyph publ
36. des a simple front end to standard Unix sockets The communications support added by GroupKit is provided by the following classes WRITER allows sending messages over a socket CALLBACKRPCREADER receives messages from a socket and calls a user specified routine the message target based upon a message type MSGSENDER provides a generic facility for sending messages over a number of different WRITERS STRMSGSENDER provides a facility for sending a message made up of a message type and an option string over a number of different WRITERS CONNECTION manages a WRITER and CALLBACKRPCREADER to form a bi directional socket connection CONNECTIONLIST manages a list of CONNECTIONS INFOCONNECTION is a CONNECTION which can receive information about the remote socket INFOCONNECTIONLIST manages a list of INFOCONNECTIONS Key concepts Message type is an integer specifying what message is being sent The message type is used by the receiver a CALLBACKRPCREADER to determine what routine should be called Option string is a string providing any options or parameters required by the message This will vary according to the message type and is interpreted by the message target Message target is the user specified routine typically a method of an object which is called by the CALLBACKRPCREADER When a message with a given message type is received Groupkit Reference Manual 3 2 93 Page 2 CLASS WRITER CATEGORY COMMUNICATIONS SUPERCLASS RPCWRITER
37. e_conference char msg Delete a conference specified by id number from the internal list protected void disp_conference char msg Broadcast a list of current conferences to all attached REGISTRARCLIENTS protected void add_user char msg Add a user to a conference based upon an attribute list Generate a unique id number for the user protected void delete user char msg Delete a user from a conference specifying conference id number and user id number protected void display users char msg Broadcast a list of users for a conference specified by conference id number to all attached REGISTRARCLIENTS protected AttrListTable conference tbl protected UserListTbl users tbl Maintain a list of all conferences and their users protected ConnectionList connlist_ Maintain a list of all REGISTRARCLIENTS Connected to us Notes The port number the REGISTRAR should be run on is normally obtained by the RegistrarPort resource The RegistrarHost resource specifies the machine the REGISTRAR is normally run on Groupkit Reference Manual 3 2 93 Page 33 G R ee CLASS REGISTRARCLIENT CATEGORY REGISTRATION SUPERCLASS RPCPEER A REGISTRARCLIENT provides an interface to the central REGISTRAR as well as defining and implementing a policy governing the semantics of different registration operations Synopsis include lt gk reg regclient h gt RegistrarClient const char hos
38. eating a lt TYPE gt callback to a member function lt FUNC gt in an object lt OBJ gt of type lt CLASS gt is done by new lt TYPE gt ActionCal lback lt CLASS gt lt OBJ gt 8 lt CLASS gt lt FUNC gt New types of callbacks accepting different parameters can also be created by making minor changes to the macros which create the current types of callbacks GroupKit Reference Manual 3 2 93 Page 8 O E CLASS STRACTION CATEGORY CALLBACKS SUPERCLASS RESOURCE A STRACTION specifies a callback routine taking a string as a parameter Synopsis include lt gk straction h gt StrAction Create a new STRACTION void execute char Activate the callback specifying the string to be passed to the callback routine Usage example class App various routines void App doit char s Interpret the string for this message type declareStrActionCallback App implementStrActionCallback App App myapp new App connection gt callbacks gt insert MSGTYPE new StrActionCallback App myapp amp App doit Notes STRACTIONS are typically used in GroupKit to specify callbacks for messages arriving over socket connections The message type allows the CALLBACKRPCREADER to identify the callback and the option string is passed to the callback routine to be interpreted Groupkit Reference Manual 312 93 Page 9 Neen cnn ccc srnrennnnn a n o a CLASS CONNACTION CATEGORY CALLBA
39. eived string can be reconstructed into an Attribute List The order of parameters in these strings is not important although the names of the attributes must be the same on both sides and separator characters such as the colon are escaped with a when necessary for transmission Attributes are added to an Attribute List using the attribute method Any attributes with the same name are replaced The remove_attribute routine removes an attribute while the find attribute routine looks up an attribute s value This is shown in the following example include lt gk attrlist h gt include lt stdio h gt maln char p 80 q 80 AttributeList al new AttributeList al gt attribute id 123 al gt attribute name Mark al gt attribute temp blah al gt attribute id 445 al gt remove attribute temp if al gt find attribute id p printf s n p if al gt find attribute name q printf sin q An AttributeList can be translated into a single string suitable for transmission using the write method This could then be sent using a message sender as done previously char s 1000 al gt write s conference gt connections gt toAll new StrMsgSender WHATEVERMSG s 3 2 93 Page 10 Reconstructing an Attribute List Using Overlays On the receiving end the string coul
40. ews deck object to display one of three strings cards contained in the deck Buttons for previous and next allow switching between the cards The multi user version will broadcast changes to all users so that when One user moves to a different card other users will see the same card The communications routines are detailed in the next section this section describes how to get the basic single user program up and running in the GroupKit framework Designing the The first step is designing the InterViews glyph which will manage the ConferenceGlyph user interface GroupKit programs subclass glyphs from the class ConferenceGlyph which is an InterViews InputHandler containing a pointer to a Conference object The Conference object allows the glyph to communicate with other conference users The glyph will contain the deck a patch to redraw the deck when it changes and buttons for previous and next Callback routines for the buttons will be necessary as well as a function flip which will be used by the callbacks The declaration looks like this class FlipGlyph public ConferenceGlyph public FlipGlyph WidgetKit Conference private void prev 9 void next void flip GlyphIndex cur Patch patch_ Deck deck_ The glyph will need to define callbacks for the buttons which must be declared as in normal InterViews Groupkit Tutorial 3 2 93 Page 3 The constructor simply creates all
41. h App WidgetKit void select void doit StringBrowser browser_ ae declareActionCallback App implementActionCallback App App App WidgetKit kit MonoGlyph nil browser_ new StringBrowser kit new ActionCallback App this amp App doit new ActionCallback App this amp App select body browser void App select printf something selectedin void App doit printf item d double clicked n browser gt selected Groupkit Reference Manual 3 2193 Page 27 CLASS NOEDITFIELD CATEGORY WIDGETS SUPERCLASS FIELDEDITOR A NOEDITFIELD is a LABEL with a fancier appearance Synopsis finclude lt gk ui noeditfield h gt NokditField const char string WidgetKit kit Create a new NoEDITFIELD using the indicated string as its contents Usage example NoEditPield txt new NoEditField some text WidgetKit instance CLASS LABELLEDSCROLLLIST CATEGORY WIDGETS SUPERCLASS MONOGLYPH A LABELLEDSCROLLLIST combines a browser a scrollbar and a label Synopsis f finclude lt gk ui labserlst h gt LabelledScrollList WidgetKit kit char Ibl FileBrowser br int width int height Create a new LABELLEDSCROLLLIST Usage example StringBrowser users new StringBrowser kit nil nil LabelledScrollList users box new LabelledScrollbist kit Users users 200 70 Groupkit Reference Manual 3 2193 Page 28 V CLASS S
42. ic EmptyGlyph Style Conference int int ae EmptyGlyph EmptyGlyph Style style Conference conf int x int y ConferenceGlyph nil style conf LayoutKit amp layout LayoutKit instance WidgetKit kit WidgetKit instance body new Background layout vbox first aligned layout vspace y layout hspace x ie kit background 3 2 93 Page 11 A Sketchpad overlay could be placed over the EmptyGlyph as follows int main int argc char argv GroupSession session new GroupSession SketchDemo argc argv Conference confer session gt conference WidgetKit amp kit WidgetKit instance LayoutKit layout LayoutKit instance sesslion gt run_window new Applicat lonWindow kit inset_frame new Sketchpad new EmptyGlyph session gt style confer 300 300 sesslon gt style confer The Cursor Overlay The Cursor Overlay allows communicating gestural information via multiple cursors that appear on all displays This allows pointing to objects underneath the overlay Working with the Cursor Overlay is just like working with the Sketchpad overlay The following fragment combines both the overlays see Appendix A for a complete listing sesslon gt run window new Applicat ionWindow kit inset_frame new CursorOver lay new Sketchpad new EmptyGlyph session gt style confer 300 300 sesslon gt style confer sesslon gt style confer
43. ick Canvas c const Allocation amp a int depth Hit amp h The OVERLAY PICK routine is like the normal ACTIVEHANDLER PICK except that it will not call pick on the subglyphs i e the inside glyph This ensures that the OVERLAY and not the leaf glyphs will receive the events first protected boolean event Event amp e The OVERLAY EVENT routine replaces the ACTIVEHANDLER S normal event processing routines It processes the event in a similar way to the ACTIVEHANDLER but then passes the event to the inside glyph for processing Notes Both of the provided overlays SKETCHPAD and Cursor provide some basic functionality Developers may wish to subclass these overlays to meet their actual needs More experience working with the standard overlays in different groupware applications may suggest ways that the standard ones can be parameterized through mechanisms such as X resources Groupkit Reference Manual 3 2 93 Page 14 k n o CLASS SKETCHPAD CATEGORY GRAPHICS AND OVERLAYS SUPERCLASS OVERLAY A SKETCHPAD is an OVERLAY which permits freehand sketching Synopsis include lt gk sketchpad h gt Sketchpad ActiveHandler inside class Style style class Conference conference Create a new SKETCHPAD overlay A LAYOUTKIT OVERLAY is used to overlay the inside glyph with a bitmap the same size as the inside glyph void press const Event amp e drag const Event amp e release const Event amp e These r
44. include lt InterViews window h gt include lt stdio h gt Groupkit Tutorial 3 2 93 Page 22 include lt gk cursor h gt finclude lt gk sketchpad h gt include emptyglyph h inelude lt IV look kit h include lt InterViews layout h gt int main int argc char argv GroupSession session new GroupSession CursorDemo argc argv Conference confer session gt conference sesslon gt run window new ApplicationWindow WidgetKit instance gt inset frame LayoutKit instance gt margin new ursorOverlav new Sketchpad new EmptyGlyph session gt style confer 300 300 sesslon gt style confer session gt style confer 30 0 GroupKit Tutorial 3 2 93 Page 23 INTRODUCTION GroupKit overview GroupKit is a toolkit for developing real time groupware applications It consists of a set of C classes and applications providing a number of common groupware components GroupKit programs run on Unix machines under X Windows GroupKit is based on the InterViews user interface toolkit developed at Stanford University About this Reference Manual This manual provides details of the C classes which make up GroupKit This serves as a detailed reference to using the toolkit Previous Knowledge This reference manual assumes a familiarity with C and InterViews as well as a basic understanding of how to build GroupKit applications Remainder of this Document The reference manu
45. ion to them The registration system relies heavily on ATTRIBUTELISTS described in the Conference Support section The REGISTRAR accepts an ATTRIBUTELIST from its clients to describe both conferences and users The REGISTRAR adds to these descriptions attributes for conference id number confnum and user id number usernum Additionally the COORDINATOR requires attributes to be defined for the name of the conference name the type of the conference type used to look up the conference application in the X resources file and the Internet host name host and port number port of various sockets The OPENREGCLIENT also maintains information about the userid userid and the full user name username Groupkit Reference Manual 3 2193 Page 32 E a aaa UUU U CLASS REGISTRAR CATEGORY REGISTRATION SUPERCLASS RPCPEER A REGISTRAR maintains global registration information for all active conferences Synopsis This class is used by the registar program found in src examples registrar Registrar int port Create a new REGISTRAR listening for connections from REGISTRARCLIENTS on the indicated port protected void createReaderAndWriter int fd Accept a new CONNECTION from a REGISTRARCLIENT protected void new_conference char msg Add a conference specified by an attribute list to the internal list Generate a unique id number for the conference protected void delet
46. kit Reference Manual 3 2 93 Page 29 CLASS TABULAR CATEGORY WIDGETS SUPERCLASS MONOGLYPH A TABULAR is a GLYPH holding rows and columns of other glyphs Synopsis include lt gk ui tabular h gt Tabular int x 1 int y 1 Create a new TABULAR specifying the intial numbers of columns and rows void insert row int y Insert a new row at the given position void insert col int x Insert a new column at the given position void delete row int y Delete the row at the given position void delete col int x Delete the column at the given position void replace int x int y Glyph g Replace the glyph at the indicated column and row with a new glyph Glyph item int x mt y Return the glyph at the indicated column and row int rows int colsQ Return the number of rows or columns in the table GroupKit Reference Manual 3 2 93 Page 30 CLASS DIALOGMANAGER CATEGORY WIDGETS SUPERCLASS lt NONE gt A DIALOGMANAGER allows instantiating common dialog boxes Synopsis include lt gk ui DialogMgr h gt DialogManager Create a new DIALOGMANAGER const char choose Window win const char prompt const char filt p Pop up a dialog box over the indicated window displaying the prompt as well as a file chooser The filter specifies a set of files which the file chooser should display e g c Return the name of the file selected by the user or nil if the user hit Cancel
47. lave client src examples reg slave provides a client for a user in a facilitated conference where it is expected a facilitator will control the conferences the user will see Although the last two programs are not complete examples they provide useful information on how one could create such registration methods The first step is deciding exactly what the registration method you would like should do Using the master slave clients mentioned earlier we might consider the following Master can create any conference will join to all conferences we create can delete any conference we are managing can join any user in the facilitated conference to a conference we are managing canremove any user from a conference we are managing can remove any user fromthe facilitated conference Slave will initially join a single facilitated conference on receiving a new user message from the registrar specifying ourself we will create the conference on receiving a delete user message from the registrar specifying ourself we will delete the conference on receiving a delete user message from the registrar specifying ourself and where the conference specified is the original facilitated conference we will quit These semantics must then be translated into code for the registrar client The following code fragment might be used by the master facilitated registrar client to add a user to an existing conference
48. ll GroupKit programs from the registration system The GroupSession object uses this information to instantiate a Conference object which is needed by the ConferenceGlyph subclass defined previously int main int argc char argv GroupSession session new GroupSession DeckFlip argc argv sesslon gt run window new ApplicationWindow new FlipGlyph WidgetKit instance sesslon gt conference Finally some include files and callback declarations are needed at the beginning of the program include lt IV look kit h gt include lt InterViews layout h gt finclude lt InterViews style h gt include lt InterViews action h gt include lt InterViews patch h gt include lt InterViews window h gt include lt gk conference h gt include lt gk groupsession h gt include lt gk confglyph h gt GroupKit uses Imakefiles to compile programs Assuming the above program was stored in deckeg c the following Imakefile would be used to compile it ifdef InObjectCodeDir Use libInterViews MakeObjectFromSre deckeg GroupkitProgram deckeg deckeg o else MakeInObjectCodeDir endif 3 2 93 Page 5 Informing the Registration System Running the Program Groupkit Tutorial A script called gkmkmf should be installed which works like the Inter Views ivmkmf but also includes the necessary paths and Imakefile macros to easily build GroupKit programs To compile the example
49. mp UserMonitor selectUser info_ new StringBrowser kit nil nil msg_ new NoFditField kit LayoutKit layout LayoutKit instance patch_ new Patch kit gt inset_frame layout margin layout vbox msg_ new LabelledScrollList kit users 200 100 new LabelledScrollList kit info_ 200 100 10 0 body patch attrs new AttrListTable 20 lines new IntTable 20 conf gt monitors gt append this RRR KKK RRR RRR RRR KK KEKE KR KKK KEK KEK KKK KKK KKK KR RRR KKK KR RK KKK KKK KKK KERR RK KR RK KK A user has been selected display their attributes in the lower browser REERLAAL ELE EEE LASALLE ERE REA LER SELLS PAE ERA EERE ES ORR OS RR EE REE RRL void UserMonitor selectUser AttributeList al int id char s 100 info_ gt Clear if users gt selected gt 0 if lines gt find id users gt selected if attrs gt find al id for ListItr AVPairList i al gt list i more i next Groupkit Tutorial 3 2 93 Page 20 sprinti s info gt Append patch gt redraw s s 1 cur gt attr i cur gt val s kkikkk ikikikiiiikiiiiii iiai ik kikikik ki i i ki i kiki kii ki ikik k k a new users has Joined stick their name in the users browser and place a message in the static text field OR REALE ARRAS ER AAA OA AREAS RA POR KARA EK
50. mple application Doc is available The DIALOGMANAGER allows easily creating four types of common dialog boxes CHOOSER is a dialog box containing a file chooser which allows the user to select a file ASKER is a dialog box presenting a prompt and asking the user to input a string CONFIRMER is a dialog box presenting a prompt and asking the user to press Yes No or Cancel REPORTER is a dialog box giving a message to the user which must be acknowledged Groupkit Reference Manual 3 2 93 Page 26 V Q Q QDn dn n n ae CLASS STRINGBROWSER CATEGORY WIDGETS SUPERCLASS FILEBROWSER A STRINGBROWSER is a glyph which presents a list of strings in a box Synopsis include lt gk ui strbrowser h gt StringBrowser WidgetKit kit Action double click Action single click Create a new STRINGBROWSER void Append const char string void Append Glyph g Append a string or arbitrary glyph to the end of the list of items in the STRINGBROWSER void Remove int index Remove the indicated item from the STRINGBROWSER int Count Return the number of items in the STRINGBROWSER void Clear Remove all the items in the STRINGBROWSER void select GlyphIndex index Select the indicated item in the STRINGBRowsER The default behavior is to execute the single click callback The callback routine can figure out which item was selected using BROWSER SELECTED Usage example class App public MonoGlyp
51. n a conference Under this scheme we assume anyone can join any conference so create the CONFERENCE object via the COORDINATOR and also forward the request to the REGISTRAR The new CONFERENCE will also initiate connections to all existing users of the conference void requestLeaveConference int conf id The user via the display has requested to leave a CONFERENCE Pass this request on to the REGISTRAR void requestViewConference int conf_id The user via the display has asked to view the users for the indicated conference Update the display as appropriate Groupkit Reference Manual 3 2 93 Page 36 ea nnn E CLASS REGCLIENTDISPLAY CATEGORY REGISTRATION SUPERCLASS MONOGLYPH A REGCLIENTDISPLAY provides a user interface to an OPENREGCLIENT Synopsis This class is part of the startup program in src examples reg open RegClientDisplay OpenRegClient rc WidgetKit kit Create a new REGCLIENTDISPLAY void updateConference void updateUsers int conf_id The list of conferences or users maintained by the REGISTRARCLIENT may have changed Update our lists as appropriate Window win The window we re running in needed for posting dialog boxes protected Glyph makeGlyph Create the user interface for the REGCLIENTDISPLAY This consists of two string browsers actually LABELLEDSCROLLLISTS holding the list of conferences and the list of users in the selected conference a New button for creati
52. ng a new conference and a Join button for joining an existing conference selected in the conferences browser The New button brings up a dialog box prompting the user for the name of the conference as well as its type looked up via the resources mechanism used by the COORDINATOR for creating conferences Groupkit Reference Manual 3 2 93 Page 37
53. ociate a display with the REGISTRARCLIENT which provides a user interface for working with the OPENREGCLIENT void userLeft int conf_id int user_id The COORDINATOR has informed us that a user has left a conference Tell the REGISTRAR to delete the user from the conference and also delete the conference itself if the user was the last one in it void foundNewConference AttributeList A new conference has been found Update our display If we ve been waiting for that conference to be created because we initiated its creation tell our COORDINATOR to create it and also tell the REGISTRAR we want to join it void foundDeletedConference int conf_id A conference has been deleted Update the display Tell our COORDINATOR to delete the CONFERENCE if present void foundNewUser AttributeList A new user for a conference has been found If we ve been waiting to join this CONFERENCE we should have already created the CONFERENCE object so pass the necessary information to it via our COORDINATOR void foundDeletedUser int conf_id int user_id A user has left a conference Delete the user update the display and then tell the COORDINATOR to delete the user from the CONFERENCE if present void requestNewConference char name char type The user via the display has asked to create a new conference Pass this on to the REGISTRAR via CALLNEWCONFERENCE void reguestJoinConference int conf id The user via the display has asked to joi
54. on callback int message type Add a callback to the callback table This callback will be activated when a message with the indicated message type is received over the socket int id Return the id number which was initialized in the constructor void closeCallback RpcAction close Provides an alternate way to set the callback which is activated if the socket connection is closed down A after a superclass indicates that the superclass is part of the Inter Views library Groupkit Reference Manual 3 2 93 Page 3 CLASS MSGSENDER CATEGORY COMMUNICATIONS SUPERCLASS lt NONE gt A MSGSENDER allows the same message to be sent over multiple sockets Synopsis include lt gk msgsender h gt void sendOn Writer writer 0 A virtual method which is called to actually send the message Subclasses must define this o CLASS STRMSGSENDER CATEGORY COMMUNICATIONS SUPERCLASS MSGSENDER A STRMSGSENDER allows the same message to be sent over multiple sockets Synopsis finclude lt gk msgsender h gt StrMsgSender int message type char option string Create a STRMSGSENDER which can send the message specified by the message type and option string Predefined message types can be found in groupkit h void sendOn Writer writer This method will send the message over the socket connection managed by the WRITER Usage example char s 10 sprintf s d current value conference
55. onitor class WidgetKit class Conference virtual void newUser class AttributeList virtual void userLeaving int id protected void selectUser class StringBrowser users_ class NoEditField msg_ class Patch patch_ class StringBrowser info_ class AttrListTable attrs_ class IntTable lines_ endif UserMon c Source for Conference Glyph include usermon h include lt InterViews patch h gt include lt gk attrlist h gt include lt gk conference h gt Groupkit Tutorial 3 2 93 Page 19 finclude lt gk ui strbrowser h gt finclude lt gk ui noeditfield h gt include lt IV look kit h gt include lt InterViews layout h gt include lt InterViews action h gt include lt gk ui labsocrlst h gt include lt 0S table h gt include lt stdio h gt declareActionCallback UserMonitor implementActionCallback UserMonitor declareTable IntTable int int implementTable IntTable int int RRR RRR KKK KK RRR KKK RR KARR KR KK RK RRR RR RRR KKK RK ER RK KK KKK RR EEK EK KK KKK KARR KE Create a user monitor consisting of a list of users and underneath that a list holding the attributes for the selected user as well as a static text field holding messages PR R P ROP SRA PAA A A Ao AAR HH UserMonitor UserMonitor WidgetKit kit Conference conf ConferenceGlyph nil kit gt style conf users new StringBrowser kit nil new ActionCallback UserMonitor this a
56. ontaining a reference to a CONFERENCE object Synopsis Hinclude lt gk confglyph h gt ConferenceGlyph Glyph Style Conference Create a CONFERENCEGLYPH Conference conference Return the CONFERENCE object associated with the CONFERENCEGLYPH Notes A CONFERENCEGLYPH is the basis for building the graphical components of GroupKit programs The GLYPH in the constructor specifies the graphics as in a MONOGLYPH and can also be assigned via MONOGLYPH BODY GLYPH Usage example This example shows a CONFERENCEGLYPH subclass containing a single string label passed as a parameter to the glyph When the glyph is pressed which is detectable because a CONFERENCEGLYPH is an ACTIVEHANDLER labels for all CONFERENCE users are set to the string of the user who pressed the button The PATCH is used in order to force a redraw of the glyph when the string changes The constructor uses the associated CONFERENCE for sending messages as well as establishing callbacks for messages class ShowString public ConferenceGlyph public ShowString char str Style Conference void Change char str virtual void press Patch patch_ he ShowString ShowString char str Style style Conference conf ConferenceGlyph nil style conf patch_ new Patch WidgetKit instance gt label str body patch conference gt connections gt callbacks gt insert STRINGMSG new StrActionCallb
57. ormal TABLE operations to be performed However due to the way that TABLEs are implemented using preprocessor macros it is necessary to declare TABLEITERATORS Over ATTRLISTTABLES aS TABLEITERATOR ATTRLSTTBL rather than TABLEITERATOR ATTRLISTT ABLE CLASS USERLISTTBL CATEGORY CONFERENCE SUPPORT SUPERCLASS TABLE A USERLISTTBL holds a table of ATTRLISTTABLES Synopsis finclude lt gk attrlist h gt Notes This class is just an InterViews Table indexed by an integer key and holding AttrListTables This is convenient for holding lists of users for all the conference Each item in this table indexed by the conference id number holds the table of users indexed by user id number for each conference GroupKit Reference Manual 3 2 93 Page 25 WIDGETS A number of general purpose widgets InterViews glyphs which are not part of the InterViews distribution are also included These are used in various places within GroupKit and can be useful building blocks for interfaces The extra components are STRINGBROWSER which presents a list of strings in a box NOEDITFIELD which presents a label in a fancy box like an edit field but which cannot be edited LABELLEDSCROLLLIST bundles a label a browser and a scrollbar which is a common combination of glyphs SHELL which supports running a Unix shell process inside a VT100 terminal emulator TABULAR contains rows and columns of glyphs As well the DIALOGMANAGER from the InterViews sa
58. outines handle the drawing events from the local host updating the bitmap broadcasting changes to the other CONFERENCES actually the other SKETCHPAD Overlays and then passing the events on to the inside glyph void doLine int x0 int y0 int xl int y1 This routine draws the lines on the bitmap and damages the canvas appropriately to generate a redraw void remoteScribble char s This callback routine is used to get the coordinates of lines initiated on other users bitmaps Usage example int main int argc char argv GroupSession session new GroupSession SketchDemo argc argv Conference confer session gt conference sesgslon gt run_window new Applicat ionWindow new Sketchpad new PictureConfGlyph session gt style confer sesslon gt style confer Notes The following resource shown here with default value is currently defined SketchOverlay foreground black color of bitmap annotations The SKETCHPAD will eventually use the following resources to specify its behavior SketchOverlay line Width 1 width of annotations SketchOverlay button l which button for drawing The SKETCHPAD relies on a fixed size bitmap meaning that it cannot be resized This overlay should be extended to support at the very least freehand erasing using another mouse button and also a Clear operator to erase the entire bitmap GroupKit Reference Manual 3 2 93 Page 15 a CLASS CUR
59. pKit framework 3 Adding messaging features to programs 4 Using attribute lists to simplify sending complex messages 5 Using overlays to provide common groupware features for work surfaces 6 Monitoring when users enter and leave a conference The README file in the GroupKit distribution provides details for installing GroupKit on the development system The GroupKit Reference Manual provides detailed descriptions of the various C classes which make up GroupKit The paper GroupKit A Groupware Toolkit for Building Real Time Conferencing Applications Proc CSCW 92 Toronto Ontario describes the motivation for GroupKit s design as well as its implementation The InterViews Reference Manual from the InterViews distribution available from Stanford University provides details of the InterViews class library 3 2 93 Page 1 The document A Not Entirely Gentle Introduction to InterViews included in this distribution provides a brief introduction to InterViews GroupKit Architecture Overview Registrar Registrar Client Coordinator Conference Groupkit Tutorial GroupKit applications consist of a number of processes arranged in a distributed architecture on a number of machines Registrar Client Coordinator NL PIOCBSS mmm mm Jie SOCKOt connection CI object meme Object message mmm passing The central Registrar maintains a
60. plications The registration system is inherently policy free A central REGISTRAR maintains a global list of all conferences and their users The REGISTRAR accepts and obeys commands to modify these lists without regard to where the commands come from e g it is perfectly acceptable for anyone to delete any user from a conference However users interact with the REGISTRAR through a REGISTRARCLIENT one per user distributed across the network which besides providing a user interface to the REGISTRAR must also provide the semantic interpretation of any changes to the REGISTRAR s status That is every REGISTRARCLIENT is responsible for implementing a registration policy as well as a user interface The protocol by which the REGISTRAR and REGISTRARCLIENTS communicate provides the means for expressing that policy One sample client is currently provided an OPENREGCLIENT which implements an open registration policy Under an open registration policy any user can create a conference and any user can join an existing conference Users may leave a conference they are part of but not delete anyone else Conferences are deleted only when the last user of the conference leaves The OPENREGCLIENT uses a REGCLIENTDISPLAY to provide its user interface The registration system interacts with the conference applications through the COORDINATOR described in the Conference Support section which spawns CONFERENCES and forwards relevant registration informat
61. rom CONFERENCEMONITOR and register themselves with the CONFERENCE The CONFERENCE objects rely on the registration components for information about users joining and leaving the conference The COORDINATOR serves as an interface between the registration components and one or more CONFERENCES It will create one or more CONFERENCES at the request of the registration system that all share a common registration system As well GroupKit applications require a number of parameters to control how they behave e g names of conferences host and port numbers of different components These parameters come from X11 resources and command line arguments The GROUPSESSION object augments the standard InterViews SESSION to handle GroupKit specific parameters Finally a number of support classes help maintain information throughout GroupKit both for internal use and transmission An AVPAIR holds a single attribute value pair while an ATTRIBUTELIST holds a list of AVPairs A table of ATTRIBUTELISTS indexed by an integer id number can be stored in a ATTRLISTTABLE while tables of these tables useful for holding all the users in all the conferences for example can be stored in a USERLISTTBL i GroupKit Reference Manual 3 2 93 Page 17 7 IE CLASS CONFERENCE CATEGORY CONFERENCE SUPPORT SUPERCLASS RPCPEER A CONFERENCE maintains connections to other users as well as the user s COORDINATOR serving as the center of communication
62. rst of all make sure the GroupKit registrar is running If it is not running start it up by typing registrar amp Note that the registrar must run on a certain machine specified by the RegistrarHost resource in the file core src groupsession c Next run the program startup which provides a client to the registrar This program expects to find the registrar at the host and port number identified by the RegistrarHost and RegistrarPort resources but this can be overridden with the host lt name gt and port lt number gt command line options This should bring up the window shown below Note the appearance may be slightly different depending on the default InterViews WidgetKit used the screen dumps here show the monochrome WidgetKit 3 2 93 Page 6 eD startup fB Conferences Clicking the New button should bring up the dialog box below asking you to create a new conference The name of the conference can be entered in the field editor at the top and the radio button for Deck Flip Example should be selected If more conferences were specified in the Xdefaults more radio buttons would be in the dialog Conference name Conference name Deck Flip Example Clicking OK should start up the Deck Flip program in another window The Conference list in the registrar client will be updated to include the newly created conference Selecting the conference name will give a list of its
63. s for GroupKit applications Synopsis include lt gk conference h gt Conference char name const char coord host int coord port int confnum Create a new CONFERENCE object given the name of the conference the host and port number of the COORDINATOR which initiated the CONFERENCE and the id number of the CONFERENCE The CONFERENCE initiates a CONNECTION to the COORDINATOR in order to receive registration information such as announcements of new users A CONFERENCE can also be created using the GROUPSESSION object void newUser AttributeList user attrs void userLeaving int id These routines are called whenever a new user joins the CONFERENCE or an existing user leaves the CONFERENCE The default behavior is to pass the notification on to a list of CONFERENCEMONITOR objects which can take appropriate action such as updating application data structures to reflect the new users boolean createReaderAndWriter const char host int port void createReaderAndWriter int fd These routines are used when initiating or accepting new socket connections to the COORDINATOR and from Other CONFERENCE objects respectively void info callback char msg class Connection c This routine is used as the target of the INFOCONNECTION interpreting information about the remote CONFERENCE user and storing it in the CONNECTION object void connectTo char msg This routine is activated as a callback from the COORDINATOR and initiates a C
64. ser and one to indicate which user is on what line in the top string browser The last line registers the UserMonitor with the list of monitors in the Conference so it will be informed when users enter or leave the conference UserMonitor UserMonitor WidgetKit kit Conference conf ConferenceGlyph nil kit gt style conf LayoutKit amp layout LayoutKit instance msg new NoEFditField kit users_ new StringBrowser kit nil new ActionCallback UserMonitor this amp UserMonitor selectUser info_ new StringBrowser kit nil nil patch_ new Patch kit gt inset_frame layout margin layout vbox msg new LabelledScrollList kit users 200 100 new Label ledScroilbist kit info 200 100 go LOD P body patch attrs new AttrListTable 20 lines new IntTable 20 conf gt monitors gt append this When new users enter the conference the routine newUser in any ConferenceMonitors registered with the Conference is called The routine is passed an attribute list for the user The UserMonitor extracts the user number as a key for its data structures as well as the name for display in the top string browser and the top message field The whole list is stored for use in the selectUser routine described below 3 2 93 Page 13 Users Leaving Groupkit Tutorial void UserMonitor newUser AttributeList al char id 80 name 80 s 80 al
65. specifying the card to flip to The message type any integer not already used can be defined simply as follows define DECKFLIPMSG 200 In order to send messages we ll use the ConnectionList in the Conference object which holds Connections to all other users in the conference The ConnectionList provides routines for sending messages to a single user specified by their user number in the conference or to all the users of the conference which is necessary here The sending routines take a message sender object which is capable of sending the same message on a number of Connections We can create a message sender using the GroupKit class StrMsgSender which takes an integer the message type and a string the option string as parameters in its constructor The code to send a message would be placed in our flip routine as follows void FlipGlyph flip GlyphIndex cur char s 10 deck gt flip to cur patch gt redraw Sprintris 20 cur conference gt connections gt toAl1 new StrMsgSender DECKFLIPMSG ja Two steps are necessary to receive messages First callback routines need to be specified which will be executed when particular message types are received In the example a routine here called remoteFlip should be activated when the DECKFLIPMSG is received The following code in the FlipGlyph constructor specifies this conf gt connections gt callbacks gt insert DECKFLIP
66. style Conference conf ConferenceGlyph nil style conf WidgetKit amp kit WidgetKit instance const LayoutKit amp layout LayoutKit instance deck _ layout deck deck_ gt append kit label Hi mom deck append kit label Big Bird deck gt append kit label Oscar deck gt flip to 0 Groupkit Tutorial 3 2 93 Page 17 patch_ new Patch deck_ body kit inset frame layout margin layout vbox patch_ layout vglue 5 0 layout hbox kit push_button Next new ActionCallback DeckFlip this amp DeckFlip next layout hglue 10 0 kit push_button Previous new ActionCallback DeckFlip this amp DeckFlip prev conf gt connections gt callbacks gt insert DEMOCALLBACK new StrActionCallback DeckFlip this amp DeckFlip remoteFlip RRR KR RK RRR KK RK KK KK RR RRR RRR RR RR RK RK KR RRR RK RRR KK RK KKK KKK KEKE KKK KK KK callbacks when user presses previous or next buttons DEAR O YKK R O K NE E E O A P AO E RE DR RRR Mf void DeckFlip prev GlyphIndex cur deck gt card 1 flip cur 1 deck gt count 1 cur void DeckFlip next GlyphIndex cur deck_ gt card 1 flip cur deck gt count 0 cur RRR K KK RR KK RK RK RR KKK RK KR KR KKK KKK KR KK KKK KK RRR KKK RK ERK KR KKK KKK ERK KKK KK KKK KEK call real_flip to change the glyph and also tell other users x EERE LE LAE Se AS ER SAE Ce ee LEE
67. t int port Coordinator coord Create a new REGISTRARCLIENT Connect up to the central REGISTRAR on the given host and port Store the COORDINATOR for later use in dealing with CONFERENCES we create void callJoinConference int conf id void callJoinConference AttributeList Tell the REGISTRAR the local user wishes to join the indicated conference This routine figures out the user s name host etc Alternately let the caller provide all the host port information void callLeaveConference int conf id int user id Tell the REGISTRAR that the user with the specified id number wants to leave the indicated conference void callNewConference AttributeList Tell the REGISTRAR to create a new conference given a list of attributes e g name and type void callDeleteConference int conf_id Tell the REGISTRAR to delete the indicated conference void PollConferences Tell the REGISTRAR to broadcast a list of all conferences out to the REGISTRARCLIENTS void PollUsers int conf id Tell the REGISTRAR to broadcast a list of users of the specified conference out to the REGISTRARCLIENTS void userLeft int conf_id int user_id 0 Our COORDINATOR has told us that the indicated user has exited the indicated conference Subclasses should handle informing the REGISTRAR as necessary protected void foundNewConference AttributeList 0 A new conference has been found This routine is called not only when
68. te s printf lt s gt n s AttributeList a2 AttributeList read s if a2 gt find_attribute id p printf id is lt s gt n p a2 gt find attribute desc p printf desc is lt s gt n p Output id is lt 123 gt desc 1s lt blah hi gt id is lt 45 gt lt desc blah hi id 45 gt id is lt 45 gt desc is lt blah hi gt GroupKit Reference Manual 3 2 93 Page 24 a ss n IE U ST CLASS ATTRLISTTABLE CATEGORY CONFERENCE SUPPORT SUPERCLASS TABLE An ATTRLISTTABLE holds a table of ATTRIBUTELISTs Synopsis include lt gk attrlist h gt AttrListTable int size 30 Create a new ATTRLISTTABLE void write char output Write out a representation of the ATTRLISTTABLE suitable for transmission in the output string The format is identical to that used by ATTRIBUTELIST WRITE with ampersands placed between adjacent ATTRIBUTELISTS static AttrListTable read const char input const char key attr int size Take an input string presumably generated by WRITE and rebuild the original ATTRLISTTABLE from it The KEY_ATTR parameter indicates the attribute name present in each ATTRIBUTELIsT coded in the input used as the key for the table The value for this attribute must be an integer The s ze specifies the hash table size Notes An ATTRLISTTABLE is a subclass of an ATTRLSTTBL an InterViews TABLE holding ATTRIBUTELIST pointers indexed by an integer key allowing all the n
69. the necessary components FlipGlyph FlipGlyph WidgetKit kit Conference conf ConferenceGlyph nil kit gt style conf r L const LayoutKit amp layout LayoutKit instance deck_ layout deck kit label Hi mom kit label Big Bird kit label Oscar E patch new Patch deck_ body kit inset_frame layout margin layout vbox patch_ layout vglue 5 0 layout hbox kit push_button Next new Act ionCallback FlipGlyph this amp FlipGlyph next layout hglue 10 0 kit push button Previous new ActionCallback FlipGlyph this amp FlipGlyph prev Next the callback functions next and prev are defined along with the routine flip which actually alters the deck void FlipGlyph prev GlyphIndex cur deck_ gt card flip cur 1 deck gt count 1 void FlipGlyph next GlyphIndex cur deck_ gt card t flip cur deck gt count 0 cur J void FlipGlyph flip GlyphIndex cur deck_ gt flip_to cur patch gt redraw Groupkit Tutorial 3 2 93 Page 4 The Main Program Compiling the Program Groupkit Tutorial The main program is similar to main programs in InterViews The one change is that rather than instantiating a Session object a GroupSession is instantiated A GroupSession defines several GroupKit style attributes as well as parsing command line arguments received by a
70. upKit Tutorial 3 2 93 Page 21 Mon c include include include include include main program lt gk groupsession h gt lt InterViews window h gt lt stdio h gt usermon h lt IV look kit h gt int main int argc char argv GroupSesslon session new GroupSession UserMonitor argc argv sesslon gt run window new ApplicationWindow new UserMonitor WidgetKit instance session gt conference l GroupSketch Program EmptyGlyph h Header file for Conference Glyph ifndef emptyglyph h define _ emptyglyph h include lt gk confglyph h gt class EmptyGlyph public ConferenceGlyph public EmptyGlyph class Style class Conference int int F endif EmptyGlyph c Source file for Conference Glyph include emptyglyph h include include include include include include lt InterViews background h gt lt IV look kit h gt lt InterViews layout h gt lt InterViews bitmap h gt lt InterViews stencil h gt lt InterViews color h gt EmptyGlyph EmptyGlyph Style style Conference conf int x int y ConferenceGlyph nil style conf Bitmap bit new Bitmap const void nil x y for int i 0 i x i for int js0 j lt y j bit gt poke 0 x y body new Background new Stencil bit new Color 1 1 1 WidgetKit instance gt background GroupSketch c main program include lt gk groupsession h gt
Download Pdf Manuals
Related Search
Related Contents
17027101_1013 Akku_BS_Li NLO.book Untitled グレア スーパーホーン "service manual" User Manual 大阪支社を開設 Manual del usuario Higro-Termómetro de Precisión Modelo RH490 Copyright © All rights reserved.
Failed to retrieve file