The accelerator formatting method itself is copied from GtkCellRendererAccel, and will be used throughout the code to format the accelerators just like they used to be before moving to the listbox. https://bugzilla.gnome.org/show_bug.cgi?id=769063
96 lines
2.7 KiB
C
96 lines
2.7 KiB
C
/*
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
*
|
|
* Authors: Thomas Wood <thomas.wood@intel.com>
|
|
* Rodrigo Moya <rodrigo@gnome.org>
|
|
*/
|
|
|
|
#include <gtk/gtk.h>
|
|
#include <shell/cc-panel.h>
|
|
|
|
#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;
|
|
|
|
typedef enum
|
|
{
|
|
SHORTCUT_TYPE_KEY_ENTRY,
|
|
SHORTCUT_TYPE_XKB_OPTION,
|
|
} ShortcutType;
|
|
|
|
enum
|
|
{
|
|
DETAIL_DESCRIPTION_COLUMN,
|
|
DETAIL_KEYENTRY_COLUMN,
|
|
DETAIL_TYPE_COLUMN,
|
|
DETAIL_N_COLUMNS
|
|
};
|
|
|
|
enum
|
|
{
|
|
SECTION_DESCRIPTION_COLUMN,
|
|
SECTION_ID_COLUMN,
|
|
SECTION_GROUP_COLUMN,
|
|
SECTION_N_COLUMNS
|
|
};
|
|
|
|
gchar* find_free_settings_path (GSettings *settings);
|
|
|
|
void fill_xkb_options_shortcuts (GtkTreeModel *model);
|
|
|
|
void setup_keyboard_options (GtkListStore *store);
|
|
|
|
gboolean is_valid_binding (guint keyval,
|
|
GdkModifierType mask,
|
|
guint keycode);
|
|
|
|
KeyList* parse_keylist_from_file (const gchar *path);
|
|
|
|
gchar* convert_keysym_state_to_string (guint keysym,
|
|
GdkModifierType mask,
|
|
guint keycode);
|