- Replace deprecated gtk functions with their equivalents
- Remove unused patches
This commit is contained in:
parent
118c967316
commit
28b1cad990
284
evince-deprecated-functions.patch
Normal file
284
evince-deprecated-functions.patch
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
--- evince-2.29.91/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
|
||||||
|
+++ evince-2.29.91/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
|
||||||
|
@@ -315,7 +315,7 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
|
||||||
|
}
|
||||||
|
else if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)
|
||||||
|
{
|
||||||
|
- if (GTK_WIDGET_HAS_FOCUS (widget))
|
||||||
|
+ if (gtk_widget_has_focus (widget))
|
||||||
|
state = GTK_STATE_SELECTED;
|
||||||
|
else
|
||||||
|
state = GTK_STATE_ACTIVE;
|
||||||
|
--- evince-2.29.91/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
|
||||||
|
+++ evince-2.29.91/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
|
||||||
|
@@ -872,7 +872,7 @@ toolbar_visibility_refresh (EggEditableToolbar *etoolbar)
|
||||||
|
|
||||||
|
priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager);
|
||||||
|
|
||||||
|
- showing = GTK_WIDGET_VISIBLE (etoolbar);
|
||||||
|
+ showing = gtk_widget_get_visible (etoolbar);
|
||||||
|
|
||||||
|
n_toolbars = egg_toolbars_model_n_toolbars (priv->model);
|
||||||
|
for (i = 0; i < n_toolbars; i++)
|
||||||
|
@@ -954,7 +954,7 @@ toolbar_visibility_refresh (EggEditableToolbar *etoolbar)
|
||||||
|
gtk_action_set_visible (GTK_ACTION (action), (egg_toolbars_model_get_flags (priv->model, i)
|
||||||
|
& EGG_TB_MODEL_NOT_REMOVABLE) == 0);
|
||||||
|
gtk_action_set_sensitive (GTK_ACTION (action), showing);
|
||||||
|
- gtk_toggle_action_set_active (action, GTK_WIDGET_VISIBLE
|
||||||
|
+ gtk_toggle_action_set_active (action, gtk_widget_get_visible
|
||||||
|
(get_dock_nth (etoolbar, i)));
|
||||||
|
|
||||||
|
for (list = priv->visibility_paths; list != NULL; list = g_list_next (list))
|
||||||
|
--- evince-2.29.91/libmisc/ev-page-action.c
|
||||||
|
+++ evince-2.29.91/libmisc/ev-page-action.c
|
||||||
|
@@ -193,7 +193,7 @@ ev_page_action_grab_focus (EvPageAction *page_action)
|
||||||
|
|
||||||
|
proxy = EV_PAGE_ACTION_WIDGET (proxies->data);
|
||||||
|
|
||||||
|
- if (GTK_WIDGET_MAPPED (GTK_WIDGET (proxy)))
|
||||||
|
+ if (gtk_widget_get_mapped (GTK_WIDGET (proxy)))
|
||||||
|
ev_page_action_widget_grab_focus (proxy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--- evince-2.29.91/libview/ev-annotation-window.c
|
||||||
|
+++ evince-2.29.91/libview/ev-annotation-window.c
|
||||||
|
@@ -249,7 +249,7 @@ ev_annotation_window_set_resize_cursor (GtkWidget *widget,
|
||||||
|
if (!widget->window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- if (GTK_WIDGET_IS_SENSITIVE (widget)) {
|
||||||
|
+ if (gtk_widget_is_sensitive (widget)) {
|
||||||
|
GdkDisplay *display = gtk_widget_get_display (widget);
|
||||||
|
GdkCursor *cursor;
|
||||||
|
|
||||||
|
@@ -627,7 +627,7 @@ ev_annotation_window_grab_focus (EvAnnotationWindow *window)
|
||||||
|
{
|
||||||
|
g_return_if_fail (EV_IS_ANNOTATION_WINDOW (window));
|
||||||
|
|
||||||
|
- if (!GTK_WIDGET_HAS_FOCUS (window->text_view)) {
|
||||||
|
+ if (!gtk_widget_has_focus (window->text_view)) {
|
||||||
|
gtk_widget_grab_focus (GTK_WIDGET (window));
|
||||||
|
send_focus_change (window->text_view, TRUE);
|
||||||
|
}
|
||||||
|
@@ -638,7 +638,7 @@ ev_annotation_window_ungrab_focus (EvAnnotationWindow *window)
|
||||||
|
{
|
||||||
|
g_return_if_fail (EV_IS_ANNOTATION_WINDOW (window));
|
||||||
|
|
||||||
|
- if (GTK_WIDGET_HAS_FOCUS (window->text_view)) {
|
||||||
|
+ if (gtk_widget_has_focus (window->text_view)) {
|
||||||
|
send_focus_change (window->text_view, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
--- evince-2.29.91/libview/ev-pixbuf-cache.c
|
||||||
|
+++ evince-2.29.91/libview/ev-pixbuf-cache.c
|
||||||
|
@@ -479,7 +479,7 @@ ev_pixbuf_cache_clear_job_sizes (EvPixbufCache *pixbuf_cache,
|
||||||
|
static void
|
||||||
|
get_selection_colors (GtkWidget *widget, GdkColor **text, GdkColor **base)
|
||||||
|
{
|
||||||
|
- if (GTK_WIDGET_HAS_FOCUS (widget)) {
|
||||||
|
+ if (gtk_widget_has_focus (widget)) {
|
||||||
|
*text = &widget->style->text [GTK_STATE_SELECTED];
|
||||||
|
*base = &widget->style->base [GTK_STATE_SELECTED];
|
||||||
|
} else {
|
||||||
|
--- evince-2.29.91/libview/ev-view-presentation.c
|
||||||
|
+++ evince-2.29.91/libview/ev-view-presentation.c
|
||||||
|
@@ -830,7 +830,7 @@ ev_view_presentation_set_cursor (EvViewPresentation *pview,
|
||||||
|
return;
|
||||||
|
|
||||||
|
widget = GTK_WIDGET (pview);
|
||||||
|
- if (!GTK_WIDGET_REALIZED (widget))
|
||||||
|
+ if (!gtk_widget_get_realized (widget))
|
||||||
|
gtk_widget_realize (widget);
|
||||||
|
|
||||||
|
pview->cursor = view_cursor;
|
||||||
|
@@ -995,7 +995,7 @@ ev_view_presentation_draw_end_page (EvViewPresentation *pview)
|
||||||
|
|
||||||
|
gtk_paint_layout (widget->style,
|
||||||
|
widget->window,
|
||||||
|
- GTK_WIDGET_STATE (widget),
|
||||||
|
+ gtk_widget_get_state (widget),
|
||||||
|
FALSE,
|
||||||
|
&area,
|
||||||
|
widget,
|
||||||
|
--- evince-2.29.91/libview/ev-view.c
|
||||||
|
+++ evince-2.29.91/libview/ev-view.c
|
||||||
|
@@ -2398,7 +2398,7 @@ ev_view_window_child_move_with_parent (EvView *view,
|
||||||
|
ev_view_window_child_move (view, child, dest_x, dest_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (child->visible && !GTK_WIDGET_VISIBLE (window))
|
||||||
|
+ if (child->visible && !gtk_widget_get_visible (window))
|
||||||
|
gtk_widget_show (window);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -3250,7 +3250,7 @@ ev_view_button_press_event (GtkWidget *widget,
|
||||||
|
if (!view->document)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
- if (!GTK_WIDGET_HAS_FOCUS (widget)) {
|
||||||
|
+ if (!gtk_widget_has_focus (widget)) {
|
||||||
|
gtk_widget_grab_focus (widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -3762,7 +3762,7 @@ ev_view_key_press_event (GtkWidget *widget,
|
||||||
|
if (!view->document)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
- if (!GTK_WIDGET_HAS_FOCUS (widget)) {
|
||||||
|
+ if (!gtk_widget_has_focus (widget)) {
|
||||||
|
/* Forward key events to current focused window child */
|
||||||
|
if (view->window_child_focus) {
|
||||||
|
GdkEventKey *new_event;
|
||||||
|
@@ -4381,7 +4381,7 @@ on_adjustment_value_changed (GtkAdjustment *adjustment,
|
||||||
|
gint x, y;
|
||||||
|
GList *children, *l;
|
||||||
|
|
||||||
|
- if (! GTK_WIDGET_REALIZED (view))
|
||||||
|
+ if (! gtk_widget_get_realized (view))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (view->hadjustment) {
|
||||||
|
--- evince-2.29.91/shell/ev-application.c
|
||||||
|
+++ evince-2.29.91/shell/ev-application.c
|
||||||
|
@@ -619,7 +619,7 @@ ev_application_open_uri_in_window (EvApplication *application,
|
||||||
|
we can restore window size without flickering */
|
||||||
|
ev_window_open_uri (ev_window, uri, dest, mode, search_string);
|
||||||
|
|
||||||
|
- if (!GTK_WIDGET_REALIZED (GTK_WIDGET (ev_window)))
|
||||||
|
+ if (!gtk_widget_get_realized (GTK_WIDGET (ev_window)))
|
||||||
|
gtk_widget_realize (GTK_WIDGET (ev_window));
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
@@ -709,7 +709,7 @@ ev_application_open_window (EvApplication *application,
|
||||||
|
gtk_window_set_screen (GTK_WINDOW (new_window), screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!GTK_WIDGET_REALIZED (new_window))
|
||||||
|
+ if (!gtk_widget_get_realized (new_window))
|
||||||
|
gtk_widget_realize (new_window);
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
--- evince-2.29.91/shell/ev-navigation-action-widget.c
|
||||||
|
+++ evince-2.29.91/shell/ev-navigation-action-widget.c
|
||||||
|
@@ -98,7 +98,7 @@ ev_navigation_action_widget_set_menu(EvNavigationActionWidget *button, GtkWidget
|
||||||
|
if (button->menu == GTK_MENU (menu))
|
||||||
|
return;
|
||||||
|
|
||||||
|
- if (button->menu && GTK_WIDGET_VISIBLE (button->menu))
|
||||||
|
+ if (button->menu && gtk_widget_get_visible (button->menu))
|
||||||
|
gtk_menu_shell_deactivate (GTK_MENU_SHELL (button->menu));
|
||||||
|
|
||||||
|
if (button->menu) {
|
||||||
|
@@ -186,7 +186,7 @@ ev_navigation_action_widget_toggled (GtkToggleToolButton *toggle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (button)) &&
|
||||||
|
- !GTK_WIDGET_VISIBLE (button->menu)) {
|
||||||
|
+ !gtk_widget_get_visible (button->menu)) {
|
||||||
|
/* we get here only when the menu is activated by a key
|
||||||
|
* press, so that we can select the first menu item */
|
||||||
|
popup_menu_under_arrow (button, NULL);
|
||||||
|
--- evince-2.29.91/shell/ev-sidebar-attachments.c
|
||||||
|
+++ evince-2.29.91/shell/ev-sidebar-attachments.c
|
||||||
|
@@ -273,7 +273,7 @@ ev_sidebar_attachments_button_press (EvSidebarAttachments *ev_attachbar,
|
||||||
|
GdkEventButton *event,
|
||||||
|
GtkWidget *icon_view)
|
||||||
|
{
|
||||||
|
- if (!GTK_WIDGET_HAS_FOCUS (icon_view)) {
|
||||||
|
+ if (!gtk_widget_has_focus (icon_view)) {
|
||||||
|
gtk_widget_grab_focus (icon_view);
|
||||||
|
}
|
||||||
|
|
||||||
|
--- evince-2.29.91/shell/ev-sidebar-links.c
|
||||||
|
+++ evince-2.29.91/shell/ev-sidebar-links.c
|
||||||
|
@@ -542,7 +542,7 @@ ev_sidebar_links_set_current_page (EvSidebarLinks *sidebar_links,
|
||||||
|
GtkTreeIter iter;
|
||||||
|
|
||||||
|
/* Widget is not currently visible */
|
||||||
|
- if (!GTK_WIDGET_MAPPED (sidebar_links))
|
||||||
|
+ if (!gtk_widget_get_mapped (sidebar_links))
|
||||||
|
return;
|
||||||
|
|
||||||
|
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (sidebar_links->priv->tree_view));
|
||||||
|
--- evince-2.29.91/shell/ev-sidebar-thumbnails.c
|
||||||
|
+++ evince-2.29.91/shell/ev-sidebar-thumbnails.c
|
||||||
|
@@ -503,14 +503,14 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
|
||||||
|
gint wy2;
|
||||||
|
|
||||||
|
/* Widget is not currently visible */
|
||||||
|
- if (!GTK_WIDGET_MAPPED (sidebar_thumbnails))
|
||||||
|
+ if (!gtk_widget_get_mapped (sidebar_thumbnails))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (priv->vadjustment->page_size == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (priv->tree_view) {
|
||||||
|
- if (! GTK_WIDGET_REALIZED (priv->tree_view))
|
||||||
|
+ if (! gtk_widget_get_realized (priv->tree_view))
|
||||||
|
return;
|
||||||
|
|
||||||
|
gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view),
|
||||||
|
@@ -526,7 +526,7 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
|
||||||
|
1, wy2 -1, &path2,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
} else if (priv->icon_view) {
|
||||||
|
- if (! GTK_WIDGET_REALIZED (priv->icon_view))
|
||||||
|
+ if (! gtk_widget_get_realized (priv->icon_view))
|
||||||
|
return;
|
||||||
|
if (! gtk_icon_view_get_visible_range (GTK_ICON_VIEW (priv->icon_view), &path, &path2))
|
||||||
|
return;
|
||||||
|
--- evince-2.29.91/shell/ev-sidebar.c
|
||||||
|
+++ evince-2.29.91/shell/ev-sidebar.c
|
||||||
|
@@ -208,7 +208,7 @@ ev_sidebar_menu_position_under (GtkMenu *menu,
|
||||||
|
GtkWidget *widget;
|
||||||
|
|
||||||
|
g_return_if_fail (GTK_IS_BUTTON (user_data));
|
||||||
|
- g_return_if_fail (GTK_WIDGET_NO_WINDOW (user_data));
|
||||||
|
+ g_return_if_fail (!gtk_widget_get_has_window (user_data));
|
||||||
|
|
||||||
|
widget = GTK_WIDGET (user_data);
|
||||||
|
|
||||||
|
--- evince-2.29.91/shell/ev-window.c
|
||||||
|
+++ evince-2.29.91/shell/ev-window.c
|
||||||
|
@@ -4330,11 +4330,11 @@ ev_window_sidebar_visibility_changed_cb (EvSidebar *ev_sidebar,
|
||||||
|
|
||||||
|
if (!EV_WINDOW_IS_PRESENTATION (ev_window)) {
|
||||||
|
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
|
||||||
|
- GTK_WIDGET_VISIBLE (ev_sidebar));
|
||||||
|
+ gtk_widget_get_visible (ev_sidebar));
|
||||||
|
|
||||||
|
if (ev_window->priv->metadata)
|
||||||
|
ev_metadata_set_boolean (ev_window->priv->metadata, "sidebar_visibility",
|
||||||
|
- GTK_WIDGET_VISIBLE (ev_sidebar));
|
||||||
|
+ gtk_widget_get_visible (ev_sidebar));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -4653,7 +4653,7 @@ find_bar_visibility_changed_cb (EggFindBar *find_bar,
|
||||||
|
{
|
||||||
|
gboolean visible;
|
||||||
|
|
||||||
|
- visible = GTK_WIDGET_VISIBLE (find_bar);
|
||||||
|
+ visible = gtk_widget_get_visible (find_bar);
|
||||||
|
|
||||||
|
if (ev_window->priv->document &&
|
||||||
|
EV_IS_DOCUMENT_FIND (ev_window->priv->document)) {
|
||||||
|
@@ -4963,7 +4963,7 @@ ev_window_key_press_event (GtkWidget *widget,
|
||||||
|
*/
|
||||||
|
if (priv->view) {
|
||||||
|
g_object_ref (priv->view);
|
||||||
|
- if (GTK_WIDGET_IS_SENSITIVE (priv->view))
|
||||||
|
+ if (gtk_widget_is_sensitive (priv->view))
|
||||||
|
handled = gtk_widget_event (priv->view, (GdkEvent*) event);
|
||||||
|
g_object_unref (priv->view);
|
||||||
|
}
|
||||||
|
@@ -4974,7 +4974,7 @@ ev_window_key_press_event (GtkWidget *widget,
|
||||||
|
if (priv->menubar_accel_keyval != 0 &&
|
||||||
|
event->keyval == priv->menubar_accel_keyval &&
|
||||||
|
modifier == priv->menubar_accel_modifier) {
|
||||||
|
- if (!GTK_WIDGET_VISIBLE (priv->menubar)) {
|
||||||
|
+ if (!gtk_widget_get_visible (priv->menubar)) {
|
||||||
|
g_signal_connect (priv->menubar, "deactivate",
|
||||||
|
G_CALLBACK (menubar_deactivate_cb),
|
||||||
|
ev_window);
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Name: evince
|
Name: evince
|
||||||
Version: 2.29.91
|
Version: 2.29.91
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Document viewer
|
Summary: Document viewer
|
||||||
|
|
||||||
License: GPLv2+ and GFDL
|
License: GPLv2+ and GFDL
|
||||||
@ -17,6 +17,7 @@ Source0: http://download.gnome.org/sources/%{name}/2.29/%{name}-%{version}.tar.b
|
|||||||
# Patch1: duplex-copies.patch
|
# Patch1: duplex-copies.patch
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=562648
|
# https://bugzilla.redhat.com/show_bug.cgi?id=562648
|
||||||
Patch2: evince-t1font-mapping.patch
|
Patch2: evince-t1font-mapping.patch
|
||||||
|
Patch3: evince-deprecated-functions.patch
|
||||||
|
|
||||||
BuildRequires: gtk2-devel >= %{gtk2_version}
|
BuildRequires: gtk2-devel >= %{gtk2_version}
|
||||||
BuildRequires: glib2-devel >= %{glib2_version}
|
BuildRequires: glib2-devel >= %{glib2_version}
|
||||||
@ -106,6 +107,7 @@ This package contains a backend to let evince display djvu files.
|
|||||||
%setup -q
|
%setup -q
|
||||||
# %patch1 -p0 -b .duplex-copies
|
# %patch1 -p0 -b .duplex-copies
|
||||||
%patch2 -p1 -b .t1font-map
|
%patch2 -p1 -b .t1font-map
|
||||||
|
%patch3 -p1 -b .deprecated
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --disable-static --disable-scrollkeeper \
|
%configure --disable-static --disable-scrollkeeper \
|
||||||
@ -264,6 +266,10 @@ fi
|
|||||||
%{_libdir}/evince/2/backends/djvudocument.evince-backend
|
%{_libdir}/evince/2/backends/djvudocument.evince-backend
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 10 2010 Marek Kasik <mkasik@redhat.com> - 2.29.91-3
|
||||||
|
- Replace deprecated gtk functions with their equivalents
|
||||||
|
- Remove unused patches
|
||||||
|
|
||||||
* Tue Mar 9 2010 Marek Kasik <mkasik@redhat.com> - 2.29.91-2
|
* Tue Mar 9 2010 Marek Kasik <mkasik@redhat.com> - 2.29.91-2
|
||||||
- Use Type 1 fonts when viewing DVI files
|
- Use Type 1 fonts when viewing DVI files
|
||||||
- Use correct name when the font is mapped
|
- Use correct name when the font is mapped
|
||||||
|
316
poppler072.patch
316
poppler072.patch
@ -1,316 +0,0 @@
|
|||||||
diff -up evince-2.22.0/backend/pdf/ev-poppler.cc.poppler72 evince-2.22.0/backend/pdf/ev-poppler.cc
|
|
||||||
--- evince-2.22.0/backend/pdf/ev-poppler.cc.poppler72 2008-03-14 10:43:57.000000000 -0400
|
|
||||||
+++ evince-2.22.0/backend/pdf/ev-poppler.cc 2008-03-14 10:44:39.000000000 -0400
|
|
||||||
@@ -53,6 +53,14 @@
|
|
||||||
#define HAVE_CAIRO_PRINT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if POPPLER_MAJOR_VERSION <= 6 || (POPPLER_MAJOR_VERSION == 7 && POPPLER_MINOR_VERSION < 2)
|
|
||||||
+#define POPPLER_HAS_GDK
|
|
||||||
+#else
|
|
||||||
+#ifdef POPPLER_WITH_GDK
|
|
||||||
+#define POPPLER_HAS_GDK
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
typedef struct {
|
|
||||||
PdfDocument *document;
|
|
||||||
char *text;
|
|
||||||
@@ -445,27 +453,12 @@ pdf_document_get_attachments (EvDocument
|
|
||||||
}
|
|
||||||
|
|
||||||
static cairo_surface_t *
|
|
||||||
-pdf_document_render (EvDocument *document,
|
|
||||||
- EvRenderContext *rc)
|
|
||||||
+pdf_page_render (PopplerPage *page,
|
|
||||||
+ gint width,
|
|
||||||
+ gint height,
|
|
||||||
+ EvRenderContext *rc)
|
|
||||||
{
|
|
||||||
- PdfDocument *pdf_document;
|
|
||||||
cairo_surface_t *surface;
|
|
||||||
- double width_points, height_points;
|
|
||||||
- gint width, height;
|
|
||||||
-
|
|
||||||
- pdf_document = PDF_DOCUMENT (document);
|
|
||||||
-
|
|
||||||
- set_rc_data (pdf_document, rc);
|
|
||||||
-
|
|
||||||
- poppler_page_get_size (POPPLER_PAGE (rc->data), &width_points, &height_points);
|
|
||||||
-
|
|
||||||
- if (rc->rotation == 90 || rc->rotation == 270) {
|
|
||||||
- width = (int) ((height_points * rc->scale) + 0.5);
|
|
||||||
- height = (int) ((width_points * rc->scale) + 0.5);
|
|
||||||
- } else {
|
|
||||||
- width = (int) ((width_points * rc->scale) + 0.5);
|
|
||||||
- height = (int) ((height_points * rc->scale) + 0.5);
|
|
||||||
- }
|
|
||||||
|
|
||||||
#ifdef HAVE_POPPLER_PAGE_RENDER
|
|
||||||
cairo_t *cr;
|
|
||||||
@@ -492,7 +485,7 @@ pdf_document_render (EvDocument *do
|
|
||||||
}
|
|
||||||
cairo_scale (cr, rc->scale, rc->scale);
|
|
||||||
cairo_rotate (cr, rc->rotation * G_PI / 180.0);
|
|
||||||
- poppler_page_render (POPPLER_PAGE (rc->data), cr);
|
|
||||||
+ poppler_page_render (page, cr);
|
|
||||||
cairo_destroy (cr);
|
|
||||||
#else /* HAVE_POPPLER_PAGE_RENDER */
|
|
||||||
GdkPixbuf *pixbuf;
|
|
||||||
@@ -501,7 +494,7 @@ pdf_document_render (EvDocument *do
|
|
||||||
FALSE, 8,
|
|
||||||
width, height);
|
|
||||||
|
|
||||||
- poppler_page_render_to_pixbuf (POPPLER_PAGE (rc->data),
|
|
||||||
+ poppler_page_render_to_pixbuf (page,
|
|
||||||
0, 0,
|
|
||||||
width, height,
|
|
||||||
rc->scale,
|
|
||||||
@@ -511,7 +504,34 @@ pdf_document_render (EvDocument *do
|
|
||||||
g_object_unref (pixbuf);
|
|
||||||
#endif /* HAVE_POPPLER_PAGE_RENDER */
|
|
||||||
|
|
||||||
- return surface;
|
|
||||||
+ return surface;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static cairo_surface_t *
|
|
||||||
+pdf_document_render (EvDocument *document,
|
|
||||||
+ EvRenderContext *rc)
|
|
||||||
+{
|
|
||||||
+ PdfDocument *pdf_document;
|
|
||||||
+ double width_points, height_points;
|
|
||||||
+ gint width, height;
|
|
||||||
+
|
|
||||||
+ pdf_document = PDF_DOCUMENT (document);
|
|
||||||
+
|
|
||||||
+ set_rc_data (pdf_document, rc);
|
|
||||||
+
|
|
||||||
+ poppler_page_get_size (POPPLER_PAGE (rc->data),
|
|
||||||
+ &width_points, &height_points);
|
|
||||||
+
|
|
||||||
+ if (rc->rotation == 90 || rc->rotation == 270) {
|
|
||||||
+ width = (int) ((height_points * rc->scale) + 0.5);
|
|
||||||
+ height = (int) ((width_points * rc->scale) + 0.5);
|
|
||||||
+ } else {
|
|
||||||
+ width = (int) ((width_points * rc->scale) + 0.5);
|
|
||||||
+ height = (int) ((height_points * rc->scale) + 0.5);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return pdf_page_render (POPPLER_PAGE (rc->data),
|
|
||||||
+ width, height, rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EvDocumentSecurity */
|
|
||||||
@@ -1178,7 +1198,7 @@ pdf_document_images_get_image_mapping (E
|
|
||||||
ev_image_mapping = g_new (EvImageMapping, 1);
|
|
||||||
#ifdef HAVE_POPPLER_PAGE_GET_IMAGE
|
|
||||||
ev_image_mapping->image = ev_image_new (page, image_mapping->image_id);
|
|
||||||
-#else
|
|
||||||
+#elif POPPLER_HAS_CAIRO
|
|
||||||
ev_image_mapping->image = ev_image_new_from_pixbuf (image_mapping->image);
|
|
||||||
#endif
|
|
||||||
ev_image_mapping->x1 = image_mapping->area.x1;
|
|
||||||
@@ -1240,7 +1260,7 @@ make_thumbnail_for_page (PdfDocument
|
|
||||||
|
|
||||||
pdf_document_thumbnails_get_dimensions (EV_DOCUMENT_THUMBNAILS (pdf_document),
|
|
||||||
rc, &width, &height);
|
|
||||||
-
|
|
||||||
+#ifdef POPPLER_HAS_GDK
|
|
||||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
|
|
||||||
width, height);
|
|
||||||
gdk_pixbuf_fill (pixbuf, 0xffffffff);
|
|
||||||
@@ -1250,6 +1270,16 @@ make_thumbnail_for_page (PdfDocument
|
|
||||||
width, height,
|
|
||||||
rc->scale, rc->rotation, pixbuf);
|
|
||||||
ev_document_fc_mutex_unlock ();
|
|
||||||
+#else
|
|
||||||
+ cairo_surface_t *surface;
|
|
||||||
+
|
|
||||||
+ ev_document_fc_mutex_lock ();
|
|
||||||
+ surface = pdf_page_render (poppler_page, width, height, rc);
|
|
||||||
+ ev_document_fc_mutex_unlock ();
|
|
||||||
+
|
|
||||||
+ pixbuf = ev_document_misc_pixbuf_from_surface (surface);
|
|
||||||
+ cairo_surface_destroy (surface);
|
|
||||||
+#endif /* POPPLER_HAS_GDK */
|
|
||||||
|
|
||||||
return pixbuf;
|
|
||||||
}
|
|
||||||
@@ -1261,7 +1291,7 @@ pdf_document_thumbnails_get_thumbnail (E
|
|
||||||
{
|
|
||||||
PdfDocument *pdf_document;
|
|
||||||
PopplerPage *poppler_page;
|
|
||||||
- GdkPixbuf *pixbuf;
|
|
||||||
+ GdkPixbuf *pixbuf = NULL;
|
|
||||||
GdkPixbuf *border_pixbuf;
|
|
||||||
|
|
||||||
pdf_document = PDF_DOCUMENT (document_thumbnails);
|
|
||||||
@@ -1269,7 +1299,22 @@ pdf_document_thumbnails_get_thumbnail (E
|
|
||||||
poppler_page = poppler_document_get_page (pdf_document->document, rc->page);
|
|
||||||
g_return_val_if_fail (poppler_page != NULL, NULL);
|
|
||||||
|
|
||||||
+#if POPPLER_MAJOR_VERSION <= 6 || (POPPLER_MAJOR_VERSION == 7 && POPPLER_MINOR_VERSION < 2)
|
|
||||||
pixbuf = poppler_page_get_thumbnail (poppler_page);
|
|
||||||
+#else
|
|
||||||
+#ifdef POPPLER_HAS_GDK
|
|
||||||
+ pixbuf = poppler_page_get_thumbnail_pixbuf (poppler_page);
|
|
||||||
+#else
|
|
||||||
+ cairo_surface_t *surface;
|
|
||||||
+
|
|
||||||
+ surface = poppler_page_get_thumbnail (poppler_page);
|
|
||||||
+ if (surface) {
|
|
||||||
+ pixbuf = ev_document_misc_pixbuf_from_surface (surface);
|
|
||||||
+ cairo_surface_destroy (surface);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
if (pixbuf) {
|
|
||||||
/* Rotate provided thumbnail if needed */
|
|
||||||
GdkPixbuf *rotated_pixbuf;
|
|
||||||
@@ -1855,6 +1900,23 @@ pdf_selection_render_selection (EvSelect
|
|
||||||
|
|
||||||
#ifdef HAVE_POPPLER_PAGE_RENDER
|
|
||||||
cairo_t *cr;
|
|
||||||
+
|
|
||||||
+#if POPPLER_MAJOR_VERSION <= 6 || (POPPLER_MAJOR_VERSION == 7 && POPPLER_MINOR_VERSION < 2)
|
|
||||||
+ GdkColor **text_color, **base_color;
|
|
||||||
+
|
|
||||||
+ *text_color = text;
|
|
||||||
+ *base_color = base;
|
|
||||||
+#else
|
|
||||||
+ PopplerColor text_color, base_color;
|
|
||||||
+
|
|
||||||
+ text_color.red = text->red;
|
|
||||||
+ text_color.green = text->green;
|
|
||||||
+ text_color.blue = text->blue;
|
|
||||||
+
|
|
||||||
+ base_color.red = base->red;
|
|
||||||
+ base_color.green = base->green;
|
|
||||||
+ base_color.blue = base->blue;
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
if (*surface == NULL) {
|
|
||||||
*surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
|
||||||
@@ -1873,8 +1935,8 @@ pdf_selection_render_selection (EvSelect
|
|
||||||
(PopplerRectangle *)points,
|
|
||||||
(PopplerRectangle *)old_points,
|
|
||||||
(PopplerSelectionStyle)style,
|
|
||||||
- text,
|
|
||||||
- base);
|
|
||||||
+ &text_color,
|
|
||||||
+ &base_color);
|
|
||||||
cairo_destroy (cr);
|
|
||||||
#else /* HAVE_POPPLER_PAGE_RENDER */
|
|
||||||
GdkPixbuf *pixbuf;
|
|
||||||
@@ -1928,22 +1990,60 @@ pdf_selection_get_selected_text (EvSelec
|
|
||||||
}
|
|
||||||
|
|
||||||
static GdkRegion *
|
|
||||||
+create_gdk_region_from_poppler_region (GList *region)
|
|
||||||
+{
|
|
||||||
+ GList *l;
|
|
||||||
+ GdkRegion *retval;
|
|
||||||
+
|
|
||||||
+ retval = gdk_region_new ();
|
|
||||||
+
|
|
||||||
+ for (l = region; l; l = g_list_next (l)) {
|
|
||||||
+ PopplerRectangle *rectangle;
|
|
||||||
+ GdkRectangle rect;
|
|
||||||
+
|
|
||||||
+ rectangle = (PopplerRectangle *)l->data;
|
|
||||||
+
|
|
||||||
+ rect.x = (gint) rectangle->x1;
|
|
||||||
+ rect.y = (gint) rectangle->y1;
|
|
||||||
+ rect.width = (gint) (rectangle->x2 - rectangle->x1);
|
|
||||||
+ rect.height = (gint) (rectangle->y2 - rectangle->y1);
|
|
||||||
+ gdk_region_union_with_rect (retval, &rect);
|
|
||||||
+
|
|
||||||
+ poppler_rectangle_free (rectangle);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return retval;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static GdkRegion *
|
|
||||||
pdf_selection_get_selection_region (EvSelection *selection,
|
|
||||||
EvRenderContext *rc,
|
|
||||||
EvSelectionStyle style,
|
|
||||||
EvRectangle *points)
|
|
||||||
{
|
|
||||||
PdfDocument *pdf_document;
|
|
||||||
- GdkRegion *retval;
|
|
||||||
+ GdkRegion *retval;
|
|
||||||
|
|
||||||
pdf_document = PDF_DOCUMENT (selection);
|
|
||||||
|
|
||||||
set_rc_data (pdf_document, rc);
|
|
||||||
-
|
|
||||||
- retval = poppler_page_get_selection_region ((PopplerPage *)rc->data,
|
|
||||||
+
|
|
||||||
+#if POPPLER_MAJOR_VERSION <= 6 || (POPPLER_MAJOR_VERSION == 7 && POPPLER_MINOR_VERSION < 2)
|
|
||||||
+ retval = poppler_page_get_selection_region (POPPLER_PAGE (rc->data),
|
|
||||||
rc->scale,
|
|
||||||
(PopplerSelectionStyle)style,
|
|
||||||
(PopplerRectangle *) points);
|
|
||||||
+#else
|
|
||||||
+ GList *region;
|
|
||||||
+
|
|
||||||
+ region = poppler_page_get_selection_region (POPPLER_PAGE (rc->data),
|
|
||||||
+ rc->scale,
|
|
||||||
+ (PopplerSelectionStyle)style,
|
|
||||||
+ (PopplerRectangle *) points);
|
|
||||||
+ retval = create_gdk_region_from_poppler_region (region);
|
|
||||||
+ g_list_free (region);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1954,6 +2054,7 @@ pdf_selection_get_selection_map (EvSelec
|
|
||||||
PdfDocument *pdf_document;
|
|
||||||
PopplerPage *poppler_page;
|
|
||||||
PopplerRectangle points;
|
|
||||||
+ GList *region;
|
|
||||||
GdkRegion *retval;
|
|
||||||
|
|
||||||
pdf_document = PDF_DOCUMENT (selection);
|
|
||||||
@@ -1963,9 +2064,18 @@ pdf_selection_get_selection_map (EvSelec
|
|
||||||
points.x1 = 0.0;
|
|
||||||
points.y1 = 0.0;
|
|
||||||
poppler_page_get_size (poppler_page, &(points.x2), &(points.y2));
|
|
||||||
+
|
|
||||||
+#if POPPLER_MAJOR_VERSION <= 6 || (POPPLER_MAJOR_VERSION == 7 && POPPLER_MINOR_VERSION < 2)
|
|
||||||
retval = poppler_page_get_selection_region (poppler_page, 1.0,
|
|
||||||
POPPLER_SELECTION_GLYPH,
|
|
||||||
&points);
|
|
||||||
+#else
|
|
||||||
+ region = poppler_page_get_selection_region (poppler_page, 1.0,
|
|
||||||
+ POPPLER_SELECTION_GLYPH,
|
|
||||||
+ &points);
|
|
||||||
+ retval = create_gdk_region_from_poppler_region (region);
|
|
||||||
+ g_list_free (region);
|
|
||||||
+#endif
|
|
||||||
g_object_unref (poppler_page);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
diff -up evince-2.22.0/configure.ac.poppler72 evince-2.22.0/configure.ac
|
|
||||||
--- evince-2.22.0/configure.ac.poppler72 2008-03-14 10:43:46.000000000 -0400
|
|
||||||
+++ evince-2.22.0/configure.ac 2008-03-14 10:44:18.000000000 -0400
|
|
||||||
@@ -218,6 +218,15 @@ if test "x$enable_pdf" = "xyes"; then
|
|
||||||
AC_CHECK_FUNCS(poppler_page_get_image)
|
|
||||||
LIBS=$evince_save_LIBS
|
|
||||||
|
|
||||||
+ POPPLER_MAJOR_VERSION=`$PKG_CONFIG --modversion poppler-glib | sed 's/0\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\?/\1/'`
|
|
||||||
+ POPPLER_MINOR_VERSION=`$PKG_CONFIG --modversion poppler-glib | sed 's/0\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\?/\3/'`
|
|
||||||
+ if test -z "$POPPLER_MINOR_VERSION"; then
|
|
||||||
+ POPPLER_MINOR_VERSION=0
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ AC_DEFINE_UNQUOTED([POPPLER_MAJOR_VERSION], $POPPLER_MAJOR_VERSION, [Poppler major version number])
|
|
||||||
+ AC_DEFINE_UNQUOTED([POPPLER_MINOR_VERSION], $POPPLER_MINOR_VERSION, [Poppler minor version number])
|
|
||||||
+
|
|
||||||
PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
|
|
||||||
if test x$enable_cairo_pdf == xyes; then
|
|
||||||
AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -up evince-2.21.90/properties/ev-properties-main.c.property-deps evince-2.21.90/properties/ev-properties-main.c
|
|
||||||
--- evince-2.21.90/properties/ev-properties-main.c.property-deps 2008-01-29 00:09:41.000000000 -0500
|
|
||||||
+++ evince-2.21.90/properties/ev-properties-main.c 2008-01-29 00:14:44.000000000 -0500
|
|
||||||
@@ -133,6 +133,8 @@ nautilus_module_initialize (GTypeModule
|
|
||||||
/* set up translation catalog */
|
|
||||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
||||||
+
|
|
||||||
+ ev_backends_manager_init ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
@ -1,33 +0,0 @@
|
|||||||
diff -up evince-2.21.90/thumbnailer/Makefile.am.property-deps evince-2.21.90/thumbnailer/Makefile.am
|
|
||||||
--- evince-2.21.90/thumbnailer/Makefile.am.property-deps 2008-01-30 12:40:35.000000000 -0500
|
|
||||||
+++ evince-2.21.90/thumbnailer/Makefile.am 2008-01-30 12:40:56.000000000 -0500
|
|
||||||
@@ -16,8 +16,7 @@ evince_thumbnailer_SOURCES= \
|
|
||||||
|
|
||||||
evince_thumbnailer_LDADD= \
|
|
||||||
$(top_builddir)/libdocument/libevbackend.la \
|
|
||||||
- $(FRONTEND_LIBS) \
|
|
||||||
- $(DJVU_LIBS)
|
|
||||||
+ $(FRONTEND_LIBS)
|
|
||||||
|
|
||||||
schema_files = \
|
|
||||||
evince-thumbnailer-dvi.schemas.in \
|
|
||||||
diff -up evince-2.21.90/properties/Makefile.am.property-deps evince-2.21.90/properties/Makefile.am
|
|
||||||
--- evince-2.21.90/properties/Makefile.am.property-deps 2008-01-28 15:53:04.000000000 -0500
|
|
||||||
+++ evince-2.21.90/properties/Makefile.am 2008-01-30 12:36:45.000000000 -0500
|
|
||||||
@@ -32,16 +32,4 @@ libevince_properties_page_la_LIBADD =
|
|
||||||
$(FRONTEND_LIBS) \
|
|
||||||
$(NAUTILUS_LIBS)
|
|
||||||
|
|
||||||
-if ENABLE_DJVU
|
|
||||||
-libevince_properties_page_la_LIBADD += $(DJVU_LIBS)
|
|
||||||
-endif
|
|
||||||
-
|
|
||||||
-if ENABLE_DVI
|
|
||||||
-libevince_properties_page_la_LIBADD += -lkpathsea
|
|
||||||
-endif
|
|
||||||
-
|
|
||||||
-if WITH_TYPE1_FONTS
|
|
||||||
-libevince_properties_page_la_LIBADD += -lt1
|
|
||||||
-endif
|
|
||||||
-
|
|
||||||
libevince_properties_page_la_LDFLAGS = -module -avoid-version -no-undefined
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -up evince-2.21.90/thumbnailer/evince-thumbnailer.c.thumbnailer evince-2.21.90/thumbnailer/evince-thumbnailer.c
|
|
||||||
--- evince-2.21.90/thumbnailer/evince-thumbnailer.c.thumbnailer 2008-02-02 14:13:41.000000000 -0500
|
|
||||||
+++ evince-2.21.90/thumbnailer/evince-thumbnailer.c 2008-02-02 14:14:11.000000000 -0500
|
|
||||||
@@ -158,6 +158,8 @@ main (int argc, char *argv[])
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ g_type_init ();
|
|
||||||
+
|
|
||||||
if (!g_thread_supported ())
|
|
||||||
g_thread_init (NULL);
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user