Laxkit  0.0.7.1
laxtuio.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (C) 2011 by Tom Lechner
22 //
23 #ifndef _LAX_LAXTUIO_H
24 #define _LAX_LAXTUIO_H
25 
26 
27 #include <lax/laxdevices.h>
28 #include <lo/lo.h>
29 
30 namespace Laxkit {
31 
32 
33 
34 int SetupTUIOListener(const char *port); //default port is 3333
35 
36 //-------------------------------------- TouchObject --------------------------------
37 class TouchObject : public LaxMouse
38 {
39  public:
40  int touch_id;
41  double x,y; //scaled to screen
42  double xv,yv,a;
43  int active;
44  char firsttime;
45  anXWindow *focus;
46 
47  TouchObject(int touchid);
48  virtual ~TouchObject();
49  virtual int usesX() { return 0; }
50  //virtual int grabDevice(anXWindow *win);
51  //virtual int ungrabDevice();
52  virtual int getInfo(anXWindow *win,
53  int *screen, anXWindow **child,
54  int *x, int *y, unsigned int *mods,
55  double *pressure, double *tiltx, double *tilty);
56  virtual int Set(double xx,double yy,double xxv,double yyv,double aa);
57 };
58 
59 //------------------------------------- TUIOListener ----------------------------------
60 class TUIOListener : public LaxDevice
61 {
62  protected:
63  int filedescriptor;
64  public:
65  int current_frame;
67  int firstinactive;
68  time_t last_fseq;
69 
70  lo_server_thread st;
71 
72  TUIOListener(const char *port);
73  virtual ~TUIOListener();
74  virtual int Start();
75  virtual int Stop();
76  virtual int tuioHandler( int argc, lo_arg **argv, const char *types);
77  virtual int fd();
78 };
79 
80 } //namespace Laxkit
81 
82 #endif
83 

Mon Feb 17 2014 11:52:56, Laxkit