Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gtkshortcutaction.h
Go to the documentation of this file.
1/*
2 * Copyright © 2018 Benjamin Otte
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authors: Benjamin Otte <otte@gnome.org>
18 */
19
20#pragma once
21
22#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23#error "Only <gtk/gtk.h> can be included directly."
24#endif
25
26#include <gtk/gtktypes.h>
27
29
30#define GTK_TYPE_SHORTCUT_ACTION (gtk_shortcut_action_get_type ())
31
32/**
33 * GtkShortcutFunc:
34 * @widget: The widget passed to the activation
35 * @args: (nullable): The arguments passed to the activation
36 * @user_data: (nullable): The user data provided when activating the action
37 *
38 * Prototype for shortcuts based on user callbacks.
39 *
40 * Returns: %TRUE if the action was successful.
41 */
42typedef gboolean (* GtkShortcutFunc) (GtkWidget *widget,
43 GVariant *args,
44 gpointer user_data);
45
46/**
47 * GtkShortcutActionFlags:
48 * @GTK_SHORTCUT_ACTION_EXCLUSIVE: The action is the only
49 * action that can be activated. If this flag is not set,
50 * a future activation may select a different action.
51 *
52 * List of flags that can be passed to action activation.
53 *
54 * More flags may be added in the future.
55 **/
59
61GDK_DECLARE_INTERNAL_TYPE (GtkShortcutAction, gtk_shortcut_action, GTK, SHORTCUT_ACTION, GObject)
62
67
70 GString *string);
74 GtkWidget *widget,
75 GVariant *args);
76
77#define GTK_TYPE_NOTHING_ACTION (gtk_nothing_action_get_type())
78
79/**
80 * GtkNothingAction:
81 *
82 * A `GtkShortcutAction` that does nothing.
83 */
85GDK_DECLARE_INTERNAL_TYPE (GtkNothingAction, gtk_nothing_action, GTK, NOTHING_ACTION, GtkShortcutAction)
86
89
90#define GTK_TYPE_CALLBACK_ACTION (gtk_callback_action_get_type())
91
92/**
93 * GtkCallbackAction:
94 *
95 * A `GtkShortcutAction` that invokes a callback.
96 */
98GDK_DECLARE_INTERNAL_TYPE (GtkCallbackAction, gtk_callback_action, GTK, CALLBACK_ACTION, GtkShortcutAction)
99
102 gpointer data,
103 GDestroyNotify destroy);
104
105#define GTK_TYPE_MNEMONIC_ACTION (gtk_mnemonic_action_get_type())
106
107/**
108 * GtkMnemonicAction:
109 *
110 * A `GtkShortcutAction` that calls gtk_widget_mnemonic_activate().
111 */
113GDK_DECLARE_INTERNAL_TYPE (GtkMnemonicAction, gtk_mnemonic_action, GTK, MNEMONIC_ACTION, GtkShortcutAction)
114
117
118#define GTK_TYPE_ACTIVATE_ACTION (gtk_activate_action_get_type())
119
120/**
121 * GtkActivateAction:
122 *
123 * A `GtkShortcutAction` that calls gtk_widget_activate().
124 */
126GDK_DECLARE_INTERNAL_TYPE (GtkActivateAction, gtk_activate_action, GTK, ACTIVATE_ACTION, GtkShortcutAction)
127
130
131#define GTK_TYPE_SIGNAL_ACTION (gtk_signal_action_get_type())
132
133/**
134 * GtkSignalAction:
135 *
136 * A `GtkShortcut`Action that emits a signal.
137 *
138 * Signals that are used in this way are referred to as keybinding signals,
139 * and they are expected to be defined with the %G_SIGNAL_ACTION flag.
140 */
142GDK_DECLARE_INTERNAL_TYPE (GtkSignalAction, gtk_signal_action, GTK, SIGNAL_ACTION, GtkShortcutAction)
143
145GtkShortcutAction * gtk_signal_action_new (const char *signal_name);
147const char * gtk_signal_action_get_signal_name (GtkSignalAction *self);
148
149#define GTK_TYPE_NAMED_ACTION (gtk_named_action_get_type())
150
151/**
152 * GtkNamedAction:
153 *
154 * A `GtkShortcutAction` that activates an action by name.
155 */
157GDK_DECLARE_INTERNAL_TYPE (GtkNamedAction, gtk_named_action, GTK, NAMED_ACTION, GtkShortcutAction)
158
162const char * gtk_named_action_get_action_name (GtkNamedAction *self);
163
165
#define GDK_AVAILABLE_IN_ALL
#define GDK_DECLARE_INTERNAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName)
Definition gdktypes.h:122
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
typedefG_BEGIN_DECLS struct _GString GString
Definition gstring.h:43
GtkShortcutActionFlags
@ GTK_SHORTCUT_ACTION_EXCLUSIVE
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_mnemonic_action_get(void)
GDK_AVAILABLE_IN_ALL gboolean gtk_shortcut_action_activate(GtkShortcutAction *self, GtkShortcutActionFlags flags, GtkWidget *widget, GVariant *args)
GDK_AVAILABLE_IN_ALL const char * gtk_signal_action_get_signal_name(GtkSignalAction *self)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_signal_action_new(const char *signal_name)
gboolean(* GtkShortcutFunc)(GtkWidget *widget, GVariant *args, gpointer user_data)
GDK_AVAILABLE_IN_ALL void gtk_shortcut_action_print(GtkShortcutAction *self, GString *string)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_nothing_action_get(void)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_named_action_new(const char *name)
GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_shortcut_action_parse_string(const char *string)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_activate_action_get(void)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL GtkShortcutAction * gtk_callback_action_new(GtkShortcutFunc callback, gpointer data, GDestroyNotify destroy)
GDK_AVAILABLE_IN_ALL const char * gtk_named_action_get_action_name(GtkNamedAction *self)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL char * gtk_shortcut_action_to_string(GtkShortcutAction *self)
struct _GtkShortcutAction GtkShortcutAction
Definition gtktypes.h:58
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109
void(* GDestroyNotify)(gpointer data)
Definition gtypes.h:140
typedefG_BEGIN_DECLS struct _GVariant GVariant
Definition gvariant.h:36
const char * name
Definition lsqlite3.c:2154