ubit
macevents.hpp
1 /*************************************************************************
2  *
3  * macevents.hpp - UMS Server
4  * Ubit GUI Toolkit - Version 6.0
5  * (C) 2003-2008 Eric Lecolinet / ENST Paris / www.enst.fr/~elc/ubit
6  *
7  * ***********************************************************************
8  * COPYRIGHT NOTICE :
9  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
10  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
12  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
13  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
14  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
15  * ***********************************************************************/
16 
17 #ifndef _macevents_hpp_
18 #define _macevents_hpp_
19 #include "events.hpp"
20 #define __CARBONSOUND__ 1 // hack pour eviter un bug de mise a jour de MacOSX
21 #include <Carbon/Carbon.h>
22 
23 class MacEvents {
24 public:
26  ~MacEvents();
27 
28  void leaveLocalDisplay();
29  void enterLocalDisplay();
30 
31  void getPointer(long& x, long& y);
32  void warpPointer(long x, long y);
33  void warpPointerToCenter();
34 
35  void sendButton(MouseFlow&, long x, long y, int btn_id, bool press, bool move_ptr);
36  void sendMotion(MouseFlow&, long x, long y, bool move_ptr);
37  //void sendKey(MouseFlow&, unsigned long keysym, bool press, Pos* use_pos);
38 
39  static OSStatus processEventCB(EventHandlerCallRef, EventRef, void* macev);
40  void processMouseEvents(EventRef);
41  void processKeyEvents(EventRef);
42 
43  UMServer& ums;
44  WindowRef grabwin;
45  int scr_xcenter, scr_ycenter;
46  bool left_btn_pressed, right_btn_pressed;
47  EventHandlerUPP event_handler;
48 };
49 
50 #endif
UMS mouse event flow.
Definition: flow.hpp:40
UMS server main class.
Definition: umserver.hpp:152
Definition: macevents.hpp:23