umsproto.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  umsproto.hpp: UMS (Ubit Mouse/Message Server) protocol
00004  *  Ubit Project
00005  *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00006  *  (C) 1999-2006 / EricLecolinet / ENST Paris / http://www.enst.fr/~elc/ubit
00007  *
00008  * ***********************************************************************
00009  * COPYRIGHT NOTICE : 
00010  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00011  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00012  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00013  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00014  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00015  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00016  * ***********************************************************************
00017  * ==================================================== [(c)Elc] ======= *
00018  * ==================================================== ======== ======= */
00019 
00020 #ifndef _umsproto_hpp_
00021 #define _umsproto_hpp_
00022 //pragma ident  "@(#)umsproto.hpp       ubit:05.00.00"
00023 #include <ubit/usocket.hpp>
00024 namespace ubit {
00025 
00026 /* ==================================================== ===== ======= */
00030 #define UMS_ZEROCONF    "_ums._tcp."
00032 
00033 #define UMS_PORT          9666
00035   
00036 #define UMS_EVENT                (1UL<<14)
00037 
00041 // NOTE: cette valeur est choisie pour eviter des interferences avec les Button*Mask
00042 // et les Modifier*Mask. elle est < 1<<15 car cette valeur est definie par X
00043 // et car les Event.xxx.state sont des unsigned int.  
00044 
00045 #define UMS_WINDOW   "_UBIT_WINDOW"
00047 
00048 #define UMS_MESSAGE      "_UBIT_MESSAGE"
00050 
00051 /* ==================================================== ===== ======= */
00069 struct UMSrequest : public UOutbuf {
00070   enum RequestType { 
00071     KEY_MOUSE_CTRL    = 1,   
00072     SEND_EVENT        = 2,   
00073     SEND_MESSAGE      = 3,
00074     SET_NEIGHBOR      = 8,
00075     CALIBRATE         = 9,
00076     BROWSE_NEIGHBORS  = 10,
00077     BROWSE_SERVERS    = 11,
00078     RESOLVE_SERVER    = 12,
00079     RESOLVE_WINDOW    = 13,
00080     BROWSE_WINDOWS    = 14,
00081     GET_SCREEN_SIZE   = 20,
00082     MOVE_BACK_POINTER = 30,
00083     FILE_TRANSFERT    = 33,  //aka '!'
00084     OPEN_DEVICE       = 40,
00085     CLOSE_DEVICE      = 41,
00086     TACTOS            = 50,
00087     REQUEST_COUNT/*NO COMMA*/
00088   };
00089   UMSrequest(unsigned char reqtype) {buffer[outpos++] = reqtype;}
00090 };
00091 
00092 }
00093 #endif
00094 /* ==================================================== [TheEnd] ======= */
00095 /* ==================================================== [(c)Elc] ======= */
00096 

Generated on Mon Jan 29 00:20:39 2007 for Ubit by  doxygen 1.4.7