mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 15:14:38 +01:00
ratbagd: rename test's button type to action_type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
10903e2434
commit
5f98d8d029
@@ -200,13 +200,13 @@ static const struct ratbag_test_device ratbagd_test_device_descr = {
|
||||
.profiles = {
|
||||
{
|
||||
.buttons = {
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_BUTTON,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_BUTTON,
|
||||
.button = 0 },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
.key = KEY_3 },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_SPECIAL,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_SPECIAL,
|
||||
.special = RATBAG_BUTTON_ACTION_SPECIAL_PROFILE_CYCLE_UP },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_MACRO,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_MACRO,
|
||||
.macro = {
|
||||
{ .type = RATBAG_MACRO_EVENT_KEY_PRESSED,
|
||||
.value = KEY_B },
|
||||
@@ -247,13 +247,13 @@ static const struct ratbag_test_device ratbagd_test_device_descr = {
|
||||
},
|
||||
{
|
||||
.buttons = {
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
.key = 4 },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
.key = 5 },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
.key = 6 },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_KEY,
|
||||
.key = 7 },
|
||||
},
|
||||
.resolutions = {
|
||||
@@ -266,9 +266,9 @@ static const struct ratbag_test_device ratbagd_test_device_descr = {
|
||||
},
|
||||
{
|
||||
.buttons = {
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_SPECIAL,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_SPECIAL,
|
||||
.special = RATBAG_BUTTON_ACTION_SPECIAL_PROFILE_CYCLE_UP },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_MACRO,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_MACRO,
|
||||
.macro = {
|
||||
{ .type = RATBAG_MACRO_EVENT_KEY_PRESSED,
|
||||
.value = KEY_A },
|
||||
@@ -278,9 +278,9 @@ static const struct ratbag_test_device ratbagd_test_device_descr = {
|
||||
.value = 150 },
|
||||
}
|
||||
},
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_BUTTON,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_BUTTON,
|
||||
.button = 2 },
|
||||
{ .type = RATBAG_BUTTON_ACTION_TYPE_BUTTON,
|
||||
{ .action_type = RATBAG_BUTTON_ACTION_TYPE_BUTTON,
|
||||
.button = 3 },
|
||||
},
|
||||
.resolutions = {
|
||||
|
||||
@@ -102,7 +102,7 @@ test_read_button(struct ratbag_button *button)
|
||||
struct ratbag_test_macro_event *e;
|
||||
int idx;
|
||||
|
||||
switch (b->type) {
|
||||
switch (b->action_type) {
|
||||
case RATBAG_BUTTON_ACTION_TYPE_BUTTON:
|
||||
button->action.type = RATBAG_BUTTON_ACTION_TYPE_BUTTON;
|
||||
button->action.action.button = p->buttons[button->index].button;
|
||||
|
||||
@@ -37,7 +37,7 @@ struct ratbag_test_macro_event {
|
||||
};
|
||||
|
||||
struct ratbag_test_button {
|
||||
enum ratbag_button_action_type type;
|
||||
enum ratbag_button_action_type action_type;
|
||||
union {
|
||||
int button;
|
||||
int key;
|
||||
|
||||
@@ -681,7 +681,7 @@ START_TEST(device_buttons)
|
||||
struct ratbag_test_device td = sane_device;
|
||||
td.num_buttons = 10;
|
||||
|
||||
td.profiles[0].buttons[8].type = RATBAG_BUTTON_ACTION_TYPE_MACRO;
|
||||
td.profiles[0].buttons[8].action_type = RATBAG_BUTTON_ACTION_TYPE_MACRO;
|
||||
|
||||
td.destroyed_data = &device_freed_count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user