libview: Invalidate union of old and new selection

Instead of using xor, use the union of old_sel and new_sel to find
what needs redrawing.

https://bugzilla.gnome.org/show_bug.cgi?id=703024
libview: Don't queue a redraw when damaged region hasn't changed

When the region covered by old and new selection is the same, don't
schedule a new redraw for the union.
libview: Use a larger damage area to redraw selections

Depending on the zoom level the area actually drawn by cairo can be a
bit larger than the selected region due to rounding errors or pixel
alignment. We use the selected region to build the damage area to
invalidate when drawing selections which in many cases is not large
enough. This causes that sometimes when removing a selections some small
rectangles keep drawn because they are not redrawn. To avoid this we
grow the damage area computed from selected regions.
libview: Avoid unnecessary region copies when selecting text

Now that we always build a new damage region, we don't need to copy the
selection covered region.
libview: Added 'cursor-moved' signal to notify when the caret cursor has been moved.

https://bugzilla.gnome.org/show_bug.cgi?id=702078
libview: Add ev_view_find_set_result

To be able set a random result in addition to next/prev results.
eggfindbar: don't close the findbar when it loses the focus

Now that there's a toggle button in the toolbar, the find bar can be
closed just by toggling the button.
shell: Add the findbar to the main box instead of the view box
shell: Add EvFindSidebar widget to show search results

This is based on a patch by Sergey Pushkin.

http://bugzilla.gnome.org/show_bug.cgi?id=566827
shell: show a sidebar with search results when find is active

https://bugzilla.gnome.org/show_bug.cgi?id=566827
ev-find-sidebar: Use text layout and pango instead of GtkTextBuffer

We already have the coordinates of the matches, we don't need to
search all them again using GtkTextBuffer. It also removes the line
breaks, resolves the hyphenations and adds more context.
Check if find bar is visible when ESC is pressed to hide it

We were checking if the focused widget was a children of the find bar.
Now that there's a find sidebar and findbar is not closed when it loses
the focus, other widgets might have the focus while a search is active.
So, simply check if the findbar is visible instead.
Focus the findbar when it's requested to be shown and it's already visible
djvu: enable selection highlighting

https://bugzilla.gnome.org/show_bug.cgi?id=448739
djvu: Rename djvu_text_page_prepare_search as djvu_text_page_index_text
djvu: implement text interface

https://bugzilla.gnome.org/show_bug.cgi?id=703108
ev-find-sidebar: fix a crash due to an infinite loop resolving hyphenations

Do not try to resolve the hyphenation if the hyphen is the last
character of the chunk processed.

https://bugzilla.gnome.org/show_bug.cgi?id=703275
ev-find-sidebar: Show all results in sidebar for multicolumn documents

Search results are sorted in physical order while text layout is in
reading order, so when a match is not found after the offset of previous
one, continue iterating the text layout from the beginning. Add a
warning when we fail to find the offset for a match because it should
never happen.
ev-pixbuf-cache: Schedule jobs to render previous pages in inverse order
ev-pixbuf-cache: schedule prev or next jobs first depending on the scroll direction

If we are scrolling down schedule next pages first, otherwise schedule
the previous pages first.