From 57be37fa569757451e33ac6d69b55a455ee2009a Mon Sep 17 00:00:00 2001 From: lightmanLP <50497969+lightmanLP@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:36:47 +0000 Subject: [PATCH] MouseMeta migration --- src/controller/controldeck/ControlDeck.h | 1 - src/controller/controldevice/controller/Controller.h | 1 - .../controldevice/controller/ControllerButton.h | 1 - .../controldevice/controller/ControllerStick.h | 1 - .../mapping/factories/AxisDirectionMappingFactory.cpp | 2 +- .../mapping/factories/ButtonMappingFactory.cpp | 2 +- .../controller/mapping/keyboard/KeyboardScancodes.h | 6 ++++++ .../controller/mapping/mouse/MouseKeyToAnyMapping.h | 2 +- .../mapping/mouse/MouseKeyToAxisDirectionMapping.h | 2 +- .../controller/mapping/mouse/MouseKeyToButtonMapping.h | 2 +- src/graphic/Fast3D/Fast3dWindow.h | 2 +- src/window/MouseMeta.h | 9 --------- src/window/Window.h | 2 +- 13 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 src/window/MouseMeta.h diff --git a/src/controller/controldeck/ControlDeck.h b/src/controller/controldeck/ControlDeck.h index 8ff1a6098..65e9572e6 100644 --- a/src/controller/controldeck/ControlDeck.h +++ b/src/controller/controldeck/ControlDeck.h @@ -5,7 +5,6 @@ #include #include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" #include "controller/deviceindex/ShipDeviceIndexMappingManager.h" -#include "window/MouseMeta.h" namespace Ship { diff --git a/src/controller/controldevice/controller/Controller.h b/src/controller/controldevice/controller/Controller.h index 92e764944..409899bf2 100644 --- a/src/controller/controldevice/controller/Controller.h +++ b/src/controller/controldevice/controller/Controller.h @@ -17,7 +17,6 @@ #include "ControllerLED.h" #include "controller/controldevice/ControlDevice.h" #include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" -#include "window/MouseMeta.h" namespace Ship { diff --git a/src/controller/controldevice/controller/ControllerButton.h b/src/controller/controldevice/controller/ControllerButton.h index b5dd1e8f6..0678d3813 100644 --- a/src/controller/controldevice/controller/ControllerButton.h +++ b/src/controller/controldevice/controller/ControllerButton.h @@ -6,7 +6,6 @@ #include #include "libultraship/libultra/controller.h" #include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" -#include "window/MouseMeta.h" namespace Ship { diff --git a/src/controller/controldevice/controller/ControllerStick.h b/src/controller/controldevice/controller/ControllerStick.h index 6b5f3e5dc..806aeb4c9 100644 --- a/src/controller/controldevice/controller/ControllerStick.h +++ b/src/controller/controldevice/controller/ControllerStick.h @@ -5,7 +5,6 @@ #include #include #include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" -#include "window/MouseMeta.h" namespace Ship { diff --git a/src/controller/controldevice/controller/mapping/factories/AxisDirectionMappingFactory.cpp b/src/controller/controldevice/controller/mapping/factories/AxisDirectionMappingFactory.cpp index 5eda7f3e6..eb39ad5fd 100644 --- a/src/controller/controldevice/controller/mapping/factories/AxisDirectionMappingFactory.cpp +++ b/src/controller/controldevice/controller/mapping/factories/AxisDirectionMappingFactory.cpp @@ -10,7 +10,7 @@ #include "Context.h" #include "controller/deviceindex/ShipDeviceIndexToSDLDeviceIndexMapping.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Ship { std::shared_ptr diff --git a/src/controller/controldevice/controller/mapping/factories/ButtonMappingFactory.cpp b/src/controller/controldevice/controller/mapping/factories/ButtonMappingFactory.cpp index dee1fe5c3..640f8f06c 100644 --- a/src/controller/controldevice/controller/mapping/factories/ButtonMappingFactory.cpp +++ b/src/controller/controldevice/controller/mapping/factories/ButtonMappingFactory.cpp @@ -8,7 +8,7 @@ #include "controller/controldevice/controller/mapping/sdl/SDLButtonToButtonMapping.h" #include "controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.h" #include "controller/deviceindex/ShipDeviceIndexToSDLDeviceIndexMapping.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Ship { std::shared_ptr ButtonMappingFactory::CreateButtonMappingFromConfig(uint8_t portIndex, diff --git a/src/controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h b/src/controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h index 4e92ef6f2..601b29b20 100644 --- a/src/controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h +++ b/src/controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h @@ -1,6 +1,8 @@ #pragma once #ifdef __cplusplus +#include + namespace Ship { #endif @@ -118,6 +120,10 @@ typedef enum KbScancode { LUS_KB_MAX } KbScancode; +typedef enum MouseBtn { LEFT, MIDDLE, RIGHT, BACKWARD, FORWARD, MOUSE_BTN_COUNT, MOUSE_BTN_UNKNOWN } MouseBtn; + #ifdef __cplusplus +static std::string mouseBtnNames[7] = { "MouseLeft", "MouseMiddle", "MouseRight", "MouseBackward", + "MouseForward", "MOUSE_BTN_COUNT", "MOUSE_BTN_UNKNOWN" }; } // namespace Ship #endif diff --git a/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAnyMapping.h b/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAnyMapping.h index 16ff28c87..7a1f1fbf0 100644 --- a/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAnyMapping.h +++ b/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAnyMapping.h @@ -1,7 +1,7 @@ #pragma once #include "controller/controldevice/controller/mapping/ControllerInputMapping.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Ship { class MouseKeyToAnyMapping : virtual public ControllerInputMapping { diff --git a/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAxisDirectionMapping.h b/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAxisDirectionMapping.h index 9ce17d8f3..11f955fdb 100644 --- a/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAxisDirectionMapping.h +++ b/src/controller/controldevice/controller/mapping/mouse/MouseKeyToAxisDirectionMapping.h @@ -2,7 +2,7 @@ #include "controller/controldevice/controller/mapping/ControllerAxisDirectionMapping.h" #include "MouseKeyToAnyMapping.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Ship { class MouseKeyToAxisDirectionMapping final : public MouseKeyToAnyMapping, public ControllerAxisDirectionMapping { diff --git a/src/controller/controldevice/controller/mapping/mouse/MouseKeyToButtonMapping.h b/src/controller/controldevice/controller/mapping/mouse/MouseKeyToButtonMapping.h index cb91ec464..0fe7f9897 100644 --- a/src/controller/controldevice/controller/mapping/mouse/MouseKeyToButtonMapping.h +++ b/src/controller/controldevice/controller/mapping/mouse/MouseKeyToButtonMapping.h @@ -2,7 +2,7 @@ #include "controller/controldevice/controller/mapping/ControllerButtonMapping.h" #include "MouseKeyToAnyMapping.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Ship { class MouseKeyToButtonMapping final : public MouseKeyToAnyMapping, public ControllerButtonMapping { diff --git a/src/graphic/Fast3D/Fast3dWindow.h b/src/graphic/Fast3D/Fast3dWindow.h index 6bd8b6404..86676cf9d 100644 --- a/src/graphic/Fast3D/Fast3dWindow.h +++ b/src/graphic/Fast3D/Fast3dWindow.h @@ -3,7 +3,7 @@ #include "graphic/Fast3D/gfx_window_manager_api.h" #include "graphic/Fast3D/gfx_rendering_api.h" #include "public/bridge/gfxbridge.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Fast { class Fast3dWindow : public Ship::Window { diff --git a/src/window/MouseMeta.h b/src/window/MouseMeta.h deleted file mode 100644 index b5271ff66..000000000 --- a/src/window/MouseMeta.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -namespace Ship { -enum class MouseBtn { LEFT, MIDDLE, RIGHT, BACKWARD, FORWARD, MOUSE_BTN_COUNT, MOUSE_BTN_UNKNOWN }; -static std::string mouseBtnNames[7] = { "MouseLeft", "MouseMiddle", "MouseRight", "MouseBackward", - "MouseForward", "MOUSE_BTN_COUNT", "MOUSE_BTN_UNKNOWN" }; -} // namespace Ship diff --git a/src/window/Window.h b/src/window/Window.h index 7f7a818af..708b29bfe 100644 --- a/src/window/Window.h +++ b/src/window/Window.h @@ -7,7 +7,7 @@ #include #include #include "window/gui/Gui.h" -#include "window/MouseMeta.h" +#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h" namespace Ship { enum class WindowBackend { FAST3D_DXGI_DX11, FAST3D_SDL_OPENGL, FAST3D_SDL_METAL, WINDOW_BACKEND_COUNT };