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

input_mouse.h

Go to the documentation of this file.
00001 /*
00002         $Id: input_mouse.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_input_mouse
00016 #define header_input_mouse
00017 
00018 #include "API/Display/Input/input.h"
00019 #include "API/Display/Input/inputdevice.h"
00020 #include "API/Display/Input/inputcursor.h"
00021 #include "API/Display/Input/inputaxis.h"
00022 #include "API/Display/Input/inputbutton.h"
00023 #include "Core/System/Win32/init_win32.h"
00024 #include "API/Core/System/keep_alive.h"
00025 
00026 class CL_InputButton_Mouse_Win32;
00027 class CL_InputCursor_Mouse_Win32;
00028 class CL_InputAxis_Mouse_Win32;
00029 
00030 class CL_Mouse_Win32 : public CL_InputDevice, public CL_KeepAlive, public CL_Win32EventListener
00031 {
00032 protected:
00033         CL_InputButton_Mouse_Win32 **buttons;
00034         CL_InputCursor_Mouse_Win32 *cursor;
00035         CL_InputAxis_Mouse_Win32 *axes;
00036 
00037 public:
00038         CL_Mouse_Win32();
00039         virtual ~CL_Mouse_Win32();
00040 
00041         virtual char *get_name() const;
00042 
00043         virtual int get_num_buttons() const;
00044         virtual CL_InputButton *get_button(int button_num);
00045 
00046         virtual int get_num_axes() const;
00047         virtual CL_InputAxis *get_axis(int axis_num);
00048 
00049         virtual int get_num_hats() const;
00050         virtual CL_InputHat *get_hat(int hat_num);
00051 
00052         virtual int get_num_cursors() const;
00053         virtual CL_InputCursor *get_cursor(int cursor_num);
00054 
00055         virtual void keep_alive();
00056         virtual bool received_event(UINT uMsg, WPARAM wParam, LPARAM lParam);
00057 };
00058 
00059 class CL_InputButton_Mouse_Win32 : public CL_InputButton
00060 {
00061 public:
00062         int key;
00063         bool button_state;
00064 
00065         CL_InputButton_Mouse_Win32(int key);
00066         virtual ~CL_InputButton_Mouse_Win32();
00067 
00068         virtual bool is_pressed();
00069 };
00070 
00071 class CL_InputCursor_Mouse_Win32 : public CL_InputCursor
00072 {
00073 friend class CL_Mouse_Win32;
00074 
00075 protected:
00076         float x, y;
00077 
00078 public:
00079 
00080         CL_InputCursor_Mouse_Win32();
00081         virtual ~CL_InputCursor_Mouse_Win32();
00082 
00083         virtual float get_x();
00084         virtual float get_y();
00085         virtual float get_max_x();
00086         virtual float get_max_y();
00087 };
00088 
00089 class CL_InputAxis_Mouse_Win32 : public CL_InputAxis
00090 {
00091 friend class CL_Mouse_Win32;
00092 
00093 protected:
00094         float pos, center;
00095         
00096 public:
00097         CL_InputAxis_Mouse_Win32();
00098         virtual ~CL_InputAxis_Mouse_Win32();
00099 
00100         virtual float get_pos();
00101 };
00102 
00103 #endif

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