[empathy] CameraMonitor: make EmpathyCamera a boxed type



commit 2ea5aa82155ce47ca9a91f5fa1a97b0610a487a3
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Tue Aug 2 11:11:19 2011 +0100

    CameraMonitor: make EmpathyCamera a boxed type

 libempathy/empathy-camera-monitor.c |    9 +++++++++
 libempathy/empathy-camera-monitor.h |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-camera-monitor.c b/libempathy/empathy-camera-monitor.c
index 98d0218..694e6ff 100644
--- a/libempathy/empathy-camera-monitor.c
+++ b/libempathy/empathy-camera-monitor.c
@@ -62,6 +62,12 @@ empathy_camera_new (const gchar *id,
   return camera;
 }
 
+static EmpathyCamera *
+empathy_camera_copy (EmpathyCamera *camera)
+{
+  return empathy_camera_new (camera->id, camera->device, camera->name);
+}
+
 static void
 empathy_camera_free (EmpathyCamera *camera)
 {
@@ -72,6 +78,9 @@ empathy_camera_free (EmpathyCamera *camera)
   g_slice_free (EmpathyCamera, camera);
 }
 
+G_DEFINE_BOXED_TYPE (EmpathyCamera, empathy_camera,
+    empathy_camera_copy, empathy_camera_free)
+
 static gint
 empathy_camera_find (gconstpointer a,
     gconstpointer b)
diff --git a/libempathy/empathy-camera-monitor.h b/libempathy/empathy-camera-monitor.h
index 19fbafa..2f26670 100644
--- a/libempathy/empathy-camera-monitor.h
+++ b/libempathy/empathy-camera-monitor.h
@@ -53,6 +53,9 @@ typedef struct
   gchar *name;
 } EmpathyCamera;
 
+#define EMPATHY_TYPE_CAMERA (empathy_camera_get_type ())
+GType empathy_camera_get_type (void) G_GNUC_CONST;
+
 GType empathy_camera_monitor_get_type (void) G_GNUC_CONST;
 
 EmpathyCameraMonitor *empathy_camera_monitor_dup_singleton (void);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]