]> git.0d.be Git - empathy.git/blob - libempathy/empathy-call-handler.c
2c08a87471eb8288652ee66183b441ec9cb2872b
[empathy.git] / libempathy / empathy-call-handler.c
1 /*
2  * empathy-call-handler.c - Source for EmpathyCallHandler
3  * Copyright (C) 2008 Collabora Ltd.
4  * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20
21
22 #include <stdio.h>
23 #include <stdlib.h>
24
25 #include "empathy-call-handler.h"
26
27 G_DEFINE_TYPE(EmpathyCallHandler, empathy_call_handler, G_TYPE_OBJECT)
28
29 #if 0
30 /* signal enum */
31 enum
32 {
33     LAST_SIGNAL
34 };
35
36 static guint signals[LAST_SIGNAL] = {0};
37 #endif
38
39 /* private structure */
40 typedef struct _EmpathyCallHandlerPrivate EmpathyCallHandlerPrivate;
41
42 struct _EmpathyCallHandlerPrivate
43 {
44   gboolean dispose_has_run;
45 };
46
47 #define EMPATHY_CALL_HANDLER_GET_PRIVATE(o) \
48   (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMPATHY_TYPE_CALL_HANDLER,\
49     EmpathyCallHandlerPrivate))
50
51 static void
52 empathy_call_handler_init (EmpathyCallHandler *obj)
53 {
54   //EmpathyCallHandlerPrivate *priv = EMPATHY_CALL_HANDLER_GET_PRIVATE (obj);
55
56   /* allocate any data required by the object here */
57 }
58
59 static void empathy_call_handler_dispose (GObject *object);
60 static void empathy_call_handler_finalize (GObject *object);
61
62 static void
63 empathy_call_handler_class_init (
64   EmpathyCallHandlerClass *empathy_call_handler_class)
65 {
66   GObjectClass *object_class = G_OBJECT_CLASS (empathy_call_handler_class);
67
68   g_type_class_add_private (empathy_call_handler_class,
69     sizeof (EmpathyCallHandlerPrivate));
70
71   object_class->dispose = empathy_call_handler_dispose;
72   object_class->finalize = empathy_call_handler_finalize;
73
74 }
75
76 void
77 empathy_call_handler_dispose (GObject *object)
78 {
79   EmpathyCallHandler *self = EMPATHY_CALL_HANDLER (object);
80   EmpathyCallHandlerPrivate *priv = EMPATHY_CALL_HANDLER_GET_PRIVATE (self);
81
82   if (priv->dispose_has_run)
83     return;
84
85   priv->dispose_has_run = TRUE;
86
87   /* release any references held by the object here */
88
89   if (G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose)
90     G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose (object);
91 }
92
93 void
94 empathy_call_handler_finalize (GObject *object)
95 {
96   //EmpathyCallHandler *self = EMPATHY_CALL_HANDLER (object);
97   //EmpathyCallHandlerPrivate *priv = EMPATHY_CALL_HANDLER_GET_PRIVATE (self);
98
99   /* free any data held directly by the object here */
100
101   G_OBJECT_CLASS (empathy_call_handler_parent_class)->finalize (object);
102 }
103
104
105 EmpathyCallHandler *
106 empathy_call_handler_new_for_contact (EmpathyContact *contact)
107 {
108   return EMPATHY_CALL_HANDLER (g_object_new (EMPATHY_TYPE_CALL_HANDLER, NULL));
109 }
110
111 EmpathyCallHandler *
112 empathy_call_handler_new_for_channel (EmpathyTpCall *call)
113 {
114   return EMPATHY_CALL_HANDLER (g_object_new (EMPATHY_TYPE_CALL_HANDLER, NULL));
115 }