]> Pileus Git - ~andy/gtk/blob - gtk/gtkapplication.h
Merge branch 'notebooks-without-mouse-scrolling'
[~andy/gtk] / gtk / gtkapplication.h
1 /* GTK - The GIMP Toolkit
2  *
3  * Copyright (C) 2010 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Colin Walters <walters@verbum.org>
21  */
22
23 /*
24  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
25  * file for a list of people on the GTK+ Team.  See the ChangeLog
26  * files for a list of changes.  These files are distributed with
27  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
28  */
29
30 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
31 #error "Only <gtk/gtk.h> can be included directly."
32 #endif
33
34 #ifndef __GTK_APPLICATION_H__
35 #define __GTK_APPLICATION_H__
36
37 #include <gio/gio.h>
38 #include <gtk/gtkaction.h>
39 #include <gtk/gtkactiongroup.h>
40 #include <gtk/gtkwindow.h>
41
42 G_BEGIN_DECLS
43
44 #define GTK_TYPE_APPLICATION            (gtk_application_get_type ())
45 #define GTK_APPLICATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_APPLICATION, GtkApplication))
46 #define GTK_APPLICATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_APPLICATION, GtkApplicationClass))
47 #define GTK_IS_APPLICATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_APPLICATION))
48 #define GTK_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_APPLICATION))
49 #define GTK_APPLICATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_APPLICATION, GtkApplicationClass))
50
51 typedef struct _GtkApplication        GtkApplication;
52 typedef struct _GtkApplicationClass   GtkApplicationClass;
53 typedef struct _GtkApplicationPrivate GtkApplicationPrivate;
54
55 struct _GtkApplication
56 {
57   GApplication parent;
58
59   /*< private >*/
60
61   GtkApplicationPrivate *priv;
62 };
63
64 struct _GtkApplicationClass
65 {
66   GApplicationClass parent_class;
67
68   /*< vfuncs >*/
69   GtkWindow *(* create_window) (GtkApplication *app);
70   void       (* activated)     (GtkApplication *app,
71                                 GVariant       *args);
72   void       (* action)        (GtkApplication *app,
73                                 const gchar    *action_name);
74   gboolean   (* quit)          (GtkApplication *app);
75                                
76
77   /* Padding for future expansion */
78   void (*_gtk_reserved1) (void);
79   void (*_gtk_reserved2) (void);
80   void (*_gtk_reserved3) (void);
81   void (*_gtk_reserved4) (void);
82   void (*_gtk_reserved5) (void);
83   void (*_gtk_reserved6) (void);
84   void (*_gtk_reserved7) (void);
85   void (*_gtk_reserved8) (void);
86   void (*_gtk_reserved9) (void);
87   void (*_gtk_reserved10) (void);
88 };
89
90 GType                   gtk_application_get_type         (void) G_GNUC_CONST;
91 GtkApplication*         gtk_application_new              (const gchar      *appid,
92                                                           gint             *argc,
93                                                           gchar          ***argv);
94 void                    gtk_application_set_action_group (GtkApplication   *app,
95                                                           GtkActionGroup   *group);
96 GtkWindow *             gtk_application_create_window    (GtkApplication   *app);
97 GtkWindow *             gtk_application_get_window       (GtkApplication   *app);
98 G_CONST_RETURN GSList * gtk_application_get_windows      (GtkApplication   *app);
99 void                    gtk_application_add_window       (GtkApplication   *app,
100                                                           GtkWindow        *window);
101 void                    gtk_application_run              (GtkApplication   *app);
102 void                    gtk_application_quit             (GtkApplication   *app);
103
104 G_END_DECLS
105
106 #endif /* __GTK_APPLICATION_H__ */
107