24 #ifndef _umserver_hpp_ 25 #define _umserver_hpp_ 30 #include <ubit/udefs.hpp> 31 #include <ubit/usocket.hpp> 34 #if (defined(__MACH__) && defined(__APPLE__)) 40 typedef unsigned long WindowID;
41 typedef unsigned long AtomID;
42 typedef unsigned long CursorID;
43 typedef unsigned long TimeID;
44 typedef union _XEvent XEvent;
45 typedef struct _XDisplay XDisplay;
51 MouseMiddleID = (1<<9),
52 MouseRightID = (1<<10),
54 WheelDownID = (1<<12),
55 ALT_GRAPH_MASK = 0x2000
62 typedef std::list<RemoteUMS*> RemoteUMSList;
68 ActionKey(
unsigned int keycode,
int modifier,
69 void (*press_action)(
class UMServer&, XEvent&),
70 void (*release_action)(
class UMServer&, XEvent&));
74 void (*press_action)(
class UMServer&, XEvent&);
75 void (*release_action)(
class UMServer&, XEvent&);
83 Pos(
int rx,
int ry,
int wx,
int wy, WindowID win,
84 bool in_ubitwin,
int win_sock);
99 enum State {HIDE=0, SHOW=1, CREATE=2, DESTROY=3};
102 Win(WindowID win, WindowID client_win);
105 bool is_prop_init, is_shown, is_override, is_input_only, is_icon;
107 WindowID win, client_win;
108 unsigned char* ubit_prop;
112 Win& operator=(
const Win&);
115 typedef std::list<Win*> WinList;
125 bool browse_servers, browse_neigbors, browse_windows;
128 typedef std::list<Cnx*> CnxList;
134 static const int EDGE_THICKNESS = 1;
136 bool isEdge(WindowID);
137 void enterEdge(WindowID,
int x_root,
int y_root);
139 void moveNativePointerBackHome(
bool center);
143 int x_crossings, y_crossings;
144 int x_delta, y_delta;
145 WindowID left_edge, top_edge, right_edge, bottom_edge, h_where_win, v_where_win;
155 static const TimeID NEIGHBOR_RETRY_DELAY = 6*1000;
159 UMServer(
const char* display_name,
int ums_port,
bool reuse_address,
160 int cursor_mode,
int neighbor_mode);
179 void setPublicDir(
const char* s);
180 const std::string& getPublicDir() {
return public_dir;}
185 void setNativeButton(
int raw_btn_number,
unsigned int raw_mod_mask,
186 unsigned int to_btn_mask,
unsigned int ro_mod_mask);
195 void setActionKey(
unsigned int keycode,
int modifier,
196 void (*press_action)(
class UMServer&, XEvent&),
197 void (*release_action)(
class UMServer&, XEvent&));
204 RemoteUMSList::iterator findRemoteUMS(
const char* name);
205 RemoteUMS* addRemoteUMS(
const char* name,
const char* address,
207 void removeRemoteUMS(
const char* name);
209 RemoteUMS* getNeighborUMS(
int pos)
const;
210 RemoteUMS* setNeighborUMS(
int pos,
const char* name);
212 void sendRemoteUMSState(
RemoteUMS*,
int state);
215 void sendRemoteUMSList(
Cnx* to);
218 void sendNeighborList(
Cnx* to);
219 void sendNeighborState(
RemoteUMS*,
int pos);
224 std::string resolveDeviceName(
const char*);
290 CnxList::iterator findCnxIt(
USocket*);
298 XDisplay* getDisplay()
const {
return xdisplay;}
299 XScreen* getScreen()
const {
return xscreen;}
300 WindowID getRoot()
const {
return xrootwin;}
301 int getXConnection()
const {
return xconnection;}
302 long getScreenWidth()
const;
303 long getScreenHeight()
const;
304 int getScreenDepth()
const;
312 Win* addWin(WindowID,
bool notify);
313 void removeWin(WindowID,
bool notify);
314 void reorderWin(WinList::iterator& from,
const WinList::iterator& to);
316 void retrieveXWindows();
317 void raiseXWindows();
319 void sendWindowState(
Win*,
int state);
320 void sendWindowList(
Cnx* to);
322 Win* findWin(
const char* name);
323 Win* findWin(WindowID);
324 WinList::iterator findWinIt(WindowID);
327 bool getXWin(
int root_x,
int root_y,
Pos&,
bool check_props);
330 bool getXSubwin(
const Pos& wp,
int x,
int y,
Pos&);
333 bool getXWinPos(
const Win* w,
Pos&);
339 bool isPointer(WindowID);
342 void moveNativePointerBackHome(
bool center);
348 static TimeID getTime();
351 WinList& getWins() {
return wins;}
352 CnxList& getCnxs() {
return cnxs;}
357 AtomID _WM_DELETE_WINDOW;
361 bool initX(
const char* display_name,
int cursor_mode,
int neighbor_mode);
362 void getAndProcessXEvents();
364 bool addSourceToMainLoop(
USocket*);
377 CursorID root_cursor, grab_cursor;
382 std::string hostname, system, public_dir;
EventSource & natsource
the native event source.
Definition: umserver.hpp:383
Definition: umserver.hpp:67
bool isInit() const
checks if the UMS is initialized.
Definition: umserver.hpp:169
RemoteUMSList remotes
the list of RemoteUMS that are currently browsed.
Definition: umserver.hpp:398
Definition: zeroconf.hpp:30
window (on the same display).
Definition: umserver.hpp:98
UInbuf (.
Definition: usocket.hpp:264
std::vector< ActionKey > action_keys
predefined keys that perform some action
Definition: umserver.hpp:404
UMS mouse event flow.
Definition: flow.hpp:40
UServerSocket.
Definition: usocket.hpp:156
UMS event flow.
Definition: flow.hpp:24
connection with a remote appli.
Definition: umserver.hpp:120
position on the screen
Definition: umserver.hpp:81
UMS server main class.
Definition: umserver.hpp:152
WinList wins
list of the windows of this X server
Definition: umserver.hpp:395
std::vector< EventSource * > sources
list of event sources (= the devices that are connected to the eflows)
Definition: umserver.hpp:386
std::vector< EventFlow * > eflows
list of event flows (eflows[0] corresponds to the standard X server)
Definition: umserver.hpp:389
Ubit Simple Sockets.
Definition: usocket.hpp:64
Remote UMServer.
Definition: remoteserver.hpp:24
screen edges.
Definition: umserver.hpp:133
Definition: uhardfont.hpp:31
UMS event source.
Definition: source.hpp:46
CnxList cnxs
lists of connections (= connected applications) and their opened windows
Definition: umserver.hpp:392
settings of the calibration window (used for absolute positioning devices such as the MIMIO) ...
Definition: calib.hpp:24
RemoteUMS * l_neighbor
neigbhors of this UMS server.
Definition: umserver.hpp:401