joy.h 3.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
/*
 * Joystick testing control panel applet resources and definitions
 *
 * Copyright 2012 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
 *
 */

#ifndef __WINE_JOYSTICKCPL__
#define __WINE_JOYSTICKCPL__

#include <winuser.h>
#include <windef.h>
#include <commctrl.h>
#include <dinput.h>

extern HMODULE hcpl;

32 33 34 35 36 37
struct Effect {
    IDirectInputEffect *effect;
    DIEFFECT params;
    DIEFFECTINFOW info;
};

38 39 40 41 42
struct Joystick {
    IDirectInputDevice8W *device;
    DIDEVICEINSTANCEW instance;
    int num_buttons;
    int num_axes;
43 44 45 46 47
    BOOL forcefeedback;
    int num_effects;
    int cur_effect;
    int chosen_effect;
    struct Effect *effects;
48 49
};

50
#define TEST_MAX_BUTTONS    32
51
#define TEST_MAX_AXES       4
52

53 54 55 56 57 58 59
struct Graphics {
    HWND hwnd;
    HWND buttons[TEST_MAX_BUTTONS];
    HWND axes[TEST_MAX_AXES];
    HWND ff_axis;
};

60 61 62 63
struct JoystickData {
    IDirectInput8W *di;
    struct Joystick *joysticks;
    int num_joysticks;
64
    int num_ff;
65 66
    int cur_joystick;
    int chosen_joystick;
67
    struct Graphics graphics;
68
    BOOL stop;
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
};

#define NUM_PROPERTY_PAGES 3

/* strings */
#define IDS_CPL_NAME        1
#define IDS_CPL_INFO        2

/* dialogs */
#define IDC_STATIC          -1

#define IDD_LIST            1000
#define IDD_TEST            1001
#define IDD_FORCEFEEDBACK   1002

84 85 86 87
#define IDC_JOYSTICKLIST    2000
#define IDC_BUTTONDISABLE   2001
#define IDC_BUTTONENABLE    2002
#define IDC_DISABLEDLIST    2003
88
#define IDC_TESTSELECTCOMBO 2004
89 90 91
#define IDC_TESTGROUPXY     2005
#define IDC_TESTGROUPRXRY   2006
#define IDC_TESTGROUPZRZ    2007
92
#define IDC_TESTGROUPPOV    2008
93

94 95 96
#define IDC_FFSELECTCOMBO   2009
#define IDC_FFEFFECTLIST    2010

97 98
#define ICO_MAIN            100

99 100 101 102
/* constants */
#define TEST_POLL_TIME      100

#define TEST_BUTTON_COL_MAX 8
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
#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
122

123 124 125
#define FF_PLAY_TIME        2*DI_SECONDS
#define FF_PERIOD_TIME      FF_PLAY_TIME/4

126
#endif