Commit graph

79 commits

Author SHA1 Message Date
Sebastian Ramacher
3285d61a99 Remove replace_substring
We now have girara_replace_substring.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-04-11 14:48:04 +02:00
Sebastian Ramacher
71ef7c7eed Fix some memory leaks and a use after free
Also return proper D-Bus errors

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-19 17:09:33 +01:00
Moritz Lipp
0fc5b80121 Replace glib memory functions with try version 2014-01-19 16:47:08 +01:00
Sebastian Ramacher
5021767a18 Split of guess_content_type
… and use it everywhere we want to get the content type of a file.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-14 18:01:34 +01:00
Sebastian Ramacher
40fe7cdd9e Some typos
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-07 03:43:38 +01:00
Sebastian Ramacher
250c575f44 CS
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-05 23:05:43 +01:00
Sebastian Ramacher
6599b921a3 Remove more unused functions
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-05 22:21:50 +01:00
Sebastian Ramacher
3a0fe29336 Remove unused execute_command
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-05 22:06:44 +01:00
Abdo Roig-Maranges
030a8c65c1 add functions to compute page positions
The plan is to put in adjustment.c every piece of code that has to do
with document positioning, either computing it from data on the document
side, or talking to GTK.

We want to have at our disposal functions to compute sizes and positions
without having to ask for it to a GTK widget. The new functions are:

 - move page_calc_height_width to adjustment.c

 - add page_calc_position that rotates a position relative to a page
   according to the rotation settings.

 - add position_to_page_number that computes the number of a page
   sitting at a given position (given in document-relative coordinates)

 - add page_number_to_position that computes the position (in document
   relative coordinates) that will be placed at the center of the viewport.

 - add page_is_visible that checks whether the given page intersects the
   viewport.
2013-10-26 17:13:55 +02:00
Abdo Roig-Maranges
a0a64832d9 move zathura_get_document_size to document.c
It makes more sense, plus now the document knows about the page layout
and can do the computation.
2013-10-26 16:02:23 +02:00
Abdo Roig-Maranges
7329209d84 change arguments to page_calc_height_width
now accepts a document object and explicit width and height. This will
make it easier to reuse this function for computing the document page
cell width and height.
2013-10-26 15:58:26 +02:00
Marwan Tanager
d09cd5c62c Make the X clipboard buffer configurable
This patch adds a new configuration setting, selection-clipboard, which allows
us to choose between the PRIMARY selection, and the CLIPBOARD selection, for
determining which X clipboard to use for storing mouse-selected data. It has
only two valid values: "primary" and "clipboard", with "clipboard" being set as
the it's default value.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-08-31 12:30:12 +02:00
Sebastian Ramacher
7ebf15543b Use strrchr in file_get_extension
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-05-04 19:33:14 +02:00
Benoît Knecht
c9eef95492 Use signals to readjust_view_after_zooming()
Instead of guesstimating the values of the scrollbars adjustments after
a change in zoom level, connect callbacks to the "changed" GtkAdjustment
event (which is emitted when the bounds or page_size of the adjustment
change, e.g. when the zoom level changes), and compute the new values
from there.

The previous adjustment values are tracked in zathura->ui.hadjustment
and zathura->ui.vadjustment (and updated by signal handlers as well), so
that the view's position can be maintained while zooming.

cb_view_hadjustment_changed() centers the page horizontally if a
"best-fit" or "width" zoom is being performed, or if "zoom-center" is
true; otherwise, it keeps the view horizontally centered around the same
area of the page.

cb_view_vadjustment_changed() always keeps the view vertically centered
around the same area of the page.

Many thanks to Marwan Tanager for thoroughly reviewing the various
stages of this patch, and actually coming up with a working solution.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-03-23 16:02:56 +01:00
Sebastian Ramacher
0e3efe0504 Fix compiler warnings
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-02-23 17:32:30 +01:00
Sebastian Ramacher
f2ed53aa72 Fix the off-by-one with the poppler plugin
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-02-23 17:18:02 +01:00
Sebastian Ramacher
1fd5ca3ebb Remove some duplicated code
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-02-23 16:48:19 +01:00
Marwan Tanager
815c51d066 Pass hadjustment to set_adjustment() instead of vadjustment.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-02-08 14:24:18 +01:00
Sebastian Ramacher
a45c58f0b5 Add tests for replace_substring 2013-01-25 23:19:26 +01:00
Benoît Knecht
99fbf0d17b Add function to get the size of the laid out document
zathura_get_document_size computes the size of the document to be
displayed (in pixels), given the size of the individual cells. It takes
padding between the cells into account.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2012-12-13 18:18:03 +01:00
Moritz Lipp
89e7832047 Update style 2012-10-09 01:12:18 +02:00
Moritz Lipp
a08520a33d Implement cmd_exec with 2012-08-14 11:45:11 +02:00
Moritz Lipp
66b6fa65a1 Add --version command line argument 2012-07-12 10:37:58 +02:00
Julian Orth
30eda65aaa We added three options
1) zoom-center :: bool
   zoom-center = false

   If zoom-center = false nothing changes.
   If zoom-center = true zooming respects the horizontal center of the
   pageview. That is, the vertical line dividing the displayed part of
   the document doesn't move within the document.

   Reasoning: When viewing a pdf with a margin we usually want to hide the
   margin at both sides by zooming in.

2) scroll-hstep :: float
   scroll-hstep = -1

   If scroll-hstep < 0 nothing changes.
   If scroll-hstep >= 0 then scroll-hstep defines the scroll step in the
   horizontal direction.

   Reasoning: This allows us to make finer adjustments in the horizontal
   direction without the mouse and without loosing the ablility to
   navigate quickly through the document.

3) search-hadjust :: bool
   search-hadjust = true

   If search-hadjust = true nothing changes.
   If search-hadjust = false searching does not adjust the horizontal
   center of the document when showing search results.

   Reasoning: When viewing a pdf with a margin we usually want to hide
   the margin at both sides by zooming in. The horizontal adjustment
   sometimes hides parts of the document by moving the horizontal
   center.
2012-06-27 21:18:05 +02:00
Sebastian Ramacher
40dd2b469b Fix off-by-one. 2012-06-20 16:11:00 +02:00
Moritz Lipp
8e1cf395a5 Show correct page after leaving fullscreen mode
Fixes #220
2012-06-17 00:20:36 +02:00
Moritz Lipp
365dc9a66e Improve zathura_link_t 2012-05-28 12:43:22 +02:00
Moritz Lipp
2d6a63e6fe Evaluate ZATHURA_LINK_LAUNCH 2012-05-28 02:45:00 +02:00
Moritz Lipp
234ea6d323 Update file_valid_extension argument check 2012-05-21 23:16:29 +02:00
Moritz Lipp
b7b8f53cbe Resolve page-jumping while zooming on last page
Resolves the problem of jumping to a wrong possition
that occured while zooming on the last page of the document

Fixes: #166
2012-05-01 10:23:00 +02:00
Moritz Lipp
036dc0cd57 Implement hlsearch/nohlsearch 2012-04-22 19:12:45 +02:00
Moritz Lipp
a86940b3f4 Implement ZATHURA_LINK_GOTO_REMOTE 2012-04-22 11:11:36 +02:00
Moritz Lipp
adc9f41264 Introduce new link types 2012-04-22 10:04:46 +02:00
Moritz Lipp
7d92d54539 Implemented marks 2012-04-21 04:59:58 +02:00
Moritz Lipp
97247f41ca Unhitch zathura_t from document_t/page_t/plugin_manager_t 2012-04-03 09:02:45 +02:00
Moritz Lipp
025c995d89 Introduce plugin manager 2012-04-01 18:32:16 +02:00
Moritz Lipp
334b4fbb95 Introduce and use zathura_document wrapper functions 2012-03-27 21:59:35 +02:00
Moritz Lipp
4ade2c1472 Introduced plugin.h and plugin-api.h 2012-03-27 13:30:04 +02:00
Moritz Lipp
efc108fbe2 Introduced page.h 2012-03-26 14:44:56 +02:00
Sebastian Ramacher
2475c371fd There is really no reason to implement file_exists on our own. 2012-03-19 17:03:27 +01:00
Moritz Lipp
ce2113bbee Add NULL pointer check in file_valid_extension 2012-03-15 16:32:03 +01:00
Sebastian Ramacher
5dacede692 use getter functions to make it compatible with GTK+3 2012-02-12 12:22:11 +01:00
Moritz Lipp
043513558c Fix math.h include 2012-02-09 12:31:39 +01:00
Sebastian Ramacher
e513cb5579 store rotation in history 2012-02-08 22:23:45 +01:00
Sebastian Ramacher
c6403ec097 wrap gtk_adjustment_set_value 2012-02-08 21:34:53 +01:00
Sebastian Ramacher
6045e46069 fix the coordinate system 2012-02-07 21:45:32 +01:00
Moritz Lipp
21a65cbe34 Rename PageViewWidget to PageWidget 2012-02-07 18:30:46 +01:00
Moritz Lipp
0b88e118a5 Evaluate sc_follow input correctly 2012-02-07 18:00:47 +01:00
Sebastian Ramacher
57291989c5 calculate visible pages and update current page number 2012-02-07 14:56:58 +01:00
Sebastian Ramacher
a1cdb48921 Create a page view widget (Closes: #90).
Add a widget derived from GtkDrawingArea that handles the drawing. It
automaticaly requests rerendering of the page if necessary (i.e on a scroll and
rotate).

This should solve all the rendering issues.
2012-02-05 11:24:34 +01:00