Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gapplication.h
Go to the documentation of this file.
1/*
2 * Copyright © 2010 Codethink Limited
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authors: Ryan Lortie <desrt@desrt.ca>
20 */
21
22#ifndef __G_APPLICATION_H__
23#define __G_APPLICATION_H__
24
25#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
26#error "Only <gio/gio.h> can be included directly."
27#endif
28
29#include <gio/giotypes.h>
30
32
33#define G_TYPE_APPLICATION (g_application_get_type ())
34#define G_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
35 G_TYPE_APPLICATION, GApplication))
36#define G_APPLICATION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
37 G_TYPE_APPLICATION, GApplicationClass))
38#define G_IS_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_APPLICATION))
39#define G_IS_APPLICATION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_APPLICATION))
40#define G_APPLICATION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
41 G_TYPE_APPLICATION, GApplicationClass))
42
43typedef struct _GApplicationPrivate GApplicationPrivate;
45
47{
48 /*< private >*/
50
52};
53
55{
56 /*< private >*/
58
59 /*< public >*/
60 /* signals */
61 void (* startup) (GApplication *application);
62
63 void (* activate) (GApplication *application);
64
65 void (* open) (GApplication *application,
66 GFile **files,
67 gint n_files,
68 const gchar *hint);
69
70 int (* command_line) (GApplication *application,
72
73 /* vfuncs */
74
75 /**
76 * GApplicationClass::local_command_line:
77 * @application: a #GApplication
78 * @arguments: (inout) (array zero-terminated=1): array of command line arguments
79 * @exit_status: (out): exit status to fill after processing the command line.
80 *
81 * This virtual function is always invoked in the local instance. It
82 * gets passed a pointer to a %NULL-terminated copy of @argv and is
83 * expected to remove arguments that it handled (shifting up remaining
84 * arguments).
85 *
86 * The last argument to local_command_line() is a pointer to the @status
87 * variable which can used to set the exit status that is returned from
88 * g_application_run().
89 *
90 * See g_application_run() for more details on #GApplication startup.
91 *
92 * Returns: %TRUE if the commandline has been completely handled
93 */
95 gchar ***arguments,
96 int *exit_status);
97
98 /* @platform_data comes from an external process and is untrusted. All value types
99 * must be validated before being used. */
100 void (* before_emit) (GApplication *application,
101 GVariant *platform_data);
102 /* Same as for @before_emit. */
103 void (* after_emit) (GApplication *application,
104 GVariant *platform_data);
105 void (* add_platform_data) (GApplication *application,
106 GVariantBuilder *builder);
107 void (* quit_mainloop) (GApplication *application);
108 void (* run_mainloop) (GApplication *application);
109 void (* shutdown) (GApplication *application);
110
112 GDBusConnection *connection,
113 const gchar *object_path,
114 GError **error);
115 void (* dbus_unregister) (GApplication *application,
116 GDBusConnection *connection,
117 const gchar *object_path);
119 GVariantDict *options);
120 gboolean (* name_lost) (GApplication *application);
121
122 /*< private >*/
124};
125
128
131
133GApplication * g_application_new (const gchar *application_id,
134 GApplicationFlags flags);
135
140 const gchar *application_id);
141
146 const gchar *version);
147
152
157 guint inactivity_timeout);
158
163 GApplicationFlags flags);
164
169 const gchar *resource_path);
170
173 GActionGroup *action_group);
174
177 const GOptionEntry *entries);
178
181 const char *long_name,
182 char short_name,
183 GOptionFlags flags,
185 const char *description,
186 const char *arg_description);
189 GOptionGroup *group);
192 const gchar *parameter_string);
195 const gchar *summary);
198 const gchar *description);
203
206 GCancellable *cancellable,
207 GError **error);
208
213
216
219 GFile **files,
220 gint n_files,
221 const gchar *hint);
222
225 int argc,
226 char **argv);
227
230
235
242
245 const gchar *id,
246 GNotification *notification);
249 const gchar *id);
250
253 gpointer object,
254 const gchar *property);
255
258 gpointer object,
259 const gchar *property);
260
262
263#endif /* __G_APPLICATION_H__ */
CURL_EXTERN int void * arg
Definition curl.h:2622
GIO_AVAILABLE_IN_2_56 void g_application_set_option_context_parameter_string(GApplication *application, const gchar *parameter_string)
GIO_AVAILABLE_IN_2_80 void g_application_set_version(GApplication *application, const gchar *version)
GIO_AVAILABLE_IN_2_34 GDBusConnection * g_application_get_dbus_connection(GApplication *application)
GIO_AVAILABLE_IN_ALL void g_application_set_application_id(GApplication *application, const gchar *application_id)
GIO_AVAILABLE_IN_ALL void g_application_set_inactivity_timeout(GApplication *application, guint inactivity_timeout)
GIO_AVAILABLE_IN_ALL GApplication * g_application_new(const gchar *application_id, GApplicationFlags flags)
GIO_AVAILABLE_IN_ALL void g_application_activate(GApplication *application)
GIO_AVAILABLE_IN_ALL gboolean g_application_id_is_valid(const gchar *application_id)
GIO_AVAILABLE_IN_2_42 void g_application_set_resource_base_path(GApplication *application, const gchar *resource_path)
GIO_AVAILABLE_IN_2_42 const gchar * g_application_get_resource_base_path(GApplication *application)
GIO_AVAILABLE_IN_ALL GApplicationFlags g_application_get_flags(GApplication *application)
GIO_AVAILABLE_IN_ALL guint g_application_get_inactivity_timeout(GApplication *application)
GIO_AVAILABLE_IN_ALL gboolean g_application_register(GApplication *application, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_ALL gboolean g_application_get_is_remote(GApplication *application)
GIO_AVAILABLE_IN_2_32 GApplication * g_application_get_default(void)
GIO_AVAILABLE_IN_2_40 void g_application_send_notification(GApplication *application, const gchar *id, GNotification *notification)
GIO_AVAILABLE_IN_ALL const gchar * g_application_get_application_id(GApplication *application)
GIO_AVAILABLE_IN_ALL void g_application_open(GApplication *application, GFile **files, gint n_files, const gchar *hint)
GIO_AVAILABLE_IN_2_56 void g_application_set_option_context_description(GApplication *application, const gchar *description)
GIO_AVAILABLE_IN_2_56 void g_application_set_option_context_summary(GApplication *application, const gchar *summary)
GIO_AVAILABLE_IN_ALL void g_application_set_flags(GApplication *application, GApplicationFlags flags)
struct _GApplicationPrivate GApplicationPrivate
GIO_AVAILABLE_IN_2_40 void g_application_add_option_group(GApplication *application, GOptionGroup *group)
GIO_AVAILABLE_IN_ALL void g_application_release(GApplication *application)
GIO_AVAILABLE_IN_ALL gboolean g_application_get_is_registered(GApplication *application)
GIO_AVAILABLE_IN_ALL GType g_application_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL void g_application_hold(GApplication *application)
GIO_AVAILABLE_IN_2_32 void g_application_quit(GApplication *application)
GIO_AVAILABLE_IN_ALL int g_application_run(GApplication *application, int argc, char **argv)
GIO_AVAILABLE_IN_2_44 void g_application_unbind_busy_property(GApplication *application, gpointer object, const gchar *property)
GIO_AVAILABLE_IN_2_38 void g_application_mark_busy(GApplication *application)
GIO_AVAILABLE_IN_2_44 gboolean g_application_get_is_busy(GApplication *application)
GIO_AVAILABLE_IN_2_34 const gchar * g_application_get_dbus_object_path(GApplication *application)
GIO_AVAILABLE_IN_2_40 void g_application_add_main_option_entries(GApplication *application, const GOptionEntry *entries)
GIO_AVAILABLE_IN_2_32 void g_application_set_default(GApplication *application)
GIO_AVAILABLE_IN_2_80 const gchar * g_application_get_version(GApplication *application)
GIO_AVAILABLE_IN_2_42 void g_application_add_main_option(GApplication *application, const char *long_name, char short_name, GOptionFlags flags, GOptionArg arg, const char *description, const char *arg_description)
GIO_AVAILABLE_IN_2_40 void g_application_withdraw_notification(GApplication *application, const gchar *id)
GIO_AVAILABLE_IN_2_38 void g_application_unmark_busy(GApplication *application)
GIO_DEPRECATED void g_application_set_action_group(GApplication *application, GActionGroup *action_group)
GIO_AVAILABLE_IN_2_44 void g_application_bind_busy_property(GApplication *application, gpointer object, const gchar *property)
#define GIO_AVAILABLE_IN_ALL
#define GIO_DEPRECATED
#define GIO_AVAILABLE_IN_2_32
#define GIO_AVAILABLE_IN_2_40
#define GIO_AVAILABLE_IN_2_44
#define GIO_AVAILABLE_IN_2_80
#define GIO_AVAILABLE_IN_2_34
#define GIO_AVAILABLE_IN_2_38
#define GIO_AVAILABLE_IN_2_56
#define GIO_AVAILABLE_IN_2_42
GApplicationFlags
Definition gioenums.h:1544
struct _GFile GFile
Definition giotypes.h:74
struct _GDBusConnection GDBusConnection
Definition giotypes.h:468
struct _GNotification GNotification
Definition giotypes.h:66
struct _GActionGroup GActionGroup
Definition giotypes.h:55
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
GOptionFlags
Definition goption.h:85
GOptionArg
Definition goption.h:123
struct _GOptionGroup GOptionGroup
Definition goption.h:53
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
int gint
Definition gtypes.h:55
unsigned int guint
Definition gtypes.h:61
typedefG_BEGIN_DECLS struct _GVariant GVariant
Definition gvariant.h:36
static void error(LoadState *S, const char *why)
gboolean(* name_lost)(GApplication *application)
void(* quit_mainloop)(GApplication *application)
GObjectClass parent_class
void(* after_emit)(GApplication *application, GVariant *platform_data)
gpointer padding[7]
void(* shutdown)(GApplication *application)
void(* run_mainloop)(GApplication *application)
void(* add_platform_data)(GApplication *application, GVariantBuilder *builder)
void(* before_emit)(GApplication *application, GVariant *platform_data)
void(* startup)(GApplication *application)
void(* open)(GApplication *application, GFile **files, gint n_files, const gchar *hint)
void(* dbus_unregister)(GApplication *application, GDBusConnection *connection, const gchar *object_path)
gboolean(* local_command_line)(GApplication *application, gchar ***arguments, int *exit_status)
gint(* handle_local_options)(GApplication *application, GVariantDict *options)
int(* command_line)(GApplication *application, GApplicationCommandLine *command_line)
gboolean(* dbus_register)(GApplication *application, GDBusConnection *connection, const gchar *object_path, GError **error)
void(* activate)(GApplication *application)
GApplicationPrivate * priv
GObject parent_instance