gcal-view: cleaned GcalView API
Removed GcalView:remove_by_uuid method. Reordered gcal-view header file.
This commit is contained in:
@@ -213,7 +213,6 @@ gcal_month_view_init (GcalMonthView *self)
|
||||
static void
|
||||
gcal_view_interface_init (GcalViewIface *iface)
|
||||
{
|
||||
iface->remove_by_uuid = gcal_month_view_remove_by_uuid;
|
||||
iface->reposition_child = gcal_month_view_reposition_child;
|
||||
|
||||
iface->clear_selection = gcal_month_view_clear_selection;
|
||||
|
||||
+20
-20
@@ -115,26 +115,6 @@ gcal_view_get_date (GcalView *view)
|
||||
return date;
|
||||
}
|
||||
|
||||
void
|
||||
gcal_view_remove_by_uuid (GcalView *view,
|
||||
const gchar *uuid)
|
||||
{
|
||||
g_return_if_fail (GCAL_IS_VIEW (view));
|
||||
g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->remove_by_uuid);
|
||||
|
||||
GCAL_VIEW_GET_INTERFACE (view)->remove_by_uuid (view, uuid);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gcal_view_get_by_uuid (GcalView *view,
|
||||
const gchar *uuid)
|
||||
{
|
||||
g_return_val_if_fail (GCAL_IS_VIEW (view), NULL);
|
||||
g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid);
|
||||
|
||||
return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
|
||||
}
|
||||
|
||||
void
|
||||
gcal_view_reposition_child (GcalView *view,
|
||||
const gchar *uuid)
|
||||
@@ -282,3 +262,23 @@ gcal_view_get_right_header (GcalView *view)
|
||||
|
||||
return GCAL_VIEW_GET_INTERFACE (view)->get_right_header (view);
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_view_get_by_uuid:
|
||||
* @view: a #GcalView
|
||||
* @uuid: the uuid of the event-widget
|
||||
*
|
||||
* The uuid is formed by source-uid:event-uid, and the widget with
|
||||
* this uuid is fetched by this method
|
||||
*
|
||||
* Returns: a #GcalEventWidget as #GtkWidget
|
||||
**/
|
||||
GtkWidget*
|
||||
gcal_view_get_by_uuid (GcalView *view,
|
||||
const gchar *uuid)
|
||||
{
|
||||
g_return_val_if_fail (GCAL_IS_VIEW (view), NULL);
|
||||
g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid);
|
||||
|
||||
return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
|
||||
}
|
||||
|
||||
+6
-9
@@ -51,9 +51,6 @@ struct _GcalViewIface
|
||||
void (*create_event) (GcalView *view, icaltimetype *start_span, icaltimetype *end_span, gdouble x, gdouble y);
|
||||
void (*updated) (GcalView *view, icaltimetype *date);
|
||||
|
||||
/* Container functions related API */
|
||||
void (*remove_by_uuid) (GcalView *view, const gchar *uuid);
|
||||
GtkWidget* (*get_by_uuid) (GcalView *view, const gchar *uuid);
|
||||
void (*reposition_child) (GcalView *view, const gchar *uuid);
|
||||
|
||||
/* FIXME remove me in favor of the one below */
|
||||
@@ -75,6 +72,9 @@ struct _GcalViewIface
|
||||
/* Update NavBar headings */
|
||||
gchar* (*get_left_header) (GcalView *view);
|
||||
gchar* (*get_right_header) (GcalView *view);
|
||||
|
||||
/* Container functions related API */
|
||||
GtkWidget* (*get_by_uuid) (GcalView *view, const gchar *uuid);
|
||||
};
|
||||
|
||||
GType gcal_view_get_type (void);
|
||||
@@ -85,12 +85,6 @@ void gcal_view_set_date (GcalView *view,
|
||||
|
||||
icaltimetype* gcal_view_get_date (GcalView *view);
|
||||
|
||||
void gcal_view_remove_by_uuid (GcalView *view,
|
||||
const gchar *uuid);
|
||||
|
||||
GtkWidget* gcal_view_get_by_uuid (GcalView *view,
|
||||
const gchar *uuid);
|
||||
|
||||
void gcal_view_reposition_child (GcalView *view,
|
||||
const gchar *uuid);
|
||||
|
||||
@@ -116,6 +110,9 @@ gchar* gcal_view_get_left_header (GcalView *view);
|
||||
|
||||
gchar* gcal_view_get_right_header (GcalView *view);
|
||||
|
||||
GtkWidget* gcal_view_get_by_uuid (GcalView *view,
|
||||
const gchar *uuid);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GCAL_MONTH_VIEW_H__ */
|
||||
|
||||
@@ -236,9 +236,8 @@ gcal_view_interface_init (GcalViewIface *iface)
|
||||
{
|
||||
iface->get_initial_date = gcal_week_view_get_initial_date;
|
||||
iface->get_final_date = gcal_week_view_get_final_date;
|
||||
|
||||
iface->contains_date = gcal_week_view_contains_date;
|
||||
iface->remove_by_uuid = gcal_week_view_remove_by_uuid;
|
||||
|
||||
iface->get_by_uuid = gcal_week_view_get_by_uuid;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,21 +208,19 @@ gcal_year_view_init (GcalYearView *self)
|
||||
static void
|
||||
gcal_view_interface_init (GcalViewIface *iface)
|
||||
{
|
||||
iface->get_initial_date = gcal_year_view_get_initial_date;
|
||||
iface->get_final_date = gcal_year_view_get_final_date;
|
||||
|
||||
iface->contains_date = gcal_year_view_contains_date;
|
||||
iface->remove_by_uuid = gcal_year_view_remove_by_uuid;
|
||||
iface->get_by_uuid = gcal_year_view_get_by_uuid;
|
||||
iface->reposition_child = gcal_year_view_reposition_child;
|
||||
|
||||
iface->clear_selection = gcal_year_view_clear_selection;
|
||||
|
||||
iface->create_event_on_current_unit = gcal_year_view_create_event_on_current_unit;
|
||||
|
||||
/* New API */
|
||||
iface->get_initial_date = gcal_year_view_get_initial_date;
|
||||
iface->get_final_date = gcal_year_view_get_final_date;
|
||||
iface->contains_date = gcal_year_view_contains_date;
|
||||
|
||||
iface->get_left_header = gcal_year_view_get_left_header;
|
||||
iface->get_right_header = gcal_year_view_get_right_header;
|
||||
|
||||
iface->get_by_uuid = gcal_year_view_get_by_uuid;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user