Commit graph

499 commits

Author SHA1 Message Date
Sebastian Ramacher
15838abf56 Only enable reparent if we have X11
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-10-24 19:44:20 +02:00
Moritz Lipp
9ee079bd34 Use _DEFAULT_SOURCE instead of deprecated _BSD_SOURCE 2014-10-16 23:56:41 +02:00
Sebastian Ramacher
9a06b5f61e Add option to ignore images while recoloring
Ideally we would handle this differently. See the TODO entry in the render
function. But the patch is a start.

Thanks to carlos for the patch.

Closes: #398

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-09-30 19:45:07 +02:00
Sebastian Ramacher
d911d8c393 Replace deprecatec GtkAlignment
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-09-27 02:07:53 +02:00
Sebastian Ramacher
1ae4eda5b2 Print a warning if loading plugins failed. 2014-09-07 19:12:41 +02:00
Moritz Lipp
1608249709 Update visible pages after opening the file 2014-09-04 00:42:46 +02:00
Sebastian Ramacher
fca4d040a4 Move synctex logic away from ZathuraPage
Also emit the D-Bus signal
2014-08-22 20:42:33 +02:00
Sebastian Ramacher
bbe174ac08 Add cache directory
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-08-15 18:10:38 +02:00
Sebastian Ramacher
b99f0ed0db Also read from FIFOs and write content to temporary file
Closes: #425
2014-08-08 23:27:43 +02:00
Sebastian Ramacher
eabd883e62 Add synctex-editor-command setting
Also, turn on SyncTeX backward synchronization per default and remove -s option.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-07-26 16:14:36 +02:00
Sebastian Ramacher
db9ee77f13 Change cursor if mouse is over link
Thanks to MaximeC for the initial patch.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-05-24 18:04:59 +02:00
Sebastian Ramacher
8f61583af7 Style index mode with CSS
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-04-26 23:32:38 +02:00
Moritz Lipp
8409fb2a2d Catch SIGTERM on UNIX targets 2014-04-23 17:27:24 +02:00
Sebastian Ramacher
eb5010789b Document database setting
... and add null as possible values.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-04-19 19:19:56 +02:00
Sebastian Ramacher
ace31581b4 Add --mode option
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-29 20:59:45 +01:00
Sebastian Ramacher
71e10b5f3c Add a cast
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-20 17:31:46 +01:00
akbjker
bb47adb270 Center pages
Whoops, you're right. I misunderstood the purpose of gtk_widget_reparent.

Here's the patch v2.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-20 16:33:30 +01: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
8b701f609c Finish renaming
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-12 22:23:29 +01:00
Sebastian Ramacher
d0b7676bc3 Just return a list of rectangles
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-11 22:04:14 +01:00
Sebastian Ramacher
26333fb20c Run D-Bus service all the time
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-11 22:03:36 +01:00
Sebastian Ramacher
68b665a49d Move config file loading to config.c 2014-01-06 16:02:58 +01:00
Sebastian Ramacher
f9ef7598a4 Add syntex-dbus-service setting to en/disable D-Bus service for synctex 2014-01-05 14:57:48 +01:00
Sebastian Ramacher
f7fddf750e Initial D-Bus interface for synctex
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-12-23 18:16:36 +01:00
Sebastian Ramacher
45a997c88e More consts
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-12-17 16:32:50 +01:00
Sebastian Ramacher
660a3e7757 CS
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-12-17 16:27:34 +01:00
Sebastian Ramacher
87af53afbb Make inital values more explicit
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-12-17 16:26:13 +01:00
Sebastian Neuser
42a8382a45 Set position on document load only if no page was specified 2013-12-17 15:38:40 +01:00
Sebastian Ramacher
f59a6f539e Remove GTK+2 support
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-11-25 18:57:59 +01:00
Sebastian Ramacher
903dae55e0 Get the correct adjustment
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-11-05 02:29:20 +01:00
Sebastian Ramacher
08d799a1f8 Set viewport info early and set correct page size the first time
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-11-05 02:22:30 +01:00
Sebastian Ramacher
cc0ad0ad64 Make a string translatable 2013-11-04 19:57:23 +01:00
Sebastian Ramacher
3575157cb2 Connect the correct callback
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-10-31 14:39:32 +01:00
Abdo Roig-Maranges
e02806b6e2 get rid of the hide_inputbar hack
We no longer need to hide the inputbar to get the right jump position,
since now showing or hiding the inputbar does not change the position
stored in the document object.

Wen the adjustments get resized, the changed_callback resets the value
from what is stored in the document object, effectively recentering the
position to the middle of the viewport.
2013-10-26 17:13:57 +02:00
Abdo Roig-Maranges
84736dc89b remove zathura->global.update_page_number global hack
The callbacks are no longer aware of it anyways
2013-10-26 17:13:57 +02:00
Abdo Roig-Maranges
9367d646d9 get rid of tracking adjustments
They are not used anywere, and do not seem to become useful anymore in
the light of the new separation of document and view.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
860c748889 remove delayed versions of page_set and position_set
We don't need the anymore since the new page_set and position_set are
already 'delayed'.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
4a75efd4f2 use the new document functions for the jumplist
And get rid of explicit gtk calls to the adjustment
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
6ca81e3716 use the new document functions for marks, bookmarks and initialization
We get the position data from the document object instead of the gtk
adjustment itself.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
1171bffb6b replace delayed versions of page_set and position_set
The new page_set and position_set behave as delayed, but with the
immediate availability of the new positions through the document
object. We no longer need to keep delayed and non-delayed versions!
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
3634636227 adapt view_adjustment callbacks to new document/view separation
The adjustment callbacks act as an interface between position data in
the document object, and the adjustments.

We remove the horizontal centering code, as now it is done by
position_set. Those callbacks should not change the position read from
the document object in any way.

Also, we split the adjustment_value_changed callback into a vertical and
an horizontal version. Previously a single callback was reused for both,
horizontal and vertical. That lead to a subtle problem when coming out
of index mode. What happened was the following:

  1. horizontal adjustment bounds change coming out of index mode. This
     triggers an hadjustment changed signal.

  2. the hadjustment_changed callback handles it, and resets the
     hadjustment value, as the bound may have changed. This triggers a
     value_changed event.

  3. the value_changed callback handles the event, and captures the
     position for *BOTH*, horizontal and vertical adjustments, saving
     them to the document object.

  1..3 is repeated for the vertical adjustment.

  Now, if in 3. the horizontal adjustment bounds were not yet updated
  after the index mode, we got ourselves at the wrong vertical position.

This race condition is avoided now because both value_changed callbacks
*ONLY* handle their own direction, either vertical or horizontal, not
 both.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
c4245600c9 move adjustment code from sc_adjust_window to adjust_view
This new function adjust_view is in charge of recomputing the scale
according to adjustment settings and trigger a render_all.

adjust_view contains the old sc_adjust_window code, slightly simplified
thanks to the availability of the document_get_viewport_size.

Then it is used by sc_adjust_window, document_open and the
cb_view_resized callback. Makes slightly more sense this way than
calling the shortcut sc_adjust_window directly.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
54b6f7336d make position_set and page_set more asynchronous
Now page_set and position_set save the computed page and position to the
document object, then trigger a refresh-view signal. They do not handle
GTK adjustments anymore.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
692e72abd4 add a custom refresh-view signal
Now we can trigger a gtk page refresh calling refresh_view. This
function triggers a custom signal refresh-view, whose handler copies the
position from the document object to the adjustments.
2013-10-26 17:13:56 +02:00
Abdo Roig-Maranges
c5930c900a page_widget_set_mode now sets the page-padding too
- fix the computation of the number of rows in the table. Doing a ceil
    of an integer division has no effect...

  - set the page_padding in page_widget_set_mode function, instead of
    doing it independently.

  - call zathura_document_set_layout after calling page_widget_set_mode
    to save the page layout settings into the document object.
2013-10-26 16:01:02 +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
Sebastian Ramacher
e7cd4e5f8c Move page cache to ZathuraRenderer
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-10-18 20:00:04 +02:00
Sebastian Ramacher
2c9e34fa8a Merge branch 'feature/renderer-take-2' into develop 2013-10-18 16:12:50 +02:00