[gnome-calendar] event-widget: add ::clone API
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event-widget: add ::clone API
- Date: Thu, 18 Dec 2014 14:06:06 +0000 (UTC)
commit 60946551b3b69bd4ac9e00ebb0d3b97fefedfc75
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Wed Dec 10 11:44:59 2014 -0500
event-widget: add ::clone API
src/gcal-event-widget.c | 25 +++++++++++++++++++++++++
src/gcal-event-widget.h | 4 ++++
2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index 4cae475..caa8843 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -834,6 +834,22 @@ gcal_event_widget_new_with_summary_and_color (const gchar *summary,
NULL);
}
+GtkWidget*
+gcal_event_widget_clone (GcalEventWidget *widget)
+{
+ GtkWidget *new_widget;
+ GcalEventData *data;
+
+ data = gcal_event_widget_get_data (widget);
+ g_object_ref (data->event_component);
+
+ new_widget = gcal_event_widget_new_from_data (data);
+ g_free (data);
+
+ gcal_event_widget_set_read_only(GCAL_EVENT_WIDGET (new_widget), gcal_event_widget_get_read_only (widget));
+ return new_widget;
+}
+
const gchar*
gcal_event_widget_peek_uuid (GcalEventWidget *event)
{
@@ -854,6 +870,15 @@ gcal_event_widget_set_read_only (GcalEventWidget *event,
priv->read_only = read_only;
}
+gboolean
+gcal_event_widget_get_read_only (GcalEventWidget *event)
+{
+ GcalEventWidgetPrivate *priv;
+ priv = gcal_event_widget_get_instance_private (event);
+
+ return priv->read_only;
+}
+
/**
* gcal_event_widget_set_date:
* @event: a #GcalEventWidget
diff --git a/src/gcal-event-widget.h b/src/gcal-event-widget.h
index bf71cac..75268c4 100644
--- a/src/gcal-event-widget.h
+++ b/src/gcal-event-widget.h
@@ -61,11 +61,15 @@ GtkWidget* gcal_event_widget_new_from_data (GcalEventData *
GtkWidget* gcal_event_widget_new_with_summary_and_color (const gchar *summary,
const GdkRGBA *color);
+GtkWidget* gcal_event_widget_clone (GcalEventWidget *widget);
+
const gchar* gcal_event_widget_peek_uuid (GcalEventWidget *event);
void gcal_event_widget_set_read_only (GcalEventWidget *event,
gboolean read_only);
+gboolean gcal_event_widget_get_read_only (GcalEventWidget *event);
+
void gcal_event_widget_set_date (GcalEventWidget *event,
const icaltimetype *date);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]