]> git.0d.be Git - empathy.git/blob - src/empathy-debug-dialog.c
Added initial empty EmpathyDebugDialog.
[empathy.git] / src / empathy-debug-dialog.c
1 /*
2 *  Copyright (C) 2009 Collabora Ltd.
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.1 of the License, 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 Free Software
16 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 *
18 *  Authors: Jonny Lamb <jonny.lamb@collabora.co.uk>
19 */
20
21 #include "config.h"
22
23 #include <glib/gi18n.h>
24 #include <gtk/gtk.h>
25
26 #include <libempathy/empathy-utils.h>
27
28 #include "empathy-debug-dialog.h"
29
30 G_DEFINE_TYPE (EmpathyDebugDialog, empathy_debug_dialog,
31     GTK_TYPE_DIALOG)
32
33 enum
34 {
35   PROP_0,
36 };
37
38 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyDebugDialog)
39 typedef struct
40 {
41   gboolean dispose_run;
42 } EmpathyDebugDialogPriv;
43
44 static GObject *
45 debug_dialog_constructor (GType type,
46                           guint n_construct_params,
47                           GObjectConstructParam *construct_params)
48 {
49   GObject *object;
50   EmpathyDebugDialogPriv *priv;
51
52   object = G_OBJECT_CLASS (empathy_debug_dialog_parent_class)->constructor
53     (type, n_construct_params, construct_params);
54   priv = GET_PRIV (object);
55
56   return object;
57 }
58
59 static void
60 empathy_debug_dialog_init (EmpathyDebugDialog *empathy_debug_dialog)
61 {
62   EmpathyDebugDialogPriv *priv =
63       G_TYPE_INSTANCE_GET_PRIVATE (empathy_debug_dialog,
64       EMPATHY_TYPE_DEBUG_DIALOG, EmpathyDebugDialogPriv);
65
66   empathy_debug_dialog->priv = priv;
67
68   priv->dispose_run = FALSE;
69 }
70
71 static void
72 debug_dialog_set_property (GObject *object,
73                                guint prop_id,
74                                const GValue *value,
75                                GParamSpec *pspec)
76 {
77   switch (prop_id)
78     {
79       default:
80         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
81         break;
82     }
83 }
84
85 static void
86 debug_dialog_get_property (GObject *object,
87                                guint prop_id,
88                                GValue *value,
89                                GParamSpec *pspec)
90 {
91   switch (prop_id)
92     {
93       default:
94         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
95         break;
96     }
97 }
98
99 static void
100 debug_dialog_dispose (GObject *object)
101 {
102   EmpathyDebugDialog *selector = EMPATHY_DEBUG_DIALOG (object);
103   EmpathyDebugDialogPriv *priv = GET_PRIV (selector);
104
105   if (priv->dispose_run)
106     return;
107
108   priv->dispose_run = TRUE;
109
110   (G_OBJECT_CLASS (empathy_debug_dialog_parent_class)->dispose) (object);
111 }
112
113 static void
114 empathy_debug_dialog_class_init (EmpathyDebugDialogClass *klass)
115 {
116   GObjectClass *object_class = G_OBJECT_CLASS (klass);
117   object_class->constructor = debug_dialog_constructor;
118   object_class->dispose = debug_dialog_dispose;
119   object_class->set_property = debug_dialog_set_property;
120   object_class->get_property = debug_dialog_get_property;
121   g_type_class_add_private (klass, sizeof (EmpathyDebugDialogPriv));
122 }
123
124 /* public methods */
125
126 GtkWidget *
127 empathy_debug_dialog_new (void)
128 {
129   return GTK_WIDGET (g_object_new (EMPATHY_TYPE_DEBUG_DIALOG, NULL));
130 }