[gnome-calendar] view: remove ::mark_current_unit
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] view: remove ::mark_current_unit
- Date: Fri, 26 Dec 2014 15:13:23 +0000 (UTC)
commit e6a929f3fdb867466dc571a152e2d9d179d10c5b
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Dec 25 20:24:36 2014 -0500
view: remove ::mark_current_unit
New event action will open edit-dialog directly so this method is not needed
src/gcal-month-view.c | 49 -------------------------------------------------
src/gcal-view.c | 20 --------------------
src/gcal-view.h | 5 -----
src/gcal-week-view.c | 1 -
src/gcal-year-view.c | 35 -----------------------------------
5 files changed, 0 insertions(+), 110 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index a29abdf..0b24ee3 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -201,10 +201,6 @@ static icaltimetype* gcal_month_view_get_initial_date (GcalView *vie
static icaltimetype* gcal_month_view_get_final_date (GcalView *view);
-static void gcal_month_view_mark_current_unit (GcalView *view,
- gint *x,
- gint *y);
-
static void gcal_month_view_clear_marks (GcalView *view);
static gchar* gcal_month_view_get_left_header (GcalView *view);
@@ -656,7 +652,6 @@ gcal_view_interface_init (GcalViewIface *iface)
iface->get_initial_date = gcal_month_view_get_initial_date;
iface->get_final_date = gcal_month_view_get_final_date;
- iface->mark_current_unit = gcal_month_view_mark_current_unit;
iface->clear_marks = gcal_month_view_clear_marks;
iface->get_left_header = gcal_month_view_get_left_header;
@@ -1819,50 +1814,6 @@ gcal_month_view_get_final_date (GcalView *view)
}
static void
-gcal_month_view_mark_current_unit (GcalView *view,
- gint *x,
- gint *y)
-{
- GcalMonthViewPrivate *priv;
-
- gdouble horizontal_block;
- gdouble vertical_block;
-
- gint days;
- gint shown_rows;
- gint february_gap;
- gdouble lines_gap;
- gdouble lines_gap_for_5;
-
- gint x_pos, y_pos;
- gdouble start_grid_y;
-
- priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (view));
- start_grid_y = get_start_grid_y (GTK_WIDGET (view));
- horizontal_block = gtk_widget_get_allocated_width (GTK_WIDGET (view)) / 7.0;
- vertical_block = (gtk_widget_get_allocated_height (GTK_WIDGET (view)) - start_grid_y) / 6.0;
-
- days = priv->days_delay + icaltime_days_in_month (priv->date->month, priv->date->year);
- shown_rows = ceil (days / 7.0);
- february_gap = shown_rows == 4 ? 1 : 0;
- lines_gap = ((shown_rows + 1) / 2.0) + 0.5 - ceil (shown_rows / 2.0);
- lines_gap_for_5 = shown_rows == 5 ? lines_gap : 0;
-
- priv->start_mark_cell = priv->date->day + 7 * february_gap + priv->days_delay - 1;
- priv->end_mark_cell = priv->start_mark_cell;
-
- x_pos = horizontal_block * ((priv->end_mark_cell % 7) + 0.5);
- y_pos = start_grid_y + vertical_block * (lines_gap_for_5 + (priv->end_mark_cell / 7.0) + 0.5);
-
- gtk_widget_queue_draw (GTK_WIDGET (view));
-
- if (x != NULL)
- *x = x_pos;
- if (y != NULL)
- *y = y_pos;
-}
-
-static void
gcal_month_view_clear_marks (GcalView *view)
{
GcalMonthViewPrivate *priv;
diff --git a/src/gcal-view.c b/src/gcal-view.c
index 74c157b..4be2930 100644
--- a/src/gcal-view.c
+++ b/src/gcal-view.c
@@ -162,26 +162,6 @@ gcal_view_get_final_date (GcalView *view)
}
/**
- * gcal_view_mark_current_unit:
- * @view: a #GcalView implementation
- * @x: the x position of the current unit. Returned by the view
- * @y: the y position of the current unit. Returned by the view
- *
- * Mark the current unit in the view as marked for event creation.
- * The (x, y) pair returned is the center of the cell
- **/
-void
-gcal_view_mark_current_unit (GcalView *view,
- gint *x,
- gint *y)
-{
- g_return_if_fail (GCAL_IS_VIEW (view));
- g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->mark_current_unit);
-
- GCAL_VIEW_GET_INTERFACE (view)->mark_current_unit (view, x, y);
-}
-
-/**
* gcal_view_clear_marks:
* @view: a #GcalView
*
diff --git a/src/gcal-view.h b/src/gcal-view.h
index c42dc8d..b13e908 100644
--- a/src/gcal-view.h
+++ b/src/gcal-view.h
@@ -54,7 +54,6 @@ struct _GcalViewIface
icaltimetype* (*get_final_date) (GcalView *view);
/* Marks related API */
- void (*mark_current_unit) (GcalView *view, gint *x, gint *y);
void (*clear_marks) (GcalView *view);
/* Update NavBar headings */
@@ -77,10 +76,6 @@ icaltimetype* gcal_view_get_initial_date (GcalView *view);
icaltimetype* gcal_view_get_final_date (GcalView *view);
-void gcal_view_mark_current_unit (GcalView *view,
- gint *x,
- gint *y);
-
void gcal_view_clear_marks (GcalView *view);
gchar* gcal_view_get_left_header (GcalView *view);
diff --git a/src/gcal-week-view.c b/src/gcal-week-view.c
index e0416a5..22e38f7 100644
--- a/src/gcal-week-view.c
+++ b/src/gcal-week-view.c
@@ -564,7 +564,6 @@ 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->mark_current_unit = gcal_week_view_mark_current_unit; */
/* iface->clear_marks = gcal_week_view_clear_marks; */
iface->get_left_header = gcal_week_view_get_left_header;
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 2ec3a72..beba031 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -115,10 +115,6 @@ static icaltimetype* gcal_year_view_get_initial_date (GcalView
static icaltimetype* gcal_year_view_get_final_date (GcalView *view);
-static void gcal_year_view_mark_current_unit (GcalView *view,
- gint *x,
- gint *y);
-
static void gcal_year_view_clear_marks (GcalView *view);
static gchar* gcal_year_view_get_left_header (GcalView *view);
@@ -202,7 +198,6 @@ 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->mark_current_unit = gcal_year_view_mark_current_unit;
iface->clear_marks = gcal_year_view_clear_marks;
iface->get_left_header = gcal_year_view_get_left_header;
@@ -949,36 +944,6 @@ gcal_year_view_get_final_date (GcalView *view)
}
static void
-gcal_year_view_mark_current_unit (GcalView *view,
- gint *x,
- gint *y)
-{
- GcalYearViewPrivate *priv;
-
- gint x_pos, y_pos;
- gint width, height;
-
- /* FIXME: This need to include marking the current unit */
- priv = gcal_year_view_get_instance_private (GCAL_YEAR_VIEW (view));
-
- width = gtk_widget_get_allocated_width (GTK_WIDGET (view));
- height = gtk_widget_get_allocated_height (GTK_WIDGET (view));
-
- priv->start_mark_cell = priv->date->month - 1;
- priv->end_mark_cell = priv->start_mark_cell;
-
- x_pos = (width / 6) * (( priv->start_mark_cell % 6) + 0.5);
- y_pos = (height / 2) * (( priv->start_mark_cell / 6) + 0.5);
-
- gtk_widget_queue_draw (GTK_WIDGET (view));
-
- if (x != NULL)
- *x = x_pos;
- if (y != NULL)
- *y = y_pos;
-}
-
-static void
gcal_year_view_clear_marks (GcalView *view)
{
GcalYearViewPrivate *priv;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]