+}
+
+static gboolean
+off_item_button_press_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ struct psppire_output_view *view)
+{
+ /* buttontime is set by button_press_event_cb
+ If our event->time is equal to the time from the
+ button_press_event_cb, then we handle the same event.
+ In that case we must not clear the selection because
+ it was just set by button_press_event_cb from the item */
+ if (event->time != view->buttontime)
+ clear_selection (view);
+ return FALSE; /* Forward the event -> DragNDrop */
+}
+
+static gboolean
+button_press_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ struct psppire_output_view *view)
+{
+ view->buttontime = event->time;
+ clear_selection (view);
+ set_copy_action (view, TRUE);
+ gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_SELECTED, FALSE);
+ gtk_widget_queue_draw (widget);
+ return FALSE; /* Forward Event -> off_item will trigger */
+}
+
+static void
+drag_data_get_cb (GtkWidget *widget, GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint target_type, guint time,
+ struct psppire_output_view *view)
+{
+ view->selected_item = find_selected_item (view);
+ clipboard_get_cb (NULL, selection_data, target_type, view);
+}
+
+static void
+create_drawing_area (struct psppire_output_view *view,
+ GtkWidget *drawing_area, struct xr_rendering *r,
+ int tw, int th, const struct output_item *item)
+{
+ struct string_map options = STRING_MAP_INITIALIZER (options);
+ string_map_insert (&options, "transparent", "true");
+ string_map_insert (&options, "systemcolors", "true");
+ xr_rendering_apply_options (r, &options);