pingus-cvs
[Top][All Lists]
Advanced

[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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]