Commit graph

68 commits

Author SHA1 Message Date
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
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
Sebastian Ramacher
10fbf29125 adopt to girara changes 2011-10-17 11:16:14 +02:00
Sebastian Ramacher
b719e8701c get rid of warnings 2011-09-29 18:08:37 +02:00
Sebastian Ramacher
1e18d7f3ea display page in index 2011-09-29 17:28:09 +02:00
Sebastian Ramacher
225bc75baf generate index 2011-09-29 16:50:52 +02:00
Sebastian Ramacher
b34d21afaf implement content type support 2011-09-29 15:23:13 +02:00
Moritz Lipp
a6268788c0 Resolve warnings caused by -Wextra 2011-09-21 00:46:03 +02:00
Moritz Lipp
2437d85471 Remove obsolete page_blank function 2011-05-27 12:57:57 +02:00
Moritz Lipp
b4f834d462 Fix segmentation fault in extension checking 2011-05-26 12:05:10 +02:00