1 /* dzl-shortcut-controller.h 2 * 3 * Copyright (C) 2016 Christian Hergert <chergert@redhat.com> 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef DZL_SHORTCUT_CONTROLLER_H 20 #define DZL_SHORTCUT_CONTROLLER_H 21 22 #include <gtk/gtk.h> 23 24 #include "dzl-version-macros.h" 25 26 #include "shortcuts/dzl-shortcut-context.h" 27 #include "shortcuts/dzl-shortcut-manager.h" 28 #include "shortcuts/dzl-shortcut-phase.h" 29 30 G_BEGIN_DECLS 31 32 #define DZL_TYPE_SHORTCUT_CONTROLLER (dzl_shortcut_controller_get_type()) 33 34 DZL_AVAILABLE_IN_ALL 35 G_DECLARE_FINAL_TYPE (DzlShortcutController, dzl_shortcut_controller, DZL, SHORTCUT_CONTROLLER, GObject) 36 37 DZL_AVAILABLE_IN_ALL 38 DzlShortcutController *dzl_shortcut_controller_new (GtkWidget *widget); 39 DZL_AVAILABLE_IN_3_34 40 GtkWidget *dzl_shortcut_controller_get_widget (DzlShortcutController *self); 41 DZL_AVAILABLE_IN_ALL 42 DzlShortcutManager *dzl_shortcut_controller_get_manager (DzlShortcutController *self); 43 DZL_AVAILABLE_IN_ALL 44 void dzl_shortcut_controller_set_manager (DzlShortcutController *self, 45 DzlShortcutManager *manager); 46 DZL_AVAILABLE_IN_ALL 47 DzlShortcutController *dzl_shortcut_controller_find (GtkWidget *widget); 48 DZL_AVAILABLE_IN_ALL 49 DzlShortcutController *dzl_shortcut_controller_try_find (GtkWidget *widget); 50 DZL_AVAILABLE_IN_ALL 51 DzlShortcutContext *dzl_shortcut_controller_get_context (DzlShortcutController *self); 52 DZL_AVAILABLE_IN_ALL 53 void dzl_shortcut_controller_set_context_by_name (DzlShortcutController *self, 54 const gchar *name); 55 DZL_AVAILABLE_IN_ALL 56 DzlShortcutContext *dzl_shortcut_controller_get_context_for_phase (DzlShortcutController *self, 57 DzlShortcutPhase phase); 58 DZL_AVAILABLE_IN_ALL 59 gboolean dzl_shortcut_controller_execute_command (DzlShortcutController *self, 60 const gchar *command); 61 DZL_AVAILABLE_IN_ALL 62 const DzlShortcutChord *dzl_shortcut_controller_get_current_chord (DzlShortcutController *self); 63 DZL_AVAILABLE_IN_3_34 64 void dzl_shortcut_controller_remove_accel (DzlShortcutController *self, 65 const gchar *accel, 66 DzlShortcutPhase phase); 67 DZL_AVAILABLE_IN_ALL 68 void dzl_shortcut_controller_add_command_action (DzlShortcutController *self, 69 const gchar *command_id, 70 const gchar *default_accel, 71 DzlShortcutPhase phase, 72 const gchar *action); 73 DZL_AVAILABLE_IN_ALL 74 void dzl_shortcut_controller_add_command_callback (DzlShortcutController *self, 75 const gchar *command_id, 76 const gchar *default_accel, 77 DzlShortcutPhase phase, 78 GtkCallback callback, 79 gpointer callback_data, 80 GDestroyNotify callback_data_destroy); 81 DZL_AVAILABLE_IN_ALL 82 void dzl_shortcut_controller_add_command_signal (DzlShortcutController *self, 83 const gchar *command_id, 84 const gchar *default_accel, 85 DzlShortcutPhase phase, 86 const gchar *signal_name, 87 guint n_args, 88 ...); 89 90 G_END_DECLS 91 92 #endif /* DZL_SHORTCUT_CONTROLLER_H */ 93