-static void
-create_xr (struct psppire_output_view *view)
-{
- const GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (view->output));
- struct text_item *text_item;
- PangoFontDescription *font_desc;
- struct xr_rendering *r;
- char *font_name;
- int font_width;
- cairo_t *cr;
- gchar *fgc;
-
- cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET (view->output)));
-
- /* Set the widget's text color as the foreground color for the output driver */
- fgc = gdk_color_to_string (&style->text[gtk_widget_get_state (GTK_WIDGET (view->output))]);
-
- string_map_insert (&view->render_opts, "foreground-color", fgc);
- g_free (fgc);
-
- /* Use GTK+ default font as proportional font. */
- font_name = pango_font_description_to_string (style->font_desc);
- string_map_insert (&view->render_opts, "prop-font", font_name);
- g_free (font_name);
-
- /* Derived emphasized font from proportional font. */
- font_desc = pango_font_description_copy (style->font_desc);
- pango_font_description_set_style (font_desc, PANGO_STYLE_ITALIC);
- font_name = pango_font_description_to_string (font_desc);
- string_map_insert (&view->render_opts, "emph-font", font_name);
- g_free (font_name);
- pango_font_description_free (font_desc);
-
- /* Pretend that the "page" has a reasonable width and a very big length,
- so that most tables can be conveniently viewed on-screen with vertical
- scrolling only. (The length should not be increased very much because
- it is already close enough to INT_MAX when expressed as thousands of a
- point.) */
- string_map_insert_nocopy (&view->render_opts, xstrdup ("paper-size"),
- xasprintf ("%dx1000000pt", view->render_width));
- string_map_insert (&view->render_opts, "left-margin", "0");
- string_map_insert (&view->render_opts, "right-margin", "0");
- string_map_insert (&view->render_opts, "top-margin", "0");
- string_map_insert (&view->render_opts, "bottom-margin", "0");
-
- view->xr = xr_driver_create (cr, &view->render_opts);
-
- text_item = text_item_create (TEXT_ITEM_PARAGRAPH, "X");
- r = xr_rendering_create (view->xr, text_item_super (text_item), cr);
- xr_rendering_measure (r, &font_width, &view->font_height);
- /* xr_rendering_destroy (r); */
- text_item_unref (text_item);
+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 */
+}