9be256afbf8cced3681c957ba3865c70d256517f
[projects/chimara/chimara.git] / player / browser.c
1 #include <glib-object.h>
2 #include <glib/gi18n.h>
3 #include <gtk/gtk.h>
4 #include "browser.h"
5 #include "app.h"
6 #include "util.h"
7
8 typedef struct _ChimaraBrowserPrivate {
9         int dummy;
10 } ChimaraBrowserPrivate;
11
12 #define CHIMARA_BROWSER_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), CHIMARA_TYPE_BROWSER, ChimaraBrowserPrivate))
13 #define CHIMARA_BROWSER_USE_PRIVATE ChimaraBrowserPrivate *priv = CHIMARA_BROWSER_PRIVATE(self)
14
15 G_DEFINE_TYPE(ChimaraBrowser, chimara_browser, GTK_TYPE_WINDOW);
16
17 static void
18 chimara_browser_finalize(GObject *self)
19 {
20         /* Chain up */
21         G_OBJECT_CLASS(chimara_browser_parent_class)->finalize(self);
22 }
23
24 static void
25 chimara_browser_class_init(ChimaraBrowserClass *klass)
26 {
27         /* Override methods of parent classes */
28         GObjectClass *object_class = G_OBJECT_CLASS(klass);
29         //object_class->set_property = chimara_if_set_property;
30         //object_class->get_property = chimara_if_get_property;
31         object_class->finalize = chimara_browser_finalize;
32         
33         /* Signals */
34
35         /* Properties */
36
37         /* Private data */
38         g_type_class_add_private(klass, sizeof(ChimaraBrowserPrivate));
39 }
40
41 static void
42 chimara_browser_init(ChimaraBrowser *self)
43 {
44         ChimaraApp *theapp = chimara_app_get();
45         GError *error = NULL;
46
47         /* Set own properties */
48         g_object_set(self,
49                 "title", _("Chimara"),
50                 NULL);
51
52         GtkUIManager *uimanager = new_ui_manager("browser.menus");
53
54         gtk_ui_manager_insert_action_group(uimanager, chimara_app_get_action_group(theapp), 0);
55         GtkWidget *menubar = gtk_ui_manager_get_widget(uimanager, "/browser_menu");
56         gtk_container_add(GTK_CONTAINER(self), menubar);
57 }
58
59 /* PUBLIC FUNCTIONS */
60 GtkWidget *
61 chimara_browser_new(void)
62 {
63         return GTK_WIDGET(g_object_new(CHIMARA_TYPE_BROWSER,
64                 "type", GTK_WINDOW_TOPLEVEL,
65                 NULL));
66 }
67