Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b0dfa932
Commit
b0dfa932
authored
Sep 01, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Sep 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Working CANCEL and RESET buttons in ConfigureDevices dialog.
parent
67682c24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
config.c
dlls/dinput/config.c
+38
-3
No files found.
dlls/dinput/config.c
View file @
b0dfa932
...
@@ -40,6 +40,7 @@ typedef struct {
...
@@ -40,6 +40,7 @@ typedef struct {
typedef
struct
{
typedef
struct
{
IDirectInput8W
*
lpDI
;
IDirectInput8W
*
lpDI
;
LPDIACTIONFORMATW
lpdiaf
;
LPDIACTIONFORMATW
lpdiaf
;
LPDIACTIONFORMATW
original_lpdiaf
;
DIDevicesData
devices_data
;
DIDevicesData
devices_data
;
int
display_only
;
int
display_only
;
}
ConfigureDevicesData
;
}
ConfigureDevicesData
;
...
@@ -201,16 +202,21 @@ static void init_devices(HWND dialog, IDirectInput8W *lpDI, DIDevicesData *data,
...
@@ -201,16 +202,21 @@ static void init_devices(HWND dialog, IDirectInput8W *lpDI, DIDevicesData *data,
SendDlgItemMessageW
(
dialog
,
IDC_CONTROLLERCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
data
->
devices
[
i
].
ddi
.
tszProductName
);
SendDlgItemMessageW
(
dialog
,
IDC_CONTROLLERCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
data
->
devices
[
i
].
ddi
.
tszProductName
);
}
}
static
void
destroy_d
evices
(
HWND
dialog
)
static
void
destroy_d
ata
(
HWND
dialog
)
{
{
int
i
;
int
i
;
ConfigureDevicesData
*
data
=
(
ConfigureDevicesData
*
)
GetWindowLongPtrW
(
dialog
,
DWLP_USER
);
ConfigureDevicesData
*
data
=
(
ConfigureDevicesData
*
)
GetWindowLongPtrW
(
dialog
,
DWLP_USER
);
DIDevicesData
*
devices_data
=
&
data
->
devices_data
;
DIDevicesData
*
devices_data
=
&
data
->
devices_data
;
/* Free the devices */
for
(
i
=
0
;
i
<
devices_data
->
ndevices
;
i
++
)
for
(
i
=
0
;
i
<
devices_data
->
ndevices
;
i
++
)
IDirectInputDevice8_Release
(
devices_data
->
devices
[
i
].
lpdid
);
IDirectInputDevice8_Release
(
devices_data
->
devices
[
i
].
lpdid
);
HeapFree
(
GetProcessHeap
(),
0
,
devices_data
->
devices
);
HeapFree
(
GetProcessHeap
(),
0
,
devices_data
->
devices
);
/* Free the backup LPDIACTIONFORMATW */
HeapFree
(
GetProcessHeap
(),
0
,
data
->
original_lpdiaf
->
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
data
->
original_lpdiaf
);
}
}
static
void
fill_device_object_list
(
HWND
dialog
)
static
void
fill_device_object_list
(
HWND
dialog
)
...
@@ -323,6 +329,26 @@ static void assign_action(HWND dialog)
...
@@ -323,6 +329,26 @@ static void assign_action(HWND dialog)
lv_set_action
(
dialog
,
obj
,
action
,
lpdiaf
);
lv_set_action
(
dialog
,
obj
,
action
,
lpdiaf
);
}
}
static
void
copy_actions
(
LPDIACTIONFORMATW
to
,
LPDIACTIONFORMATW
from
)
{
int
i
;
for
(
i
=
0
;
i
<
from
->
dwNumActions
;
i
++
)
{
to
->
rgoAction
[
i
].
guidInstance
=
from
->
rgoAction
[
i
].
guidInstance
;
to
->
rgoAction
[
i
].
dwObjID
=
from
->
rgoAction
[
i
].
dwObjID
;
to
->
rgoAction
[
i
].
dwHow
=
from
->
rgoAction
[
i
].
dwHow
;
to
->
rgoAction
[
i
].
lptszActionName
=
from
->
rgoAction
[
i
].
lptszActionName
;
}
}
static
void
reset_actions
(
HWND
dialog
)
{
ConfigureDevicesData
*
data
=
(
ConfigureDevicesData
*
)
GetWindowLongPtrW
(
dialog
,
DWLP_USER
);
LPDIACTIONFORMATW
to
=
data
->
lpdiaf
,
from
=
data
->
original_lpdiaf
;
copy_actions
(
to
,
from
);
}
static
INT_PTR
CALLBACK
ConfigureDevicesDlgProc
(
HWND
dialog
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
static
INT_PTR
CALLBACK
ConfigureDevicesDlgProc
(
HWND
dialog
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
{
switch
(
uMsg
)
switch
(
uMsg
)
...
@@ -339,6 +365,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
...
@@ -339,6 +365,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
init_listview_columns
(
dialog
);
init_listview_columns
(
dialog
);
/* Create a backup action format for CANCEL and RESET operations */
data
->
original_lpdiaf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPDIACTIONFORMATW
));
data
->
original_lpdiaf
->
dwNumActions
=
data
->
lpdiaf
->
dwNumActions
;
data
->
original_lpdiaf
->
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
data
->
lpdiaf
->
dwNumActions
);
copy_actions
(
data
->
original_lpdiaf
,
data
->
lpdiaf
);
break
;
break
;
}
}
...
@@ -383,15 +415,18 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
...
@@ -383,15 +415,18 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
case
IDOK
:
case
IDOK
:
EndDialog
(
dialog
,
0
);
EndDialog
(
dialog
,
0
);
destroy_d
evices
(
dialog
);
destroy_d
ata
(
dialog
);
break
;
break
;
case
IDCANCEL
:
case
IDCANCEL
:
reset_actions
(
dialog
);
EndDialog
(
dialog
,
0
);
EndDialog
(
dialog
,
0
);
destroy_d
evices
(
dialog
);
destroy_d
ata
(
dialog
);
break
;
break
;
case
IDC_RESET
:
case
IDC_RESET
:
reset_actions
(
dialog
);
fill_device_object_list
(
dialog
);
break
;
break
;
}
}
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment