From e365242892d612a3d90317b7e3c53188c9a9de6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 26 Nov 2022 19:01:06 +0100 Subject: [PATCH] joy.cpl: Move constants and structures to main.c. --- dlls/joy.cpl/joy.rc | 2 +- dlls/joy.cpl/main.c | 78 +++++++++++++++++++++++++++++- dlls/joy.cpl/{joy.h => resource.h} | 76 +---------------------------- 3 files changed, 79 insertions(+), 77 deletions(-) rename dlls/joy.cpl/{joy.h => resource.h} (52%) diff --git a/dlls/joy.cpl/joy.rc b/dlls/joy.cpl/joy.rc index 6c4bb0053ae..8086ecec6e1 100644 --- a/dlls/joy.cpl/joy.rc +++ b/dlls/joy.cpl/joy.rc @@ -19,7 +19,7 @@ * */ -#include "joy.h" +#include "resource.h" #pragma makedep po diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index c1f41fb0e56..e3ed1f8f155 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -28,15 +28,89 @@ #include #include #include +#include #include #include "ole2.h" #include "wine/debug.h" -#include "joy.h" + +#include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(joycpl); -DECLSPEC_HIDDEN HMODULE hcpl; +#define TEST_MAX_BUTTONS 32 +#define TEST_MAX_AXES 4 +#define TEST_POLL_TIME 100 + +#define TEST_BUTTON_COL_MAX 8 +#define TEST_BUTTON_X 8 +#define TEST_BUTTON_Y 122 +#define TEST_NEXT_BUTTON_X 30 +#define TEST_NEXT_BUTTON_Y 25 +#define TEST_BUTTON_SIZE_X 20 +#define TEST_BUTTON_SIZE_Y 18 + +#define TEST_AXIS_X 43 +#define TEST_AXIS_Y 60 +#define TEST_NEXT_AXIS_X 77 +#define TEST_AXIS_SIZE_X 3 +#define TEST_AXIS_SIZE_Y 3 +#define TEST_AXIS_MIN -25 +#define TEST_AXIS_MAX 25 + +#define FF_AXIS_X 248 +#define FF_AXIS_Y 60 +#define FF_AXIS_SIZE_X 3 +#define FF_AXIS_SIZE_Y 3 + +#define FF_PLAY_TIME 2*DI_SECONDS +#define FF_PERIOD_TIME FF_PLAY_TIME/4 + +#define NUM_PROPERTY_PAGES 3 + +struct Effect +{ + IDirectInputEffect *effect; + DIEFFECT params; + DIEFFECTINFOW info; +}; + +struct Joystick +{ + IDirectInputDevice8W *device; + DIDEVICEINSTANCEW instance; + int num_buttons; + int num_axes; + BOOL forcefeedback; + BOOL is_xinput; + BOOL has_override; + int num_effects; + int cur_effect; + int chosen_effect; + struct Effect *effects; +}; + +struct Graphics +{ + HWND hwnd; + HWND buttons[TEST_MAX_BUTTONS]; + HWND axes[TEST_MAX_AXES]; + HWND ff_axis; +}; + +struct JoystickData +{ + IDirectInput8W *di; + struct Joystick *joysticks; + int num_joysticks; + int num_ff; + int cur_joystick; + int chosen_joystick; + struct Graphics graphics; + BOOL stop; +}; + +static HMODULE hcpl; /********************************************************************* * DllMain diff --git a/dlls/joy.cpl/joy.h b/dlls/joy.cpl/resource.h similarity index 52% rename from dlls/joy.cpl/joy.h rename to dlls/joy.cpl/resource.h index 64df21963b9..671e9ad8c77 100644 --- a/dlls/joy.cpl/joy.h +++ b/dlls/joy.cpl/resource.h @@ -22,55 +22,10 @@ #ifndef __WINE_JOYSTICKCPL__ #define __WINE_JOYSTICKCPL__ -#include #include +#include +#include #include -#include - -extern HMODULE hcpl; - -struct Effect { - IDirectInputEffect *effect; - DIEFFECT params; - DIEFFECTINFOW info; -}; - -struct Joystick { - IDirectInputDevice8W *device; - DIDEVICEINSTANCEW instance; - int num_buttons; - int num_axes; - BOOL forcefeedback; - BOOL is_xinput; - BOOL has_override; - int num_effects; - int cur_effect; - int chosen_effect; - struct Effect *effects; -}; - -#define TEST_MAX_BUTTONS 32 -#define TEST_MAX_AXES 4 - -struct Graphics { - HWND hwnd; - HWND buttons[TEST_MAX_BUTTONS]; - HWND axes[TEST_MAX_AXES]; - HWND ff_axis; -}; - -struct JoystickData { - IDirectInput8W *di; - struct Joystick *joysticks; - int num_joysticks; - int num_ff; - int cur_joystick; - int chosen_joystick; - struct Graphics graphics; - BOOL stop; -}; - -#define NUM_PROPERTY_PAGES 3 /* strings */ #define IDS_CPL_NAME 1 @@ -102,31 +57,4 @@ struct JoystickData { #define ICO_MAIN 100 -/* constants */ -#define TEST_POLL_TIME 100 - -#define TEST_BUTTON_COL_MAX 8 -#define TEST_BUTTON_X 8 -#define TEST_BUTTON_Y 122 -#define TEST_NEXT_BUTTON_X 30 -#define TEST_NEXT_BUTTON_Y 25 -#define TEST_BUTTON_SIZE_X 20 -#define TEST_BUTTON_SIZE_Y 18 - -#define TEST_AXIS_X 43 -#define TEST_AXIS_Y 60 -#define TEST_NEXT_AXIS_X 77 -#define TEST_AXIS_SIZE_X 3 -#define TEST_AXIS_SIZE_Y 3 -#define TEST_AXIS_MIN -25 -#define TEST_AXIS_MAX 25 - -#define FF_AXIS_X 248 -#define FF_AXIS_Y 60 -#define FF_AXIS_SIZE_X 3 -#define FF_AXIS_SIZE_Y 3 - -#define FF_PLAY_TIME 2*DI_SECONDS -#define FF_PERIOD_TIME FF_PLAY_TIME/4 - #endif