Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

mouse_x11.h

Go to the documentation of this file.
00001 /*
00002         $Id: mouse_x11.h,v 1.1 2001/03/06 15:09:22 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifndef header_mouse_x11
00016 #define header_mouse_x11
00017 
00018 #ifdef USE_X11
00019 
00020 #include "API/Display/Input/inputdevice.h"
00021 #include "API/Display/Input/inputbutton.h"
00022 #include "API/Display/Input/inputaxis.h"
00023 #include "API/Display/Input/inputcursor.h"
00024 #include "Display/Display/X11/display_xwindow.h"
00025 #include "Core/System/Unix/init_linux.h"
00026 #include "API/Core/System/keep_alive.h"
00027 
00028 class CL_InputButton_Mouse_XWin : public CL_InputButton
00029 {
00030 public:
00031         bool button_state;
00032 
00033         CL_InputButton_Mouse_XWin();
00034         virtual ~CL_InputButton_Mouse_XWin();
00035 
00036         virtual bool is_pressed();
00037 };
00038 
00039 class CL_InputCursor_Mouse_XWin : public CL_InputCursor
00040 {
00041 friend class CL_Mouse_XWin;
00042 
00043 protected:
00044         CL_XWindow_CompatibleCard *card;
00045         float x, y;
00046 
00047 public:
00048 
00049         CL_InputCursor_Mouse_XWin(CL_XWindow_CompatibleCard *card);
00050         virtual ~CL_InputCursor_Mouse_XWin();
00051 
00052         virtual float get_x();
00053         virtual float get_y();
00054         virtual float get_max_x();
00055         virtual float get_max_y();
00056 };
00057 
00058 class CL_InputAxis_Mouse_XWin : public CL_InputAxis
00059 {
00060 friend class CL_Mouse_XWin;
00061 
00062 protected:
00063         float pos, center;
00064 
00065 public:
00066         CL_InputAxis_Mouse_XWin();
00067         virtual ~CL_InputAxis_Mouse_XWin();
00068 
00069         virtual float get_pos();
00070 };
00071 
00072 class CL_Mouse_XWin : public CL_InputDevice, CL_KeepAlive
00073 {
00074 protected:
00075         bool have_focus;
00076         CL_XWindow_CompatibleCard *card;
00077         CL_InputButton_Mouse_XWin **buttons;
00078         CL_InputCursor_Mouse_XWin *cursor;
00079         CL_InputAxis_Mouse_XWin *axes;
00080 
00081 public:
00082         CL_Mouse_XWin(CL_XWindow_CompatibleCard *card);
00083         virtual ~CL_Mouse_XWin();
00084 
00085         virtual char *get_name() const { return "XMouse"; };
00086 
00087         virtual int get_num_buttons() const;
00088         virtual CL_InputButton *get_button(int button_num);
00089 
00090         virtual int get_num_axes() const;
00091         virtual CL_InputAxis *get_axis(int axis_num);
00092 
00093         virtual int get_num_hats() const;
00094         virtual CL_InputHat *get_hat(int hat_num);
00095 
00096         virtual int get_num_cursors() const;
00097         virtual CL_InputCursor *get_cursor(int cursor_num);
00098 
00099         virtual void keep_alive();
00100 };
00101 
00102 #endif /* USE_X11 */
00103 
00104 #endif

Generated at Wed Apr 4 19:54:01 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001