Commit Graph

41 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
3412f40093 Update doc 2012-04-22 09:51:00 +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
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
900516d1f1 Update documentation 2012-02-09 02:58:53 +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
Moritz Lipp
34b6fffc33 Update documentation 2012-02-08 15:30:13 +01:00
Sebastian Ramacher
57291989c5 calculate visible pages and update current page number 2012-02-07 14:56:58 +01:00
Moritz Lipp
8ce61ed633 Implement recalc_rectangle
This function should be used to recalculate the coordinates of
a rectangle to its new coordinates on the rendered page
(depending on the current scale and rotation value)
2012-01-19 00:37:58 +01:00
Sebastian Ramacher
6c0a63943f fix the zooming issue 2011-12-10 10:19:14 +01:00
Sebastian Ramacher
911d84c908 update includes due to girara restructuring 2011-10-23 17:01:15 +02:00
Moritz Lipp
8bf7587baf Show document information 2011-10-01 23:29:40 +02:00
Moritz Lipp
2437d85471 Remove obsolete page_blank function 2011-05-27 12:57:57 +02:00
Moritz Lipp
caa058e4d2 cc_open: List only supported file types 2011-05-25 00:54:16 +02:00
Moritz Lipp
dc7c3d86eb Calculate page offset 2011-04-19 19:24:03 +02:00
Moritz Lipp
52377b994d Plugin register mechanism 2011-03-05 21:00:41 +01:00
Moritz Lipp
31027cbaad Began to implement the index view 2011-02-10 11:33:28 +08:00
Moritz Lipp
ccfe1d9fba Added some function comments 2011-02-01 22:56:43 +08:00
Moritz Lipp
0398692705 Detect which page should be rendered 2010-12-29 11:46:13 +01:00
Moritz Lipp
3f961f6c18 Continuous basics 2010-12-28 09:47:09 +01:00
Moritz Lipp
2cfe3f86b8 Complete printer list and execute command 2010-11-29 14:58:56 +01:00
Moritz Lipp
4857d62fde Init document, some changes 2010-11-18 02:41:46 +01:00
Moritz Lipp
6046fc71fb Include guards and shortcut definitions 2010-11-10 20:47:53 +01:00
Moritz Lipp
d51bd2bbe6 Updated file structure 2010-11-10 20:31:15 +01:00
Moritz Lipp
38ec3eea66 New file structure 2010-11-10 19:18:01 +01:00