Back to index

unity  6.0.0
GeisAdapterMock.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012 Canonical Ltd.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License version 3, as published
00006  * by the  Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranties of
00010  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * version 3 along with this program.  If not, see
00015  * <http://www.gnu.org/licenses/>
00016  *
00017  * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
00018  *
00019  */
00020 
00021 #ifndef GEISADAPTER_MOCK_H
00022 #define GEISADAPTER_MOCK_H
00023 
00024 #include <sigc++/sigc++.h>
00025 #include <X11/Xlib.h>
00026 
00027 class GeisAdapterMock : public sigc::trackable
00028 {
00029 public:
00030   static GeisAdapterMock& Instance();
00031 
00032   ~GeisAdapterMock() {}
00033 
00034   typedef struct _GeisTapData
00035   {
00036     int id;
00037     int device_id;
00038     Window window;
00039     int touches;
00040     int timestamp;
00041     float focus_x;
00042     float focus_y;
00043     int tap_length_ms;
00044     float position_x;
00045     float position_y;
00046     float bound_x1;
00047     float bound_y1;
00048     float bound_x2;
00049     float bound_y2;
00050   } GeisTapData;
00051 
00052   typedef struct _GeisDragData
00053   {
00054     int id;
00055     int device_id;
00056     Window window;
00057     int touches;
00058     int timestamp;
00059     float focus_x;
00060     float focus_y;
00061     float delta_x;
00062     float delta_y;
00063     float velocity_x;
00064     float velocity_y;
00065     float position_x;
00066     float position_y;
00067     float bound_x1;
00068     float bound_y1;
00069     float bound_x2;
00070     float bound_y2;
00071   } GeisDragData;
00072 
00073   typedef struct _GeisRotateData
00074   {
00075     int id;
00076     int device_id;
00077     Window window;
00078     int touches;
00079     int timestamp;
00080     float focus_x;
00081     float focus_y;
00082     float angle;
00083     float angle_delta;
00084     float angle_velocity;
00085     float bound_x1;
00086     float bound_y1;
00087     float bound_x2;
00088     float bound_y2;
00089   } GeisRotateData;
00090 
00091   typedef struct _GeisPinchData
00092   {
00093     int id;
00094     int device_id;
00095     Window window;
00096     int touches;
00097     int timestamp;
00098     float focus_x;
00099     float focus_y;
00100     float radius;
00101     float radius_delta;
00102     float radius_velocity;
00103     float bound_x1;
00104     float bound_y1;
00105     float bound_x2;
00106     float bound_y2;
00107   } GeisPinchData;
00108 
00109   typedef struct _GeisTouchData
00110   {
00111     int id;
00112     int device_id;
00113     Window window;
00114     int touches;
00115     int timestamp;
00116     float focus_x;
00117     float focus_y;
00118     float bound_x1;
00119     float bound_y1;
00120     float bound_x2;
00121     float bound_y2;
00122   } GeisTouchData;
00123 
00124   sigc::signal<void, GeisTapData*> tap;
00125 
00126   sigc::signal<void, GeisDragData*> drag_start;
00127   sigc::signal<void, GeisDragData*> drag_update;
00128   sigc::signal<void, GeisDragData*> drag_finish;
00129 
00130   sigc::signal<void, GeisRotateData*> rotate_start;
00131   sigc::signal<void, GeisRotateData*> rotate_update;
00132   sigc::signal<void, GeisRotateData*> rotate_finish;
00133 
00134   sigc::signal<void, GeisPinchData*> pinch_start;
00135   sigc::signal<void, GeisPinchData*> pinch_update;
00136   sigc::signal<void, GeisPinchData*> pinch_finish;
00137 
00138   sigc::signal<void, GeisTouchData*> touch_start;
00139   sigc::signal<void, GeisTouchData*> touch_update;
00140   sigc::signal<void, GeisTouchData*> touch_finish;
00141 
00142 private:
00143   GeisAdapterMock() {}
00144 
00145   static GeisAdapterMock* _default;
00146 
00147 };
00148 #endif