[gnome-games/wip/exalm/gameapd: 10/14] gamepad-view-configuration: Rename inputs to buttons
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/gameapd: 10/14] gamepad-view-configuration: Rename inputs to buttons
- Date: Wed, 4 Mar 2020 16:51:20 +0000 (UTC)
commit 80b601b460f026676a368648299fee165096a95d
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Mar 4 20:08:04 2020 +0500
gamepad-view-configuration: Rename inputs to buttons
This will be needed to distinguish analog sticks in the next commit.
src/ui/gamepad-view-configuration.vala | 8 ++++----
src/ui/gamepad-view.vala | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/ui/gamepad-view-configuration.vala b/src/ui/gamepad-view-configuration.vala
index ba949df4..8f3fdb52 100644
--- a/src/ui/gamepad-view-configuration.vala
+++ b/src/ui/gamepad-view-configuration.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
namespace Games {
- private const GamepadInputPath[] STANDARD_GAMEPAD_INPUT_PATHS = {
+ private const GamepadButtonPath[] STANDARD_GAMEPAD_BUTTON_PATHS = {
{ { EventCode.EV_ABS, EventCode.ABS_X }, "leftx" },
{ { EventCode.EV_ABS, EventCode.ABS_Y }, "lefty" },
{ { EventCode.EV_ABS, EventCode.ABS_RX }, "rightx" },
@@ -25,21 +25,21 @@ namespace Games {
{ { EventCode.EV_KEY, EventCode.BTN_WEST }, "west" },
};
- private struct GamepadInputPath {
+ private struct GamepadButtonPath {
GamepadInput input;
string path;
}
private struct GamepadViewConfiguration {
string svg_path;
- GamepadInputPath[] input_paths;
+ GamepadButtonPath[] button_paths;
string[] background_paths;
public static GamepadViewConfiguration get_default () {
GamepadViewConfiguration conf = {};
conf.svg_path = "/org/gnome/Games/gamepads/standard-gamepad.svg";
- conf.input_paths = STANDARD_GAMEPAD_INPUT_PATHS;
+ conf.button_paths = STANDARD_GAMEPAD_BUTTON_PATHS;
conf.background_paths = {};
return conf;
diff --git a/src/ui/gamepad-view.vala b/src/ui/gamepad-view.vala
index db39846e..d986d764 100644
--- a/src/ui/gamepad-view.vala
+++ b/src/ui/gamepad-view.vala
@@ -37,7 +37,7 @@ private class Games.GamepadView : Gtk.DrawingArea {
input_state.foreach_remove (() => true);
- foreach (var path in configuration.input_paths) {
+ foreach (var path in configuration.button_paths) {
if (path.path in input_state)
continue;
@@ -50,7 +50,7 @@ private class Games.GamepadView : Gtk.DrawingArea {
construct {
handle = new Rsvg.Handle ();
- configuration = { "", new GamepadInputPath[0] };
+ configuration = { "", new GamepadButtonPath[0] };
input_state = new HashTable<string, InputState?> (str_hash, str_equal);
}
@@ -78,7 +78,7 @@ private class Games.GamepadView : Gtk.DrawingArea {
}
public bool highlight (GamepadInput input, bool highlight) {
- foreach (var path in configuration.input_paths) {
+ foreach (var path in configuration.button_paths) {
if (input != path.input)
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]