1 /* 2 * Copyright (C) 2012 Jonathan Matthew <jonathan@d14n.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * The Rhythmbox authors hereby grant permission for non-GPL compatible 10 * GStreamer plugins to be used and distributed together with GStreamer 11 * and Rhythmbox. This permission is above and beyond the permissions granted 12 * by the GPL license by which Rhythmbox is covered. If you modify this code 13 * you may extend this exception to your version of the code, but you are not 14 * obligated to do so. If you do not wish to do so, delete this exception 15 * statement from your version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 * 26 */ 27 28 #include <gtk/gtk.h> 29 30 #ifndef RB_APPLICATION_H 31 #define RB_APPLICATION_H 32 33 #define RB_TYPE_APPLICATION (rb_application_get_type ()) 34 #define RB_APPLICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_APPLICATION, RBApplication)) 35 #define RB_APPLICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_APPLICATION, RBApplicationClass)) 36 #define RB_IS_APPLICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_APPLICATION)) 37 #define RB_IS_APPLICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_APPLICATION)) 38 #define RB_APPLICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_APPLICATION, RBApplicationClass)) 39 40 typedef struct _RBApplication RBApplication; 41 typedef struct _RBApplicationClass RBApplicationClass; 42 typedef struct _RBApplicationPrivate RBApplicationPrivate; 43 44 struct _RBApplication 45 { 46 GtkApplication parent; 47 48 RBApplicationPrivate *priv; 49 }; 50 51 struct _RBApplicationClass 52 { 53 GtkApplicationClass parent_class; 54 }; 55 56 GType rb_application_get_type (void); 57 58 GApplication * rb_application_new (void); 59 60 int rb_application_run (RBApplication *app, int argc, char **argv); 61 62 void rb_application_link_shared_menus (RBApplication *app, GMenu *menu); 63 void rb_application_set_menu_accelerators (RBApplication *app, GMenuModel *menu, gboolean enable); 64 65 void rb_application_add_shared_menu (RBApplication *app, const char *name, GMenuModel *menu); 66 GMenuModel * rb_application_get_shared_menu (RBApplication *app, const char *name); 67 68 GMenuModel * rb_application_get_plugin_menu (RBApplication *app, const char *menu); 69 void rb_application_add_plugin_menu_item (RBApplication *app, const char *menu, const char *id, GMenuItem *item); 70 void rb_application_remove_plugin_menu_item (RBApplication *app, const char *menu, const char *id); 71 72 void rb_application_add_accelerator (RBApplication *app, const char *accel, const char *action, GVariant *parameter); 73 gboolean rb_application_activate_key (RBApplication *app, GdkEventKey *event); 74 75 G_END_DECLS 76 77 #endif /* RB_APPLICATION_H */ 78