~indicator-applet-developers/indicator-appmenu/trunk.0.2

« back to all changes in this revision

Viewing changes to src/window-menus.c

  • Committer: Ted Gould
  • Date: 2010-05-02 00:00:18 UTC
  • mfrom: (2.1.26 build-register)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: ted@gould.cx-20100502000018-0jencrzyxx2ym1mq
Start with the register

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_CONFIG_H
 
2
#include "config.h"
 
3
#endif
 
4
 
 
5
#include <libdbusmenu-gtk/client.h>
 
6
 
 
7
#include "window-menus.h"
 
8
 
 
9
typedef struct _WindowMenusPrivate WindowMenusPrivate;
 
10
struct _WindowMenusPrivate {
 
11
        guint windowid;
 
12
        DbusmenuGtkClient * client;
 
13
};
 
14
 
 
15
#define WINDOW_MENUS_GET_PRIVATE(o) \
 
16
(G_TYPE_INSTANCE_GET_PRIVATE ((o), WINDOW_MENUS_TYPE, WindowMenusPrivate))
 
17
 
 
18
static void window_menus_class_init (WindowMenusClass *klass);
 
19
static void window_menus_init       (WindowMenus *self);
 
20
static void window_menus_dispose    (GObject *object);
 
21
static void window_menus_finalize   (GObject *object);
 
22
 
 
23
G_DEFINE_TYPE (WindowMenus, window_menus, G_TYPE_OBJECT);
 
24
 
 
25
/* Build the one-time class */
 
26
static void
 
27
window_menus_class_init (WindowMenusClass *klass)
 
28
{
 
29
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
30
 
 
31
        g_type_class_add_private (klass, sizeof (WindowMenusPrivate));
 
32
 
 
33
        object_class->dispose = window_menus_dispose;
 
34
        object_class->finalize = window_menus_finalize;
 
35
 
 
36
        return;
 
37
}
 
38
 
 
39
/* Initialize the per-instance data */
 
40
static void
 
41
window_menus_init (WindowMenus *self)
 
42
{
 
43
        WindowMenusPrivate * priv = WINDOW_MENUS_GET_PRIVATE(self);
 
44
 
 
45
        priv->client = NULL;
 
46
 
 
47
        return;
 
48
}
 
49
 
 
50
/* Destroy objects */
 
51
static void
 
52
window_menus_dispose (GObject *object)
 
53
{
 
54
        WindowMenusPrivate * priv = WINDOW_MENUS_GET_PRIVATE(object);
 
55
 
 
56
        if (priv->client != NULL) {
 
57
                g_object_unref(G_OBJECT(priv->client));
 
58
                priv->client = NULL;
 
59
        }
 
60
 
 
61
        G_OBJECT_CLASS (window_menus_parent_class)->dispose (object);
 
62
        return;
 
63
}
 
64
 
 
65
/* Free memory */
 
66
static void
 
67
window_menus_finalize (GObject *object)
 
68
{
 
69
 
 
70
        G_OBJECT_CLASS (window_menus_parent_class)->finalize (object);
 
71
        return;
 
72
}
 
73
 
 
74
WindowMenus *
 
75
window_menus_new (const guint windowid, const gchar * dbus_addr, const gchar * dbus_object)
 
76
{
 
77
        g_debug("Creating new windows menu: %X, %s, %s", windowid, dbus_addr, dbus_object);
 
78
 
 
79
        return NULL;
 
80
}
 
81
 
 
82
GList *
 
83
window_menus_get_entries (WindowMenus * wm)
 
84
{
 
85
 
 
86
        return NULL;
 
87
}