Blame gio/gapplication.h

Packit ae235b
/*
Packit ae235b
 * Copyright © 2010 Codethink Limited
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General
Packit ae235b
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 *
Packit ae235b
 * Authors: Ryan Lortie <desrt@desrt.ca>
Packit ae235b
 */
Packit ae235b
Packit ae235b
#ifndef __G_APPLICATION_H__
Packit ae235b
#define __G_APPLICATION_H__
Packit ae235b
Packit ae235b
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
Packit ae235b
#error "Only <gio/gio.h> can be included directly."
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#include <gio/giotypes.h>
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
#define G_TYPE_APPLICATION                                  (g_application_get_type ())
Packit ae235b
#define G_APPLICATION(inst)                                 (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
Packit ae235b
                                                             G_TYPE_APPLICATION, GApplication))
Packit ae235b
#define G_APPLICATION_CLASS(class)                          (G_TYPE_CHECK_CLASS_CAST ((class),                       \
Packit ae235b
                                                             G_TYPE_APPLICATION, GApplicationClass))
Packit ae235b
#define G_IS_APPLICATION(inst)                              (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_APPLICATION))
Packit ae235b
#define G_IS_APPLICATION_CLASS(class)                       (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_APPLICATION))
Packit ae235b
#define G_APPLICATION_GET_CLASS(inst)                       (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
Packit ae235b
                                                             G_TYPE_APPLICATION, GApplicationClass))
Packit ae235b
Packit ae235b
typedef struct _GApplicationPrivate                         GApplicationPrivate;
Packit ae235b
typedef struct _GApplicationClass                           GApplicationClass;
Packit ae235b
Packit ae235b
struct _GApplication
Packit ae235b
{
Packit ae235b
  /*< private >*/
Packit ae235b
  GObject parent_instance;
Packit ae235b
Packit ae235b
  GApplicationPrivate *priv;
Packit ae235b
};
Packit ae235b
Packit ae235b
struct _GApplicationClass
Packit ae235b
{
Packit ae235b
  /*< private >*/
Packit ae235b
  GObjectClass parent_class;
Packit ae235b
Packit ae235b
  /*< public >*/
Packit ae235b
  /* signals */
Packit ae235b
  void                      (* startup)             (GApplication              *application);
Packit ae235b
Packit ae235b
  void                      (* activate)            (GApplication              *application);
Packit ae235b
Packit ae235b
  void                      (* open)                (GApplication              *application,
Packit ae235b
                                                     GFile                    **files,
Packit ae235b
                                                     gint                       n_files,
Packit ae235b
                                                     const gchar               *hint);
Packit ae235b
Packit ae235b
  int                       (* command_line)        (GApplication              *application,
Packit ae235b
                                                     GApplicationCommandLine   *command_line);
Packit ae235b
Packit ae235b
  /* vfuncs */
Packit ae235b
Packit ae235b
  /**
Packit ae235b
   * GApplicationClass::local_command_line:
Packit ae235b
   * @application: a #GApplication
Packit ae235b
   * @arguments: (inout) (array zero-terminated=1): array of command line arguments
Packit ae235b
   * @exit_status: (out): exit status to fill after processing the command line.
Packit ae235b
   *
Packit ae235b
   * This virtual function is always invoked in the local instance. It
Packit ae235b
   * gets passed a pointer to a %NULL-terminated copy of @argv and is
Packit ae235b
   * expected to remove arguments that it handled (shifting up remaining
Packit ae235b
   * arguments).
Packit ae235b
   *
Packit ae235b
   * The last argument to local_command_line() is a pointer to the @status
Packit ae235b
   * variable which can used to set the exit status that is returned from
Packit ae235b
   * g_application_run().
Packit ae235b
   *
Packit ae235b
   * See g_application_run() for more details on #GApplication startup.
Packit ae235b
   *
Packit ae235b
   * Returns: %TRUE if the commandline has been completely handled
Packit ae235b
   */
Packit ae235b
  gboolean                  (* local_command_line)  (GApplication              *application,
Packit ae235b
                                                     gchar                   ***arguments,
Packit ae235b
                                                     int                       *exit_status);
Packit ae235b
Packit ae235b
  void                      (* before_emit)         (GApplication              *application,
Packit ae235b
                                                     GVariant                  *platform_data);
Packit ae235b
  void                      (* after_emit)          (GApplication              *application,
Packit ae235b
                                                     GVariant                  *platform_data);
Packit ae235b
  void                      (* add_platform_data)   (GApplication              *application,
Packit ae235b
                                                     GVariantBuilder           *builder);
Packit ae235b
  void                      (* quit_mainloop)       (GApplication              *application);
Packit ae235b
  void                      (* run_mainloop)        (GApplication              *application);
Packit ae235b
  void                      (* shutdown)            (GApplication              *application);
Packit ae235b
Packit ae235b
  gboolean                  (* dbus_register)       (GApplication              *application,
Packit ae235b
                                                     GDBusConnection           *connection,
Packit ae235b
                                                     const gchar               *object_path,
Packit ae235b
                                                     GError                   **error);
Packit ae235b
  void                      (* dbus_unregister)     (GApplication              *application,
Packit ae235b
                                                     GDBusConnection           *connection,
Packit ae235b
                                                     const gchar               *object_path);
Packit ae235b
  gint                      (* handle_local_options)(GApplication              *application,
Packit ae235b
                                                     GVariantDict              *options);
Packit ae235b
Packit ae235b
  /*< private >*/
Packit ae235b
  gpointer padding[8];
Packit ae235b
};
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GType                   g_application_get_type                          (void) G_GNUC_CONST;
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean                g_application_id_is_valid                       (const gchar              *application_id);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GApplication *          g_application_new                               (const gchar              *application_id,
Packit ae235b
                                                                         GApplicationFlags         flags);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
const gchar *           g_application_get_application_id                (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_set_application_id                (GApplication             *application,
Packit ae235b
                                                                         const gchar              *application_id);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_34
Packit ae235b
GDBusConnection *       g_application_get_dbus_connection               (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_2_34
Packit ae235b
const gchar *           g_application_get_dbus_object_path              (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint                   g_application_get_inactivity_timeout            (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_set_inactivity_timeout            (GApplication             *application,
Packit ae235b
                                                                         guint                     inactivity_timeout);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GApplicationFlags       g_application_get_flags                         (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_set_flags                         (GApplication             *application,
Packit ae235b
                                                                         GApplicationFlags         flags);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_42
Packit ae235b
const gchar *           g_application_get_resource_base_path            (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_2_42
Packit ae235b
void                    g_application_set_resource_base_path            (GApplication             *application,
Packit ae235b
                                                                         const gchar              *resource_path);
Packit ae235b
Packit ae235b
GLIB_DEPRECATED
Packit ae235b
void                    g_application_set_action_group                  (GApplication             *application,
Packit ae235b
                                                                         GActionGroup             *action_group);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_40
Packit ae235b
void                    g_application_add_main_option_entries           (GApplication             *application,
Packit ae235b
                                                                         const GOptionEntry       *entries);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_42
Packit ae235b
void                    g_application_add_main_option                   (GApplication             *application,
Packit ae235b
                                                                         const char               *long_name,
Packit ae235b
                                                                         char                      short_name,
Packit ae235b
                                                                         GOptionFlags              flags,
Packit ae235b
                                                                         GOptionArg                arg,
Packit ae235b
                                                                         const char               *description,
Packit ae235b
                                                                         const char               *arg_description);
Packit ae235b
GLIB_AVAILABLE_IN_2_40
Packit ae235b
void                    g_application_add_option_group                  (GApplication             *application,
Packit ae235b
                                                                         GOptionGroup             *group);
Packit ae235b
GLIB_AVAILABLE_IN_2_56
Packit ae235b
void                    g_application_set_option_context_parameter_string (GApplication             *application,
Packit ae235b
                                                                           const gchar              *parameter_string);
Packit ae235b
GLIB_AVAILABLE_IN_2_56
Packit ae235b
void                    g_application_set_option_context_summary        (GApplication             *application,
Packit ae235b
                                                                         const gchar              *summary);
Packit ae235b
GLIB_AVAILABLE_IN_2_56
Packit ae235b
void                    g_application_set_option_context_description    (GApplication             *application,
Packit ae235b
                                                                         const gchar              *description);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean                g_application_get_is_registered                 (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean                g_application_get_is_remote                     (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean                g_application_register                          (GApplication             *application,
Packit ae235b
                                                                         GCancellable             *cancellable,
Packit ae235b
                                                                         GError                  **error);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_hold                              (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_release                           (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_activate                          (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void                    g_application_open                              (GApplication             *application,
Packit ae235b
                                                                         GFile                   **files,
Packit ae235b
                                                                         gint                      n_files,
Packit ae235b
                                                                         const gchar              *hint);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
int                     g_application_run                               (GApplication             *application,
Packit ae235b
                                                                         int                       argc,
Packit ae235b
                                                                         char                    **argv);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_32
Packit ae235b
void                    g_application_quit                              (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_32
Packit ae235b
GApplication *          g_application_get_default                       (void);
Packit ae235b
GLIB_AVAILABLE_IN_2_32
Packit ae235b
void                    g_application_set_default                       (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_38
Packit ae235b
void                    g_application_mark_busy                         (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_2_38
Packit ae235b
void                    g_application_unmark_busy                       (GApplication             *application);
Packit ae235b
GLIB_AVAILABLE_IN_2_44
Packit ae235b
gboolean                g_application_get_is_busy                       (GApplication             *application);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_40
Packit ae235b
void                    g_application_send_notification                 (GApplication             *application,
Packit ae235b
                                                                         const gchar              *id,
Packit ae235b
                                                                         GNotification            *notification);
Packit ae235b
GLIB_AVAILABLE_IN_2_40
Packit ae235b
void                    g_application_withdraw_notification             (GApplication             *application,
Packit ae235b
                                                                         const gchar              *id);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_44
Packit ae235b
void                    g_application_bind_busy_property                (GApplication             *application,
Packit ae235b
                                                                         gpointer                  object,
Packit ae235b
                                                                         const gchar              *property);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_44
Packit ae235b
void                    g_application_unbind_busy_property              (GApplication             *application,
Packit ae235b
                                                                         gpointer                  object,
Packit ae235b
                                                                         const gchar              *property);
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_APPLICATION_H__ */