Reverted r6576, Menus don't belong into JoystickKeyboardController
[supertux.git] / src / control / joystickkeyboardcontroller.hpp
index 49da0a2..33d6020 100644 (file)
@@ -29,6 +29,8 @@
 #include "util/writer_fwd.hpp"
 
 class Menu;
+class KeyboardMenu;
+class JoystickMenu;
 
 class JoystickKeyboardController : public Controller
 {
@@ -40,7 +42,7 @@ public:
    */
   void process_event(const SDL_Event& event);
 
-  void write(lisp::Writer& writer);
+  void write(Writer& writer);
   void read(const Reader& lisp);
   void reset();
 
@@ -58,16 +60,36 @@ private:
 
   void print_joystick_mappings();
 
+  SDLKey reversemap_key(Control c);
+  int    reversemap_joybutton(Control c);
+  int    reversemap_joyaxis(Control c);
+  int    reversemap_joyhat(Control c);
+
+  void unbind_joystick_control(Control c);
+
+  void bind_joybutton(int button, Control c);
+  void bind_joyaxis(int axis, Control c);
+  void bind_joyhat(int dir, Control c);
+  void bind_key(SDLKey key, Control c);
+
+  void set_joy_controls(Control id, bool value);
+
+private:
+  friend class KeyboardMenu;
+  friend class JoystickMenu;
+
   typedef std::map<SDLKey, Control> KeyMap;
+  typedef std::map<int, Control> ButtonMap;
+  typedef std::map<int, Control> AxisMap;
+  typedef std::map<int, Control> HatMap;
+
+private:
   KeyMap keymap;
 
-  typedef std::map<int, Control> ButtonMap;
   ButtonMap joy_button_map;
 
-  typedef std::map<int, Control> AxisMap;
   AxisMap joy_axis_map;
 
-  typedef std::map<int, Control> HatMap;
   HatMap joy_hat_map;
 
   std::vector<SDL_Joystick*> joysticks;
@@ -89,31 +111,9 @@ private:
   bool jump_with_up_joy; // Joystick up jumps
   bool jump_with_up_kbd; // Keyboard up jumps
 
-  SDLKey reversemap_key(Control c);
-  int    reversemap_joybutton(Control c);
-  int    reversemap_joyaxis(Control c);
-  int    reversemap_joyhat(Control c);
-
-  void unbind_joystick_control(Control c);
-
-  void bind_joybutton(int button, Control c);
-  void bind_joyaxis(int axis, Control c);
-  void bind_joyhat(int dir, Control c);
-  void bind_key(SDLKey key, Control c);
-
-  void set_joy_controls(Control id, bool value);
-
   int wait_for_key;
   int wait_for_joystick;
 
-  class KeyboardMenu;
-  class JoystickMenu;
-
-  KeyboardMenu* key_options_menu;
-  JoystickMenu* joystick_options_menu;
-  friend class KeyboardMenu;
-  friend class JoystickMenu;
-
 private:
   JoystickKeyboardController(const JoystickKeyboardController&);
   JoystickKeyboardController& operator=(const JoystickKeyboardController&);