summaryrefslogtreecommitdiff
path: root/libview/ev-view.c
AgeCommit message (Collapse)AuthorFilesLines
2019-12-08Revert "First page should not reloaded"raveit651-5/+4
This reverts commit 00fad2c0d0fcdade570a08f046e85a4558f1fc0c. and fixes https://github.com/mate-desktop/atril/issues/404
2019-11-28avoid redundant redeclarationsPablo Barciela1-2/+0
2019-11-23libview: Reset `pressed_button` when starting Drag and DropMartin Wimpress1-0/+2
If view->pressed_button is left set, when the Drag and Drop operation completes, Atril will act as if it is still in a selection event. Adapted from: https://gitlab.gnome.org/GNOME/evince/commit/92828bb797742e04aadbfdd62ba1da36837c37cf
2019-08-21ev-view: Remove unused variables and assignmentrbuj1-3/+0
2019-08-10DPI: compute monitor resolution or get screen resolutionrbuj1-13/+16
2019-07-01Remove trailing whitespacesLaurent Napias1-80/+80
2019-06-26Bump Cairo version to 1.14.0Matthew Petroff1-6/+0
such that hi-dpi conditionals aren't needed. origin commit: https://github.com/linuxmint/xreader/commit/df3cdc6
2018-10-20EvView: Fix cursor movement when logical and visual line order differsColomban Wendling1-0/+10
Make sure not to move the caret in the wrong direction when restoring the visual line X offset, in case the visual and logical order is slightly different. The algorithm used to move the cursor on the next line and restore the X position across lines works as follows: 1. Move `cursor_offset` to the next line by incrementing it until reaching a line break; 2. Find the Y coordinate corresponding to the new cursor_offset; 3. Find the text closest to the new Y coordinate and the previous X coordinate. 4. Move cursor_offset to the text at this new (X, Y) location. The issue lies in step 3, which can find a position on a different line than expected in case several lines have a nearly the same Y position. Evince references: * https://gitlab.gnome.org/GNOME/evince/issues/889 * https://gitlab.gnome.org/GNOME/evince/merge_requests/81 * https://gitlab.gnome.org/GNOME/evince/commit/dddd98b4c7922e2906bba6a31afa07837ae6c39c
2018-05-10libview: replace deprecated gdk_flushraveit651-2/+4
2018-04-05view: Fix page background rendering while loadingCarlos Garcia Campos1-0/+4
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=38528f9
2018-04-05view: Use a rendered frame instead of custom borderWilliam Jon McCann1-27/+37
So it can be styled with CSS. https://bugzilla.gnome.org/show_bug.cgi?id=653294 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=7a6b53a https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=4657961
2018-04-04libview: drop deprecated unneeded coderaveit651-3/+0
inspired by: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=a56186e
2018-03-26EvView: render correctly on hi-dpi displaysOwen W. Taylor1-5/+18
Make EvPixbufCache generate surfaces with extra resolution based on gtk_widget_get_scale_factor(). Handle cairo surfaces with a device scale in ev_view_draw(). Trigger an update of the pixbuf cache when the scale factor changes. https://bugzilla.gnome.org/show_bug.cgi?id=723431 origin commit: https://git.gnome.org/browse/evince/commit/?id=a612f8
2018-03-22libview: Check number of pages when processing button eventsMarek Kasik1-1/+1
Check whether there are some pages in the opened document when processing button events to avoid crash. https://bugzilla.gnome.org/show_bug.cgi?id=769700 origin commit: https://git.gnome.org/browse/evince/commit/?id=f30aed7
2018-03-22libview: Check number of pages on ev_view_document_changed_cbGermán Poo-Caamaño1-2/+5
Fix crash on corrupted PDF with no pages. Thanks to Juha Kylmänen from OUSPG who were testing robutness. (CVE-2013-3718). libview: Fix warning on ev_view_document_changed_cb There was an introduction of a warning when fixing the bug https://bugzilla.gnome.org/show_bug.cgi?id=701302 If ev_view_document_changed_cb () is emitted when there is no previous document, the check fails. This patch change the order of the condition checks. origin commits: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=62b1585 https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=5431595
2018-03-22Use GtkOverlay to show the loading messageCarlos Garcia Campos1-99/+31
Remove the EvLoadingWindow from libview and move the implementation to the shell using a EvLoadingMessage widget and GtkOverlay. EvView has now a is-loading property that allows the users to implement their own loading notification system. This fixes several realted to the loading window. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=035c1cb
2018-03-19Save/restore context when getting colors for a different stateraveit651-0/+7
Getting colors for a state different from the current state of the corresponding widget without saving the context might trigger an invalidation and a redraw. Because this was happening from the draw function this resulted in a redraw loop and constant high CPU usage. This could be triggered by selecting text or searching. https://bugzilla.gnome.org/show_bug.cgi?id=755442 inspired by: https://git.gnome.org/browse/evince/commit/?id=1987f04 https://github.com/linuxmint/xreader/commit/e76a18d
2018-03-15Add zoom resetLars Mueller1-0/+7
origin commit: https://github.com/linuxmint/xreader/commit/43acb8f
2018-01-31require GTK+ 3.22 and GLib 2.50monsta1-22/+0
2018-01-02Revert "libview: Update the current page also when pending scroll is to find ↵raveit651-2/+1
a location" Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1525313 This reverts commit e64064d40b451011dba2f891be454f65439df18d.
2017-12-10WidthOfScreen and HeightOfScreen implementationPablo Barciela1-7/+4
This commit reverts: https://github.com/mate-desktop/atril/commit/d9fffe2dc0e33d6777099c18635b7b75f54d3d35 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height
2017-11-27Expose form fields as AtkObject children of the pageJoanmarie Diggs1-4/+4
https://bugzilla.gnome.org/show_bug.cgi?id=728475 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=d707486
2017-11-27libview: Update the caret cursor when jumping to a find resultJoanmarie Diggs1-0/+3
https://bugzilla.gnome.org/show_bug.cgi?id=728996 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=fc031f7
2017-11-27libview: Update ATK_STATE_SHOWING when the visible page range changesJoanmarie Diggs1-0/+4
https://bugzilla.gnome.org/show_bug.cgi?id=728664 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=110a98a https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=c4e98b3
2017-11-27libview: Fix shift+click text selectionJoanmarie Diggs1-7/+16
https://bugzilla.gnome.org/show_bug.cgi?id=728189 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=7cf4c80
2017-11-27libview: Fix some broken aspects EvViewAccessible text supportJoanmarie Diggs1-0/+14
* Stop using GtkTextBuffer: It was a hack more than a real solution * Fix setting and clearing of selection via AtkText for the current page * Strip newline chars out of the sentence strings: Newlines break TTS prosody * Add some logic to heuristically distinguish soft and hard returns https://bugzilla.gnome.org/show_bug.cgi?id=725003 https://git.gnome.org/browse/evince/commit/?h=gnome-3-12&id=03afe27
2017-11-27view: set_caret_cursor_position should emit "cursor-moved" if appliesAlejandro Piñeiro1-0/+3
https://bugzilla.gnome.org/show_bug.cgi?id=701746 from: https://git.gnome.org/browse/evince/commit/?h=gnome-3-12&id=9809525
2017-11-27ev-view-accessible: Clear the cached data when the current pageAntia Puentes1-0/+4
or document is updated. https://bugzilla.gnome.org/show_bug.cgi?id=704621 https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=d71e0d7
2017-09-06libview: Add ev_view_set_caret_cursor_positionCarlos Garcia Campos1-0/+18
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=b2597d
2017-09-06libview: Update the current page also when pending scroll is to find a locationCarlos Garcia Campos1-1/+2
Pending scroll SCROLL_TO_FIND_LOCATION, can jump to another page if the location is in a different page. We should change the current page in the model in this case too. Origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=8709b39
2017-09-06libview: Do not schedule a redraw when enabling/disabling caret navigationCarlos Garcia Campos1-1/+3
If the cursor is not in a visible page origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=c187766
2017-09-06libview: Stop caret cursor blinking when cursor is not in a visible pageCarlos Garcia Campos1-0/+14
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=570927e
2017-09-06libview: Add ev_view_supports_caret_navigation()Antia Puentes1-0/+15
https://bugzilla.gnome.org/show_bug.cgi?id=702079 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=6127a36
2017-09-06libview: Fix selections starting/ending in page marginsCarlos Garcia Campos1-0/+8
Do not take into account the page area borders when looking the pages where the selection starts or ends. This allows to start a new selection from a page margin and prevents selection from disappearing when selecting multiple pages and releasing the mouse between two pages. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=4969e2b
2017-09-06libview: Reduce the pages to scan for selectionsCarlos Garcia Campos1-26/+58
when selection starts and ends at the same point We can use the current page range in this case, since this will only happen when starting a new word/line selection. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=e92c98f
2017-09-06libview: Remove unused rectangle selection modeCarlos Garcia Campos1-59/+5
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=848459e
2017-09-06libview: Rework ev_view_accessible_get_selectionAntia Puentes1-7/+22
Actually return the text and offset range of the selected text in the current page. https://bugzilla.gnome.org/show_bug.cgi?id=704335 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=a178d26
2017-09-06libview: do not redraw the whole view when caret cursor movesCarlos Garcia Campos1-16/+33
Invalidate the previous and new regions instead. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=e39ac99
2017-09-06libview: Update the cursor area after positioning the cursor when moving ↵Carlos Garcia Campos1-0/+3
between lines origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=074dfec
2017-09-06libview: Use error bell and return early when moving between lines failsCarlos Garcia Campos1-6/+11
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=3666096
2017-09-06libview: do not schedule a resize in ensure_rectangle_is_visibleCarlos Garcia Campos1-2/+0
It will be scheduled if the adjustments change. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=0597aa7
2017-09-06libview: Stop the cursor blink when there are selections activeCarlos Garcia Campos1-1/+5
Even though the caret cursor is not shown while there are active selections we don't want the cursor blink timeout running and scheduling redraws. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=41c660f
2017-09-06libview: Add more scroll key bindings to EvViewCarlos Garcia Campos1-0/+20
All keybindings currently used by EvWindow. Having them in the view makes them available to other EvView users and they can be overriden by the themes. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=660b741 Fix Return key bidings Do not use the helper function for keypad keys since Return doesn't have a key un the keypad. https://bugzilla.gnome.org/show_bug.cgi?id=704154
2017-09-06libview: Fix second parameter type of scroll signal for h, j, k and l bindingsCarlos Garcia Campos1-8/+12
We were still using G_TYPE_BOOLEAN instead of GTK_TYPE_ORIENTATION. It worked because both are integers in the end. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=f9a65d4
2017-09-06libview: Use merge_selection_region passing NULL to clear the selectionsCarlos Garcia Campos1-18/+6
This way only the regions affected by the selection are redrawn and we don't need to schedule a full redraw every time clear_selection is called. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=4b4ea6c
2017-09-06libview: Get text attributes from backend and save them in page cacheAntia Puentes1-1/+2
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=4592007
2017-09-06libview: clear the selection when cursor is movedCarlos Garcia Campos1-26/+75
If the cursor is moved with left/right arrow keys the cursor moves the beginning/end of the selection. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=9c3816b
2017-09-06libview: Do not show the caret cursor when there are active selectionsCarlos Garcia Campos1-1/+2
https://bugzilla.gnome.org/show_bug.cgi?id=702761 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=604cd6d
2017-09-06libview: Return NULL instead of empty regions from the pixbuf cacheCarlos Garcia Campos1-3/+2
This way we just need to check the pointer returned. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=bf18b54
2017-09-06libview: Don't draw the caret cursor when the view is not focusedCarlos Garcia Campos1-1/+11
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=1691b14