605
get_selection_colors (GtkWidget *widget, GdkColor **text, GdkColor **base)
605
get_selection_colors (GtkWidget *widget, GdkColor *text, GdkColor *base)
607
GtkStyle *style = gtk_widget_get_style (widget);
609
if (gtk_widget_has_focus (widget)) {
610
*text = &style->text [GTK_STATE_SELECTED];
611
*base = &style->base [GTK_STATE_SELECTED];
613
*text = &style->text [GTK_STATE_ACTIVE];
614
*base = &style->base [GTK_STATE_ACTIVE];
607
GtkStyleContext *context = gtk_widget_get_style_context (widget);
608
GtkStateFlags state = 0;
611
state |= gtk_widget_has_focus (widget) ? GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE;
613
gtk_style_context_get_color (context, state, &fg);
615
text->red = CLAMP ((guint) (fg.red * 65535), 0, 65535);
616
text->green = CLAMP ((guint) (fg.green * 65535), 0, 65535);
617
text->blue = CLAMP ((guint) (fg.blue * 65535), 0, 65535);
619
gtk_style_context_get_background_color (context, state, &bg);
621
base->red = CLAMP ((guint) (bg.red * 65535), 0, 65535);
622
base->green = CLAMP ((guint) (bg.green * 65535), 0, 65535);
623
base->blue = CLAMP ((guint) (bg.blue * 65535), 0, 65535);
639
647
if (new_selection_surface_needed (pixbuf_cache, job_info, page, scale)) {
640
GdkColor *text, *base;
642
gtk_widget_ensure_style (pixbuf_cache->view);
643
650
get_selection_colors (pixbuf_cache->view, &text, &base);
644
651
ev_job_render_set_selection_info (EV_JOB_RENDER (job_info->job),
645
652
&(job_info->target_points),
646
653
job_info->selection_style,
650
657
g_signal_connect (job_info->job, "finished",
977
984
rc, job_info->selection_style,
978
985
&(job_info->target_points));
980
gtk_widget_ensure_style (pixbuf_cache->view);
982
987
get_selection_colors (pixbuf_cache->view, &text, &base);
984
989
ev_selection_render_selection (EV_SELECTION (pixbuf_cache->document),
986
991
&(job_info->target_points),
988
993
job_info->selection_style,
990
995
job_info->selection_points = job_info->target_points;
991
996
g_object_unref (rc);
992
997
ev_document_doc_mutex_unlock ();