]> Pileus Git - ~andy/gtk/blob - gtk/gtkapplication.h
GtkApplication: add a way to get the appmenu
[~andy/gtk] / gtk / gtkapplication.h
1 /*
2  * Copyright © 2010 Codethink Limited
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 of the licence, 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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  *
19  * Author: Ryan Lortie <desrt@desrt.ca>
20  */
21
22 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23 #error "Only <gtk/gtk.h> can be included directly."
24 #endif
25
26 #ifndef __GTK_APPLICATION_H__
27 #define __GTK_APPLICATION_H__
28
29 #include <gtk/gtkwidget.h>
30 #include <gtk/gtkmenu.h>
31 #include <gio/gio.h>
32
33 G_BEGIN_DECLS
34
35 #define GTK_TYPE_APPLICATION            (gtk_application_get_type ())
36 #define GTK_APPLICATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_APPLICATION, GtkApplication))
37 #define GTK_APPLICATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_APPLICATION, GtkApplicationClass))
38 #define GTK_IS_APPLICATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_APPLICATION))
39 #define GTK_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_APPLICATION))
40 #define GTK_APPLICATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_APPLICATION, GtkApplicationClass))
41
42 typedef struct _GtkApplication        GtkApplication;
43 typedef struct _GtkApplicationClass   GtkApplicationClass;
44 typedef struct _GtkApplicationPrivate GtkApplicationPrivate;
45
46 struct _GtkApplication
47 {
48   GApplication parent;
49
50   /*< private >*/
51   GtkApplicationPrivate *priv;
52 };
53
54 struct _GtkApplicationClass
55 {
56   GApplicationClass parent_class;
57
58   void (*window_added)   (GtkApplication *application,
59                           GtkWindow      *window);
60   void (*window_removed) (GtkApplication *application,
61                           GtkWindow      *window);
62
63   /*< private >*/
64   gpointer padding[14];
65 };
66
67 GType                   gtk_application_get_type                        (void) G_GNUC_CONST;
68
69 GtkApplication *        gtk_application_new                             (const gchar       *application_id,
70                                                                          GApplicationFlags  flags);
71
72 void                    gtk_application_add_window                      (GtkApplication    *application,
73                                                                          GtkWindow         *window);
74
75 void                    gtk_application_remove_window                   (GtkApplication    *application,
76                                                                          GtkWindow         *window);
77
78 GList *                 gtk_application_get_windows                     (GtkApplication    *application);
79
80 GtkMenu *               gtk_application_get_menu                        (GtkApplication    *application);
81
82 G_END_DECLS
83
84 #endif /* __GTK_APPLICATION_H__ */
85