[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/input/buttons Makefile.am, 1.3, 1.4 j
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/input/buttons Makefile.am, 1.3, 1.4 joystick_button.cxx, 1.3, 1.4 key_button.cxx, 1.3, 1.4 mouse_button.cxx, 1.3, 1.4 mouse_button.hxx, 1.5, 1.6 |
Date: |
Sun, 19 Oct 2003 14:25:50 +0200 |
Update of /var/lib/cvs/Games/Pingus/src/input/buttons
In directory dark:/tmp/cvs-serv19578/input/buttons
Modified Files:
Makefile.am joystick_button.cxx key_button.cxx
mouse_button.cxx mouse_button.hxx
Log Message:
- some more stuff, still not much useable
Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile.am 9 Sep 2002 09:38:48 -0000 1.3
+++ Makefile.am 19 Oct 2003 12:25:47 -0000 1.4
@@ -17,6 +17,7 @@
noinst_LIBRARIES = libpingus_input_buttons.a
+libpingus_input_buttons_a_CPPFLAGS = @PINGUS_CFLAGS@
libpingus_input_buttons_a_SOURCES = \
double_button.hxx double_button.cxx \
dummy_button.hxx \
Index: joystick_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/joystick_button.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- joystick_button.cxx 19 Apr 2003 10:23:19 -0000 1.3
+++ joystick_button.cxx 19 Oct 2003 12:25:47 -0000 1.4
@@ -17,38 +17,37 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <ClanLib/Display/Input/input.h>
-#include <ClanLib/Display/Input/inputdevice.h>
-#include <ClanLib/Display/Input/inputbutton.h>
+//#include <ClanLib/Display/input.h>
+#include <ClanLib/Display/input_device.h>
+//#include <ClanLib/Display/input_button.h>
#include "joystick_button.hxx"
#include "../../string_converter.hxx"
#include "../../pingus_error.hxx"
namespace Input {
+namespace Buttons {
- namespace Buttons {
-
- JoystickButton::JoystickButton(int id_, int button_) : id(id_),
button(button_)
- {
- if (static_cast<unsigned int>(id) >= CL_Input::joysticks.size())
- PingusError::raise("JoystickButton: Invalid joystick id: " +
to_string(id));
+JoystickButton::JoystickButton(int id_, int button_) : id(id_), button(button_)
+{
+ if (static_cast<unsigned int>(id) >= CL_Input::joysticks.size())
+ PingusError::raise("JoystickButton: Invalid joystick id: " +
to_string(id));
- if (button > CL_Input::joysticks[id]->get_num_buttons())
- PingusError::raise("JoystickButton: Invalid joystick button id: " +
to_string(button));
- }
+ if (button > CL_Input::joysticks[id]->get_num_buttons())
+ PingusError::raise("JoystickButton: Invalid joystick button id: " +
to_string(button));
+}
- void
- JoystickButton::update(float)
- {
- }
+void
+JoystickButton::update(float)
+{
+}
- bool
- JoystickButton::is_pressed() const
- {
- return CL_Input::joysticks[id]->get_button(button)->is_pressed();
- }
+bool
+JoystickButton::is_pressed() const
+{
+ return CL_Input::joysticks[id]->get_button(button)->is_pressed();
+}
- }
+}
}
/* EOF */
Index: key_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/key_button.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- key_button.cxx 19 Jun 2003 11:00:10 -0000 1.3
+++ key_button.cxx 19 Oct 2003 12:25:47 -0000 1.4
@@ -17,48 +17,48 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <ClanLib/Display/Input/input.h>
+//#include <ClanLib/Display/input.h>
#include "key_button.hxx"
#include <iostream>
namespace Input {
+namespace Buttons {
- namespace Buttons {
-
- KeyButton::KeyButton (int button_) : button(button_),
- key_press
(CL_Input::sig_button_press ().connect(this,
&Input::Buttons::KeyButton::key_press_handler)),
-
key_release(CL_Input::sig_button_release().connect(this,
&Input::Buttons::KeyButton::key_release_handler)),
- pressed(false)
- {
- }
+KeyButton::KeyButton (int button_)
+ : button(button_),
+ key_press (CL_Input::sig_button_press ().connect(this,
&Input::Buttons::KeyButton::key_press_handler)),
+ key_release(CL_Input::sig_button_release().connect(this,
&Input::Buttons::KeyButton::key_release_handler)),
+ pressed(false)
+{
+}
- void
- KeyButton::update (float)
- {
- }
+void
+KeyButton::update (float)
+{
+}
- bool
- KeyButton::is_pressed () const
- {
- return pressed;
- }
+bool
+KeyButton::is_pressed () const
+{
+ return pressed;
+}
- void
- KeyButton::key_press_handler (CL_InputDevice*, const CL_Key& key)
- {
- if (key.id == button)
- pressed = true;
- }
+void
+KeyButton::key_press_handler (CL_InputDevice*, const CL_Key& key)
+{
+ if (key.id == button)
+ pressed = true;
+}
- void
- KeyButton::key_release_handler (CL_InputDevice*, const CL_Key& key)
- {
- if (key.id == button)
- pressed = false;
- }
+void
+KeyButton::key_release_handler (CL_InputDevice*, const CL_Key& key)
+{
+ if (key.id == button)
+ pressed = false;
+}
- }
+}
}
/* EOF */
Index: mouse_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/mouse_button.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mouse_button.cxx 19 Jun 2003 11:00:10 -0000 1.3
+++ mouse_button.cxx 19 Oct 2003 12:25:47 -0000 1.4
@@ -17,86 +17,85 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <ClanLib/Display/Input/key.h>
-#include <ClanLib/Display/Input/input.h>
-#include <ClanLib/Display/Input/mouse.h>
+#include <ClanLib/Display/input_event.h>
+#include <ClanLib/Display/keys.h>
+#include <ClanLib/Display/mouse.h>
#include "mouse_button.hxx"
#include "../../pingus_error.hxx"
namespace Input {
-
- namespace Buttons {
+namespace Buttons {
- void press_handler (const CL_Key&);
- void release_handler (const CL_Key&);
-
+void press_handler (const CL_Key&);
+void release_handler (const CL_Key&);
- MouseButton::MouseButton (int button_) : button(button_),
- button_press_slot
(CL_Mouse::sig_button_press ().connect(this,
&Input::Buttons::MouseButton::press_handler)),
-
button_release_slot(CL_Mouse::sig_button_release().connect(this,
&Input::Buttons::MouseButton::release_handler)),
- pressed(false)
- {
- if (button > CL_Input::pointers[0]->get_num_buttons())
- PingusError::raise("MouseButton: Invalid button id");
- }
+MouseButton::MouseButton (int button_)
+ : button(button_),
+ button_press_slot (CL_Mouse::sig_button_press ().connect(this,
&Input::Buttons::MouseButton::press_handler)),
+ button_release_slot(CL_Mouse::sig_button_release().connect(this,
&Input::Buttons::MouseButton::release_handler)),
+ pressed(false)
+{
+ if (button > CL_Input::pointers[0]->get_num_buttons())
+ PingusError::raise("MouseButton: Invalid button id");
+}
- void
- MouseButton::update (float)
- {
- }
+void
+MouseButton::update (float)
+{
+}
- void
- MouseButton::press_handler (const CL_Key& signal) // may not be a member
function since CL_Signal doesn't take a member function pointer
+void
+MouseButton::press_handler (const CL_InputEvent& signal) // may not be a
member function since CL_Signal doesn't take a member function pointer
+{
+ switch (button)
{
- switch (button)
- {
- case 0:
- if (signal.id == CL_MOUSE_LEFTBUTTON)
- pressed = true;
- break;
+ case 0:
+ if (signal.id == CL_MOUSE_LEFT)
+ pressed = true;
+ break;
- case 1:
- if (signal.id == CL_MOUSE_MIDDLEBUTTON)
- pressed = true;
- break;
+ case 1:
+ if (signal.id == CL_MOUSE_MIDDLE)
+ pressed = true;
+ break;
- case 2:
- if (signal.id == CL_MOUSE_RIGHTBUTTON)
- pressed = true;
- break;
+ case 2:
+ if (signal.id == CL_MOUSE_RIGHT)
+ pressed = true;
+ break;
- default: // only three buttons support so far
- break;
- }
+ default: // only three buttons support so far
+ break;
}
+}
- void
- MouseButton::release_handler (const CL_Key& signal) // may not be a member
function since CL_Signal doesn't take a member function pointer
+void
+MouseButton::release_handler (const CL_InputEvent& signal) // may not be a
member function since CL_Signal doesn't take a member function pointer
+{
+ switch (button)
{
- switch (button)
- {
- case 0:
- if (signal.id == CL_MOUSE_LEFTBUTTON)
- pressed = false;
- break;
+ case 0:
+ if (signal.id == CL_MOUSE_LEFT)
+ pressed = false;
+ break;
- case 1:
- if (signal.id == CL_MOUSE_MIDDLEBUTTON)
- pressed = false;
- break;
+ case 1:
+ if (signal.id == CL_MOUSE_MIDDLE)
+ pressed = false;
+ break;
- case 2:
- if (signal.id == CL_MOUSE_RIGHTBUTTON)
- pressed = false;
- break;
+ case 2:
+ if (signal.id == CL_MOUSE_RIGHT)
+ pressed = false;
+ break;
- default: // only three buttons support so far
- break;
- }
+ default: // only three buttons support so far
+ break;
}
+}
- }
+}
}
/* EOF */
Index: mouse_button.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/mouse_button.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mouse_button.hxx 19 Jun 2003 11:00:10 -0000 1.5
+++ mouse_button.hxx 19 Oct 2003 12:25:47 -0000 1.6
@@ -26,37 +26,36 @@
class CL_Key;
namespace Input {
+namespace Buttons {
- namespace Buttons {
-
- /**
- @brief represents a mouse button
+/**
+ @brief represents a mouse button
- XML definition: <mouse-button button="button num"/>
- */
- class MouseButton : public Button {
+ XML definition: <mouse-button button="button num"/>
+*/
+class MouseButton : public Button {
- private:
- int button;
- CL_Slot button_press_slot;
- CL_Slot button_release_slot;
- bool pressed;
+private:
+ int button;
+ CL_Slot button_press_slot;
+ CL_Slot button_release_slot;
+ bool pressed;
- public:
- MouseButton (int button_);
+public:
+ MouseButton (int button_);
- virtual bool is_pressed () const { return pressed; }
- virtual void update (float);
+ virtual bool is_pressed () const { return pressed; }
+ virtual void update (float);
- private:
- void press_handler (const CL_Key& number);
- void release_handler (const CL_Key& number);
+private:
+ void press_handler (const CL_Key& number);
+ void release_handler (const CL_Key& number);
- MouseButton (const MouseButton&);
- MouseButton& operator= (const MouseButton&);
- };
+ MouseButton (const MouseButton&);
+ MouseButton& operator= (const MouseButton&);
+};
- }
+}
}
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/input/buttons Makefile.am, 1.3, 1.4 joystick_button.cxx, 1.3, 1.4 key_button.cxx, 1.3, 1.4 mouse_button.cxx, 1.3, 1.4 mouse_button.hxx, 1.5, 1.6,
Ingo Ruhnke <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/gui buffer_graphic_context.cxx, 1.3, 1.4 buffer_graphic_context.hxx, 1.4, 1.5 display_graphic_context.cxx, 1.8, 1.9 display_graphic_context.hxx, 1.6, 1.7 game_delta_recorder.hxx, 1.2, 1.3 graphic_context.hxx, 1.6, 1.7 gui_manager.hxx, 1.14, 1.15 gui_screen.cxx, 1.2, 1.3 input_debug_screen.cxx, 1.2, 1.3 input_debug_screen.hxx, 1.2, 1.3 root_gui_manager.cxx, 1.9, 1.10 screen.hxx, 1.3, 1.4 screen_manager_impl.hxx, 1.2, 1.3
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am, 1.154, 1.155 blitter.cxx, 1.31, 1.32 blitter.hxx, 1.11, 1.12 blitter_impl.hxx, 1.13, 1.14 indexed_canvas.hxx, 1.4, 1.5 loading.hxx, 1.7, 1.8 menu_button.hxx, 1.4, 1.5 pingu_map.cxx, 1.8, 1.9 pingus_counter.hxx, 1.11, 1.12 pingus_counter_bar.cxx, 1.7, 1.8 pingus_main.cxx, 1.99, 1.100 pingus_map_manager.cxx, 1.4, 1.5 pingus_menu.cxx, 1.21, 1.22 pingus_menu_manager.cxx, 1.26, 1.27 pingus_resource.hxx, 1.16, 1.17 playfield.cxx, 1.36, 1.37 playfield_view.hxx, 1.9, 1.10 plt_xml.cxx, 1.12, 1.13 prefab.cxx, 1.7, 1.8 resource_modifier.cxx, 1.3, 1.4 screenshot.cxx, 1.15, 1.16 smallmap.hxx, 1.19, 1.20 theme_selector.hxx, 1.7, 1.8 vector.cxx, 1.5, 1.6 view.cxx, 1.14, 1.15 view.hxx, 1.13, 1.14 worldobj.cxx, 1.12, 1.13 worldobj_data_factory.hxx, 1.9, 1.10 xml_plf.cxx, 1.39, 1.40
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/gui buffer_graphic_context.cxx, 1.3, 1.4 buffer_graphic_context.hxx, 1.4, 1.5 display_graphic_context.cxx, 1.8, 1.9 display_graphic_context.hxx, 1.6, 1.7 game_delta_recorder.hxx, 1.2, 1.3 graphic_context.hxx, 1.6, 1.7 gui_manager.hxx, 1.14, 1.15 gui_screen.cxx, 1.2, 1.3 input_debug_screen.cxx, 1.2, 1.3 input_debug_screen.hxx, 1.2, 1.3 root_gui_manager.cxx, 1.9, 1.10 screen.hxx, 1.3, 1.4 screen_manager_impl.hxx, 1.2, 1.3
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am, 1.154, 1.155 blitter.cxx, 1.31, 1.32 blitter.hxx, 1.11, 1.12 blitter_impl.hxx, 1.13, 1.14 indexed_canvas.hxx, 1.4, 1.5 loading.hxx, 1.7, 1.8 menu_button.hxx, 1.4, 1.5 pingu_map.cxx, 1.8, 1.9 pingus_counter.hxx, 1.11, 1.12 pingus_counter_bar.cxx, 1.7, 1.8 pingus_main.cxx, 1.99, 1.100 pingus_map_manager.cxx, 1.4, 1.5 pingus_menu.cxx, 1.21, 1.22 pingus_menu_manager.cxx, 1.26, 1.27 pingus_resource.hxx, 1.16, 1.17 playfield.cxx, 1.36, 1.37 playfield_view.hxx, 1.9, 1.10 plt_xml.cxx, 1.12, 1.13 prefab.cxx, 1.7, 1.8 resource_modifier.cxx, 1.3, 1.4 screenshot.cxx, 1.15, 1.16 smallmap.hxx, 1.19, 1.20 theme_selector.hxx, 1.7, 1.8 vector.cxx, 1.5, 1.6 view.cxx, 1.14, 1.15 view.hxx, 1.13, 1.14 worldobj.cxx, 1.12, 1.13 worldobj_data_factory.hxx, 1.9, 1.10 xml_plf.cxx, 1.39, 1.40
- Index(es):