[2/8] dinput: Added ConfigureDevices dialog
Lucas Fialho Zawacki
lfzawacki at gmail.com
Wed Aug 3 18:49:46 CDT 2011
---
dlls/dinput/Makefile.in | 7 ++--
dlls/dinput/configure_devices.c | 43 ++++++++++++++++++++++++++++
dlls/dinput/configure_devices.rc | 45 ++++++++++++++++++++++++++++++
dlls/dinput/configure_devices_resource.h | 17 +++++++++++
dlls/dinput/dinput_main.c | 3 +-
dlls/dinput/dinput_private.h | 2 +
6 files changed, 113 insertions(+), 4 deletions(-)
create mode 100644 dlls/dinput/configure_devices.c
create mode 100644 dlls/dinput/configure_devices.rc
create mode 100644 dlls/dinput/configure_devices_resource.h
diff --git a/dlls/dinput/Makefile.in b/dlls/dinput/Makefile.in
index 24502e6..817658e 100644
--- a/dlls/dinput/Makefile.in
+++ b/dlls/dinput/Makefile.in
@@ -1,6 +1,6 @@
MODULE = dinput.dll
IMPORTLIB = dinput
-IMPORTS = dxguid uuid ole32 user32 advapi32
+IMPORTS = dxguid uuid ole32 user32 advapi32 comctl32
EXTRALIBS = @IOKITLIB@
C_SRCS = \
@@ -13,12 +13,13 @@ C_SRCS = \
joystick_linuxinput.c \
joystick_osx.c \
keyboard.c \
- mouse.c
+ mouse.c \
+ configure_devices.c
IMPLIB_SRCS = data_formats.c
IDL_R_SRCS = dinput_classes.idl
-RC_SRCS = version.rc
+RC_SRCS = version.rc configure_devices.rc
@MAKE_DLL_RULES@
diff --git a/dlls/dinput/configure_devices.c b/dlls/dinput/configure_devices.c
new file mode 100644
index 0000000..1e20b86
--- /dev/null
+++ b/dlls/dinput/configure_devices.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011 Lucas Fialho Zawacki
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "objbase.h"
+#include "dinput_private.h"
+#include "device_private.h"
+#include "configure_devices_resource.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dinput);
+
+static HINSTANCE g_hinstance;
+
+HRESULT _configure_devices(LPDIRECTINPUT8W iface,
+ LPDICONFIGUREDEVICESCALLBACK lpdiCallback,
+ LPDICONFIGUREDEVICESPARAMSW lpdiCDParams,
+ DWORD dwFlags,
+ LPVOID pvRefData,
+ HINSTANCE hinstance)
+{
+ InitCommonControls();
+
+ g_hinstance = hinstance;
+ DialogBoxParamW(g_hinstance, (LPCWSTR) MAKEINTRESOURCE(IDD_CONFIGUREDEVICES), lpdiCDParams->hwnd, 0, 0);
+
+ return DI_OK;
+}
diff --git a/dlls/dinput/configure_devices.rc b/dlls/dinput/configure_devices.rc
new file mode 100644
index 0000000..35678db
--- /dev/null
+++ b/dlls/dinput/configure_devices.rc
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 Lucas Fialho Zawacki
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "configure_devices_resource.h"
+
+STRINGTABLE
+BEGIN
+ IDS_NOACTION "-"
+ IDS_ACTIONCOLUMN "Action"
+ IDS_OBJECTCOLUMN "Object"
+END
+
+IDD_CONFIGUREDEVICES DIALOG 0, 0, 270, 260
+STYLE DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE
+CAPTION "Configure Devices"
+FONT 8, "Ms Shell Dlg"
+{
+ DEFPUSHBUTTON "OK", IDOK, 10, 236, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 65, 236, 50, 14
+ DEFPUSHBUTTON "Reset", IDRESET, 210, 236, 50, 14
+ COMBOBOX IDC_PLAYERCOMBO, 10, 50, 90, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
+ COMBOBOX IDC_CONTROLLERCOMBO, 10, 20, 90, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
+ LTEXT "Player", IDC_PLAYERTEXT, 10, 40, 21, 8, SS_LEFT
+ LTEXT "Device", IDC_DEVICETEXT, 10, 10, 22, 8, SS_LEFT
+ LTEXT "Actions", IDC_ACTIONTEXT, 10, 70, 24, 8, SS_LEFT
+ LTEXT "Mapping", IDC_MAPPINGTEXT, 120, 8, 28, 8, SS_LEFT
+ LISTBOX IDC_ACTIONLIST, 10, 80, 90, 130, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY
+ AUTOCHECKBOX "Sort Assigned", IDC_CHECKBOXSORT, 120, 215, 60, 8
+ CONTROL "Listview", IDC_DEVICEOBJECTSLIST, "SysListView32", LVS_REPORT | LVS_AUTOARRANGE | LVS_ALIGNLEFT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP, 120, 20, 140, 190
+}
diff --git a/dlls/dinput/configure_devices_resource.h b/dlls/dinput/configure_devices_resource.h
new file mode 100644
index 0000000..cf597ab
--- /dev/null
+++ b/dlls/dinput/configure_devices_resource.h
@@ -0,0 +1,17 @@
+#include <shlobj.h>
+
+#define IDD_CONFIGUREDEVICES 100
+#define IDC_DEVICETEXT 1000
+#define IDRESET 1001
+#define IDC_ACTIONTEXT 1002
+#define IDC_PLAYERTEXT 1005
+#define IDC_DEVICEOBJECTSTEXT 1006
+#define IDC_CONTROLLERCOMBO 1009
+#define IDC_PLAYERCOMBO 1010
+#define IDC_ACTIONLIST 1012
+#define IDC_DEVICEOBJECTSLIST 1013
+#define IDC_CHECKBOXSORT 1014
+#define IDC_MAPPINGTEXT 1015
+#define IDS_NOACTION 1016
+#define IDS_ACTIONCOLUMN 1017
+#define IDS_OBJECTCOLUMN 1018
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 8b531d3..e129574 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -1008,7 +1008,8 @@ static HRESULT WINAPI IDirectInput8WImpl_ConfigureDevices(
FIXME("(this=%p,%p,%p,%04x,%p): stub\n", This, lpdiCallback, lpdiCDParams, dwFlags, pvRefData);
- return DI_OK;
+ /* Call helper function in configure_devices.c to do the real work */
+ return _configure_devices(iface, lpdiCallback, lpdiCDParams, dwFlags, pvRefData, DINPUT_instance);
}
static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h
index 3c4776e..773b6c0 100644
--- a/dlls/dinput/dinput_private.h
+++ b/dlls/dinput/dinput_private.h
@@ -67,6 +67,8 @@ extern void _dump_diactionformatA(LPDIACTIONFORMATA) DECLSPEC_HIDDEN;
extern void _copy_diactionformatAtoW(LPDIACTIONFORMATW, LPDIACTIONFORMATA) DECLSPEC_HIDDEN;
extern void _copy_diactionformatWtoA(LPDIACTIONFORMATA, LPDIACTIONFORMATW) DECLSPEC_HIDDEN;
+extern HRESULT _configure_devices(LPDIRECTINPUT8W iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData, HINSTANCE hinstance) DECLSPEC_HIDDEN;
+
#define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0)
#define DIKEYBOARD_MASK 0x81000000
--
1.7.0.4
More information about the wine-patches
mailing list