4 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
5 * @author Renato Filho <renato.filho@indt.org.br>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include <gmyth/gmyth.h>
30 #include <dbus/dbus-glib-bindings.h>
33 #include "gmyth-dbus-common.h"
34 #include "gmyth-dbus-server.h"
36 #define MYTH_DEFAULT_DB "mythconverg"
38 typedef struct _GMythDbusServerPrivate GMythDbusServerPrivate;
40 struct _GMythDbusServerPrivate
42 GMythBackendInfo *myth_backend;
44 GMythScheduler *myth_scheduler;
47 #define GMYTH_DBUS_SERVER_GET_PRIVATE(o) \
48 (G_TYPE_INSTANCE_GET_PRIVATE ((o), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerPrivate))
50 static void gmyth_dbus_server_class_init (GMythDbusServerClass *klass);
51 static void gmyth_dbus_server_init (GMythDbusServer *self);
52 static void gmyth_dbus_server_dispose (GObject *object);
53 static void gmyth_dbus_server_finalize (GObject *object);
56 static gboolean gmyth_dbus_server_connect (GObject *obj,
60 const gchar *password,
63 static gboolean gmyth_dbus_server_get_channel_list (GObject *obj,
66 static gboolean gmyth_dbus_server_get_channel_info (GObject *obj,
70 static gboolean gmyth_dbus_server_file_exists (GObject *obj,
71 const gchar *file_name,
74 static gboolean gmyth_dbus_server_get_recorded_list (GObject *obj,
77 static gboolean gmyth_dbus_server_get_recorded_info (GObject *obj,
78 const gchar *basename,
81 static gboolean gmyth_dbus_server_get_program_list (GObject *obj,
83 const gchar *start_time,
84 const gchar *end_time,
85 GPtrArray **program_list);
86 static gboolean gmyth_dbus_server_get_schedule_list (GObject *obj,
87 GPtrArray **schedule_list);
89 static gboolean gmyth_dbus_server_connected (GObject *obj,
92 static gboolean gmyth_dbus_server_disconnect (GObject *obj,
94 static gboolean gmyth_dbus_server_get_server_info (GObject *obj,
99 static gboolean gmyth_dbus_server_get_thumbnail (GObject *obj,
103 static gboolean gmyth_dbus_server_get_channel_icon (GObject *obj,
107 static gboolean gmyth_dbus_server_stop_recording (GObject *obj,
111 static gboolean gmyth_dbus_server_add_schedule (GObject *obj,
114 const gchar *start_time,
115 const gchar *end_time,
117 const gchar *description,
120 static gboolean gmyth_dbus_server_add_exception (GObject *obj,
124 const gchar *start_time,
125 const gchar *end_time,
126 const gchar *description,
128 static gboolean gmyth_dbus_server_remove_schedule (GObject *obj,
133 #include "gmyth-dbus-server-glue.h"
136 G_DEFINE_TYPE (GMythDbusServer, gmyth_dbus_server, G_TYPE_OBJECT);
139 gmyth_dbus_server_class_init (GMythDbusServerClass *klass)
141 GObjectClass *object_class = G_OBJECT_CLASS (klass);
143 g_type_class_add_private (klass, sizeof (GMythDbusServerPrivate));
145 object_class->dispose = gmyth_dbus_server_dispose;
146 object_class->finalize = gmyth_dbus_server_finalize;
148 dbus_g_object_type_install_info (GMYTH_DBUS_SERVER_TYPE,
149 &dbus_glib_gmyth_dbus_server_object_info);
153 gmyth_dbus_server_init (GMythDbusServer *self)
158 gmyth_dbus_server_dispose (GObject *object)
160 G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->dispose (object);
164 gmyth_dbus_server_finalize (GObject *object)
166 G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->finalize (object);
170 gmyth_dbus_server_connect_epg (GMythDbusServer *server)
172 GMythDbusServerPrivate *priv;
173 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
177 priv->myth_epg = gmyth_epg_new();
178 if (!gmyth_epg_connect (priv->myth_epg, priv->myth_backend))
180 g_object_unref (priv->myth_epg);
181 priv->myth_epg = NULL;
190 gmyth_dbus_server_connect_scheduler (GMythDbusServer *server)
192 GMythDbusServerPrivate *priv;
193 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
195 if (!priv->myth_scheduler)
197 priv->myth_scheduler = gmyth_scheduler_new ();
198 if (!gmyth_scheduler_connect (priv->myth_scheduler,
201 g_object_unref (priv->myth_scheduler);
202 priv->myth_scheduler = NULL;
211 gmyth_dbus_server_connect (GObject *obj,
215 const gchar *password,
219 GMythDbusServerPrivate *priv;
221 g_debug ("%s:%d", __FUNCTION__, __LINE__);
223 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
225 if (priv->myth_backend)
228 priv->myth_backend = gmyth_backend_info_new_full (host,
238 gmyth_dbus_server_connected (GObject *obj,
242 GMythDbusServerPrivate *priv;
244 g_debug ("%s:%d", __FUNCTION__, __LINE__);
246 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
248 if (priv->myth_backend)
256 gmyth_dbus_server_disconnect (GObject *obj,
259 GMythDbusServerPrivate *priv;
261 g_debug ("%s:%d", __FUNCTION__, __LINE__);
263 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
267 g_object_unref (priv->myth_epg);
268 priv->myth_epg = NULL;
272 if (priv->myth_backend)
274 g_object_unref (priv->myth_backend);
275 priv->myth_backend = NULL;
278 if (priv->myth_scheduler)
280 g_object_unref (priv->myth_scheduler);
281 priv->myth_scheduler = NULL;
289 gmyth_dbus_server_get_server_info (GObject *obj,
290 guint64 *total_space,
295 GMythBackendDetails *details;
296 GMythDbusServerPrivate *priv;
297 gboolean ret = FALSE;
300 g_debug ("%s:%d", __FUNCTION__, __LINE__);
301 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
303 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
305 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
308 gmyth_util_get_backend_details (socket,
312 *total_space = details->total_space;
313 *used_space = details->used_space;
314 *free_space = *total_space - *used_space;
315 gmyth_util_backend_details_free (details);
320 g_object_unref (socket);
327 gmyth_dbus_server_parse_channel_info (GMythChannelInfo *info,
330 dbus_g_type_struct_set (val,
332 1, info->channel_num->str,
333 2, info->channel_name->str,
334 3, info->channel_icon->str,
339 gmyth_dbus_server_get_channel_info (GObject *obj,
345 GMythChannelInfo *ch_info;
346 GMythDbusServerPrivate *priv;
348 g_debug ("%s:%d", __FUNCTION__, __LINE__);
349 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
351 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
353 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
356 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
358 ch_info = gmyth_epg_get_channel_info (priv->myth_epg, channel_id);
362 g_value_init (&v, ch_type);
363 g_value_take_boxed (&v, dbus_g_type_specialized_construct (ch_type));
364 gmyth_dbus_server_parse_channel_info (ch_info, &v);
366 *info = g_value_get_boxed (&v);
375 gmyth_dbus_server_get_channel_list (GObject *obj,
376 GPtrArray **channels,
383 GMythDbusServerPrivate *priv;
385 g_debug ("%s:%d", __FUNCTION__, __LINE__);
386 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
388 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
389 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
394 len = gmyth_epg_get_channel_list (priv->myth_epg, &lst);
396 *channels = g_ptr_array_sized_new (len);
397 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
399 for (walk = lst; walk != NULL; walk = walk->next)
402 GMythChannelInfo *data;
404 data = (GMythChannelInfo *) walk->data;
406 g_value_init (&ch, ch_type);
407 g_value_take_boxed (&ch, dbus_g_type_specialized_construct (ch_type));
408 gmyth_dbus_server_parse_channel_info (data, &ch);
409 g_ptr_array_add (*channels, g_value_get_boxed (&ch));
412 gmyth_free_channel_list (lst);
417 gmyth_dbus_server_file_exists (GObject *obj,
418 const gchar *file_name,
422 GMythDbusServerPrivate *priv;
423 g_debug ("%s:%d", __FUNCTION__, __LINE__);
424 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
426 g_return_val_if_fail (priv->myth_backend, FALSE);
428 *exists = gmyth_util_file_exists (priv->myth_backend, file_name);
434 gmyth_dbus_server_get_program_list (GObject *obj,
436 const gchar *start_time,
437 const gchar *end_time,
438 GPtrArray **programs)
444 GTimeVal start_time_val;
445 GTimeVal end_time_val;
446 GMythDbusServerPrivate *priv;
448 g_debug ("%s:%d", __FUNCTION__, __LINE__);
449 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
451 g_return_val_if_fail (priv->myth_backend, FALSE);
452 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
455 g_time_val_from_iso8601 (start_time, &start_time_val);
456 g_time_val_from_iso8601 (end_time, &end_time_val);
459 len = gmyth_epg_get_program_list (priv->myth_epg,
465 *programs = g_ptr_array_sized_new (len);
466 program_type = GMYTH_DBUS_PROGRAM_G_TYPE;
468 for (walk = list; walk != NULL; walk = walk->next)
470 GValue program = { 0, };
473 GMythProgramInfo *data;
475 data = (GMythProgramInfo *) walk->data;
480 g_value_init (&program, program_type);
481 g_value_take_boxed (&program,
482 dbus_g_type_specialized_construct (program_type));
484 start_str = g_time_val_to_iso8601 (data->startts);
485 end_str = g_time_val_to_iso8601 (data->endts);
487 dbus_g_type_struct_set (&program,
488 0, data->chanid->str,
492 4, data->subtitle->str,
493 5, data->description->str,
494 6, data->category->str,
497 g_ptr_array_add (*programs, g_value_get_boxed (&program));
503 gmyth_free_program_list (list);
505 g_debug ("%s:%d", __FUNCTION__, __LINE__);
510 gmyth_dbus_server_parse_recorded_info (RecordedInfo *info,
516 start_str = g_time_val_to_iso8601 (info->start_time);
517 end_str = g_time_val_to_iso8601 (info->end_time);
519 dbus_g_type_struct_set (val,
526 6, info->subtitle->str,
527 7, info->description->str,
528 8, info->category->str,
529 9, info->basename->str,
537 gmyth_dbus_server_get_recorded_info (GObject *obj,
538 const gchar *basename,
543 GMythDbusServerPrivate *priv;
544 RecordedInfo *record_info;
547 g_debug ("%s:%d", __FUNCTION__, __LINE__);
548 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
550 g_return_val_if_fail (priv->myth_backend, FALSE);
552 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
555 record_type = GMYTH_DBUS_RECORD_G_TYPE;
557 record_info = gmyth_scheduler_get_recorded_info (priv->myth_scheduler,
564 g_value_init (&r, record_type);
565 g_value_take_boxed (&r,
566 dbus_g_type_specialized_construct (record_type));
568 gmyth_dbus_server_parse_recorded_info (record_info, &r);
569 gmyth_recorded_info_free (record_info);
571 *info = g_value_get_boxed (&r);
581 gmyth_dbus_server_get_recorded_list (GObject *obj,
589 GMythDbusServerPrivate *priv;
591 g_debug ("%s:%d", __FUNCTION__, __LINE__);
592 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
594 g_return_val_if_fail (priv->myth_backend, FALSE);
595 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
599 len = gmyth_scheduler_get_recorded_list (priv->myth_scheduler,
602 record_type = GMYTH_DBUS_RECORD_G_TYPE;
603 *records = g_ptr_array_sized_new (len);
605 for (walk = list; walk != NULL; walk = walk->next)
607 GValue record = { 0, };
610 data = (RecordedInfo *) walk->data;
612 g_value_init (&record, record_type);
613 g_value_take_boxed (&record,
614 dbus_g_type_specialized_construct (record_type));
616 gmyth_dbus_server_parse_recorded_info (data, &record);
618 g_ptr_array_add (*records, g_value_get_boxed (&record));
619 //g_value_unset (&record);
622 gmyth_recorded_info_list_free (list);
629 gmyth_dbus_server_get_schedule_list (GObject *obj,
630 GPtrArray **schedules)
636 GMythDbusServerPrivate *priv;
638 g_debug ("%s:%d", __FUNCTION__, __LINE__);
639 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
641 g_return_val_if_fail (priv->myth_backend, FALSE);
642 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
646 len = gmyth_scheduler_get_schedule_list (priv->myth_scheduler,
649 *schedules = g_ptr_array_sized_new (len);
650 schedule_type = GMYTH_DBUS_SCHEDULE_G_TYPE;
652 for (walk = list; walk != NULL; walk = walk->next)
654 GValue schedule = { 0, };
656 gchar *start_str_time;
659 data = (ScheduleInfo *) walk->data;
661 g_value_init (&schedule, schedule_type);
662 g_value_take_boxed (&schedule,
663 dbus_g_type_specialized_construct (schedule_type));
665 start_str_time = g_time_val_to_iso8601 (data->start_time);
666 end_str_time = g_time_val_to_iso8601 (data->end_time);
668 dbus_g_type_struct_set (&schedule,
669 0, data->schedule_id,
675 6, data->subtitle->str,
676 7, data->description->str,
677 8, data->category->str,
681 g_ptr_array_add (*schedules, g_value_get_boxed (&schedule));
683 g_free (start_str_time);
684 g_free (end_str_time);
687 gmyth_schedule_info_list_free (list);
694 gmyth_dbus_server_get_thumbnail (GObject *obj,
699 GMythFileTransfer *file_transfer;
701 GMythFileReadResult result;
702 GMythDbusServerPrivate *priv;
704 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
706 file_transfer = NULL;
708 g_return_val_if_fail (priv->myth_backend, FALSE);
710 if (!gmyth_util_file_exists (priv->myth_backend, uri))
713 file_transfer = gmyth_file_transfer_new (priv->myth_backend);
715 if (!gmyth_file_transfer_open (file_transfer, uri))
718 filesize = gmyth_file_transfer_get_filesize (file_transfer);
722 *image = g_byte_array_new ();
723 result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
724 if (result == GMYTH_FILE_READ_ERROR)
727 gmyth_file_transfer_close (file_transfer);
728 g_object_unref (file_transfer);
730 if (filesize > (*image)->len)
737 g_byte_array_free (*image, TRUE);
738 g_object_unref(file_transfer);
743 gmyth_dbus_server_get_channel_icon (GObject *obj,
748 GMythChannelInfo *channel = NULL;
751 GMythDbusServerPrivate *priv;
753 g_debug ("%s:%d", __FUNCTION__, __LINE__);
754 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
755 g_return_val_if_fail (priv->myth_backend, FALSE);
757 channel = gmyth_epg_get_channel_info (priv->myth_epg,
765 if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
767 gmyth_channel_info_free (channel);
768 g_debug("Channel does not have icon available");
774 if (!gmyth_epg_channel_get_icon (priv->myth_epg,
779 gmyth_channel_info_free (channel);
780 g_warning("Could not get channel icon for channel id = %u", channel_id);
784 *icon = g_byte_array_sized_new (icon_length);
785 *icon = g_byte_array_append (*icon, icon_data, icon_length);
788 gmyth_channel_info_free(channel);
794 gmyth_dbus_server_stop_recording (GObject *obj,
799 gboolean ret = FALSE;
800 GMythDbusServerPrivate *priv;
802 g_debug ("%s:%d", __FUNCTION__, __LINE__);
803 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
805 g_return_val_if_fail (priv->myth_backend, FALSE);
806 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
809 ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
816 gmyth_dbus_server_new_schedule_info (const gchar* description,
819 GTimeVal *start_vtime,
822 ScheduleInfo *new_sched_info;
824 new_sched_info = g_new0(ScheduleInfo, 1);
826 /* record_id == -1 for generating a new id */
827 new_sched_info->schedule_id = -1;
829 new_sched_info->channel_id = channel_id;
830 new_sched_info->program_id = program_id;
831 new_sched_info->start_time = g_new0 (GTimeVal, 1);
832 *new_sched_info->start_time = *start_vtime;
833 new_sched_info->end_time = g_new0 (GTimeVal, 1);
834 *new_sched_info->end_time = *end_vtime;
836 /* TODO: there is no frequency field */
837 /*new_sched_info->frequency = -1;*/
839 if (description != NULL) {
840 /* FIXME: description parameter is used as title and description */
841 new_sched_info->title = g_string_new(description);
842 new_sched_info->description = g_string_new(description);
845 return new_sched_info;
849 gmyth_dbus_server_add_schedule (GObject *obj,
852 const gchar *start_time,
853 const gchar *end_time,
855 const gchar *description,
859 ScheduleInfo *sch_info;
860 GTimeVal start_vtime;
862 GMythDbusServerPrivate *priv;
864 g_debug ("%s:%d", __FUNCTION__, __LINE__);
865 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
869 g_return_val_if_fail (priv->myth_backend, FALSE);
871 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
875 g_time_val_from_iso8601 (start_time, &start_vtime);
876 g_time_val_from_iso8601 (end_time, &end_vtime);
877 sch_info = gmyth_dbus_server_new_schedule_info (description,
882 if (sch_info != NULL) {
883 GMythScheduleType type;
888 GMYTH_SCHEDULE_ALL_OCCURRENCES :
889 GMYTH_SCHEDULE_ONE_OCCURRENCE);
891 g_get_current_time (&t_now);
893 has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler,
895 (time_t) start_vtime.tv_sec);
898 if ((t_now.tv_sec >= start_vtime.tv_sec)
899 && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
902 gboolean res = FALSE;
904 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
905 res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
907 (time_t) start_vtime.tv_sec);
909 GMythStringList *slist = gmyth_string_list_new();
911 gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
912 gmyth_socket_sendreceive_stringlist(socket, slist);
913 res = (gmyth_string_list_get_int(slist, 0) == 1);
914 g_object_unref(slist);
917 g_object_unref(socket);
922 if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
926 g_warning("Could not add schedule entry");
930 (*schedule_id) = sch_info->schedule_id;
931 gmyth_schedule_info_free (sch_info);
939 gmyth_dbus_server_add_exception (GObject *obj,
943 const gchar *start_time,
944 const gchar *end_time,
945 const gchar *description,
948 ScheduleInfo *sch_info;
949 GTimeVal start_vtime;
951 GMythDbusServerPrivate *priv;
953 g_debug ("%s:%d", __FUNCTION__, __LINE__);
954 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
956 g_return_val_if_fail (priv->myth_backend, FALSE);
958 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
961 g_time_val_from_iso8601 (start_time, &start_vtime);
962 g_time_val_from_iso8601 (end_time, &end_vtime);
964 sch_info = gmyth_dbus_server_new_schedule_info (description,
969 if (sch_info != NULL)
971 if (!gmyth_scheduler_add_exception (priv->myth_scheduler,
975 g_warning ("Could not add schedule exception");
976 gmyth_schedule_info_free (sch_info);
980 gmyth_schedule_info_free (sch_info);
987 gmyth_dbus_server_remove_schedule (GObject *obj,
991 GMythDbusServerPrivate *priv;
993 g_debug ("%s:%d", __FUNCTION__, __LINE__);
994 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
996 g_return_val_if_fail (priv->myth_backend, FALSE);
998 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
1001 return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
1005 gmyth_dbus_server_start_dbus_service (void)
1007 GError *error = NULL;
1009 DBusGConnection *bus;
1011 GMythDbusServer *self;
1013 self = g_object_new (GMYTH_DBUS_SERVER_TYPE, NULL);
1014 g_return_val_if_fail (self, FALSE);
1016 /* TODO: should verify if this service was already started */
1018 /* connect to session bus */
1019 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
1022 g_warning ("Could not connect to dbus: %s", error->message);
1023 g_error_free (error);
1027 /* register dbus object */
1028 dbus_g_connection_register_g_object (bus,
1029 GMYTH_DBUS_SERVER_PATH, G_OBJECT (self));
1031 proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS,
1032 DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
1034 /* registering download manager service */
1035 if (!org_freedesktop_DBus_request_name (proxy, GMYTH_DBUS_SERVER_IFACE,
1036 0, &request_ret, &error))
1038 g_warning ("Unable to register dbus service: %d %s",
1039 error->code, error->message);
1040 g_error_free (error);
1044 if (request_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
1046 g_warning ("Got result code %u from requesting name", request_ret);
1053 g_object_unref (self);