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

mouse_ggi.h

Go to the documentation of this file.
00001 /*
00002         $Id: mouse_ggi.h,v 1.1 2001/03/06 15:09:21 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_ggi
00016 #define header_mouse_ggi
00017 
00018 #ifdef USE_GGI
00019 
00020 #include "API/Display/Input/inputdevice.h"
00021 #include "API/Display/Input/inputbutton.h"
00022 #include "API/Display/Input/inputcursor.h"
00023 #include "API/Display/Input/inputaxis.h"
00024 #include "API/Core/System/keep_alive.h"
00025 #include "Display/Display/GGI/display_ggi.h"
00026 #include "Core/System/Unix/init_linux.h"
00027 
00028 class CL_InputButton_Mouse_GGI : public CL_InputButton
00029 {
00030 public:
00031         bool button_state;
00032 
00033         CL_InputButton_Mouse_GGI();
00034         virtual ~CL_InputButton_Mouse_GGI();
00035 
00036         virtual bool is_pressed();
00037 };
00038 
00039 class CL_InputCursor_Mouse_GGI : public CL_InputCursor
00040 {
00041 friend class CL_Mouse_GGI;
00042 
00043 protected:
00044         CL_GGI_DisplayCard *card;
00045         float x, y;
00046 public:
00047 
00048         CL_InputCursor_Mouse_GGI(CL_GGI_DisplayCard *card);
00049         virtual ~CL_InputCursor_Mouse_GGI();
00050 
00051         virtual float get_x();
00052         virtual float get_y();
00053         virtual float get_max_x();
00054         virtual float get_max_y();
00055 };
00056 
00057 class CL_InputAxis_Mouse_GGI : public CL_InputAxis
00058 {
00059 friend class CL_Mouse_GGI;
00060 
00061 protected:
00062         float pos, center;
00063 public:
00064         
00065         CL_InputAxis_Mouse_GGI();
00066         ~CL_InputAxis_Mouse_GGI();
00067 
00068         virtual float get_pos();
00069 };
00070 
00071 class CL_Mouse_GGI : public CL_InputDevice, CL_KeepAlive
00072 {
00073 protected:
00074         CL_GGI_DisplayCard *card;
00075         CL_InputButton_Mouse_GGI **buttons;
00076         CL_InputCursor_Mouse_GGI *cursor;
00077         CL_InputAxis_Mouse_GGI *axes;
00078 
00079         ggi_visual_t m_vis;
00080 
00081 public:
00082         CL_Mouse_GGI(CL_GGI_DisplayCard *card);
00083         virtual ~CL_Mouse_GGI();
00084 
00085         virtual char *get_name() const { return "ggiMouse"; };
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_GGI */
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