From 2ea5aa82155ce47ca9a91f5fa1a97b0610a487a3 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Tue, 2 Aug 2011 11:11:19 +0100 Subject: CameraMonitor: make EmpathyCamera a boxed type --- libempathy/empathy-camera-monitor.c | 9 +++++++++ libempathy/empathy-camera-monitor.h | 3 +++ 2 files changed, 12 insertions(+) (limited to 'libempathy') diff --git a/libempathy/empathy-camera-monitor.c b/libempathy/empathy-camera-monitor.c index 98d021867..694e6ff96 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 19fbafa2e..2f26670dd 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); -- cgit v1.2.3