From ae1c76ff830d146d41e88d6fba724c0a54bce868 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:45:20 +0200 Subject: Adding upstream version 1:43.6. Signed-off-by: Daniel Baumann --- panels/keyboard/keyboard-shortcuts.h | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 panels/keyboard/keyboard-shortcuts.h (limited to 'panels/keyboard/keyboard-shortcuts.h') diff --git a/panels/keyboard/keyboard-shortcuts.h b/panels/keyboard/keyboard-shortcuts.h new file mode 100644 index 0000000..7c9b978 --- /dev/null +++ b/panels/keyboard/keyboard-shortcuts.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 Intel, Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * Authors: Thomas Wood + * Rodrigo Moya + */ + +#include +#include + +#include "cc-keyboard-item.h" + +typedef struct { + /* The untranslated name, combine with ->package to translate */ + char *name; + /* The group of keybindings (system or application) */ + char *group; + /* The gettext package to use to translate the section title */ + char *package; + /* Name of the window manager the keys would apply to */ + char *wm_name; + /* The GSettings schema for the whole file, if any */ + char *schema; + /* an array of KeyListEntry */ + GArray *entries; +} KeyList; + +typedef struct +{ + CcKeyboardItemType type; + char *schema; /* GSettings schema name, if any */ + char *description; /* description for GSettings types */ + char *name; /* GSettings schema path, or GSettings key name depending on type */ + char *reverse_entry; + gboolean is_reversed; + gboolean hidden; +} KeyListEntry; + +typedef struct { + CcKeyboardItem *orig_item; + CcKeyboardItem *conflict_item; + guint new_keyval; + GdkModifierType new_mask; + guint new_keycode; +} CcUniquenessData; + +enum +{ + SECTION_DESCRIPTION_COLUMN, + SECTION_ID_COLUMN, + SECTION_GROUP_COLUMN, + SECTION_N_COLUMNS +}; + +gchar* find_free_settings_path (GSettings *settings); + +gboolean is_valid_binding (const CcKeyCombo *combo); + +gboolean is_empty_binding (const CcKeyCombo *combo); + +gboolean is_valid_accel (const CcKeyCombo *combo); + +KeyList* parse_keylist_from_file (const gchar *path); + +gchar* convert_keysym_state_to_string (const CcKeyCombo *combo); + +void normalize_keyval_and_mask (guint keyval, + GdkModifierType mask, + guint group, + guint *out_keyval, + GdkModifierType *out_mask); -- cgit v1.2.3