~ubuntu-branches/ubuntu/oneiric/evince/oneiric-updates

« back to all changes in this revision

Viewing changes to libview/ev-pixbuf-cache.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya, Josselin Mouette, Rodrigo Moya
  • Date: 2011-05-19 12:12:42 UTC
  • mfrom: (1.1.65 upstream) (1.3.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110519121242-967hbn2nh2hunp4y
Tags: 3.0.0-4ubuntu1
[ Josselin Mouette ]
* bug-presubj: please document where to report rendering bugs.
* evince.mime: dropped. We have desktop files to handle MIME 
  associations, no need to maintain an alternate system by hand.
  Closes: #619564, #627027, #551734, #581441.

[ Rodrigo Moya ]
* Rebase from Debian and GNOME3 PPA (thanks to Rico Tzschichholz).
  Remaining Ubuntu changes:
* debian/apparmor-profile:
* debian/apparmor-profile.abstraction:
* debian/evince.apport:
* debian/evince-common.dirs:
* debian/evince-common.postinst:
* debian/evince-common.postrm:
  - Add apparmor profile
* debian/control:
  - Build-Depend on debhelper (>= 7.4.20ubuntu5), gnome-common,
    hardening-includes and liblaunchpad-integration-3.0-dev
  - Standards-Version is 3.9.1
  - Depend on apparmor
* debian/rules:
  - Include hardening.make
  - Add rule to install apparmor files
* debian/watch:
  - Watch unstable series
* debian/patches/01_lpi.patch:
  - Launchpad integration patch
* debian/patches/04_gold.patch:
  - Link against libz
* debian/patches/05_library-path.patch:
  - Fix library path for g-ir-scanner

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
}
603
603
 
604
604
static void
605
 
get_selection_colors (GtkWidget *widget, GdkColor **text, GdkColor **base)
 
605
get_selection_colors (GtkWidget *widget, GdkColor *text, GdkColor *base)
606
606
{
607
 
        GtkStyle *style = gtk_widget_get_style (widget);
608
 
 
609
 
        if (gtk_widget_has_focus (widget)) {
610
 
                *text = &style->text [GTK_STATE_SELECTED];
611
 
                *base = &style->base [GTK_STATE_SELECTED];
612
 
        } else {
613
 
                *text = &style->text [GTK_STATE_ACTIVE];
614
 
                *base = &style->base [GTK_STATE_ACTIVE];
615
 
        }
 
607
        GtkStyleContext *context = gtk_widget_get_style_context (widget);
 
608
        GtkStateFlags    state = 0;
 
609
        GdkRGBA          fg, bg;
 
610
 
 
611
        state |= gtk_widget_has_focus (widget) ? GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE;
 
612
 
 
613
        gtk_style_context_get_color (context, state, &fg);
 
614
        text->pixel = 0;
 
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);
 
618
 
 
619
        gtk_style_context_get_background_color (context, state, &bg);
 
620
        base->pixel = 0;
 
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);
616
624
}
617
625
 
618
626
static void
637
645
                                           width, height);
638
646
 
639
647
        if (new_selection_surface_needed (pixbuf_cache, job_info, page, scale)) {
640
 
                GdkColor *text, *base;
 
648
                GdkColor text, base;
641
649
 
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,
647
 
                                                  text, base);
 
654
                                                  &text, &base);
648
655
        }
649
656
 
650
657
        g_signal_connect (job_info->job, "finished",
952
959
         */
953
960
        if (ev_rect_cmp (&(job_info->target_points), &(job_info->selection_points))) {
954
961
                EvRectangle *old_points;
955
 
                GdkColor *text, *base;
 
962
                GdkColor text, base;
956
963
                EvRenderContext *rc;
957
964
                EvPage *ev_page;
958
965
 
977
984
                                                           rc, job_info->selection_style,
978
985
                                                           &(job_info->target_points));
979
986
 
980
 
                gtk_widget_ensure_style (pixbuf_cache->view);
981
 
 
982
987
                get_selection_colors (pixbuf_cache->view, &text, &base);
983
988
 
984
989
                ev_selection_render_selection (EV_SELECTION (pixbuf_cache->document),
986
991
                                               &(job_info->target_points),
987
992
                                               old_points,
988
993
                                               job_info->selection_style,
989
 
                                               text, base);
 
994
                                               &text, &base);
990
995
                job_info->selection_points = job_info->target_points;
991
996
                g_object_unref (rc);
992
997
                ev_document_doc_mutex_unlock ();