ReactOS  0.4.14-dev-50-g13bb5e2
config.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Lucas Fialho Zawacki
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #define NONAMELESSUNION
20 
21 #include "wine/unicode.h"
22 #include "objbase.h"
23 #include "dinput_private.h"
24 #include "device_private.h"
25 #include "resource.h"
26 
27 typedef struct {
28  int nobjects;
29  IDirectInputDevice8W *lpdid;
32 } DeviceData;
33 
34 typedef struct {
35  int ndevices;
38 
39 typedef struct {
40  IDirectInput8W *lpDI;
46 
47 /*
48  * Enumeration callback functions
49  */
51 {
52  DeviceData *data = (DeviceData*) pvRef;
53 
54  data->ddo[data->nobjects] = *lpddo;
55 
56  data->nobjects++;
57  return DIENUM_CONTINUE;
58 }
59 
60 static BOOL CALLBACK count_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
61 {
62  DIDevicesData *data = (DIDevicesData*) pvRef;
63 
64  data->ndevices++;
65  return DIENUM_CONTINUE;
66 }
67 
68 static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
69 {
70  DIDevicesData *data = (DIDevicesData*) pvRef;
71  DeviceData *device = &data->devices[data->ndevices];
72  device->lpdid = lpdid;
73  device->ddi = *lpddi;
74 
76 
77  device->nobjects = 0;
79 
80  data->ndevices++;
81  return DIENUM_CONTINUE;
82 }
83 
84 /*
85  * Listview utility functions
86  */
88 {
89  LVCOLUMNW listColumn;
90  RECT viewRect;
91  int width;
93 
95  width = (viewRect.right - viewRect.left)/2;
96 
98  listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
99  listColumn.pszText = column;
100  listColumn.cchTextMax = lstrlenW(listColumn.pszText);
101  listColumn.cx = width;
102 
104 
106  listColumn.cx = width;
107  listColumn.pszText = column;
108  listColumn.cchTextMax = lstrlenW(listColumn.pszText);
109 
111 }
112 
114 {
116 }
117 
119 {
120  LVITEMW item;
121 
122  if (index < 0) return -1;
123 
124  item.mask = LVIF_PARAM;
125  item.iItem = index;
126  item.iSubItem = 0;
127 
129 
130  return item.lParam;
131 }
132 
133 static void lv_set_action(HWND dialog, int item, int action, LPDIACTIONFORMATW lpdiaf)
134 {
135  static const WCHAR no_action[] = {'-','\0'};
136  const WCHAR *action_text = no_action;
137  LVITEMW lvItem;
138 
139  if (item < 0) return;
140 
141  if (action != -1)
142  action_text = lpdiaf->rgoAction[action].u.lptszActionName;
143 
144  /* Keep the action and text in the listview item */
145  lvItem.iItem = item;
146 
147  lvItem.mask = LVIF_PARAM;
148  lvItem.iSubItem = 0;
149  lvItem.lParam = (LPARAM) action;
150 
151  /* Action index */
153 
154  lvItem.mask = LVIF_TEXT;
155  lvItem.iSubItem = 1;
156  lvItem.pszText = (WCHAR *)action_text;
157  lvItem.cchTextMax = lstrlenW(lvItem.pszText);
158 
159  /* Text */
161 }
162 
163 /*
164  * Utility functions
165  */
167 {
170  return &data->devices_data.devices[sel];
171 }
172 
174 {
176  return data->lpdiaf;
177 }
178 
180 {
182  return data->display_only;
183 }
184 
185 static void init_devices(HWND dialog, IDirectInput8W *lpDI, DIDevicesData *data, LPDIACTIONFORMATW lpdiaf)
186 {
187  int i;
188 
189  /* Count devices */
190  data->ndevices = 0;
192 
193  /* Allocate devices */
194  data->devices = HeapAlloc(GetProcessHeap(), 0, sizeof(DeviceData) * data->ndevices);
195 
196  /* Collect and insert */
197  data->ndevices = 0;
199 
200  for (i=0; i < data->ndevices; i++)
201  SendDlgItemMessageW(dialog, IDC_CONTROLLERCOMBO, CB_ADDSTRING, 0, (LPARAM) data->devices[i].ddi.tszProductName );
202 }
203 
205 {
206  int i;
208  DIDevicesData *devices_data = &data->devices_data;
209 
210  /* Free the devices */
211  for (i=0; i < devices_data->ndevices; i++)
212  IDirectInputDevice8_Release(devices_data->devices[i].lpdid);
213 
214  HeapFree(GetProcessHeap(), 0, devices_data->devices);
215 
216  /* Free the backup LPDIACTIONFORMATW */
217  HeapFree(GetProcessHeap(), 0, data->original_lpdiaf->rgoAction);
218  HeapFree(GetProcessHeap(), 0, data->original_lpdiaf);
219 }
220 
222 {
225  LVITEMW item;
226  int i, j;
227 
228  /* Clean the listview */
230 
231  /* Add each object */
232  for (i=0; i < device->nobjects; i++)
233  {
234  int action = -1;
235 
236  item.mask = LVIF_TEXT | LVIF_PARAM;
237  item.iItem = i;
238  item.iSubItem = 0;
239  item.pszText = device->ddo[i].tszName;
240  item.cchTextMax = lstrlenW(item.pszText);
241 
242  /* Add the item */
244 
245  /* Search for an assigned action for this device */
246  for (j=0; j < lpdiaf->dwNumActions; j++)
247  {
248  if (IsEqualGUID(&lpdiaf->rgoAction[j].guidInstance, &device->ddi.guidInstance) &&
249  lpdiaf->rgoAction[j].dwObjID == device->ddo[i].dwType)
250  {
251  action = j;
252  break;
253  }
254  }
255 
256  lv_set_action(dialog, i, action, lpdiaf);
257  }
258 }
259 
261 {
264  int i, added = 0;
265  int obj = lv_get_cur_item(dialog);
266 
267  if (obj < 0) return;
268 
270 
271  for (i=0; i < lpdiaf->dwNumActions; i++)
272  {
273  /* Skip keyboard actions for non keyboards */
274  if (GET_DIDEVICE_TYPE(device->ddi.dwDevType) != DI8DEVTYPE_KEYBOARD &&
275  (lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) == DIKEYBOARD_MASK) continue;
276 
277  /* Skip mouse actions for non mouses */
278  if (GET_DIDEVICE_TYPE(device->ddi.dwDevType) != DI8DEVTYPE_MOUSE &&
279  (lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) == DIMOUSE_MASK) continue;
280 
281  /* Add action string and index in the action format to the list entry */
282  if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[obj].dwType))
283  {
286  added++;
287  }
288  }
289 }
290 
292 {
295  LVFINDINFOW lvFind;
298  int obj = lv_get_cur_item(dialog);
299  int old_action = lv_get_item_data(dialog, obj);
300  int used_obj;
301 
302  DIDEVICEOBJECTINSTANCEW ddo = device->ddo[obj];
303 
304  if (old_action == action) return;
305 
306  /* Clear old action */
307  if (old_action != -1)
308  {
309  lpdiaf->rgoAction[old_action].dwObjID = 0;
310  lpdiaf->rgoAction[old_action].guidInstance = GUID_NULL;
311  lpdiaf->rgoAction[old_action].dwHow = DIAH_UNMAPPED;
312  }
313 
314  /* Find if action text is already set for other object and unset it */
315  lvFind.flags = LVFI_PARAM;
316  lvFind.lParam = action;
317 
319 
320  lv_set_action(dialog, used_obj, -1, lpdiaf);
321 
322  /* Set new action */
323  lpdiaf->rgoAction[action].dwObjID = ddo.dwType;
324  lpdiaf->rgoAction[action].guidInstance = device->ddi.guidInstance;
326 
327  /* Set new action in the list */
328  lv_set_action(dialog, obj, action, lpdiaf);
329 }
330 
332 {
333  DWORD i;
334  for (i=0; i < from->dwNumActions; i++)
335  {
336  to->rgoAction[i].guidInstance = from->rgoAction[i].guidInstance;
337  to->rgoAction[i].dwObjID = from->rgoAction[i].dwObjID;
338  to->rgoAction[i].dwHow = from->rgoAction[i].dwHow;
339  to->rgoAction[i].u.lptszActionName = from->rgoAction[i].u.lptszActionName;
340  }
341 }
342 
344 {
346  LPDIACTIONFORMATW to = data->lpdiaf, from = data->original_lpdiaf;
347 
348  copy_actions(to, from);
349 }
350 
352 {
353  switch(uMsg)
354  {
355  case WM_INITDIALOG:
356  {
358 
359  /* Initialize action format and enumerate devices */
360  init_devices(dialog, data->lpDI, &data->devices_data, data->lpdiaf);
361 
362  /* Store information in the window */
364 
366 
367  /* Create a backup action format for CANCEL and RESET operations */
368  data->original_lpdiaf = HeapAlloc(GetProcessHeap(), 0, sizeof(*data->original_lpdiaf));
369  data->original_lpdiaf->dwNumActions = data->lpdiaf->dwNumActions;
370  data->original_lpdiaf->rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*data->lpdiaf->dwNumActions);
371  copy_actions(data->original_lpdiaf, data->lpdiaf);
372 
373  /* Select the first device and show its actions */
376 
377  break;
378  }
379 
380  case WM_NOTIFY:
381 
382  switch (((LPNMHDR)lParam)->code)
383  {
384  case LVN_ITEMCHANGED:
386  break;
387  }
388  break;
389 
390 
391  case WM_COMMAND:
392 
393  switch(LOWORD(wParam))
394  {
395 
396  case IDC_ACTIONLIST:
397 
398  switch (HIWORD(wParam))
399  {
400  case LBN_DBLCLK:
401  /* Ignore this if app did not ask for editing */
402  if (dialog_display_only(dialog)) break;
403 
405  break;
406  }
407  break;
408 
409  case IDC_CONTROLLERCOMBO:
410 
411  switch (HIWORD(wParam))
412  {
413  case CBN_SELCHANGE:
415  break;
416  }
417  break;
418 
419  case IDOK:
420  EndDialog(dialog, 0);
422  break;
423 
424  case IDCANCEL:
426  EndDialog(dialog, 0);
428  break;
429 
430  case IDC_RESET:
433  break;
434  }
435  break;
436  }
437 
438  return FALSE;
439 }
440 
441 HRESULT _configure_devices(IDirectInput8W *iface,
442  LPDICONFIGUREDEVICESCALLBACK lpdiCallback,
443  LPDICONFIGUREDEVICESPARAMSW lpdiCDParams,
444  DWORD dwFlags,
445  LPVOID pvRefData
446 )
447 {
449  data.lpDI = iface;
450  data.lpdiaf = lpdiCDParams->lprgFormats;
451  data.display_only = !(dwFlags & DICD_EDIT);
452 
454 
456  lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data);
457 
458  return DI_OK;
459 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
GLint GLint GLsizei width
Definition: gl.h:1546
static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pvRef)
Definition: config.c:50
static void init_listview_columns(HWND dialog)
Definition: config.c:87
#define IDOK
Definition: winuser.h:824
DIDevicesData devices_data
Definition: config.c:43
#define LVCF_WIDTH
Definition: commctrl.h:2559
DWORD dwObjID
Definition: dinput.h:1286
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define LB_ADDSTRING
Definition: winuser.h:2013
#define LVCF_TEXT
Definition: commctrl.h:2560
static int lv_get_cur_item(HWND dialog)
Definition: config.c:113
#define IDirectInputDevice_EnumObjects(p, a, b, c)
Definition: dinput.h:1607
static void assign_action(HWND dialog)
Definition: config.c:291
#define LVM_FINDITEMW
Definition: commctrl.h:2438
#define LB_GETITEMDATA
Definition: winuser.h:2023
#define LVN_ITEMCHANGED
Definition: commctrl.h:3103
HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData)
Definition: config.c:441
LPARAM lParam
Definition: commctrl.h:2430
#define CALLBACK
Definition: compat.h:27
LPDIACTIONFORMATW lpdiaf
Definition: config.c:41
static void lv_set_action(HWND dialog, int item, int action, LPDIACTIONFORMATW lpdiaf)
Definition: config.c:133
LPDIACTIONFORMATW original_lpdiaf
Definition: config.c:42
#define IDirectInputDevice_AddRef(p)
Definition: dinput.h:1603
#define LVNI_SELECTED
Definition: commctrl.h:2396
UINT_PTR WPARAM
Definition: windef.h:207
GUID guidInstance
Definition: dinput.h:1285
#define GetWindowLongPtrW
Definition: winuser.h:4730
LONG left
Definition: windef.h:291
int32_t INT_PTR
Definition: typedefs.h:62
#define DI8DEVTYPE_KEYBOARD
Definition: dinput.h:211
static LPDIACTIONFORMATW get_cur_lpdiaf(HWND dialog)
Definition: config.c:173
HINSTANCE DINPUT_instance
Definition: dinput_main.c:96
LONG right
Definition: windef.h:293
#define lstrlenW
Definition: compat.h:407
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CB_GETCURSEL
Definition: winuser.h:1925
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define DIDFT_GETINSTANCE(n)
Definition: dinput.h:764
#define LVFI_PARAM
Definition: commctrl.h:2408
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
int ndevices
Definition: config.c:35
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVCF_SUBITEM
Definition: commctrl.h:2561
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define LB_RESETCONTENT
Definition: winuser.h:2037
int nobjects
Definition: config.c:28
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2604
Definition: devices.h:37
int iSubItem
Definition: commctrl.h:2334
#define IDC_CONTROLLERCOMBO
Definition: resource.h:30
LPARAM lParam
Definition: commctrl.h:2340
#define CB_ADDSTRING
Definition: winuser.h:1918
smooth NULL
Definition: ftsmooth.c:416
#define IDC_ACTIONLIST
Definition: resource.h:32
LONG_PTR LPARAM
Definition: windef.h:208
static void init_devices(HWND dialog, IDirectInput8W *lpDI, DIDevicesData *data, LPDIACTIONFORMATW lpdiaf)
Definition: config.c:185
#define IDS_OBJECTCOLUMN
Definition: resource.h:37
GLuint index
Definition: glext.h:6031
#define IDirectInputDevice8_Release(p)
Definition: dinput.h:2038
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define DIAH_UNMAPPED
Definition: dinput.h:1301
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
IDirectInputDevice8W * lpdid
Definition: config.c:29
LPDIACTIONFORMATW lprgFormats
Definition: dinput.h:1401
#define MAX_PATH
Definition: compat.h:26
#define DICD_EDIT
Definition: dinput.h:1364
LPWSTR pszText
Definition: commctrl.h:2539
#define IDD_CONFIGUREDEVICES
Definition: resource.h:23
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_DEVICEOBJECTSLIST
Definition: resource.h:33
#define GET_DIDEVICE_TYPE(dwDevType)
Definition: dinput.h:320
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LB_SETITEMDATA
Definition: winuser.h:2047
#define LBN_DBLCLK
Definition: winuser.h:2053
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
UINT mask
Definition: commctrl.h:2332
DeviceData * devices
Definition: config.c:36
#define index(s, c)
Definition: various.h:29
#define DWLP_USER
Definition: winuser.h:866
IDirectInput8W * lpDI
Definition: config.c:40
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define GUID_NULL
Definition: ks.h:106
static void destroy_data(HWND dialog)
Definition: config.c:204
#define CB_SETCURSEL
Definition: winuser.h:1943
#define DIKEYBOARD_MASK
#define WM_COMMAND
Definition: winuser.h:1722
LPDIACTIONW rgoAction
Definition: dinput.h:1332
static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: config.c:351
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2385
#define DIMOUSE_MASK
static int dialog_display_only(HWND dialog)
Definition: config.c:179
int cchTextMax
Definition: commctrl.h:2540
static DeviceData * get_cur_device(HWND dialog)
Definition: config.c:166
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define IDirectInput8_EnumDevicesBySemantics(p, a, b, c, d, e)
Definition: dinput.h:2466
static void copy_actions(LPDIACTIONFORMATW to, LPDIACTIONFORMATW from)
Definition: config.c:331
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
static void show_suitable_actions(HWND dialog)
Definition: config.c:260
const WCHAR * action
Definition: action.c:7783
static ATOM item
Definition: dde.c:856
#define DIAH_USERCONFIG
Definition: dinput.h:1302
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL(CALLBACK * LPDICONFIGUREDEVICESCALLBACK)(LPUNKNOWN, LPVOID)
Definition: dinput.h:462
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDC_RESET
Definition: resource.h:26
#define LB_GETCURSEL
Definition: winuser.h:2021
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define DI8DEVTYPE_MOUSE
Definition: dinput.h:210
static HWND dialog
Definition: gui.c:33
#define LVM_SETITEMW
Definition: commctrl.h:2369
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define LVIF_PARAM
Definition: commctrl.h:2283
#define IDS_ACTIONCOLUMN
Definition: resource.h:36
static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
Definition: config.c:68
#define DI_OK
Definition: dinput.h:128
#define DIENUM_CONTINUE
Definition: dinput.h:188
DIDEVICEINSTANCEW ddi
Definition: config.c:30
#define HIWORD(l)
Definition: typedefs.h:246
DWORD dwHow
Definition: dinput.h:1287
static void reset_actions(HWND dialog)
Definition: config.c:343
#define SetWindowLongPtrW
Definition: winuser.h:5247
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
DWORD dwNumActions
Definition: dinput.h:1331
#define DIDFT_ALL
Definition: dinput.h:750
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define IDCANCEL
Definition: winuser.h:825
#define DIDFT_GETTYPE(n)
Definition: dinput.h:763
CardRegion * from
Definition: spigame.cpp:19
#define LVM_GETNEXTITEM
Definition: commctrl.h:2405
static BOOL CALLBACK count_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
Definition: config.c:60
static void fill_device_object_list(HWND dialog)
Definition: config.c:221
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61
DWORD dwSemantic
Definition: dinput.h:1279
static int lv_get_item_data(HWND dialog, int index)
Definition: config.c:118
LPCWSTR lptszActionName
Definition: dinput.h:1282