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 Makefile.am,1.17,1.18 axis_fact


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/input Makefile.am,1.17,1.18 axis_factory.cxx,1.8,1.9 axis_factory.hxx,1.4,1.5 button_factory.cxx,1.7,1.8 button_factory.hxx,1.4,1.5 controller.cxx,1.20,1.21 controller.hxx,1.11,1.12 pointer_factory.cxx,1.5,1.6 pointer_factory.hxx,1.2,1.3 scroller_factory.cxx,1.6,1.7 scroller_factory.hxx,1.3,1.4 axis.hxx,1.6,NONE axis_pointer.cxx,1.7,NONE axis_pointer.hxx,1.7,NONE axis_scroller.cxx,1.5,NONE axis_scroller.hxx,1.3,NONE button.hxx,1.6,NONE button_axis.cxx,1.6,NONE button_axis.hxx,1.5,NONE double_button.cxx,1.2,NONE double_button.hxx,1.3,NONE dummy_axis.hxx,1.3,NONE dummy_button.hxx,1.3,NONE dummy_pointer.hxx,1.3,NONE dummy_scroller.hxx,1.3,NONE inverted_axis.cxx,1.4,NONE inverted_axis.hxx,1.6,NONE inverted_scroller.cxx,1.2,NONE inverted_scroller.hxx,1.3,NONE joystick_axis.cxx,1.7,NONE joystick_axis.hxx,1.5,NONE joystick_button.cxx,1.4,NONE joystick_button.hxx,1.4,NONE joystick_scroller.cxx,1.3,NONE joystick_scroller.hxx,1.3,NONE key_button.cxx,1.2,NONE key_button.hxx,1.4,NONE mouse_axis.cxx,1.4,NONE mouse_axis.hxx,1.6,NONE mouse_button.cxx,1.4,NONE mouse_button.hxx,1.4,NONE mouse_pointer.cxx,1.4,NONE mouse_pointer.hxx,1.5,NONE mouse_scroller.cxx,1.3,NONE mouse_scroller.hxx,1.3,NONE multiple_axis.cxx,1.3,NONE multiple_axis.hxx,1.4,NONE multiple_button.cxx,1.4,NONE multiple_button.hxx,1.6,NONE multiple_pointer.cxx,1.6,NONE multiple_pointer.hxx,1.5,NONE multiple_scroller.cxx,1.2,NONE multiple_scroller.hxx,1.3,NONE pointer.hxx,1.7,NONE pointer_scroller.cxx,1.2,NONE pointer_scroller.hxx,1.3,NONE scroller.hxx,1.4,NONE triple_button.cxx,1.2,NONE triple_button.hxx,1.3,NONE
Date: 24 Aug 2002 11:37:33 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/input
In directory dark:/tmp/cvs-serv15327/src/input

Modified Files:
        Makefile.am axis_factory.cxx axis_factory.hxx 
        button_factory.cxx button_factory.hxx controller.cxx 
        controller.hxx pointer_factory.cxx pointer_factory.hxx 
        scroller_factory.cxx scroller_factory.hxx 
Removed Files:
        axis.hxx axis_pointer.cxx axis_pointer.hxx axis_scroller.cxx 
        axis_scroller.hxx button.hxx button_axis.cxx button_axis.hxx 
        double_button.cxx double_button.hxx dummy_axis.hxx 
        dummy_button.hxx dummy_pointer.hxx dummy_scroller.hxx 
        inverted_axis.cxx inverted_axis.hxx inverted_scroller.cxx 
        inverted_scroller.hxx joystick_axis.cxx joystick_axis.hxx 
        joystick_button.cxx joystick_button.hxx joystick_scroller.cxx 
        joystick_scroller.hxx key_button.cxx key_button.hxx 
        mouse_axis.cxx mouse_axis.hxx mouse_button.cxx 
        mouse_button.hxx mouse_pointer.cxx mouse_pointer.hxx 
        mouse_scroller.cxx mouse_scroller.hxx multiple_axis.cxx 
        multiple_axis.hxx multiple_button.cxx multiple_button.hxx 
        multiple_pointer.cxx multiple_pointer.hxx 
        multiple_scroller.cxx multiple_scroller.hxx pointer.hxx 
        pointer_scroller.cxx pointer_scroller.hxx scroller.hxx 
        triple_button.cxx triple_button.hxx 
Log Message:
moved input devices in own subdirs / namespaces


Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Makefile.am 12 Jul 2002 15:08:01 -0000      1.17
+++ Makefile.am 24 Aug 2002 11:37:29 -0000      1.18
@@ -17,45 +17,22 @@
 
 noinst_LIBRARIES = libpingus_input.a
 
+SUBDIRS = \
+        axes \
+       buttons \
+       pointers \
+       scrollers
+
 libpingus_input_a_SOURCES =       \
-        axis.hxx \
        axis_event.hxx \
        axis_factory.hxx axis_factory.cxx \
-        axis_pointer.hxx axis_pointer.cxx \
-       axis_scroller.hxx axis_scroller.cxx \
-       button.hxx  \
-        button_axis.hxx button_axis.cxx \
        button_event.hxx \
        button_factory.hxx button_factory.cxx \
        controller.hxx controller.cxx \
-       double_button.hxx double_button.cxx \
-       dummy_axis.hxx \
-       dummy_button.hxx \
-       dummy_pointer.hxx \
-       dummy_scroller.hxx \
        event.hxx \
-       inverted_axis.hxx inverted_axis.cxx \
-       inverted_scroller.hxx inverted_scroller.cxx \
-       joystick_axis.hxx joystick_axis.cxx \
-        joystick_button.hxx joystick_button.cxx \
-       joystick_scroller.hxx joystick_scroller.cxx \
-        key_button.hxx key_button.cxx \
-        key_helper.hxx key_helper.cxx \
-       mouse_axis.hxx mouse_axis.cxx \
-       mouse_button.hxx mouse_button.cxx \
-        mouse_pointer.hxx mouse_pointer.cxx \
-       mouse_scroller.hxx mouse_scroller.cxx \
-       multiple_axis.hxx multiple_axis.cxx \
-       multiple_button.hxx multiple_button.cxx \
-       multiple_pointer.hxx multiple_pointer.cxx \
-       multiple_scroller.hxx multiple_scroller.cxx \
-        pointer.hxx \
        pointer_event.hxx \
        pointer_factory.hxx pointer_factory.cxx \
-       pointer_scroller.hxx pointer_scroller.cxx \
-       scroller.hxx \
        scroller_factory.hxx scroller_factory.cxx \
-       scroll_event.hxx \
-       triple_button.hxx triple_button.cxx
+       scroll_event.hxx 
 
 # EOF #

Index: axis_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axis_factory.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- axis_factory.cxx    22 Aug 2002 00:36:30 -0000      1.8
+++ axis_factory.cxx    24 Aug 2002 11:37:29 -0000      1.9
@@ -21,16 +21,19 @@
 #include "../xml_helper.hxx"
 #include "../pingus_error.hxx"
 #include "axis_factory.hxx"
-#include "button.hxx"
-#include "button_axis.hxx"
 #include "button_factory.hxx"
-#include "inverted_axis.hxx"
-#include "joystick_axis.hxx"
-#include "mouse_axis.hxx"
-#include "multiple_axis.hxx"
+#include "axes/button_axis.hxx"
+#include "axes/inverted_axis.hxx"
+#include "axes/joystick_axis.hxx"
+#include "axes/mouse_axis.hxx"
+#include "axes/multiple_axis.hxx"
+#include "buttons/button.hxx"
 
 namespace Input {
 
+  using namespace Axes;
+  using Buttons::Button;
+
   Axis* AxisFactory::create(xmlNodePtr cur)
   {
     if (!cur)
@@ -38,31 +41,31 @@
 
     if ( ! strcmp(reinterpret_cast<const char*>(cur->name), "button-axis"))
       return button_axis(cur);
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"inverted-axis"))
       return inverted_axis(cur);
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"joystick-axis"))
       return joystick_axis(cur);
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), "mouse-axis"))
       return mouse_axis(cur);
 
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"multiple-axis"))
       return multiple_axis(cur->children);
-      
+    
     else
       PingusError::raise(std::string("Unknown axis type: ") + ((cur->name) ? 
reinterpret_cast<const char*>(cur->name) : ""));
-      
+    
     return 0; // never reached
   }
-  
+
   Axis* AxisFactory::button_axis (xmlNodePtr cur)
   {
     char * angle_str = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("angle")));
     if (!angle_str)
       PingusError::raise("ButtonAxis without angle parameter");
-      
+    
     float angle = strtod(angle_str, reinterpret_cast<char**>(NULL));
     xmlFree(angle_str);
 
@@ -71,7 +74,7 @@
 
     cur = XMLhelper::skip_blank(cur->next);
     Button* button2 = ButtonFactory::create(cur);
-           
+         
     return new ButtonAxis(angle, button1, button2);
   }
 
@@ -79,7 +82,7 @@
   {
     return new InvertedAxis(create(cur->children));
   }
-      
+    
   Axis* AxisFactory::joystick_axis (xmlNodePtr cur)
   {
     char * angle_str = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("angle")));
@@ -89,45 +92,45 @@
     char * id_str    = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("id")));
     if (!id_str)
       PingusError::raise("JoystickAxis without id parameter");
-      
+    
     char * axis_str  = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("axis")));
     if (!axis_str)
       PingusError::raise("JoystickAxis without axis parameter");
-    
+  
     float angle = strtod(angle_str, reinterpret_cast<char**>(NULL));
     int   id    = strtol(id_str,    reinterpret_cast<char**>(NULL), 10);
     int   axis  = strtol(axis_str,  reinterpret_cast<char**>(NULL), 10);
-    
+  
     xmlFree(angle_str);
     xmlFree(id_str);
     xmlFree(axis_str);
-    
+  
     return new JoystickAxis(id, axis, angle);
   }
-  
+
   Axis* AxisFactory::mouse_axis (xmlNodePtr cur)
   {
     char * angle_str = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("angle")));
     if (!angle_str)
       PingusError::raise("MouseAxis without angle parameter");
-      
+    
     char * axis_str  = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("axis")));
     if (!axis_str)
       PingusError::raise("MouseAxis without axis parameter");
-    
+  
     float angle = strtod(angle_str, reinterpret_cast<char**>(NULL));
     int   axis  = strtol(axis_str,  reinterpret_cast<char**>(NULL), 10);
-    
+  
     xmlFree(angle_str);
     xmlFree(axis_str);
-    
+  
     return new MouseAxis(axis, angle);
   }
 
   Axis* AxisFactory::multiple_axis (xmlNodePtr cur)
   {
     std::vector<Axis*> axes;
-    
+  
     while (cur)
       {
         if (xmlIsBlankNode(cur))
@@ -135,11 +138,11 @@
            cur = cur->next;
            continue;
          }
-         
+       
        axes.push_back(create(cur));
        cur = cur->next;
       }
-      
+    
     if (!axes.size())
       PingusError::raise("MultipleAxis without any axis");
 

Index: axis_factory.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axis_factory.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- axis_factory.hxx    23 Aug 2002 15:49:55 -0000      1.4
+++ axis_factory.hxx    24 Aug 2002 11:37:29 -0000      1.5
@@ -24,25 +24,28 @@
 
 namespace Input {
 
-  class Axis;
-
+  namespace Axes {
+    class Axis;
+  }
+  
   class AxisFactory 
   {
     private:
-      static inline Axis* button_axis   (xmlNodePtr cur);
-      static inline Axis* inverted_axis (xmlNodePtr cur);
-      static inline Axis* joystick_axis (xmlNodePtr cur);
-      static inline Axis* mouse_axis    (xmlNodePtr cur);
-      static inline Axis* multiple_axis (xmlNodePtr cur);
-    
+      static inline Axes::Axis* button_axis   (xmlNodePtr cur);
+      static inline Axes::Axis* inverted_axis (xmlNodePtr cur);
+      static inline Axes::Axis* joystick_axis (xmlNodePtr cur);
+      static inline Axes::Axis* mouse_axis    (xmlNodePtr cur);
+      static inline Axes::Axis* multiple_axis (xmlNodePtr cur);
+  
     public:
-      static Axis* create (xmlNodePtr cur);
-      
+      static Axes::Axis* create (xmlNodePtr cur);
+    
     private:
       AxisFactory ();
       AxisFactory (const AxisFactory&);
       AxisFactory operator= (const AxisFactory&);
   };
+    
 }
 
 #endif

Index: button_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/button_factory.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- button_factory.cxx  22 Aug 2002 00:36:30 -0000      1.7
+++ button_factory.cxx  24 Aug 2002 11:37:29 -0000      1.8
@@ -21,54 +21,56 @@
 #include "../xml_helper.hxx"
 #include "../pingus_error.hxx"
 #include "button_factory.hxx"
-#include "double_button.hxx"
-#include "joystick_button.hxx"
-#include "key_button.hxx"
-#include "key_helper.hxx"
-#include "mouse_button.hxx"
-#include "multiple_button.hxx"
-#include "triple_button.hxx"
+#include "buttons/double_button.hxx"
+#include "buttons/joystick_button.hxx"
+#include "buttons/key_button.hxx"
+#include "buttons/key_helper.hxx"
+#include "buttons/mouse_button.hxx"
+#include "buttons/multiple_button.hxx"
+#include "buttons/triple_button.hxx"
 
 namespace Input {
 
-  Button* ButtonFactory::create(xmlNodePtr cur)
+  using namespace Buttons;
+
+  Button* ButtonFactory::create (xmlNodePtr cur)
   {
     if (!cur)
       PingusError::raise("ButtonFactory called without an element");
-  
+
     if ( ! strcmp(reinterpret_cast<const char*>(cur->name), "double-button"))
       return double_button(XMLhelper::skip_blank(cur->children));
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"joystick-button"))
       return joystick_button(cur);
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), "key-button"))
       return key_button(cur);
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"mouse-button"))
       return mouse_button(cur);
 
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"multiple-button"))
       return multiple_button(cur->children);
-    
+  
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"triple-button"))
       return triple_button(XMLhelper::skip_blank(cur->children));
-    
+  
     else
       PingusError::raise(std::string("Unknown button type: ") + ((cur->name) ? 
reinterpret_cast<const char*>(cur->name) : ""));
-      
+    
     return 0; // never reached
   }
-  
+
   Button* ButtonFactory::double_button (xmlNodePtr cur)
   {
     Button *button1, *button2;
-    
+  
     button1 = create(cur);
-    
+  
     cur = XMLhelper::skip_blank(cur->next);    
     button2 = create(cur);
-            
+          
     return new DoubleButton(button1, button2);
   }
 
@@ -81,71 +83,71 @@
     char * button_str = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("button")));
     if (!button_str)
       PingusError::raise("JoystickButton without button parameter");
-    
+  
     int id     = strtol(id_str,     reinterpret_cast<char**>(NULL), 10);
     int button = strtol(button_str, reinterpret_cast<char**>(NULL), 10);
-    
+  
     xmlFree(id_str);
     xmlFree(button_str);
-    
+  
     return new JoystickButton(id, button);
   }
-  
+
   Button* ButtonFactory::key_button (xmlNodePtr cur)
   {
     char * key_str = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("key")));
     if (!key_str)
       PingusError::raise("KeyButton without key parameter");
-    
+  
     int key = KeyHelper::string_to_key(key_str);
-    
+  
     xmlFree(key_str);
-    
+  
     return new KeyButton(key);
   }
-  
+
   Button* ButtonFactory::mouse_button (xmlNodePtr cur)
   {
     char * button_str = reinterpret_cast<char *>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("button")));
     if (!button_str)
       PingusError::raise("MouseButton without button parameter");
-    
+  
     int button = strtol(button_str, reinterpret_cast<char**>(NULL), 10);
     xmlFree(button_str);
-    
+  
     return new MouseButton(button);
   }
 
   Button* ButtonFactory::multiple_button (xmlNodePtr cur)
   {
     std::vector<Button*> buttons;
-    
+  
     while (cur)
       {
         if (xmlIsBlankNode(cur)) {
          cur = cur->next;
          continue;
        }
-       
+      
        buttons.push_back(create(cur));
        cur = cur->next;
       }
-      
+    
     return new MultipleButton(buttons);
   }
-  
+
   Button* ButtonFactory::triple_button (xmlNodePtr cur)
   {
     Button *button1, *button2, *button3;
-    
+  
     button1 = create(cur);
-    
+  
     cur = XMLhelper::skip_blank(cur->next);    
     button2 = create(cur);
-    
+  
     cur = XMLhelper::skip_blank(cur->next);
     button3 = create(cur);
-            
+          
     return new TripleButton(button1, button2, button3);
   }
 

Index: button_factory.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/button_factory.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- button_factory.hxx  23 Aug 2002 15:49:55 -0000      1.4
+++ button_factory.hxx  24 Aug 2002 11:37:29 -0000      1.5
@@ -24,26 +24,29 @@
 
 namespace Input {
 
-  class Button;
+  namespace Buttons {
+    class Button;
+  }
 
   class ButtonFactory 
   {
     private:
-      static inline Button* double_button   (xmlNodePtr cur);
-      static inline Button* joystick_button (xmlNodePtr cur);
-      static inline Button* key_button      (xmlNodePtr cur);
-      static inline Button* mouse_button    (xmlNodePtr cur);
-      static inline Button* multiple_button (xmlNodePtr cur);
-      static inline Button* triple_button   (xmlNodePtr cur);
-    
+      static inline Buttons::Button* double_button   (xmlNodePtr cur);
+      static inline Buttons::Button* joystick_button (xmlNodePtr cur);
+      static inline Buttons::Button* key_button      (xmlNodePtr cur);
+      static inline Buttons::Button* mouse_button    (xmlNodePtr cur);
+      static inline Buttons::Button* multiple_button (xmlNodePtr cur);
+      static inline Buttons::Button* triple_button   (xmlNodePtr cur);
+  
     public:
-      static Button* create (xmlNodePtr cur);
-      
+      static Buttons::Button* create (xmlNodePtr cur);
+    
     private:
       ButtonFactory ();
       ButtonFactory (const ButtonFactory&);
       ButtonFactory operator= (const ButtonFactory&);
   };
+
 }
 
 #endif

Index: controller.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/controller.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- controller.cxx      23 Aug 2002 15:49:55 -0000      1.20
+++ controller.cxx      24 Aug 2002 11:37:29 -0000      1.21
@@ -24,17 +24,22 @@
 #include "axis_factory.hxx"
 #include "button_factory.hxx"
 #include "controller.hxx"
-#include "dummy_axis.hxx"
-#include "dummy_button.hxx"
-#include "dummy_pointer.hxx"
-#include "dummy_scroller.hxx"
+#include "axes/dummy_axis.hxx"
+#include "buttons/dummy_button.hxx"
+#include "pointers/dummy_pointer.hxx"
+#include "scrollers/dummy_scroller.hxx"
 #include "pointer_event.hxx"
 #include "pointer_factory.hxx"
 #include "scroller_factory.hxx"
 #include "scroll_event.hxx"
 
-namespace Input
-{
+namespace Input {
+
+  using namespace Axes;
+  using namespace Buttons;
+  using namespace Pointers;
+  using namespace Scrollers;
+
   Controller::Controller (const std::string& configfile) : action_axis(0),
                                                            
standard_pointer(0), 
                                                           scroller(0),

Index: controller.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/controller.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- controller.hxx      23 Aug 2002 15:49:55 -0000      1.11
+++ controller.hxx      24 Aug 2002 11:37:29 -0000      1.12
@@ -27,22 +27,34 @@
 #include "../libxmlfwd.hxx"
 #include "button_event.hxx"
 
-namespace Input
-{
-  class Axis;
-  class Button;
+namespace Input {
+
+  namespace Axes {
+    class Axis;
+  }
+  
+  namespace Buttons {
+    class Button;
+  }
+
+  namespace Pointers {
+    class Pointer;
+  }
+
+  namespace Scrollers {
+    class Scroller;
+  }
+
   class Event;
-  class Pointer;
-  class Scroller;
 
   class Controller {
 
     private:
-      Axis*     action_axis;
-      Pointer*  standard_pointer;
-      Scroller* scroller;
+      Axes::Axis*          action_axis;
+      Pointers::Pointer*   standard_pointer;
+      Scrollers::Scroller* scroller;
     
-      std::map<ButtonName, std::pair<Button*, bool> > buttons;
+      std::map<ButtonName, std::pair<Buttons::Button*, bool> > buttons;
       
       std::list<Event*> events;
 
@@ -54,14 +66,14 @@
       
       std::list<Event*>& get_events () { return events; }
       
-      const Pointer * get_pointer     () const { return standard_pointer; }
-      const Scroller* get_scroller    () const { return scroller;         }
-      const Axis    * get_action_axis () const { return action_axis;      }
+      const Pointers::Pointer  * get_pointer     () const { return 
standard_pointer; }
+      const Scrollers::Scroller* get_scroller    () const { return scroller;   
      }
+      const Axes::Axis         * get_action_axis () const { return 
action_axis;      }
 
-      /// returns the requested button or 0 if it doesn't exist (e.g. 
undefined action button)
-      const Button* get_button (ButtonName name);
+      /// returns the requested Buttons::Button or 0 if it doesn't exist (e.g. 
undefined action Buttons::Button)
+      const Buttons::Button* get_button (ButtonName name);
       
-      void update(float delta);
+      void update (float delta);
 
     private:
       void create_action_buttons (xmlNodePtr cur);

Index: pointer_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/pointer_factory.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pointer_factory.cxx 22 Aug 2002 00:36:30 -0000      1.5
+++ pointer_factory.cxx 24 Aug 2002 11:37:30 -0000      1.6
@@ -20,35 +20,38 @@
 #include <stdlib.h>
 #include "../xml_helper.hxx"
 #include "../pingus_error.hxx"
-#include "axis_pointer.hxx"
 #include "axis_factory.hxx"
-#include "mouse_pointer.hxx"
-#include "multiple_pointer.hxx"
-#include "pointer.hxx"
+#include "pointers/axis_pointer.hxx"
+#include "pointers/mouse_pointer.hxx"
+#include "pointers/multiple_pointer.hxx"
+#include "pointers/pointer.hxx"
 #include "pointer_factory.hxx"
 
 namespace Input {
 
-  Pointer* PointerFactory::create(xmlNodePtr cur)
+  using namespace Pointers;
+  using Axes::Axis;
+  
+  Pointer* PointerFactory::create (xmlNodePtr cur)
   {
     if (!cur)
       PingusError::raise("PointerFactory called without an element");
 
     if ( ! strcmp(reinterpret_cast<const char*>(cur->name), "axis-pointer"))
       return axis_pointer(cur);
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"mouse-pointer"))
       return mouse_pointer();
-      
+    
     else if ( ! strcmp(reinterpret_cast<const char*>(cur->name), 
"multiple-pointer"))
       return multiple_pointer(cur->children);
-      
+    
     else
       PingusError::raise(std::string("Unknown pointer type: ") + ((cur->name) 
? reinterpret_cast<const char*>(cur->name) : ""));
-      
+    
     return 0; // never reached
   }
-  
+
   Pointer* PointerFactory::axis_pointer (xmlNodePtr cur)
   {
     char* speed_str = reinterpret_cast<char*>(xmlGetProp(cur, 
reinterpret_cast<const xmlChar*>("speed")));
@@ -60,7 +63,7 @@
 
     std::vector<Axis*> axes;
     cur = cur->children;
-    
+  
     while (cur)
       {
         if (xmlIsBlankNode(cur))
@@ -68,11 +71,11 @@
            cur = cur->next;
            continue;
          }
-         
+       
        axes.push_back(AxisFactory::create(cur));
        cur = cur->next;
       }
-      
+    
     return new AxisPointer(speed, axes);
   }
 
@@ -96,7 +99,7 @@
        pointers.push_back(create(cur));
        cur = cur->next;
       }
-    
+  
     return new MultiplePointer(pointers);
   }
 

Index: pointer_factory.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/pointer_factory.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pointer_factory.hxx 23 Aug 2002 15:49:56 -0000      1.2
+++ pointer_factory.hxx 24 Aug 2002 11:37:30 -0000      1.3
@@ -24,17 +24,19 @@
 
 namespace Input {
 
-  class Pointer;
+  namespace Pointers {
+    class Pointer;
+  }
 
   class PointerFactory 
   {
     private:
-      static inline Pointer* axis_pointer     (xmlNodePtr cur);
-      static inline Pointer* mouse_pointer    ();
-      static inline Pointer* multiple_pointer (xmlNodePtr cur);
+      static inline Pointers::Pointer* axis_pointer     (xmlNodePtr cur);
+      static inline Pointers::Pointer* mouse_pointer    ();
+      static inline Pointers::Pointer* multiple_pointer (xmlNodePtr cur);
     
     public:
-      static Pointer* create (xmlNodePtr cur);
+      static Pointers::Pointer* create (xmlNodePtr cur);
       
     private:
       PointerFactory ();

Index: scroller_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/scroller_factory.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- scroller_factory.cxx        22 Aug 2002 00:36:30 -0000      1.6
+++ scroller_factory.cxx        24 Aug 2002 11:37:30 -0000      1.7
@@ -20,21 +20,27 @@
 #include <stdlib.h>
 #include "../xml_helper.hxx"
 #include "../pingus_error.hxx"
-#include "axis.hxx"
 #include "axis_factory.hxx"
-#include "axis_scroller.hxx"
-#include "button.hxx"
 #include "button_factory.hxx"
-#include "inverted_scroller.hxx"
-#include "joystick_scroller.hxx"
-#include "mouse_scroller.hxx"
-#include "multiple_scroller.hxx"
-#include "pointer.hxx"
 #include "pointer_factory.hxx"
-#include "pointer_scroller.hxx"
 #include "scroller_factory.hxx"
+#include "axes/axis.hxx"
+#include "buttons/button.hxx"
+#include "pointers/pointer.hxx"
+#include "scrollers/axis_scroller.hxx"
+#include "scrollers/inverted_scroller.hxx"
+#include "scrollers/joystick_scroller.hxx"
+#include "scrollers/mouse_scroller.hxx"
+#include "scrollers/multiple_scroller.hxx"
+#include "scrollers/pointer_scroller.hxx"
+
 
 namespace Input {
+
+  using namespace Scrollers;
+  using Axes::Axis;
+  using Buttons::Button;
+  using Pointers::Pointer;
 
   Scroller*
   ScrollerFactory::create(xmlNodePtr cur)

Index: scroller_factory.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/scroller_factory.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- scroller_factory.hxx        23 Aug 2002 15:49:56 -0000      1.3
+++ scroller_factory.hxx        24 Aug 2002 11:37:30 -0000      1.4
@@ -24,20 +24,22 @@
 
 namespace Input {
 
-  class Scroller;
+  namespace Scrollers {
+    class Scroller;
+  }
 
   class ScrollerFactory 
   {
     private:
-      static inline Scroller* axis_scroller     (xmlNodePtr cur);
-      static inline Scroller* inverted_scroller (xmlNodePtr cur);
-      static inline Scroller* joystick_scroller (xmlNodePtr cur);
-      static inline Scroller* mouse_scroller    (xmlNodePtr cur);
-      static inline Scroller* multiple_scroller (xmlNodePtr cur);
-      static inline Scroller* pointer_scroller  (xmlNodePtr cur);
+      static inline Scrollers::Scroller* axis_scroller     (xmlNodePtr cur);
+      static inline Scrollers::Scroller* inverted_scroller (xmlNodePtr cur);
+      static inline Scrollers::Scroller* joystick_scroller (xmlNodePtr cur);
+      static inline Scrollers::Scroller* mouse_scroller    (xmlNodePtr cur);
+      static inline Scrollers::Scroller* multiple_scroller (xmlNodePtr cur);
+      static inline Scrollers::Scroller* pointer_scroller  (xmlNodePtr cur);
     
     public:
-      static Scroller* create (xmlNodePtr cur);
+      static Scrollers::Scroller* create (xmlNodePtr cur);
       
     private:
       ScrollerFactory ();

--- axis.hxx DELETED ---

--- axis_pointer.cxx DELETED ---

--- axis_pointer.hxx DELETED ---

--- axis_scroller.cxx DELETED ---

--- axis_scroller.hxx DELETED ---

--- button.hxx DELETED ---

--- button_axis.cxx DELETED ---

--- button_axis.hxx DELETED ---

--- double_button.cxx DELETED ---

--- double_button.hxx DELETED ---

--- dummy_axis.hxx DELETED ---

--- dummy_button.hxx DELETED ---

--- dummy_pointer.hxx DELETED ---

--- dummy_scroller.hxx DELETED ---

--- inverted_axis.cxx DELETED ---

--- inverted_axis.hxx DELETED ---

--- inverted_scroller.cxx DELETED ---

--- inverted_scroller.hxx DELETED ---

--- joystick_axis.cxx DELETED ---

--- joystick_axis.hxx DELETED ---

--- joystick_button.cxx DELETED ---

--- joystick_button.hxx DELETED ---

--- joystick_scroller.cxx DELETED ---

--- joystick_scroller.hxx DELETED ---

--- key_button.cxx DELETED ---

--- key_button.hxx DELETED ---

--- mouse_axis.cxx DELETED ---

--- mouse_axis.hxx DELETED ---

--- mouse_button.cxx DELETED ---

--- mouse_button.hxx DELETED ---

--- mouse_pointer.cxx DELETED ---

--- mouse_pointer.hxx DELETED ---

--- mouse_scroller.cxx DELETED ---

--- mouse_scroller.hxx DELETED ---

--- multiple_axis.cxx DELETED ---

--- multiple_axis.hxx DELETED ---

--- multiple_button.cxx DELETED ---

--- multiple_button.hxx DELETED ---

--- multiple_pointer.cxx DELETED ---

--- multiple_pointer.hxx DELETED ---

--- multiple_scroller.cxx DELETED ---

--- multiple_scroller.hxx DELETED ---

--- pointer.hxx DELETED ---

--- pointer_scroller.cxx DELETED ---

--- pointer_scroller.hxx DELETED ---

--- scroller.hxx DELETED ---

--- triple_button.cxx DELETED ---

--- triple_button.hxx DELETED ---





reply via email to

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