aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog20
-rw-r--r--calendar/gui/e-cal-view.c91
-rw-r--r--calendar/gui/e-cal-view.h13
-rw-r--r--calendar/gui/e-calendar-view.c91
-rw-r--r--calendar/gui/e-calendar-view.h13
-rw-r--r--calendar/gui/e-day-view-main-item.c6
-rw-r--r--calendar/gui/e-day-view-top-item.c6
-rw-r--r--calendar/gui/e-day-view.c196
-rw-r--r--calendar/gui/e-day-view.h15
-rw-r--r--calendar/gui/e-week-view-event-item.c18
-rw-r--r--calendar/gui/e-week-view.c19
-rw-r--r--calendar/gui/e-week-view.h12
-rw-r--r--calendar/gui/gnome-cal.c5
13 files changed, 267 insertions, 238 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 83ef942e01..fed82ace52 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,25 @@
2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/e-day-view.c (e_day_view_delete_event,
+ e_day_view_delete_event_internal):
+ * gui/e-week-view.c (e_week_view_delete_event,
+ e_week_view_delete_event_internal): removed.
+
+ * gui/e-cal-view.[ch] (e_cal_view_delete_selected_event): renamed
+ from e_cal_view_delete_event_internal.
+ (e_cal_view_delete_selected_events): new function.
+
+ * gui/gnome-cal.c (gnome_calendar_delete_selection): call
+ e_cal_view_delete_selected_events().
+
+ * gui/e-week-view-event-item.c (e_week_view_event_item_get_position,
+ e_week_view_event_item_button_press):
+ * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
+ * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
+ adapted to changes in E*ViewPosition.
+
+2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
+
* gui/e-cal-view.c (on_print): added missing cases.
(setup_popup_icons): new function to set up icons for the popup menu.
(e_cal_view_create_popup_menu): call setup_popup_icons.
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
index fd499ffc6a..6c352270af 100644
--- a/calendar/gui/e-cal-view.c
+++ b/calendar/gui/e-cal-view.c
@@ -576,6 +576,64 @@ e_cal_view_paste_clipboard (ECalView *cal_view)
}
static void
+delete_event (ECalView *cal_view, CalComponent *comp)
+{
+ CalComponentVType vtype;
+
+ vtype = cal_component_get_vtype (comp);
+
+ if (delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view))) {
+ const char *uid;
+
+ if (itip_organizer_is_user (comp, cal_view->priv->client)
+ && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (cal_view),
+ cal_view->priv->client,
+ comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp,
+ cal_view->priv->client, NULL);
+
+ cal_component_get_uid (comp, &uid);
+
+ delete_error_dialog (
+ cal_client_remove_object (cal_view->priv->client, uid), CAL_COMPONENT_EVENT);
+ }
+}
+
+void
+e_cal_view_delete_selected_event (ECalView *cal_view)
+{
+ GList *selected;
+ CalComponent *comp;
+
+ selected = e_cal_view_get_selected_events (cal_view);
+ if (!selected)
+ return;
+
+ comp = CAL_COMPONENT (selected->data);
+ delete_event (cal_view, comp);
+
+ g_list_free (selected);
+}
+
+void
+e_cal_view_delete_selected_events (ECalView *cal_view)
+{
+ GList *selected, *l;
+ CalComponent *comp;
+
+ selected = e_cal_view_get_selected_events (cal_view);
+ if (!selected)
+ return;
+
+ for (l = selected; l != NULL; l = l->next) {
+ comp = CAL_COMPONENT (l->data);
+ delete_event (cal_view, comp);
+ }
+
+ g_list_free (selected);
+}
+
+static void
on_new_appointment (GtkWidget *widget, gpointer user_data)
{
time_t dtstart, dtend;
@@ -797,44 +855,13 @@ on_settings (GtkWidget *widget, gpointer user_data)
control_util_show_settings (cal_view->priv->calendar);
}
-void
-e_cal_view_delete_event_internal (ECalView *cal_view, CalComponent *comp)
-{
- CalComponentVType vtype;
-
- vtype = cal_component_get_vtype (comp);
-
- if (delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view))) {
- const char *uid;
-
- if (itip_organizer_is_user (comp, cal_view->priv->client)
- && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (cal_view),
- cal_view->priv->client,
- comp, TRUE))
- itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp,
- cal_view->priv->client, NULL);
-
- cal_component_get_uid (comp, &uid);
-
- delete_error_dialog (
- cal_client_remove_object (cal_view->priv->client, uid), CAL_COMPONENT_EVENT);
- }
-}
-
-
static void
on_delete_appointment (GtkWidget *widget, gpointer user_data)
{
ECalView *cal_view;
- GList *selected;
cal_view = E_CAL_VIEW (user_data);
-
- selected = e_cal_view_get_selected_events (cal_view);
- if (selected) {
- e_cal_view_delete_event_internal (cal_view, CAL_COMPONENT (selected->data));
- g_list_free (selected);
- }
+ e_cal_view_delete_selected_event (cal_view);
}
static void
diff --git a/calendar/gui/e-cal-view.h b/calendar/gui/e-cal-view.h
index 28079831d0..4f71669080 100644
--- a/calendar/gui/e-cal-view.h
+++ b/calendar/gui/e-cal-view.h
@@ -37,6 +37,16 @@ G_BEGIN_DECLS
#define E_CAL_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_view_get_type (), ECalViewClass)
#define E_IS_CAL_VIEW(obj) GTK_CHECK_TYPE (obj, e_cal_view_get_type ())
+typedef enum {
+ E_CAL_VIEW_POS_OUTSIDE,
+ E_CAL_VIEW_POS_NONE,
+ E_CAL_VIEW_POS_EVENT,
+ E_CAL_VIEW_POS_LEFT_EDGE,
+ E_CAL_VIEW_POS_RIGHT_EDGE,
+ E_CAL_VIEW_POS_TOP_EDGE,
+ E_CAL_VIEW_POS_BOTTOM_EDGE
+} ECalViewPosition;
+
typedef struct _ECalView ECalView;
typedef struct _ECalViewClass ECalViewClass;
typedef struct _ECalViewPrivate ECalViewPrivate;
@@ -80,7 +90,8 @@ void e_cal_view_update_query (ECalView *cal_view);
void e_cal_view_cut_clipboard (ECalView *cal_view);
void e_cal_view_copy_clipboard (ECalView *cal_view);
void e_cal_view_paste_clipboard (ECalView *cal_view);
-void e_cal_view_delete_event_internal (ECalView *cal_view, CalComponent *comp);
+void e_cal_view_delete_selected_event (ECalView *cal_view);
+void e_cal_view_delete_selected_events (ECalView *cal_view);
GtkMenu *e_cal_view_create_popup_menu (ECalView *cal_view);
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index fd499ffc6a..6c352270af 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -576,6 +576,64 @@ e_cal_view_paste_clipboard (ECalView *cal_view)
}
static void
+delete_event (ECalView *cal_view, CalComponent *comp)
+{
+ CalComponentVType vtype;
+
+ vtype = cal_component_get_vtype (comp);
+
+ if (delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view))) {
+ const char *uid;
+
+ if (itip_organizer_is_user (comp, cal_view->priv->client)
+ && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (cal_view),
+ cal_view->priv->client,
+ comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp,
+ cal_view->priv->client, NULL);
+
+ cal_component_get_uid (comp, &uid);
+
+ delete_error_dialog (
+ cal_client_remove_object (cal_view->priv->client, uid), CAL_COMPONENT_EVENT);
+ }
+}
+
+void
+e_cal_view_delete_selected_event (ECalView *cal_view)
+{
+ GList *selected;
+ CalComponent *comp;
+
+ selected = e_cal_view_get_selected_events (cal_view);
+ if (!selected)
+ return;
+
+ comp = CAL_COMPONENT (selected->data);
+ delete_event (cal_view, comp);
+
+ g_list_free (selected);
+}
+
+void
+e_cal_view_delete_selected_events (ECalView *cal_view)
+{
+ GList *selected, *l;
+ CalComponent *comp;
+
+ selected = e_cal_view_get_selected_events (cal_view);
+ if (!selected)
+ return;
+
+ for (l = selected; l != NULL; l = l->next) {
+ comp = CAL_COMPONENT (l->data);
+ delete_event (cal_view, comp);
+ }
+
+ g_list_free (selected);
+}
+
+static void
on_new_appointment (GtkWidget *widget, gpointer user_data)
{
time_t dtstart, dtend;
@@ -797,44 +855,13 @@ on_settings (GtkWidget *widget, gpointer user_data)
control_util_show_settings (cal_view->priv->calendar);
}
-void
-e_cal_view_delete_event_internal (ECalView *cal_view, CalComponent *comp)
-{
- CalComponentVType vtype;
-
- vtype = cal_component_get_vtype (comp);
-
- if (delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view))) {
- const char *uid;
-
- if (itip_organizer_is_user (comp, cal_view->priv->client)
- && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (cal_view),
- cal_view->priv->client,
- comp, TRUE))
- itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp,
- cal_view->priv->client, NULL);
-
- cal_component_get_uid (comp, &uid);
-
- delete_error_dialog (
- cal_client_remove_object (cal_view->priv->client, uid), CAL_COMPONENT_EVENT);
- }
-}
-
-
static void
on_delete_appointment (GtkWidget *widget, gpointer user_data)
{
ECalView *cal_view;
- GList *selected;
cal_view = E_CAL_VIEW (user_data);
-
- selected = e_cal_view_get_selected_events (cal_view);
- if (selected) {
- e_cal_view_delete_event_internal (cal_view, CAL_COMPONENT (selected->data));
- g_list_free (selected);
- }
+ e_cal_view_delete_selected_event (cal_view);
}
static void
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index 28079831d0..4f71669080 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -37,6 +37,16 @@ G_BEGIN_DECLS
#define E_CAL_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_view_get_type (), ECalViewClass)
#define E_IS_CAL_VIEW(obj) GTK_CHECK_TYPE (obj, e_cal_view_get_type ())
+typedef enum {
+ E_CAL_VIEW_POS_OUTSIDE,
+ E_CAL_VIEW_POS_NONE,
+ E_CAL_VIEW_POS_EVENT,
+ E_CAL_VIEW_POS_LEFT_EDGE,
+ E_CAL_VIEW_POS_RIGHT_EDGE,
+ E_CAL_VIEW_POS_TOP_EDGE,
+ E_CAL_VIEW_POS_BOTTOM_EDGE
+} ECalViewPosition;
+
typedef struct _ECalView ECalView;
typedef struct _ECalViewClass ECalViewClass;
typedef struct _ECalViewPrivate ECalViewPrivate;
@@ -80,7 +90,8 @@ void e_cal_view_update_query (ECalView *cal_view);
void e_cal_view_cut_clipboard (ECalView *cal_view);
void e_cal_view_copy_clipboard (ECalView *cal_view);
void e_cal_view_paste_clipboard (ECalView *cal_view);
-void e_cal_view_delete_event_internal (ECalView *cal_view, CalComponent *comp);
+void e_cal_view_delete_selected_event (ECalView *cal_view);
+void e_cal_view_delete_selected_events (ECalView *cal_view);
GtkMenu *e_cal_view_create_popup_menu (ECalView *cal_view);
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index 56be20e1be..698f702c86 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -511,12 +511,12 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
bar_y2 = event->end_minute * day_view->row_height / day_view->mins_per_row - y;
/* When an item is being resized, we fill the bar up to the new row. */
- if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE
&& day_view->resize_event_day == day
&& day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_TOP_EDGE)
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_TOP_EDGE)
bar_y1 = item_y + 1;
- else if (day_view->resize_drag_pos == E_DAY_VIEW_POS_BOTTOM_EDGE)
+ else if (day_view->resize_drag_pos == E_CAL_VIEW_POS_BOTTOM_EDGE)
bar_y2 = item_y + item_h - 1;
}
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index 1277f95221..298998b7db 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -394,13 +394,13 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
/* When resizing we don't draw the triangles.*/
draw_start_triangle = TRUE;
draw_end_triangle = TRUE;
- if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE
&& day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
&& day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_LEFT_EDGE)
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_LEFT_EDGE)
draw_start_triangle = FALSE;
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_RIGHT_EDGE)
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_RIGHT_EDGE)
draw_end_triangle = FALSE;
}
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index d1586dd902..790594e0a0 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -231,27 +231,27 @@ static void e_day_view_abort_resize (EDayView *day_view,
static gboolean e_day_view_on_long_event_button_press (EDayView *day_view,
gint event_num,
GdkEventButton *event,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y);
static gboolean e_day_view_on_event_button_press (EDayView *day_view,
gint day,
gint event_num,
GdkEventButton *event,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y);
static void e_day_view_on_long_event_click (EDayView *day_view,
gint event_num,
GdkEventButton *bevent,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y);
static void e_day_view_on_event_click (EDayView *day_view,
gint day,
gint event_num,
GdkEventButton *event,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y);
static void e_day_view_on_event_double_click (EDayView *day_view,
@@ -272,12 +272,12 @@ static void e_day_view_recalc_day_starts (EDayView *day_view,
static void e_day_view_recalc_num_rows (EDayView *day_view);
static void e_day_view_recalc_cell_sizes (EDayView *day_view);
-static EDayViewPosition e_day_view_convert_position_in_top_canvas (EDayView *day_view,
+static ECalViewPosition e_day_view_convert_position_in_top_canvas (EDayView *day_view,
gint x,
gint y,
gint *day_return,
gint *event_num_return);
-static EDayViewPosition e_day_view_convert_position_in_main_canvas (EDayView *day_view,
+static ECalViewPosition e_day_view_convert_position_in_main_canvas (EDayView *day_view,
gint x,
gint y,
gint *day_return,
@@ -551,7 +551,7 @@ e_day_view_init (EDayView *day_view)
day_view->selection_drag_pos = E_DAY_VIEW_DRAG_END;
day_view->selection_in_top_canvas = FALSE;
- day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
+ day_view->resize_drag_pos = E_CAL_VIEW_POS_NONE;
day_view->pressed_event_day = -1;
@@ -2724,7 +2724,7 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
EDayView *day_view)
{
gint event_x, event_y, day, event_num;
- EDayViewPosition pos;
+ ECalViewPosition pos;
/* Convert the coords to the main canvas window, or return if the
window is not found. */
@@ -2737,10 +2737,10 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
event_x, event_y,
&day, &event_num);
- if (pos == E_DAY_VIEW_POS_OUTSIDE)
+ if (pos == E_CAL_VIEW_POS_OUTSIDE)
return FALSE;
- if (pos != E_DAY_VIEW_POS_NONE)
+ if (pos != E_CAL_VIEW_POS_NONE)
return e_day_view_on_long_event_button_press (day_view,
event_num,
event, pos,
@@ -2841,7 +2841,7 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
EDayView *day_view)
{
gint event_x, event_y, row, day, event_num;
- EDayViewPosition pos;
+ ECalViewPosition pos;
#if 0
g_print ("In e_day_view_on_main_canvas_button_press\n");
@@ -2860,10 +2860,10 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
&day, &row,
&event_num);
- if (pos == E_DAY_VIEW_POS_OUTSIDE)
+ if (pos == E_CAL_VIEW_POS_OUTSIDE)
return FALSE;
- if (pos != E_DAY_VIEW_POS_NONE)
+ if (pos != E_CAL_VIEW_POS_NONE)
return e_day_view_on_event_button_press (day_view, day,
event_num, event, pos,
event_x, event_y);
@@ -2966,7 +2966,7 @@ static gboolean
e_day_view_on_long_event_button_press (EDayView *day_view,
gint event_num,
GdkEventButton *event,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y)
{
@@ -3015,7 +3015,7 @@ e_day_view_on_event_button_press (EDayView *day_view,
gint day,
gint event_num,
GdkEventButton *event,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y)
{
@@ -3063,7 +3063,7 @@ static void
e_day_view_on_long_event_click (EDayView *day_view,
gint event_num,
GdkEventButton *bevent,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y)
{
@@ -3075,13 +3075,13 @@ e_day_view_on_long_event_click (EDayView *day_view,
event_num);
/* Ignore clicks on the EText while editing. */
- if (pos == E_DAY_VIEW_POS_EVENT
+ if (pos == E_CAL_VIEW_POS_EVENT
&& E_TEXT (event->canvas_item)->editing)
return;
if ((cal_component_is_instance (event->comp) || !cal_component_has_recurrences (event->comp))
- && (pos == E_DAY_VIEW_POS_LEFT_EDGE
- || pos == E_DAY_VIEW_POS_RIGHT_EDGE)) {
+ && (pos == E_CAL_VIEW_POS_LEFT_EDGE
+ || pos == E_CAL_VIEW_POS_RIGHT_EDGE)) {
gboolean destroyed;
if (!e_day_view_find_long_event_days (event,
@@ -3148,7 +3148,7 @@ e_day_view_on_event_click (EDayView *day_view,
gint day,
gint event_num,
GdkEventButton *bevent,
- EDayViewPosition pos,
+ ECalViewPosition pos,
gint event_x,
gint event_y)
{
@@ -3159,13 +3159,13 @@ e_day_view_on_event_click (EDayView *day_view,
event_num);
/* Ignore clicks on the EText while editing. */
- if (pos == E_DAY_VIEW_POS_EVENT
+ if (pos == E_CAL_VIEW_POS_EVENT
&& E_TEXT (event->canvas_item)->editing)
return;
if ((cal_component_is_instance (event->comp) || !cal_component_has_recurrences (event->comp))
- && (pos == E_DAY_VIEW_POS_TOP_EDGE
- || pos == E_DAY_VIEW_POS_BOTTOM_EDGE)) {
+ && (pos == E_CAL_VIEW_POS_TOP_EDGE
+ || pos == E_CAL_VIEW_POS_BOTTOM_EDGE)) {
gboolean destroyed;
destroyed = FALSE;
@@ -3241,7 +3241,7 @@ e_day_view_reshape_resize_long_event_rect_item (EDayView *day_view)
/* If we're not resizing an event, or the event is not shown,
hide the resize bars. */
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_NONE
|| !e_day_view_get_long_event_position (day_view, event_num,
&start_day, &end_day,
&item_x, &item_y,
@@ -3277,7 +3277,7 @@ e_day_view_reshape_resize_rect_item (EDayView *day_view)
/* If we're not resizing an event, or the event is not shown,
hide the resize bars. */
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_NONE
|| !e_day_view_get_event_position (day_view, day, event_num,
&item_x, &item_y,
&item_w, &item_h)) {
@@ -3459,28 +3459,6 @@ e_day_view_on_event_right_click (EDayView *day_view,
day, event_num);
}
-void
-e_day_view_delete_event (EDayView *day_view)
-{
- EDayViewEvent *event;
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- if (day_view->editing_event_day == -1)
- return;
-
- if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent,
- day_view->editing_event_num);
- else
- event = &g_array_index (day_view->events[day_view->editing_event_day],
- EDayViewEvent,
- day_view->editing_event_num);
-
- e_cal_view_delete_event_internal (day_view, event->comp);
-}
-
static void
e_day_view_delete_occurrence_internal (EDayView *day_view, EDayViewEvent *event)
{
@@ -3616,7 +3594,7 @@ e_day_view_on_top_canvas_button_release (GtkWidget *widget,
if (day_view->selection_is_being_dragged) {
gdk_pointer_ungrab (event->time);
e_day_view_finish_selection (day_view);
- } else if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE) {
+ } else if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
gdk_pointer_ungrab (event->time);
e_day_view_finish_long_event_resize (day_view);
} else if (day_view->pressed_event_day != -1) {
@@ -3645,7 +3623,7 @@ e_day_view_on_main_canvas_button_release (GtkWidget *widget,
gdk_pointer_ungrab (event->time);
e_day_view_finish_selection (day_view);
e_day_view_stop_auto_scroll (day_view);
- } else if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE) {
+ } else if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
gdk_pointer_ungrab (event->time);
e_day_view_finish_resize (day_view);
e_day_view_stop_auto_scroll (day_view);
@@ -3688,7 +3666,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
EDayView *day_view)
{
EDayViewEvent *event = NULL;
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint event_x, event_y, canvas_x, canvas_y;
gint day, event_num;
GdkCursor *cursor;
@@ -3717,8 +3695,8 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
if (day_view->selection_is_being_dragged) {
e_day_view_update_selection (day_view, day, -1);
return TRUE;
- } else if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE) {
- if (pos != E_DAY_VIEW_POS_OUTSIDE) {
+ } else if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
+ if (pos != E_CAL_VIEW_POS_OUTSIDE) {
e_day_view_update_long_event_resize (day_view, day);
return TRUE;
}
@@ -3758,8 +3736,8 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
/* Recurring events can't be resized. */
if (event && (cal_component_is_instance (event->comp) || !cal_component_has_recurrences (event->comp))) {
switch (pos) {
- case E_DAY_VIEW_POS_LEFT_EDGE:
- case E_DAY_VIEW_POS_RIGHT_EDGE:
+ case E_CAL_VIEW_POS_LEFT_EDGE:
+ case E_CAL_VIEW_POS_RIGHT_EDGE:
cursor = day_view->resize_width_cursor;
break;
default:
@@ -3785,7 +3763,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
EDayView *day_view)
{
EDayViewEvent *event = NULL;
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint event_x, event_y, canvas_x, canvas_y;
gint row, day, event_num;
GdkCursor *cursor;
@@ -3813,14 +3791,14 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
event_num);
if (day_view->selection_is_being_dragged) {
- if (pos != E_DAY_VIEW_POS_OUTSIDE) {
+ if (pos != E_CAL_VIEW_POS_OUTSIDE) {
e_day_view_update_selection (day_view, day, row);
e_day_view_check_auto_scroll (day_view,
event_x, event_y);
return TRUE;
}
- } else if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE) {
- if (pos != E_DAY_VIEW_POS_OUTSIDE) {
+ } else if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
+ if (pos != E_CAL_VIEW_POS_OUTSIDE) {
e_day_view_update_resize (day_view, row);
e_day_view_check_auto_scroll (day_view,
event_x, event_y);
@@ -3862,11 +3840,11 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
/* Recurring events can't be resized. */
if (event && (cal_component_is_instance (event->comp) || !cal_component_has_recurrences (event->comp))) {
switch (pos) {
- case E_DAY_VIEW_POS_LEFT_EDGE:
+ case E_CAL_VIEW_POS_LEFT_EDGE:
cursor = day_view->move_cursor;
break;
- case E_DAY_VIEW_POS_TOP_EDGE:
- case E_DAY_VIEW_POS_BOTTOM_EDGE:
+ case E_CAL_VIEW_POS_TOP_EDGE:
+ case E_CAL_VIEW_POS_BOTTOM_EDGE:
cursor = day_view->resize_height_cursor;
break;
default:
@@ -4007,7 +3985,7 @@ e_day_view_update_long_event_resize (EDayView *day_view,
event = &g_array_index (day_view->long_events, EDayViewEvent,
event_num);
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_LEFT_EDGE) {
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_LEFT_EDGE) {
day = MIN (day, day_view->resize_end_row);
if (day != day_view->resize_start_row) {
need_reshape = TRUE;
@@ -4048,7 +4026,7 @@ e_day_view_update_resize (EDayView *day_view,
event = &g_array_index (day_view->events[day], EDayViewEvent,
event_num);
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_TOP_EDGE) {
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_TOP_EDGE) {
row = MIN (row, day_view->resize_end_row);
if (row != day_view->resize_start_row) {
need_reshape = TRUE;
@@ -4102,7 +4080,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
and end times. */
date.tzid = icaltimezone_get_tzid (day_view->zone);
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_LEFT_EDGE) {
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_LEFT_EDGE) {
dt = day_view->day_starts[day_view->resize_start_row];
*date.value = icaltime_from_timet_with_zone (dt, FALSE,
day_view->zone);
@@ -4140,7 +4118,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
- day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
+ day_view->resize_drag_pos = E_CAL_VIEW_POS_NONE;
g_object_unref (comp);
}
@@ -4176,7 +4154,7 @@ e_day_view_finish_resize (EDayView *day_view)
and end times. */
date.tzid = icaltimezone_get_tzid (day_view->zone);
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_TOP_EDGE) {
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_TOP_EDGE) {
dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_start_row);
*date.value = icaltime_from_timet_with_zone (dt, FALSE,
day_view->zone);
@@ -4197,7 +4175,7 @@ e_day_view_finish_resize (EDayView *day_view)
gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
- day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
+ day_view->resize_drag_pos = E_CAL_VIEW_POS_NONE;
if (cal_component_is_instance (comp)) {
CalObjModType mod;
@@ -4232,10 +4210,10 @@ e_day_view_abort_resize (EDayView *day_view,
{
gint day, event_num;
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_NONE)
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_NONE)
return;
- day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
+ day_view->resize_drag_pos = E_CAL_VIEW_POS_NONE;
gdk_pointer_ungrab (time);
day = day_view->resize_event_day;
@@ -4518,7 +4496,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
layout = pango_layout_new (pango_context);
- if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE
&& day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
&& day_view->resize_event_num == event_num)
show_icons = FALSE;
@@ -4676,7 +4654,7 @@ e_day_view_reshape_day_event (EDayView *day_view,
/* We don't show the icons while resizing, since we'd have to
draw them on top of the resize rect. */
num_icons = 0;
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_NONE
|| day_view->resize_event_day != day
|| day_view->resize_event_num != event_num) {
GSList *categories_list, *elem;
@@ -4874,7 +4852,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
return TRUE;
/* The Escape key aborts a resize operation. */
- if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE) {
+ if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
if (keyval == GDK_Escape) {
e_day_view_abort_resize (day_view, event->time);
}
@@ -5991,7 +5969,7 @@ static gboolean
e_day_view_auto_scroll_handler (gpointer data)
{
EDayView *day_view;
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint scroll_x, scroll_y, new_scroll_y, canvas_x, canvas_y, row, day;
GtkAdjustment *adj;
@@ -6053,10 +6031,10 @@ e_day_view_auto_scroll_handler (gpointer data)
if (day_view->last_mouse_x == -1)
day = -1;
- if (pos != E_DAY_VIEW_POS_OUTSIDE) {
+ if (pos != E_CAL_VIEW_POS_OUTSIDE) {
if (day_view->selection_is_being_dragged) {
e_day_view_update_selection (day_view, day, row);
- } else if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE) {
+ } else if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
e_day_view_update_resize (day_view, row);
} else if (day_view->drag_item->object.flags
& GNOME_CANVAS_ITEM_VISIBLE) {
@@ -6124,12 +6102,12 @@ e_day_view_get_event_position (EDayView *day_view,
return FALSE;
/* If the event is being resize, use the resize position. */
- if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE
&& day_view->resize_event_day == day
&& day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_TOP_EDGE)
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_TOP_EDGE)
start_row = day_view->resize_start_row;
- else if (day_view->resize_drag_pos == E_DAY_VIEW_POS_BOTTOM_EDGE)
+ else if (day_view->resize_drag_pos == E_CAL_VIEW_POS_BOTTOM_EDGE)
end_row = day_view->resize_end_row;
}
@@ -6177,12 +6155,12 @@ e_day_view_get_long_event_position (EDayView *day_view,
return FALSE;
/* If the event is being resize, use the resize position. */
- if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
+ if (day_view->resize_drag_pos != E_CAL_VIEW_POS_NONE
&& day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
&& day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_DAY_VIEW_POS_LEFT_EDGE)
+ if (day_view->resize_drag_pos == E_CAL_VIEW_POS_LEFT_EDGE)
*start_day = day_view->resize_start_row;
- else if (day_view->resize_drag_pos == E_DAY_VIEW_POS_RIGHT_EDGE)
+ else if (day_view->resize_drag_pos == E_CAL_VIEW_POS_RIGHT_EDGE)
*end_day = day_view->resize_end_row;
}
@@ -6199,7 +6177,7 @@ e_day_view_get_long_event_position (EDayView *day_view,
/* Converts a position within the entire top canvas to a day & event and
a place within the event if appropriate. If event_num_return is NULL, it
simply returns the grid position without trying to find the event. */
-static EDayViewPosition
+static ECalViewPosition
e_day_view_convert_position_in_top_canvas (EDayView *day_view,
gint x,
gint y,
@@ -6215,7 +6193,7 @@ e_day_view_convert_position_in_top_canvas (EDayView *day_view,
*event_num_return = -1;
if (x < 0 || y < 0)
- return E_DAY_VIEW_POS_OUTSIDE;
+ return E_CAL_VIEW_POS_OUTSIDE;
row = y / day_view->top_row_height - 1;
@@ -6227,13 +6205,13 @@ e_day_view_convert_position_in_top_canvas (EDayView *day_view,
}
}
if (day == -1)
- return E_DAY_VIEW_POS_OUTSIDE;
+ return E_CAL_VIEW_POS_OUTSIDE;
*day_return = day;
/* If only the grid position is wanted, return. */
if (event_num_return == NULL)
- return E_DAY_VIEW_POS_NONE;
+ return E_CAL_VIEW_POS_NONE;
for (event_num = 0; event_num < day_view->long_events->len;
event_num++) {
@@ -6259,23 +6237,23 @@ e_day_view_convert_position_in_top_canvas (EDayView *day_view,
if (x < item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH
+ E_DAY_VIEW_LONG_EVENT_X_PAD)
- return E_DAY_VIEW_POS_LEFT_EDGE;
+ return E_CAL_VIEW_POS_LEFT_EDGE;
if (x >= item_x + item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH
- E_DAY_VIEW_LONG_EVENT_X_PAD)
- return E_DAY_VIEW_POS_RIGHT_EDGE;
+ return E_CAL_VIEW_POS_RIGHT_EDGE;
- return E_DAY_VIEW_POS_EVENT;
+ return E_CAL_VIEW_POS_EVENT;
}
- return E_DAY_VIEW_POS_NONE;
+ return E_CAL_VIEW_POS_NONE;
}
/* Converts a position within the entire main canvas to a day, row, event and
a place within the event if appropriate. If event_num_return is NULL, it
simply returns the grid position without trying to find the event. */
-static EDayViewPosition
+static ECalViewPosition
e_day_view_convert_position_in_main_canvas (EDayView *day_view,
gint x,
gint y,
@@ -6298,11 +6276,11 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view,
/* Check the position is inside the canvas, and determine the day
and row. */
if (x < 0 || y < 0)
- return E_DAY_VIEW_POS_OUTSIDE;
+ return E_CAL_VIEW_POS_OUTSIDE;
row = y / day_view->row_height;
if (row >= day_view->rows)
- return E_DAY_VIEW_POS_OUTSIDE;
+ return E_CAL_VIEW_POS_OUTSIDE;
day = -1;
for (col = 1; col <= day_view->days_shown; col++) {
@@ -6312,14 +6290,14 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view,
}
}
if (day == -1)
- return E_DAY_VIEW_POS_OUTSIDE;
+ return E_CAL_VIEW_POS_OUTSIDE;
*day_return = day;
*row_return = row;
/* If only the grid position is wanted, return. */
if (event_num_return == NULL)
- return E_DAY_VIEW_POS_NONE;
+ return E_CAL_VIEW_POS_NONE;
/* Check the selected item first, since the horizontal resizing bars
may be above other events. */
@@ -6332,10 +6310,10 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view,
*event_num_return = day_view->resize_bars_event_num;
if (y >= item_y - E_DAY_VIEW_BAR_HEIGHT
&& y < item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT)
- return E_DAY_VIEW_POS_TOP_EDGE;
+ return E_CAL_VIEW_POS_TOP_EDGE;
if (y >= item_y + item_h - E_DAY_VIEW_EVENT_BORDER_HEIGHT
&& y < item_y + item_h + E_DAY_VIEW_BAR_HEIGHT)
- return E_DAY_VIEW_POS_BOTTOM_EDGE;
+ return E_CAL_VIEW_POS_BOTTOM_EDGE;
}
}
}
@@ -6356,20 +6334,20 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view,
*event_num_return = event_num;
if (x < item_x + E_DAY_VIEW_BAR_WIDTH)
- return E_DAY_VIEW_POS_LEFT_EDGE;
+ return E_CAL_VIEW_POS_LEFT_EDGE;
if (y < item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT
+ E_DAY_VIEW_EVENT_Y_PAD)
- return E_DAY_VIEW_POS_TOP_EDGE;
+ return E_CAL_VIEW_POS_TOP_EDGE;
if (y >= item_y + item_h - E_DAY_VIEW_EVENT_BORDER_HEIGHT
- E_DAY_VIEW_EVENT_Y_PAD)
- return E_DAY_VIEW_POS_BOTTOM_EDGE;
+ return E_CAL_VIEW_POS_BOTTOM_EDGE;
- return E_DAY_VIEW_POS_EVENT;
+ return E_CAL_VIEW_POS_EVENT;
}
- return E_DAY_VIEW_POS_NONE;
+ return E_CAL_VIEW_POS_NONE;
}
@@ -6397,7 +6375,7 @@ e_day_view_on_top_canvas_drag_motion (GtkWidget *widget,
static void
e_day_view_reshape_top_canvas_drag_item (EDayView *day_view)
{
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint x, y, day;
/* Calculate the day & start row of the event being dragged, using
@@ -6407,7 +6385,7 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view)
pos = e_day_view_convert_position_in_top_canvas (day_view, x, y,
&day, NULL);
/* This shouldn't really happen in a drag. */
- if (pos == E_DAY_VIEW_POS_OUTSIDE)
+ if (pos == E_CAL_VIEW_POS_OUTSIDE)
return;
if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT)
@@ -6544,7 +6522,7 @@ e_day_view_on_main_canvas_drag_motion (GtkWidget *widget,
static void
e_day_view_reshape_main_canvas_drag_item (EDayView *day_view)
{
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint x, y, day, row;
/* Calculate the day & start row of the event being dragged, using
@@ -6554,7 +6532,7 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view)
pos = e_day_view_convert_position_in_main_canvas (day_view, x, y,
&day, &row, NULL);
/* This shouldn't really happen in a drag. */
- if (pos == E_DAY_VIEW_POS_OUTSIDE)
+ if (pos == E_CAL_VIEW_POS_OUTSIDE)
return;
if (day_view->drag_event_day != -1
@@ -6841,7 +6819,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
EDayView *day_view)
{
EDayViewEvent *event=NULL;
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint day, start_day, end_day, num_days;
gint start_offset, end_offset;
gchar *event_uid;
@@ -6860,7 +6838,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
pos = e_day_view_convert_position_in_top_canvas (day_view,
x, y, &day,
NULL);
- if (pos != E_DAY_VIEW_POS_OUTSIDE) {
+ if (pos != E_CAL_VIEW_POS_OUTSIDE) {
const char *uid;
num_days = 1;
start_offset = 0;
@@ -6997,7 +6975,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
EDayView *day_view)
{
EDayViewEvent *event = NULL;
- EDayViewPosition pos;
+ ECalViewPosition pos;
gint day, row, start_row, end_row, num_rows, scroll_x, scroll_y;
gint start_offset, end_offset;
gchar *event_uid;
@@ -7020,7 +6998,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
pos = e_day_view_convert_position_in_main_canvas (day_view,
x, y, &day,
&row, NULL);
- if (pos != E_DAY_VIEW_POS_OUTSIDE) {
+ if (pos != E_CAL_VIEW_POS_OUTSIDE) {
const char *uid;
num_rows = 1;
start_offset = 0;
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
index c56d25a4ca..2738c0c5e0 100644
--- a/calendar/gui/e-day-view.h
+++ b/calendar/gui/e-day-view.h
@@ -167,18 +167,6 @@ typedef enum
E_DAY_VIEW_DRAG_END
} EDayViewDragPosition;
-/* Specifies the position of the mouse. */
-typedef enum
-{
- E_DAY_VIEW_POS_OUTSIDE,
- E_DAY_VIEW_POS_NONE,
- E_DAY_VIEW_POS_EVENT,
- E_DAY_VIEW_POS_LEFT_EDGE,
- E_DAY_VIEW_POS_RIGHT_EDGE,
- E_DAY_VIEW_POS_TOP_EDGE,
- E_DAY_VIEW_POS_BOTTOM_EDGE
-} EDayViewPosition;
-
typedef struct _EDayViewEvent EDayViewEvent;
struct _EDayViewEvent {
CalComponent *comp;
@@ -444,7 +432,7 @@ struct _EDayView
/* These are used when resizing events. */
gint resize_event_day;
gint resize_event_num;
- EDayViewPosition resize_drag_pos;
+ ECalViewPosition resize_drag_pos;
gint resize_start_row;
gint resize_end_row;
@@ -566,7 +554,6 @@ void e_day_view_set_timezone (EDayView *day_view,
icaltimezone *zone);
-void e_day_view_delete_event (EDayView *day_view);
void e_day_view_delete_occurrence (EDayView *day_view);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 741ec913f5..37318141a9 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -84,7 +84,7 @@ static gboolean e_week_view_event_item_button_release (EWeekViewEventItem *wveit
GdkEvent *event);
static gboolean e_week_view_event_item_double_click (EWeekViewEventItem *wveitem,
GdkEvent *bevent);
-static EWeekViewPosition e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
+static ECalViewPosition e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
gdouble x,
gdouble y);
@@ -756,7 +756,7 @@ e_week_view_event_item_button_press (EWeekViewEventItem *wveitem,
GdkEvent *bevent)
{
EWeekView *week_view;
- EWeekViewPosition pos;
+ ECalViewPosition pos;
EWeekViewEvent *event;
EWeekViewEventSpan *span;
GnomeCanvasItem *item;
@@ -777,7 +777,7 @@ e_week_view_event_item_button_press (EWeekViewEventItem *wveitem,
pos = e_week_view_event_item_get_position (wveitem, bevent->button.x,
bevent->button.y);
- if (pos == E_WEEK_VIEW_POS_NONE)
+ if (pos == E_CAL_VIEW_POS_NONE)
return FALSE;
if (bevent->button.button == 1) {
@@ -878,7 +878,7 @@ e_week_view_event_item_double_click (EWeekViewEventItem *wveitem,
}
-static EWeekViewPosition
+static ECalViewPosition
e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
gdouble x,
gdouble y)
@@ -889,7 +889,7 @@ e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
item = GNOME_CANVAS_ITEM (wveitem);
week_view = E_WEEK_VIEW (GTK_WIDGET (item->canvas)->parent);
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), E_WEEK_VIEW_POS_NONE);
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), E_CAL_VIEW_POS_NONE);
#if 0
g_print ("In e_week_view_event_item_get_position item: %g,%g %g,%g point: %g,%g\n", item->x1, item->y1, item->x2, item->y2, x, y);
@@ -897,20 +897,20 @@ e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD
|| x >= item->x2 - E_WEEK_VIEW_EVENT_R_PAD)
- return E_WEEK_VIEW_POS_NONE;
+ return E_CAL_VIEW_POS_NONE;
/* Support left/right edge for long events only. */
if (!e_week_view_is_one_day_event (week_view, wveitem->event_num)) {
if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD
+ E_WEEK_VIEW_EVENT_BORDER_WIDTH
+ E_WEEK_VIEW_EVENT_EDGE_X_PAD)
- return E_WEEK_VIEW_POS_LEFT_EDGE;
+ return E_CAL_VIEW_POS_LEFT_EDGE;
if (x >= item->x2 + 1 - E_WEEK_VIEW_EVENT_R_PAD
- E_WEEK_VIEW_EVENT_BORDER_WIDTH
- E_WEEK_VIEW_EVENT_EDGE_X_PAD)
- return E_WEEK_VIEW_POS_RIGHT_EDGE;
+ return E_CAL_VIEW_POS_RIGHT_EDGE;
}
- return E_WEEK_VIEW_POS_EVENT;
+ return E_CAL_VIEW_POS_EVENT;
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 81b6fe53ba..0065a00123 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -3307,7 +3307,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
/* The Escape key aborts a resize operation. */
#if 0
- if (week_view->resize_drag_pos != E_WEEK_VIEW_POS_NONE) {
+ if (week_view->resize_drag_pos != E_CAL_VIEW_POS_NONE) {
if (event->keyval == GDK_Escape) {
e_week_view_abort_resize (week_view, event->time);
}
@@ -3409,23 +3409,6 @@ e_week_view_popup_menu (GtkWidget *widget)
return TRUE;
}
-void
-e_week_view_delete_event (EWeekView *week_view)
-{
- EWeekViewEvent *event;
-
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
-
- if (week_view->editing_event_num == -1)
- return;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, week_view->editing_event_num);
- if (!event)
- return;
- e_cal_view_delete_event_internal (week_view, event->comp);
-}
-
-
static void
e_week_view_delete_occurrence_internal (EWeekView *week_view, gint event_num)
{
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index ffe31ffea5..0d071a7d1f 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -132,17 +132,6 @@ typedef enum
E_WEEK_VIEW_TIME_BOTH_SMALL_MIN
} EWeekViewTimeFormat;
-/* Specifies the position of the mouse. */
-typedef enum
-{
- E_WEEK_VIEW_POS_OUTSIDE,
- E_WEEK_VIEW_POS_NONE,
- E_WEEK_VIEW_POS_EVENT,
- E_WEEK_VIEW_POS_LEFT_EDGE,
- E_WEEK_VIEW_POS_RIGHT_EDGE
-} EWeekViewPosition;
-
-
typedef struct _EWeekViewEventSpan EWeekViewEventSpan;
struct _EWeekViewEventSpan {
guint start_day : 6;
@@ -420,7 +409,6 @@ icaltimezone* e_week_view_get_timezone (EWeekView *week_view);
void e_week_view_set_timezone (EWeekView *week_view,
icaltimezone *zone);
-void e_week_view_delete_event (EWeekView *week_view);
void e_week_view_delete_occurrence (EWeekView *week_view);
/* Returns the number of selected events (0 or 1 at present). */
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index c16651f9cb..ee4efe44e5 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -2919,10 +2919,7 @@ gnome_calendar_delete_selection (GnomeCalendar *gcal)
if (location == FOCUS_CALENDAR) {
view = gnome_calendar_get_current_view_widget (gcal);
- if (E_IS_DAY_VIEW (view))
- e_day_view_delete_event (E_DAY_VIEW (view));
- else
- e_week_view_delete_event (E_WEEK_VIEW (view));
+ e_cal_view_delete_selected_events (E_CAL_VIEW (view));
} else if (location == FOCUS_TASKPAD)
e_calendar_table_delete_selected (E_CALENDAR_TABLE (priv->todo));
else