view iface: remove more unused methods
GcalView::draw_event overlapped a bit with GcalView::will_add_event, so the same reasons for removing one stand for the other. GcalView::clear was a hack for the composited GcalDayView which has gone, and was a bad experiment.
This commit is contained in:
@@ -127,15 +127,9 @@ static gchar* gcal_month_view_get_left_header (GcalView *vie
|
|||||||
|
|
||||||
static gchar* gcal_month_view_get_right_header (GcalView *view);
|
static gchar* gcal_month_view_get_right_header (GcalView *view);
|
||||||
|
|
||||||
static gboolean gcal_month_view_draw_event (GcalView *view,
|
|
||||||
icaltimetype *start_date,
|
|
||||||
icaltimetype *end_date);
|
|
||||||
|
|
||||||
static GtkWidget* gcal_month_view_get_by_uuid (GcalView *view,
|
static GtkWidget* gcal_month_view_get_by_uuid (GcalView *view,
|
||||||
const gchar *uuid);
|
const gchar *uuid);
|
||||||
|
|
||||||
static void gcal_month_view_clear (GcalView *view);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GcalMonthView,
|
G_DEFINE_TYPE_WITH_CODE (GcalMonthView,
|
||||||
gcal_month_view,
|
gcal_month_view,
|
||||||
GCAL_TYPE_SUBSCRIBER,
|
GCAL_TYPE_SUBSCRIBER,
|
||||||
@@ -222,9 +216,7 @@ gcal_view_interface_init (GcalViewIface *iface)
|
|||||||
iface->get_left_header = gcal_month_view_get_left_header;
|
iface->get_left_header = gcal_month_view_get_left_header;
|
||||||
iface->get_right_header = gcal_month_view_get_right_header;
|
iface->get_right_header = gcal_month_view_get_right_header;
|
||||||
|
|
||||||
iface->draw_event = gcal_month_view_draw_event;
|
|
||||||
iface->get_by_uuid = gcal_month_view_get_by_uuid;
|
iface->get_by_uuid = gcal_month_view_get_by_uuid;
|
||||||
iface->clear = gcal_month_view_clear;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1282,23 +1274,6 @@ gcal_month_view_get_right_header (GcalView *view)
|
|||||||
return g_strdup_printf ("%d", priv->date->year);
|
return g_strdup_printf ("%d", priv->date->year);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gcal_month_view_draw_event (GcalView *view,
|
|
||||||
icaltimetype *start_date,
|
|
||||||
icaltimetype *end_date)
|
|
||||||
{
|
|
||||||
GcalMonthViewPrivate *priv;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GCAL_IS_MONTH_VIEW (view), FALSE);
|
|
||||||
priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (view));
|
|
||||||
|
|
||||||
if (priv->date == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return (priv->date->month == start_date->month &&
|
|
||||||
priv->date->year == start_date->year);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget*
|
static GtkWidget*
|
||||||
gcal_month_view_get_by_uuid (GcalView *view,
|
gcal_month_view_get_by_uuid (GcalView *view,
|
||||||
const gchar *uuid)
|
const gchar *uuid)
|
||||||
@@ -1326,13 +1301,6 @@ gcal_month_view_get_by_uuid (GcalView *view,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gcal_month_view_clear (GcalView *view)
|
|
||||||
{
|
|
||||||
gtk_container_foreach (GTK_CONTAINER (view),
|
|
||||||
(GtkCallback) gtk_widget_destroy, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Public API */
|
/* Public API */
|
||||||
/**
|
/**
|
||||||
* gcal_month_view_new:
|
* gcal_month_view_new:
|
||||||
|
|||||||
@@ -227,29 +227,6 @@ gcal_view_get_right_header (GcalView *view)
|
|||||||
return GCAL_VIEW_GET_INTERFACE (view)->get_right_header (view);
|
return GCAL_VIEW_GET_INTERFACE (view)->get_right_header (view);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gcal_view_draw_event:
|
|
||||||
* @view: a #GcalView
|
|
||||||
* @start_date: an #icaltimetype object. The starting date of the event
|
|
||||||
* @end_date: an #icaltimetype object. The edn-date of the event
|
|
||||||
*
|
|
||||||
* Whether the event within these boundaries will be drawn by the #GcalView implementation
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if it is, %FALSE otherwise
|
|
||||||
**/
|
|
||||||
gboolean
|
|
||||||
gcal_view_draw_event (GcalView *view,
|
|
||||||
icaltimetype *start_date,
|
|
||||||
icaltimetype *end_date)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (GCAL_IS_VIEW (view), FALSE);
|
|
||||||
g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->draw_event);
|
|
||||||
|
|
||||||
return GCAL_VIEW_GET_INTERFACE (view)->draw_event (view,
|
|
||||||
start_date,
|
|
||||||
end_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_view_get_by_uuid:
|
* gcal_view_get_by_uuid:
|
||||||
* @view: a #GcalView
|
* @view: a #GcalView
|
||||||
@@ -270,21 +247,3 @@ gcal_view_get_by_uuid (GcalView *view,
|
|||||||
|
|
||||||
return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
|
return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gcal_view_clear:
|
|
||||||
* @view: a #GcalView object
|
|
||||||
*
|
|
||||||
* Destroy every children inside the view.
|
|
||||||
*
|
|
||||||
* Note: this is a hack because of not-working container code
|
|
||||||
* for day and week view composited widgets.
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
gcal_view_clear (GcalView *view)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GCAL_IS_VIEW (view));
|
|
||||||
g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->clear);
|
|
||||||
|
|
||||||
GCAL_VIEW_GET_INTERFACE (view)->clear (view);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -61,9 +61,7 @@ struct _GcalViewIface
|
|||||||
gchar* (*get_right_header) (GcalView *view);
|
gchar* (*get_right_header) (GcalView *view);
|
||||||
|
|
||||||
/* Container functions related API */
|
/* Container functions related API */
|
||||||
gboolean (*draw_event) (GcalView *view, icaltimetype *start_date, icaltimetype *end_date);
|
|
||||||
GtkWidget* (*get_by_uuid) (GcalView *view, const gchar *uuid);
|
GtkWidget* (*get_by_uuid) (GcalView *view, const gchar *uuid);
|
||||||
void (*clear) (GcalView *view);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gcal_view_get_type (void);
|
GType gcal_view_get_type (void);
|
||||||
@@ -88,15 +86,9 @@ gchar* gcal_view_get_left_header (GcalView *view);
|
|||||||
|
|
||||||
gchar* gcal_view_get_right_header (GcalView *view);
|
gchar* gcal_view_get_right_header (GcalView *view);
|
||||||
|
|
||||||
gboolean gcal_view_draw_event (GcalView *view,
|
|
||||||
icaltimetype *start_date,
|
|
||||||
icaltimetype *end_date);
|
|
||||||
|
|
||||||
GtkWidget* gcal_view_get_by_uuid (GcalView *view,
|
GtkWidget* gcal_view_get_by_uuid (GcalView *view,
|
||||||
const gchar *uuid);
|
const gchar *uuid);
|
||||||
|
|
||||||
void gcal_view_clear (GcalView *view);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GCAL_MONTH_VIEW_H__ */
|
#endif /* __GCAL_MONTH_VIEW_H__ */
|
||||||
|
|||||||
@@ -230,9 +230,7 @@ gcal_view_interface_init (GcalViewIface *iface)
|
|||||||
iface->get_left_header = gcal_week_view_get_left_header;
|
iface->get_left_header = gcal_week_view_get_left_header;
|
||||||
iface->get_right_header = gcal_week_view_get_right_header;
|
iface->get_right_header = gcal_week_view_get_right_header;
|
||||||
|
|
||||||
iface->draw_event = gcal_week_view_draw_event;
|
|
||||||
iface->get_by_uuid = gcal_week_view_get_by_uuid;
|
iface->get_by_uuid = gcal_week_view_get_by_uuid;
|
||||||
/* iface->clear = gcal_week_view_clear; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -917,6 +915,7 @@ gcal_week_view_set_date (GcalWeekView *view,
|
|||||||
priv = gcal_week_view_get_instance_private (view);
|
priv = gcal_week_view_get_instance_private (view);
|
||||||
will_resize = FALSE;
|
will_resize = FALSE;
|
||||||
|
|
||||||
|
/* FIXME: draw_event don't exist anymore */
|
||||||
/* if span_updated: queue_resize */
|
/* if span_updated: queue_resize */
|
||||||
will_resize = ! gcal_week_view_draw_event (GCAL_VIEW (view), date, NULL);
|
will_resize = ! gcal_week_view_draw_event (GCAL_VIEW (view), date, NULL);
|
||||||
|
|
||||||
@@ -1362,6 +1361,7 @@ gcal_week_view_get_right_header (GcalView *view)
|
|||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: replace cause it doesn't exist anymore */
|
||||||
static gboolean
|
static gboolean
|
||||||
gcal_week_view_draw_event (GcalView *view,
|
gcal_week_view_draw_event (GcalView *view,
|
||||||
icaltimetype *start_date,
|
icaltimetype *start_date,
|
||||||
|
|||||||
@@ -122,15 +122,9 @@ static gchar* gcal_year_view_get_left_header (GcalView
|
|||||||
|
|
||||||
static gchar* gcal_year_view_get_right_header (GcalView *view);
|
static gchar* gcal_year_view_get_right_header (GcalView *view);
|
||||||
|
|
||||||
static gboolean gcal_year_view_draw_event (GcalView *view,
|
|
||||||
icaltimetype *start_date,
|
|
||||||
icaltimetype *end_date);
|
|
||||||
|
|
||||||
static GtkWidget* gcal_year_view_get_by_uuid (GcalView *view,
|
static GtkWidget* gcal_year_view_get_by_uuid (GcalView *view,
|
||||||
const gchar *uuid);
|
const gchar *uuid);
|
||||||
|
|
||||||
static void gcal_year_view_clear (GcalView *view);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GcalYearView,
|
G_DEFINE_TYPE_WITH_CODE (GcalYearView,
|
||||||
gcal_year_view,
|
gcal_year_view,
|
||||||
GCAL_TYPE_SUBSCRIBER,
|
GCAL_TYPE_SUBSCRIBER,
|
||||||
@@ -209,9 +203,7 @@ gcal_view_interface_init (GcalViewIface *iface)
|
|||||||
iface->get_left_header = gcal_year_view_get_left_header;
|
iface->get_left_header = gcal_year_view_get_left_header;
|
||||||
iface->get_right_header = gcal_year_view_get_right_header;
|
iface->get_right_header = gcal_year_view_get_right_header;
|
||||||
|
|
||||||
iface->draw_event = gcal_year_view_draw_event;
|
|
||||||
iface->get_by_uuid = gcal_year_view_get_by_uuid;
|
iface->get_by_uuid = gcal_year_view_get_by_uuid;
|
||||||
iface->clear = gcal_year_view_clear;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1000,22 +992,6 @@ gcal_year_view_get_right_header (GcalView *view)
|
|||||||
return g_strdup ("");
|
return g_strdup ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gcal_year_view_draw_event (GcalView *view,
|
|
||||||
icaltimetype *start_date,
|
|
||||||
icaltimetype *end_date)
|
|
||||||
{
|
|
||||||
GcalYearViewPrivate *priv;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GCAL_IS_YEAR_VIEW (view), FALSE);
|
|
||||||
priv = gcal_year_view_get_instance_private (GCAL_YEAR_VIEW (view));
|
|
||||||
|
|
||||||
if (priv->date == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return priv->date->year == start_date->year;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget*
|
static GtkWidget*
|
||||||
gcal_year_view_get_by_uuid (GcalView *view,
|
gcal_year_view_get_by_uuid (GcalView *view,
|
||||||
const gchar *uuid)
|
const gchar *uuid)
|
||||||
@@ -1043,13 +1019,6 @@ gcal_year_view_get_by_uuid (GcalView *view,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gcal_year_view_clear (GcalView *view)
|
|
||||||
{
|
|
||||||
gtk_container_foreach (GTK_CONTAINER (view),
|
|
||||||
(GtkCallback) gtk_widget_destroy, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Public API */
|
/* Public API */
|
||||||
/**
|
/**
|
||||||
* gcal_year_view_new:
|
* gcal_year_view_new:
|
||||||
|
|||||||
Reference in New Issue
Block a user