mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
backends: Add function to retrieve the label for a pad button action
As those are specified by settings.
This commit is contained in:
parent
c7e0b87d7e
commit
67f5b89659
@ -123,6 +123,9 @@ gboolean meta_input_settings_handle_pad_button (MetaIn
|
|||||||
ClutterInputDevice *pad,
|
ClutterInputDevice *pad,
|
||||||
gboolean is_press,
|
gboolean is_press,
|
||||||
guint button);
|
guint button);
|
||||||
|
gchar * meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings,
|
||||||
|
ClutterInputDevice *pad,
|
||||||
|
guint button);
|
||||||
|
|
||||||
#ifdef HAVE_LIBWACOM
|
#ifdef HAVE_LIBWACOM
|
||||||
WacomDevice * meta_input_settings_get_tablet_wacom_device (MetaInputSettings *settings,
|
WacomDevice * meta_input_settings_get_tablet_wacom_device (MetaInputSettings *settings,
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "native/meta-input-settings-native.h"
|
#include "native/meta-input-settings-native.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <glib/gi18n-lib.h>
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
|
|
||||||
static GQuark quark_tool_settings = 0;
|
static GQuark quark_tool_settings = 0;
|
||||||
@ -1381,3 +1382,40 @@ meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gchar *
|
||||||
|
meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings,
|
||||||
|
ClutterInputDevice *pad,
|
||||||
|
guint button)
|
||||||
|
{
|
||||||
|
GDesktopPadButtonAction action;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_INPUT_SETTINGS (input_settings), NULL);
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (pad), NULL);
|
||||||
|
g_return_val_if_fail (clutter_input_device_get_device_type (pad) ==
|
||||||
|
CLUTTER_PAD_DEVICE, NULL);
|
||||||
|
|
||||||
|
action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case G_DESKTOP_PAD_BUTTON_ACTION_KEYBINDING:
|
||||||
|
{
|
||||||
|
GSettings *settings;
|
||||||
|
gchar *accel;
|
||||||
|
|
||||||
|
settings = lookup_pad_button_settings (pad, button);
|
||||||
|
accel = g_settings_get_string (settings, "keybinding");
|
||||||
|
g_object_unref (settings);
|
||||||
|
|
||||||
|
return accel;
|
||||||
|
}
|
||||||
|
case G_DESKTOP_PAD_BUTTON_ACTION_SWITCH_MONITOR:
|
||||||
|
return g_strdup (_("Switch monitor"));
|
||||||
|
case G_DESKTOP_PAD_BUTTON_ACTION_HELP:
|
||||||
|
return g_strdup (_("Show on-screen help"));
|
||||||
|
case G_DESKTOP_PAD_BUTTON_ACTION_NONE:
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user