From d58fccd494f8020b5e1291c126ee345261823d6f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 24 Nov 2013 21:31:43 +0100 Subject: [PATCH 001/129] Document fullscreen key bindings more explicitely Signed-off-by: Sebastian Ramacher --- zathura.1.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/zathura.1.rst b/zathura.1.rst index 664b525..8c74946 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -122,6 +122,28 @@ mX q Quit +Fullscreen mode +--------------- + +J, K + Go to the next or previous page +space, , + Scroll a full page down or up +gg, G, nG + Goto to the first, the last or to the nth page +^c, Escape + Abort +F5 + Switch to normal mode ++, -, = + Zoom in, out or to the original size +zI, zO, z0 + Zoom in, out or to the original size +n= + Zoom to size n +q + Quit + Index mode ---------- From f59a6f539e4c00dba9d5f491451cad96014933b3 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 25 Nov 2013 18:57:59 +0100 Subject: [PATCH 002/129] Remove GTK+2 support Signed-off-by: Sebastian Ramacher --- config.c | 1 - page-widget.c | 53 +-------------------------------------------------- zathura.c | 25 ------------------------ zathura.h | 9 +-------- 4 files changed, 2 insertions(+), 86 deletions(-) diff --git a/config.c b/config.c index 33c1419..72b5100 100644 --- a/config.c +++ b/config.c @@ -15,7 +15,6 @@ #include #include #include -#include #include static void diff --git a/page-widget.c b/page-widget.c index 6f328bc..720fed9 100644 --- a/page-widget.c +++ b/page-widget.c @@ -61,9 +61,6 @@ typedef struct zathura_page_widget_private_s { zathura_page_widget_private_t)) static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo); -#if GTK_MAJOR_VERSION == 2 -static gboolean zathura_page_widget_expose(GtkWidget* widget, GdkEventExpose* event); -#endif static void zathura_page_widget_finalize(GObject* object); static void zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec); static void zathura_page_widget_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec); @@ -111,11 +108,7 @@ zathura_page_widget_class_init(ZathuraPageClass* class) /* overwrite methods */ GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(class); -#if GTK_MAJOR_VERSION == 2 - widget_class->expose_event = zathura_page_widget_expose; -#else widget_class->draw = zathura_page_widget_draw; -#endif widget_class->size_allocate = zathura_page_widget_size_allocate; widget_class->button_press_event = cb_zathura_page_widget_button_press_event; widget_class->button_release_event = cb_zathura_page_widget_button_release_event; @@ -368,43 +361,15 @@ zathura_page_widget_get_property(GObject* object, guint prop_id, GValue* value, } } -#if GTK_MAJOR_VERSION == 2 -static gboolean -zathura_page_widget_expose(GtkWidget* widget, GdkEventExpose* event) -{ - cairo_t* cairo = gdk_cairo_create(gtk_widget_get_window(widget)); - if (cairo == NULL) { - girara_error("Could not retrieve cairo object"); - return FALSE; - } - - /* set clip region */ - cairo_rectangle(cairo, event->area.x, event->area.y, event->area.width, event->area.height); - cairo_clip(cairo); - - const gboolean ret = zathura_page_widget_draw(widget, cairo); - cairo_destroy(cairo); - return ret; -} -#endif - static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) { zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); mutex_lock(&(priv->lock)); - zathura_document_t* document = zathura_page_get_document(priv->page); - -#if GTK_MAJOR_VERSION == 2 - GtkAllocation allocation; - gtk_widget_get_allocation(widget, &allocation); - const unsigned int page_height = allocation.height; - const unsigned int page_width = allocation.width; -#else + zathura_document_t* document = zathura_page_get_document(priv->page); const unsigned int page_height = gtk_widget_get_allocated_height(widget); const unsigned int page_width = gtk_widget_get_allocated_width(widget); -#endif if (priv->surface != NULL) { cairo_save(cairo); @@ -620,11 +585,7 @@ redraw_rect(ZathuraPage* widget, zathura_rectangle_t* rectangle) grect.y = rectangle->y1; grect.width = (rectangle->x2 + 1) - rectangle->x1; grect.height = (rectangle->y2 + 1) - rectangle->y1; -#if GTK_MAJOR_VERSION == 2 - gdk_window_invalidate_rect(gtk_widget_get_window(GTK_WIDGET(widget)), &grect, TRUE); -#else gtk_widget_queue_draw_area(GTK_WIDGET(widget), grect.x, grect.y, grect.width, grect.height); -#endif } static void @@ -890,19 +851,7 @@ cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page) const int width = cairo_image_surface_get_width(surface); const int height = cairo_image_surface_get_height(surface); -#if GTK_MAJOR_VERSION == 2 - GdkPixmap* pixmap = gdk_pixmap_new(gtk_widget_get_window(GTK_WIDGET(item)), width, height, -1); - cairo_t* cairo = gdk_cairo_create(pixmap); - - cairo_set_source_surface(cairo, surface, 0, 0); - cairo_paint(cairo); - cairo_destroy(cairo); - - GdkPixbuf* pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, 0, 0, 0, - 0, width, height); -#else GdkPixbuf* pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, width, height); -#endif g_signal_emit(page, signals[IMAGE_SELECTED], 0, pixbuf); g_object_unref(pixbuf); cairo_surface_destroy(surface); diff --git a/zathura.c b/zathura.c index 2449698..55b72e5 100644 --- a/zathura.c +++ b/zathura.c @@ -146,13 +146,9 @@ zathura_init(zathura_t* zathura) G_CALLBACK(cb_refresh_view), zathura); /* page view */ -#if (GTK_MAJOR_VERSION == 3) zathura->ui.page_widget = gtk_grid_new(); gtk_grid_set_row_homogeneous(GTK_GRID(zathura->ui.page_widget), TRUE); gtk_grid_set_column_homogeneous(GTK_GRID(zathura->ui.page_widget), TRUE); -#else - zathura->ui.page_widget = gtk_table_new(0, 0, TRUE); -#endif if (zathura->ui.page_widget == NULL) { goto error_free; } @@ -184,13 +180,10 @@ zathura_init(zathura_t* zathura) } gtk_container_add(GTK_CONTAINER(zathura->ui.page_widget_alignment), zathura->ui.page_widget); -#if (GTK_MAJOR_VERSION == 3) gtk_widget_set_hexpand_set(zathura->ui.page_widget_alignment, TRUE); gtk_widget_set_hexpand(zathura->ui.page_widget_alignment, FALSE); gtk_widget_set_vexpand_set(zathura->ui.page_widget_alignment, TRUE); gtk_widget_set_vexpand(zathura->ui.page_widget_alignment, FALSE); -#endif - gtk_widget_show(zathura->ui.page_widget); @@ -325,11 +318,7 @@ zathura_free(zathura_t* zathura) } void -#if (GTK_MAJOR_VERSION == 2) -zathura_set_xid(zathura_t* zathura, GdkNativeWindow xid) -#else zathura_set_xid(zathura_t* zathura, Window xid) -#endif { g_return_if_fail(zathura != NULL); @@ -1060,30 +1049,16 @@ page_widget_set_mode(zathura_t* zathura, unsigned int page_padding, unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); -#if (GTK_MAJOR_VERSION == 3) gtk_grid_set_row_spacing(GTK_GRID(zathura->ui.page_widget), page_padding); gtk_grid_set_column_spacing(GTK_GRID(zathura->ui.page_widget), page_padding); -#else - gtk_table_set_row_spacings(GTK_TABLE(zathura->ui.page_widget), page_padding); - gtk_table_set_col_spacings(GTK_TABLE(zathura->ui.page_widget), page_padding); - - unsigned int ncol = pages_per_row; - unsigned int nrow = (number_of_pages + first_page_column - 1 + ncol - 1) / ncol; - gtk_table_resize(GTK_TABLE(zathura->ui.page_widget), nrow, ncol); -#endif - for (unsigned int i = 0; i < number_of_pages; i++) { int x = (i + first_page_column - 1) % pages_per_row; int y = (i + first_page_column - 1) / pages_per_row; zathura_page_t* page = zathura_document_get_page(zathura->document, i); GtkWidget* page_widget = zathura_page_get_widget(zathura, page); -#if (GTK_MAJOR_VERSION == 3) gtk_grid_attach(GTK_GRID(zathura->ui.page_widget), page_widget, x, y, 1, 1); -#else - gtk_table_attach(GTK_TABLE(zathura->ui.page_widget), page_widget, x, x + 1, y, y + 1, GTK_SHRINK, GTK_SHRINK, 0, 0); -#endif } gtk_widget_show_all(zathura->ui.page_widget); diff --git a/zathura.h b/zathura.h index 4b198ed..633e73f 100644 --- a/zathura.h +++ b/zathura.h @@ -6,13 +6,10 @@ #include #include #include +#include #include "macros.h" #include "types.h" -#if (GTK_MAJOR_VERSION == 3) -#include -#endif - enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT, DELETE_LAST_WORD, DELETE_LAST_CHAR, DEFAULT, ERROR, WARNING, NEXT_GROUP, PREVIOUS_GROUP, ZOOM_IN, ZOOM_OUT, ZOOM_ORIGINAL, ZOOM_SPECIFIC, FORWARD, @@ -190,11 +187,7 @@ void zathura_free(zathura_t* zathura); * @param zathura The zathura session * @param xid The window id */ -#if (GTK_MAJOR_VERSION == 2) -void zathura_set_xid(zathura_t* zathura, GdkNativeWindow xid); -#else void zathura_set_xid(zathura_t* zathura, Window xid); -#endif /** * Set the path to the configuration directory From 80a54e70f8f78cd82af875a019c478d211527d7e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 25 Nov 2013 18:59:02 +0100 Subject: [PATCH 003/129] Update README Signed-off-by: Sebastian Ramacher --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index 111cdf2..04bf619 100644 --- a/README +++ b/README @@ -5,9 +5,9 @@ girara user interface library and several document libraries. Requirements ------------ -gtk2 (>= 2.18) or gtk3 +gtk3 glib (>= 2.28) -girara +girara (>= 0.1.8) sqlite3 (optional, >= 3.5.9) check (for tests) intltool From 0406cbe495ff13aaa7917f64f760b79286636283 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 25 Nov 2013 19:02:43 +0100 Subject: [PATCH 004/129] Drop compat code for glib < 2.28 Signed-off-by: Sebastian Ramacher --- glib-compat.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/glib-compat.h b/glib-compat.h index d13e59f..c76ccca 100644 --- a/glib-compat.h +++ b/glib-compat.h @@ -20,14 +20,4 @@ #define mutex_free(m) g_mutex_clear((m)) #endif -/* g_get_real_time appeared in 2.28 */ -#if !GLIB_CHECK_VERSION(2, 27, 0) -inline static gint64 g_get_real_time(void) -{ - GTimeVal tv; - g_get_current_time(&tv); - return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec; -} -#endif - #endif From 7d5a5868114d449ea6bb8cd2b15b0883ddb2034b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 25 Nov 2013 19:05:46 +0100 Subject: [PATCH 005/129] Drop more GTK+2 code Signed-off-by: Sebastian Ramacher --- main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.c b/main.c index 7f3ac59..bd81b98 100644 --- a/main.c +++ b/main.c @@ -47,12 +47,7 @@ main(int argc, char* argv[]) bool print_version = false; bool synctex = false; int page_number = ZATHURA_PAGE_NUMBER_UNSPECIFIED; - -#if GTK_CHECK_VERSION(3, 0, 0) - Window embed = 0; -#else - GdkNativeWindow embed = 0; -#endif + Window embed = 0; GOptionEntry entries[] = { { "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, _("Reparents to window specified by xid"), "xid" }, From 7f82bec71bb7d5ac97a824df267366483ea70ba1 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Mon, 25 Nov 2013 23:10:35 +0100 Subject: [PATCH 006/129] Replace fullscreen mode with presentation mode --- config.c | 285 +++++++++++++++++++++++++++------------------------- shortcuts.c | 31 +++++- shortcuts.h | 11 ++ zathura.h | 1 + 4 files changed, 188 insertions(+), 140 deletions(-) diff --git a/config.c b/config.c index 33c1419..1d35618 100644 --- a/config.c +++ b/config.c @@ -115,16 +115,19 @@ config_load_default(zathura_t* zathura) girara_session_t* gsession = zathura->ui.session; /* mode settings */ - zathura->modes.normal = gsession->modes.normal; - zathura->modes.fullscreen = girara_mode_add(gsession, "fullscreen"); - zathura->modes.index = girara_mode_add(gsession, "index"); - zathura->modes.insert = girara_mode_add(gsession, "insert"); + zathura->modes.normal = gsession->modes.normal; + zathura->modes.fullscreen = girara_mode_add(gsession, "fullscreen"); + zathura->modes.index = girara_mode_add(gsession, "index"); + zathura->modes.insert = girara_mode_add(gsession, "insert"); + zathura->modes.presentation = girara_mode_add(gsession, "presentation"); #define NORMAL zathura->modes.normal #define INSERT zathura->modes.insert #define INDEX zathura->modes.index #define FULLSCREEN zathura->modes.fullscreen +#define PRESENTATION zathura->modes.presentation + /* Set default mode */ girara_mode_set(gsession, zathura->modes.normal); /* zathura settings */ @@ -209,162 +212,165 @@ config_load_default(zathura_t* zathura) string_value = "primary"; girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL); - /* define default shortcuts */ - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Escape, NULL, sc_abort, 0, 0, NULL); +#define DEFAULT_SHORTCUTS(mode) \ + girara_shortcut_add(gsession, 0, GDK_KEY_a, NULL, sc_adjust_window, (mode), ZATHURA_ADJUST_BESTFIT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_s, NULL, sc_adjust_window, (mode), ZATHURA_ADJUST_WIDTH, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_F, NULL, sc_display_link, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_slash, NULL, sc_focus_inputbar, (mode), 0, &("/")); \ + girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_slash, NULL, sc_focus_inputbar, (mode), 0, &("/")); \ + girara_shortcut_add(gsession, 0, GDK_KEY_question, NULL, sc_focus_inputbar, (mode), 0, &("?")); \ + girara_shortcut_add(gsession, 0, GDK_KEY_colon, NULL, sc_focus_inputbar, (mode), 0, &(":")); \ + girara_shortcut_add(gsession, 0, GDK_KEY_o, NULL, sc_focus_inputbar, (mode), 0, &(":open ")); \ + girara_shortcut_add(gsession, 0, GDK_KEY_O, NULL, sc_focus_inputbar, (mode), APPEND_FILEPATH, &(":open ")); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_f, NULL, sc_follow, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, 0, "gg", sc_goto, (mode), TOP, NULL); \ + girara_shortcut_add(gsession, 0, 0, "G", sc_goto, (mode), BOTTOM, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_m, NULL, sc_mark_add, (mode), 0, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_apostrophe, NULL, sc_mark_evaluate, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_J, NULL, sc_navigate, (mode), NEXT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_K, NULL, sc_navigate, (mode), PREVIOUS, NULL); \ + girara_shortcut_add(gsession, GDK_MOD1_MASK, GDK_KEY_Right, NULL, sc_navigate, (mode), NEXT, NULL); \ + girara_shortcut_add(gsession, GDK_MOD1_MASK, GDK_KEY_Left, NULL, sc_navigate, (mode), PREVIOUS, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_Page_Down, NULL, sc_navigate, (mode), NEXT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_Page_Up, NULL, sc_navigate, (mode), PREVIOUS, NULL); \ +\ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_p, NULL, sc_print, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_r, NULL, sc_recolor, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_R, NULL, sc_reload, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_r, NULL, sc_rotate, (mode), ROTATE_CW, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_h, NULL, sc_scroll, (mode), LEFT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_j, NULL, sc_scroll, (mode), DOWN, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_k, NULL, sc_scroll, (mode), UP, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_l, NULL, sc_scroll, (mode), RIGHT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_scroll, (mode), LEFT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_scroll, (mode), UP, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_scroll, (mode), DOWN, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_scroll, (mode), RIGHT, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_t, NULL, sc_scroll, (mode), HALF_LEFT, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_d, NULL, sc_scroll, (mode), HALF_DOWN, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_u, NULL, sc_scroll, (mode), HALF_UP, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_y, NULL, sc_scroll, (mode), HALF_RIGHT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_t, NULL, sc_scroll, (mode), FULL_LEFT, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_f, NULL, sc_scroll, (mode), FULL_DOWN, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_b, NULL, sc_scroll, (mode), FULL_UP, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_y, NULL, sc_scroll, (mode), FULL_RIGHT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_scroll, (mode), FULL_DOWN, NULL); \ + girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_space, NULL, sc_scroll, (mode), FULL_UP, NULL); \ +\ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_o, NULL, sc_jumplist, (mode), BACKWARD, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_i, NULL, sc_jumplist, (mode), FORWARD, NULL); \ +\ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_j, NULL, sc_bisect, (mode), FORWARD, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_k, NULL, sc_bisect, (mode), BACKWARD, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_n, NULL, sc_search, (mode), FORWARD, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_N, NULL, sc_search, (mode), BACKWARD, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_Tab, NULL, sc_toggle_index, (mode), 0, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_n, NULL, girara_sc_toggle_statusbar, (mode), 0, NULL); \ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_m, NULL, girara_sc_toggle_inputbar, (mode), 0, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_d, NULL, sc_toggle_page_mode, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_q, NULL, sc_quit, (mode), 0, NULL); \ - girara_shortcut_add(gsession, 0, GDK_KEY_a, NULL, sc_adjust_window, NORMAL, ZATHURA_ADJUST_BESTFIT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_s, NULL, sc_adjust_window, NORMAL, ZATHURA_ADJUST_WIDTH, NULL); +#define DEFAULT_MOUSE_EVENTS(mode) \ + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_UP, UP, NULL); \ + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); \ + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_LEFT, LEFT, NULL); \ + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_RIGHT, RIGHT, NULL); \ +\ + girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_UP, LEFT, NULL); \ + girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_DOWN, RIGHT, NULL); \ +\ + girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, (mode), GIRARA_EVENT_SCROLL_UP, UP, NULL); \ + girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, (mode), GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); \ + girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, (mode), GIRARA_EVENT_BUTTON_PRESS, 0, NULL); \ + girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, (mode), GIRARA_EVENT_BUTTON_RELEASE, 0, NULL); \ + girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_MOTION_NOTIFY, 0, NULL); \ - girara_shortcut_add(gsession, 0, GDK_KEY_F, NULL, sc_display_link, NORMAL, 0, NULL); + /* Define mode-less shortcuts */ + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Escape, NULL, sc_abort, 0, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_slash, NULL, sc_focus_inputbar, NORMAL, 0, &("/")); - girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_slash, NULL, sc_focus_inputbar, NORMAL, 0, &("/")); - girara_shortcut_add(gsession, 0, GDK_KEY_question, NULL, sc_focus_inputbar, NORMAL, 0, &("?")); - girara_shortcut_add(gsession, 0, GDK_KEY_colon, NULL, sc_focus_inputbar, NORMAL, 0, &(":")); - girara_shortcut_add(gsession, 0, GDK_KEY_o, NULL, sc_focus_inputbar, NORMAL, 0, &(":open ")); - girara_shortcut_add(gsession, 0, GDK_KEY_O, NULL, sc_focus_inputbar, NORMAL, APPEND_FILEPATH, &(":open ")); + /* Normal mode */ + girara_shortcut_add(gsession, 0, GDK_KEY_F5, NULL, sc_toggle_presentation, NORMAL, 0, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_F11, NULL, sc_toggle_fullscreen, NORMAL, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_f, NULL, sc_follow, NORMAL, 0, NULL); + DEFAULT_SHORTCUTS(NORMAL) - girara_shortcut_add(gsession, 0, 0, "gg", sc_goto, NORMAL, TOP, NULL); - girara_shortcut_add(gsession, 0, 0, "gg", sc_goto, FULLSCREEN, TOP, NULL); - girara_shortcut_add(gsession, 0, 0, "G", sc_goto, NORMAL, BOTTOM, NULL); - girara_shortcut_add(gsession, 0, 0, "G", sc_goto, FULLSCREEN, BOTTOM, NULL); + /* Normal mode - Mouse events */ + DEFAULT_MOUSE_EVENTS(NORMAL) - girara_shortcut_add(gsession, 0, GDK_KEY_m, NULL, sc_mark_add, NORMAL, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_apostrophe, NULL, sc_mark_evaluate, NORMAL, 0, NULL); + /* Fullscreen mode */ + girara_shortcut_add(gsession, 0, GDK_KEY_F11, NULL, sc_toggle_fullscreen, FULLSCREEN, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_J, NULL, sc_navigate, NORMAL, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_K, NULL, sc_navigate, NORMAL, PREVIOUS, NULL); - girara_shortcut_add(gsession, GDK_MOD1_MASK, GDK_KEY_Right, NULL, sc_navigate, NORMAL, NEXT, NULL); - girara_shortcut_add(gsession, GDK_MOD1_MASK, GDK_KEY_Left, NULL, sc_navigate, NORMAL, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Page_Down, NULL, sc_navigate, NORMAL, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Page_Up, NULL, sc_navigate, NORMAL, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_J, NULL, sc_navigate, FULLSCREEN, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_navigate, FULLSCREEN, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_navigate, FULLSCREEN, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Page_Down, NULL, sc_navigate, FULLSCREEN, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_navigate, FULLSCREEN, NEXT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_K, NULL, sc_navigate, FULLSCREEN, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_navigate, FULLSCREEN, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_navigate, FULLSCREEN, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Page_Up, NULL, sc_navigate, FULLSCREEN, PREVIOUS, NULL); - girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_space, NULL, sc_navigate, FULLSCREEN, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_BackSpace, NULL, sc_navigate, FULLSCREEN, PREVIOUS, NULL); + DEFAULT_SHORTCUTS(FULLSCREEN) - girara_shortcut_add(gsession, 0, GDK_KEY_k, NULL, sc_navigate_index, INDEX, UP, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_j, NULL, sc_navigate_index, INDEX, DOWN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_h, NULL, sc_navigate_index, INDEX, COLLAPSE, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_l, NULL, sc_navigate_index, INDEX, EXPAND, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_L, NULL, sc_navigate_index, INDEX, EXPAND_ALL, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_H, NULL, sc_navigate_index, INDEX, COLLAPSE_ALL, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_navigate_index, INDEX, UP, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_navigate_index, INDEX, DOWN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_navigate_index, INDEX, COLLAPSE, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_navigate_index, INDEX, EXPAND, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_navigate_index, INDEX, SELECT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Return, NULL, sc_navigate_index, INDEX, SELECT, NULL); + /* Fullscreen mode - Mouse events */ + DEFAULT_MOUSE_EVENTS(FULLSCREEN) - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_p, NULL, sc_print, NORMAL, 0, NULL); + /* Index mode */ + girara_shortcut_add(gsession, 0, GDK_KEY_Tab, NULL, sc_toggle_index, INDEX, 0, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_r, NULL, sc_recolor, NORMAL, 0, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_k, NULL, sc_navigate_index, INDEX, UP, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_j, NULL, sc_navigate_index, INDEX, DOWN, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_h, NULL, sc_navigate_index, INDEX, COLLAPSE, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_l, NULL, sc_navigate_index, INDEX, EXPAND, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_L, NULL, sc_navigate_index, INDEX, EXPAND_ALL, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_H, NULL, sc_navigate_index, INDEX, COLLAPSE_ALL, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_navigate_index, INDEX, UP, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_navigate_index, INDEX, DOWN, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_navigate_index, INDEX, COLLAPSE, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_navigate_index, INDEX, EXPAND, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_navigate_index, INDEX, SELECT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Return, NULL, sc_navigate_index, INDEX, SELECT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_R, NULL, sc_reload, NORMAL, 0, NULL); + /* Presentation mode */ + girara_shortcut_add(gsession, 0, GDK_KEY_J, NULL, sc_navigate, PRESENTATION, NEXT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_navigate, PRESENTATION, NEXT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_navigate, PRESENTATION, NEXT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Page_Down, NULL, sc_navigate, PRESENTATION, NEXT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_navigate, PRESENTATION, NEXT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_K, NULL, sc_navigate, PRESENTATION, PREVIOUS, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_navigate, PRESENTATION, PREVIOUS, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_navigate, PRESENTATION, PREVIOUS, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Page_Up, NULL, sc_navigate, PRESENTATION, PREVIOUS, NULL); + girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_space, NULL, sc_navigate, PRESENTATION, PREVIOUS, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_BackSpace, NULL, sc_navigate, PRESENTATION, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_r, NULL, sc_rotate, NORMAL, ROTATE_CW, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_F5, NULL, sc_toggle_presentation, PRESENTATION, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_h, NULL, sc_scroll, NORMAL, LEFT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_j, NULL, sc_scroll, NORMAL, DOWN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_k, NULL, sc_scroll, NORMAL, UP, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_l, NULL, sc_scroll, NORMAL, RIGHT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_scroll, NORMAL, LEFT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_scroll, NORMAL, UP, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_scroll, NORMAL, DOWN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_scroll, NORMAL, RIGHT, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_t, NULL, sc_scroll, NORMAL, HALF_LEFT, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_d, NULL, sc_scroll, NORMAL, HALF_DOWN, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_u, NULL, sc_scroll, NORMAL, HALF_UP, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_y, NULL, sc_scroll, NORMAL, HALF_RIGHT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_t, NULL, sc_scroll, NORMAL, FULL_LEFT, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_f, NULL, sc_scroll, NORMAL, FULL_DOWN, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_b, NULL, sc_scroll, NORMAL, FULL_UP, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_y, NULL, sc_scroll, NORMAL, FULL_RIGHT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_scroll, NORMAL, FULL_DOWN, NULL); - girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_space, NULL, sc_scroll, NORMAL, FULL_UP, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_o, NULL, sc_jumplist, NORMAL, BACKWARD, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_i, NULL, sc_jumplist, NORMAL, FORWARD, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_j, NULL, sc_bisect, NORMAL, FORWARD, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_k, NULL, sc_bisect, NORMAL, BACKWARD, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_n, NULL, sc_search, NORMAL, FORWARD, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_N, NULL, sc_search, NORMAL, BACKWARD, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_q, NULL, sc_quit, PRESENTATION, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Tab, NULL, sc_toggle_index, NORMAL, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Tab, NULL, sc_toggle_index, INDEX, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_F5, NULL, sc_toggle_fullscreen, NORMAL, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_F5, NULL, sc_toggle_fullscreen, FULLSCREEN, 0, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_n, NULL, girara_sc_toggle_statusbar, NORMAL, 0, NULL); - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_m, NULL, girara_sc_toggle_inputbar, NORMAL, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_d, NULL, sc_toggle_page_mode, NORMAL, 0, NULL); + /* Presentation mode - Mouse events */ + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, PRESENTATION, GIRARA_EVENT_SCROLL_UP, UP, NULL); + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, PRESENTATION, GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, PRESENTATION, GIRARA_EVENT_SCROLL_LEFT, LEFT, NULL); + girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, PRESENTATION, GIRARA_EVENT_SCROLL_RIGHT, RIGHT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_q, NULL, sc_quit, NORMAL, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_q, NULL, sc_quit, FULLSCREEN, 0, NULL); + girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON1, sc_navigate, PRESENTATION, GIRARA_EVENT_BUTTON_PRESS, NEXT, NULL); + girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON3, sc_navigate, PRESENTATION, GIRARA_EVENT_BUTTON_PRESS, PREVIOUS, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_plus, NULL, sc_zoom, NORMAL, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_KP_Add, NULL, sc_zoom, NORMAL, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_plus, NULL, sc_zoom, FULLSCREEN, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_KP_Add, NULL, sc_zoom, FULLSCREEN, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_minus, NULL, sc_zoom, NORMAL, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_KP_Subtract,NULL, sc_zoom, NORMAL, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_minus, NULL, sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_KP_Subtract,NULL, sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, NORMAL, ZOOM_SPECIFIC, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL); - girara_shortcut_add(gsession, 0, 0, "zi", sc_zoom, NORMAL, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, 0, "zi", sc_zoom, FULLSCREEN, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, 0, "zI", sc_zoom, NORMAL, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, 0, "zI", sc_zoom, FULLSCREEN, ZOOM_IN, NULL); - girara_shortcut_add(gsession, 0, 0, "zo", sc_zoom, NORMAL, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, 0, "zo", sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, 0, "zO", sc_zoom, NORMAL, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, 0, "zO", sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); - girara_shortcut_add(gsession, 0, 0, "z0", sc_zoom, NORMAL, ZOOM_ORIGINAL, NULL); - girara_shortcut_add(gsession, 0, 0, "z0", sc_zoom, FULLSCREEN, ZOOM_ORIGINAL, NULL); - girara_shortcut_add(gsession, 0, 0, "zz", sc_zoom, NORMAL, ZOOM_SPECIFIC, NULL); - girara_shortcut_add(gsession, 0, 0, "zz", sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL); - girara_shortcut_add(gsession, 0, 0, "zZ", sc_zoom, NORMAL, ZOOM_SPECIFIC, NULL); - girara_shortcut_add(gsession, 0, 0, "zZ", sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL); + girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, PRESENTATION, GIRARA_EVENT_SCROLL_UP, LEFT, NULL); + girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, PRESENTATION, GIRARA_EVENT_SCROLL_DOWN, RIGHT, NULL); + + girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, PRESENTATION, GIRARA_EVENT_SCROLL_UP, UP, NULL); + girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, PRESENTATION, GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); /* inputbar shortcuts */ girara_inputbar_shortcut_add(gsession, 0, GDK_KEY_Escape, sc_abort, 0, NULL); girara_inputbar_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, sc_abort, 0, NULL); - /* mouse events */ - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_UP, UP, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_UP, UP, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_LEFT, LEFT, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_LEFT, LEFT, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_RIGHT, RIGHT, NULL); - girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_RIGHT, RIGHT, NULL); - - girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON1, sc_navigate, FULLSCREEN, GIRARA_EVENT_BUTTON_PRESS, NEXT, NULL); - girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON3, sc_navigate, FULLSCREEN, GIRARA_EVENT_BUTTON_PRESS, PREVIOUS, NULL); - - girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_UP, LEFT, NULL); - girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_UP, LEFT, NULL); - girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_DOWN, RIGHT, NULL); - girara_mouse_event_add(gsession, GDK_SHIFT_MASK, 0, sc_mouse_scroll, FULLSCREEN, GIRARA_EVENT_SCROLL_DOWN, RIGHT, NULL); - - girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, NORMAL, GIRARA_EVENT_SCROLL_UP, UP, NULL); - girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, FULLSCREEN, GIRARA_EVENT_SCROLL_UP, UP, NULL); - girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, NORMAL, GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); - girara_mouse_event_add(gsession, GDK_CONTROL_MASK, 0, sc_mouse_zoom, FULLSCREEN, GIRARA_EVENT_SCROLL_DOWN, DOWN, NULL); - girara_mouse_event_add(gsession, 0, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, NORMAL, GIRARA_EVENT_BUTTON_PRESS, 0, NULL); - girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, NORMAL, GIRARA_EVENT_BUTTON_RELEASE, 0, NULL); - girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_MOTION_NOTIFY, 0, NULL); - /* define default inputbar commands */ girara_inputbar_command_add(gsession, "bmark", NULL, cmd_bookmark_create, NULL, _("Add a bookmark")); girara_inputbar_command_add(gsession, "bdelete", NULL, cmd_bookmark_delete, cc_bookmarks, _("Delete a bookmark")); @@ -409,6 +415,7 @@ config_load_default(zathura_t* zathura) girara_shortcut_mapping_add(gsession, "scroll", sc_scroll); girara_shortcut_mapping_add(gsession, "search", sc_search); girara_shortcut_mapping_add(gsession, "toggle_fullscreen", sc_toggle_fullscreen); + girara_shortcut_mapping_add(gsession, "toggle_presentation", sc_toggle_presentation); girara_shortcut_mapping_add(gsession, "toggle_index", sc_toggle_index); girara_shortcut_mapping_add(gsession, "toggle_inputbar", girara_sc_toggle_inputbar); girara_shortcut_mapping_add(gsession, "toggle_page_mode", sc_toggle_page_mode); diff --git a/shortcuts.c b/shortcuts.c index 3908167..0bf53c7 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -1193,6 +1193,35 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* return false; } + static bool fullscreen = false; + if (fullscreen == true) { + gtk_window_unfullscreen(GTK_WINDOW(session->gtk.window)); + refresh_view(zathura); + girara_mode_set(session, zathura->modes.normal); + } else { + gtk_window_fullscreen(GTK_WINDOW(session->gtk.window)); + refresh_view(zathura); + girara_mode_set(session, zathura->modes.fullscreen); + } + + fullscreen = fullscreen ? false : true; + + return false; +} + +bool +sc_toggle_presentation(girara_session_t* session, girara_argument_t* + UNUSED(argument), girara_event_t* UNUSED(event), unsigned int UNUSED(t)) +{ + g_return_val_if_fail(session != NULL, false); + g_return_val_if_fail(session->global.data != NULL, false); + zathura_t* zathura = session->global.data; + + if (zathura->document == NULL) { + girara_notify(session, GIRARA_WARNING, _("No document opened.")); + return false; + } + static bool fullscreen = false; static int pages_per_row = 1; static int first_page_column = 1; @@ -1245,7 +1274,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* refresh_view(zathura); /* setm ode */ - girara_mode_set(session, zathura->modes.fullscreen); + girara_mode_set(session, zathura->modes.presentation); } fullscreen = fullscreen ? false : true; diff --git a/shortcuts.h b/shortcuts.h index c3231c6..7fce02f 100644 --- a/shortcuts.h +++ b/shortcuts.h @@ -248,6 +248,17 @@ bool sc_toggle_page_mode(girara_session_t* session, girara_argument_t* argument, */ bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); +/** + * Toggle presentation mode + * + * @param session The used girara session + * @param argument The used argument + * @param event Girara event + * @param t Number of executions + * @return true if no error occured otherwise false + */ +bool sc_toggle_presentation(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); + /** * Quit zathura * diff --git a/zathura.h b/zathura.h index 4b198ed..938f598 100644 --- a/zathura.h +++ b/zathura.h @@ -112,6 +112,7 @@ struct zathura_s girara_mode_t fullscreen; /**< Fullscreen mode */ girara_mode_t index; /**< Index mode */ girara_mode_t insert; /**< Insert mode */ + girara_mode_t presentation; /**< Presentation mode */ } modes; struct From 6ae3a7eab80777a1bac9ca1e5e4630047519b8d8 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Tue, 26 Nov 2013 09:57:20 +0100 Subject: [PATCH 007/129] Document PgDn and PgUp --- zathura.1.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zathura.1.rst b/zathura.1.rst index 8c74946..4da2e27 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -61,8 +61,10 @@ OPTIONS MOUSE AND KEY BINDINGS ====================== -J, K - Go to the next or previous page +J, PgDn + Go to the next page +K, PgUp + Go to the previous page h, k, j, l Scroll to the left, down, up or right direction Left, Down, Up, Right From 2c76fde31fbc972361dbf792bd4613eb5dd25e40 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 28 Nov 2013 14:16:17 +0100 Subject: [PATCH 008/129] Make sure there are no outstanding requests if the page size gets changed Signed-off-by: Sebastian Ramacher --- page-widget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/page-widget.c b/page-widget.c index 6f328bc..aac3f7b 100644 --- a/page-widget.c +++ b/page-widget.c @@ -608,7 +608,10 @@ static void zathura_page_widget_size_allocate(GtkWidget* widget, GdkRectangle* allocation) { GTK_WIDGET_CLASS(zathura_page_widget_parent_class)->size_allocate(widget, allocation); - zathura_page_widget_update_surface(ZATHURA_PAGE(widget), NULL); + + ZathuraPage* page = ZATHURA_PAGE(widget); + zathura_page_widget_abort_render_request(page); + zathura_page_widget_update_surface(page, NULL); } static void From 6ee0f265a31cee622fb304bacf493141a346d787 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 29 Nov 2013 15:57:40 +0100 Subject: [PATCH 009/129] CS Signed-off-by: Sebastian Ramacher --- shortcuts.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 3908167..b806637 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -495,13 +495,16 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, t = 1; } - unsigned int view_width=0, view_height=0; + unsigned int view_width = 0; + unsigned int view_height = 0; zathura_document_get_viewport_size(zathura->document, &view_height, &view_width); - unsigned int cell_width=0, cell_height=0; + unsigned int cell_width = 0; + unsigned int cell_height = 0; zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); - unsigned int doc_width=0, doc_height=0; + unsigned int doc_width = 0; + unsigned int doc_height = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); float scroll_step = 40; @@ -544,8 +547,8 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, direction = 1.0; } - double vstep = (double)(cell_height + padding) / (double)doc_height; - double hstep = (double)(cell_width + padding) / (double)doc_width; + const double vstep = (double)(cell_height + padding) / (double)doc_height; + const double hstep = (double)(cell_width + padding) / (double)doc_width; /* compute new position */ switch(argument->n) { From 6788776bae4bd9fc601da706354bc1963918ff24 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 29 Nov 2013 17:08:01 +0100 Subject: [PATCH 010/129] Bail out early if we get TOP or BOTTOM --- shortcuts.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index b806637..b34b1a4 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -491,6 +491,15 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, return false; } + /* if TOP or BOTTOM, go there and we are done */ + if (argument->n == TOP) { + position_set(zathura, -1, 0); + return false; + } else if (argument->n == BOTTOM) { + position_set(zathura, -1, 1.0); + return false; + } + if (t == 0) { t = 1; } @@ -527,31 +536,21 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, double pos_x = zathura_document_get_position_x(zathura->document); double pos_y = zathura_document_get_position_y(zathura->document); - double page_id = zathura_document_get_current_page_number(zathura->document); - double direction = 1.0; - /* if TOP or BOTTOM, go there and we are done */ - if (argument->n == TOP) { - position_set(zathura, -1, 0); - return false; - } else if (argument->n == BOTTOM) { - position_set(zathura, -1, 1.0); - return false; - } + const unsigned int page_id = zathura_document_get_current_page_number(zathura->document); /* compute the direction of scrolling */ - if ( (argument->n == LEFT) || (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT) || - (argument->n == UP) || (argument->n == FULL_UP) || (argument->n == HALF_UP)) { + double direction = 1.0; + if ((argument->n == LEFT) || (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT) || + (argument->n == UP) || (argument->n == FULL_UP) || (argument->n == HALF_UP)) { direction = -1.0; - } else { - direction = 1.0; } const double vstep = (double)(cell_height + padding) / (double)doc_height; const double hstep = (double)(cell_width + padding) / (double)doc_width; /* compute new position */ - switch(argument->n) { + switch (argument->n) { case FULL_UP: case FULL_DOWN: pos_y += direction * (1.0 - scroll_full_overlap) * vstep; @@ -603,9 +602,9 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, } /* snap to the border if we change page */ - double dummy; - unsigned int new_page_id = position_to_page_number(zathura->document, pos_x, pos_y); + const unsigned int new_page_id = position_to_page_number(zathura->document, pos_x, pos_y); if (scroll_page_aware == true && page_id != new_page_id) { + double dummy = 0.0; switch(argument->n) { case FULL_LEFT: case HALF_LEFT: From 064db002870b5b83bda385690adcf5d0e575112a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 29 Nov 2013 17:24:28 +0100 Subject: [PATCH 011/129] Half / full page scroll need to respect the view port size They are not using the page size from the document. Signed-off-by: Sebastian Ramacher --- shortcuts.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index b34b1a4..fa5e2c7 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -508,10 +508,6 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int view_height = 0; zathura_document_get_viewport_size(zathura->document, &view_height, &view_width); - unsigned int cell_width = 0; - unsigned int cell_height = 0; - zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); - unsigned int doc_width = 0; unsigned int doc_height = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); @@ -546,8 +542,8 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, direction = -1.0; } - const double vstep = (double)(cell_height + padding) / (double)doc_height; - const double hstep = (double)(cell_width + padding) / (double)doc_width; + const double vstep = (double)view_height / (double)doc_height; + const double hstep = (double)view_width / (double)doc_width; /* compute new position */ switch (argument->n) { From 5a932e014c16ebddb37a9242c903482e2f2b1ee8 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 29 Nov 2013 18:05:40 +0100 Subject: [PATCH 012/129] No need for padding anymore Signed-off-by: Sebastian Ramacher --- shortcuts.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index fa5e2c7..5d141cb 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -527,9 +527,6 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, bool scroll_wrap = false; girara_setting_get(session, "scroll-wrap", &scroll_wrap); - int padding = 1; - girara_setting_get(session, "page-padding", &padding); - double pos_x = zathura_document_get_position_x(zathura->document); double pos_y = zathura_document_get_position_y(zathura->document); @@ -579,11 +576,11 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, } /* handle boundaries */ - double end_x = 0.5 * (double)view_width / (double)doc_width; - double end_y = 0.5 * (double)view_height / (double)doc_height; + const double end_x = 0.5 * (double)view_width / (double)doc_width; + const double end_y = 0.5 * (double)view_height / (double)doc_height; - double new_x = scroll_wrap ? 1.0 - end_x : end_x; - double new_y = scroll_wrap ? 1.0 - end_y : end_y; + const double new_x = scroll_wrap ? 1.0 - end_x : end_x; + const double new_y = scroll_wrap ? 1.0 - end_y : end_y; if (pos_x < end_x) { pos_x = new_x; From cff05ac10e3643dfb8fa20d2c8c63b1d1f1ba8c1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 1 Dec 2013 15:47:28 +0100 Subject: [PATCH 013/129] Replace some GdkColors with GdkRGBA Signed-off-by: Sebastian Ramacher --- page-widget.c | 8 +++---- render.c | 62 +++++++++++++++++---------------------------------- render.h | 4 ++-- 3 files changed, 27 insertions(+), 47 deletions(-) diff --git a/page-widget.c b/page-widget.c index 9e136b9..e39d66e 100644 --- a/page-widget.c +++ b/page-widget.c @@ -464,9 +464,9 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) } else { /* set background color */ if (zathura_renderer_recolor_enabled(priv->zathura->sync.render_thread) == true) { - GdkColor color; + GdkRGBA color; zathura_renderer_get_recolor_colors(priv->zathura->sync.render_thread, &color, NULL); - cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); + cairo_set_source_rgb(cairo, color.red, color.green, color.blue); } else { GdkColor color = priv->zathura->ui.colors.render_loading_bg; cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); @@ -480,9 +480,9 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* write text */ if (render_loading == true) { if (zathura_renderer_recolor_enabled(priv->zathura->sync.render_thread) == true) { - GdkColor color; + GdkRGBA color; zathura_renderer_get_recolor_colors(priv->zathura->sync.render_thread, NULL, &color); - cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); + cairo_set_source_rgb(cairo, color.red, color.green, color.blue); } else { GdkColor color = priv->zathura->ui.colors.render_loading_fg; cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); diff --git a/render.c b/render.c index f572a82..d98f03d 100644 --- a/render.c +++ b/render.c @@ -1,6 +1,7 @@ /* See LICENSE file for license and copyright information */ #include +#include #include #include #include "glib-compat.h" @@ -24,7 +25,6 @@ static void render_request_finalize(GObject* object); static void render_job(void* data, void* user_data); static gint render_thread_sort(gconstpointer a, gconstpointer b, gpointer data); -static void color2double(const GdkColor* col, double* v); static ssize_t page_cache_lru_invalidate(ZathuraRenderer* renderer); static void page_cache_invalidate_all(ZathuraRenderer* renderer); static bool page_cache_is_full(ZathuraRenderer* renderer, bool* result); @@ -43,10 +43,8 @@ typedef struct private_s { bool enabled; bool hue; - double light[3]; - GdkColor light_gdk; - double dark[3]; - GdkColor dark_gdk; + GdkRGBA light; + GdkRGBA dark; } recolor; /* @@ -317,22 +315,16 @@ zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, bool enable) void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, - const GdkColor* light, const GdkColor* dark) + const GdkRGBA* light, const GdkRGBA* dark) { g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); private_t* priv = GET_PRIVATE(renderer); if (light != NULL) { - priv->recolor.light_gdk.red = light->red; - priv->recolor.light_gdk.blue = light->blue; - priv->recolor.light_gdk.green = light->green; - color2double(light, priv->recolor.light); + memcpy(&priv->recolor.light, light, sizeof(GdkRGBA)); } if (dark != NULL) { - priv->recolor.dark_gdk.red = dark->red; - priv->recolor.dark_gdk.blue = dark->blue; - priv->recolor.dark_gdk.green = dark->green; - color2double(dark, priv->recolor.dark); + memcpy(&priv->recolor.dark, dark, sizeof(GdkRGBA)); } } @@ -343,33 +335,29 @@ zathura_renderer_set_recolor_colors_str(ZathuraRenderer* renderer, g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); if (dark != NULL) { - GdkColor color; - gdk_color_parse(dark, &color); + GdkRGBA color; + gdk_rgba_parse(&color, dark); zathura_renderer_set_recolor_colors(renderer, NULL, &color); } if (light != NULL) { - GdkColor color; - gdk_color_parse(light, &color); + GdkRGBA color; + gdk_rgba_parse(&color, light); zathura_renderer_set_recolor_colors(renderer, &color, NULL); } } void zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer, - GdkColor* light, GdkColor* dark) + GdkRGBA* light, GdkRGBA* dark) { g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); private_t* priv = GET_PRIVATE(renderer); if (light != NULL) { - light->red = priv->recolor.light_gdk.red; - light->blue = priv->recolor.light_gdk.blue; - light->green = priv->recolor.light_gdk.green; + memcpy(light, &priv->recolor.light, sizeof(GdkRGBA)); } if (dark != NULL) { - dark->red = priv->recolor.dark_gdk.red; - dark->blue = priv->recolor.dark_gdk.blue; - dark->green = priv->recolor.dark_gdk.green; + memcpy(dark, &priv->recolor.dark, sizeof(GdkRGBA)); } } @@ -503,14 +491,6 @@ emit_completed_signal(void* data) return FALSE; } -static void -color2double(const GdkColor* col, double* v) -{ - v[0] = (double) col->red / 65535.; - v[1] = (double) col->green / 65535.; - v[2] = (double) col->blue / 65535.; -} - /* Returns the maximum possible saturation for given h and l. Assumes that l is in the interval l1, l2 and corrects the value to force u=0 on l1 and l2 */ @@ -575,13 +555,13 @@ recolor(private_t* priv, unsigned int page_width, unsigned int page_height, #define rgb1 priv->recolor.dark #define rgb2 priv->recolor.light - const double l1 = (a[0]*rgb1[0] + a[1]*rgb1[1] + a[2]*rgb1[2]); - const double l2 = (a[0]*rgb2[0] + a[1]*rgb2[1] + a[2]*rgb2[2]); + const double l1 = a[0]*rgb1.red + a[1]*rgb1.green + a[2]*rgb1.blue; + const double l2 = a[0]*rgb2.red + a[1]*rgb2.green + a[2]*rgb2.blue; const double rgb_diff[] = { - rgb2[0] - rgb1[0], - rgb2[1] - rgb1[1], - rgb2[2] - rgb1[2] + rgb2.red - rgb1.red, + rgb2.green - rgb1.green, + rgb2.blue - rgb1.blue }; for (unsigned int y = 0; y < page_height; y++) { @@ -626,9 +606,9 @@ recolor(private_t* priv, unsigned int page_width, unsigned int page_height, } else { /* linear interpolation between dark and light with color ligtness as * a parameter */ - data[2] = (unsigned char)round(255.*(l * rgb_diff[0] + rgb1[0])); - data[1] = (unsigned char)round(255.*(l * rgb_diff[1] + rgb1[1])); - data[0] = (unsigned char)round(255.*(l * rgb_diff[2] + rgb1[2])); + data[2] = (unsigned char)round(255.*(l * rgb_diff[0] + rgb1.red)); + data[1] = (unsigned char)round(255.*(l * rgb_diff[1] + rgb1.green)); + data[0] = (unsigned char)round(255.*(l * rgb_diff[2] + rgb1.blue)); } } } diff --git a/render.h b/render.h index 07368f6..016c6b2 100644 --- a/render.h +++ b/render.h @@ -78,7 +78,7 @@ void zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, * @param dark dark color */ void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, - const GdkColor* light, const GdkColor* dark); + const GdkRGBA* light, const GdkRGBA* dark); /** * Set light and dark colors for recoloring. * @param renderer a renderer object @@ -94,7 +94,7 @@ void zathura_renderer_set_recolor_colors_str(ZathuraRenderer* renderer, * @param dark dark color */ void zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer, - GdkColor* light, GdkColor* dark); + GdkRGBA* light, GdkRGBA* dark); /** * Stop rendering. * @param renderer a render object From 43c3ba86f4caeb7b6f6f4269afa92b5d3cb1e191 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 1 Dec 2013 16:04:04 +0100 Subject: [PATCH 014/129] Replace some more GdkColors with GdkRGBA Signed-off-by: Sebastian Ramacher --- config.c | 8 ++++---- page-widget.c | 22 +++++++++++----------- zathura.h | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/config.c b/config.c index 72b5100..8482d82 100644 --- a/config.c +++ b/config.c @@ -52,9 +52,9 @@ cb_color_change(girara_session_t* session, const char* name, char* string_value = (char*) value; if (g_strcmp0(name, "highlight-color") == 0) { - gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color)); + gdk_rgba_parse(&(zathura->ui.colors.highlight_color), string_value); } else if (g_strcmp0(name, "highlight-active-color") == 0) { - gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color_active)); + gdk_rgba_parse(&(zathura->ui.colors.highlight_color_active), string_value); } else if (g_strcmp0(name, "recolor-darkcolor") == 0) { if (zathura->sync.render_thread != NULL) { zathura_renderer_set_recolor_colors_str(zathura->sync.render_thread, NULL, string_value); @@ -64,9 +64,9 @@ cb_color_change(girara_session_t* session, const char* name, zathura_renderer_set_recolor_colors_str(zathura->sync.render_thread, string_value, NULL); } } else if (g_strcmp0(name, "render-loading-bg") == 0) { - gdk_color_parse(string_value, &(zathura->ui.colors.render_loading_bg)); + gdk_rgba_parse(&(zathura->ui.colors.render_loading_bg), string_value); } else if (g_strcmp0(name, "render-loading-fg") == 0) { - gdk_color_parse(string_value, &(zathura->ui.colors.render_loading_fg)); + gdk_rgba_parse(&(zathura->ui.colors.render_loading_fg), string_value); } render_all(zathura); diff --git a/page-widget.c b/page-widget.c index e39d66e..9c9020a 100644 --- a/page-widget.c +++ b/page-widget.c @@ -416,8 +416,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) zathura_rectangle_t rectangle = recalc_rectangle(priv->page, zathura_link_get_position(link)); /* draw position */ - GdkColor color = priv->zathura->ui.colors.highlight_color; - cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency); + const GdkRGBA color = priv->zathura->ui.colors.highlight_color; + cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency); cairo_rectangle(cairo, rectangle.x1, rectangle.y1, (rectangle.x2 - rectangle.x1), (rectangle.y2 - rectangle.y1)); cairo_fill(cairo); @@ -441,11 +441,11 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* draw position */ if (idx == priv->search.current) { - GdkColor color = priv->zathura->ui.colors.highlight_color_active; - cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency); + const GdkRGBA color = priv->zathura->ui.colors.highlight_color_active; + cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency); } else { - GdkColor color = priv->zathura->ui.colors.highlight_color; - cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency); + const GdkRGBA color = priv->zathura->ui.colors.highlight_color; + cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency); } cairo_rectangle(cairo, rectangle.x1, rectangle.y1, (rectangle.x2 - rectangle.x1), (rectangle.y2 - rectangle.y1)); @@ -455,8 +455,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) } /* draw selection */ if (priv->mouse.selection.y2 != -1 && priv->mouse.selection.x2 != -1) { - GdkColor color = priv->zathura->ui.colors.highlight_color; - cairo_set_source_rgba(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0, transparency); + const GdkRGBA color = priv->zathura->ui.colors.highlight_color; + cairo_set_source_rgba(cairo, color.red, color.green, color.blue, transparency); cairo_rectangle(cairo, priv->mouse.selection.x1, priv->mouse.selection.y1, (priv->mouse.selection.x2 - priv->mouse.selection.x1), (priv->mouse.selection.y2 - priv->mouse.selection.y1)); cairo_fill(cairo); @@ -468,8 +468,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) zathura_renderer_get_recolor_colors(priv->zathura->sync.render_thread, &color, NULL); cairo_set_source_rgb(cairo, color.red, color.green, color.blue); } else { - GdkColor color = priv->zathura->ui.colors.render_loading_bg; - cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); + const GdkRGBA color = priv->zathura->ui.colors.render_loading_bg; + cairo_set_source_rgb(cairo, color.red, color.green, color.blue); } cairo_rectangle(cairo, 0, 0, page_width, page_height); cairo_fill(cairo); @@ -484,7 +484,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) zathura_renderer_get_recolor_colors(priv->zathura->sync.render_thread, NULL, &color); cairo_set_source_rgb(cairo, color.red, color.green, color.blue); } else { - GdkColor color = priv->zathura->ui.colors.render_loading_fg; + const GdkRGBA color = priv->zathura->ui.colors.render_loading_fg; cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0); } diff --git a/zathura.h b/zathura.h index 633e73f..e5577f3 100644 --- a/zathura.h +++ b/zathura.h @@ -57,10 +57,10 @@ struct zathura_s struct { - GdkColor highlight_color; /**< Color for highlighting */ - GdkColor highlight_color_active; /** Color for highlighting */ - GdkColor render_loading_bg; /**< Background color for render "Loading..." */ - GdkColor render_loading_fg; /**< Foreground color for render "Loading..." */ + GdkRGBA highlight_color; /**< Color for highlighting */ + GdkRGBA highlight_color_active; /** Color for highlighting */ + GdkRGBA render_loading_bg; /**< Background color for render "Loading..." */ + GdkRGBA render_loading_fg; /**< Foreground color for render "Loading..." */ } colors; GtkWidget *page_widget_alignment; From 0ac744c07635007cbd97beea400a23e1469736cc Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 3 Dec 2013 17:04:58 +0100 Subject: [PATCH 015/129] I guess this mutex is no longer needed Signed-off-by: Sebastian Ramacher --- page-widget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/page-widget.c b/page-widget.c index 9c9020a..59dbd8b 100644 --- a/page-widget.c +++ b/page-widget.c @@ -24,7 +24,12 @@ typedef struct zathura_page_widget_private_s { zathura_t* zathura; /**< Zathura object */ cairo_surface_t* surface; /**< Cairo surface */ ZathuraRenderRequest* render_request; /* Request object */ - mutex lock; /**< Lock */ + /** Lock + * + * This mutex can probably be removed. All functions are now called from the + * main thread. + */ + mutex lock; bool cached; /**< Cached state */ struct { From 60001b2ede121f676bf42ab441a55356d9913f6c Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 3 Dec 2013 17:05:09 +0100 Subject: [PATCH 016/129] A const Signed-off-by: Sebastian Ramacher --- config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.c b/config.c index 8482d82..fb38dbc 100644 --- a/config.c +++ b/config.c @@ -50,7 +50,7 @@ cb_color_change(girara_session_t* session, const char* name, g_return_if_fail(name != NULL); zathura_t* zathura = session->global.data; - char* string_value = (char*) value; + const char* string_value = (const char*) value; if (g_strcmp0(name, "highlight-color") == 0) { gdk_rgba_parse(&(zathura->ui.colors.highlight_color), string_value); } else if (g_strcmp0(name, "highlight-active-color") == 0) { From 5b3e0b7fc7e64bd589fcf87ea908b6fdf01d3a38 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 3 Dec 2013 20:29:44 +0100 Subject: [PATCH 017/129] Some consts here and there --- render.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/render.c b/render.c index d98f03d..a5bee64 100644 --- a/render.c +++ b/render.c @@ -497,17 +497,17 @@ emit_completed_signal(void* data) static double colorumax(const double* h, double l, double l1, double l2) { - double u, uu, v, vv, lv; if (h[0] == 0 && h[1] == 0 && h[2] == 0) { return 0; } - lv = (l - l1)/(l2 - l1); /* Remap l to the whole interval 0,1 */ - u = v = 1000000; + const double lv = (l - l1)/(l2 - l1); /* Remap l to the whole interval 0,1 */ + double u = 1000000; + double v = u; for (int k = 0; k < 3; k++) { if (h[k] > 0) { - uu = fabs((1-l)/h[k]); - vv = fabs((1-lv)/h[k]); + const double uu = fabs((1-l)/h[k]); + const double vv = fabs((1-lv)/h[k]); if (uu < u) { u = uu; @@ -516,8 +516,8 @@ colorumax(const double* h, double l, double l1, double l2) v = vv; } } else if (h[k] < 0) { - uu = fabs(l/h[k]); - vv = fabs(lv/h[k]); + const double uu = fabs(l/h[k]); + const double vv = fabs(lv/h[k]); if (uu < u) { u = uu; From 1d398dfaf08e77c2ebe0b76a696c3be26da69328 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 3 Dec 2013 20:30:44 +0100 Subject: [PATCH 018/129] Remove mutex from page widget This should not introduce any problems. All functions of the page widget are now called from the main thread. Signed-off-by: Sebastian Ramacher --- page-widget.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/page-widget.c b/page-widget.c index 59dbd8b..2c77b89 100644 --- a/page-widget.c +++ b/page-widget.c @@ -7,7 +7,6 @@ #include #include -#include "glib-compat.h" #include "links.h" #include "page-widget.h" #include "page.h" @@ -24,12 +23,6 @@ typedef struct zathura_page_widget_private_s { zathura_t* zathura; /**< Zathura object */ cairo_surface_t* surface; /**< Cairo surface */ ZathuraRenderRequest* render_request; /* Request object */ - /** Lock - * - * This mutex can probably be removed. All functions are now called from the - * main thread. - */ - mutex lock; bool cached; /**< Cached state */ struct { @@ -197,8 +190,6 @@ zathura_page_widget_init(ZathuraPage* widget) priv->mouse.selection_basepoint.x = -1; priv->mouse.selection_basepoint.y = -1; - mutex_init(&(priv->lock)); - /* we want mouse events */ gtk_widget_add_events(GTK_WIDGET(widget), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK); @@ -249,8 +240,6 @@ zathura_page_widget_finalize(GObject* object) girara_list_free(priv->links.list); } - mutex_free(&(priv->lock)); - G_OBJECT_CLASS(zathura_page_widget_parent_class)->finalize(object); } @@ -370,7 +359,6 @@ static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) { zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); - mutex_lock(&(priv->lock)); zathura_document_t* document = zathura_page_get_document(priv->page); const unsigned int page_height = gtk_widget_get_allocated_height(widget); @@ -507,7 +495,6 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* render real page */ zathura_render_request(priv->render_request, g_get_real_time()); } - mutex_unlock(&(priv->lock)); return FALSE; } @@ -522,7 +509,6 @@ void zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface) { zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); - mutex_lock(&(priv->lock)); if (priv->surface != NULL) { cairo_surface_destroy(priv->surface); priv->surface = NULL; @@ -531,7 +517,6 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface priv->surface = surface; cairo_surface_reference(surface); } - mutex_unlock(&(priv->lock)); /* force a redraw here */ if (priv->surface != NULL) { zathura_page_widget_redraw_canvas(widget); From 42a8382a4590aea0564bcf7c37440e3a7a84805a Mon Sep 17 00:00:00 2001 From: Sebastian Neuser Date: Mon, 16 Dec 2013 19:42:35 +0100 Subject: [PATCH 019/129] Set position on document load only if no page was specified --- zathura.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zathura.c b/zathura.c index 55b72e5..89f06aa 100644 --- a/zathura.c +++ b/zathura.c @@ -786,10 +786,13 @@ document_open(zathura_t* zathura, const char* path, const char* password, gtk_widget_show(zathura->pages[page_id]); } - /* set position */ + /* Set page */ page_set(zathura, zathura_document_get_current_page_number(document)); - if (file_info.position_x != 0 || file_info.position_y != 0) { - position_set(zathura, file_info.position_x, file_info.position_y); + + /* Set position (only if restoring from history file) */ + if (file_info.current_page == zathura_document_get_current_page_number(document) + && (file_info.position_x != 0 || file_info.position_y != 0)) { + position_set(zathura, file_info.position_x, file_info.position_y); } return true; From 87af53afbbb18e9243c0800ea9e95c8f6155d5f5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 17 Dec 2013 16:26:13 +0100 Subject: [PATCH 020/129] Make inital values more explicit Signed-off-by: Sebastian Ramacher --- zathura.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zathura.c b/zathura.c index 89f06aa..4dd7cad 100644 --- a/zathura.c +++ b/zathura.c @@ -536,8 +536,17 @@ document_open(zathura_t* zathura, const char* path, const char* password, } /* read history file */ - zathura_fileinfo_t file_info = { 0, 0, 1, 0, 0, 0, 0, 0 }; - bool known_file = zathura_db_get_fileinfo(zathura->database, file_path, &file_info); + zathura_fileinfo_t file_info = { + .current_page = 0, + .page_offset = 0, + .scale = 1, + .rotation = 0, + .pages_per_row = 0, + .first_page_column = 0, + .position_x = 0, + .position_y = 0 + }; + const bool known_file = zathura_db_get_fileinfo(zathura->database, file_path, &file_info); /* set page offset */ zathura_document_set_page_offset(document, file_info.page_offset); From 660a3e7757a2b9f0de61f68546c002230d2e82b7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 17 Dec 2013 16:27:34 +0100 Subject: [PATCH 021/129] CS Signed-off-by: Sebastian Ramacher --- zathura.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zathura.c b/zathura.c index 4dd7cad..647bc8d 100644 --- a/zathura.c +++ b/zathura.c @@ -799,9 +799,9 @@ document_open(zathura_t* zathura, const char* path, const char* password, page_set(zathura, zathura_document_get_current_page_number(document)); /* Set position (only if restoring from history file) */ - if (file_info.current_page == zathura_document_get_current_page_number(document) - && (file_info.position_x != 0 || file_info.position_y != 0)) { - position_set(zathura, file_info.position_x, file_info.position_y); + if (file_info.current_page == zathura_document_get_current_page_number(document) && + (file_info.position_x != 0 || file_info.position_y != 0)) { + position_set(zathura, file_info.position_x, file_info.position_y); } return true; From 45a997c88e4bfe2e6fb1126520b619cbc0b74fcb Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 17 Dec 2013 16:32:50 +0100 Subject: [PATCH 022/129] More consts Signed-off-by: Sebastian Ramacher --- zathura.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zathura.c b/zathura.c index 647bc8d..9caa762 100644 --- a/zathura.c +++ b/zathura.c @@ -786,8 +786,8 @@ document_open(zathura_t* zathura, const char* path, const char* password, /* adjust_view calls render_all in some cases and render_all calls * gtk_widget_set_size_request. To be sure that it's really called, do it * here once again. */ - double height = zathura_page_get_height(page); - double width = zathura_page_get_width(page); + const double height = zathura_page_get_height(page); + const double width = zathura_page_get_width(page); page_calc_height_width(zathura->document, height, width, &page_height, &page_width, true); gtk_widget_set_size_request(zathura->pages[page_id], page_width, page_height); From e8bc7b1e491d0f0f9ed790ef4afa0056e3cb5c26 Mon Sep 17 00:00:00 2001 From: Sebastian Neuser Date: Tue, 17 Dec 2013 15:34:40 +0100 Subject: [PATCH 023/129] Implement shortcuts for scrolling to page top/bottom --- config.c | 4 ++++ shortcuts.c | 21 ++++++++++++++++----- zathura.h | 3 ++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/config.c b/config.c index fb38dbc..76ca03e 100644 --- a/config.c +++ b/config.c @@ -281,6 +281,8 @@ config_load_default(zathura_t* zathura) girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_scroll, NORMAL, UP, NULL); girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_scroll, NORMAL, DOWN, NULL); girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_scroll, NORMAL, RIGHT, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_H, NULL, sc_scroll, NORMAL, PAGE_TOP, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_L, NULL, sc_scroll, NORMAL, PAGE_BOTTOM, NULL); girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_t, NULL, sc_scroll, NORMAL, HALF_LEFT, NULL); girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_d, NULL, sc_scroll, NORMAL, HALF_DOWN, NULL); girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_u, NULL, sc_scroll, NORMAL, HALF_UP, NULL); @@ -436,6 +438,8 @@ config_load_default(zathura_t* zathura) girara_argument_mapping_add(gsession, "left", LEFT); girara_argument_mapping_add(gsession, "next", NEXT); girara_argument_mapping_add(gsession, "out", ZOOM_OUT); + girara_argument_mapping_add(gsession, "page-top", PAGE_TOP); + girara_argument_mapping_add(gsession, "page-bottom", PAGE_BOTTOM); girara_argument_mapping_add(gsession, "previous", PREVIOUS); girara_argument_mapping_add(gsession, "right", RIGHT); girara_argument_mapping_add(gsession, "specific", ZOOM_SPECIFIC); diff --git a/shortcuts.c b/shortcuts.c index 5d141cb..e0a141f 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -500,6 +500,22 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, return false; } + /* Retrieve current page and position */ + const unsigned int page_id = zathura_document_get_current_page_number(zathura->document); + double pos_x = zathura_document_get_position_x(zathura->document); + double pos_y = zathura_document_get_position_y(zathura->document); + + /* If PAGE_TOP or PAGE_BOTTOM, go there and we are done */ + if (argument->n == PAGE_TOP) { + page_number_to_position(zathura->document, page_id, 0.5, 0.0, &pos_x, &pos_y); + position_set(zathura, -1, pos_y); + return false; + } else if (argument->n == PAGE_BOTTOM) { + page_number_to_position(zathura->document, page_id, 0.5, 1.0, &pos_x, &pos_y); + position_set(zathura, -1, pos_y); + return false; + } + if (t == 0) { t = 1; } @@ -527,11 +543,6 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, bool scroll_wrap = false; girara_setting_get(session, "scroll-wrap", &scroll_wrap); - double pos_x = zathura_document_get_position_x(zathura->document); - double pos_y = zathura_document_get_position_y(zathura->document); - - const unsigned int page_id = zathura_document_get_current_page_number(zathura->document); - /* compute the direction of scrolling */ double direction = 1.0; if ((argument->n == LEFT) || (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT) || diff --git a/zathura.h b/zathura.h index e5577f3..5f63d01 100644 --- a/zathura.h +++ b/zathura.h @@ -16,7 +16,8 @@ enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT, BACKWARD, CONTINUOUS, DELETE_LAST, EXPAND, EXPAND_ALL, COLLAPSE_ALL, COLLAPSE, SELECT, GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP, FULL_DOWN, HALF_LEFT, HALF_RIGHT, FULL_LEFT, FULL_RIGHT, NEXT_CHAR, - PREVIOUS_CHAR, DELETE_TO_LINE_START, APPEND_FILEPATH, ROTATE_CW, ROTATE_CCW }; + PREVIOUS_CHAR, DELETE_TO_LINE_START, APPEND_FILEPATH, ROTATE_CW, ROTATE_CCW, + PAGE_BOTTOM, PAGE_TOP }; /* unspecified page number */ enum { From 976b6ab16413d1e4c685278f1f0b4837bb431feb Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 17 Dec 2013 18:05:23 +0100 Subject: [PATCH 024/129] Document page-top and page-bottom Signed-off-by: Sebastian Ramacher --- zathurarc.5.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zathurarc.5.rst b/zathurarc.5.rst index d4bc152..54e8edd 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -262,6 +262,8 @@ Possible arguments are: * left * next * out +* page-bottom +* page-top * previous * right * rotate-ccw From 3dcae9604535cc3d293cebe9575b8ec151239d09 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 17 Dec 2013 18:07:04 +0100 Subject: [PATCH 025/129] Document new shortcuts Signed-off-by: Sebastian Ramacher --- zathura.1.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zathura.1.rst b/zathura.1.rst index 4da2e27..36384ed 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -75,6 +75,8 @@ t, ^f, ^b, space, , y Scroll a full page left, down, up or right gg, G, nG Goto to the first, the last or to the nth page +H, L + Goto top or bottom of the current page ^o, ^i Move backward and forward through the jump list ^j, ^k From b3c2327fbb213d9afbfe44039bd29e10b2c91934 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 23 Dec 2013 15:41:44 +0100 Subject: [PATCH 026/129] Make synctex_view available Also fix argv handling. Signed-off-by: Sebastian Ramacher --- synctex.c | 47 +++++++++++++++++++++++++++++------------------ synctex.h | 1 + types.h | 2 +- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/synctex.c b/synctex.c index 3a9ea29..2bf5d90 100644 --- a/synctex.c +++ b/synctex.c @@ -52,7 +52,6 @@ static GScannerConfig scanner_config = { static void synctex_record_hits(zathura_t* zathura, int page_idx, girara_list_t* hits, bool first); static double scan_float(GScanner* scanner); -static bool synctex_view(zathura_t* zathura, char* position); void synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) @@ -71,18 +70,19 @@ synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) return; } - int page_idx = zathura_page_get_index(page); - char *buffer = g_strdup_printf("%d:%d:%d:%s", page_idx + 1, x, y, filename); - + char** argv = g_malloc0(sizeof(char*) * (zathura->synctex.editor != NULL ? + 6 : 4)); + argv[0] = g_strdup("synctex"); + argv[1] = g_strdup("edit"); + argv[2] = g_strdup("-o"); + argv[3] = g_strdup_printf("%d:%d:%d:%s", zathura_page_get_index(page) + 1, x, y, filename); if (zathura->synctex.editor != NULL) { - char* argv[] = {"synctex", "edit", "-o", buffer, "-x", zathura->synctex.editor, NULL}; - g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); - } else { - char* argv[] = {"synctex", "edit", "-o", buffer, NULL}; - g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); + argv[4] = g_strdup("-x"); + argv[5] = g_strdup(zathura->synctex.editor); } - g_free(buffer); + g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); + g_strfreev(argv); } static void @@ -96,7 +96,7 @@ synctex_record_hits(zathura_t* zathura, int page_idx, girara_list_t* hits, bool g_object_set(page_widget, "draw-links", FALSE, NULL); g_object_set(page_widget, "search-results", hits, NULL); - if (first) { + if (first == true) { page_set(zathura, zathura_page_get_index(page)); g_object_set(page_widget, "search-current", 0, NULL); } @@ -115,15 +115,26 @@ scan_float(GScanner* scanner) } } -static bool -synctex_view(zathura_t* zathura, char* position) +bool +synctex_view(zathura_t* zathura, const char* position) { - char* filename = g_strdup(zathura_document_get_path(zathura->document)); - char* argv[] = {"synctex", "view", "-i", position, "-o", filename, NULL}; - gint output; + if (zathura->document == NULL) { + return false; + } - bool ret = g_spawn_async_with_pipes(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, &output, NULL, NULL); - g_free(filename); + char** argv = g_malloc0(sizeof(char*) * 6); + argv[0] = g_strdup("synctex"); + argv[1] = g_strdup("view"); + argv[2] = g_strdup("-i"); + argv[3] = g_strdup(position); + argv[4] = g_strdup("-o"); + argv[5] = g_strdup(zathura_document_get_path(zathura->document)); + + gint output; + bool ret = g_spawn_async_with_pipes(NULL, argv, NULL, + G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, + &output, NULL, NULL); + g_strfreev(argv); if (ret == false) { return false; diff --git a/synctex.h b/synctex.h index 1514117..85a6d07 100644 --- a/synctex.h +++ b/synctex.h @@ -6,5 +6,6 @@ #include "types.h" void synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y); +bool synctex_view(zathura_t* zathura, const char* position); #endif diff --git a/types.h b/types.h index 433bcb5..a211e8f 100644 --- a/types.h +++ b/types.h @@ -33,7 +33,7 @@ typedef struct zathura_plugin_manager_s zathura_plugin_manager_t; /** * Renderer */ -typedef struct zathura_renderer_s ZathuraRenderer; +typedef struct zathura_renderer_s ZathuraRenderer; /** * Error types From f7fddf750e8d7e5d8cd79f4be5dfaf997d134994 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 23 Dec 2013 18:14:23 +0100 Subject: [PATCH 027/129] Initial D-Bus interface for synctex Signed-off-by: Sebastian Ramacher --- synctex-dbus.c | 225 +++++++++++++++++++++++++++++++++++++++++++++++++ synctex-dbus.h | 49 +++++++++++ types.h | 5 ++ zathura.c | 10 +++ zathura.h | 1 + 5 files changed, 290 insertions(+) create mode 100644 synctex-dbus.c create mode 100644 synctex-dbus.h diff --git a/synctex-dbus.c b/synctex-dbus.c new file mode 100644 index 0000000..66116a2 --- /dev/null +++ b/synctex-dbus.c @@ -0,0 +1,225 @@ +/* See LICENSE file for license and copyright information */ + +#include "synctex-dbus.h" +#include "synctex.h" +#include "macros.h" +#include "zathura.h" +#include "document.h" +#include +#include +#include +#include + +G_DEFINE_TYPE(ZathuraSynctexDbus, zathura_synctex_dbus, G_TYPE_OBJECT) + +/* template for bus name */ +static const char DBUS_NAME_TEMPLATE[] = "org.pwmt.zathura.PID-%d"; +/* template for object path */ +const char DBUS_OBJPATH[] = "/org/pwmt/zathura/synctex"; + +typedef struct private_s { + zathura_t* zathura; + GDBusNodeInfo* introspection_data; + GDBusConnection* connection; + guint owner_id; + guint registration_id; +} private_t; + +#define GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ + private_t)) + +/* Introspection data for the service we are exporting */ +static const char SYNCTEX_DBUS_INTROSPECTION[] = + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; + +static const GDBusInterfaceVTable interface_vtable; + +static bool synctex_dbus_view(ZathuraSynctexDbus* synctex_view, + const char* position); + +static void +finalize(GObject* object) +{ + ZathuraSynctexDbus* synctex_dbus = ZATHURA_SYNCTEX_DBUS(object); + private_t* priv = GET_PRIVATE(synctex_dbus); + + if (priv->connection != NULL && priv->registration_id > 0) { + g_dbus_connection_unregister_object(priv->connection, priv->registration_id); + } + + if (priv->owner_id > 0) { + g_bus_unown_name(priv->owner_id); + } + + if (priv->introspection_data != NULL) { + g_dbus_node_info_unref(priv->introspection_data); + } + + G_OBJECT_CLASS(zathura_synctex_dbus_parent_class)->finalize(object); +} + +static void +zathura_synctex_dbus_class_init(ZathuraSynctexDbusClass* class) +{ + /* initialize methods */ + class->view = synctex_dbus_view; + + /* add private members */ + g_type_class_add_private(class, sizeof(private_t)); + + /* overwrite methods */ + GObjectClass* object_class = G_OBJECT_CLASS(class); + object_class->finalize = finalize; +} + +static void +zathura_synctex_dbus_init(ZathuraSynctexDbus* synctex_dbus) +{ + private_t* priv = GET_PRIVATE(synctex_dbus); + priv->zathura = NULL; + priv->introspection_data = NULL; + priv->connection = NULL; + priv->owner_id = 0; + priv->registration_id = 0; +} + +static void +bus_acquired(GDBusConnection* connection, const gchar* name, void* data) +{ + girara_debug("Bus acquired at '%s'.", name); + + ZathuraSynctexDbus* dbus = data; + private_t* priv = GET_PRIVATE(dbus); + + GError* error = NULL; + priv->registration_id = g_dbus_connection_register_object(connection, + DBUS_OBJPATH, priv->introspection_data->interfaces[0], + &interface_vtable, dbus, NULL, &error); + + if (priv->registration_id == 0) { + girara_warning("Failed to register object on D-Bus connection: %s", + error->message); + g_error_free(error); + return; + } + + priv->connection = connection; +} + +static void +name_acquired(GDBusConnection* UNUSED(connection), const gchar* name, + void* UNUSED(data)) +{ + girara_debug("Acquired '%s' on session bus.", name); +} + +static void +name_lost(GDBusConnection* UNUSED(connection), const gchar* name, + void* UNUSED(data)) +{ + girara_debug("Lost connection or failed to acquire '%s' on session bus.", + name); +} + +ZathuraSynctexDbus* +zathura_synctex_dbus_new(zathura_t* zathura) +{ + GObject* obj = g_object_new(ZATHURA_TYPE_SYNCTEX_DBUS, NULL); + if (obj == NULL) { + return NULL; + } + + ZathuraSynctexDbus* synctex_dbus = ZATHURA_SYNCTEX_DBUS(obj); + private_t* priv = GET_PRIVATE(synctex_dbus); + priv->zathura = zathura; + + GError* error = NULL; + priv->introspection_data = g_dbus_node_info_new_for_xml(SYNCTEX_DBUS_INTROSPECTION, &error); + if (priv->introspection_data == NULL) { + girara_warning("Failed to parse introspection data: %s", error->message); + g_error_free(error); + g_object_unref(obj); + return NULL; + } + + char* well_known_name = g_strdup_printf(DBUS_NAME_TEMPLATE, getpid()); + priv->owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, + well_known_name, G_BUS_NAME_OWNER_FLAGS_NONE, bus_acquired, + name_acquired, name_lost, synctex_dbus, NULL); + g_free(well_known_name); + + return synctex_dbus; +} + +static bool +synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, const char* position) +{ + private_t* priv = GET_PRIVATE(synctex_dbus); + return synctex_view(priv->zathura, position); +} + +bool +zathura_synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, const char* position) +{ + g_return_val_if_fail(ZATHURA_IS_SYNCTEX_DBUS(synctex_dbus), false); + g_return_val_if_fail(position != NULL, false); + + return ZATHURA_SYNCTEX_DBUS_GET_CLASS(synctex_dbus)->view(synctex_dbus, + position); +} + +/* D-Bus handler */ + +static void +handle_method_call(GDBusConnection* UNUSED(connection), + const gchar* UNUSED(sender), const gchar* UNUSED(object_path), + const gchar* UNUSED(interface_name), + const gchar* method_name, GVariant* parameters, + GDBusMethodInvocation* invocation, void* data) +{ + ZathuraSynctexDbus* synctex_dbus = data; + + if (g_strcmp0(method_name, "View") == 0) { + gchar* position = NULL; + g_variant_get(parameters, "(s)", &position); + + const bool ret = zathura_synctex_dbus_view(synctex_dbus, position); + g_free(position); + + GVariant* result = g_variant_new("(b)", ret); + g_dbus_method_invocation_return_value(invocation, result); + } +} + +static GVariant* +handle_get_property(GDBusConnection* UNUSED(connection), + const gchar* UNUSED(sender), const gchar* UNUSED(object_path), + const gchar* UNUSED(interface_name), const gchar* property_name, + GError** UNUSED(error), void* data) +{ + ZathuraSynctexDbus* synctex_dbus = data; + private_t* priv = GET_PRIVATE(synctex_dbus); + + if (g_strcmp0(property_name, "filename") == 0) { + return g_variant_new_string(zathura_document_get_path(priv->zathura->document)); + } + + return NULL; +} + +static const GDBusInterfaceVTable interface_vtable = +{ + .method_call = handle_method_call, + .get_property = handle_get_property, + .set_property = NULL +}; + diff --git a/synctex-dbus.h b/synctex-dbus.h new file mode 100644 index 0000000..749bf10 --- /dev/null +++ b/synctex-dbus.h @@ -0,0 +1,49 @@ +/* See LICENSE file for license and copyright information */ + +#ifndef SYNCTEX_DBUS_H +#define SYNCTEX_DBUS_H + +#include +#include +#include +#include "types.h" + +typedef struct zathura_synctex_dbus_class_s ZathuraSynctexDbusClass; + +struct zathura_synctex_dbus_s +{ + GObject parent; +}; + +struct zathura_synctex_dbus_class_s +{ + GObjectClass parent_class; + + bool (*view)(ZathuraSynctexDbus* synctex_dbus, const char* position); +}; + +#define ZATHURA_TYPE_SYNCTEX_DBUS \ + (zathura_synctex_dbus_get_type()) +#define ZATHURA_SYNCTEX_DBUS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ + ZathuraSynctexDbus)) +#define ZATHURA_SYNCTEX_DBUS_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_CAST((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ + ZathuraSynctexDbus)) +#define ZATHURA_IS_SYNCTEX_DBUS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZATHURA_TYPE_SYNCTEX_DBUS)) +#define ZATHURA_IS_SYNCTEX_DBUS_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((obj), ZATHURA_TYPE_SYNCTEX_DBUS)) +#define ZATHURA_SYNCTEX_DBUS_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ + ZathuraSynctexDbusClass)) + +GType zathura_synctex_dbus_get_type(void); + +ZathuraSynctexDbus* zathura_synctex_dbus_new(zathura_t* zathura); + +/* bool zathura_synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, + const char* position); */ + + +#endif diff --git a/types.h b/types.h index a211e8f..71dce5d 100644 --- a/types.h +++ b/types.h @@ -35,6 +35,11 @@ typedef struct zathura_plugin_manager_s zathura_plugin_manager_t; */ typedef struct zathura_renderer_s ZathuraRenderer; +/** + * Synctex DBus manager + */ +typedef struct zathura_synctex_dbus_s ZathuraSynctexDbus; + /** * Error types */ diff --git a/zathura.c b/zathura.c index 9caa762..d62ec2e 100644 --- a/zathura.c +++ b/zathura.c @@ -34,6 +34,7 @@ #include "page-widget.h" #include "plugin.h" #include "adjustment.h" +#include "synctex-dbus.h" typedef struct zathura_document_info_s { zathura_t* zathura; @@ -804,6 +805,9 @@ document_open(zathura_t* zathura, const char* path, const char* password, position_set(zathura, file_info.position_x, file_info.position_y); } + /* Start D-Bus */ + zathura->synctex.dbus = zathura_synctex_dbus_new(zathura); + return true; error_free: @@ -886,6 +890,12 @@ document_close(zathura_t* zathura, bool keep_monitor) /* stop rendering */ zathura_renderer_stop(zathura->sync.render_thread); + /* stop D-Bus */ + if (zathura->synctex.dbus != NULL) { + g_object_unref(zathura->synctex.dbus); + zathura->synctex.dbus = NULL; + } + /* remove monitor */ if (keep_monitor == false) { if (zathura->file_monitor.monitor != NULL) { diff --git a/zathura.h b/zathura.h index 5f63d01..1eded22 100644 --- a/zathura.h +++ b/zathura.h @@ -89,6 +89,7 @@ struct zathura_s { bool enabled; gchar* editor; + ZathuraSynctexDbus* dbus; } synctex; struct From 1b6a2b47534d0f64c6531f919ed8eb7481ec27fa Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 01:05:40 +0100 Subject: [PATCH 028/129] Initial D-Bus client implementation Signed-off-by: Sebastian Ramacher --- main.c | 41 +++++++++++++++-------- synctex-dbus.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ synctex-dbus.h | 8 +++++ 3 files changed, 125 insertions(+), 13 deletions(-) diff --git a/main.c b/main.c index 7f3ac59..a0982ab 100644 --- a/main.c +++ b/main.c @@ -10,6 +10,7 @@ #include "zathura.h" #include "utils.h" +#include "synctex-dbus.h" /* main function */ int @@ -43,6 +44,7 @@ main(int argc, char* argv[]) gchar* loglevel = NULL; gchar* password = NULL; gchar* synctex_editor = NULL; + gchar* synctex_fwd = NULL; bool forkback = false; bool print_version = false; bool synctex = false; @@ -55,17 +57,18 @@ main(int argc, char* argv[]) #endif GOptionEntry entries[] = { - { "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, _("Reparents to window specified by xid"), "xid" }, - { "config-dir", 'c', 0, G_OPTION_ARG_FILENAME, &config_dir, _("Path to the config directory"), "path" }, - { "data-dir", 'd', 0, G_OPTION_ARG_FILENAME, &data_dir, _("Path to the data directory"), "path" }, - { "plugins-dir", 'p', 0, G_OPTION_ARG_STRING, &plugin_path, _("Path to the directories containing plugins"), "path" }, - { "fork", '\0',0, G_OPTION_ARG_NONE, &forkback, _("Fork into the background"), NULL }, - { "password", 'w', 0, G_OPTION_ARG_STRING, &password, _("Document password"), "password" }, - { "page", 'P', 0, G_OPTION_ARG_INT, &page_number, _("Page number to go to"), "number" }, - { "debug", 'l', 0, G_OPTION_ARG_STRING, &loglevel, _("Log level (debug, info, warning, error)"), "level" }, - { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version, _("Print version information"), NULL }, - { "synctex", 's', 0, G_OPTION_ARG_NONE, &synctex, _("Enable synctex support"), NULL }, - { "synctex-editor-command", 'x', 0, G_OPTION_ARG_STRING, &synctex_editor, _("Synctex editor (forwarded to the synctex command)"), "cmd" }, + { "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, _("Reparents to window specified by xid"), "xid" }, + { "config-dir", 'c', 0, G_OPTION_ARG_FILENAME, &config_dir, _("Path to the config directory"), "path" }, + { "data-dir", 'd', 0, G_OPTION_ARG_FILENAME, &data_dir, _("Path to the data directory"), "path" }, + { "plugins-dir", 'p', 0, G_OPTION_ARG_STRING, &plugin_path, _("Path to the directories containing plugins"), "path" }, + { "fork", '\0', 0, G_OPTION_ARG_NONE, &forkback, _("Fork into the background"), NULL }, + { "password", 'w', 0, G_OPTION_ARG_STRING, &password, _("Document password"), "password" }, + { "page", 'P', 0, G_OPTION_ARG_INT, &page_number, _("Page number to go to"), "number" }, + { "debug", 'l', 0, G_OPTION_ARG_STRING, &loglevel, _("Log level (debug, info, warning, error)"), "level" }, + { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version, _("Print version information"), NULL }, + { "synctex", 's', 0, G_OPTION_ARG_NONE, &synctex, _("Enable synctex support"), NULL }, + { "synctex-editor-command", 'x', 0, G_OPTION_ARG_STRING, &synctex_editor, _("Synctex editor (forwarded to the synctex command)"), "cmd" }, + { "synctex-forward", '\0', 0, G_OPTION_ARG_STRING, &synctex_fwd, _("Synctex forward ..."), "position" }, { NULL, '\0', 0, 0, NULL, NULL, NULL } }; @@ -82,11 +85,23 @@ main(int argc, char* argv[]) } g_option_context_free(context); + if (synctex_fwd != NULL) { + if (argc != 2) { + girara_error(_("Too many arguments or missing filename while running with --syntex-forward")); + return -1; + } + + if (synctex_forward_position(argv[1], synctex_fwd) == true) { + return 0; + } + } + + /* Fork into the background if the user really wants to ... */ if (forkback == true) { - int pid = fork(); + const int pid = fork(); if (pid > 0) { /* parent */ - exit(0); + return 0; } else if (pid < 0) { /* error */ girara_error("Couldn't fork."); } diff --git a/synctex-dbus.c b/synctex-dbus.c index 66116a2..a9f2926 100644 --- a/synctex-dbus.c +++ b/synctex-dbus.c @@ -223,3 +223,92 @@ static const GDBusInterfaceVTable interface_vtable = .set_property = NULL }; +static const unsigned int TIMEOUT = 3000; + +bool +synctex_forward_position(const char* filename, const char* position) +{ + if (filename == NULL || position == NULL) { + return false; + } + + GError* error = NULL; + GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, + NULL, &error); + /* GDBusProxy* proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_NONE, NULL, "org.freedesktop.DBus", + "/org/freedesktop/DBus", "org.freedesktop.DBus", NULL, &error); */ + if (connection == NULL) { + girara_error("Could not create proxy for 'org.freedesktop.DBus': %s", + error->message); + g_error_free(error); + return false; + } + + GVariant* vnames = g_dbus_connection_call_sync(connection, + "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", + "ListNames", NULL, G_VARIANT_TYPE("(as)"), G_DBUS_CALL_FLAGS_NONE, + TIMEOUT, NULL, &error); + if (vnames == NULL) { + girara_error("Could not list available names: %s", error->message); + g_error_free(error); + // g_object_unref(proxy); + g_object_unref(connection); + return false; + } + + GVariantIter* iter = NULL; + g_variant_get(vnames, "(as)", &iter); + + gchar* name = NULL; + bool found_one = false; + while (g_variant_iter_loop(iter, "s", &name) == TRUE) { + if (g_str_has_prefix(name, "org.pwmt.zathura.PID") == FALSE) { + continue; + } + girara_debug("Found name: %s", name); + + GVariant* vfilename = g_dbus_connection_call_sync(connection, + name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties", + "Get", g_variant_new("(ss)", "org.pwmt.zathura.Synctex", "filename"), + G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, + TIMEOUT, NULL, &error); + if (vfilename == NULL) { + girara_error("Failed to query 'filename' property from '%s': %s", + name, error->message); + g_error_free(error); + continue; + } + + GVariant* tmp = NULL; + g_variant_get(vfilename, "(v)", &tmp); + gchar* remote_filename = g_variant_dup_string(tmp, NULL); + girara_debug("Filename from '%s': %s", name, remote_filename); + g_variant_unref(tmp); + g_variant_unref(vfilename); + + if (g_strcmp0(filename, remote_filename) != 0) { + g_free(remote_filename); + continue; + } + + g_free(remote_filename); + found_one = true; + + GVariant* ret = g_dbus_connection_call_sync(connection, + name, DBUS_OBJPATH, "org.pwmt.zathura.Synctex", "View", + g_variant_new("(s)", position), G_VARIANT_TYPE("(b)"), + G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); + if (ret == NULL) { + girara_error("Failed to run View on '%s': %s", name, error->message); + g_error_free(error); + } else { + g_variant_unref(ret); + } + } + g_variant_iter_free(iter); + g_variant_unref(vnames); + + return found_one; +} + diff --git a/synctex-dbus.h b/synctex-dbus.h index 749bf10..1cb2501 100644 --- a/synctex-dbus.h +++ b/synctex-dbus.h @@ -45,5 +45,13 @@ ZathuraSynctexDbus* zathura_synctex_dbus_new(zathura_t* zathura); /* bool zathura_synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, const char* position); */ +/** + * Forward synctex position to zathura instance having the right file open. + * @param filename filename + * @param position synctex position + * @returns true if a instance was found that has the given filename open, false + * otherwise + */ +bool synctex_forward_position(const char* filename, const char* position); #endif From ccab5cf829db955ddccc854a448f8ac78f62d53d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 01:09:27 +0100 Subject: [PATCH 029/129] Close the connection Signed-off-by: Sebastian Ramacher --- synctex-dbus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/synctex-dbus.c b/synctex-dbus.c index a9f2926..4de17da 100644 --- a/synctex-dbus.c +++ b/synctex-dbus.c @@ -308,6 +308,7 @@ synctex_forward_position(const char* filename, const char* position) } g_variant_iter_free(iter); g_variant_unref(vnames); + g_object_unref(connection); return found_one; } From b36c078710719fec35b4c598fde3cc1b38621ec5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 01:17:21 +0100 Subject: [PATCH 030/129] Add interface definition Signed-off-by: Sebastian Ramacher --- org.pwmt.zathura.synctex.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 org.pwmt.zathura.synctex.xml diff --git a/org.pwmt.zathura.synctex.xml b/org.pwmt.zathura.synctex.xml new file mode 100644 index 0000000..eb3538e --- /dev/null +++ b/org.pwmt.zathura.synctex.xml @@ -0,0 +1,10 @@ + + + + + + + + + + From fb000b9607a45d090cf26fb431fd93a289aaed1b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 01:19:50 +0100 Subject: [PATCH 031/129] Install D-Bus interface definitions Signed-off-by: Sebastian Ramacher --- Makefile | 8 +++++++- config.mk | 1 + synctex-dbus.c | 12 +++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e1f4a54..a08418c 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,7 @@ dist: clean build-manpages ${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \ ${PROJECT}.desktop version.h.in \ ${PROJECT}.1 ${PROJECT}rc.5 \ + org.pwmt.zathura.synxtex.xml \ ${PROJECT}-${VERSION} $(QUIET)cp tests/Makefile tests/config.mk tests/*.c \ ${PROJECT}-${VERSION}/tests @@ -184,7 +185,12 @@ install-headers: ${PROJECT}.pc $(QUIET)mkdir -m 755 -p ${DESTDIR}${LIBDIR}/pkgconfig $(QUIET)install -m 644 ${PROJECT}.pc ${DESTDIR}${LIBDIR}/pkgconfig -install: all install-headers install-manpages +install-dbus: + $(ECHO) installing D-Bus interface definitions + $(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR) + $(QUIET)install -m 644 org.pwmt.zathura.synxtex.xml $(DESTDIR)$(DBUSINTERFACEDIR) + +install: all install-headers install-manpages install-dbus $(ECHO) installing executable file $(QUIET)mkdir -m 755 -p ${DESTDIR}${PREFIX}/bin $(QUIET)install -m 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin diff --git a/config.mk b/config.mk index 620faa7..e167660 100644 --- a/config.mk +++ b/config.mk @@ -43,6 +43,7 @@ MANPREFIX ?= ${PREFIX}/share/man DESKTOPPREFIX ?= ${PREFIX}/share/applications LIBDIR ?= ${PREFIX}/lib INCLUDEDIR ?= ${PREFIX}/include +DBUSINTERFACEDIR =? ${PREFIX}/share/dbus-1/interfaces # plugin directory PLUGINDIR ?= ${LIBDIR}/zathura diff --git a/synctex-dbus.c b/synctex-dbus.c index 4de17da..6d003f8 100644 --- a/synctex-dbus.c +++ b/synctex-dbus.c @@ -14,8 +14,10 @@ G_DEFINE_TYPE(ZathuraSynctexDbus, zathura_synctex_dbus, G_TYPE_OBJECT) /* template for bus name */ static const char DBUS_NAME_TEMPLATE[] = "org.pwmt.zathura.PID-%d"; -/* template for object path */ -const char DBUS_OBJPATH[] = "/org/pwmt/zathura/synctex"; +/* object path */ +static const char DBUS_OBJPATH[] = "/org/pwmt/zathura/synctex"; +/* interface name */ +static const char DBUS_INTERFACE[] = "org.pwmt.zathura.synctex"; typedef struct private_s { zathura_t* zathura; @@ -32,7 +34,7 @@ typedef struct private_s { /* Introspection data for the service we are exporting */ static const char SYNCTEX_DBUS_INTROSPECTION[] = "\n" - " \n" + " \n" " \n" " \n" " \n" @@ -270,7 +272,7 @@ synctex_forward_position(const char* filename, const char* position) GVariant* vfilename = g_dbus_connection_call_sync(connection, name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties", - "Get", g_variant_new("(ss)", "org.pwmt.zathura.Synctex", "filename"), + "Get", g_variant_new("(ss)", DBUS_INTERFACE, "filename"), G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); if (vfilename == NULL) { @@ -296,7 +298,7 @@ synctex_forward_position(const char* filename, const char* position) found_one = true; GVariant* ret = g_dbus_connection_call_sync(connection, - name, DBUS_OBJPATH, "org.pwmt.zathura.Synctex", "View", + name, DBUS_OBJPATH, DBUS_INTERFACE, "View", g_variant_new("(s)", position), G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); if (ret == NULL) { From f5983a842942bcdbae0cf8ce55f4f20885698298 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 01:25:20 +0100 Subject: [PATCH 032/129] Remove some unneeded stuff Signed-off-by: Sebastian Ramacher --- synctex-dbus.c | 26 ++------------------------ synctex-dbus.h | 5 ----- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/synctex-dbus.c b/synctex-dbus.c index 6d003f8..d64b3af 100644 --- a/synctex-dbus.c +++ b/synctex-dbus.c @@ -45,9 +45,6 @@ static const char SYNCTEX_DBUS_INTROSPECTION[] = static const GDBusInterfaceVTable interface_vtable; -static bool synctex_dbus_view(ZathuraSynctexDbus* synctex_view, - const char* position); - static void finalize(GObject* object) { @@ -72,9 +69,6 @@ finalize(GObject* object) static void zathura_synctex_dbus_class_init(ZathuraSynctexDbusClass* class) { - /* initialize methods */ - class->view = synctex_dbus_view; - /* add private members */ g_type_class_add_private(class, sizeof(private_t)); @@ -162,23 +156,6 @@ zathura_synctex_dbus_new(zathura_t* zathura) return synctex_dbus; } -static bool -synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, const char* position) -{ - private_t* priv = GET_PRIVATE(synctex_dbus); - return synctex_view(priv->zathura, position); -} - -bool -zathura_synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, const char* position) -{ - g_return_val_if_fail(ZATHURA_IS_SYNCTEX_DBUS(synctex_dbus), false); - g_return_val_if_fail(position != NULL, false); - - return ZATHURA_SYNCTEX_DBUS_GET_CLASS(synctex_dbus)->view(synctex_dbus, - position); -} - /* D-Bus handler */ static void @@ -189,12 +166,13 @@ handle_method_call(GDBusConnection* UNUSED(connection), GDBusMethodInvocation* invocation, void* data) { ZathuraSynctexDbus* synctex_dbus = data; + private_t* priv = GET_PRIVATE(synctex_dbus); if (g_strcmp0(method_name, "View") == 0) { gchar* position = NULL; g_variant_get(parameters, "(s)", &position); - const bool ret = zathura_synctex_dbus_view(synctex_dbus, position); + const bool ret = synctex_view(priv->zathura, position); g_free(position); GVariant* result = g_variant_new("(b)", ret); diff --git a/synctex-dbus.h b/synctex-dbus.h index 1cb2501..f180a5d 100644 --- a/synctex-dbus.h +++ b/synctex-dbus.h @@ -18,8 +18,6 @@ struct zathura_synctex_dbus_s struct zathura_synctex_dbus_class_s { GObjectClass parent_class; - - bool (*view)(ZathuraSynctexDbus* synctex_dbus, const char* position); }; #define ZATHURA_TYPE_SYNCTEX_DBUS \ @@ -42,9 +40,6 @@ GType zathura_synctex_dbus_get_type(void); ZathuraSynctexDbus* zathura_synctex_dbus_new(zathura_t* zathura); -/* bool zathura_synctex_dbus_view(ZathuraSynctexDbus* synctex_dbus, - const char* position); */ - /** * Forward synctex position to zathura instance having the right file open. * @param filename filename From 03e1fb1f90ce5364ee4e8691d892bb212663fd33 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 01:41:43 +0100 Subject: [PATCH 033/129] Set log level earlier Signed-off-by: Sebastian Ramacher --- main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index a0982ab..bacc52d 100644 --- a/main.c +++ b/main.c @@ -85,6 +85,15 @@ main(int argc, char* argv[]) } g_option_context_free(context); + /* Set log level. */ + if (loglevel == NULL || g_strcmp0(loglevel, "info") == 0) { + girara_set_debug_level(GIRARA_INFO); + } else if (g_strcmp0(loglevel, "warning") == 0) { + girara_set_debug_level(GIRARA_WARNING); + } else if (g_strcmp0(loglevel, "error") == 0) { + girara_set_debug_level(GIRARA_ERROR); + } + if (synctex_fwd != NULL) { if (argc != 2) { girara_error(_("Too many arguments or missing filename while running with --syntex-forward")); @@ -109,15 +118,6 @@ main(int argc, char* argv[]) setsid(); } - /* Set log level. */ - if (loglevel == NULL || g_strcmp0(loglevel, "info") == 0) { - girara_set_debug_level(GIRARA_INFO); - } else if (g_strcmp0(loglevel, "warning") == 0) { - girara_set_debug_level(GIRARA_WARNING); - } else if (g_strcmp0(loglevel, "error") == 0) { - girara_set_debug_level(GIRARA_ERROR); - } - zathura_set_xid(zathura, embed); zathura_set_config_dir(zathura, config_dir); zathura_set_data_dir(zathura, data_dir); From 5640bc78ec86782e0cc7a91065ebb107f5f42fc0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 17:50:38 +0100 Subject: [PATCH 034/129] Add initial vim ftplugin --- tex_zathurasyntex.vim | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tex_zathurasyntex.vim diff --git a/tex_zathurasyntex.vim b/tex_zathurasyntex.vim new file mode 100644 index 0000000..652eab4 --- /dev/null +++ b/tex_zathurasyntex.vim @@ -0,0 +1,52 @@ +" See LICENSE file for license and copyright information + +" avoid re-execution +if exists("b:did_zathura_synctex_plugin") + finish +endif +let b:did_zathura_synctex_plugin = 1 + +" set up global variables +if !exists("g:zathura_synctex_latex_suite") + let g:zathura_synctex_latex_suite = 1 +endif + +function! Zathura_SyncTexForward() + let source = expand("%:p") + let input = shellescape(line(".").":".col(".").":".source) + let output = "" + if exists("*Tex_GetMainFileName") && g:zathura_synctex_latex_suite == 1 + " use Tex_GetMainFileName from latex-suite if it is available + let output = Tex_GetMainFileName(":p:r").".pdf" + else + " try to find synctex files and use them to determine the output file + let synctex_files = split(glob("%:p:h/*.synctex.gz"), "\n") + if len(synctex_files) == 0 + echo "No synctex file found" + return + endif + + let found = 0 + for synctex in synctex_files + let pdffile = substitute(synctex, "synctex.gz", "pdf", "") + let out = system("synctex view -i ".input." -o ".shellescape(pdffile)) + if match(out, "No tag for ".source) >= 0 + continue + endif + + let found = 1 + let output = pdffile + break + endfor + + if found == 0 + echo "No synctex file containing reference to source file found" + return + endif + endif + + let execstr = "silent !zathura --synctex-forward=".input." ".shellescape(output) + exec execstr +endfunction + +nmap f :call Zathura_SyncTexForward() From 2b446f4182fde0b3185c4349bbed2ef3fa220dd6 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Dec 2013 17:58:50 +0100 Subject: [PATCH 035/129] Fail if no open instance has been found Signed-off-by: Sebastian Ramacher --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index bacc52d..80b0af5 100644 --- a/main.c +++ b/main.c @@ -96,12 +96,15 @@ main(int argc, char* argv[]) if (synctex_fwd != NULL) { if (argc != 2) { - girara_error(_("Too many arguments or missing filename while running with --syntex-forward")); + girara_error("Too many arguments or missing filename while running with --syntex-forward"); return -1; } if (synctex_forward_position(argv[1], synctex_fwd) == true) { return 0; + } else { + girara_error("Could not find open instance for '%s'., argv[1]); + return -1; } } From d0b7750065be077e1fb498784e7f039bb9582fff Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Fri, 27 Dec 2013 17:12:59 +0100 Subject: [PATCH 036/129] Fix quotes in girara_error call --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 80b0af5..dfc1f81 100644 --- a/main.c +++ b/main.c @@ -103,7 +103,7 @@ main(int argc, char* argv[]) if (synctex_forward_position(argv[1], synctex_fwd) == true) { return 0; } else { - girara_error("Could not find open instance for '%s'., argv[1]); + girara_error("Could not find open instance for '%s'", argv[1]); return -1; } } From 2940be27f1d840b43c0c7410d549b0057a68ce3a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 20:16:00 +0100 Subject: [PATCH 037/129] Document --syntex-forward Signed-off-by: Sebastian Ramacher --- zathura.1.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zathura.1.rst b/zathura.1.rst index 36384ed..7c06ae7 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -14,6 +14,7 @@ SYNOPOSIS ========= | zathura [OPTION]... | zathura [OPTION]... FILE [FILE ...] +| zathura --syntex-forward INPUT FILE DESCRIPTION =========== @@ -58,6 +59,10 @@ OPTIONS -x [cmd], --synctex-editor-command [cmd] Set the synctex editor command +--syntex-forward [input], + Jump to the given position. The switch expcects the same format as specified + for syntex's view -i. + MOUSE AND KEY BINDINGS ====================== From 81e75539b34357ca6c4e7418bc868d3b4289b905 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 20:40:06 +0100 Subject: [PATCH 038/129] Use fullpath in for --syntex-forward Signed-off-by: Sebastian Ramacher --- main.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index dfc1f81..5e7d168 100644 --- a/main.c +++ b/main.c @@ -1,11 +1,17 @@ /* See LICENSE file for license and copyright information */ +#define _BSD_SOURCE +#define _XOPEN_SOURCE 700 + +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include #include #include "zathura.h" @@ -100,10 +106,19 @@ main(int argc, char* argv[]) return -1; } - if (synctex_forward_position(argv[1], synctex_fwd) == true) { + char* real_path = realpath(argv[1], NULL); + if (real_path == NULL) { + girara_error("Failed to determine real path: %s", strerror(errno)); + return -1; + } + + const bool ret = synctex_forward_position(argv[1], synctex_fwd); + free(real_path); + + if (ret == true) { return 0; } else { - girara_error("Could not find open instance for '%s'", argv[1]); + girara_error("Could not find open instance for '%s'", real_path); return -1; } } From de46558ecc55167b05b924b9c2db48785e731f8e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 21:15:05 +0100 Subject: [PATCH 039/129] Update help string --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index ae6e89c..cf83892 100644 --- a/main.c +++ b/main.c @@ -69,7 +69,7 @@ main(int argc, char* argv[]) { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version, _("Print version information"), NULL }, { "synctex", 's', 0, G_OPTION_ARG_NONE, &synctex, _("Enable synctex support"), NULL }, { "synctex-editor-command", 'x', 0, G_OPTION_ARG_STRING, &synctex_editor, _("Synctex editor (forwarded to the synctex command)"), "cmd" }, - { "synctex-forward", '\0', 0, G_OPTION_ARG_STRING, &synctex_fwd, _("Synctex forward ..."), "position" }, + { "synctex-forward", '\0', 0, G_OPTION_ARG_STRING, &synctex_fwd, _("Move to given synctex position"), "position" }, { NULL, '\0', 0, 0, NULL, NULL, NULL } }; From 24581734737b9463ffd0951baf178ba33daa02b3 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 21:15:41 +0100 Subject: [PATCH 040/129] Really use realpath Signed-off-by: Sebastian Ramacher --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index cf83892..c22e954 100644 --- a/main.c +++ b/main.c @@ -107,7 +107,7 @@ main(int argc, char* argv[]) return -1; } - const bool ret = synctex_forward_position(argv[1], synctex_fwd); + const bool ret = synctex_forward_position(real_path, synctex_fwd); free(real_path); if (ret == true) { From b1e8edf0d6baa9e6d0ad9184a887b26866d6ca07 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 21:26:38 +0100 Subject: [PATCH 041/129] Install vim ftplugin Signed-off-by: Sebastian Ramacher --- Makefile | 10 ++++++++-- config.mk | 3 ++- tex_zathurasyntex.vim => tex_zathurasynctex.vim | 0 3 files changed, 10 insertions(+), 3 deletions(-) rename tex_zathurasyntex.vim => tex_zathurasynctex.vim (100%) diff --git a/Makefile b/Makefile index a08418c..237d0a4 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,8 @@ dist: clean build-manpages ${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \ ${PROJECT}.desktop version.h.in \ ${PROJECT}.1 ${PROJECT}rc.5 \ - org.pwmt.zathura.synxtex.xml \ + org.pwmt.zathura.synctex.xml \ + tex_zathurasynctex.tex \ ${PROJECT}-${VERSION} $(QUIET)cp tests/Makefile tests/config.mk tests/*.c \ ${PROJECT}-${VERSION}/tests @@ -188,7 +189,12 @@ install-headers: ${PROJECT}.pc install-dbus: $(ECHO) installing D-Bus interface definitions $(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR) - $(QUIET)install -m 644 org.pwmt.zathura.synxtex.xml $(DESTDIR)$(DBUSINTERFACEDIR) + $(QUIET)install -m 644 org.pwmt.zathura.synctex.xml $(DESTDIR)$(DBUSINTERFACEDIR) + +install-vimftplugin: + $(ECHO) installing Vim filetype plugin + $(QUIET)mkdir -m 755 -p $(DESTDIR)$(VIMFTPLUGINDIR) + $(QUIET)install -m 644 tex_zathurasynctex.vim $(DESTDIR)$(VIMFTPLUGINDIR) install: all install-headers install-manpages install-dbus $(ECHO) installing executable file diff --git a/config.mk b/config.mk index e167660..c57531f 100644 --- a/config.mk +++ b/config.mk @@ -43,7 +43,8 @@ MANPREFIX ?= ${PREFIX}/share/man DESKTOPPREFIX ?= ${PREFIX}/share/applications LIBDIR ?= ${PREFIX}/lib INCLUDEDIR ?= ${PREFIX}/include -DBUSINTERFACEDIR =? ${PREFIX}/share/dbus-1/interfaces +DBUSINTERFACEDIR ?= ${PREFIX}/share/dbus-1/interfaces +VIMFTPLUGINDIR ?= ${PREFIX}/share/vim/addons/ftplugin # plugin directory PLUGINDIR ?= ${LIBDIR}/zathura diff --git a/tex_zathurasyntex.vim b/tex_zathurasynctex.vim similarity index 100% rename from tex_zathurasyntex.vim rename to tex_zathurasynctex.vim From 029364bd30e3f466ef1df58ab2360434429b5c26 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 22:21:59 +0100 Subject: [PATCH 042/129] Fix use after free Signed-off-by: Sebastian Ramacher --- main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index c22e954..2f0c52a 100644 --- a/main.c +++ b/main.c @@ -107,13 +107,12 @@ main(int argc, char* argv[]) return -1; } - const bool ret = synctex_forward_position(real_path, synctex_fwd); - free(real_path); - - if (ret == true) { + if (synctex_forward_position(real_path, synctex_fwd) == true) { + free(real_path); return 0; } else { girara_error("Could not find open instance for '%s'", real_path); + free(real_path); return -1; } } From 85e8833305608591398a41655e026c4e9b8848c3 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 27 Dec 2013 22:32:19 +0100 Subject: [PATCH 043/129] Move D-Bus interface definition and vim ftplugin to data Signed-off-by: Sebastian Ramacher --- Makefile | 7 +++---- .../org.pwmt.zathura.synctex.xml | 0 tex_zathurasynctex.vim => data/tex_zathurasynctex.vim | 0 3 files changed, 3 insertions(+), 4 deletions(-) rename org.pwmt.zathura.synctex.xml => data/org.pwmt.zathura.synctex.xml (100%) rename tex_zathurasynctex.vim => data/tex_zathurasynctex.vim (100%) diff --git a/Makefile b/Makefile index 237d0a4..83acc7a 100644 --- a/Makefile +++ b/Makefile @@ -128,9 +128,8 @@ dist: clean build-manpages ${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \ ${PROJECT}.desktop version.h.in \ ${PROJECT}.1 ${PROJECT}rc.5 \ - org.pwmt.zathura.synctex.xml \ - tex_zathurasynctex.tex \ ${PROJECT}-${VERSION} + $(QUIET)cp -r data ${PROJECT}-${VERSION} $(QUIET)cp tests/Makefile tests/config.mk tests/*.c \ ${PROJECT}-${VERSION}/tests $(QUIET)cp po/Makefile po/*.po ${PROJECT}-${VERSION}/po @@ -189,12 +188,12 @@ install-headers: ${PROJECT}.pc install-dbus: $(ECHO) installing D-Bus interface definitions $(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR) - $(QUIET)install -m 644 org.pwmt.zathura.synctex.xml $(DESTDIR)$(DBUSINTERFACEDIR) + $(QUIET)install -m 644 data/org.pwmt.zathura.synctex.xml $(DESTDIR)$(DBUSINTERFACEDIR) install-vimftplugin: $(ECHO) installing Vim filetype plugin $(QUIET)mkdir -m 755 -p $(DESTDIR)$(VIMFTPLUGINDIR) - $(QUIET)install -m 644 tex_zathurasynctex.vim $(DESTDIR)$(VIMFTPLUGINDIR) + $(QUIET)install -m 644 data/tex_zathurasynctex.vim $(DESTDIR)$(VIMFTPLUGINDIR) install: all install-headers install-manpages install-dbus $(ECHO) installing executable file diff --git a/org.pwmt.zathura.synctex.xml b/data/org.pwmt.zathura.synctex.xml similarity index 100% rename from org.pwmt.zathura.synctex.xml rename to data/org.pwmt.zathura.synctex.xml diff --git a/tex_zathurasynctex.vim b/data/tex_zathurasynctex.vim similarity index 100% rename from tex_zathurasynctex.vim rename to data/tex_zathurasynctex.vim From 79e812dc5e0f5fa35a0a4687c0d4fe18eb134715 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Mon, 30 Dec 2013 06:46:09 +0100 Subject: [PATCH 044/129] Run command in vim script without breaking the screen --- tex_zathurasynctex.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tex_zathurasynctex.vim b/tex_zathurasynctex.vim index 652eab4..9f28889 100644 --- a/tex_zathurasynctex.vim +++ b/tex_zathurasynctex.vim @@ -45,8 +45,8 @@ function! Zathura_SyncTexForward() endif endif - let execstr = "silent !zathura --synctex-forward=".input." ".shellescape(output) - exec execstr + let execstr = "zathura --synctex-forward=".input." ".shellescape(output) + silent call system(execstr) endfunction nmap f :call Zathura_SyncTexForward() From 3c83a50cffe3f8efbd0e2bc63f8b2fcfc9a41db2 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 1 Jan 2014 16:49:34 +0100 Subject: [PATCH 045/129] Update copyright years --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f9fa617..f115cbe 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2013 pwmt.org +Copyright (c) 2009-2014 pwmt.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages From 6cd8f2d3f6896d5e2e2f35fa51d56ed07e7eb5b5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 1 Jan 2014 16:50:19 +0100 Subject: [PATCH 046/129] Run version check if config.mk changed --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 83acc7a..f73a7ed 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ DOBJECTS = $(patsubst %.c, %.do, $(SOURCE)) all: options ${PROJECT} po build-manpages # pkg-config based version checks -.version-checks/%: +.version-checks/%: config.mk $(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \ pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \ echo "The minium required version of $(*) is $($(*)_MIN_VERSION)" && \ From d9a4c1862776c998dfe181d62e8bf3f2e9c65721 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 1 Jan 2014 18:14:17 +0100 Subject: [PATCH 047/129] Remove extra --- data/tex_zathurasynctex.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/tex_zathurasynctex.vim b/data/tex_zathurasynctex.vim index 9f28889..9096ecc 100644 --- a/data/tex_zathurasynctex.vim +++ b/data/tex_zathurasynctex.vim @@ -49,4 +49,4 @@ function! Zathura_SyncTexForward() silent call system(execstr) endfunction -nmap f :call Zathura_SyncTexForward() +nmap f :call Zathura_SyncTexForward() From aeaa900a9439976477486c2a0c94e5554d9a3cae Mon Sep 17 00:00:00 2001 From: Sebastian Neuser Date: Wed, 1 Jan 2014 19:19:28 +0100 Subject: [PATCH 048/129] Preserve horizontal position when scrolling to PAGE_TOP/BOTTOM --- shortcuts.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index e0a141f..23ea84e 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -507,12 +507,14 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, /* If PAGE_TOP or PAGE_BOTTOM, go there and we are done */ if (argument->n == PAGE_TOP) { - page_number_to_position(zathura->document, page_id, 0.5, 0.0, &pos_x, &pos_y); - position_set(zathura, -1, pos_y); + double dontcare = 0.5; + page_number_to_position(zathura->document, page_id, dontcare, 0.0, &dontcare, &pos_y); + position_set(zathura, pos_x, pos_y); return false; } else if (argument->n == PAGE_BOTTOM) { - page_number_to_position(zathura->document, page_id, 0.5, 1.0, &pos_x, &pos_y); - position_set(zathura, -1, pos_y); + double dontcare = 0.5; + page_number_to_position(zathura->document, page_id, dontcare, 1.0, &dontcare, &pos_y); + position_set(zathura, pos_x, pos_y); return false; } From 3a524935d23c9f4e8946c43f87140c708454026b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 4 Jan 2014 20:19:53 +0100 Subject: [PATCH 049/129] Clean up Signed-off-by: Sebastian Ramacher --- data/tex_zathurasynctex.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/tex_zathurasynctex.vim b/data/tex_zathurasynctex.vim index 9096ecc..4ac8be9 100644 --- a/data/tex_zathurasynctex.vim +++ b/data/tex_zathurasynctex.vim @@ -1,4 +1,4 @@ -" See LICENSE file for license and copyright information +" See LICENSE file for license and copyright information " avoid re-execution if exists("b:did_zathura_synctex_plugin") From db1f2c98a8646875a7c02393a39972c38b00321e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 4 Jan 2014 20:23:48 +0100 Subject: [PATCH 050/129] Update translations Signed-off-by: Sebastian Ramacher --- po/ca.po | 5 +-- po/cs.po | 2 +- po/de.po | 2 +- po/el.po | 2 +- po/eo.po | 2 +- po/es.po | 2 +- po/es_CL.po | 2 +- po/et.po | 2 +- po/fr.po | 39 +++++++++--------- po/he.po | 2 +- po/hr.po | 2 +- po/id_ID.po | 46 ++++++++++----------- po/it.po | 2 +- po/pl.po | 2 +- po/pt_BR.po | 30 +++++++------- po/ru.po | 117 ++++++++++++++++++++++++++-------------------------- po/ta_IN.po | 2 +- po/tr.po | 2 +- po/uk_UA.po | 2 +- 19 files changed, 131 insertions(+), 134 deletions(-) diff --git a/po/ca.po b/po/ca.po index b331ecb..0928982 100644 --- a/po/ca.po +++ b/po/ca.po @@ -2,15 +2,14 @@ # See LICENSE file for license and copyright information # # Translators: -# norbux , 2013 -# norbux , 2012 # mvdan , 2012 +# norbux , 2012-2013 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2014-01-04 20:20+0100\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Catalan (http://www.transifex.com/projects/p/zathura/language/" "ca/)\n" diff --git a/po/cs.po b/po/cs.po index 083a527..1ba1fa8 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Martin Pelikan \n" "Language-Team: pwmt.org \n" "Language: cs\n" diff --git a/po/de.po b/po/de.po index f8eb78c..a037f1b 100644 --- a/po/de.po +++ b/po/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: German (http://www.transifex.com/projects/p/zathura/language/" "de/)\n" diff --git a/po/el.po b/po/el.po index e789213..217e6e8 100644 --- a/po/el.po +++ b/po/el.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Greek (http://www.transifex.com/projects/p/zathura/language/" "el/)\n" diff --git a/po/eo.po b/po/eo.po index db89adc..27d2a70 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-05 01:06+0100\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" "language/eo/)\n" diff --git a/po/es.po b/po/es.po index 1d69579..14c36aa 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Moritz Lipp \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" "zathura/language/es/)\n" diff --git a/po/es_CL.po b/po/es_CL.po index aae2625..40896ac 100644 --- a/po/es_CL.po +++ b/po/es_CL.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: watsh1ken \n" "Language-Team: Spanish (Chile) (http://www.transifex.net/projects/p/zathura/" "language/es_CL/)\n" diff --git a/po/et.po b/po/et.po index eb99602..dfc942f 100644 --- a/po/et.po +++ b/po/et.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Rivo Zängov \n" "Language-Team: Estonian (http://www.transifex.net/projects/p/zathura/" "language/et/)\n" diff --git a/po/fr.po b/po/fr.po index 7c36cb0..47e55b5 100644 --- a/po/fr.po +++ b/po/fr.po @@ -5,17 +5,18 @@ # bknecht , 2012 # Dorian , 2012 # Quentin Stiévenart , 2012 +# rike, 2014 # Stéphane Aulery , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" -"Last-Translator: Benoît Knecht \n" +"PO-Revision-Date: 2014-01-02 18:42+0000\n" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" "fr/)\n" "Language: fr\n" +"Last-Translator: rike\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -84,35 +85,35 @@ msgstr "Aucun marque-page correspondant : %s" #: ../commands.c:162 msgid "Title" -msgstr "" +msgstr "Titre" #: ../commands.c:163 msgid "Author" -msgstr "" +msgstr "Auteur" #: ../commands.c:164 msgid "Subject" -msgstr "" +msgstr "Sujet" #: ../commands.c:165 msgid "Keywords" -msgstr "" +msgstr "Mots clé" #: ../commands.c:166 msgid "Creator" -msgstr "" +msgstr "Créateur" #: ../commands.c:167 msgid "Producer" -msgstr "" +msgstr "Producteur" #: ../commands.c:168 msgid "Creation date" -msgstr "" +msgstr "Date de création" #: ../commands.c:169 msgid "Modification date" -msgstr "" +msgstr "Date de modification" #: ../commands.c:174 ../commands.c:196 msgid "No information available." @@ -229,7 +230,7 @@ msgstr "Zoom maximum" #: ../config.c:151 msgid "Maximum number of pages to keep in the cache" -msgstr "" +msgstr "Nombre maximum de pages à garder en cache" #: ../config.c:153 msgid "Number of positions to remember in the jumplist" @@ -265,9 +266,7 @@ msgstr "Recoloriser les pages" #: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Lors de la recoloration garder la teinte d'origine et ajuster seulement la " -"luminosité" +msgstr "Lors de la recoloration garder la teinte d'origine et ajuster seulement la luminosité" #: ../config.c:171 msgid "Wrap scrolling" @@ -287,11 +286,11 @@ msgstr "Zoom centré horizontalement" #: ../config.c:179 msgid "Align link target to the left" -msgstr "" +msgstr "Aligner la cible du lien à gauche" #: ../config.c:181 msgid "Let zoom be changed when following links" -msgstr "" +msgstr "Autoriser la modification du zoom quand on suit un lien" #: ../config.c:183 msgid "Center result horizontally" @@ -339,7 +338,7 @@ msgstr "Utiliser le nom de base du fichier dans le titre de la fenêtre" #: ../config.c:204 msgid "Display the page number in the window title" -msgstr "" +msgstr "Afficher le numéro de page dans le titre de la fenêtre" #: ../config.c:206 msgid "Use basename of the file in the statusbar" @@ -351,7 +350,7 @@ msgstr "Activer la prise en charge de synctex" #: ../config.c:210 msgid "The clipboard into which mouse-selected data will be written" -msgstr "" +msgstr "Le presse-papiers qui recevra les données sélectionnées avec la souris" #. define default inputbar commands #: ../config.c:369 @@ -510,11 +509,11 @@ msgstr "[Sans nom]" #: ../zathura.c:486 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" +msgstr "Impossible de lire le fichier depuis stdin et de le sauvegarder dans un fichier temporaire." #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" +msgstr "Type de fichier non supporté. Veuillez installer l'extension nécessaire." #: ../zathura.c:545 msgid "Document does not contain any pages" diff --git a/po/he.po b/po/he.po index 35c6ffd..e6f3834 100644 --- a/po/he.po +++ b/po/he.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Hebrew (http://www.transifex.com/projects/p/zathura/language/" "he/)\n" diff --git a/po/hr.po b/po/hr.po index 3a1c2a7..eb022a6 100644 --- a/po/hr.po +++ b/po/hr.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Croatian (http://www.transifex.com/projects/p/zathura/" "language/hr/)\n" diff --git a/po/id_ID.po b/po/id_ID.po index 2af438b..28a00ea 100644 --- a/po/id_ID.po +++ b/po/id_ID.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-12-15 05:57+0000\n" "Last-Translator: andjeng \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/" "zathura/language/id_ID/)\n" @@ -81,35 +81,35 @@ msgstr "Tidak ada bookmark: %s" #: ../commands.c:162 msgid "Title" -msgstr "" +msgstr "Judul" #: ../commands.c:163 msgid "Author" -msgstr "" +msgstr "Penulis" #: ../commands.c:164 msgid "Subject" -msgstr "" +msgstr "Subjek" #: ../commands.c:165 msgid "Keywords" -msgstr "" +msgstr "Kata kunci" #: ../commands.c:166 msgid "Creator" -msgstr "" +msgstr "Pembuat" #: ../commands.c:167 msgid "Producer" -msgstr "" +msgstr "Produser" #: ../commands.c:168 msgid "Creation date" -msgstr "" +msgstr "Tanggal pembuatan" #: ../commands.c:169 msgid "Modification date" -msgstr "" +msgstr "Tanggal ubahan" #: ../commands.c:174 ../commands.c:196 msgid "No information available." @@ -186,7 +186,7 @@ msgstr "Citra" #. zathura settings #: ../config.c:131 msgid "Database backend" -msgstr "" +msgstr "backend database" #: ../config.c:133 msgid "Zoom step" @@ -226,7 +226,7 @@ msgstr "Pembesaran maksimal" #: ../config.c:151 msgid "Maximum number of pages to keep in the cache" -msgstr "" +msgstr "Jumlah laman yang disimpan pada cache" #: ../config.c:153 msgid "Number of positions to remember in the jumplist" @@ -250,11 +250,11 @@ msgstr "Warna sorotan (aktif)" #: ../config.c:161 msgid "'Loading ...' background color" -msgstr "" +msgstr "'Memuat ...; warna latar" #: ../config.c:163 msgid "'Loading ...' foreground color" -msgstr "" +msgstr "'Memuat ...' warna depan" #: ../config.c:167 msgid "Recolor pages" @@ -282,11 +282,11 @@ msgstr "Pembesaran horisontal tengah" #: ../config.c:179 msgid "Align link target to the left" -msgstr "" +msgstr "Ratakan tautan ke kiri" #: ../config.c:181 msgid "Let zoom be changed when following links" -msgstr "" +msgstr "Biarkan pembesaran berubah saat mengikuti pranala" #: ../config.c:183 msgid "Center result horizontally" @@ -334,11 +334,11 @@ msgstr "Gunakan nama dasar file pada judul jendela" #: ../config.c:204 msgid "Display the page number in the window title" -msgstr "" +msgstr "Tampilkan nomor laman pada jendela judul" #: ../config.c:206 msgid "Use basename of the file in the statusbar" -msgstr "" +msgstr "Gunakan nama dasar berkas pada statusbar" #: ../config.c:208 ../main.c:67 msgid "Enable synctex support" @@ -346,7 +346,7 @@ msgstr "Support synctex" #: ../config.c:210 msgid "The clipboard into which mouse-selected data will be written" -msgstr "" +msgstr "Data yang dipilih tetikus akan ditulis ke clipboard" #. define default inputbar commands #: ../config.c:369 @@ -419,7 +419,7 @@ msgstr "Jangan menyorot hasil cari sekarang" #: ../config.c:386 msgid "Highlight current search results" -msgstr "" +msgstr "Sorot hasil pencarian sekarang" #: ../config.c:387 msgid "Show version information" @@ -469,7 +469,7 @@ msgstr "Kata sandi dokumen" #: ../main.c:64 msgid "Page number to go to" -msgstr "" +msgstr "Nomor halaman tujuan" #: ../main.c:65 msgid "Log level (debug, info, warning, error)" @@ -505,12 +505,12 @@ msgstr "[Tidak berjudul]" #: ../zathura.c:486 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" +msgstr "Tidak dapat membaca berkas dari stdin dan menulisnya ke berkas sementar" #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" +msgstr "Tipe berkas tidak didukung. Silakan memasang plugin yang dibutuhkan." #: ../zathura.c:545 msgid "Document does not contain any pages" -msgstr "" +msgstr "Dokumen tidak mempunyai laman apapun" diff --git a/po/it.po b/po/it.po index 215c000..aebfb7b 100644 --- a/po/it.po +++ b/po/it.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Italian (http://www.transifex.com/projects/p/zathura/language/" "it/)\n" diff --git a/po/pl.po b/po/pl.po index 83bc94d..37df1db 100644 --- a/po/pl.po +++ b/po/pl.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" "pl/)\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 452e0ea..8422d95 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: salmora8 \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" "zathura/language/pt_BR/)\n" @@ -82,35 +82,35 @@ msgstr "Não há favoritos: %s" #: ../commands.c:162 msgid "Title" -msgstr "" +msgstr "Título" #: ../commands.c:163 msgid "Author" -msgstr "" +msgstr "Autor" #: ../commands.c:164 msgid "Subject" -msgstr "" +msgstr "Assunto" #: ../commands.c:165 msgid "Keywords" -msgstr "" +msgstr "Palavras-chave" #: ../commands.c:166 msgid "Creator" -msgstr "" +msgstr "Criador" #: ../commands.c:167 msgid "Producer" -msgstr "" +msgstr "Produtor" #: ../commands.c:168 msgid "Creation date" -msgstr "" +msgstr "Data de criação" #: ../commands.c:169 msgid "Modification date" -msgstr "" +msgstr "Data de modificação" #: ../commands.c:174 ../commands.c:196 msgid "No information available." @@ -263,8 +263,7 @@ msgstr "Recolorir páginas" #: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" +msgstr "Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" #: ../config.c:171 msgid "Wrap scrolling" @@ -288,7 +287,7 @@ msgstr "Alinhe destino do link à esquerda" #: ../config.c:181 msgid "Let zoom be changed when following links" -msgstr "" +msgstr "Zoom será mudado quando seguir os links" #: ../config.c:183 msgid "Center result horizontally" @@ -348,7 +347,7 @@ msgstr "Ativar suporte synctex" #: ../config.c:210 msgid "The clipboard into which mouse-selected data will be written" -msgstr "" +msgstr "A área de transferência em que o dados selecionados com o mouse vão ser escritos" #. define default inputbar commands #: ../config.c:369 @@ -507,12 +506,11 @@ msgstr "[Sem nome]" #: ../zathura.c:486 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" +msgstr "Não foi possível ler o arquivo a partir de stdin e gravá-lo em um arquivo temporário." #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" -"Formato de arquivo não suportado. Por favor, instale o plugin necessário." +msgstr "Formato de arquivo não suportado. Por favor, instale o plugin necessário." #: ../zathura.c:545 msgid "Document does not contain any pages" diff --git a/po/ru.po b/po/ru.po index 6c62284..5eaf34b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -5,16 +5,17 @@ # AlexanderR , 2013 # Alissa , 2013 # Mikhail Krutov <>, 2012 +# vp1981 , 2013 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" -"Last-Translator: Sebastian Ramacher \n" +"PO-Revision-Date: 2013-12-16 13:11+0000\n" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" "ru/)\n" "Language: ru\n" +"Last-Translator: vp1981 \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -24,12 +25,12 @@ msgstr "" #: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." -msgstr "Неправильный ввод: %s" +msgstr "Неправильный ввод: %s." #: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." -msgstr "Получен неверный индекс %s" +msgstr "Получен неверный индекс: %s." #: ../callbacks.c:546 #, c-format @@ -41,11 +42,11 @@ msgstr "Выделенный текст скопирован в буфер: %s" #: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 #: ../shortcuts.c:1192 msgid "No document opened." -msgstr "Документ не открыт" +msgstr "Нет открытых документов." #: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." -msgstr "Неверное число аргументов" +msgstr "Указано неверное число аргументов." #: ../commands.c:53 #, c-format @@ -55,7 +56,7 @@ msgstr "Не могу создать закладку %s" #: ../commands.c:55 #, c-format msgid "Could not create bookmark: %s" -msgstr "Не могу создать закладку %s" +msgstr "Не удалось создать закладку %s" #: ../commands.c:60 #, c-format @@ -84,93 +85,93 @@ msgstr "Закладки %s не существует" #: ../commands.c:162 msgid "Title" -msgstr "" +msgstr "Заголовок" #: ../commands.c:163 msgid "Author" -msgstr "" +msgstr "Автор" #: ../commands.c:164 msgid "Subject" -msgstr "" +msgstr "Тема" #: ../commands.c:165 msgid "Keywords" -msgstr "" +msgstr "Ключевые слова" #: ../commands.c:166 msgid "Creator" -msgstr "" +msgstr "Создатель" #: ../commands.c:167 msgid "Producer" -msgstr "" +msgstr "Производитель" #: ../commands.c:168 msgid "Creation date" -msgstr "" +msgstr "Время создания" #: ../commands.c:169 msgid "Modification date" -msgstr "" +msgstr "Время изменения" #: ../commands.c:174 ../commands.c:196 msgid "No information available." -msgstr "Нет доступной информации" +msgstr "Нет доступной информации." #: ../commands.c:234 msgid "Too many arguments." -msgstr "Слишком много аргументов" +msgstr "Слишком много аргументов." #: ../commands.c:245 msgid "No arguments given." -msgstr "Отсутствуют аргументы" +msgstr "Отсутствуют аргументы." #: ../commands.c:304 ../commands.c:330 msgid "Document saved." -msgstr "Документ сохранён" +msgstr "Документ сохранён." #: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." -msgstr "Не удалось сохранить документ" +msgstr "Не удалось сохранить документ." #: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." -msgstr "Неверное количество аргументов" +msgstr "Неверное количество аргументов." #: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." -msgstr "Не могу сохранить приложенный файл %s в %s" +msgstr "Не удалось сохранить приложенный файл «%s» в «%s»." #: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." -msgstr "Файл %s сохранён в %s" +msgstr "Файл «%s» сохранён в «%s»." #: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." -msgstr "Файл '%s' сохранён в '%s'" +msgstr "Изображение «%s» сохранено в «%s»." #: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." -msgstr "Не могу сохранить приложенный файл %s в %s" +msgstr "Не удалось записать изображение «%s» в «%s»." #: ../commands.c:498 #, c-format msgid "Unknown image '%s'." -msgstr "Неизвестный файл %s." +msgstr "Неизвестное изображение «%s»." #: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." -msgstr "Неизвестное вложение %s." +msgstr "Неизвестное вложение или изображение «%s»." #: ../commands.c:553 msgid "Argument must be a number." -msgstr "Аргумент должен быть числом" +msgstr "Аргумент должен быть числом." #: ../completion.c:250 #, c-format @@ -179,7 +180,7 @@ msgstr "Страница %d" #: ../completion.c:293 msgid "Attachments" -msgstr "Прикепленные файлы" +msgstr "Прикреплённые файлы" #. add images #: ../completion.c:324 @@ -205,7 +206,7 @@ msgstr "Количество страниц в ряд" #: ../config.c:139 msgid "Column of the first page" -msgstr "" +msgstr "Столбец первой страницы" #: ../config.c:141 msgid "Scroll step" @@ -217,7 +218,7 @@ msgstr "Шаг горизонтальной прокрутки" #: ../config.c:145 msgid "Full page scroll overlap" -msgstr "" +msgstr "Перекрытие страниц при прокрутке" #: ../config.c:147 msgid "Zoom minimum" @@ -229,7 +230,7 @@ msgstr "Максимальное увеличение" #: ../config.c:151 msgid "Maximum number of pages to keep in the cache" -msgstr "" +msgstr "Максимальное количество страниц хранимых в кэше" #: ../config.c:153 msgid "Number of positions to remember in the jumplist" @@ -265,7 +266,7 @@ msgstr "Перекрасить страницы" #: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" +msgstr "При перекраске сохранять оттенок и изменять только осветление" #: ../config.c:171 msgid "Wrap scrolling" @@ -273,7 +274,7 @@ msgstr "Плавная прокрутка" #: ../config.c:173 msgid "Page aware scrolling" -msgstr "" +msgstr "Постраничная прокрутка" #: ../config.c:175 msgid "Advance number of pages per row" @@ -281,15 +282,15 @@ msgstr "Увеличить количество страниц в ряду" #: ../config.c:177 msgid "Horizontally centered zoom" -msgstr "" +msgstr "Центрировать увеличение по горизонтали" #: ../config.c:179 msgid "Align link target to the left" -msgstr "" +msgstr "Выровнять цель ссылки по левому краю" #: ../config.c:181 msgid "Let zoom be changed when following links" -msgstr "" +msgstr "Разрешить изменять размер при следовании по ссылкам" #: ../config.c:183 msgid "Center result horizontally" @@ -301,19 +302,19 @@ msgstr "Прозрачность подсветки" #: ../config.c:187 msgid "Render 'Loading ...'" -msgstr "Рендер 'Загружается ...'" +msgstr "Рендер «Загружается ...»" #: ../config.c:188 msgid "Adjust to when opening file" -msgstr "" +msgstr "Подогнать размеры при открытии документа" #: ../config.c:190 msgid "Show hidden files and directories" -msgstr "Показывать скрытые файлы и директории" +msgstr "Показывать скрытые файлы и каталоги" #: ../config.c:192 msgid "Show directories" -msgstr "Показывать директории" +msgstr "Показывать каталоги" #: ../config.c:194 msgid "Always open on first page" @@ -325,7 +326,7 @@ msgstr "Подсветить результаты поиска" #: ../config.c:198 msgid "Enable incremental search" -msgstr "Инкрементальный поиск" +msgstr "Включить инкрементальный поиск" #: ../config.c:200 msgid "Clear search results on abort" @@ -337,7 +338,7 @@ msgstr "Использовать базовое имя файла в загол #: ../config.c:204 msgid "Display the page number in the window title" -msgstr "Отображать номер страницы в заголовке" +msgstr "Показывать номер страницы в заголовке" #: ../config.c:206 msgid "Use basename of the file in the statusbar" @@ -345,11 +346,11 @@ msgstr "Использовать базовое имя файла в строк #: ../config.c:208 ../main.c:67 msgid "Enable synctex support" -msgstr "" +msgstr "Включить поддержку synctex" #: ../config.c:210 msgid "The clipboard into which mouse-selected data will be written" -msgstr "" +msgstr "Буфер для записи данных из области выделенных мышкой" #. define default inputbar commands #: ../config.c:369 @@ -398,7 +399,7 @@ msgstr "Сохранить документ" #: ../config.c:380 msgid "Save document (and force overwriting)" -msgstr "Сохранить документ (с перезапиьсю)" +msgstr "Сохранить документ (с перезаписью)" #: ../config.c:381 msgid "Save attachments" @@ -444,7 +445,7 @@ msgstr "Ссылка: %s" #: ../links.c:228 msgid "Link: Invalid" -msgstr "" +msgstr "Ссылка: неправильная" #: ../main.c:58 msgid "Reparents to window specified by xid" @@ -452,19 +453,19 @@ msgstr "Сменить материнское окно на окно, указа #: ../main.c:59 msgid "Path to the config directory" -msgstr "Путь к директории конфига" +msgstr "Путь к каталогу с настройкой" #: ../main.c:60 msgid "Path to the data directory" -msgstr "Путь к директории с данными" +msgstr "Путь к каталогу с данными" #: ../main.c:61 msgid "Path to the directories containing plugins" -msgstr "Путь к директории с плагинами" +msgstr "Путь к каталогу с плагинами" #: ../main.c:62 msgid "Fork into the background" -msgstr "Уйти в бэкграунд" +msgstr "Запустить в фоне" #: ../main.c:63 msgid "Document password" @@ -476,7 +477,7 @@ msgstr "Перейти к странице номер" #: ../main.c:65 msgid "Log level (debug, info, warning, error)" -msgstr "Уровень логирования (debug,info,warning,error)" +msgstr "Уровень журналирования (debug, info, warning, error)" #: ../main.c:66 msgid "Print version information" @@ -484,7 +485,7 @@ msgstr "Показать информацию о файле" #: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" -msgstr "" +msgstr "Редактор для synctex (передаётся далее программе synctex)" #: ../page-widget.c:526 msgid "Loading..." @@ -496,19 +497,19 @@ msgstr "Скопировать изображение" #: ../page-widget.c:846 msgid "Save image as" -msgstr "Созранить как" +msgstr "Сохранить изображение как" #: ../shortcuts.c:1076 msgid "This document does not contain any index" -msgstr "В документе нету индекса" +msgstr "В документе нет индекса" #: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" -msgstr "[No name]" +msgstr "[Без названия]" #: ../zathura.c:486 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" +msgstr "Не удалось прочитать файл со стандартного входа и записать его во временный файл." #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." @@ -516,4 +517,4 @@ msgstr "Тип файла не поддерживается. Установит #: ../zathura.c:545 msgid "Document does not contain any pages" -msgstr "Документ не содержит ни одной страницы" +msgstr "В документе нет страниц" diff --git a/po/ta_IN.po b/po/ta_IN.po index c0aa749..e130d3b 100644 --- a/po/ta_IN.po +++ b/po/ta_IN.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: mankand007 \n" "Language-Team: Tamil (India) (http://www.transifex.net/projects/p/zathura/" "language/ta_IN/)\n" diff --git a/po/tr.po b/po/tr.po index 81d20aa..18f3384 100644 --- a/po/tr.po +++ b/po/tr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: hsngrms \n" "Language-Team: Turkish (http://www.transifex.net/projects/p/zathura/language/" "tr/)\n" diff --git a/po/uk_UA.po b/po/uk_UA.po index bf63e17..04c8e2a 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-04 19:57+0100\n" -"PO-Revision-Date: 2013-11-01 13:12+0000\n" +"PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" "zathura/language/uk_UA/)\n" From f9ef7598a4690715dbab5764df4ffb0ef82179d2 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 14:57:48 +0100 Subject: [PATCH 051/129] Add syntex-dbus-service setting to en/disable D-Bus service for synctex --- config.c | 2 ++ main.c | 2 +- zathura.c | 8 ++++++-- zathurarc.5.rst | 9 ++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config.c b/config.c index 76ca03e..32a8326 100644 --- a/config.c +++ b/config.c @@ -205,6 +205,8 @@ config_load_default(zathura_t* zathura) girara_setting_add(gsession, "statusbar-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the statusbar"), NULL, NULL); bool_value = false; girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL); + bool_value = true; + girara_setting_add(gsession, "synctex-dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service for synctex forward synchronization support"), NULL, NULL); string_value = "primary"; girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL); diff --git a/main.c b/main.c index 2f0c52a..692f1d2 100644 --- a/main.c +++ b/main.c @@ -97,7 +97,7 @@ main(int argc, char* argv[]) if (synctex_fwd != NULL) { if (argc != 2) { - girara_error("Too many arguments or missing filename while running with --syntex-forward"); + girara_error("Too many arguments or missing filename while running with --synctex-forward"); return -1; } diff --git a/zathura.c b/zathura.c index d62ec2e..67b7a5d 100644 --- a/zathura.c +++ b/zathura.c @@ -805,8 +805,12 @@ document_open(zathura_t* zathura, const char* path, const char* password, position_set(zathura, file_info.position_x, file_info.position_y); } - /* Start D-Bus */ - zathura->synctex.dbus = zathura_synctex_dbus_new(zathura); + /* Start D-Bus service for synctex forward synchronization */ + bool synctex_dbus = true; + girara_setting_get(zathura->ui.session, "synctex-dbus-service", &synctex_dbus); + if (synctex_dbus == true) { + zathura->synctex.dbus = zathura_synctex_dbus_new(zathura); + } return true; diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 54e8edd..deb826f 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -752,7 +752,7 @@ zoom-center ^^^^^^^^^^^ En/Disables horizontally centered zooming -* Value type: Bool +* Value type: Boolean * Default value: False zoom-max @@ -787,6 +787,13 @@ middle mouse button, or the Shift-Insert key combination. * Value type: String * Default value: primary +syntex-dbus-service +^^^^^^^^^^^^^^^^^^^ +En/disables the D-Bus service required for synctex forward synchronization. + +* Value type: Boolean +* Default value: true + SEE ALSO ======== From 9be3600440a0bc627c9e4c226fe4e08ed727c8f0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 17:23:31 +0100 Subject: [PATCH 052/129] A typo Signed-off-by: Sebastian Ramacher --- zathurarc.5.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/zathurarc.5.rst b/zathurarc.5.rst index deb826f..8f2ff5d 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -708,21 +708,22 @@ Defines if scrolling by half or full pages stops at page boundaries. link-zoom ^^^^^^^^^ -En/Disables the hability of changing zoom when following links. +En/Disables the ability of changing zoom when following links. * Value type: Boolean * Default value: true link-hadjust ^^^^^^^^^^^^ -En/Disables aligning to the left internal link targets, for example from the index +En/Disables aligning to the left internal link targets, for example from the +index. * Value type: Boolean * Default value: true search-hadjust ^^^^^^^^^^^^^^ -En/Disables horizontally centered search results +En/Disables horizontally centered search results. * Value type: Boolean * Default value: true @@ -750,21 +751,21 @@ Use basename of the file in the statusbar. zoom-center ^^^^^^^^^^^ -En/Disables horizontally centered zooming +En/Disables horizontally centered zooming. * Value type: Boolean * Default value: False zoom-max ^^^^^^^^ -Defines the maximum percentage that the zoom level can be +Defines the maximum percentage that the zoom level can be. * Value type: Integer * Default value: 1000 zoom-min ^^^^^^^^ -Defines the minimum percentage that the zoom level can be +Defines the minimum percentage that the zoom level can be. * Value type: Integer * Default value: 10 @@ -789,7 +790,7 @@ middle mouse button, or the Shift-Insert key combination. syntex-dbus-service ^^^^^^^^^^^^^^^^^^^ -En/disables the D-Bus service required for synctex forward synchronization. +En/Disables the D-Bus service required for synctex forward synchronization. * Value type: Boolean * Default value: true From fcbc9cf8838898bdf91bd281e316b21943a0b5fd Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 21:54:23 +0100 Subject: [PATCH 053/129] Move the deprecated stuff to the end Signed-off-by: Sebastian Ramacher --- glib-compat.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/glib-compat.h b/glib-compat.h index c76ccca..3e98dae 100644 --- a/glib-compat.h +++ b/glib-compat.h @@ -5,19 +5,20 @@ #include -/* GStaticMutex is deprecated starting with glib 2.32 */ -#if !GLIB_CHECK_VERSION(2, 31, 0) -#define mutex GStaticMutex -#define mutex_init(m) g_static_mutex_init((m)) -#define mutex_lock(m) g_static_mutex_lock((m)) -#define mutex_unlock(m) g_static_mutex_unlock((m)) -#define mutex_free(m) g_static_mutex_free((m)) -#else +/* GStaticMutex is deprecated starting with glib 2.32 and got replaced with + * GMutex */ +#if GLIB_CHECK_VERSION(2, 32, 0) #define mutex GMutex #define mutex_init(m) g_mutex_init((m)) #define mutex_lock(m) g_mutex_lock((m)) #define mutex_unlock(m) g_mutex_unlock((m)) #define mutex_free(m) g_mutex_clear((m)) +#else +#define mutex GStaticMutex +#define mutex_init(m) g_static_mutex_init((m)) +#define mutex_lock(m) g_static_mutex_lock((m)) +#define mutex_unlock(m) g_static_mutex_unlock((m)) +#define mutex_free(m) g_static_mutex_free((m)) #endif #endif From 3a0fe29336959adfa30d96eeb3e222ab68ab0841 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 22:06:44 +0100 Subject: [PATCH 054/129] Remove unused execute_command Signed-off-by: Sebastian Ramacher --- utils.c | 83 ++------------------------------------------------------- 1 file changed, 2 insertions(+), 81 deletions(-) diff --git a/utils.c b/utils.c index cd40ec6..f2cdca9 100644 --- a/utils.c +++ b/utils.c @@ -9,9 +9,10 @@ #include #include #include +#include #include -#include #include +#include #include #include "links.h" @@ -22,10 +23,6 @@ #include "page.h" #include "plugin.h" -#include - -#define BLOCK_SIZE 64 - const char* file_get_extension(const char* path) { @@ -59,82 +56,6 @@ file_valid_extension(zathura_t* zathura, const char* path) return (plugin == NULL) ? false : true; } -bool -execute_command(char* const argv[], char** output) -{ - if (!output) { - return false; - } - - int p[2]; - if (pipe(p)) { - return -1; - } - - pid_t pid = fork(); - - if (pid == -1) { // failure - return false; - } else if (pid == 0) { // child - dup2(p[1], 1); - close(p[0]); - - if (execvp(argv[0], argv) == -1) { - return false; - } - } else { // parent - dup2(p[0], 0); - close(p[1]); - - /* read output */ - unsigned int bc = BLOCK_SIZE; - unsigned int i = 0; - char* buffer = malloc(sizeof(char) * bc); - *output = NULL; - - if (!buffer) { - close(p[0]); - return false; - } - - char c; - while (1 == read(p[0], &c, 1)) { - buffer[i++] = c; - - if (i == bc) { - bc += BLOCK_SIZE; - char* tmp = realloc(buffer, sizeof(char) * bc); - - if (!tmp) { - free(buffer); - close(p[0]); - return false; - } - - buffer = tmp; - } - } - - char* tmp = realloc(buffer, sizeof(char) * (bc + 1)); - if (!tmp) { - free(buffer); - close(p[0]); - return false; - } - - buffer = tmp; - buffer[i] = '\0'; - - *output = buffer; - - /* wait for child to terminate */ - waitpid(pid, NULL, 0); - close(p[0]); - } - - return true; -} - void document_index_build(GtkTreeModel* model, GtkTreeIter* parent, girara_tree_node_t* tree) From 6599b921a38b077ff3badd9aec4fdcf502e7bb85 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 22:21:50 +0100 Subject: [PATCH 055/129] Remove more unused functions Signed-off-by: Sebastian Ramacher --- utils.c | 26 -------------------------- utils.h | 28 ---------------------------- 2 files changed, 54 deletions(-) diff --git a/utils.c b/utils.c index f2cdca9..7623985 100644 --- a/utils.c +++ b/utils.c @@ -23,21 +23,6 @@ #include "page.h" #include "plugin.h" -const char* -file_get_extension(const char* path) -{ - if (path == NULL) { - return NULL; - } - - const char* res = strrchr(path, '.'); - if (res == NULL) { - return NULL; - } - - return res + 1; -} - bool file_valid_extension(zathura_t* zathura, const char* path) { @@ -87,17 +72,6 @@ document_index_build(GtkTreeModel* model, GtkTreeIter* parent, GIRARA_LIST_FOREACH_END(list, gchar*, iter, name); } -void -page_calculate_offset(zathura_t* zathura, zathura_page_t* page, page_offset_t* offset) -{ - g_return_if_fail(page != NULL); - g_return_if_fail(offset != NULL); - GtkWidget* widget = zathura_page_get_widget(zathura, page); - - g_return_if_fail(gtk_widget_translate_coordinates(widget, - zathura->ui.page_widget, 0, 0, &(offset->x), &(offset->y)) == true); -} - zathura_rectangle_t rotate_rectangle(zathura_rectangle_t rectangle, unsigned int degree, double height, double width) { diff --git a/utils.h b/utils.h index 20da943..c061384 100644 --- a/utils.h +++ b/utils.h @@ -17,14 +17,6 @@ typedef struct page_offset_s int y; } page_offset_t; -/** - * Returns the file extension of a path - * - * @param path Path to the file - * @return The file extension or NULL - */ -const char* file_get_extension(const char* path); - /** * This function checks if the file has a valid extension. A extension is * evaluated as valid if it matches a supported filetype. @@ -35,15 +27,6 @@ const char* file_get_extension(const char* path); */ bool file_valid_extension(zathura_t* zathura, const char* path); -/** - * Executes a system command and saves its output into output - * - * @param argv The command - * @param output Pointer where the output will be saved - * @return true if no error occured, otherwise false - */ -bool execute_command(char* const argv[], char** output); - /** * Generates the document index based upon the list retreived from the document * object. @@ -54,17 +37,6 @@ bool execute_command(char* const argv[], char** output); */ void document_index_build(GtkTreeModel* model, GtkTreeIter* parent, girara_tree_node_t* tree); -/** - * Calculates the offset of the page to the top of the viewing area as - * well as to the left side of it. The result has to be freed. - * - * @param zathura Zathura session - * @param page The Page - * @param offset Applied offset - * @return The calculated offset or NULL if an error occured - */ -void page_calculate_offset(zathura_t* zathura, zathura_page_t* page, page_offset_t* offset); - /** * Rotate a rectangle by 0, 90, 180 or 270 degree * From dcc2e9f73669d373ee391dc5322964a5dbe962e7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 22:29:30 +0100 Subject: [PATCH 056/129] Remove obsolete tests --- tests/test_utils.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/test_utils.c b/tests/test_utils.c index a36b3a9..541707e 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -4,21 +4,6 @@ #include "../utils.h" -START_TEST(test_file_get_extension_null) { - fail_unless(file_get_extension(NULL) == NULL, NULL); -} END_TEST - -START_TEST(test_file_get_extension_none) { - const char* path = "test"; - fail_unless(file_get_extension(path) == NULL, NULL); -} END_TEST - -START_TEST(test_file_get_extension_single) { - const char* path = "test.pdf"; - const char* extension = file_get_extension(path); - fail_unless(strcmp(extension, "pdf") == 0, NULL); -} END_TEST - START_TEST(test_file_valid_extension_null) { fail_unless(file_valid_extension(NULL, NULL) == false, NULL); fail_unless(file_valid_extension((void*) 0xDEAD, NULL) == false, NULL); @@ -62,13 +47,6 @@ Suite* suite_utils() TCase* tcase = NULL; Suite* suite = suite_create("Utils"); - /* file exists */ - tcase = tcase_create("file_get_extension"); - tcase_add_test(tcase, test_file_get_extension_null); - tcase_add_test(tcase, test_file_get_extension_none); - tcase_add_test(tcase, test_file_get_extension_single); - suite_add_tcase(suite, tcase); - /* file valid extension */ tcase = tcase_create("file_valid_extension"); tcase_add_test(tcase, test_file_valid_extension_null); From 250c575f444923ff11f3c68578aeab15ec4d5cf4 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 23:05:43 +0100 Subject: [PATCH 057/129] CS Signed-off-by: Sebastian Ramacher --- utils.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/utils.c b/utils.c index 7623985..c30e4ef 100644 --- a/utils.c +++ b/utils.c @@ -244,26 +244,26 @@ replace_substring(const char* string, const char* old, const char* new) GdkAtom* get_selection(zathura_t* zathura) { - g_return_val_if_fail(zathura != NULL, NULL); + g_return_val_if_fail(zathura != NULL, NULL); - char* value; - girara_setting_get(zathura->ui.session, "selection-clipboard", &value); + char* value; + girara_setting_get(zathura->ui.session, "selection-clipboard", &value); - GdkAtom* selection = g_malloc(sizeof(GdkAtom)); - - if (strcmp(value, "primary") == 0) { - *selection = GDK_SELECTION_PRIMARY; - } else if (strcmp(value, "clipboard") == 0) { - *selection = GDK_SELECTION_CLIPBOARD; - } else { - girara_error("Invalid value for the selection-clipboard setting"); - g_free(value); - g_free(selection); - - return NULL; - } + GdkAtom* selection = g_malloc(sizeof(GdkAtom)); + if (strcmp(value, "primary") == 0) { + *selection = GDK_SELECTION_PRIMARY; + } else if (strcmp(value, "clipboard") == 0) { + *selection = GDK_SELECTION_CLIPBOARD; + } else { + girara_error("Invalid value for the selection-clipboard setting"); g_free(value); + g_free(selection); - return selection; + return NULL; + } + + g_free(value); + + return selection; } From ecf090b9b10d507026c1f9ada827bdac3837ed96 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 23:40:37 +0100 Subject: [PATCH 058/129] Split guess_type methods into separate functions Also don't try to run file if we have libmagic available. Signed-off-by: Sebastian Ramacher --- document.c | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/document.c b/document.c index ffb0950..67cd26c 100644 --- a/document.c +++ b/document.c @@ -665,11 +665,9 @@ zathura_document_get_information(zathura_document_t* document, zathura_error_t* return result; } -static const gchar* -guess_type(const char* path) -{ - const gchar* content_type = NULL; #ifdef WITH_MAGIC +static const char* +guess_type_magic(const char* path) { const char* mime_type = NULL; /* creat magic cookie */ @@ -698,22 +696,30 @@ guess_type(const char* path) girara_debug("failed guessing filetype: %s", magic_error(magic)); goto cleanup; } + /* dup so we own the memory */ + mime_type = g_strdup(mime_type); girara_debug("magic detected filetype: %s", mime_type); - content_type = g_strdup(mime_type); cleanup: if (magic != NULL) { magic_close(magic); } - if (content_type != NULL) { - return content_type; - } - /* else fallback to g_content_type_guess method */ -#endif /*WITH_MAGIC*/ + return mime_type; +} +#else +static const char* +guess_type_magic(const char* UNUSED(path)) { + return NULL; +} +#endif + +static const char* +guess_type_glib(const char* path) +{ gboolean uncertain = FALSE; - content_type = g_content_type_guess(path, NULL, 0, &uncertain); + const char* content_type = g_content_type_guess(path, NULL, 0, &uncertain); if (content_type == NULL) { girara_debug("g_content_type failed\n"); } else { @@ -755,8 +761,26 @@ cleanup: } g_free((void*)content_type); - content_type = NULL; + return NULL; +} +static const char* +guess_type(const char* path) +{ + /* try libmagic first */ + const char* content_type = guess_type_magic(path); + if (content_type != NULL) { + return content_type; + } + /* else fallback to g_content_type_guess method */ + content_type = guess_type_glib(path); + if (content_type != NULL) { + return content_type; + } +#ifdef WITH_MAGIC + return NULL; +#else + /* and if libmagic is not available, try file as last resort */ girara_debug("falling back to file"); GString* command = g_string_new("file -b --mime-type "); @@ -784,6 +808,7 @@ cleanup: g_strdelimit(out, "\n\r", '\0'); return out; +#endif } zathura_plugin_t* From 5d2666daf5b51d7477df50bb13e10dd21e55258f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 6 Jan 2014 01:18:56 +0100 Subject: [PATCH 059/129] Move file based detection into separate function --- document.c | 68 +++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/document.c b/document.c index 67cd26c..f7e7f22 100644 --- a/document.c +++ b/document.c @@ -708,11 +708,47 @@ cleanup: return mime_type; } + +static const char* +guess_type_file(const char* UNUSED(path)) +{ + return NULL; +} #else static const char* guess_type_magic(const char* UNUSED(path)) { return NULL; } + +static const char* +guess_type_file(const char* path) +{ + GString* command = g_string_new("file -b --mime-type "); + char* tmp = g_shell_quote(path); + + g_string_append(command, tmp); + g_free(tmp); + + GError* error = NULL; + char* out = NULL; + int ret = 0; + g_spawn_command_line_sync(command->str, &out, NULL, &ret, &error); + g_string_free(command, TRUE); + if (error != NULL) { + girara_warning("failed to execute command: %s", error->message); + g_error_free(error); + g_free(out); + return NULL; + } + if (WEXITSTATUS(ret) != 0) { + girara_warning("file failed with error code: %d", WEXITSTATUS(ret)); + g_free(out); + return NULL; + } + + g_strdelimit(out, "\n\r", '\0'); + return out; +} #endif static const char* @@ -777,38 +813,8 @@ guess_type(const char* path) if (content_type != NULL) { return content_type; } -#ifdef WITH_MAGIC - return NULL; -#else /* and if libmagic is not available, try file as last resort */ - girara_debug("falling back to file"); - - GString* command = g_string_new("file -b --mime-type "); - char* tmp = g_shell_quote(path); - - g_string_append(command, tmp); - g_free(tmp); - - GError* error = NULL; - char* out = NULL; - int ret = 0; - g_spawn_command_line_sync(command->str, &out, NULL, &ret, &error); - g_string_free(command, TRUE); - if (error != NULL) { - girara_warning("failed to execute command: %s", error->message); - g_error_free(error); - g_free(out); - return NULL; - } - if (WEXITSTATUS(ret) != 0) { - girara_warning("file failed with error code: %d", WEXITSTATUS(ret)); - g_free(out); - return NULL; - } - - g_strdelimit(out, "\n\r", '\0'); - return out; -#endif + return guess_type_file(path); } zathura_plugin_t* From 7b9fd65ce6a28ccf51a13b2da0605b814e632073 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 6 Jan 2014 15:34:03 +0100 Subject: [PATCH 060/129] A const Signed-off-by: Sebastian Ramacher --- config.c | 2 +- config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 32a8326..6c12ae9 100644 --- a/config.c +++ b/config.c @@ -454,7 +454,7 @@ config_load_default(zathura_t* zathura) } void -config_load_file(zathura_t* zathura, char* path) +config_load_file(zathura_t* zathura, const char* path) { if (zathura == NULL || path == NULL) { return; diff --git a/config.h b/config.h index 4587468..1d107c6 100644 --- a/config.h +++ b/config.h @@ -21,6 +21,6 @@ void config_load_default(zathura_t* zathura); * @param zathura The zathura session * @param path Path to the configuration file */ -void config_load_file(zathura_t* zathura, char* path); +void config_load_file(zathura_t* zathura, const char* path); #endif // CONFIG_H From 4350053956dd9152e6008b9dbf7d9c7a66dc46f7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 6 Jan 2014 15:34:17 +0100 Subject: [PATCH 061/129] Some clean up Signed-off-by: Sebastian Ramacher --- config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index 6c12ae9..aea58d1 100644 --- a/config.c +++ b/config.c @@ -109,7 +109,6 @@ config_load_default(zathura_t* zathura) int int_value = 0; float float_value = 0; bool bool_value = false; - bool inc_search = true; char* string_value = NULL; girara_session_t* gsession = zathura->ui.session; @@ -193,8 +192,9 @@ config_load_default(zathura_t* zathura) girara_setting_add(gsession, "open-first-page", &bool_value, BOOLEAN, false, _("Always open on first page"), NULL, NULL); bool_value = false; girara_setting_add(gsession, "nohlsearch", &bool_value, BOOLEAN, false, _("Highlight search results"), cb_nohlsearch_changed, NULL); - inc_search = false; - girara_setting_add(gsession, "incremental-search", &inc_search, BOOLEAN, false, _("Enable incremental search"), cb_incsearch_changed, NULL); +#define INCREMENTAL_SEARCH false + bool_value = INCREMENTAL_SEARCH; + girara_setting_add(gsession, "incremental-search", &bool_value, BOOLEAN, false, _("Enable incremental search"), cb_incsearch_changed, NULL); bool_value = true; girara_setting_add(gsession, "abort-clear-search", &bool_value, BOOLEAN, false, _("Clear search results on abort"), NULL, NULL); bool_value = false; @@ -389,8 +389,8 @@ config_load_default(zathura_t* zathura) girara_inputbar_command_add(gsession, "hlsearch", NULL, cmd_hlsearch, NULL, _("Highlight current search results")); girara_inputbar_command_add(gsession, "version", NULL, cmd_version, NULL, _("Show version information")); - girara_special_command_add(gsession, '/', cmd_search, inc_search, FORWARD, NULL); - girara_special_command_add(gsession, '?', cmd_search, inc_search, BACKWARD, NULL); + girara_special_command_add(gsession, '/', cmd_search, INCREMENTAL_SEARCH, FORWARD, NULL); + girara_special_command_add(gsession, '?', cmd_search, INCREMENTAL_SEARCH, BACKWARD, NULL); /* add shortcut mappings */ girara_shortcut_mapping_add(gsession, "abort", sc_abort); From 68b665a49d9749c37d03394c02c385666f536753 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 6 Jan 2014 16:02:58 +0100 Subject: [PATCH 062/129] Move config file loading to config.c --- config.c | 26 ++++++++++++++++++++++---- config.h | 5 +---- print.c | 4 ++-- zathura.c | 21 +-------------------- 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/config.c b/config.c index aea58d1..e1faa6c 100644 --- a/config.c +++ b/config.c @@ -15,8 +15,12 @@ #include #include #include +#include #include +#define GLOBAL_RC "/etc/zathurarc" +#define ZATHURA_RC "zathurarc" + static void cb_jumplist_change(girara_session_t* session, const char* name, girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) @@ -454,11 +458,25 @@ config_load_default(zathura_t* zathura) } void -config_load_file(zathura_t* zathura, const char* path) +config_load_files(zathura_t* zathura) { - if (zathura == NULL || path == NULL) { - return; + /* load global configuration files */ + char* config_path = girara_get_xdg_path(XDG_CONFIG_DIRS); + girara_list_t* config_dirs = girara_split_path_array(config_path); + ssize_t size = girara_list_size(config_dirs) - 1; + for (; size >= 0; --size) { + const char* dir = girara_list_nth(config_dirs, size); + char* file = g_build_filename(dir, ZATHURA_RC, NULL); + girara_config_parse(zathura->ui.session, file); + g_free(file); } + girara_list_free(config_dirs); + g_free(config_path); - girara_config_parse(zathura->ui.session, path); + girara_config_parse(zathura->ui.session, GLOBAL_RC); + + /* load local configuration files */ + char* configuration_file = g_build_filename(zathura->config.config_dir, ZATHURA_RC, NULL); + girara_config_parse(zathura->ui.session, configuration_file); + g_free(configuration_file); } diff --git a/config.h b/config.h index 1d107c6..833cfd5 100644 --- a/config.h +++ b/config.h @@ -3,9 +3,6 @@ #ifndef CONFIG_H #define CONFIG_H -#define GLOBAL_RC "/etc/zathurarc" -#define ZATHURA_RC "zathurarc" - #include "zathura.h" /** @@ -21,6 +18,6 @@ void config_load_default(zathura_t* zathura); * @param zathura The zathura session * @param path Path to the configuration file */ -void config_load_file(zathura_t* zathura, const char* path); +void config_load_files(zathura_t* zathura); #endif // CONFIG_H diff --git a/print.c b/print.c index 454512e..d1d6e3d 100644 --- a/print.c +++ b/print.c @@ -168,8 +168,8 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* static void cb_print_request_page_setup(GtkPrintOperation* UNUSED(print_operation), - GtkPrintContext* UNUSED(context), gint page_number, GtkPageSetup* setup, - zathura_t* zathura) + GtkPrintContext* UNUSED(context), gint page_number, + GtkPageSetup* setup, zathura_t* zathura) { if (zathura == NULL || zathura->document == NULL) { return; diff --git a/zathura.c b/zathura.c index 67b7a5d..dcfca92 100644 --- a/zathura.c +++ b/zathura.c @@ -101,26 +101,7 @@ zathura_init(zathura_t* zathura) /* configuration */ config_load_default(zathura); - - /* load global configuration files */ - char* config_path = girara_get_xdg_path(XDG_CONFIG_DIRS); - girara_list_t* config_dirs = girara_split_path_array(config_path); - ssize_t size = girara_list_size(config_dirs) - 1; - for (; size >= 0; --size) { - const char* dir = girara_list_nth(config_dirs, size); - char* file = g_build_filename(dir, ZATHURA_RC, NULL); - config_load_file(zathura, file); - g_free(file); - } - girara_list_free(config_dirs); - g_free(config_path); - - config_load_file(zathura, GLOBAL_RC); - - /* load local configuration files */ - char* configuration_file = g_build_filename(zathura->config.config_dir, ZATHURA_RC, NULL); - config_load_file(zathura, configuration_file); - g_free(configuration_file); + config_load_files(zathura); /* UI */ if (girara_session_init(zathura->ui.session, "zathura") == false) { From 40fe7cdd9e9035425b01267e53db2b89c5e19a77 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 7 Jan 2014 03:43:38 +0100 Subject: [PATCH 063/129] Some typos Signed-off-by: Sebastian Ramacher --- document.c | 4 ++-- print.c | 2 +- shortcuts.c | 2 +- utils.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/document.c b/document.c index f7e7f22..4667619 100644 --- a/document.c +++ b/document.c @@ -35,7 +35,7 @@ /** Read a most GT_MAX_READ bytes before falling back to file. */ static const size_t GT_MAX_READ = 1 << 16; -static const gchar* guess_type(const char* path); +static const char* guess_type(const char* path); /** * Document @@ -86,7 +86,7 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* return NULL; } - const gchar* content_type = guess_type(path); + const char* content_type = guess_type(path); if (content_type == NULL) { girara_error("Could not determine file type."); return NULL; diff --git a/print.c b/print.c index d1d6e3d..3ac1fd8 100644 --- a/print.c +++ b/print.c @@ -60,7 +60,7 @@ print(zathura_t* zathura) zathura->print.settings = g_object_ref(gtk_print_operation_get_print_settings(print_operation)); zathura->print.page_setup = g_object_ref(gtk_print_operation_get_default_page_setup(print_operation)); } else if (result == GTK_PRINT_OPERATION_RESULT_ERROR) { - girara_error("Error occured while printing progress"); + girara_error("Error pccurred while printing progress"); } g_object_unref(print_operation); diff --git a/shortcuts.c b/shortcuts.c index 23ea84e..91770ba 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -1287,7 +1287,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* zathura_document_set_adjust_mode(zathura->document, ZATHURA_ADJUST_NONE); - /* retreive zoom step value */ + /* retrieve zoom step value */ int value = 1; girara_setting_get(zathura->ui.session, "zoom-step", &value); diff --git a/utils.c b/utils.c index c30e4ef..382f3c4 100644 --- a/utils.c +++ b/utils.c @@ -210,7 +210,7 @@ replace_substring(const char* string, const char* old, const char* new) size_t old_len = strlen(old); size_t new_len = strlen(new); - /* count occurences */ + /* count occurrences */ unsigned int count = 0; unsigned int i = 0; From 43aca4cb36df0d01b245ff4fffdeaa53093a7dfe Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Thu, 9 Jan 2014 21:39:16 +0100 Subject: [PATCH 064/129] Add missing zoom key bindings --- config.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.c b/config.c index 1d35618..ef15e54 100644 --- a/config.c +++ b/config.c @@ -282,6 +282,19 @@ config_load_default(zathura_t* zathura) girara_shortcut_add(gsession, 0, GDK_KEY_d, NULL, sc_toggle_page_mode, (mode), 0, NULL); \ \ girara_shortcut_add(gsession, 0, GDK_KEY_q, NULL, sc_quit, (mode), 0, NULL); \ +\ + girara_shortcut_add(gsession, 0, GDK_KEY_plus, NULL, sc_zoom, (mode), ZOOM_IN, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_KP_Add, NULL, sc_zoom, (mode), ZOOM_IN, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_minus, NULL, sc_zoom, (mode), ZOOM_OUT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_KP_Subtract,NULL, sc_zoom, (mode), ZOOM_OUT, NULL); \ + girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, (mode), ZOOM_SPECIFIC, NULL); \ + girara_shortcut_add(gsession, 0, 0, "zi", sc_zoom, (mode), ZOOM_IN, NULL); \ + girara_shortcut_add(gsession, 0, 0, "zI", sc_zoom, (mode), ZOOM_IN, NULL); \ + girara_shortcut_add(gsession, 0, 0, "zo", sc_zoom, (mode), ZOOM_OUT, NULL); \ + girara_shortcut_add(gsession, 0, 0, "zO", sc_zoom, (mode), ZOOM_OUT, NULL); \ + girara_shortcut_add(gsession, 0, 0, "z0", sc_zoom, (mode), ZOOM_ORIGINAL, NULL); \ + girara_shortcut_add(gsession, 0, 0, "zz", sc_zoom, (mode), ZOOM_SPECIFIC, NULL); \ + girara_shortcut_add(gsession, 0, 0, "zZ", sc_zoom, (mode), ZOOM_SPECIFIC, NULL); #define DEFAULT_MOUSE_EVENTS(mode) \ girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_SCROLL_UP, UP, NULL); \ From f41d372f7551cb673108d675513e80e4cc791f31 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 14:52:07 +0100 Subject: [PATCH 065/129] Add mapping for SELECT Signed-off-by: Sebastian Ramacher --- config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/config.c b/config.c index ca1012e..c11237b 100644 --- a/config.c +++ b/config.c @@ -451,6 +451,7 @@ config_load_default(zathura_t* zathura) girara_argument_mapping_add(gsession, "down", DOWN); girara_argument_mapping_add(gsession, "expand", EXPAND); girara_argument_mapping_add(gsession, "expand-all", EXPAND_ALL); + girara_argument_mapping_add(gsession, "select", SELECT); girara_argument_mapping_add(gsession, "forward", FORWARD); girara_argument_mapping_add(gsession, "full-down", FULL_DOWN); girara_argument_mapping_add(gsession, "full-up", FULL_UP); From f504da0dd1caa2af25e3f7a99e0da886856c7104 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 14:52:51 +0100 Subject: [PATCH 066/129] Implement TOGGLE for sc_navigate_index Closes: #396 Signed-off-by: Sebastian Ramacher --- config.c | 1 + shortcuts.c | 14 +++++++++++-- zathura.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 65 insertions(+), 10 deletions(-) diff --git a/config.c b/config.c index c11237b..d25a386 100644 --- a/config.c +++ b/config.c @@ -452,6 +452,7 @@ config_load_default(zathura_t* zathura) girara_argument_mapping_add(gsession, "expand", EXPAND); girara_argument_mapping_add(gsession, "expand-all", EXPAND_ALL); girara_argument_mapping_add(gsession, "select", SELECT); + girara_argument_mapping_add(gsession, "toggle", TOGGLE); girara_argument_mapping_add(gsession, "forward", FORWARD); girara_argument_mapping_add(gsession, "full-down", FULL_DOWN); girara_argument_mapping_add(gsession, "full-up", FULL_UP); diff --git a/shortcuts.c b/shortcuts.c index 23f0a59..103ac09 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -989,7 +989,7 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument, * moving anywhere. */ is_valid_path = gtk_tree_path_up(path) && (gtk_tree_path_get_depth(path) > 0); } else { /* row above */ - while(gtk_tree_view_row_expanded(tree_view, path)) { + while (gtk_tree_view_row_expanded(tree_view, path)) { gtk_tree_model_get_iter(model, &iter, path); /* select last child */ gtk_tree_model_iter_nth_child(model, &child_iter, &iter, @@ -1035,13 +1035,23 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument, path = gtk_tree_path_new_first(); gtk_tree_view_set_cursor(tree_view, path, NULL, FALSE); break; + case TOGGLE: + gtk_tree_model_get_iter(model, &iter, path); + if (gtk_tree_model_iter_has_child(model, &iter) == TRUE) { + if (gtk_tree_view_row_expanded(tree_view, path) == TRUE) { + gtk_tree_view_collapse_row(tree_view, path); + } else { + gtk_tree_view_expand_row(tree_view, path, FALSE); + } + break; + } case SELECT: cb_index_row_activated(tree_view, path, NULL, zathura); gtk_tree_path_free(path); return false; } - if (is_valid_path) { + if (is_valid_path == TRUE) { gtk_tree_view_set_cursor(tree_view, path, NULL, FALSE); } diff --git a/zathura.h b/zathura.h index 8436db1..57431f3 100644 --- a/zathura.h +++ b/zathura.h @@ -10,14 +10,58 @@ #include "macros.h" #include "types.h" -enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT, - DELETE_LAST_WORD, DELETE_LAST_CHAR, DEFAULT, ERROR, WARNING, NEXT_GROUP, - PREVIOUS_GROUP, ZOOM_IN, ZOOM_OUT, ZOOM_ORIGINAL, ZOOM_SPECIFIC, FORWARD, - BACKWARD, CONTINUOUS, DELETE_LAST, EXPAND, EXPAND_ALL, COLLAPSE_ALL, COLLAPSE, - SELECT, GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP, - FULL_DOWN, HALF_LEFT, HALF_RIGHT, FULL_LEFT, FULL_RIGHT, NEXT_CHAR, - PREVIOUS_CHAR, DELETE_TO_LINE_START, APPEND_FILEPATH, ROTATE_CW, ROTATE_CCW, - PAGE_BOTTOM, PAGE_TOP }; +enum { + NEXT, + PREVIOUS, + LEFT, + RIGHT, + UP, + DOWN, + BOTTOM, + TOP, + HIDE, + HIGHLIGHT, + DELETE_LAST_WORD, + DELETE_LAST_CHAR, + DEFAULT, + ERROR, + WARNING, + NEXT_GROUP, + PREVIOUS_GROUP, + ZOOM_IN, + ZOOM_OUT, + ZOOM_ORIGINAL, + ZOOM_SPECIFIC, + FORWARD, + BACKWARD, + CONTINUOUS, + DELETE_LAST, + EXPAND, + EXPAND_ALL, + COLLAPSE_ALL, + COLLAPSE, + TOGGLE, + SELECT, + GOTO_DEFAULT, + GOTO_LABELS, + GOTO_OFFSET, + HALF_UP, + HALF_DOWN, + FULL_UP, + FULL_DOWN, + HALF_LEFT, + HALF_RIGHT, + FULL_LEFT, + FULL_RIGHT, + NEXT_CHAR, + PREVIOUS_CHAR, + DELETE_TO_LINE_START, + APPEND_FILEPATH, + ROTATE_CW, + ROTATE_CCW, + PAGE_BOTTOM, + PAGE_TOP +}; /* unspecified page number */ enum { From 96914d635cacf4be01387c3c43f7a7bd818571f6 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 14:55:38 +0100 Subject: [PATCH 067/129] Document toggle and select Signed-off-by: Sebastian Ramacher --- zathurarc.5.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 8f2ff5d..75176eb 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -268,7 +268,9 @@ Possible arguments are: * right * rotate-ccw * rotate-cw +* select * specific +* toggle * top * up * width From 2c02dd97e6f084574026deb51e63d5521b2aed00 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 15:49:22 +0100 Subject: [PATCH 068/129] Use g_key_file_* to set/get doubles And use locale-independent functions everywhere else. Signed-off-by: Sebastian Ramacher --- database-plain.c | 79 +++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 45 deletions(-) diff --git a/database-plain.c b/database-plain.c index 0c5b938..2da9359 100644 --- a/database-plain.c +++ b/database-plain.c @@ -14,6 +14,7 @@ #include #include "database-plain.h" +#include "utils.h" #define BOOKMARKS "bookmarks" #define HISTORY "history" @@ -326,18 +327,17 @@ plain_add_bookmark(zathura_database_t* db, const char* file, } char* name = prepare_filename(file); - char* val_list[] = { g_strdup_printf("%d", bookmark->page), - g_ascii_dtostr(g_malloc(G_ASCII_DTOSTR_BUF_SIZE), G_ASCII_DTOSTR_BUF_SIZE, bookmark->x), - g_ascii_dtostr(g_malloc(G_ASCII_DTOSTR_BUF_SIZE), G_ASCII_DTOSTR_BUF_SIZE, bookmark->y) }; + char* val_list[] = { + g_strdup_printf("%d", bookmark->page), + g_ascii_dtostr(g_malloc(G_ASCII_DTOSTR_BUF_SIZE), G_ASCII_DTOSTR_BUF_SIZE, bookmark->x), + g_ascii_dtostr(g_malloc(G_ASCII_DTOSTR_BUF_SIZE), G_ASCII_DTOSTR_BUF_SIZE, bookmark->y) + }; - gsize num_vals = sizeof(val_list)/sizeof(char *); + g_key_file_set_string_list(priv->bookmarks, name, bookmark->id, (const char**)val_list, LENGTH(val_list)); - g_key_file_set_string_list(priv->bookmarks, name, bookmark->id, (const char**)val_list, num_vals); - - for (unsigned int i = 0; i < num_vals; ++i) { + for (unsigned int i = 0; i < LENGTH(val_list); ++i) { g_free(val_list[i]); } - g_free(name); zathura_db_write_key_file_to_file(priv->bookmark_path, priv->bookmarks); @@ -429,7 +429,7 @@ get_jumplist_from_str(const char* str) { g_return_val_if_fail(str != NULL, NULL); - if (*str == 0) { + if (*str == '\0') { return girara_list_new2(g_free); } @@ -442,9 +442,9 @@ get_jumplist_from_str(const char* str) jump->page = strtoul(token, NULL, 0); token = strtok(NULL, " "); - jump->x = strtod(token, NULL); + jump->x = g_ascii_strtod(token, NULL); token = strtok(NULL, " "); - jump->y = strtod(token, NULL); + jump->y = g_ascii_strtod(token, NULL); girara_list_append(result, jump); token = strtok(NULL, " "); } @@ -477,9 +477,13 @@ plain_save_jumplist(zathura_database_t* db, const char* file, girara_list_t* jum GString* str_val = g_string_new(NULL); GIRARA_LIST_FOREACH(jumplist, zathura_jump_t*, iter, jump) - g_string_append(str_val, g_strdup_printf("%d ", jump->page)); - g_string_append(str_val, g_strdup_printf("%.20f ", jump->x)); - g_string_append(str_val, g_strdup_printf("%.20f ", jump->y)); + char buffer[G_ASCII_DTOSTR_BUF_SIZE] = { '\0' }; + + g_string_append_printf(str_val, "%d ", jump->page); + g_string_append(str_val, g_ascii_dtostr(buffer, G_ASCII_DTOSTR_BUF_SIZE, jump->x)); + g_string_append_c(str_val, ' '); + g_string_append(str_val, g_ascii_dtostr(buffer, G_ASCII_DTOSTR_BUF_SIZE, jump->y)); + g_string_append_c(str_val, ' '); GIRARA_LIST_FOREACH_END(jumplist, zathura_jump_t*, iter, jump); zathura_plaindatabase_private_t* priv = ZATHURA_PLAINDATABASE_GET_PRIVATE(db); @@ -502,24 +506,14 @@ plain_set_fileinfo(zathura_database_t* db, const char* file, zathura_fileinfo_t* char* name = prepare_filename(file); - g_key_file_set_integer(priv->history, name, KEY_PAGE, file_info->current_page); - g_key_file_set_integer(priv->history, name, KEY_OFFSET, file_info->page_offset); - - char* tmp = g_strdup_printf("%.20f", file_info->scale); - g_key_file_set_string (priv->history, name, KEY_SCALE, tmp); - g_free(tmp); - + g_key_file_set_integer(priv->history, name, KEY_PAGE, file_info->current_page); + g_key_file_set_integer(priv->history, name, KEY_OFFSET, file_info->page_offset); + g_key_file_set_double (priv->history, name, KEY_SCALE, file_info->scale); g_key_file_set_integer(priv->history, name, KEY_ROTATE, file_info->rotation); g_key_file_set_integer(priv->history, name, KEY_PAGES_PER_ROW, file_info->pages_per_row); g_key_file_set_integer(priv->history, name, KEY_FIRST_PAGE_COLUMN, file_info->first_page_column); - - tmp = g_strdup_printf("%.20f", file_info->position_x); - g_key_file_set_string(priv->history, name, KEY_POSITION_X, tmp); - g_free(tmp); - - tmp = g_strdup_printf("%.20f", file_info->position_y); - g_key_file_set_string(priv->history, name, KEY_POSITION_Y, tmp); - g_free(tmp); + g_key_file_set_double (priv->history, name, KEY_POSITION_X, file_info->position_x); + g_key_file_set_double (priv->history, name, KEY_POSITION_Y, file_info->position_y); g_free(name); @@ -549,26 +543,21 @@ plain_get_fileinfo(zathura_database_t* db, const char* file, zathura_fileinfo_t* file_info->current_page = g_key_file_get_integer(priv->history, name, KEY_PAGE, NULL); file_info->page_offset = g_key_file_get_integer(priv->history, name, KEY_OFFSET, NULL); + file_info->scale = g_key_file_get_double (priv->history, name, KEY_SCALE, NULL); file_info->rotation = g_key_file_get_integer(priv->history, name, KEY_ROTATE, NULL); - file_info->pages_per_row = g_key_file_get_integer(priv->history, name, KEY_PAGES_PER_ROW, NULL); - file_info->first_page_column = g_key_file_get_integer(priv->history, name, KEY_FIRST_PAGE_COLUMN, NULL); - char* scale_string = g_key_file_get_string(priv->history, name, KEY_SCALE, NULL); - if (scale_string != NULL) { - file_info->scale = strtod(scale_string, NULL); - g_free(scale_string); + /* the following flags got introduced at a later point */ + if (g_key_file_has_key(priv->history, name, KEY_PAGES_PER_ROW, NULL) == TRUE) { + file_info->pages_per_row = g_key_file_get_integer(priv->history, name, KEY_PAGES_PER_ROW, NULL); } - - char* position_x_string = g_key_file_get_string(priv->history, name, KEY_POSITION_X, NULL); - if (position_x_string != NULL) { - file_info->position_x = strtod(position_x_string, NULL); - g_free(position_x_string); + if (g_key_file_has_key(priv->history, name, KEY_FIRST_PAGE_COLUMN, NULL) == TRUE) { + file_info->first_page_column = g_key_file_get_integer(priv->history, name, KEY_FIRST_PAGE_COLUMN, NULL); } - - char* position_y_string = g_key_file_get_string(priv->history, name, KEY_POSITION_Y, NULL); - if (position_y_string != NULL) { - file_info->position_y = strtod(position_y_string, NULL); - g_free(position_y_string); + if (g_key_file_has_key(priv->history, name, KEY_POSITION_X, NULL) == TRUE) { + file_info->position_x = g_key_file_get_double(priv->history, name, KEY_POSITION_X, NULL); + } + if (g_key_file_has_key(priv->history, name, KEY_POSITION_Y, NULL) == TRUE) { + file_info->position_y = g_key_file_get_double(priv->history, name, KEY_POSITION_Y, NULL); } g_free(name); From c575fe5f83d1b9dac5ce58879df740eab0fe5e53 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 16:07:03 +0100 Subject: [PATCH 069/129] Use strtok_r instead of strtok Signed-off-by: Sebastian Ramacher --- database-plain.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/database-plain.c b/database-plain.c index 2da9359..2f1801f 100644 --- a/database-plain.c +++ b/database-plain.c @@ -435,18 +435,25 @@ get_jumplist_from_str(const char* str) girara_list_t* result = girara_list_new2(g_free); char* copy = g_strdup(str); - char* token = strtok(copy, " "); + char* saveptr = NULL; + char* token = strtok_r(copy, " ", &saveptr); while (token != NULL) { zathura_jump_t* jump = g_malloc0(sizeof(zathura_jump_t)); jump->page = strtoul(token, NULL, 0); - token = strtok(NULL, " "); + token = strtok_r(NULL, " ", &saveptr); + if (token == NULL) { + girara_warning("Could not parse jumplist information."); + g_free(jump); + break; + } + jump->x = g_ascii_strtod(token, NULL); - token = strtok(NULL, " "); + token = strtok_r(NULL, " ", &saveptr); jump->y = g_ascii_strtod(token, NULL); girara_list_append(result, jump); - token = strtok(NULL, " "); + token = strtok_r(NULL, " ", &saveptr); } g_free(copy); From dbe5f7429a96d756c8060d36b555f4d00b2980b3 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 16:11:43 +0100 Subject: [PATCH 070/129] One more check Signed-off-by: Sebastian Ramacher --- database-plain.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/database-plain.c b/database-plain.c index 2f1801f..22fc507 100644 --- a/database-plain.c +++ b/database-plain.c @@ -448,10 +448,16 @@ get_jumplist_from_str(const char* str) g_free(jump); break; } - jump->x = g_ascii_strtod(token, NULL); + token = strtok_r(NULL, " ", &saveptr); + if (token == NULL) { + girara_warning("Could not parse jumplist information."); + g_free(jump); + break; + } jump->y = g_ascii_strtod(token, NULL); + girara_list_append(result, jump); token = strtok_r(NULL, " ", &saveptr); } From bacdc19d23910dfbdf6f9eba1e377168ff344b83 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 17:45:36 +0100 Subject: [PATCH 071/129] Implement G and gg for index mode Closes: #52 Signed-off-by: Sebastian Ramacher --- config.c | 3 +++ shortcuts.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/config.c b/config.c index d25a386..1e61b88 100644 --- a/config.c +++ b/config.c @@ -354,6 +354,9 @@ config_load_default(zathura_t* zathura) girara_shortcut_add(gsession, 0, GDK_KEY_Right, NULL, sc_navigate_index, INDEX, EXPAND, NULL); girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_navigate_index, INDEX, SELECT, NULL); girara_shortcut_add(gsession, 0, GDK_KEY_Return, NULL, sc_navigate_index, INDEX, SELECT, NULL); + girara_shortcut_add(gsession, 0, 0, "gg", sc_navigate_index, INDEX, TOP, NULL); + girara_shortcut_add(gsession, 0, 0, "G", sc_navigate_index, INDEX, BOTTOM, NULL); + /* Presentation mode */ girara_shortcut_add(gsession, 0, GDK_KEY_J, NULL, sc_navigate, PRESENTATION, NEXT, NULL); diff --git a/shortcuts.c b/shortcuts.c index 103ac09..96cd552 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -983,6 +983,19 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument, gboolean is_valid_path = TRUE; switch(argument->n) { + case TOP: + gtk_tree_path_free(path); + path = gtk_tree_path_new_first(); + break; + case BOTTOM: + gtk_tree_path_free(path); + path = gtk_tree_path_new_from_indices(gtk_tree_model_iter_n_children(model, NULL) - 1, -1); + gtk_tree_model_get_iter(model, &iter, path); + while (gtk_tree_model_iter_has_child(model, &iter) == TRUE && + gtk_tree_view_row_expanded(tree_view, path) == TRUE) { + gtk_tree_path_append_index(path, gtk_tree_model_iter_n_children(model, &iter) - 1); + } + break; case UP: if (gtk_tree_path_prev(path) == FALSE) { /* For some reason gtk_tree_path_up returns TRUE although we're not From 8d2e331b1ad8231f012b417d0c8667ae0d227ce8 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 10 Jan 2014 18:53:21 +0100 Subject: [PATCH 072/129] Fix up some types Signed-off-by: Sebastian Ramacher --- document.c | 1 - page.c | 3 ++- shortcuts.c | 20 +++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/document.c b/document.c index 4667619..0e52e7e 100644 --- a/document.c +++ b/document.c @@ -29,7 +29,6 @@ #include "render.h" #include "database.h" #include "page.h" -#include "page-widget.h" #include "plugin.h" /** Read a most GT_MAX_READ bytes before falling back to file. */ diff --git a/page.c b/page.c index d31af46..d8a876a 100644 --- a/page.c +++ b/page.c @@ -316,7 +316,8 @@ zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathu return functions->page_image_get_cairo(page, page->data, image, error); } -char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error) +char* +zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error) { if (page == NULL || page->document == NULL ) { if (error) { diff --git a/shortcuts.c b/shortcuts.c index 96cd552..7e76235 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -984,10 +984,12 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument, switch(argument->n) { case TOP: + /* go to the first node */ gtk_tree_path_free(path); path = gtk_tree_path_new_first(); break; case BOTTOM: + /* go to the last visiible node */ gtk_tree_path_free(path); path = gtk_tree_path_new_from_indices(gtk_tree_model_iter_n_children(model, NULL) - 1, -1); gtk_tree_model_get_iter(model, &iter, path); @@ -1343,9 +1345,9 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* int value = 1; girara_setting_get(zathura->ui.session, "zoom-step", &value); - int nt = (t == 0) ? 1 : t; - float zoom_step = value / 100.0f * nt; - float old_zoom = zathura_document_get_scale(zathura->document); + const int nt = (t == 0) ? 1 : t; + const double zoom_step = value / 100.0 * nt; + const double old_zoom = zathura_document_get_scale(zathura->document); /* specify new zoom value */ if (argument->n == ZOOM_IN) { @@ -1354,12 +1356,12 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* zathura_document_set_scale(zathura->document, old_zoom - zoom_step); } else if (argument->n == ZOOM_SPECIFIC) { if (t == 0) { - zathura_document_set_scale(zathura->document, 1.0f); + zathura_document_set_scale(zathura->document, 1.0); } else { - zathura_document_set_scale(zathura->document, t / 100.0f); + zathura_document_set_scale(zathura->document, t / 100.0); } } else { - zathura_document_set_scale(zathura->document, 1.0f); + zathura_document_set_scale(zathura->document, 1.0); } /* zoom limitations */ @@ -1368,10 +1370,10 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* girara_setting_get(session, "zoom-min", &zoom_min_int); girara_setting_get(session, "zoom-max", &zoom_max_int); - float zoom_min = zoom_min_int * 0.01f; - float zoom_max = zoom_max_int * 0.01f; + const double zoom_min = zoom_min_int * 0.01; + const double zoom_max = zoom_max_int * 0.01; - float scale = zathura_document_get_scale(zathura->document); + const double scale = zathura_document_get_scale(zathura->document); if (scale < zoom_min) { zathura_document_set_scale(zathura->document, zoom_min); } else if (scale > zoom_max) { From 7e2c0f2e1e89446d7820b4ab0fa349a8d1a06286 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 21:48:41 +0100 Subject: [PATCH 073/129] Generate introspection data from XML file Signed-off-by: Sebastian Ramacher --- .gitignore | 1 + Makefile | 31 ++++++++++++++++++++++++------- data/org.pwmt.zathura.synctex.xml | 10 ---------- data/org.pwmt.zathura.xml | 29 +++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 17 deletions(-) delete mode 100644 data/org.pwmt.zathura.synctex.xml create mode 100644 data/org.pwmt.zathura.xml diff --git a/.gitignore b/.gitignore index 851795d..4fdda19 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ doc/ zathura.1 zathurarc.5 .version-checks/ +dbus-interface-definitions.c diff --git a/Makefile b/Makefile index f73a7ed..8f76699 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include config.mk include common.mk PROJECT = zathura -OSOURCE = $(wildcard *.c) +OSOURCE = $(filter-out dbus-interface-definitions.c, $(wildcard *.c)) HEADER = $(wildcard *.h) HEADERINST = version.h document.h macros.h page.h types.h plugin-api.h links.h @@ -37,8 +37,8 @@ ifeq (,$(findstring -DLOCALEDIR,${CPPFLAGS})) CPPFLAGS += -DLOCALEDIR=\"${LOCALEDIR}\" endif -OBJECTS = $(patsubst %.c, %.o, $(SOURCE)) -DOBJECTS = $(patsubst %.c, %.do, $(SOURCE)) +OBJECTS = $(patsubst %.c, %.o, $(SOURCE)) dbus-interface-definitions.o +DOBJECTS = $(patsubst %.o, %.do, $(OBJECTS)) all: options ${PROJECT} po build-manpages @@ -64,7 +64,14 @@ version.h: version.h.in config.mk -e 's/ZVMINOR/${ZATHURA_VERSION_MINOR}/' \ -e 's/ZVREV/${ZATHURA_VERSION_REV}/' \ -e 's/ZVAPI/${ZATHURA_API_VERSION}/' \ - -e 's/ZVABI/${ZATHURA_ABI_VERSION}/' version.h.in > version.h + -e 's/ZVABI/${ZATHURA_ABI_VERSION}/' version.h.in > version.h.tmp + $(QUIET)mv version.h.tmp version.h + +dbus-interface-definitions.c: data/org.pwmt.zathura.xml + $(QUIET)echo "const char* DBUS_INTERFACE_XML =" > dbus-interface-definitions.c.tmp + $(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/org.pwmt.zathura.xml >> dbus-interface-definitions.c.tmp + $(QUIET)echo ";" >> dbus-interface-definitions.c.tmp + $(QUIET)mv dbus-interface-definitions.c.tmp dbus-interface-definitions.c %.o: %.c $(ECHO) CC $< @@ -84,8 +91,18 @@ ${PROJECT}: ${OBJECTS} $(QUIET)${CC} ${SFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS} clean: - $(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \ - ${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \ + $(QUIET)rm -rf ${PROJECT} \ + ${OBJECTS} \ + ${PROJECT}-${VERSION}.tar.gz \ + ${DOBJECTS} \ + ${PROJECT}-debug \ + .depend \ + ${PROJECT}.pc \ + doc \ + version.h \ + version.h.tmp \ + dbus-interface-definitions.c \ + dbus-interface-definitions.c.tmp \ *gcda *gcno $(PROJECT).info gcov *.tmp \ .version-checks ifneq "$(wildcard ${RSTTOMAN})" "" @@ -188,7 +205,7 @@ install-headers: ${PROJECT}.pc install-dbus: $(ECHO) installing D-Bus interface definitions $(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR) - $(QUIET)install -m 644 data/org.pwmt.zathura.synctex.xml $(DESTDIR)$(DBUSINTERFACEDIR) + $(QUIET)install -m 644 data/org.pwmt.zathura.xml $(DESTDIR)$(DBUSINTERFACEDIR) install-vimftplugin: $(ECHO) installing Vim filetype plugin diff --git a/data/org.pwmt.zathura.synctex.xml b/data/org.pwmt.zathura.synctex.xml deleted file mode 100644 index eb3538e..0000000 --- a/data/org.pwmt.zathura.synctex.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/data/org.pwmt.zathura.xml b/data/org.pwmt.zathura.xml new file mode 100644 index 0000000..600326f --- /dev/null +++ b/data/org.pwmt.zathura.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 26333fb20c304d1b4e5d6fbf81ad99542d4354f1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 22:03:36 +0100 Subject: [PATCH 074/129] Run D-Bus service all the time Signed-off-by: Sebastian Ramacher --- config.c | 2 +- zathura.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config.c b/config.c index 1e61b88..0e9b0b0 100644 --- a/config.c +++ b/config.c @@ -213,7 +213,7 @@ config_load_default(zathura_t* zathura) bool_value = false; girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL); bool_value = true; - girara_setting_add(gsession, "synctex-dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service for synctex forward synchronization support"), NULL, NULL); + girara_setting_add(gsession, "dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service"), NULL, NULL); string_value = "primary"; girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL); diff --git a/zathura.c b/zathura.c index dcfca92..c473786 100644 --- a/zathura.c +++ b/zathura.c @@ -229,6 +229,13 @@ zathura_init(zathura_t* zathura) zathura->jumplist.size = 0; zathura->jumplist.cur = NULL; + /* Start D-Bus service */ + bool synctex_dbus = true; + girara_setting_get(zathura->ui.session, "dbus-service", &synctex_dbus); + if (synctex_dbus == true) { + zathura->synctex.dbus = zathura_synctex_dbus_new(zathura); + } + return true; error_free: @@ -253,6 +260,12 @@ zathura_free(zathura_t* zathura) document_close(zathura, false); + /* stop D-Bus */ + if (zathura->synctex.dbus != NULL) { + g_object_unref(zathura->synctex.dbus); + zathura->synctex.dbus = NULL; + } + if (zathura->ui.session != NULL) { girara_session_destroy(zathura->ui.session); } @@ -786,13 +799,6 @@ document_open(zathura_t* zathura, const char* path, const char* password, position_set(zathura, file_info.position_x, file_info.position_y); } - /* Start D-Bus service for synctex forward synchronization */ - bool synctex_dbus = true; - girara_setting_get(zathura->ui.session, "synctex-dbus-service", &synctex_dbus); - if (synctex_dbus == true) { - zathura->synctex.dbus = zathura_synctex_dbus_new(zathura); - } - return true; error_free: @@ -875,12 +881,6 @@ document_close(zathura_t* zathura, bool keep_monitor) /* stop rendering */ zathura_renderer_stop(zathura->sync.render_thread); - /* stop D-Bus */ - if (zathura->synctex.dbus != NULL) { - g_object_unref(zathura->synctex.dbus); - zathura->synctex.dbus = NULL; - } - /* remove monitor */ if (keep_monitor == false) { if (zathura->file_monitor.monitor != NULL) { From d0b7676bc33d0305c2105d1b4e5ae6d6e5e30586 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 22:04:14 +0100 Subject: [PATCH 075/129] Just return a list of rectangles Signed-off-by: Sebastian Ramacher --- synctex.c | 80 +++++++++++++++++-------------------------------------- synctex.h | 2 +- zathura.c | 1 - 3 files changed, 26 insertions(+), 57 deletions(-) diff --git a/synctex.c b/synctex.c index 2bf5d90..e24a688 100644 --- a/synctex.c +++ b/synctex.c @@ -1,7 +1,6 @@ /* See LICENSE file for license and copyright information */ #include -#include #include "synctex.h" @@ -10,8 +9,6 @@ #include "document.h" #include "utils.h" -#include - enum { SYNCTEX_RESULT_BEGIN = 1, SYNCTEX_RESULT_END, @@ -50,9 +47,6 @@ static GScannerConfig scanner_config = { .numbers_2_int = TRUE, }; -static void synctex_record_hits(zathura_t* zathura, int page_idx, girara_list_t* hits, bool first); -static double scan_float(GScanner* scanner); - void synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) { @@ -85,23 +79,6 @@ synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) g_strfreev(argv); } -static void -synctex_record_hits(zathura_t* zathura, int page_idx, girara_list_t* hits, bool first) -{ - zathura_page_t* page = zathura_document_get_page(zathura->document, page_idx-1); - if (page == NULL) - return; - - GtkWidget* page_widget = zathura_page_get_widget(zathura, page); - g_object_set(page_widget, "draw-links", FALSE, NULL); - g_object_set(page_widget, "search-results", hits, NULL); - - if (first == true) { - page_set(zathura, zathura_page_get_index(page)); - g_object_set(page_widget, "search-current", 0, NULL); - } -} - static double scan_float(GScanner* scanner) { @@ -115,11 +92,11 @@ scan_float(GScanner* scanner) } } -bool -synctex_view(zathura_t* zathura, const char* position) +girara_list_t* +synctex_rectangles_from_position(const char* filename, const char* position, int* page) { - if (zathura->document == NULL) { - return false; + if (filename == NULL || position == NULL || page == NULL) { + return NULL; } char** argv = g_malloc0(sizeof(char*) * 6); @@ -128,7 +105,7 @@ synctex_view(zathura_t* zathura, const char* position) argv[2] = g_strdup("-i"); argv[3] = g_strdup(position); argv[4] = g_strdup("-o"); - argv[5] = g_strdup(zathura_document_get_path(zathura->document)); + argv[5] = g_strdup(filename); gint output; bool ret = g_spawn_async_with_pipes(NULL, argv, NULL, @@ -170,20 +147,9 @@ synctex_view(zathura_t* zathura, const char* position) } } - if (found_begin == true) { - unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); - for (unsigned int page_id = 0; page_id < number_of_pages; ++page_id) { - zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); - if (page == NULL) { - continue; - } - g_object_set(zathura_page_get_widget(zathura, page), "search-results", NULL, NULL); - } - } - - ret = false; - int page = -1, nextpage; - girara_list_t* hitlist = NULL; + *page = -1; + int current_page; + girara_list_t* hitlist = girara_list_new2(g_free);; zathura_rectangle_t* rectangle = NULL; while (found_end == false) { @@ -200,17 +166,18 @@ synctex_view(zathura_t* zathura, const char* position) case SYNCTEX_PROP_PAGE: if (g_scanner_get_next_token(scanner) == G_TOKEN_INT) { - nextpage = g_scanner_cur_value(scanner).v_int; - if (page != nextpage) { - if (hitlist) { - synctex_record_hits(zathura, page, hitlist, !ret); - ret = true; - } - hitlist = girara_list_new2((girara_free_function_t) g_free); - page = nextpage; + current_page = g_scanner_cur_value(scanner).v_int; + if (*page == -1) { + *page = current_page; } + + if (*page == current_page && rectangle != NULL) { + girara_list_append(hitlist, rectangle); + rectangle = NULL; + } + + g_free(rectangle); rectangle = g_malloc0(sizeof(zathura_rectangle_t)); - girara_list_append(hitlist, rectangle); } break; @@ -237,13 +204,16 @@ synctex_view(zathura_t* zathura, const char* position) } } - if (hitlist != NULL) { - synctex_record_hits(zathura, page, hitlist, !ret); - ret = true; + if (rectangle != NULL) { + if (current_page == *page) { + girara_list_append(hitlist, rectangle); + } else { + g_free(rectangle); + } } g_scanner_destroy(scanner); close(output); - return ret; + return hitlist; } diff --git a/synctex.h b/synctex.h index 85a6d07..1c3a276 100644 --- a/synctex.h +++ b/synctex.h @@ -6,6 +6,6 @@ #include "types.h" void synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y); -bool synctex_view(zathura_t* zathura, const char* position); +girara_list_t* synctex_rectangles_from_position(const char* filename, const char* position, int* page); #endif diff --git a/zathura.c b/zathura.c index c473786..0163382 100644 --- a/zathura.c +++ b/zathura.c @@ -220,7 +220,6 @@ zathura_init(zathura_t* zathura) (girara_free_function_t) zathura_bookmark_free); /* jumplist */ - int jumplist_size = 20; girara_setting_get(zathura->ui.session, "jumplist-size", &jumplist_size); From b6c018ca8790d119e15372f45dbf2825d84f10ad Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 22:04:49 +0100 Subject: [PATCH 076/129] Add more methods to D-Bus interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … and improve the rest. Signed-off-by: Sebastian Ramacher --- main.c | 2 +- synctex-dbus.c | 155 +++++++++++++++++++++++++++++++++++++------------ synctex-dbus.h | 12 +++- 3 files changed, 129 insertions(+), 40 deletions(-) diff --git a/main.c b/main.c index 692f1d2..b8e89f0 100644 --- a/main.c +++ b/main.c @@ -107,7 +107,7 @@ main(int argc, char* argv[]) return -1; } - if (synctex_forward_position(real_path, synctex_fwd) == true) { + if (zathura_dbus_synctex_position(real_path, synctex_fwd) == true) { free(real_path); return 0; } else { diff --git a/synctex-dbus.c b/synctex-dbus.c index d64b3af..845d50e 100644 --- a/synctex-dbus.c +++ b/synctex-dbus.c @@ -8,6 +8,7 @@ #include #include #include +#include #include G_DEFINE_TYPE(ZathuraSynctexDbus, zathura_synctex_dbus, G_TYPE_OBJECT) @@ -15,9 +16,9 @@ G_DEFINE_TYPE(ZathuraSynctexDbus, zathura_synctex_dbus, G_TYPE_OBJECT) /* template for bus name */ static const char DBUS_NAME_TEMPLATE[] = "org.pwmt.zathura.PID-%d"; /* object path */ -static const char DBUS_OBJPATH[] = "/org/pwmt/zathura/synctex"; +static const char DBUS_OBJPATH[] = "/org/pwmt/zathura"; /* interface name */ -static const char DBUS_INTERFACE[] = "org.pwmt.zathura.synctex"; +static const char DBUS_INTERFACE[] = "org.pwmt.zathura"; typedef struct private_s { zathura_t* zathura; @@ -31,17 +32,8 @@ typedef struct private_s { (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ private_t)) -/* Introspection data for the service we are exporting */ -static const char SYNCTEX_DBUS_INTROSPECTION[] = - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - ""; +/* in dbus-interface-definitions.c */ +extern const char* DBUS_INTERFACE_XML; static const GDBusInterfaceVTable interface_vtable; @@ -94,13 +86,12 @@ bus_acquired(GDBusConnection* connection, const gchar* name, void* data) girara_debug("Bus acquired at '%s'.", name); ZathuraSynctexDbus* dbus = data; - private_t* priv = GET_PRIVATE(dbus); + private_t* priv = GET_PRIVATE(dbus); GError* error = NULL; priv->registration_id = g_dbus_connection_register_object(connection, DBUS_OBJPATH, priv->introspection_data->interfaces[0], &interface_vtable, dbus, NULL, &error); - if (priv->registration_id == 0) { girara_warning("Failed to register object on D-Bus connection: %s", error->message); @@ -139,7 +130,7 @@ zathura_synctex_dbus_new(zathura_t* zathura) priv->zathura = zathura; GError* error = NULL; - priv->introspection_data = g_dbus_node_info_new_for_xml(SYNCTEX_DBUS_INTROSPECTION, &error); + priv->introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTERFACE_XML, &error); if (priv->introspection_data == NULL) { girara_warning("Failed to parse introspection data: %s", error->message); g_error_free(error); @@ -160,23 +151,89 @@ zathura_synctex_dbus_new(zathura_t* zathura) static void handle_method_call(GDBusConnection* UNUSED(connection), - const gchar* UNUSED(sender), const gchar* UNUSED(object_path), - const gchar* UNUSED(interface_name), + const gchar* UNUSED(sender), const gchar* object_path, + const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, void* data) { ZathuraSynctexDbus* synctex_dbus = data; private_t* priv = GET_PRIVATE(synctex_dbus); - if (g_strcmp0(method_name, "View") == 0) { - gchar* position = NULL; - g_variant_get(parameters, "(s)", &position); + girara_debug("Handling call '%s.%s' on '%s'.", interface_name, method_name, + object_path); - const bool ret = synctex_view(priv->zathura, position); - g_free(position); + /* methods that work without open document */ + if (g_strcmp0(method_name, "OpenDocument") == 0) { + gchar* filename = NULL; + gchar* password = NULL; + gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + g_variant_get(parameters, "(ssi)", &filename, &password, &page); - GVariant* result = g_variant_new("(b)", ret); + document_close(priv->zathura, false); + const bool ret = document_open(priv->zathura, filename, + strlen(password) > 0 ? password : NULL, page); + g_free(filename); + g_free(password); + + GVariant* result = g_variant_new("(b)", ret); + g_dbus_method_invocation_return_value(invocation, result); + return; + } else if (g_strcmp0(method_name, "CloseDocument") == 0) { + const bool ret = document_close(priv->zathura, false); + + GVariant* result = g_variant_new("(b)", ret); + g_dbus_method_invocation_return_value(invocation, result); + return; + } + + if (priv->zathura->document == NULL) { + g_dbus_method_invocation_return_dbus_error(invocation, + "org.pwmt.zathura.NoOpenDocumen", "No document has been opened."); + return; + } + + const unsigned int number_of_pages = zathura_document_get_number_of_pages(priv->zathura->document); + + /* methods that require an open document */ + if (g_strcmp0(method_name, "GotoPage") == 0) { + gint page = 0; + g_variant_get(parameters, "(i)", &page); + + bool ret = true; + if (page < 1 || (unsigned int)page >= number_of_pages) { + ret = false; + } else { + page_set(priv->zathura, page - 1); + } + + GVariant* result = g_variant_new("(b)", ret); + g_dbus_method_invocation_return_value(invocation, result); + } else if (g_strcmp0(method_name, "HighlightRects") == 0) { + gint page = 0; + GVariantIter* iter = NULL; + g_variant_get(parameters, "(ia(dddd))", &page, &iter); + + if (page < 1 || (unsigned int)page >= number_of_pages) { + GVariant* result = g_variant_new("(b)", false); g_dbus_method_invocation_return_value(invocation, result); + } + + /* get rectangles */ + girara_list_t* rectangles = girara_list_new2(g_free); + zathura_rectangle_t temp_rect; + while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, + &temp_rect.y1, &temp_rect.y2)) { + zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); + memcpy(rect, &temp_rect, sizeof(zathura_rectangle_t)); + girara_list_append(rectangles, rect); + } + g_variant_iter_free(iter); + + page_set(priv->zathura, page - 1); + + GObject* widget = G_OBJECT(priv->zathura->pages[page - 1]); + g_object_set(widget, "draw-links", FALSE, "search-results", rectangles, + "search-current", 0, NULL); } } @@ -184,13 +241,17 @@ static GVariant* handle_get_property(GDBusConnection* UNUSED(connection), const gchar* UNUSED(sender), const gchar* UNUSED(object_path), const gchar* UNUSED(interface_name), const gchar* property_name, - GError** UNUSED(error), void* data) + GError** error, void* data) { ZathuraSynctexDbus* synctex_dbus = data; private_t* priv = GET_PRIVATE(synctex_dbus); if (g_strcmp0(property_name, "filename") == 0) { - return g_variant_new_string(zathura_document_get_path(priv->zathura->document)); + if (priv->zathura->document == NULL) { + g_set_error(error, G_IO_ERROR, G_IO_ERROR_FAILED, "No document open."); + } else { + return g_variant_new_string(zathura_document_get_path(priv->zathura->document)); + } } return NULL; @@ -206,18 +267,15 @@ static const GDBusInterfaceVTable interface_vtable = static const unsigned int TIMEOUT = 3000; bool -synctex_forward_position(const char* filename, const char* position) +zathura_dbus_goto_page_and_highlight(const char* filename, int page, girara_list_t* rectangles) { - if (filename == NULL || position == NULL) { + if (filename == NULL) { return false; } GError* error = NULL; GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); - /* GDBusProxy* proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION, - G_DBUS_PROXY_FLAGS_NONE, NULL, "org.freedesktop.DBus", - "/org/freedesktop/DBus", "org.freedesktop.DBus", NULL, &error); */ if (connection == NULL) { girara_error("Could not create proxy for 'org.freedesktop.DBus': %s", error->message); @@ -232,7 +290,6 @@ synctex_forward_position(const char* filename, const char* position) if (vnames == NULL) { girara_error("Could not list available names: %s", error->message); g_error_free(error); - // g_object_unref(proxy); g_object_unref(connection); return false; } @@ -275,12 +332,21 @@ synctex_forward_position(const char* filename, const char* position) g_free(remote_filename); found_one = true; + GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE("a(dddd)")); + if (rectangles != NULL) { + GIRARA_LIST_FOREACH(rectangles, zathura_rectangle_t*, iter, rect) + g_variant_builder_add(builder, "(dddd)", rect->x1, rect->x2, rect->y1, + rect->y2); + GIRARA_LIST_FOREACH_END(rectangles, zathura_rectangle_t*, iter, rect); + } + GVariant* ret = g_dbus_connection_call_sync(connection, - name, DBUS_OBJPATH, DBUS_INTERFACE, "View", - g_variant_new("(s)", position), G_VARIANT_TYPE("(b)"), - G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); + name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", + g_variant_new("(ia(dddd))", page, builder), + G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); + g_variant_builder_unref(builder); if (ret == NULL) { - girara_error("Failed to run View on '%s': %s", name, error->message); + girara_error("Failed to run HighlightRects on '%s': %s", name, error->message); g_error_free(error); } else { g_variant_unref(ret); @@ -293,3 +359,20 @@ synctex_forward_position(const char* filename, const char* position) return found_one; } +bool +zathura_dbus_synctex_position(const char* filename, const char* position) +{ + if (filename == NULL || position == NULL) { + return false; + } + + int page = -1; + girara_list_t* rectangles = synctex_rectangles_from_position(filename, position, &page); + if (rectangles == NULL) { + return false; + } + + bool ret = zathura_dbus_goto_page_and_highlight(filename, page, rectangles); + girara_list_free(rectangles); + return ret; +} diff --git a/synctex-dbus.h b/synctex-dbus.h index f180a5d..d685e23 100644 --- a/synctex-dbus.h +++ b/synctex-dbus.h @@ -41,12 +41,18 @@ GType zathura_synctex_dbus_get_type(void); ZathuraSynctexDbus* zathura_synctex_dbus_new(zathura_t* zathura); /** - * Forward synctex position to zathura instance having the right file open. + * Look for zathura instance having filename open and cause it to open give page + * and move to the given position on that page. + * * @param filename filename - * @param position synctex position + * @param page page number + * @param position_x x coordinate on the page + * @param position_y y coordinate on the page * @returns true if a instance was found that has the given filename open, false * otherwise */ -bool synctex_forward_position(const char* filename, const char* position); +bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, girara_list_t* rectangles); + +bool zathura_dbus_synctex_position(const char* filename, const char* position); #endif From b6af22c52524981cbc517d0aad7d946587be18af Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 22:24:35 +0100 Subject: [PATCH 077/129] Draw 'search' result Signed-off-by: Sebastian Ramacher --- data/org.pwmt.zathura.xml | 2 +- synctex-dbus.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/data/org.pwmt.zathura.xml b/data/org.pwmt.zathura.xml index 600326f..bda9506 100644 --- a/data/org.pwmt.zathura.xml +++ b/data/org.pwmt.zathura.xml @@ -21,7 +21,7 @@ - + diff --git a/synctex-dbus.c b/synctex-dbus.c index 845d50e..7e2fd72 100644 --- a/synctex-dbus.c +++ b/synctex-dbus.c @@ -233,7 +233,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), GObject* widget = G_OBJECT(priv->zathura->pages[page - 1]); g_object_set(widget, "draw-links", FALSE, "search-results", rectangles, - "search-current", 0, NULL); + "search-current", 0, "draw-search-results", TRUE, NULL); } } @@ -267,8 +267,11 @@ static const GDBusInterfaceVTable interface_vtable = static const unsigned int TIMEOUT = 3000; bool -zathura_dbus_goto_page_and_highlight(const char* filename, int page, girara_list_t* rectangles) +zathura_dbus_goto_page_and_highlight(const char* filename, int page, + girara_list_t* rectangles) { + /* note: page is [1, number_of_pages] here */ + if (filename == NULL) { return false; } From c64b4f545afb5b7f7990d7a03e9e270afcd3d5eb Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 23:11:59 +0100 Subject: [PATCH 078/129] Just support latexsuite for now Signed-off-by: Sebastian Ramacher --- data/tex_zathurasynctex.vim | 43 ++++++------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/data/tex_zathurasynctex.vim b/data/tex_zathurasynctex.vim index 4ac8be9..96f3a25 100644 --- a/data/tex_zathurasynctex.vim +++ b/data/tex_zathurasynctex.vim @@ -1,50 +1,19 @@ " See LICENSE file for license and copyright information +" This is a sample plugin that can be used for synctex forward synchronization. +" It currently uses latexsuite to obtain the file name of the document. If you +" are not using latexsuite, it should be enough to adopt output accordingly. + " avoid re-execution -if exists("b:did_zathura_synctex_plugin") +if exists("b:did_zathura_synctex_plugin") || !exists("*Tex_GetMainFileName") finish endif let b:did_zathura_synctex_plugin = 1 -" set up global variables -if !exists("g:zathura_synctex_latex_suite") - let g:zathura_synctex_latex_suite = 1 -endif - function! Zathura_SyncTexForward() let source = expand("%:p") let input = shellescape(line(".").":".col(".").":".source) - let output = "" - if exists("*Tex_GetMainFileName") && g:zathura_synctex_latex_suite == 1 - " use Tex_GetMainFileName from latex-suite if it is available - let output = Tex_GetMainFileName(":p:r").".pdf" - else - " try to find synctex files and use them to determine the output file - let synctex_files = split(glob("%:p:h/*.synctex.gz"), "\n") - if len(synctex_files) == 0 - echo "No synctex file found" - return - endif - - let found = 0 - for synctex in synctex_files - let pdffile = substitute(synctex, "synctex.gz", "pdf", "") - let out = system("synctex view -i ".input." -o ".shellescape(pdffile)) - if match(out, "No tag for ".source) >= 0 - continue - endif - - let found = 1 - let output = pdffile - break - endfor - - if found == 0 - echo "No synctex file containing reference to source file found" - return - endif - endif - + let output = Tex_GetMainFileName(":p:r").".pdf" let execstr = "zathura --synctex-forward=".input." ".shellescape(output) silent call system(execstr) endfunction From 8b701f609c9504ee8f298383f5384453549f75ef Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 12 Jan 2014 22:23:29 +0100 Subject: [PATCH 079/129] Finish renaming Signed-off-by: Sebastian Ramacher --- data/tex_zathurasynctex.vim | 3 +- synctex-dbus.c => dbus-interface.c | 46 ++++++++++++------------ dbus-interface.h | 58 ++++++++++++++++++++++++++++++ main.c | 2 +- synctex-dbus.h | 58 ------------------------------ types.h | 4 +-- zathura.c | 16 ++++----- zathura.h | 2 +- 8 files changed, 95 insertions(+), 94 deletions(-) rename synctex-dbus.c => dbus-interface.c (90%) create mode 100644 dbus-interface.h delete mode 100644 synctex-dbus.h diff --git a/data/tex_zathurasynctex.vim b/data/tex_zathurasynctex.vim index 96f3a25..c7f4922 100644 --- a/data/tex_zathurasynctex.vim +++ b/data/tex_zathurasynctex.vim @@ -2,7 +2,8 @@ " This is a sample plugin that can be used for synctex forward synchronization. " It currently uses latexsuite to obtain the file name of the document. If you -" are not using latexsuite, it should be enough to adopt output accordingly. +" are not using latexsuite, it should be enough to adopt the calculation of +" 'output' accordingly. " avoid re-execution if exists("b:did_zathura_synctex_plugin") || !exists("*Tex_GetMainFileName") diff --git a/synctex-dbus.c b/dbus-interface.c similarity index 90% rename from synctex-dbus.c rename to dbus-interface.c index 7e2fd72..a746323 100644 --- a/synctex-dbus.c +++ b/dbus-interface.c @@ -1,6 +1,6 @@ /* See LICENSE file for license and copyright information */ -#include "synctex-dbus.h" +#include "dbus-interface.h" #include "synctex.h" #include "macros.h" #include "zathura.h" @@ -11,7 +11,7 @@ #include #include -G_DEFINE_TYPE(ZathuraSynctexDbus, zathura_synctex_dbus, G_TYPE_OBJECT) +G_DEFINE_TYPE(ZathuraDbus, zathura_dbus, G_TYPE_OBJECT) /* template for bus name */ static const char DBUS_NAME_TEMPLATE[] = "org.pwmt.zathura.PID-%d"; @@ -29,7 +29,7 @@ typedef struct private_s { } private_t; #define GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_DBUS, \ private_t)) /* in dbus-interface-definitions.c */ @@ -40,8 +40,8 @@ static const GDBusInterfaceVTable interface_vtable; static void finalize(GObject* object) { - ZathuraSynctexDbus* synctex_dbus = ZATHURA_SYNCTEX_DBUS(object); - private_t* priv = GET_PRIVATE(synctex_dbus); + ZathuraDbus* dbus = ZATHURA_DBUS(object); + private_t* priv = GET_PRIVATE(dbus); if (priv->connection != NULL && priv->registration_id > 0) { g_dbus_connection_unregister_object(priv->connection, priv->registration_id); @@ -55,11 +55,11 @@ finalize(GObject* object) g_dbus_node_info_unref(priv->introspection_data); } - G_OBJECT_CLASS(zathura_synctex_dbus_parent_class)->finalize(object); + G_OBJECT_CLASS(zathura_dbus_parent_class)->finalize(object); } static void -zathura_synctex_dbus_class_init(ZathuraSynctexDbusClass* class) +zathura_dbus_class_init(ZathuraDbusClass* class) { /* add private members */ g_type_class_add_private(class, sizeof(private_t)); @@ -70,9 +70,9 @@ zathura_synctex_dbus_class_init(ZathuraSynctexDbusClass* class) } static void -zathura_synctex_dbus_init(ZathuraSynctexDbus* synctex_dbus) +zathura_dbus_init(ZathuraDbus* dbus) { - private_t* priv = GET_PRIVATE(synctex_dbus); + private_t* priv = GET_PRIVATE(dbus); priv->zathura = NULL; priv->introspection_data = NULL; priv->connection = NULL; @@ -85,8 +85,8 @@ bus_acquired(GDBusConnection* connection, const gchar* name, void* data) { girara_debug("Bus acquired at '%s'.", name); - ZathuraSynctexDbus* dbus = data; - private_t* priv = GET_PRIVATE(dbus); + ZathuraDbus* dbus = data; + private_t* priv = GET_PRIVATE(dbus); GError* error = NULL; priv->registration_id = g_dbus_connection_register_object(connection, @@ -117,17 +117,17 @@ name_lost(GDBusConnection* UNUSED(connection), const gchar* name, name); } -ZathuraSynctexDbus* -zathura_synctex_dbus_new(zathura_t* zathura) +ZathuraDbus* +zathura_dbus_new(zathura_t* zathura) { - GObject* obj = g_object_new(ZATHURA_TYPE_SYNCTEX_DBUS, NULL); + GObject* obj = g_object_new(ZATHURA_TYPE_DBUS, NULL); if (obj == NULL) { return NULL; } - ZathuraSynctexDbus* synctex_dbus = ZATHURA_SYNCTEX_DBUS(obj); - private_t* priv = GET_PRIVATE(synctex_dbus); - priv->zathura = zathura; + ZathuraDbus* dbus = ZATHURA_DBUS(obj); + private_t* priv = GET_PRIVATE(dbus); + priv->zathura = zathura; GError* error = NULL; priv->introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTERFACE_XML, &error); @@ -141,10 +141,10 @@ zathura_synctex_dbus_new(zathura_t* zathura) char* well_known_name = g_strdup_printf(DBUS_NAME_TEMPLATE, getpid()); priv->owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, well_known_name, G_BUS_NAME_OWNER_FLAGS_NONE, bus_acquired, - name_acquired, name_lost, synctex_dbus, NULL); + name_acquired, name_lost, dbus, NULL); g_free(well_known_name); - return synctex_dbus; + return dbus; } /* D-Bus handler */ @@ -156,8 +156,8 @@ handle_method_call(GDBusConnection* UNUSED(connection), const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, void* data) { - ZathuraSynctexDbus* synctex_dbus = data; - private_t* priv = GET_PRIVATE(synctex_dbus); + ZathuraDbus* dbus = data; + private_t* priv = GET_PRIVATE(dbus); girara_debug("Handling call '%s.%s' on '%s'.", interface_name, method_name, object_path); @@ -243,8 +243,8 @@ handle_get_property(GDBusConnection* UNUSED(connection), const gchar* UNUSED(interface_name), const gchar* property_name, GError** error, void* data) { - ZathuraSynctexDbus* synctex_dbus = data; - private_t* priv = GET_PRIVATE(synctex_dbus); + ZathuraDbus* dbus = data; + private_t* priv = GET_PRIVATE(dbus); if (g_strcmp0(property_name, "filename") == 0) { if (priv->zathura->document == NULL) { diff --git a/dbus-interface.h b/dbus-interface.h new file mode 100644 index 0000000..be74496 --- /dev/null +++ b/dbus-interface.h @@ -0,0 +1,58 @@ +/* See LICENSE file for license and copyright information */ + +#ifndef DBUS_INTERFACE_H +#define DBUS_INTERFACE_H + +#include +#include +#include +#include "types.h" + +typedef struct zathura_dbus_class_s ZathuraDbusClass; + +struct zathura_dbus_s +{ + GObject parent; +}; + +struct zathura_dbus_class_s +{ + GObjectClass parent_class; +}; + +#define ZATHURA_TYPE_DBUS \ + (zathura_dbus_get_type()) +#define ZATHURA_DBUS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), ZATHURA_TYPE_DBUS, \ + ZathuraDbus)) +#define ZATHURA_DBUS_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_CAST((obj), ZATHURA_TYPE_DBUS, \ + ZathuraDbus)) +#define ZATHURA_IS_DBUS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZATHURA_TYPE_DBUS)) +#define ZATHURA_IS_DBUS_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((obj), ZATHURA_TYPE_DBUS)) +#define ZATHURA_DBUS_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), ZATHURA_TYPE_DBUS, \ + ZathuraDbusClass)) + +GType zathura_dbus_get_type(void); + +ZathuraDbus* zathura_dbus_new(zathura_t* zathura); + +/** + * Look for zathura instance having filename open and cause it to open give page + * and highlight rectangles on the given page + * + * @param filename filename + * @param page page number + * @param rectangles list of rectangles to highlight + * @returns true if a instance was found that has the given filename open, false + * otherwise + */ +bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, + girara_list_t* rectangles); + +bool zathura_dbus_synctex_position(const char* filename, const char* position); + +#endif diff --git a/main.c b/main.c index b8e89f0..57324dd 100644 --- a/main.c +++ b/main.c @@ -16,7 +16,7 @@ #include "zathura.h" #include "utils.h" -#include "synctex-dbus.h" +#include "dbus-interface.h" /* main function */ int diff --git a/synctex-dbus.h b/synctex-dbus.h deleted file mode 100644 index d685e23..0000000 --- a/synctex-dbus.h +++ /dev/null @@ -1,58 +0,0 @@ -/* See LICENSE file for license and copyright information */ - -#ifndef SYNCTEX_DBUS_H -#define SYNCTEX_DBUS_H - -#include -#include -#include -#include "types.h" - -typedef struct zathura_synctex_dbus_class_s ZathuraSynctexDbusClass; - -struct zathura_synctex_dbus_s -{ - GObject parent; -}; - -struct zathura_synctex_dbus_class_s -{ - GObjectClass parent_class; -}; - -#define ZATHURA_TYPE_SYNCTEX_DBUS \ - (zathura_synctex_dbus_get_type()) -#define ZATHURA_SYNCTEX_DBUS(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ - ZathuraSynctexDbus)) -#define ZATHURA_SYNCTEX_DBUS_CLASS(obj) \ - (G_TYPE_CHECK_CLASS_CAST((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ - ZathuraSynctexDbus)) -#define ZATHURA_IS_SYNCTEX_DBUS(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZATHURA_TYPE_SYNCTEX_DBUS)) -#define ZATHURA_IS_SYNCTEX_DBUS_CLASS(obj) \ - (G_TYPE_CHECK_CLASS_TYPE((obj), ZATHURA_TYPE_SYNCTEX_DBUS)) -#define ZATHURA_SYNCTEX_DBUS_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \ - ZathuraSynctexDbusClass)) - -GType zathura_synctex_dbus_get_type(void); - -ZathuraSynctexDbus* zathura_synctex_dbus_new(zathura_t* zathura); - -/** - * Look for zathura instance having filename open and cause it to open give page - * and move to the given position on that page. - * - * @param filename filename - * @param page page number - * @param position_x x coordinate on the page - * @param position_y y coordinate on the page - * @returns true if a instance was found that has the given filename open, false - * otherwise - */ -bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, girara_list_t* rectangles); - -bool zathura_dbus_synctex_position(const char* filename, const char* position); - -#endif diff --git a/types.h b/types.h index 71dce5d..380e4f7 100644 --- a/types.h +++ b/types.h @@ -36,9 +36,9 @@ typedef struct zathura_plugin_manager_s zathura_plugin_manager_t; typedef struct zathura_renderer_s ZathuraRenderer; /** - * Synctex DBus manager + * D-Bus manager */ -typedef struct zathura_synctex_dbus_s ZathuraSynctexDbus; +typedef struct zathura_dbus_s ZathuraDbus; /** * Error types diff --git a/zathura.c b/zathura.c index 0163382..54777bc 100644 --- a/zathura.c +++ b/zathura.c @@ -34,7 +34,7 @@ #include "page-widget.h" #include "plugin.h" #include "adjustment.h" -#include "synctex-dbus.h" +#include "dbus-interface.h" typedef struct zathura_document_info_s { zathura_t* zathura; @@ -229,10 +229,10 @@ zathura_init(zathura_t* zathura) zathura->jumplist.cur = NULL; /* Start D-Bus service */ - bool synctex_dbus = true; - girara_setting_get(zathura->ui.session, "dbus-service", &synctex_dbus); - if (synctex_dbus == true) { - zathura->synctex.dbus = zathura_synctex_dbus_new(zathura); + bool dbus = true; + girara_setting_get(zathura->ui.session, "dbus-service", &dbus); + if (dbus == true) { + zathura->dbus = zathura_dbus_new(zathura); } return true; @@ -260,9 +260,9 @@ zathura_free(zathura_t* zathura) document_close(zathura, false); /* stop D-Bus */ - if (zathura->synctex.dbus != NULL) { - g_object_unref(zathura->synctex.dbus); - zathura->synctex.dbus = NULL; + if (zathura->dbus != NULL) { + g_object_unref(zathura->dbus); + zathura->dbus = NULL; } if (zathura->ui.session != NULL) { diff --git a/zathura.h b/zathura.h index 57431f3..00f7852 100644 --- a/zathura.h +++ b/zathura.h @@ -133,7 +133,6 @@ struct zathura_s { bool enabled; gchar* editor; - ZathuraSynctexDbus* dbus; } synctex; struct @@ -185,6 +184,7 @@ struct zathura_s zathura_document_t* document; /**< The current document */ GtkWidget** pages; /**< The page widgets */ zathura_database_t* database; /**< The database */ + ZathuraDbus* dbus; /**< D-Bus service */ /** * File monitor From 7e6112d88399663104bd8faa828867c10794b4a0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 12 Jan 2014 23:29:33 +0100 Subject: [PATCH 080/129] Use the appropriate constant Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 6 +++--- synctex.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index a746323..986ebd5 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -196,7 +196,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), /* methods that require an open document */ if (g_strcmp0(method_name, "GotoPage") == 0) { - gint page = 0; + gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; g_variant_get(parameters, "(i)", &page); bool ret = true; @@ -209,7 +209,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), GVariant* result = g_variant_new("(b)", ret); g_dbus_method_invocation_return_value(invocation, result); } else if (g_strcmp0(method_name, "HighlightRects") == 0) { - gint page = 0; + gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; GVariantIter* iter = NULL; g_variant_get(parameters, "(ia(dddd))", &page, &iter); @@ -369,7 +369,7 @@ zathura_dbus_synctex_position(const char* filename, const char* position) return false; } - int page = -1; + int page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; girara_list_t* rectangles = synctex_rectangles_from_position(filename, position, &page); if (rectangles == NULL) { return false; diff --git a/synctex.c b/synctex.c index e24a688..7866bdd 100644 --- a/synctex.c +++ b/synctex.c @@ -147,7 +147,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, int } } - *page = -1; + *page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; int current_page; girara_list_t* hitlist = girara_list_new2(g_free);; zathura_rectangle_t* rectangle = NULL; @@ -167,7 +167,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, int case SYNCTEX_PROP_PAGE: if (g_scanner_get_next_token(scanner) == G_TOKEN_INT) { current_page = g_scanner_cur_value(scanner).v_int; - if (*page == -1) { + if (*page == ZATHURA_PAGE_NUMBER_UNSPECIFIED) { *page = current_page; } From 74fd28b4b232bed3fc2cd6cab53afa776cdfc010 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 14 Jan 2014 15:05:09 +0100 Subject: [PATCH 081/129] Send rectangles not on the main page too Signed-off-by: Sebastian Ramacher --- data/org.pwmt.zathura.xml | 1 + dbus-interface.c | 81 +++++++++++++++++++++++++++++++++------ dbus-interface.h | 6 ++- synctex.c | 42 +++++++++++++++----- synctex.h | 8 +++- 5 files changed, 114 insertions(+), 24 deletions(-) diff --git a/data/org.pwmt.zathura.xml b/data/org.pwmt.zathura.xml index bda9506..68beb85 100644 --- a/data/org.pwmt.zathura.xml +++ b/data/org.pwmt.zathura.xml @@ -22,6 +22,7 @@ + diff --git a/dbus-interface.c b/dbus-interface.c index 986ebd5..0ddfc9c 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -5,6 +5,8 @@ #include "macros.h" #include "zathura.h" #include "document.h" +#include "utils.h" + #include #include #include @@ -149,6 +151,28 @@ zathura_dbus_new(zathura_t* zathura) /* D-Bus handler */ +static void +highlight_rects(zathura_t* zathura, unsigned int page, + girara_list_t** rectangles) +{ + const unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); + + for (unsigned int p = 0; p != number_of_pages; ++p) { + GObject* widget = G_OBJECT(priv->zathura->pages[p]); + + g_object_set(widget, "draw-links", FALSE, "search-results", rectangles[p], + NULL); + if (p == page) { + g_object_set(widget, "search-current", 0, NULL); + } else { + g_object_set(widget, "search-current", -1, NULL); + } + } + + page_set(zathura, page); + document_draw_search_results(zathura, true); +} + static void handle_method_call(GDBusConnection* UNUSED(connection), const gchar* UNUSED(sender), const gchar* object_path, @@ -211,29 +235,52 @@ handle_method_call(GDBusConnection* UNUSED(connection), } else if (g_strcmp0(method_name, "HighlightRects") == 0) { gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; GVariantIter* iter = NULL; - g_variant_get(parameters, "(ia(dddd))", &page, &iter); + GVariantIter* secondary_iter = NULL; + g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter, + &secondary_iter); if (page < 1 || (unsigned int)page >= number_of_pages) { GVariant* result = g_variant_new("(b)", false); + g_variant_iter_free(iter); + g_variant_iter_free(secondary_iter); g_dbus_method_invocation_return_value(invocation, result); + return; } /* get rectangles */ - girara_list_t* rectangles = girara_list_new2(g_free); + girara_list_t** rectangles = g_malloc0(number_of_pages * sizeof(girara_list_t*)); + rectangles[page - 1] = girara_list_new2(g_free); + zathura_rectangle_t temp_rect; while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); memcpy(rect, &temp_rect, sizeof(zathura_rectangle_t)); - girara_list_append(rectangles, rect); + girara_list_append(rectangles[page - 1], rect); } g_variant_iter_free(iter); - page_set(priv->zathura, page - 1); + /* get secondary rectangles */ + int temp_page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + while (g_variant_iter_loop(secondary_iter, "(idddd)", &temp_page, + &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { + if (temp_page < 0 || (unsigned int)temp_page >= number_of_pages) { + /* error out here? */ + continue; + } - GObject* widget = G_OBJECT(priv->zathura->pages[page - 1]); - g_object_set(widget, "draw-links", FALSE, "search-results", rectangles, - "search-current", 0, "draw-search-results", TRUE, NULL); + if (rectangles[temp_page] == NULL) { + rectangles[temp_page] = girara_list_new2(g_free); + } + + zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); + memcpy(rect, &temp_rect, sizeof(zathura_rectangle_t)); + girara_list_append(rectangles[temp_page], rect); + } + g_variant_iter_free(secondary_iter); + + highlight_rects(priv->zathura, page - 1, rectangles); + g_free(rectangles); } } @@ -268,7 +315,7 @@ static const unsigned int TIMEOUT = 3000; bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, - girara_list_t* rectangles) + girara_list_t* rectangles, girara_list_t* secondary_rects) { /* note: page is [1, number_of_pages] here */ @@ -343,9 +390,17 @@ zathura_dbus_goto_page_and_highlight(const char* filename, int page, GIRARA_LIST_FOREACH_END(rectangles, zathura_rectangle_t*, iter, rect); } + GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(idddd)")); + if (secondary_rects != NULL) { + GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) + g_variant_builder_add(builder, "(idddd)", rect->page, rect->rect.x1, + rect->rect.x2, rect->rect.y1, rect->rect.y2); + GIRARA_LIST_FOREACH_END(secondary_rects, synctex_page_rect_t*, iter, rect); + } + GVariant* ret = g_dbus_connection_call_sync(connection, name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", - g_variant_new("(ia(dddd))", page, builder), + g_variant_new("(ia(dddd)a(idddd))", page, builder, second_builder), G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); g_variant_builder_unref(builder); if (ret == NULL) { @@ -370,12 +425,16 @@ zathura_dbus_synctex_position(const char* filename, const char* position) } int page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; - girara_list_t* rectangles = synctex_rectangles_from_position(filename, position, &page); + girara_list_t* secondary_rects = NULL; + girara_list_t* rectangles = synctex_rectangles_from_position(filename, + position, &page, &secondary_rects); if (rectangles == NULL) { return false; } - bool ret = zathura_dbus_goto_page_and_highlight(filename, page, rectangles); + const bool ret = zathura_dbus_goto_page_and_highlight(filename, page, + rectangles, secondary_rects); girara_list_free(rectangles); + girara_list_free(secondary_rects); return ret; } diff --git a/dbus-interface.h b/dbus-interface.h index be74496..af63714 100644 --- a/dbus-interface.h +++ b/dbus-interface.h @@ -47,11 +47,13 @@ ZathuraDbus* zathura_dbus_new(zathura_t* zathura); * @param filename filename * @param page page number * @param rectangles list of rectangles to highlight + * @param secondary_rects list of synctex_page_rect_ts for rectangles not on the + * page given by page * @returns true if a instance was found that has the given filename open, false - * otherwise + * otherwise */ bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, - girara_list_t* rectangles); + girara_list_t* rectangles, girara_list_t* secondary_rects); bool zathura_dbus_synctex_position(const char* filename, const char* position); diff --git a/synctex.c b/synctex.c index 7866bdd..cb8b52b 100644 --- a/synctex.c +++ b/synctex.c @@ -1,6 +1,7 @@ /* See LICENSE file for license and copyright information */ #include +#include #include "synctex.h" @@ -69,7 +70,8 @@ synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) argv[0] = g_strdup("synctex"); argv[1] = g_strdup("edit"); argv[2] = g_strdup("-o"); - argv[3] = g_strdup_printf("%d:%d:%d:%s", zathura_page_get_index(page) + 1, x, y, filename); + argv[3] = g_strdup_printf("%d:%d:%d:%s", zathura_page_get_index(page) + 1, x, + y, filename); if (zathura->synctex.editor != NULL) { argv[4] = g_strdup("-x"); argv[5] = g_strdup(zathura->synctex.editor); @@ -93,9 +95,10 @@ scan_float(GScanner* scanner) } girara_list_t* -synctex_rectangles_from_position(const char* filename, const char* position, int* page) +synctex_rectangles_from_position(const char* filename, const char* position, + int* page, girara_list_t** secondary_rects) { - if (filename == NULL || position == NULL || page == NULL) { + if (filename == NULL || position == NULL || page) { return NULL; } @@ -107,7 +110,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, int argv[4] = g_strdup("-o"); argv[5] = g_strdup(filename); - gint output; + gint output = -1; bool ret = g_spawn_async_with_pipes(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, &output, NULL, NULL); @@ -147,9 +150,10 @@ synctex_rectangles_from_position(const char* filename, const char* position, int } } - *page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; - int current_page; - girara_list_t* hitlist = girara_list_new2(g_free);; + int rpage = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + int current_page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + girara_list_t* hitlist = girara_list_new2(g_free); + girara_list_t* other_rects = girara_list_new2(g_free); zathura_rectangle_t* rectangle = NULL; while (found_end == false) { @@ -167,13 +171,18 @@ synctex_rectangles_from_position(const char* filename, const char* position, int case SYNCTEX_PROP_PAGE: if (g_scanner_get_next_token(scanner) == G_TOKEN_INT) { current_page = g_scanner_cur_value(scanner).v_int; - if (*page == ZATHURA_PAGE_NUMBER_UNSPECIFIED) { - *page = current_page; + if (rpage == ZATHURA_PAGE_NUMBER_UNSPECIFIED) { + rpage = current_page; } if (*page == current_page && rectangle != NULL) { girara_list_append(hitlist, rectangle); rectangle = NULL; + } else if (rectangle != NULL) { + synctex_page_rect_t* page_rect = g_malloc0(sizeof(synctex_page_rect_t)); + page_rect->page = current_page; + memcpy(&page_rect->rect, rectangle, sizeof(zathura_rectangle_t)); + girara_list_append(other_rects, page_rect); } g_free(rectangle); @@ -205,9 +214,13 @@ synctex_rectangles_from_position(const char* filename, const char* position, int } if (rectangle != NULL) { - if (current_page == *page) { + if (current_page == rpage) { girara_list_append(hitlist, rectangle); } else { + synctex_page_rect_t* page_rect = g_malloc0(sizeof(synctex_page_rect_t)); + page_rect->page = current_page; + memcpy(&page_rect->rect, rectangle, sizeof(zathura_rectangle_t)); + girara_list_append(other_rects, page_rect); g_free(rectangle); } } @@ -215,5 +228,14 @@ synctex_rectangles_from_position(const char* filename, const char* position, int g_scanner_destroy(scanner); close(output); + if (page != NULL) { + *page = rpage; + } + if (secondary_rects != NULL) { + *secondary_rects = other_rects; + } else { + girara_list_free(other_rects); + } + return hitlist; } diff --git a/synctex.h b/synctex.h index 1c3a276..6f88dec 100644 --- a/synctex.h +++ b/synctex.h @@ -5,7 +5,13 @@ #include "types.h" +typedef struct synctex_page_rect_s { + int page; + zathura_rectangle_t rect; +} synctex_page_rect_t; + void synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y); -girara_list_t* synctex_rectangles_from_position(const char* filename, const char* position, int* page); +girara_list_t* synctex_rectangles_from_position(const char* filename, + const char* position, int* page, girara_list_t** secondary_rects); #endif From 5021767a18e06ad7a154e0b002a738c6ff119159 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 14 Jan 2014 18:01:34 +0100 Subject: [PATCH 082/129] Split of guess_content_type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … and use it everywhere we want to get the content type of a file. Signed-off-by: Sebastian Ramacher --- content-type.c | 173 +++++++++++++++++++++++++++++++++++++++++++++++ content-type.h | 8 +++ dbus-interface.c | 6 +- document.c | 167 +-------------------------------------------- synctex.c | 6 +- utils.c | 4 +- zathura.c | 5 +- 7 files changed, 191 insertions(+), 178 deletions(-) create mode 100644 content-type.c create mode 100644 content-type.h diff --git a/content-type.c b/content-type.c new file mode 100644 index 0000000..35b7a90 --- /dev/null +++ b/content-type.c @@ -0,0 +1,173 @@ +/* See LICENSE file for license and copyright information */ + +#define _BSD_SOURCE +#define _XOPEN_SOURCE 700 + +#include "content-type.h" +#include "macros.h" + +#include +#ifdef WITH_MAGIC +#include +#else +#include +#include +#endif +#include +#include +#include + +/** Read a most GT_MAX_READ bytes before falling back to file. */ +static const size_t GT_MAX_READ = 1 << 16; + +#ifdef WITH_MAGIC +static const char* +guess_type_magic(const char* path) { + const char* mime_type = NULL; + + /* creat magic cookie */ + const int flags = + MAGIC_MIME_TYPE | + MAGIC_SYMLINK | + MAGIC_NO_CHECK_APPTYPE | + MAGIC_NO_CHECK_CDF | + MAGIC_NO_CHECK_ELF | + MAGIC_NO_CHECK_ENCODING; + magic_t magic = magic_open(flags); + if (magic == NULL) { + girara_debug("failed creating the magic cookie"); + goto cleanup; + } + + /* ... and load mime database */ + if (magic_load(magic, NULL) < 0) { + girara_debug("failed loading the magic database: %s", magic_error(magic)); + goto cleanup; + } + + /* get the mime type */ + mime_type = magic_file(magic, path); + if (mime_type == NULL) { + girara_debug("failed guessing filetype: %s", magic_error(magic)); + goto cleanup; + } + /* dup so we own the memory */ + mime_type = g_strdup(mime_type); + + girara_debug("magic detected filetype: %s", mime_type); + +cleanup: + if (magic != NULL) { + magic_close(magic); + } + + return mime_type; +} + +static const char* +guess_type_file(const char* UNUSED(path)) +{ + return NULL; +} +#else +static const char* +guess_type_magic(const char* UNUSED(path)) { + return NULL; +} + +static const char* +guess_type_file(const char* path) +{ + GString* command = g_string_new("file -b --mime-type "); + char* tmp = g_shell_quote(path); + + g_string_append(command, tmp); + g_free(tmp); + + GError* error = NULL; + char* out = NULL; + int ret = 0; + g_spawn_command_line_sync(command->str, &out, NULL, &ret, &error); + g_string_free(command, TRUE); + if (error != NULL) { + girara_warning("failed to execute command: %s", error->message); + g_error_free(error); + g_free(out); + return NULL; + } + if (WEXITSTATUS(ret) != 0) { + girara_warning("file failed with error code: %d", WEXITSTATUS(ret)); + g_free(out); + return NULL; + } + + g_strdelimit(out, "\n\r", '\0'); + return out; +} +#endif + +static const char* +guess_type_glib(const char* path) +{ + gboolean uncertain = FALSE; + const char* content_type = g_content_type_guess(path, NULL, 0, &uncertain); + if (content_type == NULL) { + girara_debug("g_content_type failed\n"); + } else { + if (uncertain == FALSE) { + girara_debug("g_content_type detected filetype: %s", content_type); + return content_type; + } + girara_debug("g_content_type is uncertain, guess: %s", content_type); + } + + FILE* f = fopen(path, "rb"); + if (f == NULL) { + return NULL; + } + + const int fd = fileno(f); + guchar* content = NULL; + size_t length = 0u; + ssize_t bytes_read = -1; + while (uncertain == TRUE && length < GT_MAX_READ && bytes_read != 0) { + g_free((void*)content_type); + content_type = NULL; + + content = g_realloc(content, length + BUFSIZ); + bytes_read = read(fd, content + length, BUFSIZ); + if (bytes_read == -1) { + break; + } + + length += bytes_read; + content_type = g_content_type_guess(NULL, content, length, &uncertain); + girara_debug("new guess: %s uncertain: %d, read: %zu", content_type, uncertain, length); + } + + fclose(f); + g_free(content); + if (uncertain == FALSE) { + return content_type; + } + + g_free((void*)content_type); + return NULL; +} + +const char* +guess_content_type(const char* path) +{ + /* try libmagic first */ + const char* content_type = guess_type_magic(path); + if (content_type != NULL) { + return content_type; + } + /* else fallback to g_content_type_guess method */ + content_type = guess_type_glib(path); + if (content_type != NULL) { + return content_type; + } + /* and if libmagic is not available, try file as last resort */ + return guess_type_file(path); +} diff --git a/content-type.h b/content-type.h new file mode 100644 index 0000000..cb6beb2 --- /dev/null +++ b/content-type.h @@ -0,0 +1,8 @@ +/* See LICENSE file for license and copyright information */ + +#ifndef ZATHURA_CONTENT_TYPE_H +#define ZATHURA_CONTENT_TYPE_H + +const char* guess_content_type(const char* path); + +#endif diff --git a/dbus-interface.c b/dbus-interface.c index 0ddfc9c..38745d5 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -158,7 +158,7 @@ highlight_rects(zathura_t* zathura, unsigned int page, const unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); for (unsigned int p = 0; p != number_of_pages; ++p) { - GObject* widget = G_OBJECT(priv->zathura->pages[p]); + GObject* widget = G_OBJECT(zathura->pages[p]); g_object_set(widget, "draw-links", FALSE, "search-results", rectangles[p], NULL); @@ -255,7 +255,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); - memcpy(rect, &temp_rect, sizeof(zathura_rectangle_t)); + *rect = temp_rect; girara_list_append(rectangles[page - 1], rect); } g_variant_iter_free(iter); @@ -274,7 +274,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), } zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); - memcpy(rect, &temp_rect, sizeof(zathura_rectangle_t)); + *rect = temp_rect; girara_list_append(rectangles[temp_page], rect); } g_variant_iter_free(secondary_iter); diff --git a/document.c b/document.c index 0e52e7e..c68aa37 100644 --- a/document.c +++ b/document.c @@ -3,18 +3,11 @@ #define _BSD_SOURCE #define _XOPEN_SOURCE 700 -#include #include #include #include #include -#include #include -#include -#ifdef WITH_MAGIC -#include -#endif -#include #include #include @@ -30,11 +23,7 @@ #include "database.h" #include "page.h" #include "plugin.h" - -/** Read a most GT_MAX_READ bytes before falling back to file. */ -static const size_t GT_MAX_READ = 1 << 16; - -static const char* guess_type(const char* path); +#include "content-type.h" /** * Document @@ -85,7 +74,7 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* return NULL; } - const char* content_type = guess_type(path); + const char* content_type = guess_content_type(path); if (content_type == NULL) { girara_error("Could not determine file type."); return NULL; @@ -664,158 +653,6 @@ zathura_document_get_information(zathura_document_t* document, zathura_error_t* return result; } -#ifdef WITH_MAGIC -static const char* -guess_type_magic(const char* path) { - const char* mime_type = NULL; - - /* creat magic cookie */ - const int flags = - MAGIC_MIME_TYPE | - MAGIC_SYMLINK | - MAGIC_NO_CHECK_APPTYPE | - MAGIC_NO_CHECK_CDF | - MAGIC_NO_CHECK_ELF | - MAGIC_NO_CHECK_ENCODING; - magic_t magic = magic_open(flags); - if (magic == NULL) { - girara_debug("failed creating the magic cookie"); - goto cleanup; - } - - /* ... and load mime database */ - if (magic_load(magic, NULL) < 0) { - girara_debug("failed loading the magic database: %s", magic_error(magic)); - goto cleanup; - } - - /* get the mime type */ - mime_type = magic_file(magic, path); - if (mime_type == NULL) { - girara_debug("failed guessing filetype: %s", magic_error(magic)); - goto cleanup; - } - /* dup so we own the memory */ - mime_type = g_strdup(mime_type); - - girara_debug("magic detected filetype: %s", mime_type); - -cleanup: - if (magic != NULL) { - magic_close(magic); - } - - return mime_type; -} - -static const char* -guess_type_file(const char* UNUSED(path)) -{ - return NULL; -} -#else -static const char* -guess_type_magic(const char* UNUSED(path)) { - return NULL; -} - -static const char* -guess_type_file(const char* path) -{ - GString* command = g_string_new("file -b --mime-type "); - char* tmp = g_shell_quote(path); - - g_string_append(command, tmp); - g_free(tmp); - - GError* error = NULL; - char* out = NULL; - int ret = 0; - g_spawn_command_line_sync(command->str, &out, NULL, &ret, &error); - g_string_free(command, TRUE); - if (error != NULL) { - girara_warning("failed to execute command: %s", error->message); - g_error_free(error); - g_free(out); - return NULL; - } - if (WEXITSTATUS(ret) != 0) { - girara_warning("file failed with error code: %d", WEXITSTATUS(ret)); - g_free(out); - return NULL; - } - - g_strdelimit(out, "\n\r", '\0'); - return out; -} -#endif - -static const char* -guess_type_glib(const char* path) -{ - gboolean uncertain = FALSE; - const char* content_type = g_content_type_guess(path, NULL, 0, &uncertain); - if (content_type == NULL) { - girara_debug("g_content_type failed\n"); - } else { - if (uncertain == FALSE) { - girara_debug("g_content_type detected filetype: %s", content_type); - return content_type; - } - girara_debug("g_content_type is uncertain, guess: %s", content_type); - } - - FILE* f = fopen(path, "rb"); - if (f == NULL) { - return NULL; - } - - const int fd = fileno(f); - guchar* content = NULL; - size_t length = 0u; - ssize_t bytes_read = -1; - while (uncertain == TRUE && length < GT_MAX_READ && bytes_read != 0) { - g_free((void*)content_type); - content_type = NULL; - - content = g_realloc(content, length + BUFSIZ); - bytes_read = read(fd, content + length, BUFSIZ); - if (bytes_read == -1) { - break; - } - - length += bytes_read; - content_type = g_content_type_guess(NULL, content, length, &uncertain); - girara_debug("new guess: %s uncertain: %d, read: %zu", content_type, uncertain, length); - } - - fclose(f); - g_free(content); - if (uncertain == FALSE) { - return content_type; - } - - g_free((void*)content_type); - return NULL; -} - -static const char* -guess_type(const char* path) -{ - /* try libmagic first */ - const char* content_type = guess_type_magic(path); - if (content_type != NULL) { - return content_type; - } - /* else fallback to g_content_type_guess method */ - content_type = guess_type_glib(path); - if (content_type != NULL) { - return content_type; - } - /* and if libmagic is not available, try file as last resort */ - return guess_type_file(path); -} - zathura_plugin_t* zathura_document_get_plugin(zathura_document_t* document) { diff --git a/synctex.c b/synctex.c index cb8b52b..d4a7cb9 100644 --- a/synctex.c +++ b/synctex.c @@ -1,10 +1,8 @@ /* See LICENSE file for license and copyright information */ #include -#include #include "synctex.h" - #include "zathura.h" #include "page.h" #include "document.h" @@ -181,7 +179,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, } else if (rectangle != NULL) { synctex_page_rect_t* page_rect = g_malloc0(sizeof(synctex_page_rect_t)); page_rect->page = current_page; - memcpy(&page_rect->rect, rectangle, sizeof(zathura_rectangle_t)); + page_rect->rect = *rectangle; girara_list_append(other_rects, page_rect); } @@ -219,7 +217,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, } else { synctex_page_rect_t* page_rect = g_malloc0(sizeof(synctex_page_rect_t)); page_rect->page = current_page; - memcpy(&page_rect->rect, rectangle, sizeof(zathura_rectangle_t)); + page_rect->rect = *rectangle; girara_list_append(other_rects, page_rect); g_free(rectangle); } diff --git a/utils.c b/utils.c index 382f3c4..c83c6b7 100644 --- a/utils.c +++ b/utils.c @@ -13,7 +13,6 @@ #include #include #include -#include #include "links.h" #include "utils.h" @@ -22,6 +21,7 @@ #include "document.h" #include "page.h" #include "plugin.h" +#include "content-type.h" bool file_valid_extension(zathura_t* zathura, const char* path) @@ -30,7 +30,7 @@ file_valid_extension(zathura_t* zathura, const char* path) return false; } - const gchar* content_type = g_content_type_guess(path, NULL, 0, NULL); + const gchar* content_type = guess_content_type(path); if (content_type == NULL) { return false; } diff --git a/zathura.c b/zathura.c index 54777bc..1f5f4fd 100644 --- a/zathura.c +++ b/zathura.c @@ -1074,7 +1074,7 @@ bool position_set(zathura_t* zathura, double position_x, double position_y) { if (zathura == NULL || zathura->document == NULL) { - goto error_out; + return false; } double comppos_x, comppos_y; @@ -1113,9 +1113,6 @@ position_set(zathura_t* zathura, double position_x, double position_y) refresh_view(zathura); return true; - -error_out: - return false; } From 2eeaef341c8c740371bc840473e79fad0710f253 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 14 Jan 2014 18:13:14 +0100 Subject: [PATCH 083/129] Remove unused includes Signed-off-by: Sebastian Ramacher --- document.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/document.c b/document.c index c68aa37..09f55a5 100644 --- a/document.c +++ b/document.c @@ -4,23 +4,17 @@ #define _XOPEN_SOURCE 700 #include -#include #include #include #include #include #include -#include -#include -#include #include "adjustment.h" #include "document.h" #include "utils.h" #include "zathura.h" -#include "render.h" -#include "database.h" #include "page.h" #include "plugin.h" #include "content-type.h" From 5a9f53b2b76f107d654bfd39427a241d22646b72 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 15 Jan 2014 17:55:54 +0100 Subject: [PATCH 084/129] Add a header for D-Bus interface definitions Signed-off-by: Sebastian Ramacher --- Makefile | 5 +++-- dbus-interface-definitions.h | 8 ++++++++ dbus-interface.c | 4 +--- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 dbus-interface-definitions.h diff --git a/Makefile b/Makefile index 8f76699..6193fae 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,10 @@ version.h: version.h.in config.mk $(QUIET)mv version.h.tmp version.h dbus-interface-definitions.c: data/org.pwmt.zathura.xml - $(QUIET)echo "const char* DBUS_INTERFACE_XML =" > dbus-interface-definitions.c.tmp + $(QUIET)echo '#include "dbus-interface-definitions.h"' > dbus-interface-definitions.c.tmp + $(QUIET)echo 'const char* DBUS_INTERFACE_XML =' >> dbus-interface-definitions.c.tmp $(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/org.pwmt.zathura.xml >> dbus-interface-definitions.c.tmp - $(QUIET)echo ";" >> dbus-interface-definitions.c.tmp + $(QUIET)echo ';' >> dbus-interface-definitions.c.tmp $(QUIET)mv dbus-interface-definitions.c.tmp dbus-interface-definitions.c %.o: %.c diff --git a/dbus-interface-definitions.h b/dbus-interface-definitions.h new file mode 100644 index 0000000..9ebef64 --- /dev/null +++ b/dbus-interface-definitions.h @@ -0,0 +1,8 @@ +/* See LICENSE file for license and copyright information */ + +#ifndef ZATHURA_DBUS_INTERFACE_DEFINITIONS +#define ZATHURA_DBUS_INTERFACE_DEFINITIONS + +const char* DBUS_INTERFACE_XML; + +#endif diff --git a/dbus-interface.c b/dbus-interface.c index 38745d5..3c39ae4 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -6,6 +6,7 @@ #include "zathura.h" #include "document.h" #include "utils.h" +#include "dbus-interface-definitions.h" #include #include @@ -34,9 +35,6 @@ typedef struct private_s { (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_DBUS, \ private_t)) -/* in dbus-interface-definitions.c */ -extern const char* DBUS_INTERFACE_XML; - static const GDBusInterfaceVTable interface_vtable; static void From e5b951451a2fde4226f5998bc12a06797f585886 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 15 Jan 2014 17:56:09 +0100 Subject: [PATCH 085/129] Uninstall D-Bus interface definitions Signed-off-by: Sebastian Ramacher --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6193fae..180a596 100644 --- a/Makefile +++ b/Makefile @@ -208,11 +208,6 @@ install-dbus: $(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR) $(QUIET)install -m 644 data/org.pwmt.zathura.xml $(DESTDIR)$(DBUSINTERFACEDIR) -install-vimftplugin: - $(ECHO) installing Vim filetype plugin - $(QUIET)mkdir -m 755 -p $(DESTDIR)$(VIMFTPLUGINDIR) - $(QUIET)install -m 644 data/tex_zathurasynctex.vim $(DESTDIR)$(VIMFTPLUGINDIR) - install: all install-headers install-manpages install-dbus $(ECHO) installing executable file $(QUIET)mkdir -m 755 -p ${DESTDIR}${PREFIX}/bin @@ -236,9 +231,12 @@ uninstall: uninstall-headers $(QUIET)rm -f ${DESTDIR}${MANPREFIX}/man5/${PROJECT}rc.5 $(ECHO) removing desktop file $(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop + $(ECHO) removing D-Bus interface definitions + $(QUIET)rm -f $(DESTDIR)$(DBUSINTERFACEDIR)/org.pwmt.zathura.xml $(MAKE) -C po uninstall -include $(wildcard .depend/*.dep) -.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall test \ - po install-headers uninstall-headers update-po install-manpages build-manpages +.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall \ + test po install-headers uninstall-headers update-po install-manpages \ + build-manpages install-dbus From 8200dd08845b0aadc8eca30bf7e064f711e01559 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 15 Jan 2014 18:50:06 +0100 Subject: [PATCH 086/129] Get rid of ZATHURA_GTK_VERSION Signed-off-by: Sebastian Ramacher --- Makefile | 14 +++++++------- config.mk | 17 +++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 180a596..9f3c0ba 100644 --- a/Makefile +++ b/Makefile @@ -9,17 +9,17 @@ HEADER = $(wildcard *.h) HEADERINST = version.h document.h macros.h page.h types.h plugin-api.h links.h ifneq (${WITH_SQLITE},0) -INCS += $(SQLITE_INC) -LIBS += $(SQLITE_LIB) -SOURCE = $(OSOURCE) +INCS += $(SQLITE_INC) +LIBS += $(SQLITE_LIB) +SOURCE = $(OSOURCE) CPPFLAGS += -DWITH_SQLITE else -SOURCE = $(filter-out database-sqlite.c,$(OSOURCE)) +SOURCE = $(filter-out database-sqlite.c,$(OSOURCE)) endif ifneq ($(WITH_MAGIC),0) -INCS += $(MAGIC_INC) -LIBS += $(MAGIC_LIB) +INCS += $(MAGIC_INC) +LIBS += $(MAGIC_LIB) CPPFLAGS += -DWITH_MAGIC endif @@ -125,7 +125,7 @@ ${PROJECT}.pc: ${PROJECT}.pc.in config.mk $(QUIET)echo abiversion=${ZATHURA_ABI_VERSION} >> ${PROJECT}.pc $(QUIET)echo includedir=${INCLUDEDIR} >> ${PROJECT}.pc $(QUIET)echo plugindir=${PLUGINDIR} >> ${PROJECT}.pc - $(QUIET)echo GTK_VERSION=${ZATHURA_GTK_VERSION} >> ${PROJECT}.pc + $(QUIET)echo GTK_VERSION=3 >> ${PROJECT}.pc $(QUIET)cat ${PROJECT}.pc.in >> ${PROJECT}.pc valgrind: debug diff --git a/config.mk b/config.mk index c57531f..f954c41 100644 --- a/config.mk +++ b/config.mk @@ -10,24 +10,21 @@ ZATHURA_API_VERSION = 2 ZATHURA_ABI_VERSION = 2 VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_REV} -# the GTK+ version to use -ZATHURA_GTK_VERSION ?= 3 - # version checks # If you want to disable any of the checks, set *_VERSION_CHECK to 0. # girara GIRARA_VERSION_CHECK ?= 1 GIRARA_MIN_VERSION = 0.1.8 -GIRARA_PKG_CONFIG_NAME = girara-gtk$(ZATHURA_GTK_VERSION) +GIRARA_PKG_CONFIG_NAME = girara-gtk3 # glib GLIB_VERSION_CHECK ?= 1 GLIB_MIN_VERSION = 2.28 GLIB_PKG_CONFIG_NAME = glib-2.0 # GTK GTK_VERSION_CHECK ?= 1 -GTK_MIN_VERSION = 2.18 -GTK_PKG_CONFIG_NAME = gtk+-$(ZATHURA_GTK_VERSION).0 +GTK_MIN_VERSION = 3.0 +GTK_PKG_CONFIG_NAME = gtk+-3.0 # database # To disable support for the sqlite backend set WITH_SQLITE to 0. @@ -55,8 +52,8 @@ LOCALEDIR ?= ${PREFIX}/share/locale RSTTOMAN ?= /usr/bin/rst2man # libs -GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0) -GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0) +GTK_INC ?= $(shell pkg-config --cflags gtk+-3.0) +GTK_LIB ?= $(shell pkg-config --libs gtk+-3.0) GTHREAD_INC ?= $(shell pkg-config --cflags gthread-2.0) GTHREAD_LIB ?= $(shell pkg-config --libs gthread-2.0) @@ -67,8 +64,8 @@ GMODULE_LIB ?= $(shell pkg-config --libs gmodule-no-export-2.0) GLIB_INC ?= $(shell pkg-config --cflags glib-2.0) GLIB_LIB ?= $(shell pkg-config --libs glib-2.0) -GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk${ZATHURA_GTK_VERSION}) -GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk${ZATHURA_GTK_VERSION}) +GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk3) +GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk3) ifneq (${WITH_SQLITE},0) SQLITE_INC ?= $(shell pkg-config --cflags sqlite3) From 51267cdae0caa2eaf8b3594b3fd909d4926c241c Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 15 Jan 2014 20:38:42 +0100 Subject: [PATCH 087/129] Jump to the first rectangle --- dbus-interface.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/dbus-interface.c b/dbus-interface.c index 3c39ae4..54493f2 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -1,12 +1,13 @@ /* See LICENSE file for license and copyright information */ #include "dbus-interface.h" +#include "dbus-interface-definitions.h" #include "synctex.h" #include "macros.h" #include "zathura.h" #include "document.h" #include "utils.h" -#include "dbus-interface-definitions.h" +#include "adjustment.h" #include #include @@ -169,6 +170,34 @@ highlight_rects(zathura_t* zathura, unsigned int page, page_set(zathura, page); document_draw_search_results(zathura, true); + + if (rectangles[0] == NULL || girara_list_size(rectangles[0]) == 0) { + return; + } + + /* compute the position of the center of the page */ + double pos_x = 0; + double pos_y = 0; + page_number_to_position(zathura->document, page, 0.5, 0.5, &pos_x, &pos_y); + + /* correction to center the current result */ + /* NOTE: rectangle is in viewport units, already scaled and rotated */ + unsigned int cell_height = 0; + unsigned int cell_width = 0; + zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); + + unsigned int doc_height = 0; + unsigned int doc_width = 0; + zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); + + zathura_rectangle_t* rectangle = girara_list_nth(rectangles[0], 0); + pos_y += (rectangle->y1 - (double)cell_height/2) / (double)doc_height; + pos_x += (rectangle->x1 - (double)cell_width/2) / (double)doc_width; + + /* move to position */ + zathura_jumplist_add(zathura); + position_set(zathura, pos_x, pos_y); + zathura_jumplist_add(zathura); } static void From 0e733af2a5a08c00417fde5355f5e4d44e55142e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 15 Jan 2014 20:59:18 +0100 Subject: [PATCH 088/129] Fix some bugs in the D-Bus and synctex code Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 14 +++++++------- synctex.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index 54493f2..81c6dc1 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -163,15 +163,13 @@ highlight_rects(zathura_t* zathura, unsigned int page, NULL); if (p == page) { g_object_set(widget, "search-current", 0, NULL); - } else { - g_object_set(widget, "search-current", -1, NULL); } } - page_set(zathura, page); document_draw_search_results(zathura, true); if (rectangles[0] == NULL || girara_list_size(rectangles[0]) == 0) { + page_set(zathura, page); return; } @@ -308,6 +306,9 @@ handle_method_call(GDBusConnection* UNUSED(connection), highlight_rects(priv->zathura, page - 1, rectangles); g_free(rectangles); + + GVariant* result = g_variant_new("(b)", true); + g_dbus_method_invocation_return_value(invocation, result); } } @@ -354,8 +355,7 @@ zathura_dbus_goto_page_and_highlight(const char* filename, int page, GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); if (connection == NULL) { - girara_error("Could not create proxy for 'org.freedesktop.DBus': %s", - error->message); + girara_error("Could not connect to session bus: %s", error->message); g_error_free(error); return false; } @@ -420,8 +420,8 @@ zathura_dbus_goto_page_and_highlight(const char* filename, int page, GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(idddd)")); if (secondary_rects != NULL) { GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) - g_variant_builder_add(builder, "(idddd)", rect->page, rect->rect.x1, - rect->rect.x2, rect->rect.y1, rect->rect.y2); + g_variant_builder_add(second_builder, "(idddd)", rect->page, + rect->rect.x1, rect->rect.x2, rect->rect.y1, rect->rect.y2); GIRARA_LIST_FOREACH_END(secondary_rects, synctex_page_rect_t*, iter, rect); } diff --git a/synctex.c b/synctex.c index d4a7cb9..a48ce3b 100644 --- a/synctex.c +++ b/synctex.c @@ -96,7 +96,7 @@ girara_list_t* synctex_rectangles_from_position(const char* filename, const char* position, int* page, girara_list_t** secondary_rects) { - if (filename == NULL || position == NULL || page) { + if (filename == NULL || position == NULL || page == NULL) { return NULL; } From 2778868599ffc0c346e3a291a3033bc873e232b5 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 17 Jan 2014 12:52:05 +0100 Subject: [PATCH 089/129] fix page range check In those cases, page is in the range [1...N], both ends included. Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index 81c6dc1..7e63561 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -249,7 +249,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), g_variant_get(parameters, "(i)", &page); bool ret = true; - if (page < 1 || (unsigned int)page >= number_of_pages) { + if (page < 1 || (unsigned int)page > number_of_pages) { ret = false; } else { page_set(priv->zathura, page - 1); @@ -264,7 +264,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter, &secondary_iter); - if (page < 1 || (unsigned int)page >= number_of_pages) { + if (page < 1 || (unsigned int)page > number_of_pages) { GVariant* result = g_variant_new("(b)", false); g_variant_iter_free(iter); g_variant_iter_free(secondary_iter); From bfb3acc1b160d42f45db03fcbd4e52eca3d89fe6 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 17 Jan 2014 16:21:44 +0100 Subject: [PATCH 090/129] Fix the page number once while parsing the synctex output Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 12 ++++++------ synctex.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index 7e63561..5ff0a05 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -249,10 +249,10 @@ handle_method_call(GDBusConnection* UNUSED(connection), g_variant_get(parameters, "(i)", &page); bool ret = true; - if (page < 1 || (unsigned int)page > number_of_pages) { + if (page < 0 || (unsigned int)page >= number_of_pages) { ret = false; } else { - page_set(priv->zathura, page - 1); + page_set(priv->zathura, page); } GVariant* result = g_variant_new("(b)", ret); @@ -264,7 +264,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter, &secondary_iter); - if (page < 1 || (unsigned int)page > number_of_pages) { + if (page < 0 || (unsigned int)page >= number_of_pages) { GVariant* result = g_variant_new("(b)", false); g_variant_iter_free(iter); g_variant_iter_free(secondary_iter); @@ -274,14 +274,14 @@ handle_method_call(GDBusConnection* UNUSED(connection), /* get rectangles */ girara_list_t** rectangles = g_malloc0(number_of_pages * sizeof(girara_list_t*)); - rectangles[page - 1] = girara_list_new2(g_free); + rectangles[page] = girara_list_new2(g_free); zathura_rectangle_t temp_rect; while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); *rect = temp_rect; - girara_list_append(rectangles[page - 1], rect); + girara_list_append(rectangles[page], rect); } g_variant_iter_free(iter); @@ -304,7 +304,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), } g_variant_iter_free(secondary_iter); - highlight_rects(priv->zathura, page - 1, rectangles); + highlight_rects(priv->zathura, page, rectangles); g_free(rectangles); GVariant* result = g_variant_new("(b)", true); diff --git a/synctex.c b/synctex.c index a48ce3b..a4218e0 100644 --- a/synctex.c +++ b/synctex.c @@ -168,7 +168,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, case SYNCTEX_PROP_PAGE: if (g_scanner_get_next_token(scanner) == G_TOKEN_INT) { - current_page = g_scanner_cur_value(scanner).v_int; + current_page = g_scanner_cur_value(scanner).v_int - 1; if (rpage == ZATHURA_PAGE_NUMBER_UNSPECIFIED) { rpage = current_page; } From 5a992d2d460c0abb6dfd23cf475521ca4ad1b696 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 17 Jan 2014 16:31:01 +0100 Subject: [PATCH 091/129] Make page an integer where possible Signed-off-by: Sebastian Ramacher --- data/org.pwmt.zathura.xml | 6 +++--- dbus-interface.c | 26 +++++++++++++------------- dbus-interface.h | 4 ++-- synctex.c | 11 +++++++---- synctex.h | 2 +- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/data/org.pwmt.zathura.xml b/data/org.pwmt.zathura.xml index 68beb85..f8c6a7a 100644 --- a/data/org.pwmt.zathura.xml +++ b/data/org.pwmt.zathura.xml @@ -15,14 +15,14 @@ - + - + - + diff --git a/dbus-interface.c b/dbus-interface.c index 5ff0a05..1d0c13f 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -245,11 +245,11 @@ handle_method_call(GDBusConnection* UNUSED(connection), /* methods that require an open document */ if (g_strcmp0(method_name, "GotoPage") == 0) { - gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; - g_variant_get(parameters, "(i)", &page); + guint page = 0; + g_variant_get(parameters, "(u)", &page); bool ret = true; - if (page < 0 || (unsigned int)page >= number_of_pages) { + if (page >= number_of_pages) { ret = false; } else { page_set(priv->zathura, page); @@ -258,13 +258,13 @@ handle_method_call(GDBusConnection* UNUSED(connection), GVariant* result = g_variant_new("(b)", ret); g_dbus_method_invocation_return_value(invocation, result); } else if (g_strcmp0(method_name, "HighlightRects") == 0) { - gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + guint page = 0; GVariantIter* iter = NULL; GVariantIter* secondary_iter = NULL; - g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter, + g_variant_get(parameters, "(ua(dddd)a(udddd))", &page, &iter, &secondary_iter); - if (page < 0 || (unsigned int)page >= number_of_pages) { + if (page >= number_of_pages) { GVariant* result = g_variant_new("(b)", false); g_variant_iter_free(iter); g_variant_iter_free(secondary_iter); @@ -286,10 +286,10 @@ handle_method_call(GDBusConnection* UNUSED(connection), g_variant_iter_free(iter); /* get secondary rectangles */ - int temp_page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; - while (g_variant_iter_loop(secondary_iter, "(idddd)", &temp_page, + guint temp_page = 0; + while (g_variant_iter_loop(secondary_iter, "(udddd)", &temp_page, &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { - if (temp_page < 0 || (unsigned int)temp_page >= number_of_pages) { + if (temp_page >= number_of_pages) { /* error out here? */ continue; } @@ -342,7 +342,7 @@ static const GDBusInterfaceVTable interface_vtable = static const unsigned int TIMEOUT = 3000; bool -zathura_dbus_goto_page_and_highlight(const char* filename, int page, +zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, girara_list_t* rectangles, girara_list_t* secondary_rects) { /* note: page is [1, number_of_pages] here */ @@ -420,14 +420,14 @@ zathura_dbus_goto_page_and_highlight(const char* filename, int page, GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(idddd)")); if (secondary_rects != NULL) { GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) - g_variant_builder_add(second_builder, "(idddd)", rect->page, + g_variant_builder_add(second_builder, "(udddd)", rect->page, rect->rect.x1, rect->rect.x2, rect->rect.y1, rect->rect.y2); GIRARA_LIST_FOREACH_END(secondary_rects, synctex_page_rect_t*, iter, rect); } GVariant* ret = g_dbus_connection_call_sync(connection, name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", - g_variant_new("(ia(dddd)a(idddd))", page, builder, second_builder), + g_variant_new("(ua(dddd)a(idddd))", page, builder, second_builder), G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); g_variant_builder_unref(builder); if (ret == NULL) { @@ -451,7 +451,7 @@ zathura_dbus_synctex_position(const char* filename, const char* position) return false; } - int page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + unsigned int page = 0; girara_list_t* secondary_rects = NULL; girara_list_t* rectangles = synctex_rectangles_from_position(filename, position, &page, &secondary_rects); diff --git a/dbus-interface.h b/dbus-interface.h index af63714..6f9b0cd 100644 --- a/dbus-interface.h +++ b/dbus-interface.h @@ -52,8 +52,8 @@ ZathuraDbus* zathura_dbus_new(zathura_t* zathura); * @returns true if a instance was found that has the given filename open, false * otherwise */ -bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, - girara_list_t* rectangles, girara_list_t* secondary_rects); +bool zathura_dbus_goto_page_and_highlight(const char* filename, + unsigned int page,girara_list_t* rectangles, girara_list_t* secondary_rects); bool zathura_dbus_synctex_position(const char* filename, const char* position); diff --git a/synctex.c b/synctex.c index a4218e0..1d5b004 100644 --- a/synctex.c +++ b/synctex.c @@ -94,7 +94,8 @@ scan_float(GScanner* scanner) girara_list_t* synctex_rectangles_from_position(const char* filename, const char* position, - int* page, girara_list_t** secondary_rects) + unsigned int* page, + girara_list_t** secondary_rects) { if (filename == NULL || position == NULL || page == NULL) { return NULL; @@ -148,8 +149,9 @@ synctex_rectangles_from_position(const char* filename, const char* position, } } - int rpage = ZATHURA_PAGE_NUMBER_UNSPECIFIED; - int current_page = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + ret = false; + unsigned int rpage = 0; + unsigned int current_page = 0; girara_list_t* hitlist = girara_list_new2(g_free); girara_list_t* other_rects = girara_list_new2(g_free); zathura_rectangle_t* rectangle = NULL; @@ -169,7 +171,8 @@ synctex_rectangles_from_position(const char* filename, const char* position, case SYNCTEX_PROP_PAGE: if (g_scanner_get_next_token(scanner) == G_TOKEN_INT) { current_page = g_scanner_cur_value(scanner).v_int - 1; - if (rpage == ZATHURA_PAGE_NUMBER_UNSPECIFIED) { + if (ret == false) { + ret = true; rpage = current_page; } diff --git a/synctex.h b/synctex.h index 6f88dec..a81ddfb 100644 --- a/synctex.h +++ b/synctex.h @@ -12,6 +12,6 @@ typedef struct synctex_page_rect_s { void synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y); girara_list_t* synctex_rectangles_from_position(const char* filename, - const char* position, int* page, girara_list_t** secondary_rects); + const char* position, unsigned int* page, girara_list_t** secondary_rects); #endif From ad4f5f5f793bb88786f69ef2531bf850dd57f4c8 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 17 Jan 2014 13:09:10 +0100 Subject: [PATCH 092/129] fix rectangles subindex. Need page not 0 Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index 1d0c13f..c0bf62c 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -168,7 +168,7 @@ highlight_rects(zathura_t* zathura, unsigned int page, document_draw_search_results(zathura, true); - if (rectangles[0] == NULL || girara_list_size(rectangles[0]) == 0) { + if (rectangles[page] == NULL || girara_list_size(rectangles[page]) == 0) { page_set(zathura, page); return; } @@ -188,7 +188,7 @@ highlight_rects(zathura_t* zathura, unsigned int page, unsigned int doc_width = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); - zathura_rectangle_t* rectangle = girara_list_nth(rectangles[0], 0); + zathura_rectangle_t* rectangle = girara_list_nth(rectangles[page], 0); pos_y += (rectangle->y1 - (double)cell_height/2) / (double)doc_height; pos_x += (rectangle->x1 - (double)cell_width/2) / (double)doc_width; From 1a8e211a3b76386fdbcdabd19cc68bef10cd4173 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 17 Jan 2014 13:35:11 +0100 Subject: [PATCH 093/129] properly scale and rotate rectangle Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 10 +++++++--- shortcuts.c | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index c0bf62c..9819743 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -188,9 +188,13 @@ highlight_rects(zathura_t* zathura, unsigned int page, unsigned int doc_width = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); - zathura_rectangle_t* rectangle = girara_list_nth(rectangles[page], 0); - pos_y += (rectangle->y1 - (double)cell_height/2) / (double)doc_height; - pos_x += (rectangle->x1 - (double)cell_width/2) / (double)doc_width; + /* Need to adjust rectangle to page scale and orientation */ + zathura_page_t* doc_page = zathura_document_get_page(zathura->document, page); + zathura_rectangle_t* rect = girara_list_nth(rectangles[page], 0); + zathura_rectangle_t rectangle = recalc_rectangle(doc_page, *rect); + + pos_y += (rectangle.y1 - (double)cell_height/2) / (double)doc_height; + pos_x += (rectangle.x1 - (double)cell_width/2) / (double)doc_width; /* move to position */ zathura_jumplist_add(zathura); diff --git a/shortcuts.c b/shortcuts.c index 7e76235..a067dac 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -917,6 +917,7 @@ sc_search(girara_session_t* session, girara_argument_t* argument, g_object_set(page_widget, "search-current", target_idx, NULL); g_object_get(page_widget, "search-results", &results, NULL); + /* Need to adjust rectangle to page scale and orientation */ zathura_rectangle_t* rect = girara_list_nth(results, target_idx); zathura_rectangle_t rectangle = recalc_rectangle(target_page, *rect); From 633889f291db6169cd6899817c9d749e6fd8165a Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 17 Jan 2014 13:40:51 +0100 Subject: [PATCH 094/129] align highlighted rectangles correctly Align center of the rectangle with the center of the viewport, vor both keyword searches and synctex forward search. Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 9 +++++++-- shortcuts.c | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index 9819743..ce9ea64 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -193,8 +193,13 @@ highlight_rects(zathura_t* zathura, unsigned int page, zathura_rectangle_t* rect = girara_list_nth(rectangles[page], 0); zathura_rectangle_t rectangle = recalc_rectangle(doc_page, *rect); - pos_y += (rectangle.y1 - (double)cell_height/2) / (double)doc_height; - pos_x += (rectangle.x1 - (double)cell_width/2) / (double)doc_width; + /* compute the center of the rectangle, which will be aligned to the center + of the viewport */ + double center_x = (rectangle.x1 + rectangle.x2) / 2; + double center_y = (rectangle.y1 + rectangle.y2) / 2; + + pos_y += (center_y - (double)cell_height/2) / (double)doc_height; + pos_x += (center_x - (double)cell_width/2) / (double)doc_width; /* move to position */ zathura_jumplist_add(zathura); diff --git a/shortcuts.c b/shortcuts.c index a067dac..0f5c807 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -940,10 +940,14 @@ sc_search(girara_session_t* session, girara_argument_t* argument, unsigned int doc_width = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); - pos_y += (rectangle.y1 - (double)cell_height/2) / (double)doc_height; + /* compute the center of the rectangle, which will be aligned to the center + of the viewport */ + double center_x = (rectangle.x1 + rectangle.x2) / 2; + double center_y = (rectangle.y1 + rectangle.y2) / 2; + pos_y += (center_y - (double)cell_height/2) / (double)doc_height; if (search_hadjust == true) { - pos_x += (rectangle.x1 - (double)cell_width/2) / (double)doc_width; + pos_x += (center_x - (double)cell_width/2) / (double)doc_width; } /* move to position */ From e72b2d52d43c55c56e9d2d7820ebabc772df60e4 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sat, 18 Jan 2014 18:10:26 +0100 Subject: [PATCH 095/129] fix type mismatch that broke synctex forward search The problem was introduced in commit 5a992d2d460c0. Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index ce9ea64..ee3dc6d 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -426,7 +426,7 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, GIRARA_LIST_FOREACH_END(rectangles, zathura_rectangle_t*, iter, rect); } - GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(idddd)")); + GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(udddd)")); if (secondary_rects != NULL) { GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) g_variant_builder_add(second_builder, "(udddd)", rect->page, @@ -436,7 +436,7 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, GVariant* ret = g_dbus_connection_call_sync(connection, name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", - g_variant_new("(ua(dddd)a(idddd))", page, builder, second_builder), + g_variant_new("(ua(dddd)a(udddd))", page, builder, second_builder), G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); g_variant_builder_unref(builder); if (ret == NULL) { From fa06f015ba465fd89e3585ed3391e08bbaf3d575 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 18 Jan 2014 19:33:37 +0100 Subject: [PATCH 096/129] Deprecate scrollbar settings and update guioptions Signed-off-by: Sebastian Ramacher --- zathurarc.5.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 75176eb..1559870 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -381,8 +381,10 @@ Defines the font that will be used guioptions ^^^^^^^^^^ Shows or hides GUI elements. -When it contains 'c', the command line is showed. -When it contains 's', the statusbar is showed. +If it contains 'c', the command line is displayed. +If it contains 's', the statusbar is displayed. +If it contains 'h', the vertical scrollbar is displayed. +If it contains 'v', the horizontal scrollbar is displayed. * Value type: String * Default value: s @@ -473,21 +475,24 @@ Defines the background color for the focused tab show-scrollbars ^^^^^^^^^^^^^^^ -Defines if both the horizontal and vertical scrollbars should be shown or not +Defines if both the horizontal and vertical scrollbars should be shown or not. +Deprecated, use 'guioptions' instead. * Value type: Boolean * Default value: false show-h-scrollbar ^^^^^^^^^^^^^^^^ -Defines whether to show/hide the horizontal scrollbar +Defines whether to show/hide the horizontal scrollbar. Deprecated, use +'guioptions' instead. * Value type: Boolean * Default value: false show-v-scrollbar ^^^^^^^^^^^^^^^^ -Defines whether to show/hide the vertical scrollbar +Defines whether to show/hide the vertical scrollbar. Deprecated, use +'guioptions' instead. * Value type: Boolean * Default value: false From e17bb81cc38ca2804d090526867990d25ffc5aff Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 17 Jan 2014 17:53:28 +0100 Subject: [PATCH 097/129] honor search-hadjust setting in synctex forward search Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dbus-interface.c b/dbus-interface.c index ee3dc6d..7ad044c 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -9,6 +9,7 @@ #include "utils.h" #include "adjustment.h" +#include #include #include #include @@ -173,6 +174,9 @@ highlight_rects(zathura_t* zathura, unsigned int page, return; } + bool search_hadjust = true; + girara_setting_get(zathura->ui.session, "search-hadjust", &search_hadjust); + /* compute the position of the center of the page */ double pos_x = 0; double pos_y = 0; @@ -199,7 +203,9 @@ highlight_rects(zathura_t* zathura, unsigned int page, double center_y = (rectangle.y1 + rectangle.y2) / 2; pos_y += (center_y - (double)cell_height/2) / (double)doc_height; - pos_x += (center_x - (double)cell_width/2) / (double)doc_width; + if (search_hadjust == true) { + pos_x += (center_x - (double)cell_width/2) / (double)doc_width; + } /* move to position */ zathura_jumplist_add(zathura); From bafbedbcef0b3ae85e5d5db71b6dc61e252fdf14 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 18 Jan 2014 22:01:07 +0100 Subject: [PATCH 098/129] Add missing include Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dbus-interface.c b/dbus-interface.c index 7ad044c..8b212ae 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include From 0fc5b80121f4cfff5255653e103f0f9c7645bbeb Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Sun, 19 Jan 2014 16:47:08 +0100 Subject: [PATCH 099/129] Replace glib memory functions with try version --- bookmarks.c | 5 ++++- commands.c | 5 ++++- content-type.c | 6 +++++- database-plain.c | 28 +++++++++++++++++++++---- database-sqlite.c | 10 +++++++-- dbus-interface.c | 16 ++++++++++++--- document.c | 12 +++++++++-- links.c | 5 ++++- marks.c | 5 ++++- page.c | 10 +++++++-- plugin.c | 17 +++++++++++++--- render.c | 27 +++++++++++++++++++----- synctex.c | 52 +++++++++++++++++++++++++++++++++++------------ types.c | 10 +++++++-- utils.c | 11 ++++++++-- zathura.c | 16 ++++++++++++--- 16 files changed, 189 insertions(+), 46 deletions(-) diff --git a/bookmarks.c b/bookmarks.c index 28f6b5e..62932db 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -48,7 +48,10 @@ zathura_bookmark_add(zathura_t* zathura, const gchar* id, unsigned int page) return old; } - zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t)); + zathura_bookmark_t* bookmark = g_try_malloc0(sizeof(zathura_bookmark_t)); + if (bookmark == NULL) { + return NULL; + } bookmark->id = g_strdup(id); bookmark->page = page; diff --git a/commands.c b/commands.c index 30709a7..055989a 100644 --- a/commands.c +++ b/commands.c @@ -400,7 +400,10 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu } } - girara_argument_t* arg = g_malloc0(sizeof(girara_argument_t)); + girara_argument_t* arg = g_try_malloc0(sizeof(girara_argument_t)); + if (arg == NULL) { + return false; + } arg->n = FORWARD; sc_search(session, arg, NULL, 0); diff --git a/content-type.c b/content-type.c index 35b7a90..8d13e2d 100644 --- a/content-type.c +++ b/content-type.c @@ -134,7 +134,11 @@ guess_type_glib(const char* path) g_free((void*)content_type); content_type = NULL; - content = g_realloc(content, length + BUFSIZ); + content = g_try_realloc(content, length + BUFSIZ); + if (content == NULL) { + continue; + } + bytes_read = read(fd, content + length, BUFSIZ); if (bytes_read == -1) { break; diff --git a/database-plain.c b/database-plain.c index 22fc507..e1f00ef 100644 --- a/database-plain.c +++ b/database-plain.c @@ -326,13 +326,27 @@ plain_add_bookmark(zathura_database_t* db, const char* file, return false; } + char* bmx = g_try_malloc(G_ASCII_DTOSTR_BUF_SIZE); + if (bmx == NULL) { + return false; + } + + char* bmy = g_try_malloc(G_ASCII_DTOSTR_BUF_SIZE); + if (bmy == NULL) { + g_free(bmx); + return false; + } + char* name = prepare_filename(file); char* val_list[] = { g_strdup_printf("%d", bookmark->page), - g_ascii_dtostr(g_malloc(G_ASCII_DTOSTR_BUF_SIZE), G_ASCII_DTOSTR_BUF_SIZE, bookmark->x), - g_ascii_dtostr(g_malloc(G_ASCII_DTOSTR_BUF_SIZE), G_ASCII_DTOSTR_BUF_SIZE, bookmark->y) + g_ascii_dtostr(bmx, G_ASCII_DTOSTR_BUF_SIZE, bookmark->x), + g_ascii_dtostr(bmy, G_ASCII_DTOSTR_BUF_SIZE, bookmark->y) }; + g_free(bmx); + g_free(bmy); + g_key_file_set_string_list(priv->bookmarks, name, bookmark->id, (const char**)val_list, LENGTH(val_list)); for (unsigned int i = 0; i < LENGTH(val_list); ++i) { @@ -397,7 +411,10 @@ plain_load_bookmarks(zathura_database_t* db, const char* file) gsize num_vals = 0; for (gsize i = 0; i < num_keys; i++) { - zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t)); + zathura_bookmark_t* bookmark = g_try_malloc0(sizeof(zathura_bookmark_t)); + if (bookmark == NULL) { + continue; + } bookmark->id = g_strdup(keys[i]); char **val_list = g_key_file_get_string_list(priv->bookmarks, name, keys[i], &num_vals, NULL); @@ -439,7 +456,10 @@ get_jumplist_from_str(const char* str) char* token = strtok_r(copy, " ", &saveptr); while (token != NULL) { - zathura_jump_t* jump = g_malloc0(sizeof(zathura_jump_t)); + zathura_jump_t* jump = g_try_malloc0(sizeof(zathura_jump_t)); + if (jump == NULL) { + continue; + } jump->page = strtoul(token, NULL, 0); token = strtok_r(NULL, " ", &saveptr); diff --git a/database-sqlite.c b/database-sqlite.c index 9c11775..9525759 100644 --- a/database-sqlite.c +++ b/database-sqlite.c @@ -390,7 +390,10 @@ sqlite_load_bookmarks(zathura_database_t* db, const char* file) (girara_free_function_t) zathura_bookmark_free); while (sqlite3_step(stmt) == SQLITE_ROW) { - zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t)); + zathura_bookmark_t* bookmark = g_try_malloc0(sizeof(zathura_bookmark_t)); + if (bookmark == NULL) { + continue; + } bookmark->id = g_strdup((const char*) sqlite3_column_text(stmt, 0)); bookmark->page = sqlite3_column_int(stmt, 1); @@ -524,7 +527,10 @@ sqlite_load_jumplist(zathura_database_t* db, const char* file) int res = 0; while ((res = sqlite3_step(stmt)) == SQLITE_ROW) { - zathura_jump_t* jump = g_malloc0(sizeof(zathura_jump_t)); + zathura_jump_t* jump = g_try_malloc0(sizeof(zathura_jump_t)); + if (jump == NULL) { + continue; + } jump->page = sqlite3_column_int(stmt, 0); jump->x = sqlite3_column_double(stmt, 1); diff --git a/dbus-interface.c b/dbus-interface.c index 8b212ae..7b8ab05 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -289,13 +289,20 @@ handle_method_call(GDBusConnection* UNUSED(connection), } /* get rectangles */ - girara_list_t** rectangles = g_malloc0(number_of_pages * sizeof(girara_list_t*)); + girara_list_t** rectangles = g_try_malloc0(number_of_pages * sizeof(girara_list_t*)); + if (rectangles == NULL) { + return; + } + rectangles[page] = girara_list_new2(g_free); zathura_rectangle_t temp_rect; while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { - zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); + zathura_rectangle_t* rect = g_try_malloc0(sizeof(zathura_rectangle_t)); + if (rect == NULL) { + continue; + } *rect = temp_rect; girara_list_append(rectangles[page], rect); } @@ -314,7 +321,10 @@ handle_method_call(GDBusConnection* UNUSED(connection), rectangles[temp_page] = girara_list_new2(g_free); } - zathura_rectangle_t* rect = g_malloc0(sizeof(zathura_rectangle_t)); + zathura_rectangle_t* rect = g_try_malloc0(sizeof(zathura_rectangle_t)); + if (rect == NULL) { + continue; + } *rect = temp_rect; girara_list_append(rectangles[temp_page], rect); } diff --git a/document.c b/document.c index 09f55a5..cd16390 100644 --- a/document.c +++ b/document.c @@ -104,11 +104,19 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* if (plugin == NULL) { girara_error("unknown file type\n"); - *error = ZATHURA_ERROR_UNKNOWN; + if (error != NULL) { + *error = ZATHURA_ERROR_UNKNOWN; + } goto error_free; } - document = g_malloc0(sizeof(zathura_document_t)); + document = g_try_malloc0(sizeof(zathura_document_t)); + if (document == NULL) { + if (error != NULL) { + *error = ZATHURA_ERROR_OUT_OF_MEMORY; + } + goto error_free; + } document->file_path = real_path; document->basename = g_path_get_basename(real_path); diff --git a/links.c b/links.c index 33d56f1..1e8fe97 100644 --- a/links.c +++ b/links.c @@ -28,7 +28,10 @@ zathura_link_t* zathura_link_new(zathura_link_type_t type, zathura_rectangle_t position, zathura_link_target_t target) { - zathura_link_t* link = g_malloc0(sizeof(zathura_link_t)); + zathura_link_t* link = g_try_malloc0(sizeof(zathura_link_t)); + if (link == NULL) { + return NULL; + } link->type = type; link->position = position; diff --git a/marks.c b/marks.c index 4cd294c..b0faff5 100644 --- a/marks.c +++ b/marks.c @@ -215,7 +215,10 @@ mark_add(zathura_t* zathura, int key) GIRARA_LIST_FOREACH_END(zathura->global.marks, zathura_mark_t*, iter, mark); /* add new mark */ - zathura_mark_t* mark = g_malloc0(sizeof(zathura_mark_t)); + zathura_mark_t* mark = g_try_malloc0(sizeof(zathura_mark_t)); + if (mark == NULL) { + return NULL; + } mark->key = key; mark->page = page_id; diff --git a/page.c b/page.c index d8a876a..a40651a 100644 --- a/page.c +++ b/page.c @@ -31,7 +31,13 @@ zathura_page_new(zathura_document_t* document, unsigned int index, zathura_error } /* init page */ - zathura_page_t* page = g_malloc0(sizeof(zathura_page_t)); + zathura_page_t* page = g_try_malloc0(sizeof(zathura_page_t)); + if (page == NULL) { + if (error != NULL) { + *error = ZATHURA_ERROR_OUT_OF_MEMORY; + } + goto error_ret; + } page->index = index; page->visible = false; @@ -45,7 +51,7 @@ zathura_page_new(zathura_document_t* document, unsigned int index, zathura_error if (error != NULL) { *error = ZATHURA_ERROR_NOT_IMPLEMENTED; } - goto error_ret; + goto error_free; } zathura_error_t ret = functions->page_init(page); diff --git a/plugin.c b/plugin.c index a45172d..3606d3d 100644 --- a/plugin.c +++ b/plugin.c @@ -54,7 +54,10 @@ static void zathura_type_plugin_mapping_free(zathura_type_plugin_mapping_t* mapp zathura_plugin_manager_t* zathura_plugin_manager_new() { - zathura_plugin_manager_t* plugin_manager = g_malloc0(sizeof(zathura_plugin_manager_t)); + zathura_plugin_manager_t* plugin_manager = g_try_malloc0(sizeof(zathura_plugin_manager_t)); + if (plugin_manager == NULL) { + return NULL; + } plugin_manager->plugins = girara_list_new2((girara_free_function_t) zathura_plugin_free); plugin_manager->path = girara_list_new2(g_free); @@ -159,7 +162,11 @@ zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager) continue; } - plugin = g_malloc0(sizeof(zathura_plugin_t)); + plugin = g_try_malloc0(sizeof(zathura_plugin_t)); + if (plugin == NULL) { + continue; + } + plugin->content_types = girara_list_new2(g_free); plugin->handle = handle; @@ -294,7 +301,11 @@ plugin_mapping_new(zathura_plugin_manager_t* plugin_manager, const gchar* type, } GIRARA_LIST_FOREACH_END(plugin_manager->type_plugin_mapping, zathura_type_plugin_mapping_t*, iter, mapping); - zathura_type_plugin_mapping_t* mapping = g_malloc(sizeof(zathura_type_plugin_mapping_t)); + zathura_type_plugin_mapping_t* mapping = g_try_malloc(sizeof(zathura_type_plugin_mapping_t)); + if (mapping == NULL) { + return false; + } + mapping->type = g_strdup(type); mapping->plugin = plugin; girara_list_append(plugin_manager->type_plugin_mapping, mapping); diff --git a/render.c b/render.c index a5bee64..ffea0da 100644 --- a/render.c +++ b/render.c @@ -117,14 +117,20 @@ zathura_renderer_init(ZathuraRenderer* renderer) priv->requests = girara_list_new(); } -static void +static bool page_cache_init(ZathuraRenderer* renderer, size_t cache_size) { private_t* priv = GET_PRIVATE(renderer); priv->page_cache.size = cache_size; - priv->page_cache.cache = g_malloc(cache_size * sizeof(int)); + priv->page_cache.cache = g_try_malloc(cache_size * sizeof(int)); + if (priv->page_cache.cache == NULL) { + return false; + } + page_cache_invalidate_all(renderer); + + return true; } ZathuraRenderer* @@ -134,7 +140,10 @@ zathura_renderer_new(size_t cache_size) GObject* obj = g_object_new(ZATHURA_TYPE_RENDERER, NULL); ZathuraRenderer* ret = ZATHURA_RENDERER(obj); - page_cache_init(ret, cache_size); + + if (page_cache_init(ret, cache_size) == false) { + return NULL; + } return ret; } @@ -409,7 +418,11 @@ zathura_render_request(ZathuraRenderRequest* request, gint64 last_view_time) if (unfinished_jobs == false) { request_priv->last_view_time = last_view_time; - render_job_t* job = g_malloc0(sizeof(render_job_t)); + render_job_t* job = g_try_malloc0(sizeof(render_job_t)); + if (job == NULL) { + return; + } + job->request = g_object_ref(request); job->aborted = false; girara_list_append(request_priv->active_jobs, job); @@ -683,7 +696,11 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render recolor(priv, page_width, page_height, surface); } - emit_completed_signal_t* ecs = g_malloc(sizeof(emit_completed_signal_t)); + emit_completed_signal_t* ecs = g_try_malloc(sizeof(emit_completed_signal_t)); + if (ecs == NULL) { + return false; + } + ecs->job = job; ecs->surface = cairo_surface_reference(surface); diff --git a/synctex.c b/synctex.c index 1d5b004..a872910 100644 --- a/synctex.c +++ b/synctex.c @@ -63,8 +63,12 @@ synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) return; } - char** argv = g_malloc0(sizeof(char*) * (zathura->synctex.editor != NULL ? + char** argv = g_try_malloc0(sizeof(char*) * (zathura->synctex.editor != NULL ? 6 : 4)); + if (argv == NULL) { + return; + } + argv[0] = g_strdup("synctex"); argv[1] = g_strdup("edit"); argv[2] = g_strdup("-o"); @@ -101,7 +105,11 @@ synctex_rectangles_from_position(const char* filename, const char* position, return NULL; } - char** argv = g_malloc0(sizeof(char*) * 6); + char** argv = g_try_malloc0(sizeof(char*) * 6); + if (argv == NULL) { + return NULL; + } + argv[0] = g_strdup("synctex"); argv[1] = g_strdup("view"); argv[2] = g_strdup("-i"); @@ -180,31 +188,47 @@ synctex_rectangles_from_position(const char* filename, const char* position, girara_list_append(hitlist, rectangle); rectangle = NULL; } else if (rectangle != NULL) { - synctex_page_rect_t* page_rect = g_malloc0(sizeof(synctex_page_rect_t)); + synctex_page_rect_t* page_rect = g_try_malloc0(sizeof(synctex_page_rect_t)); + if (page_rect == NULL) { + continue; + } + page_rect->page = current_page; page_rect->rect = *rectangle; + girara_list_append(other_rects, page_rect); } g_free(rectangle); - rectangle = g_malloc0(sizeof(zathura_rectangle_t)); + rectangle = g_try_malloc0(sizeof(zathura_rectangle_t)); + if (rectangle == NULL) { + continue; + } } break; case SYNCTEX_PROP_H: - rectangle->x1 = scan_float(scanner); + if (rectangle != NULL) { + rectangle->x1 = scan_float(scanner); + } break; case SYNCTEX_PROP_V: - rectangle->y2 = scan_float(scanner); + if (rectangle != NULL) { + rectangle->y2 = scan_float(scanner); + } break; case SYNCTEX_PROP_WIDTH: - rectangle->x2 = rectangle->x1 + scan_float(scanner); + if (rectangle != NULL) { + rectangle->x2 = rectangle->x1 + scan_float(scanner); + } break; case SYNCTEX_PROP_HEIGHT: - rectangle->y1 = rectangle->y2 - scan_float(scanner); + if (rectangle != NULL) { + rectangle->y1 = rectangle->y2 - scan_float(scanner); + } break; } break; @@ -218,11 +242,13 @@ synctex_rectangles_from_position(const char* filename, const char* position, if (current_page == rpage) { girara_list_append(hitlist, rectangle); } else { - synctex_page_rect_t* page_rect = g_malloc0(sizeof(synctex_page_rect_t)); - page_rect->page = current_page; - page_rect->rect = *rectangle; - girara_list_append(other_rects, page_rect); - g_free(rectangle); + synctex_page_rect_t* page_rect = g_try_malloc0(sizeof(synctex_page_rect_t)); + if (page_rect != NULL) { + page_rect->page = current_page; + page_rect->rect = *rectangle; + girara_list_append(other_rects, page_rect); + g_free(rectangle); + } } } diff --git a/types.c b/types.c index bfddce0..28d50ee 100644 --- a/types.c +++ b/types.c @@ -15,7 +15,10 @@ zathura_index_element_new(const char* title) return NULL; } - zathura_index_element_t* res = g_malloc0(sizeof(zathura_index_element_t)); + zathura_index_element_t* res = g_try_malloc0(sizeof(zathura_index_element_t)); + if (res == NULL) { + return NULL; + } res->title = g_strdup(title); @@ -86,7 +89,10 @@ zathura_document_information_entry_new(zathura_document_information_type_t type, } zathura_document_information_entry_t* entry = - g_malloc0(sizeof(zathura_document_information_entry_t)); + g_try_malloc0(sizeof(zathura_document_information_entry_t)); + if (entry == NULL) { + return NULL; + } entry->type = type; entry->value = g_strdup(value); diff --git a/utils.c b/utils.c index c83c6b7..cb55110 100644 --- a/utils.c +++ b/utils.c @@ -225,7 +225,11 @@ replace_substring(const char* string, const char* old, const char* new) return NULL; } - char* ret = g_malloc0(sizeof(char) * (i - count * old_len + count * new_len + 1)); + char* ret = g_try_malloc0(sizeof(char) * (i - count * old_len + count * new_len + 1)); + if (ret == NULL) { + return NULL; + } + i = 0; /* replace */ @@ -249,7 +253,10 @@ GdkAtom* get_selection(zathura_t* zathura) char* value; girara_setting_get(zathura->ui.session, "selection-clipboard", &value); - GdkAtom* selection = g_malloc(sizeof(GdkAtom)); + GdkAtom* selection = g_try_malloc(sizeof(GdkAtom)); + if (selection == NULL) { + return NULL; + } if (strcmp(value, "primary") == 0) { *selection = GDK_SELECTION_PRIMARY; diff --git a/zathura.c b/zathura.c index 1f5f4fd..821bae2 100644 --- a/zathura.c +++ b/zathura.c @@ -53,7 +53,10 @@ static void zathura_jumplist_save(zathura_t* zathura); zathura_t* zathura_create(void) { - zathura_t* zathura = g_malloc0(sizeof(zathura_t)); + zathura_t* zathura = g_try_malloc0(sizeof(zathura_t)); + if (zathura == NULL) { + return NULL; + } /* global settings */ zathura->global.search_direction = FORWARD; @@ -821,7 +824,10 @@ document_open_idle(zathura_t* zathura, const char* path, const char* password, return; } - zathura_document_info_t* document_info = g_malloc0(sizeof(zathura_document_info_t)); + zathura_document_info_t* document_info = g_try_malloc0(sizeof(zathura_document_info_t)); + if (document_info == NULL) { + return; + } document_info->zathura = zathura; document_info->path = path; @@ -1245,7 +1251,11 @@ zathura_jumplist_append_jump(zathura_t* zathura) { g_return_if_fail(zathura != NULL && zathura->jumplist.list != NULL); - zathura_jump_t *jump = g_malloc(sizeof(zathura_jump_t)); + zathura_jump_t *jump = g_try_malloc(sizeof(zathura_jump_t)); + if (jump == NULL) { + return; + } + jump->page = 0; jump->x = 0.0; jump->y = 0.0; From 71ef7c7eedef2d2d8ec8dce0c576ba972edd775e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 17:09:33 +0100 Subject: [PATCH 100/129] Fix some memory leaks and a use after free Also return proper D-Bus errors Signed-off-by: Sebastian Ramacher --- database-plain.c | 38 ++++++++++++++++++++------------------ database-sqlite.c | 14 +++++++++++--- dbus-interface.c | 38 +++++++++++++++++++++++++++++++++++--- plugin.c | 5 ++++- render.c | 16 +++++++++------- utils.c | 7 +++---- zathura.c | 6 +++--- 7 files changed, 85 insertions(+), 39 deletions(-) diff --git a/database-plain.c b/database-plain.c index e1f00ef..1825af9 100644 --- a/database-plain.c +++ b/database-plain.c @@ -326,26 +326,22 @@ plain_add_bookmark(zathura_database_t* db, const char* file, return false; } - char* bmx = g_try_malloc(G_ASCII_DTOSTR_BUF_SIZE); - if (bmx == NULL) { - return false; - } - - char* bmy = g_try_malloc(G_ASCII_DTOSTR_BUF_SIZE); - if (bmy == NULL) { - g_free(bmx); - return false; - } - char* name = prepare_filename(file); char* val_list[] = { g_strdup_printf("%d", bookmark->page), - g_ascii_dtostr(bmx, G_ASCII_DTOSTR_BUF_SIZE, bookmark->x), - g_ascii_dtostr(bmy, G_ASCII_DTOSTR_BUF_SIZE, bookmark->y) + g_try_malloc0(G_ASCII_DTOSTR_BUF_SIZE), + g_try_malloc0(G_ASCII_DTOSTR_BUF_SIZE) }; + if (name == NULL || val_list[1] == NULL || val_list[2] == NULL) { + g_free(name); + for (unsigned int i = 0; i < LENGTH(val_list); ++i) { + g_free(val_list[i]); + } + return false; + } - g_free(bmx); - g_free(bmy); + g_ascii_dtostr(val_list[1], G_ASCII_DTOSTR_BUF_SIZE, bookmark->x); + g_ascii_dtostr(val_list[2], G_ASCII_DTOSTR_BUF_SIZE, bookmark->y); g_key_file_set_string_list(priv->bookmarks, name, bookmark->id, (const char**)val_list, LENGTH(val_list)); @@ -417,7 +413,15 @@ plain_load_bookmarks(zathura_database_t* db, const char* file) } bookmark->id = g_strdup(keys[i]); - char **val_list = g_key_file_get_string_list(priv->bookmarks, name, keys[i], &num_vals, NULL); + char** val_list = g_key_file_get_string_list(priv->bookmarks, name, keys[i], + &num_vals, NULL); + + if (num_vals != 1 && num_vals != 3) { + girara_error("Unexpected number of values."); + g_free(bookmark); + g_strfreev(val_list); + continue; + } bookmark->page = atoi(val_list[0]); @@ -427,8 +431,6 @@ plain_load_bookmarks(zathura_database_t* db, const char* file) } else if (num_vals == 1) { bookmark->x = DBL_MIN; bookmark->y = DBL_MIN; - } else { - girara_debug("This must be a BUG"); } girara_list_append(result, bookmark); diff --git a/database-sqlite.c b/database-sqlite.c index 9525759..b3696c3 100644 --- a/database-sqlite.c +++ b/database-sqlite.c @@ -388,6 +388,10 @@ sqlite_load_bookmarks(zathura_database_t* db, const char* file) girara_list_t* result = girara_sorted_list_new2((girara_compare_function_t) zathura_bookmarks_compare, (girara_free_function_t) zathura_bookmark_free); + if (result != NULL) { + sqlite3_finalize(stmt); + return NULL; + } while (sqlite3_step(stmt) == SQLITE_ROW) { zathura_bookmark_t* bookmark = g_try_malloc0(sizeof(zathura_bookmark_t)); @@ -397,8 +401,8 @@ sqlite_load_bookmarks(zathura_database_t* db, const char* file) bookmark->id = g_strdup((const char*) sqlite3_column_text(stmt, 0)); bookmark->page = sqlite3_column_int(stmt, 1); - bookmark->x = sqlite3_column_double(stmt, 2); - bookmark->y = sqlite3_column_double(stmt, 3); + bookmark->x = sqlite3_column_double(stmt, 2); + bookmark->y = sqlite3_column_double(stmt, 3); if (bookmark->page > 1) { bookmark->x = bookmark->x == 0.0 ? DBL_MIN : bookmark->x; @@ -524,8 +528,12 @@ sqlite_load_jumplist(zathura_database_t* db, const char* file) } girara_list_t* jumplist = girara_list_new2(g_free); - int res = 0; + if (jumplist == NULL) { + sqlite3_finalize(stmt); + return NULL; + } + int res = 0; while ((res = sqlite3_step(stmt)) == SQLITE_ROW) { zathura_jump_t* jump = g_try_malloc0(sizeof(zathura_jump_t)); if (jump == NULL) { diff --git a/dbus-interface.c b/dbus-interface.c index 7b8ab05..b2cf9c2 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -291,18 +291,40 @@ handle_method_call(GDBusConnection* UNUSED(connection), /* get rectangles */ girara_list_t** rectangles = g_try_malloc0(number_of_pages * sizeof(girara_list_t*)); if (rectangles == NULL) { + g_variant_iter_free(iter); + g_variant_iter_free(secondary_iter); + g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, + G_DBUS_ERROR_NO_MEMORY, + "Failed to allocate memory."); return; } rectangles[page] = girara_list_new2(g_free); + if (rectangles[page] == NULL) { + g_free(rectangles); + g_variant_iter_free(iter); + g_variant_iter_free(secondary_iter); + g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, + G_DBUS_ERROR_NO_MEMORY, + "Failed to allocate memory."); + return; + } zathura_rectangle_t temp_rect; while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { zathura_rectangle_t* rect = g_try_malloc0(sizeof(zathura_rectangle_t)); if (rect == NULL) { - continue; + g_variant_iter_free(iter); + g_variant_iter_free(secondary_iter); + girara_list_free(rectangles[page]); + g_free(rectangles); + g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, + G_DBUS_ERROR_NO_MEMORY, + "Failed to allocate memory."); + return; } + *rect = temp_rect; girara_list_append(rectangles[page], rect); } @@ -322,9 +344,19 @@ handle_method_call(GDBusConnection* UNUSED(connection), } zathura_rectangle_t* rect = g_try_malloc0(sizeof(zathura_rectangle_t)); - if (rect == NULL) { - continue; + if (rect == NULL || rectangles[temp_page] == NULL) { + g_variant_iter_free(secondary_iter); + for (unsigned int p = 0; p != number_of_pages; ++p) { + girara_list_free(rectangles[p]); + } + g_free(rectangles); + g_free(rect); + g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, + G_DBUS_ERROR_NO_MEMORY, + "Failed to allocate memory."); + return; } + *rect = temp_rect; girara_list_append(rectangles[temp_page], rect); } diff --git a/plugin.c b/plugin.c index 3606d3d..b3e59cf 100644 --- a/plugin.c +++ b/plugin.c @@ -164,6 +164,9 @@ zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager) plugin = g_try_malloc0(sizeof(zathura_plugin_t)); if (plugin == NULL) { + girara_error("Failed to allocate memory for plugin."); + g_free(path); + g_module_close(handle); continue; } @@ -301,7 +304,7 @@ plugin_mapping_new(zathura_plugin_manager_t* plugin_manager, const gchar* type, } GIRARA_LIST_FOREACH_END(plugin_manager->type_plugin_mapping, zathura_type_plugin_mapping_t*, iter, mapping); - zathura_type_plugin_mapping_t* mapping = g_try_malloc(sizeof(zathura_type_plugin_mapping_t)); + zathura_type_plugin_mapping_t* mapping = g_try_malloc0(sizeof(zathura_type_plugin_mapping_t)); if (mapping == NULL) { return false; } diff --git a/render.c b/render.c index ffea0da..a8a7dc7 100644 --- a/render.c +++ b/render.c @@ -122,14 +122,13 @@ page_cache_init(ZathuraRenderer* renderer, size_t cache_size) { private_t* priv = GET_PRIVATE(renderer); - priv->page_cache.size = cache_size; - priv->page_cache.cache = g_try_malloc(cache_size * sizeof(int)); + priv->page_cache.size = cache_size; + priv->page_cache.cache = g_try_malloc0(cache_size * sizeof(int)); if (priv->page_cache.cache == NULL) { return false; } page_cache_invalidate_all(renderer); - return true; } @@ -142,6 +141,7 @@ zathura_renderer_new(size_t cache_size) ZathuraRenderer* ret = ZATHURA_RENDERER(obj); if (page_cache_init(ret, cache_size) == false) { + g_object_unref(obj); return NULL; } @@ -646,7 +646,8 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render const double width = zathura_page_get_width(page); const double real_scale = page_calc_height_width(document, height, width, - &page_height, &page_width, false); + &page_height, &page_width, + false); cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, @@ -685,7 +686,7 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render /* before recoloring, check if we've been aborted */ if (priv->about_to_close == true || job->aborted == true) { girara_debug("Rendering of page %d aborted", - zathura_page_get_index(request_priv->page) + 1); + zathura_page_get_index(request_priv->page) + 1); remove_job_and_free(job); cairo_surface_destroy(surface); return true; @@ -696,12 +697,13 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render recolor(priv, page_width, page_height, surface); } - emit_completed_signal_t* ecs = g_try_malloc(sizeof(emit_completed_signal_t)); + emit_completed_signal_t* ecs = g_try_malloc0(sizeof(emit_completed_signal_t)); if (ecs == NULL) { + cairo_surface_destroy(surface); return false; } - ecs->job = job; + ecs->job = job; ecs->surface = cairo_surface_reference(surface); /* emit signal from the main context, i.e. the main thread */ diff --git a/utils.c b/utils.c index cb55110..b9c00f9 100644 --- a/utils.c +++ b/utils.c @@ -211,8 +211,8 @@ replace_substring(const char* string, const char* old, const char* new) size_t new_len = strlen(new); /* count occurrences */ - unsigned int count = 0; - unsigned int i = 0; + size_t count = 0; + size_t i = 0; for (i = 0; string[i] != '\0'; i++) { if (strstr(&string[i], old) == &string[i]) { @@ -230,9 +230,8 @@ replace_substring(const char* string, const char* old, const char* new) return NULL; } - i = 0; - /* replace */ + i = 0; while (*string != '\0') { if (strstr(string, old) == string) { strncpy(&ret[i], new, new_len); diff --git a/zathura.c b/zathura.c index 821bae2..75aabc5 100644 --- a/zathura.c +++ b/zathura.c @@ -1251,14 +1251,14 @@ zathura_jumplist_append_jump(zathura_t* zathura) { g_return_if_fail(zathura != NULL && zathura->jumplist.list != NULL); - zathura_jump_t *jump = g_try_malloc(sizeof(zathura_jump_t)); + zathura_jump_t* jump = g_try_malloc0(sizeof(zathura_jump_t)); if (jump == NULL) { return; } jump->page = 0; - jump->x = 0.0; - jump->y = 0.0; + jump->x = 0.0; + jump->y = 0.0; girara_list_append(zathura->jumplist.list, jump); if (zathura->jumplist.size == 0) { From 3524c6da2331921383b25085d8497e76cfa7672f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 17:15:09 +0100 Subject: [PATCH 101/129] Add extra element for NULL at the end Signed-off-by: Sebastian Ramacher --- synctex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synctex.c b/synctex.c index a872910..e3aaee4 100644 --- a/synctex.c +++ b/synctex.c @@ -64,7 +64,7 @@ synctex_edit(zathura_t* zathura, zathura_page_t* page, int x, int y) } char** argv = g_try_malloc0(sizeof(char*) * (zathura->synctex.editor != NULL ? - 6 : 4)); + 7 : 5)); if (argv == NULL) { return; } @@ -105,7 +105,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, return NULL; } - char** argv = g_try_malloc0(sizeof(char*) * 6); + char** argv = g_try_malloc0(sizeof(char*) * 7); if (argv == NULL) { return NULL; } From d83d7bc7d994188864db495886d2c14596476991 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 17:17:14 +0100 Subject: [PATCH 102/129] Create zathura instance later Signed-off-by: Sebastian Ramacher --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 57324dd..733a192 100644 --- a/main.c +++ b/main.c @@ -37,12 +37,6 @@ main(int argc, char* argv[]) #endif gtk_init(&argc, &argv); - /* create zathura session */ - zathura_t* zathura = zathura_create(); - if (zathura == NULL) { - return -1; - } - /* parse command line arguments */ gchar* config_dir = NULL; gchar* data_dir = NULL; @@ -130,6 +124,12 @@ main(int argc, char* argv[]) setsid(); } + /* create zathura session */ + zathura_t* zathura = zathura_create(); + if (zathura == NULL) { + return -1; + } + zathura_set_xid(zathura, embed); zathura_set_config_dir(zathura, config_dir); zathura_set_data_dir(zathura, data_dir); From 7fc2b365ba3e29283f21b97e4a224189e76518c2 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 19:39:58 +0100 Subject: [PATCH 103/129] g_try_realloc behaves like realloc Signed-off-by: Sebastian Ramacher --- content-type.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content-type.c b/content-type.c index 8d13e2d..4af2a10 100644 --- a/content-type.c +++ b/content-type.c @@ -134,10 +134,11 @@ guess_type_glib(const char* path) g_free((void*)content_type); content_type = NULL; - content = g_try_realloc(content, length + BUFSIZ); - if (content == NULL) { - continue; + guchar* temp_content = g_try_realloc(content, length + BUFSIZ); + if (temp_content == NULL) { + break; } + content = temp_content; bytes_read = read(fd, content + length, BUFSIZ); if (bytes_read == -1) { From af40bbabad501410171ec63f7ecd07ce5ca21181 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 19:42:54 +0100 Subject: [PATCH 104/129] Only allocate dynamically if we add to the list Signed-off-by: Sebastian Ramacher --- synctex.c | 78 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/synctex.c b/synctex.c index e3aaee4..05d1edd 100644 --- a/synctex.c +++ b/synctex.c @@ -157,12 +157,13 @@ synctex_rectangles_from_position(const char* filename, const char* position, } } - ret = false; - unsigned int rpage = 0; - unsigned int current_page = 0; - girara_list_t* hitlist = girara_list_new2(g_free); + ret = false; + unsigned int rpage = 0; + unsigned int current_page = 0; + girara_list_t* hitlist = girara_list_new2(g_free); girara_list_t* other_rects = girara_list_new2(g_free); - zathura_rectangle_t* rectangle = NULL; + bool got_rect = false; + zathura_rectangle_t rectangle; while (found_end == false) { switch (g_scanner_get_next_token(scanner)) { @@ -184,51 +185,51 @@ synctex_rectangles_from_position(const char* filename, const char* position, rpage = current_page; } - if (*page == current_page && rectangle != NULL) { - girara_list_append(hitlist, rectangle); - rectangle = NULL; - } else if (rectangle != NULL) { - synctex_page_rect_t* page_rect = g_try_malloc0(sizeof(synctex_page_rect_t)); + if (got_rect == false) { + continue; + } + got_rect = false; + + if (*page == current_page) { + zathura_rectangle_t* real_rect = g_try_malloc(sizeof(zathura_rectangle_t)); + if (real_rect == NULL) { + continue; + } + + *real_rect = rectangle; + girara_list_append(hitlist, real_rect); + } else { + synctex_page_rect_t* page_rect = g_try_malloc(sizeof(synctex_page_rect_t)); if (page_rect == NULL) { continue; } page_rect->page = current_page; - page_rect->rect = *rectangle; + page_rect->rect = rectangle; girara_list_append(other_rects, page_rect); } - - g_free(rectangle); - rectangle = g_try_malloc0(sizeof(zathura_rectangle_t)); - if (rectangle == NULL) { - continue; - } } break; case SYNCTEX_PROP_H: - if (rectangle != NULL) { - rectangle->x1 = scan_float(scanner); - } + rectangle.x1 = scan_float(scanner); + got_rect = true; break; - case SYNCTEX_PROP_V: - if (rectangle != NULL) { - rectangle->y2 = scan_float(scanner); - } + case SYNCTEX_PROP_V: + rectangle.y2 = scan_float(scanner); + got_rect = true; break; - case SYNCTEX_PROP_WIDTH: - if (rectangle != NULL) { - rectangle->x2 = rectangle->x1 + scan_float(scanner); - } + case SYNCTEX_PROP_WIDTH: + rectangle.x2 = rectangle.x1 + scan_float(scanner); + got_rect = true; break; - case SYNCTEX_PROP_HEIGHT: - if (rectangle != NULL) { - rectangle->y1 = rectangle->y2 - scan_float(scanner); - } + case SYNCTEX_PROP_HEIGHT: + rectangle.y1 = rectangle.y2 - scan_float(scanner); + got_rect = true; break; } break; @@ -238,16 +239,19 @@ synctex_rectangles_from_position(const char* filename, const char* position, } } - if (rectangle != NULL) { + if (got_rect == true) { if (current_page == rpage) { - girara_list_append(hitlist, rectangle); + zathura_rectangle_t* real_rect = g_try_malloc(sizeof(zathura_rectangle_t)); + if (real_rect != NULL) { + *real_rect = rectangle; + girara_list_append(hitlist, real_rect); + } } else { - synctex_page_rect_t* page_rect = g_try_malloc0(sizeof(synctex_page_rect_t)); + synctex_page_rect_t* page_rect = g_try_malloc(sizeof(synctex_page_rect_t)); if (page_rect != NULL) { page_rect->page = current_page; - page_rect->rect = *rectangle; + page_rect->rect = rectangle; girara_list_append(other_rects, page_rect); - g_free(rectangle); } } } From 207f57b33b379fa3c54b642b8d94b548ceeb3271 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 20:50:54 +0100 Subject: [PATCH 105/129] Call parent's finalize Signed-off-by: Sebastian Ramacher --- render.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index a8a7dc7..55f96b7 100644 --- a/render.c +++ b/render.c @@ -155,7 +155,7 @@ renderer_finalize(GObject* object) private_t* priv = GET_PRIVATE(renderer); zathura_renderer_stop(renderer); - if (priv->pool) { + if (priv->pool != NULL) { g_thread_pool_free(priv->pool, TRUE, TRUE); } mutex_free(&(priv->mutex)); @@ -286,6 +286,8 @@ render_request_finalize(GObject* object) } girara_list_free(priv->active_jobs); mutex_free(&priv->jobs_mutex); + + GOBJECT_CLASS(render_request_parent_class)->finalize(object); } /* renderer methods */ From 693f1d713a895757aadac47223e5235852e6b3ee Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 20:51:18 +0100 Subject: [PATCH 106/129] GObject references should be unref'd in dispose Signed-off-by: Sebastian Ramacher --- page-widget.c | 17 +++++++++++++---- render.c | 26 +++++++++++++++++++------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/page-widget.c b/page-widget.c index 2c77b89..ae1cb19 100644 --- a/page-widget.c +++ b/page-widget.c @@ -60,6 +60,7 @@ typedef struct zathura_page_widget_private_s { static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo); static void zathura_page_widget_finalize(GObject* object); +static void zathura_page_widget_dispose(GObject* object); static void zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec); static void zathura_page_widget_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec); static void zathura_page_widget_size_allocate(GtkWidget* widget, GdkRectangle* allocation); @@ -114,6 +115,7 @@ zathura_page_widget_class_init(ZathuraPageClass* class) widget_class->popup_menu = cb_zathura_page_widget_popup_menu; GObjectClass* object_class = G_OBJECT_CLASS(class); + object_class->dispose = zathura_page_widget_dispose; object_class->finalize = zathura_page_widget_finalize; object_class->set_property = zathura_page_widget_set_property; object_class->get_property = zathura_page_widget_get_property; @@ -218,6 +220,17 @@ zathura_page_widget_new(zathura_t* zathura, zathura_page_t* page) return GTK_WIDGET(ret); } +static void +zathura_page_widget_dispose(GObject* object) +{ + ZathuraPage* widget = ZATHURA_PAGE(object); + zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); + + g_clear_object(&priv->render_request); + + G_OBJECT_CLASS(zathura_page_widget_parent_class)->dispose(object); +} + static void zathura_page_widget_finalize(GObject* object) { @@ -228,10 +241,6 @@ zathura_page_widget_finalize(GObject* object) cairo_surface_destroy(priv->surface); } - if (priv->render_request != NULL) { - g_object_unref(priv->render_request); - } - if (priv->search.list != NULL) { girara_list_free(priv->search.list); } diff --git a/render.c b/render.c index 55f96b7..67193f3 100644 --- a/render.c +++ b/render.c @@ -21,6 +21,7 @@ G_DEFINE_TYPE(ZathuraRenderRequest, zathura_render_request, G_TYPE_OBJECT) /* private methods for ZathuraRenderer */ static void renderer_finalize(GObject* object); /* private methods for ZathuraRenderRequest */ +static void render_request_dispose(GObject* object); static void render_request_finalize(GObject* object); static void render_job(void* data, void* user_data); @@ -203,6 +204,7 @@ zathura_render_request_class_init(ZathuraRenderRequestClass* class) /* overwrite methods */ GObjectClass* object_class = G_OBJECT_CLASS(class); + object_class->dispose = render_request_dispose; object_class->finalize = render_request_finalize; request_signals[REQUEST_COMPLETED] = g_signal_new("completed", @@ -269,25 +271,35 @@ zathura_render_request_new(ZathuraRenderer* renderer, zathura_page_t* page) return request; } +static void +render_request_dispose(GObject* object) +{ + ZathuraRenderRequest* request = ZATHURA_RENDER_REQUEST(object); + request_private_t* priv = REQUEST_GET_PRIVATE(request); + + if (priv->renderer != NULL) { + /* unregister the request */ + renderer_unregister_request(priv->renderer, request); + /* release our private reference to the renderer */ + g_clear_object(&priv->renderer); + } + + G_OBJECT_CLASS(zathura_render_request_parent_class)->dispose(object); +} + static void render_request_finalize(GObject* object) { ZathuraRenderRequest* request = ZATHURA_RENDER_REQUEST(object); request_private_t* priv = REQUEST_GET_PRIVATE(request); - if (priv->renderer) { - /* unregister the request */ - renderer_unregister_request(priv->renderer, request); - /* release our private reference to the renderer */ - g_object_unref(priv->renderer); - } if (girara_list_size(priv->active_jobs) != 0) { girara_error("This should not happen!"); } girara_list_free(priv->active_jobs); mutex_free(&priv->jobs_mutex); - GOBJECT_CLASS(render_request_parent_class)->finalize(object); + G_OBJECT_CLASS(zathura_render_request_parent_class)->finalize(object); } /* renderer methods */ From 34b5c556fe8a35f2615d38d4a07bf3af52a48668 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 19 Jan 2014 21:03:40 +0100 Subject: [PATCH 107/129] GObject references should be unref'd in dispose Signed-off-by: Sebastian Ramacher --- database-plain.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/database-plain.c b/database-plain.c index 1825af9..6c9e0a7 100644 --- a/database-plain.c +++ b/database-plain.c @@ -48,6 +48,7 @@ G_DEFINE_TYPE_WITH_CODE(ZathuraPlainDatabase, zathura_plaindatabase, G_TYPE_OBJE G_IMPLEMENT_INTERFACE(ZATHURA_TYPE_DATABASE, zathura_database_interface_init) G_IMPLEMENT_INTERFACE(GIRARA_TYPE_INPUT_HISTORY_IO, io_interface_init)) +static void plain_dispose(GObject* object); static void plain_finalize(GObject* object); static bool plain_add_bookmark(zathura_database_t* db, const char* file, zathura_bookmark_t* bookmark); static bool plain_remove_bookmark(zathura_database_t* db, const char* file, const char* id); @@ -129,6 +130,7 @@ zathura_plaindatabase_class_init(ZathuraPlainDatabaseClass* class) /* override methods */ GObjectClass* object_class = G_OBJECT_CLASS(class); + object_class->dispose = plain_dispose; object_class->finalize = plain_finalize; object_class->set_property = plain_set_property; @@ -282,6 +284,18 @@ plain_set_property(GObject* object, guint prop_id, const GValue* value, GParamSp } } +static void +plain_dispose(GObject* object) +{ + ZathuraPlainDatabase* db = ZATHURA_PLAINDATABASE(object); + zathura_plaindatabase_private_t* priv = ZATHURA_PLAINDATABASE_GET_PRIVATE(db); + + g_clear_object(&priv->bookmark_monitor); + g_clear_object(&priv->history_monitor); + + G_OBJECT_CLASS(zathura_plaindatabase_parent_class)->dispose(object); +} + static void plain_finalize(GObject* object) { @@ -291,10 +305,6 @@ plain_finalize(GObject* object) /* bookmarks */ g_free(priv->bookmark_path); - if (priv->bookmark_monitor != NULL) { - g_object_unref(priv->bookmark_monitor); - } - if (priv->bookmarks != NULL) { g_key_file_free(priv->bookmarks); } @@ -302,10 +312,6 @@ plain_finalize(GObject* object) /* history */ g_free(priv->history_path); - if (priv->history_monitor != NULL) { - g_object_unref(priv->history_monitor); - } - if (priv->history != NULL) { g_key_file_free(priv->history); } From 9c45dd5278ab32808196a46504142e3d17d0be08 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 20 Jan 2014 00:55:39 +0100 Subject: [PATCH 108/129] Fix a return Signed-off-by: Sebastian Ramacher --- marks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marks.c b/marks.c index b0faff5..ac77422 100644 --- a/marks.c +++ b/marks.c @@ -217,7 +217,7 @@ mark_add(zathura_t* zathura, int key) /* add new mark */ zathura_mark_t* mark = g_try_malloc0(sizeof(zathura_mark_t)); if (mark == NULL) { - return NULL; + return; } mark->key = key; From d43e1f07ff707c50bae38077c10981f573be96c5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 20 Jan 2014 01:53:09 +0100 Subject: [PATCH 109/129] Add --synctex-pid option for the case where the process is known Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 135 +++++++++++++++++++++++++++-------------------- dbus-interface.h | 7 ++- main.c | 4 +- zathura.1.rst | 6 ++- 4 files changed, 92 insertions(+), 60 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index b2cf9c2..33fadd2 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -399,9 +399,73 @@ static const GDBusInterfaceVTable interface_vtable = static const unsigned int TIMEOUT = 3000; +static bool +call_hightlight_rects(GDBusConnection* connection, const char* filename, + const char* name, unsigned int page, girara_list_t* rectangles, + girara_list_t* secondary_rects) +{ + GError* error = NULL; + GVariant* vfilename = g_dbus_connection_call_sync(connection, + name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties", + "Get", g_variant_new("(ss)", DBUS_INTERFACE, "filename"), + G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, + TIMEOUT, NULL, &error); + if (vfilename == NULL) { + girara_error("Failed to query 'filename' property from '%s': %s", + name, error->message); + g_error_free(error); + return false; + } + + GVariant* tmp = NULL; + g_variant_get(vfilename, "(v)", &tmp); + gchar* remote_filename = g_variant_dup_string(tmp, NULL); + girara_debug("Filename from '%s': %s", name, remote_filename); + g_variant_unref(tmp); + g_variant_unref(vfilename); + + if (g_strcmp0(filename, remote_filename) != 0) { + g_free(remote_filename); + return false; + } + + g_free(remote_filename); + + GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE("a(dddd)")); + if (rectangles != NULL) { + GIRARA_LIST_FOREACH(rectangles, zathura_rectangle_t*, iter, rect) + g_variant_builder_add(builder, "(dddd)", rect->x1, rect->x2, rect->y1, + rect->y2); + GIRARA_LIST_FOREACH_END(rectangles, zathura_rectangle_t*, iter, rect); + } + + GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(udddd)")); + if (secondary_rects != NULL) { + GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) + g_variant_builder_add(second_builder, "(udddd)", rect->page, + rect->rect.x1, rect->rect.x2, rect->rect.y1, rect->rect.y2); + GIRARA_LIST_FOREACH_END(secondary_rects, synctex_page_rect_t*, iter, rect); + } + + GVariant* ret = g_dbus_connection_call_sync(connection, + name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", + g_variant_new("(ua(dddd)a(udddd))", page, builder, second_builder), + G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); + g_variant_builder_unref(builder); + if (ret == NULL) { + girara_error("Failed to run HighlightRects on '%s': %s", name, + error->message); + g_error_free(error); + return false; + } + + g_variant_unref(ret); + return true; +} + bool zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, - girara_list_t* rectangles, girara_list_t* secondary_rects) + girara_list_t* rectangles, girara_list_t* secondary_rects, pid_t hint) { /* note: page is [1, number_of_pages] here */ @@ -418,6 +482,14 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, return false; } + if (hint != -1) { + char* well_known_name = g_strdup_printf(DBUS_NAME_TEMPLATE, hint); + const bool ret = call_hightlight_rects(connection, filename, + well_known_name, page, rectangles, secondary_rects); + g_free(well_known_name); + return ret; + } + GVariant* vnames = g_dbus_connection_call_sync(connection, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames", NULL, G_VARIANT_TYPE("(as)"), G_DBUS_CALL_FLAGS_NONE, @@ -440,59 +512,9 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, } girara_debug("Found name: %s", name); - GVariant* vfilename = g_dbus_connection_call_sync(connection, - name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties", - "Get", g_variant_new("(ss)", DBUS_INTERFACE, "filename"), - G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, - TIMEOUT, NULL, &error); - if (vfilename == NULL) { - girara_error("Failed to query 'filename' property from '%s': %s", - name, error->message); - g_error_free(error); - continue; - } - - GVariant* tmp = NULL; - g_variant_get(vfilename, "(v)", &tmp); - gchar* remote_filename = g_variant_dup_string(tmp, NULL); - girara_debug("Filename from '%s': %s", name, remote_filename); - g_variant_unref(tmp); - g_variant_unref(vfilename); - - if (g_strcmp0(filename, remote_filename) != 0) { - g_free(remote_filename); - continue; - } - - g_free(remote_filename); - found_one = true; - - GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE("a(dddd)")); - if (rectangles != NULL) { - GIRARA_LIST_FOREACH(rectangles, zathura_rectangle_t*, iter, rect) - g_variant_builder_add(builder, "(dddd)", rect->x1, rect->x2, rect->y1, - rect->y2); - GIRARA_LIST_FOREACH_END(rectangles, zathura_rectangle_t*, iter, rect); - } - - GVariantBuilder* second_builder = g_variant_builder_new(G_VARIANT_TYPE("a(udddd)")); - if (secondary_rects != NULL) { - GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) - g_variant_builder_add(second_builder, "(udddd)", rect->page, - rect->rect.x1, rect->rect.x2, rect->rect.y1, rect->rect.y2); - GIRARA_LIST_FOREACH_END(secondary_rects, synctex_page_rect_t*, iter, rect); - } - - GVariant* ret = g_dbus_connection_call_sync(connection, - name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", - g_variant_new("(ua(dddd)a(udddd))", page, builder, second_builder), - G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); - g_variant_builder_unref(builder); - if (ret == NULL) { - girara_error("Failed to run HighlightRects on '%s': %s", name, error->message); - g_error_free(error); - } else { - g_variant_unref(ret); + if (call_hightlight_rects(connection, filename, name, page, rectangles, + secondary_rects) == true) { + found_one = true; } } g_variant_iter_free(iter); @@ -503,7 +525,8 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, } bool -zathura_dbus_synctex_position(const char* filename, const char* position) +zathura_dbus_synctex_position(const char* filename, const char* position, + pid_t hint) { if (filename == NULL || position == NULL) { return false; @@ -518,7 +541,7 @@ zathura_dbus_synctex_position(const char* filename, const char* position) } const bool ret = zathura_dbus_goto_page_and_highlight(filename, page, - rectangles, secondary_rects); + rectangles, secondary_rects, hint); girara_list_free(rectangles); girara_list_free(secondary_rects); return ret; diff --git a/dbus-interface.h b/dbus-interface.h index 6f9b0cd..4e0f929 100644 --- a/dbus-interface.h +++ b/dbus-interface.h @@ -6,6 +6,7 @@ #include #include #include +#include #include "types.h" typedef struct zathura_dbus_class_s ZathuraDbusClass; @@ -53,8 +54,10 @@ ZathuraDbus* zathura_dbus_new(zathura_t* zathura); * otherwise */ bool zathura_dbus_goto_page_and_highlight(const char* filename, - unsigned int page,girara_list_t* rectangles, girara_list_t* secondary_rects); + unsigned int page, girara_list_t* rectangles, girara_list_t* secondary_rects, + pid_t pidhint); -bool zathura_dbus_synctex_position(const char* filename, const char* position); +bool zathura_dbus_synctex_position(const char* filename, const char* position, + pid_t pidhint); #endif diff --git a/main.c b/main.c index 733a192..104d6b0 100644 --- a/main.c +++ b/main.c @@ -49,6 +49,7 @@ main(int argc, char* argv[]) bool print_version = false; bool synctex = false; int page_number = ZATHURA_PAGE_NUMBER_UNSPECIFIED; + int synctex_pid = -1; Window embed = 0; GOptionEntry entries[] = { @@ -64,6 +65,7 @@ main(int argc, char* argv[]) { "synctex", 's', 0, G_OPTION_ARG_NONE, &synctex, _("Enable synctex support"), NULL }, { "synctex-editor-command", 'x', 0, G_OPTION_ARG_STRING, &synctex_editor, _("Synctex editor (forwarded to the synctex command)"), "cmd" }, { "synctex-forward", '\0', 0, G_OPTION_ARG_STRING, &synctex_fwd, _("Move to given synctex position"), "position" }, + { "synctex-pid", '\0', 0, G_OPTION_ARG_INT, &synctex_pid, _("Highlight given position in the given process"), "pid" }, { NULL, '\0', 0, 0, NULL, NULL, NULL } }; @@ -101,7 +103,7 @@ main(int argc, char* argv[]) return -1; } - if (zathura_dbus_synctex_position(real_path, synctex_fwd) == true) { + if (zathura_dbus_synctex_position(real_path, synctex_fwd, synctex_pid) == true) { free(real_path); return 0; } else { diff --git a/zathura.1.rst b/zathura.1.rst index 7c06ae7..d8c02e2 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -59,10 +59,14 @@ OPTIONS -x [cmd], --synctex-editor-command [cmd] Set the synctex editor command ---syntex-forward [input], +--synctex-forward [input] Jump to the given position. The switch expcects the same format as specified for syntex's view -i. +--synctex-pid [pid] + If not -1, forward synctex input to process with the given pid. Otherwise, try + all zathura process to find the correct one. + MOUSE AND KEY BINDINGS ====================== From 3e5d7816c2be24bf8edb5c6daa25328fee5d6e7d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 20 Jan 2014 16:31:53 +0100 Subject: [PATCH 110/129] More documentation for synctex support Signed-off-by: Sebastian Ramacher --- zathura.1.rst | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zathura.1.rst b/zathura.1.rst index d8c02e2..3222359 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -54,10 +54,10 @@ OPTIONS Set log debug level (debug, info, warning, error) -s, --synctex - Enable synctex support + Enable synctex support for backwards synchronization. -x [cmd], --synctex-editor-command [cmd] - Set the synctex editor command + Set the synctex editor command for backwards synchronization. --synctex-forward [input] Jump to the given position. The switch expcects the same format as specified @@ -217,6 +217,17 @@ The default appearance and behaviour of zathura can be overwritten by modifying the *zathurarc* file (default path: ~/.config/zathura/zathurarc). For a detailed description please consult zathurarc(5). +SYNCTEX SUPPORT +=============== +Both synctex forward and backwards synchronization are supported by zathura, To +enable synctex forward synchronization, please look at the *--syntex* and +*--synctex-editor* options. To support synctex backwards synchronization, +zathura provides a D-Bus interface that can be called by the editor. For +convince zathura also knows how to parse the output of the *synctex view* +command. It is enough to pass the arguments to *synctex view*'s *-i* option to +zathura via *--syntex-forward* and zathura will pass the information to the +correct instance. + KNOWN BUGS ========== If GDK_NATIVE_WINDOWS is enabled you will experience problems with large From bb47adb270248f8cf7e8423a1c9ac83ec695d022 Mon Sep 17 00:00:00 2001 From: akbjker Date: Sun, 19 Jan 2014 20:29:40 -0500 Subject: [PATCH 111/129] Center pages Whoops, you're right. I misunderstood the purpose of gtk_widget_reparent. Here's the patch v2. Signed-off-by: Sebastian Ramacher --- zathura.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/zathura.c b/zathura.c index 75aabc5..49a78b0 100644 --- a/zathura.c +++ b/zathura.c @@ -717,6 +717,7 @@ document_open(zathura_t* zathura, const char* path, const char* password, goto error_free; } + g_object_ref(page_widget); zathura->pages[page_id] = page_widget; g_signal_connect(G_OBJECT(page_widget), "text-selected", @@ -951,7 +952,6 @@ document_close(zathura_t* zathura, bool keep_monitor) gtk_container_foreach(GTK_CONTAINER(zathura->ui.page_widget), remove_page_from_table, (gpointer) 1); for (unsigned int i = 0; i < zathura_document_get_number_of_pages(zathura->document); i++) { g_object_unref(zathura->pages[i]); - g_object_unref(zathura->pages[i]); // FIXME } free(zathura->pages); zathura->pages = NULL; @@ -1068,9 +1068,18 @@ page_widget_set_mode(zathura_t* zathura, unsigned int page_padding, int x = (i + first_page_column - 1) % pages_per_row; int y = (i + first_page_column - 1) / pages_per_row; - zathura_page_t* page = zathura_document_get_page(zathura->document, i); - GtkWidget* page_widget = zathura_page_get_widget(zathura, page); - gtk_grid_attach(GTK_GRID(zathura->ui.page_widget), page_widget, x, y, 1, 1); + GtkWidget* page_widget = zathura->pages[i]; + + GtkWidget* align = gtk_alignment_new(0.5, 0.5, 0, 0); + GtkWidget* parent = gtk_widget_get_parent(page_widget); + if (parent) + { + gtk_container_remove(GTK_CONTAINER(parent), page_widget); + g_object_unref(parent); + } + + gtk_container_add(GTK_CONTAINER(align), page_widget); + gtk_grid_attach(GTK_GRID(zathura->ui.page_widget), align, x, y, 1, 1); } gtk_widget_show_all(zathura->ui.page_widget); From 71e10b5f3c558d6cfcf88515e12840e09d7975a6 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 20 Jan 2014 17:31:46 +0100 Subject: [PATCH 112/129] Add a cast Signed-off-by: Sebastian Ramacher --- zathura.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zathura.c b/zathura.c index 49a78b0..2373d6c 100644 --- a/zathura.c +++ b/zathura.c @@ -870,7 +870,7 @@ document_save(zathura_t* zathura, const char* path, bool overwrite) static void remove_page_from_table(GtkWidget* page, gpointer permanent) { - if (permanent == false) { + if ((bool)permanent == false) { g_object_ref(G_OBJECT(page)); } @@ -949,7 +949,7 @@ document_close(zathura_t* zathura, bool keep_monitor) zathura->sync.render_thread = NULL; /* remove widgets */ - gtk_container_foreach(GTK_CONTAINER(zathura->ui.page_widget), remove_page_from_table, (gpointer) 1); + gtk_container_foreach(GTK_CONTAINER(zathura->ui.page_widget), remove_page_from_table, (gpointer) true); for (unsigned int i = 0; i < zathura_document_get_number_of_pages(zathura->document); i++) { g_object_unref(zathura->pages[i]); } From 935964bbf5b617cabe0a02471e5942ac3bba7cdf Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 20 Jan 2014 18:06:38 +0100 Subject: [PATCH 113/129] Remove unused zathura_adjustment_clone Signed-off-by: Sebastian Ramacher --- adjustment.c | 14 -------------- adjustment.h | 11 ----------- 2 files changed, 25 deletions(-) diff --git a/adjustment.c b/adjustment.c index af07009..8d2b513 100644 --- a/adjustment.c +++ b/adjustment.c @@ -146,20 +146,6 @@ page_is_visible(zathura_document_t *document, unsigned int page_number) fabs(pos_y - page_y) < 0.5 * (double)(view_height + cell_height) / (double)doc_height); } -GtkAdjustment* -zathura_adjustment_clone(GtkAdjustment* adjustment) -{ - gdouble value = gtk_adjustment_get_value(adjustment); - gdouble lower = gtk_adjustment_get_lower(adjustment); - gdouble upper = gtk_adjustment_get_upper(adjustment); - gdouble step_increment = gtk_adjustment_get_step_increment(adjustment); - gdouble page_increment = gtk_adjustment_get_page_increment(adjustment); - gdouble page_size = gtk_adjustment_get_page_size(adjustment); - - return GTK_ADJUSTMENT(gtk_adjustment_new(value, lower, upper, step_increment, - page_increment, page_size)); -} - void zathura_adjustment_set_value(GtkAdjustment* adjustment, gdouble value) { diff --git a/adjustment.h b/adjustment.h index 96ceb4c..b62e7ca 100644 --- a/adjustment.h +++ b/adjustment.h @@ -69,17 +69,6 @@ void page_number_to_position(zathura_document_t* document, unsigned int page_num */ bool page_is_visible(zathura_document_t *document, unsigned int page_number); -/** - * Clone a GtkAdjustment - * - * Creates a new adjustment with the same value, lower and upper bounds, step - * and page increments and page_size as the original adjustment. - * - * @param adjustment Adjustment instance to be cloned - * @return Pointer to the new adjustment - */ -GtkAdjustment* zathura_adjustment_clone(GtkAdjustment* adjustment); - /** * Set the adjustment value while enforcing its limits * From 76e456ef4cbc0d14d3fbe2555c9ac699005762e1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 28 Jan 2014 18:32:07 +0100 Subject: [PATCH 114/129] Expose more properties via D-Bus Thanks to Ork for the initial patch. Signed-off-by: Sebastian Ramacher --- data/org.pwmt.zathura.xml | 2 ++ dbus-interface.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/data/org.pwmt.zathura.xml b/data/org.pwmt.zathura.xml index f8c6a7a..bfa81a2 100644 --- a/data/org.pwmt.zathura.xml +++ b/data/org.pwmt.zathura.xml @@ -26,5 +26,7 @@ + + diff --git a/dbus-interface.c b/dbus-interface.c index 33fadd2..f0be98c 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -379,12 +379,17 @@ handle_get_property(GDBusConnection* UNUSED(connection), ZathuraDbus* dbus = data; private_t* priv = GET_PRIVATE(dbus); + if (priv->zathura->document == NULL) { + g_set_error(error, G_IO_ERROR, G_IO_ERROR_FAILED, "No document open."); + return NULL; + } + if (g_strcmp0(property_name, "filename") == 0) { - if (priv->zathura->document == NULL) { - g_set_error(error, G_IO_ERROR, G_IO_ERROR_FAILED, "No document open."); - } else { - return g_variant_new_string(zathura_document_get_path(priv->zathura->document)); - } + return g_variant_new_string(zathura_document_get_path(priv->zathura->document)); + } else if (g_strcmp0(property_name, "pagenumber") == 0) { + return g_variant_new_uint32(zathura_document_get_current_page_number(priv->zathura->document)); + } else if (g_strcmp0(property_name, "numberofpages") == 0) { + return g_variant_new_uint32(zathura_document_get_number_of_pages(priv->zathura->document)); } return NULL; From ace31581b47c3cce4e9731f4f05f6bc27418b82a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 29 Jan 2014 20:59:45 +0100 Subject: [PATCH 115/129] Add --mode option Signed-off-by: Sebastian Ramacher --- commands.c | 2 +- main.c | 10 +++++++++- zathura.1.rst | 3 +++ zathura.c | 16 +++++++++++++++- zathura.h | 3 ++- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/commands.c b/commands.c index 055989a..a8882c0 100644 --- a/commands.c +++ b/commands.c @@ -239,7 +239,7 @@ cmd_open(girara_session_t* session, girara_list_t* argument_list) } document_open(zathura, girara_list_nth(argument_list, 0), - (argc == 2) ? girara_list_nth(argument_list, 1) : NULL, + (argc == 2) ? girara_list_nth(argument_list, 1) : NULL, ZATHURA_PAGE_NUMBER_UNSPECIFIED); } else { girara_notify(session, GIRARA_ERROR, _("No arguments given.")); diff --git a/main.c b/main.c index 104d6b0..fa2b484 100644 --- a/main.c +++ b/main.c @@ -45,6 +45,7 @@ main(int argc, char* argv[]) gchar* password = NULL; gchar* synctex_editor = NULL; gchar* synctex_fwd = NULL; + gchar* mode = NULL; bool forkback = false; bool print_version = false; bool synctex = false; @@ -66,6 +67,7 @@ main(int argc, char* argv[]) { "synctex-editor-command", 'x', 0, G_OPTION_ARG_STRING, &synctex_editor, _("Synctex editor (forwarded to the synctex command)"), "cmd" }, { "synctex-forward", '\0', 0, G_OPTION_ARG_STRING, &synctex_fwd, _("Move to given synctex position"), "position" }, { "synctex-pid", '\0', 0, G_OPTION_ARG_INT, &synctex_pid, _("Highlight given position in the given process"), "pid" }, + { "mode", '\0', 0, G_OPTION_ARG_STRING, &mode, _("Start in a non-default mode"), "mode" }, { NULL, '\0', 0, 0, NULL, NULL, NULL } }; @@ -91,6 +93,7 @@ main(int argc, char* argv[]) girara_set_debug_level(GIRARA_ERROR); } + /* handle synctex forward synchronization */ if (synctex_fwd != NULL) { if (argc != 2) { girara_error("Too many arguments or missing filename while running with --synctex-forward"); @@ -113,6 +116,11 @@ main(int argc, char* argv[]) } } + /* check mode */ + if (mode != NULL && g_strcmp0(mode, "presentation") != 0 && g_strcmp0(mode, "fullscreen") != 0) { + girara_error("Invalid argument for --mode: %s", mode); + return -1; + } /* Fork into the background if the user really wants to ... */ if (forkback == true) { @@ -164,7 +172,7 @@ main(int argc, char* argv[]) if (argc > 1) { if (page_number > 0) --page_number; - document_open_idle(zathura, argv[1], password, page_number); + document_open_idle(zathura, argv[1], password, page_number, mode); /* open additional files */ for (int i = 2; i < argc; i++) { diff --git a/zathura.1.rst b/zathura.1.rst index 3222359..18f704a 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -67,6 +67,9 @@ OPTIONS If not -1, forward synctex input to process with the given pid. Otherwise, try all zathura process to find the correct one. +--mode [mode] + Switch to mode (presentation, fullscreen) after opening a document. + MOUSE AND KEY BINDINGS ====================== diff --git a/zathura.c b/zathura.c index 2373d6c..842cde2 100644 --- a/zathura.c +++ b/zathura.c @@ -41,6 +41,7 @@ typedef struct zathura_document_info_s { const char* path; const char* password; int page_number; + const char* mode; } zathura_document_info_t; @@ -481,6 +482,18 @@ document_info_open(gpointer data) document_open(document_info->zathura, file, document_info->password, document_info->page_number); g_free(file); + + if (document_info->mode != NULL) { + if (g_strcmp0(document_info->mode, "presentation") == 0) { + sc_toggle_presentation(document_info->zathura->ui.session, NULL, NULL, + 0); + } else if (g_strcmp0(document_info->mode, "fullscreen") == 0) { + sc_toggle_fullscreen(document_info->zathura->ui.session, NULL, NULL, + 0); + } else { + girara_error("Unknown mode: %s", document_info->mode); + } + } } } @@ -819,7 +832,7 @@ error_out: void document_open_idle(zathura_t* zathura, const char* path, const char* password, - int page_number) + int page_number, const char* mode) { if (zathura == NULL || path == NULL) { return; @@ -834,6 +847,7 @@ document_open_idle(zathura_t* zathura, const char* path, const char* password, document_info->path = path; document_info->password = password; document_info->page_number = page_number; + document_info->mode = mode; gdk_threads_add_idle(document_info_open, document_info); } diff --git a/zathura.h b/zathura.h index 00f7852..bc77e83 100644 --- a/zathura.h +++ b/zathura.h @@ -304,7 +304,8 @@ bool document_open(zathura_t* zathura, const char* path, const char* password, * @param password The password of the file */ void document_open_idle(zathura_t* zathura, const char* path, - const char* password, int page_number); + const char* password, int page_number, + const char* mode); /** * Save a open file From eea53de243d361ade256aee0552d862ea3b7284e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 30 Jan 2014 22:42:28 +0100 Subject: [PATCH 116/129] Correctly safe print setting state Since we are running the operation asynchronsly, we need to store the print settings in a callback for the done signal. Signed-off-by: Sebastian Ramacher --- print.c | 63 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/print.c b/print.c index 3ac1fd8..95ef057 100644 --- a/print.c +++ b/print.c @@ -7,14 +7,19 @@ #include #include +#include static void cb_print_draw_page(GtkPrintOperation* print_operation, - GtkPrintContext* context, gint page_number, zathura_t* zathura); + GtkPrintContext* context, gint page_number, + zathura_t* zathura); static void cb_print_end(GtkPrintOperation* print_operation, GtkPrintContext* context, zathura_t* zathura); static void cb_print_request_page_setup(GtkPrintOperation* print_operation, - GtkPrintContext* context, gint page_number, GtkPageSetup* setup, zathura_t* - zathura); + GtkPrintContext* context, + gint page_number, GtkPageSetup* setup, + zathura_t* zathura); +static void cb_print_done(GtkPrintOperation* operation, + GtkPrintOperationResult result, zathura_t* zathura); void print(zathura_t* zathura) @@ -25,6 +30,12 @@ print(zathura_t* zathura) GtkPrintOperation* print_operation = gtk_print_operation_new(); /* print operation settings */ + gtk_print_operation_set_job_name(print_operation, zathura_document_get_path(zathura->document)); + gtk_print_operation_set_allow_async(print_operation, TRUE); + gtk_print_operation_set_n_pages(print_operation, zathura_document_get_number_of_pages(zathura->document)); + gtk_print_operation_set_current_page(print_operation, zathura_document_get_current_page_number(zathura->document)); + gtk_print_operation_set_use_full_page(print_operation, TRUE); + if (zathura->print.settings != NULL) { gtk_print_operation_set_print_settings(print_operation, zathura->print.settings); } @@ -32,35 +43,20 @@ print(zathura_t* zathura) if (zathura->print.page_setup != NULL) { gtk_print_operation_set_default_page_setup(print_operation, zathura->print.page_setup); } - - gtk_print_operation_set_allow_async(print_operation, TRUE); - gtk_print_operation_set_n_pages(print_operation, zathura_document_get_number_of_pages(zathura->document)); - gtk_print_operation_set_current_page(print_operation, zathura_document_get_current_page_number(zathura->document)); - gtk_print_operation_set_use_full_page(print_operation, TRUE); gtk_print_operation_set_embed_page_setup(print_operation, TRUE); /* print operation signals */ g_signal_connect(print_operation, "draw-page", G_CALLBACK(cb_print_draw_page), zathura); g_signal_connect(print_operation, "end-print", G_CALLBACK(cb_print_end), zathura); g_signal_connect(print_operation, "request-page-setup", G_CALLBACK(cb_print_request_page_setup), zathura); + g_signal_connect(print_operation, "done", G_CALLBACK(cb_print_done), zathura); /* print */ GtkPrintOperationResult result = gtk_print_operation_run(print_operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL); - if (result == GTK_PRINT_OPERATION_RESULT_APPLY) { - if (zathura->print.settings != NULL) { - g_object_unref(zathura->print.settings); - } - if (zathura->print.page_setup != NULL) { - g_object_unref(zathura->print.page_setup); - } - - /* save previous settings */ - zathura->print.settings = g_object_ref(gtk_print_operation_get_print_settings(print_operation)); - zathura->print.page_setup = g_object_ref(gtk_print_operation_get_default_page_setup(print_operation)); - } else if (result == GTK_PRINT_OPERATION_RESULT_ERROR) { - girara_error("Error pccurred while printing progress"); + if (result == GTK_PRINT_OPERATION_RESULT_ERROR) { + girara_error("Error occurred while printing progress"); } g_object_unref(print_operation); @@ -185,3 +181,28 @@ cb_print_request_page_setup(GtkPrintOperation* UNUSED(print_operation), gtk_page_setup_set_orientation(setup, GTK_PAGE_ORIENTATION_PORTRAIT); } } + +static void +cb_print_done(GtkPrintOperation* operation, GtkPrintOperationResult result, + zathura_t* zathura) +{ + if (result == GTK_PRINT_OPERATION_RESULT_APPLY) { + if (zathura->print.settings != NULL) { + g_object_unref(zathura->print.settings); + } + if (zathura->print.page_setup != NULL) { + g_object_unref(zathura->print.page_setup); + } + + /* save previous settings */ + zathura->print.settings = g_object_ref(gtk_print_operation_get_print_settings(operation)); + zathura->print.page_setup = g_object_ref(gtk_print_operation_get_default_page_setup(operation)); + } else if (result == GTK_PRINT_OPERATION_RESULT_ERROR) { + GError* error = NULL; + gtk_print_operation_get_error(operation, &error); + girara_notify(zathura->ui.session, GIRARA_ERROR, "Printing failed: %s", + error->message); + g_error_free(error); + } +} + From ac8be2d528aaa2cd7e1d56982036a20796c31153 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 31 Jan 2014 10:19:27 +0100 Subject: [PATCH 117/129] Translate error messages Signed-off-by: Sebastian Ramacher --- print.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/print.c b/print.c index 95ef057..4b51b44 100644 --- a/print.c +++ b/print.c @@ -8,6 +8,7 @@ #include #include #include +#include static void cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* context, gint page_number, @@ -52,11 +53,15 @@ print(zathura_t* zathura) g_signal_connect(print_operation, "done", G_CALLBACK(cb_print_done), zathura); /* print */ + GError* error = NULL; GtkPrintOperationResult result = gtk_print_operation_run(print_operation, - GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL); + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, + NULL, &error); if (result == GTK_PRINT_OPERATION_RESULT_ERROR) { - girara_error("Error occurred while printing progress"); + girara_notify(zathura->ui.session, GIRARA_ERROR, _("Printing failed: %s"), + error->message); + g_error_free(error); } g_object_unref(print_operation); @@ -200,7 +205,7 @@ cb_print_done(GtkPrintOperation* operation, GtkPrintOperationResult result, } else if (result == GTK_PRINT_OPERATION_RESULT_ERROR) { GError* error = NULL; gtk_print_operation_get_error(operation, &error); - girara_notify(zathura->ui.session, GIRARA_ERROR, "Printing failed: %s", + girara_notify(zathura->ui.session, GIRARA_ERROR, _("Printing failed: %s"), error->message); g_error_free(error); } From a45cd0a4740810493f99bd0ffc28115101198aee Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 31 Jan 2014 10:33:25 +0100 Subject: [PATCH 118/129] CS Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 108 +++++++++++++++++++++++++---------------------- print.c | 9 ++-- 2 files changed, 63 insertions(+), 54 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index f0be98c..00f96c0 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -35,8 +35,7 @@ typedef struct private_s { } private_t; #define GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_DBUS, \ - private_t)) + (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_DBUS, private_t)) static const GDBusInterfaceVTable interface_vtable; @@ -92,12 +91,12 @@ bus_acquired(GDBusConnection* connection, const gchar* name, void* data) private_t* priv = GET_PRIVATE(dbus); GError* error = NULL; - priv->registration_id = g_dbus_connection_register_object(connection, - DBUS_OBJPATH, priv->introspection_data->interfaces[0], + priv->registration_id = g_dbus_connection_register_object( + connection, DBUS_OBJPATH, priv->introspection_data->interfaces[0], &interface_vtable, dbus, NULL, &error); if (priv->registration_id == 0) { girara_warning("Failed to register object on D-Bus connection: %s", - error->message); + error->message); g_error_free(error); return; } @@ -107,17 +106,17 @@ bus_acquired(GDBusConnection* connection, const gchar* name, void* data) static void name_acquired(GDBusConnection* UNUSED(connection), const gchar* name, - void* UNUSED(data)) + void* UNUSED(data)) { girara_debug("Acquired '%s' on session bus.", name); } static void name_lost(GDBusConnection* UNUSED(connection), const gchar* name, - void* UNUSED(data)) + void* UNUSED(data)) { girara_debug("Lost connection or failed to acquire '%s' on session bus.", - name); + name); } ZathuraDbus* @@ -133,7 +132,8 @@ zathura_dbus_new(zathura_t* zathura) priv->zathura = zathura; GError* error = NULL; - priv->introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTERFACE_XML, &error); + priv->introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTERFACE_XML, + &error); if (priv->introspection_data == NULL) { girara_warning("Failed to parse introspection data: %s", error->message); g_error_free(error); @@ -142,9 +142,9 @@ zathura_dbus_new(zathura_t* zathura) } char* well_known_name = g_strdup_printf(DBUS_NAME_TEMPLATE, getpid()); - priv->owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, - well_known_name, G_BUS_NAME_OWNER_FLAGS_NONE, bus_acquired, - name_acquired, name_lost, dbus, NULL); + priv->owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, well_known_name, + G_BUS_NAME_OWNER_FLAGS_NONE, bus_acquired, + name_acquired, name_lost, dbus, NULL); g_free(well_known_name); return dbus; @@ -162,7 +162,7 @@ highlight_rects(zathura_t* zathura, unsigned int page, GObject* widget = G_OBJECT(zathura->pages[p]); g_object_set(widget, "draw-links", FALSE, "search-results", rectangles[p], - NULL); + NULL); if (p == page) { g_object_set(widget, "search-current", 0, NULL); } @@ -216,10 +216,10 @@ highlight_rects(zathura_t* zathura, unsigned int page, static void handle_method_call(GDBusConnection* UNUSED(connection), - const gchar* UNUSED(sender), const gchar* object_path, - const gchar* interface_name, - const gchar* method_name, GVariant* parameters, - GDBusMethodInvocation* invocation, void* data) + const gchar* UNUSED(sender), const gchar* object_path, + const gchar* interface_name, const gchar* method_name, + GVariant* parameters, GDBusMethodInvocation* invocation, + void* data) { ZathuraDbus* dbus = data; private_t* priv = GET_PRIVATE(dbus); @@ -236,7 +236,8 @@ handle_method_call(GDBusConnection* UNUSED(connection), document_close(priv->zathura, false); const bool ret = document_open(priv->zathura, filename, - strlen(password) > 0 ? password : NULL, page); + strlen(password) > 0 ? password : NULL, + page); g_free(filename); g_free(password); @@ -253,7 +254,8 @@ handle_method_call(GDBusConnection* UNUSED(connection), if (priv->zathura->document == NULL) { g_dbus_method_invocation_return_dbus_error(invocation, - "org.pwmt.zathura.NoOpenDocumen", "No document has been opened."); + "org.pwmt.zathura.NoOpenDocumen", + "No document has been opened."); return; } @@ -278,7 +280,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), GVariantIter* iter = NULL; GVariantIter* secondary_iter = NULL; g_variant_get(parameters, "(ua(dddd)a(udddd))", &page, &iter, - &secondary_iter); + &secondary_iter); if (page >= number_of_pages) { GVariant* result = g_variant_new("(b)", false); @@ -312,7 +314,7 @@ handle_method_call(GDBusConnection* UNUSED(connection), zathura_rectangle_t temp_rect; while (g_variant_iter_loop(iter, "(dddd)", &temp_rect.x1, &temp_rect.x2, - &temp_rect.y1, &temp_rect.y2)) { + &temp_rect.y1, &temp_rect.y2)) { zathura_rectangle_t* rect = g_try_malloc0(sizeof(zathura_rectangle_t)); if (rect == NULL) { g_variant_iter_free(iter); @@ -333,9 +335,11 @@ handle_method_call(GDBusConnection* UNUSED(connection), /* get secondary rectangles */ guint temp_page = 0; while (g_variant_iter_loop(secondary_iter, "(udddd)", &temp_page, - &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, &temp_rect.y2)) { + &temp_rect.x1, &temp_rect.x2, &temp_rect.y1, + &temp_rect.y2)) { if (temp_page >= number_of_pages) { /* error out here? */ + girara_debug("Got invalid page number."); continue; } @@ -372,9 +376,10 @@ handle_method_call(GDBusConnection* UNUSED(connection), static GVariant* handle_get_property(GDBusConnection* UNUSED(connection), - const gchar* UNUSED(sender), const gchar* UNUSED(object_path), - const gchar* UNUSED(interface_name), const gchar* property_name, - GError** error, void* data) + const gchar* UNUSED(sender), + const gchar* UNUSED(object_path), + const gchar* UNUSED(interface_name), + const gchar* property_name, GError** error, void* data) { ZathuraDbus* dbus = data; private_t* priv = GET_PRIVATE(dbus); @@ -406,18 +411,17 @@ static const unsigned int TIMEOUT = 3000; static bool call_hightlight_rects(GDBusConnection* connection, const char* filename, - const char* name, unsigned int page, girara_list_t* rectangles, - girara_list_t* secondary_rects) + const char* name, unsigned int page, + girara_list_t* rectangles, girara_list_t* secondary_rects) { GError* error = NULL; - GVariant* vfilename = g_dbus_connection_call_sync(connection, - name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties", - "Get", g_variant_new("(ss)", DBUS_INTERFACE, "filename"), - G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, - TIMEOUT, NULL, &error); + GVariant* vfilename = g_dbus_connection_call_sync( + connection, name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties", "Get", + g_variant_new("(ss)", DBUS_INTERFACE, "filename"), G_VARIANT_TYPE("(v)"), + G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); if (vfilename == NULL) { girara_error("Failed to query 'filename' property from '%s': %s", - name, error->message); + name, error->message); g_error_free(error); return false; } @@ -440,7 +444,7 @@ call_hightlight_rects(GDBusConnection* connection, const char* filename, if (rectangles != NULL) { GIRARA_LIST_FOREACH(rectangles, zathura_rectangle_t*, iter, rect) g_variant_builder_add(builder, "(dddd)", rect->x1, rect->x2, rect->y1, - rect->y2); + rect->y2); GIRARA_LIST_FOREACH_END(rectangles, zathura_rectangle_t*, iter, rect); } @@ -448,14 +452,15 @@ call_hightlight_rects(GDBusConnection* connection, const char* filename, if (secondary_rects != NULL) { GIRARA_LIST_FOREACH(secondary_rects, synctex_page_rect_t*, iter, rect) g_variant_builder_add(second_builder, "(udddd)", rect->page, - rect->rect.x1, rect->rect.x2, rect->rect.y1, rect->rect.y2); + rect->rect.x1, rect->rect.x2, rect->rect.y1, + rect->rect.y2); GIRARA_LIST_FOREACH_END(secondary_rects, synctex_page_rect_t*, iter, rect); } - GVariant* ret = g_dbus_connection_call_sync(connection, - name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", - g_variant_new("(ua(dddd)a(udddd))", page, builder, second_builder), - G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); + GVariant* ret = g_dbus_connection_call_sync( + connection, name, DBUS_OBJPATH, DBUS_INTERFACE, "HighlightRects", + g_variant_new("(ua(dddd)a(udddd))", page, builder, second_builder), + G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); g_variant_builder_unref(builder); if (ret == NULL) { girara_error("Failed to run HighlightRects on '%s': %s", name, @@ -470,10 +475,9 @@ call_hightlight_rects(GDBusConnection* connection, const char* filename, bool zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, - girara_list_t* rectangles, girara_list_t* secondary_rects, pid_t hint) + girara_list_t* rectangles, + girara_list_t* secondary_rects, pid_t hint) { - /* note: page is [1, number_of_pages] here */ - if (filename == NULL) { return false; } @@ -490,15 +494,16 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, if (hint != -1) { char* well_known_name = g_strdup_printf(DBUS_NAME_TEMPLATE, hint); const bool ret = call_hightlight_rects(connection, filename, - well_known_name, page, rectangles, secondary_rects); + well_known_name, page, rectangles, + secondary_rects); g_free(well_known_name); return ret; } - GVariant* vnames = g_dbus_connection_call_sync(connection, - "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", - "ListNames", NULL, G_VARIANT_TYPE("(as)"), G_DBUS_CALL_FLAGS_NONE, - TIMEOUT, NULL, &error); + GVariant* vnames = g_dbus_connection_call_sync( + connection, "org.freedesktop.DBus", "/org/freedesktop/DBus", + "org.freedesktop.DBus", "ListNames", NULL, G_VARIANT_TYPE("(as)"), + G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error); if (vnames == NULL) { girara_error("Could not list available names: %s", error->message); g_error_free(error); @@ -518,7 +523,7 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, girara_debug("Found name: %s", name); if (call_hightlight_rects(connection, filename, name, page, rectangles, - secondary_rects) == true) { + secondary_rects) == true) { found_one = true; } } @@ -539,14 +544,15 @@ zathura_dbus_synctex_position(const char* filename, const char* position, unsigned int page = 0; girara_list_t* secondary_rects = NULL; - girara_list_t* rectangles = synctex_rectangles_from_position(filename, - position, &page, &secondary_rects); + girara_list_t* rectangles = synctex_rectangles_from_position( + filename, position, &page, &secondary_rects); if (rectangles == NULL) { return false; } const bool ret = zathura_dbus_goto_page_and_highlight(filename, page, - rectangles, secondary_rects, hint); + rectangles, + secondary_rects, hint); girara_list_free(rectangles); girara_list_free(secondary_rects); return ret; diff --git a/print.c b/print.c index 4b51b44..3bf91d0 100644 --- a/print.c +++ b/print.c @@ -38,11 +38,13 @@ print(zathura_t* zathura) gtk_print_operation_set_use_full_page(print_operation, TRUE); if (zathura->print.settings != NULL) { - gtk_print_operation_set_print_settings(print_operation, zathura->print.settings); + gtk_print_operation_set_print_settings(print_operation, + zathura->print.settings); } if (zathura->print.page_setup != NULL) { - gtk_print_operation_set_default_page_setup(print_operation, zathura->print.page_setup); + gtk_print_operation_set_default_page_setup(print_operation, + zathura->print.page_setup); } gtk_print_operation_set_embed_page_setup(print_operation, TRUE); @@ -71,7 +73,8 @@ static void cb_print_end(GtkPrintOperation* UNUSED(print_operation), GtkPrintContext* UNUSED(context), zathura_t* zathura) { - if (zathura == NULL || zathura->ui.session == NULL || zathura->document == NULL) { + if (zathura == NULL || zathura->ui.session == NULL || + zathura->document == NULL) { return; } From f2fbf92621f67abb32fb0102c2cee4538e250d5b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 31 Jan 2014 10:37:16 +0100 Subject: [PATCH 119/129] Update po Signed-off-by: Sebastian Ramacher --- po/ca.po | 215 ++++++++++++++++++++++++++---------------------- po/cs.po | 215 ++++++++++++++++++++++++++---------------------- po/de.po | 215 ++++++++++++++++++++++++++---------------------- po/el.po | 215 ++++++++++++++++++++++++++---------------------- po/eo.po | 215 ++++++++++++++++++++++++++---------------------- po/es.po | 215 ++++++++++++++++++++++++++---------------------- po/es_CL.po | 215 ++++++++++++++++++++++++++---------------------- po/et.po | 215 ++++++++++++++++++++++++++---------------------- po/fr.po | 228 ++++++++++++++++++++++++++++----------------------- po/he.po | 215 ++++++++++++++++++++++++++---------------------- po/hr.po | 215 ++++++++++++++++++++++++++---------------------- po/id_ID.po | 218 +++++++++++++++++++++++++++---------------------- po/it.po | 215 ++++++++++++++++++++++++++---------------------- po/pl.po | 215 ++++++++++++++++++++++++++---------------------- po/pt_BR.po | 229 +++++++++++++++++++++++++++++----------------------- po/ru.po | 221 +++++++++++++++++++++++++++----------------------- po/ta_IN.po | 215 ++++++++++++++++++++++++++---------------------- po/tr.po | 215 ++++++++++++++++++++++++++---------------------- po/uk_UA.po | 215 ++++++++++++++++++++++++++---------------------- 19 files changed, 2267 insertions(+), 1854 deletions(-) diff --git a/po/ca.po b/po/ca.po index 0928982..d8a6007 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2014-01-04 20:20+0100\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Catalan (http://www.transifex.com/projects/p/zathura/language/" @@ -19,29 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Entrada invàlida '%s'." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Índex invàlid '%s'." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Copiat el text seleccionat al porta-retalls: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "No s'ha obert cap document." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Nombre d'arguments invàlids." @@ -136,37 +136,37 @@ msgstr "No s'ha pogut desar el document." msgid "Invalid number of arguments." msgstr "Nombre d'arguments invàlids." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "No s'ha pogut escriure el fitxer adjunt '%s' a '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "S'ha escrit el fitxer adjunt '%s' a '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "S'ha escrit la imatge '%s' a '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "No s'ha pogut escriure la imatge '%s' a '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Imatge desconeguda '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Imatge o fitxer adjunt desconegut '%s'." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "L'argument ha de ser un nombre." @@ -185,333 +185,354 @@ msgid "Images" msgstr "Imatges" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Base de dades de rerefons" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Pas d'ampliació" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Separació entre pàgines" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Nombre de pàgines per fila" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Columna de la primera pàgina" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Pas de desplaçament" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Pas de desplaçament horitzontal" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Superposició de pàgines completes de desplaçament" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Zoom mínim" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Zoom màxim" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Nombre de posicions per recordar al jumplist" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Recolorejant (color fosc)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Recolorejant (color clar)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Color de realçament" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Color de realçament (activat)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Recolorejant les pàgines" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "Quan recoloregis manté el to original i ajusta només la lluminositat" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Desplaçament recollit" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "Desplaçament recollit" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Avançar nombre de pàgines per fila" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Zoom centrat horitzontalment" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Centra el resultat horitzontalment" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparència del realçat" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Renderitza 'Carregant ...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Ajustar al fitxer quan s'obri" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Mostra els directoris i fitxers ocults" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Mostra els directoris" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Obrir sempre la primera pàgina" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Realça els resultats de recerca" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Habilita la cerca incremental" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Esborra els resultats de recerca a l'interrompre" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Utilitza el nom base del fitxer en el títol de la finestra" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Habilitar la compatibilitat amb synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Afegir un marcador" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Esborrar un marcador" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Llista tots els marcadors" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Tancar el fitxer actual" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Mostra informació sobre el fitxer" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Executar una comanda" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Mostrar l'ajuda" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Obrir document" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Tancar Zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Imprimir document" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Desar document" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Desar document (i forçar la sobreescritura)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Desa els fitxers adjunts" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Assigna el desplaçament de pàgina" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Marca la posició actual dins el document" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Esborrar les marques especificades" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "No realcis els resultats de la recerca actual" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Realça els resultats de recerca actual" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Mostra informació sobre la versió" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "No s'ha pogut executar xdg-open." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "Enllaçar: pàgina %d" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "Enllaç: %s" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "Enllaç: Invàlid" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Reassigna a la finestra especificada per xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Ruta al directori de configuració" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Camí al directori de dades" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Camí al directori que conté els plugins" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Bifurca en segon pla" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Contrasenya del document" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Nivell de registre (depuració, informació, advertiments, errors)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Imprimeix informació sobre la versió" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Editor synctex (reenviat a l'ordre synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Carregant..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Copia la imatge" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Desa imatge com a" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Aquest document no conté cap índex" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Sense nom]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/cs.po b/po/cs.po index 1ba1fa8..fe03d9b 100644 --- a/po/cs.po +++ b/po/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Martin Pelikan \n" "Language-Team: pwmt.org \n" @@ -14,29 +14,29 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Neplatný vstup: %s" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Neplatný index: %s" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Vybraný text zkopírován do schránky: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Není otevřený žádný dokument." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Špatný počet argumentů." @@ -131,37 +131,37 @@ msgstr "Nepovedlo se uložit dokument." msgid "Invalid number of arguments." msgstr "Špatný počet argumentů." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Nepovedlo se zapsat přílohu '%s' do '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Příloha '%s' zapsána do '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Obrázek '%s' zapsán do '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Nepovedlo se zapsat obrázek '%s' do '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Neznámý obrázek '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Neznámá příloha nebo obrázek '%s'." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Argumentem musí být číslo." @@ -180,333 +180,354 @@ msgid "Images" msgstr "Obrázky" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Databázový backend" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Zoom step" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Mezery mezi stránkami" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Počet stránek na řádek" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Scroll step" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Oddálit" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Přiblížit" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Přebarvuji do tmava" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Přebarvuji do světla" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Barva zvýrazňovače" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Barva zvýrazňovače (aktivní)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Přebarvit stránky" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Scrollovat přes konce" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Průhlednost při zvýrazňování" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Vypisovat 'Načítám ...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Přiblížení po otevření souboru" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Zobrazovat skryté soubory" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Zobrazovat adresáře" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Vždy otevírat na první straně" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Zvýrazňovat výsledky hledání" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Při abortu smazat výsledky hledání" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Přidat záložku" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Smazat záložku" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Vypsat záložky" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Zavřít tenhle soubor" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Zobrazit informace o souboru" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Zobrazit nápovědu" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Otevřít dokument" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Zavřít zathuru" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Tisknout dokument" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Uložit dokument" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Uložit a přepsat dokument" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Uložit přílohy" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Označit současnou pozici v dokumentu" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Smazat vybrané značky" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Nezvýrazňovat výsledky tohoto hledání" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Zvýrazňovat výsledky tohoto hledání" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Nepovedlo se spustit xdg-open." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Cesta k souboru s nastavením" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Cesta k adresáři s daty" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Cesta k adresářům s pluginy" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Forknout se na pozadí" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Heslo" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Úroveň logování (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Zobrazit informace o souboru" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Načítám ..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Zkopíruj obrázek" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Ulož obrázek jako" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Tenhle dokument neobsahuje žádné indexy" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Nepojmenovaný]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/de.po b/po/de.po index a037f1b..0722c27 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: German (http://www.transifex.com/projects/p/zathura/language/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Ungültige Eingabe '%s' angegeben." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Ungültiger Index '%s' angegeben." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Der gewählte Text wurde in die Zwischenablage kopiert: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Kein Dokument geöffnet." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Ungültige Anzahl an Argumenten angegeben." @@ -135,37 +135,37 @@ msgstr "Konnte Dokument nicht speichern." msgid "Invalid number of arguments." msgstr "Ungültige Anzahl an Argumenten." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Konnte Anhang '%s' nicht nach '%s' schreiben." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Anhang '%s' nach '%s' geschrieben." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Anhang '%s' nach '%s' geschrieben." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Konnte Anhang '%s' nicht nach '%s' schreiben." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Unbekanntes Bild '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Unbekannter Anhanng oder Bild '%s'." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Das Argument ist keine Zahl." @@ -184,335 +184,356 @@ msgid "Images" msgstr "Bilder" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Datenbank Backend" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Vergrößerungsstufe" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Abstand zwischen den Seiten" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Anzahl der Seiten in einer Reihe" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Spalte der ersten Seite" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Schrittgröße beim Scrollen" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Horizontale Schrittgröße beim Scrollen" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Überlappung beim Scrollen von ganzen Seiten" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Minimale Vergrößerungsstufe" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Maximale Vergrößerungsstufe" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "Maximale Seitenzahl im Zwischenspeicher" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Anzahl der Liste zu behaltenden Positionen" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Neufärben (Dunkle Farbe)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Neufärben (Helle Farbe)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Farbe für eine Markierung" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Farbe für die aktuelle Markierung" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "Hintergrundfarbe von 'Lädt...'" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "Vordergrundfarbe von 'Lädt...'" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Färbe die Seiten ein" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" "Behalte beim Neuzeichnen den ursprünglichen Hue-Wert bei und stimme nur die " "Helligkeit ab" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Scroll-Umbruch" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "Seiten beim Scrollen beachten" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Gehe Anzahl der Seiten in einer Reihe weiter" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Horizontal zentrierter Zoom" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "Linkziel links ausrichten" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Zentriere Ergebnis horizontal" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparenz einer Markierung" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Zeige 'Lädt...'-Text beim Zeichnen einer Seite" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Seite einpassen" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Zeige versteckte Dateien und Ordner an" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Zeige Ordner an" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Öffne Dokument immer auf der ersten Seite" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Hebe Suchergebnisse hervor" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Aktiviere inkrementelle Suche" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Lösche Suchergebnisse bei Abbruch" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Verwende den Dateinamen der Datei im Fenstertitel" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "Verwende die Seitenzal im Fenstertitel" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "Verwende den Dateinamen der Datei in der Statusleiste" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Aktiviere SyncTeX-Unterstützung" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Füge Lesezeichen hinzu" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Lösche ein Lesezeichen" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Liste all Lesezeichen auf" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Schließe das aktuelle Dokument" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Zeige Dokumentinformationen an" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Führe einen Befehl aus" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Zeige Hilfe an" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Öffne Dokument" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Beende zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Drucke Dokument" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Speichere Dokument" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Speichere Dokument (und überschreibe bestehende)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Speichere Anhänge" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Setze den Seitenabstand" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Markiere aktuelle Position im Doukument" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Lösche angegebene Markierung" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Hebe aktuelle Suchergebnisse nicht hervor" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Hebe aktuelle Suchergebnisse hervor" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Zeige Versionsinformationen an" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Konnte xdg-open nicht ausführen." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "Verknüpfung: Seite %d" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "Verknüpfung: %s" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "Verknüpfung: ungültig" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Reparentiert zathura an das Fenster mit der xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Pfad zum Konfigurationsverzeichnis" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Pfad zum Datenverzeichnis" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Pfad zum Pluginverzeichnis" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Forkt den Prozess in den Hintergrund" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Dokument Passwort" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "Zur Seitenzahl springen" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Log-Stufe (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Zeige Versionsinformationen an" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Synctex Editor (wird an synctex weitergeleitet)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Lädt..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Bild kopieren" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Bild speichern als" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Dieses Dokument beinhaltet kein Inhaltsverzeichnis." -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Kein Name]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "Dateityp ist nicht unterstützt. Installiere das benötigete Plugin." -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "Dieses Dokument beinhaltet kein Seiten" diff --git a/po/el.po b/po/el.po index 217e6e8..450274b 100644 --- a/po/el.po +++ b/po/el.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Greek (http://www.transifex.com/projects/p/zathura/language/" @@ -19,29 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Η είσοδος '%s' είναι άκυρη." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Ο δείκτης '%s' είναι άκυρος." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Το επιλεγμένο κείμενο αποθηκεύτηκε στην μνήμη: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Δεν άνοιξε κανένα αρχείο. " -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Μη έγκυρος αριθμός παραμέτρων." @@ -136,37 +136,37 @@ msgstr "Η αποθήκευση του αρχείου απέτυχε. " msgid "Invalid number of arguments." msgstr "Μη έγκυρος ο αριθμός των παραμέτρων. " -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Μη επιτυχής η εγγραγή της προσάρτησης '%s' στην '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Επιτυχής η εγγραφή της προσάρτησης '%s' στην '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Ενεγράφει η εικόνα '%s' στην '%s'" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Δεν ενεγράφει η εικόνα '%s' στην '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Άγνωστη εικόνα '%s'. " -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Άγνωστο προσάρτημα είτε εικόνα '%s'. " -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Η παράμετρος πρέπει να είναι αριθμός." @@ -185,335 +185,356 @@ msgid "Images" msgstr "Εικόνες" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Το βασικό εργαλείο της βάσης δεδομένων" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Βήμα μεγέθυνσης" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Διάκενο μεταξύ σελίδων" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Αριθμός σελίδων ανά γραμμή" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Στήλη της πρώτης σελίδας" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Βήμα κύλισης" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Βήμα οριζόντιας κύλησης" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Ελάχιστη μεγέθυνση" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Μέγιστη μεγέθυνση" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Επαναχρωματισμός (σκούρο χρώμα)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Επαναχρωματισμός (ανοικτό χρώμα)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Χρώμα τονισμού" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Χρώμα τονισμού (ενεργό)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Επαναχρωματισμός σελίδων" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" "Κατά τον επαναχρωματισμό της σελιδάς διατήρηση της αρχικής απόχρωσης και " "αλλαγή μόνο της φωτεινότητας" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Κυκλική κύληση" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Προώθηση σε αριθμό σελίδων ανά γραμμή" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Μεγένθηση οριζοντίως κεντραρισμένη" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Οριζόντιο κεντράρισμα αποτελεσμάτων" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Διαφάνεια για τονισμό" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Εμφάνιση της ένδειξης 'Φορτώνει ...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Προσαρμογή κατά το άνοιγμα του αρχείου" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Εμφάνιση κρυφών αρχείων και φακέλων" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Εμφάνιση καταλόγων" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Άνοιγμα πάντα στην πρώτη σελίδα" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Τονισμός αποτελεσμάτων αναζήτησης" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Εκκαθάριση των απολεσμάτων αναζήτησης κατά την διακοπή" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Χρήση του ονόματος του αρχείο στο τίτλο του παραθύρου" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Ενεργοποίηση υποστήριξης synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Προσθήκη σελιδοδείκτη" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Διαγραφή σελιδοδείκτη" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Εμφάνιση όλων των σελιδοδεικτών" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Κλείσιμο αρχείου" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Προβολή πληροφοριών αρχείου" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Εκτέλεση εντολής" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Εμφάνιση βοήθειας" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Άνοιγμα αρχείου" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Κλείσιμο" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Εκτύπωση αρχείου" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Αποθήκευση αρχείου" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Αποθήκευση αρχείου (και αντικατάσταση)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Αποθήκευση προσαρτήσεων. " -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Ρύθμιση αντιστάθμισης σελίδας" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Επισήμανση τρέχουσας θέσης στο κείμενο" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Διαγραφή επιλεγμένων σημείων" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Χωρίς τονισμό τα τρέχοντα αποτελέσματα της αναζήτησης" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Τονισμός στα τρέχοντα αποτελέσματα της αναζήτησης" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Εμφάνιση πληροφοριών έκδοσης" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Απέτυχε η εκτέλεση του xdg-open. " -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Reparents to window specified by xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Διαδρομή του αρχείου ρυθμίσεων" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Διαδρομή του φακέλου δεδομένων" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Διαδρομή φακέλου που περιέχει τα πρόσθετα" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Διακλάδωση στο παρασκήνιο" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Κωδικός αρχείου" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Επίπεδο καταγραφής (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Εκτύπωση πληροφοριών έκδοσης" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Synctex editor (Προώθηση στην εντολή synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Φορτώνει ..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Αντιγραφή εικόνας" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Αποθήκευση εικόνας ως..." -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Το αρχείο δεν περιέχει κανένα δείκτη" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Χωρίς όνομα]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/eo.po b/po/eo.po index 27d2a70..4f6b54e 100644 --- a/po/eo.po +++ b/po/eo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Nevalida enigo '%s' uzata." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Nevalida indekso '%s' uzata." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Selektita teksto estas kopiita en la poŝo: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Neniu dokumento malfermita." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Nevalida nombro da argumentoj uzata." @@ -135,37 +135,37 @@ msgstr "Neeble konservi dokumenton." msgid "Invalid number of arguments." msgstr "Nevalida nombro da argumentoj." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Neeble skribi kunsendaĵon '%s' en '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Skribis kunsendaĵon '%s' en '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Skribis kunsendaĵon '%s' en '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Neeble skribi kunsendaĵon '%s' en '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Nekonata bildo '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Argumento devas esti nombro." @@ -184,333 +184,354 @@ msgid "Images" msgstr "Bildoj" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Zompaŝo" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Interpaĝa plenigo" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Nombro da paĝoj po vico" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Rulumpaŝo" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Mimimuma zomo" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Maksimuma zomo" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Rekolorigo (malhela koloro)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Rekolorigo (hela koloro)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Koloro por fonlumo" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Koloro por fonlumo (aktiva)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Rekoloru paĝojn" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Ĉirkaŭflua rulumado" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Travidebleco por fonlumo" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Bildigu 'Ŝargado ...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Adaptaĵo ĉe malfermo de dosiero" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Montru kaŝitajn dosierojn kaj -ujojn" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Montru dosierujojn" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Ĉiam malfermu ĉe unua paĝo" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Aldonu paĝosignon" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Forigu paĝosignon" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Listigu ĉiujn paĝosignojn" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Fermu nunan dosieron" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Montru dosiera informacio" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Montru helpon" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Malfermu dokumenton" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Fermu zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Presu dokumenton" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Konservu dokumenton" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Konservu dokumenton (deviga anstataŭo)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Konservu kunsendaĵojn" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Agordu paĝdelokado" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Fiaskis iro de xdg-open" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Vojo al la agorda dosierujo" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Vojo al la datuma dosierujo" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Vojoj al dosierujoj enhavantaj kromaĵojn" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Nivelo de ĵurnalo (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Montru dosiera informacio" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Ŝargado ..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Kopiu bildon" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Savi bildojn kiel" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Ĉi-tiu dokumento enhavas neniam indekson." -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Neniu nomo]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/es.po b/po/es.po index 14c36aa..ea0b083 100644 --- a/po/es.po +++ b/po/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Moritz Lipp \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" @@ -17,29 +17,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Entrada inválida: '%s'." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Índice invalido: '%s'." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Se ha copiado el texto seleccionado al portapapeles: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Ningún documento abierto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Número de argumentos inválido." @@ -134,37 +134,37 @@ msgstr "Error al guardar el documento." msgid "Invalid number of arguments." msgstr "Número de argumentos inválido." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Escrito fichero adjunto '%s' a '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Escrito fichero adjunto '%s' a '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Imagen desconocida '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Adjunto o imagen desconocidos '%s'." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "El argumento ha de ser un número." @@ -183,335 +183,356 @@ msgid "Images" msgstr "Imágenes" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Base de datos" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Unidad de zoom" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Separación entre páginas" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Número de páginas por fila" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Columna de la primera página" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Paso de desplazamiento" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Paso de desplazamiento horizontal" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Solapamiento del desplazamiento de página" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Zoom mínimo" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Zoom máximo" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Número de posiciones a recordar en la lista de saltos" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Recoloreado (color oscuro)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Recoloreado (color claro)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Color para destacar" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Color para destacar (activo)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Recolorear páginas" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" "Cuando se recoloree, mantener el tono original y ajustar únicamente la " "luminosidad" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Navegación/Scroll cíclica/o" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Zoom centrado horizontalmente" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Centrar el resultado horizontalmente" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparencia para el destacado" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Renderizado 'Cargando ...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Ajustarse al abrir un fichero" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Mostrar directorios y ficheros ocultos" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Mostrar directorios" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Abrir siempre la primera página" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Destacar los resultados de búsqueda" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Habilitar la búsqueda incremental" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Borrar resultados de búsqueda al abortar" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Usar el nombre del archivo en el título de la ventana" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Habilitar soporte synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Añadir Favorito" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Eliminar Favorito" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Listar favoritos" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Cerrar fichero actual" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Mostrar información del fichero" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Ejecutar un comando" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Mostrar ayuda" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Abrir documento" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Salir de zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Imprimir documento" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Guardar documento" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Guardar documento (y sobreescribir)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Guardar ficheros adjuntos" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Asignar el desplazamiento de página" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Marcar la posición actual en el documento" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Borrar las marcas especificadas" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "No destacar los resultados de la búsqueda actual" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Destacar los resultados de la búsqueda actual" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Mostrar versión" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Error al tratar de ejecutar xdg-open" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Reasignar a la ventana especificada por xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Ruta al directorio de configuración" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Ruta para el directorio de datos" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Ruta a los directorios que contienen los plugins" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Fork, ejecutándose en background" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Contraseña del documento" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Nivel de log (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Mostrar información del fichero" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Editor de Synctex (reenvíado al commando synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Cargando ..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Copiar imagen" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Salvar imagen como" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Este documento no contiene ningún índice" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Sin nombre]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/es_CL.po b/po/es_CL.po index 40896ac..7ebd42c 100644 --- a/po/es_CL.po +++ b/po/es_CL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: watsh1ken \n" "Language-Team: Spanish (Chile) (http://www.transifex.net/projects/p/zathura/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Entrada inválida: '%s'." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Índice invalido: '%s'." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Texto seleccionado copiado al portapapeles: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Ningún documento abierto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Número de argumentos inválido." @@ -135,37 +135,37 @@ msgstr "Error al guardar el documento." msgid "Invalid number of arguments." msgstr "Número de argumentos inválido." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Fichero adjunto escrito '%s' a '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Fichero adjunto escrito '%s' a '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "El argumento debe ser un número." @@ -184,333 +184,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Fin de la base de datos." -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Unidad de zoom" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Separación entre páginas" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Numero de páginas por fila" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Unidad de desplazamiento" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Zoom mínimo" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Zoom máximo" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Recolorando (color oscuro)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Recolorando (color claro)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Color para destacar" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Color para destacar (activo)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Recolorar páginas" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Scroll cíclico" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparencia para lo destacado" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Renderizando 'Cargando...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Ajustar al abrirse un archivo" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Mostrar archivos ocultos y directorios" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Mostrar directorios" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Siempre abrir en primera página" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Agregar un marcador" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Eliminar un marcador" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Listar todos los marcadores" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Cerrar archivo actual" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Mostrar información del archivo" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Mostrar ayuda" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Abrir documento" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Cerrar zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Imprimir documento" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Guardar documento" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Guardar documento (y forzar sobreescritura)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Guardar archivos adjuntos" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Asignar desplazamiento de la página" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Error al ejecutar xdg-open." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Reasignar a la ventana especificada por xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Ruta al directorio de configuración" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Ruta al directorio de datos" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Ruta al directorio que contiene plugins" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Ejecución en background" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Nivel de log (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Mostrar información del archivo" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Cargando..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Copiar imagen" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Este document no contiene índice" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Sin nombre]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/et.po b/po/et.po index dfc942f..aa2b29a 100644 --- a/po/et.po +++ b/po/et.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Rivo Zängov \n" "Language-Team: Estonian (http://www.transifex.net/projects/p/zathura/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "" @@ -135,37 +135,37 @@ msgstr "" msgid "Invalid number of arguments." msgstr "" -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "" @@ -184,333 +184,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Esiletõstmise värv" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Esiletõstmise värv (aktiivne)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Näita kaustasid" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Ava alati esimene leht" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Lisa järjehoidja" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Kustuta järjehoidja" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Näita kõiki järjehoidjaid" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Sulge praegune fail" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Näita faili infot" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Näita abiinfot" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Ava dokument" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Sule zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Prindi dokument" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Salvesta dokument" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Salvesta manused" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Näita faili infot" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "" -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Kopeeri pilt" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Nime pole]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/fr.po b/po/fr.po index 47e55b5..986897a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -11,40 +11,40 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2014-01-02 18:42+0000\n" +"Last-Translator: rike\n" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" "fr/)\n" "Language: fr\n" -"Last-Translator: rike\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Entrée invalide : '%s'" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Index invalide : '%s'" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Texte sélectionné copié dans le presse-papiers : %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Aucun document ouvert." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Nombre d'arguments invalide." @@ -139,37 +139,37 @@ msgstr "Échec lors de l'enregistrement du document." msgid "Invalid number of arguments." msgstr "Nombre d'arguments invalide." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Impossible d'écrire la pièce jointe '%s' dans '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Pièce jointe '%s' écrite dans '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Image '%s' écrite dans '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Impossible d'écrire l'image '%s' dans '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Image '%s' inconnue." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Pièce jointe ou image '%s' inconnue." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "L'argument doit être un nombre." @@ -188,333 +188,359 @@ msgid "Images" msgstr "Images" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Gestionnaire de base de données" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Incrément de zoom" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Espacement entre les pages" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Nombre de page par rangée" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Colonne de la première page" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Incrément de défilement" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Incrément de défilement horizontal" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Recouvrement lors du défilement par page entière" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Zoom minimum" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Zoom maximum" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "Nombre maximum de pages à garder en cache" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Nombre de positions à mémoriser dans la liste de sauts" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Recoloration (couleur sombre)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Recoloration (couleur claire)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Couleur de surbrillance" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Couleur de surbrillance (active)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "Couleur d'arrière-plan de 'Chargement...'" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "Couleur de 'Chargement...'" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Recoloriser les pages" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "Lors de la recoloration garder la teinte d'origine et ajuster seulement la luminosité" +msgstr "" +"Lors de la recoloration garder la teinte d'origine et ajuster seulement la " +"luminosité" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Défiler en boucle" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "Défilement tenant compte des limites de page" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Augmenter le nombre de pages par rangée" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Zoom centré horizontalement" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "Aligner la cible du lien à gauche" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "Autoriser la modification du zoom quand on suit un lien" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Centrer le résultat horizontalement" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparence de la surbrillance" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Afficher 'Chargement...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Ajuster à l'ouverture du fichier" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Montrer les fichiers et dossiers cachés" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Montrer les dossiers" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Toujours ouvrir à la première page" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Surligner les résultats de la recherche" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Activer la recherche incrémentale" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Effacer les résultats de recherche en cas d'annulation" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Utiliser le nom de base du fichier dans le titre de la fenêtre" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "Afficher le numéro de page dans le titre de la fenêtre" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "Utiliser le nom de base du fichier dans la barre d'état" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Activer la prise en charge de synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "Le presse-papiers qui recevra les données sélectionnées avec la souris" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Ajouter un marque-page" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Supprimer un marque-page" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Lister tous les marque-pages" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Fermer le fichier actuel" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Montrer les informations sur le fichier" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Exécuter une commande" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Afficher l'aide" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Ouvrir un document" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Quitter zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Imprimer le document" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Sauver le document" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Sauver le document (et forcer l'écrasement)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Enregistrer les pièces jointes" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Définir le décalage de page" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Marquer l'emplacement actuel dans le document" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Supprimer les marques indiquées" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Ne pas surligner les résultats de la recherche en cours" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Surligner les résultats de la recherche en cours" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Afficher les informations de version" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Échec lors du lancement de xdg-open." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "Lien : page %d" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "Lien : %s" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "Lien : Invalide" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Rattacher à la fenêtre spécifiée par xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Chemin vers le dossier de configuration" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Chemin vers le dossier de données" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Chemin vers le dossier de plugins" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Détacher en arrière-plan" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Mot de passe du document" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "Numéro de page où aller" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Niveau de journalisation (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Afficher les informations de version" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Éditeur synctex (transféré à la commande synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Chargement..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Copier l'image" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Enregistrer l'image sous" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Ce document ne contient pas d'index" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Sans nom]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "Impossible de lire le fichier depuis stdin et de le sauvegarder dans un fichier temporaire." +msgstr "" +"Impossible de lire le fichier depuis stdin et de le sauvegarder dans un " +"fichier temporaire." -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "Type de fichier non supporté. Veuillez installer l'extension nécessaire." +msgstr "" +"Type de fichier non supporté. Veuillez installer l'extension nécessaire." -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "Ce document ne contient aucune page" diff --git a/po/he.po b/po/he.po index e6f3834..0112d7c 100644 --- a/po/he.po +++ b/po/he.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Hebrew (http://www.transifex.com/projects/p/zathura/language/" @@ -17,29 +17,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "" @@ -134,37 +134,37 @@ msgstr "" msgid "Invalid number of arguments." msgstr "" -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "" @@ -183,333 +183,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "" -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/hr.po b/po/hr.po index eb022a6..7cd828b 100644 --- a/po/hr.po +++ b/po/hr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Croatian (http://www.transifex.com/projects/p/zathura/" @@ -18,29 +18,29 @@ msgstr "" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "" @@ -135,37 +135,37 @@ msgstr "" msgid "Invalid number of arguments." msgstr "" -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "" @@ -184,333 +184,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "" -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/id_ID.po b/po/id_ID.po index 28a00ea..8d1fa5f 100644 --- a/po/id_ID.po +++ b/po/id_ID.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-12-15 05:57+0000\n" "Last-Translator: andjeng \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Masukan '%s' tidak valid" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Index '%s' tidak valid" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Menyalin teks terpilih ke papan semat: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Tidak ada dokumen yang terbuka." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "jumlah argumen yang diberikan tidak valid" @@ -135,37 +135,37 @@ msgstr "Gagal menyimpan dokumen" msgid "Invalid number of arguments." msgstr "Jumlah argumen tidak valid" -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Tidak dapat menulis lampiran '%s' ke '%s'" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Tidak dapat menyimpan lampiran '%s' ke '%s'" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Menulis citra dari '%s' ke '%s'" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Tidak dapat menulis citra '%s' ke %s'" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Citra tidak diketahui '%s'" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Lampiran atau gambar tidak diketahui '%s'" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Argumen harus berupa angka." @@ -184,333 +184,355 @@ msgid "Images" msgstr "Citra" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "backend database" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Tingkat pembesaran" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Selisih antar halaman" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Jumlah halaman tiap kolom" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Kolom pada halaman pertama" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Tingkat menggulung" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Tingkat penggulungan horisontal" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Pembesaran minimum" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Pembesaran maksimal" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "Jumlah laman yang disimpan pada cache" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Jumlah posisi yang diingat pada jumplist" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Mewarnai ulang (warna gelap)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Mewarnai ulang (warna cerah)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Warna sorotan" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Warna sorotan (aktif)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "'Memuat ...; warna latar" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "'Memuat ...' warna depan" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Mewarnai ulang halaman" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "Ketika mewarnai ulang, jaga hue dan sesuaikan kecerahan saja" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "Penggulungan sadar halaman" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Jumlah halaman per baris \"lanjutan\"" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Pembesaran horisontal tengah" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "Ratakan tautan ke kiri" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "Biarkan pembesaran berubah saat mengikuti pranala" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Tengah-horisontalkan hasil" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparansi sorotan" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Memuat Render..." -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Menyesuaikan ketika membuka file" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Perlihatkan file dan direktori tersembunyi" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Perlihatkan direktori" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Selalu buka halaman pertama" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Sorot hasil pencarian" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Fungsikan pencarian berkelanjutan" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Hapus hasil pencarian ketika batal mencari" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Gunakan nama dasar file pada judul jendela" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "Tampilkan nomor laman pada jendela judul" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "Gunakan nama dasar berkas pada statusbar" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Support synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "Data yang dipilih tetikus akan ditulis ke clipboard" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Tambahkan pada bookmark" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Hapus bookmark" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Perlihatkan semua bookmark" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Tutup file ini" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Informasi file" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Jalankan perintah" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Bantuan" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Buka dokumen" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Tutup zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Cetak dokumen" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Simpan dokumen" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Simpan dokumen (dan menimpa berkas)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Simpan lampiran" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Set offset halaman" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Tandai lokasi sekarang dalam dokumen" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Hapus tanda terpilih" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Jangan menyorot hasil cari sekarang" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Sorot hasil pencarian sekarang" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Tunjukan informasi versi" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Gagal menjalankan program xdg-open" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "Link: halaman %d" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "Link: %s" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "Link: Tidak valid" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Mengembalikan jendela sesuai dengan xid yang ditentukan" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Path ke direktori konfigurasi" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Path ke direktori data" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Path ke direktori plugin" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Jalankan pada latar" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Kata sandi dokumen" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "Nomor halaman tujuan" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Tingkat log (debug, info, peringatan, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Cetak informasi versi" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Synctex editor (diteruskan ke perintah synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Memuat....." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Salin gambar" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Simpan gambar sebagai" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Dokumen ini tidak mempunyai indeks" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Tidak berjudul]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "Tidak dapat membaca berkas dari stdin dan menulisnya ke berkas sementar" +msgstr "" +"Tidak dapat membaca berkas dari stdin dan menulisnya ke berkas sementar" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "Tipe berkas tidak didukung. Silakan memasang plugin yang dibutuhkan." -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "Dokumen tidak mempunyai laman apapun" diff --git a/po/it.po b/po/it.po index aebfb7b..ec2dfec 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Italian (http://www.transifex.com/projects/p/zathura/language/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Input inserito '%s' non valido." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Indice inserito '%s' non valido." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "La selezione è stato copiata negli appunti:%s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Nessun documento aperto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Numero di argomenti errato." @@ -135,37 +135,37 @@ msgstr "Impossibile salvare il documento." msgid "Invalid number of arguments." msgstr "Numero di argomenti non valido." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Impossibile salvare l' allegato '%s' in '%s'" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Allegato '%s' salvato in '%s'" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "L' argomento dev' essere un numero." @@ -184,333 +184,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Backend del database" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Spaziatura tra le pagine" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Numero di pagine per riga" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Zoom minimo" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Zoom massimo" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Ricolora le pagine" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Scrolling continuo" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Mostra file e cartelle nascosti" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Mostra cartelle" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Apri sempre alla prima pagina" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Aggiungi un segnalibro" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Elimina un segnalibro" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Mostra i segnalibri" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Chiudi il file corrente" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Mostra le informazioni sul file" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Mostra l' aiuto" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Apri un documento" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Chiudi zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Stampa il documento" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Salva il documento" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Salva il documento (e sovrascrivi)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Salva allegati" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Imposta l' offset della pagina" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Impossibile eseguire xdg-open." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Percorso della directory della configurazione" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Percorso della directory dei dati" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Percorso della directory contenente i plugin" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Crea un processo separato" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Livello di log (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Mostra le informazioni sul file" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "" -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Copia immagine" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Questo documento non contiene l' indice" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Nessun nome]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/pl.po b/po/pl.po index 37df1db..9276f5d 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" @@ -20,29 +20,29 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Nieprawidłowy argument: %s" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Nieprawidłowy indeks: %s" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Zaznaczony tekst skopiowano do schowka: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Nie otwarto żadnego pliku" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Nieprawidłowa liczba parametrów polecenia" @@ -137,37 +137,37 @@ msgstr "Błąd zapisu" msgid "Invalid number of arguments." msgstr "Niewłaściwa liczba parametrów polecenia" -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Nie można dodać załącznika %s do pliku %s" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Zapisano załącznik %s do pliku %s" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Zapisano obrazek %s do pliku %s" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Nie można dodać obrazka %s do pliku %s" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Nieznany obrazek '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Nieznany załącznik lub obrazek '%s'." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Parametr polecenia musi być liczbą" @@ -186,333 +186,354 @@ msgid "Images" msgstr "Obrazki" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Baza danych" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Skok powiększenia" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Odstęp pomiędzy stronami" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Liczba stron w wierszu" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Skok przewijania" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Minimalne powiększenie" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Maksymalne powiększenie" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Ciemny kolor negatywu" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Jasny kolor negatywu" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Kolor wyróżnienia" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Kolor wyróżnienia bieżącego elementu" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Negatyw" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Zawijanie dokumentu" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Liczba stron w wierszu" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Przezroczystość wyróżnienia" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Wyświetlaj: „Wczytywanie pliku...”" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Dopasowanie widoku pliku" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Wyświetl ukryte pliki i katalogi" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Wyświetl katalogi" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Zawsze otwieraj na pierwszej stronie" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Podświetl wyniki wyszukiwania" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Wyczyść wyniki wyszukiwania po przerwaniu" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Dodaj zakładkę" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Usuń zakładkę" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Wyświetl zakładki" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Zamknij plik" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Wyświetl informacje o pliku" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Wykonaj polecenie" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Wyświetl pomoc" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Otwórz plik" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Zakończ" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Wydrukuj" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Zapisz" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Zapisz (nadpisując istniejący plik)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Zapisz załączniki" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Ustaw przesunięcie numerów stron" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Zaznacz aktualną pozycję w dokumencie" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Skasuj określone zakładki" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Nie podświetlaj aktualnych wyników wyszukiwania " -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Podświetl aktualne wyniki wyszukiwania" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Wyświetl informacje o wersji" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Wystąpił problem z uruchomieniem xdg-open" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Przypisz proces do rodzica o danym xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Ścieżka do katalogu konfiguracyjnego" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Ścieżka do katalogu danych" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Ścieżka do katalogu wtyczek" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Forkuj w tle" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Hasło dokumentu" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Szczegółowość komunikatów (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Wyświetl informacje o wersji" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Wczytywanie pliku..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Skopiuj obrazek" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Zapisz obrazek jako" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Dokument nie zawiera indeksu" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[bez nazwy]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 8422d95..ce6c570 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: salmora8 \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" @@ -19,29 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Dados de entrada inválida '%s' ." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Dados de índice invalido '%s'." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Texto selecionado copiado para área de transferência: %s " #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Nenhum documento aberto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Número de argumentos dados inválidos." @@ -136,37 +136,37 @@ msgstr "Falha ao salvar o documento." msgid "Invalid number of arguments." msgstr "Número de argumento invalido." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Não foi possível gravar anexo '%s' para '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Escreveu anexo '%s' para '%s'." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Escreveu imagem '%s' para '%s'." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Não foi possível gravar imagem '%s' para '%s'." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Imagem desconhecida '%s'." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Anexo desconhecido ou imagem '%s'." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "O argumento deve ser um número." @@ -185,333 +185,360 @@ msgid "Images" msgstr "Imagens" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Fim da base de dados" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Grau de Zoom" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Preenchimento entre páginas" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Número de paginas por linha" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Coluna da primeira página" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Fase de Rolagem" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Etapa de rolagem horizontal" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Sobreposição de rolagem de página inteira" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Zoom minimo" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Zoom máximo" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "Número máximo de páginas para manter no cache" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Numero de posições para lembrar na lista de salto" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Recolorindo (cor escura)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Recolorindo (cor clara)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Cor para destacar" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Cor para destacar (ativo)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "'Carregando ...' cor de fundo" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "'Carregando ...' cor de primeiro plano" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Recolorir páginas" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" +msgstr "" +"Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Rolagem envoltório" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "Rolagem de página consciente" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Numero de avanço de paginas por linha" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Zoom centrado horizontalmente" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "Alinhe destino do link à esquerda" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "Zoom será mudado quando seguir os links" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Resultado centrado horizontalmente" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Transparência para destacar" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Renderizando 'Carregando...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Ajuste para quando abrir o arquivo" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Mostrar arquivos ocultos e diretórios" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Mostrar diretórios" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Sempre abrir na primeira página" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Destaque resultados de busca" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Ativar pesquisa incremental" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Limpar resultados de busca ou abortar" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Usar nome do arquivo na barra de titulo" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "Exibir o número da página no título da janela." -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "Use o nome do arquivo na barra de status" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Ativar suporte synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" -msgstr "A área de transferência em que o dados selecionados com o mouse vão ser escritos" +msgstr "" +"A área de transferência em que o dados selecionados com o mouse vão ser " +"escritos" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Adicionar um favorito" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Deletar um favorito" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Listar todos favoritos" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Fechar arquivo atual" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Mostrar informações do arquivo" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Executar um comando" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Mostrar ajuda" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Abrir documento" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Fechar zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Imprimir documento" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Salvar documento" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Salvar documento (e forçar sobrescrever)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Salvar anexos" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Definir deslocamento da página" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Marcar localização atual no documento" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Apagar as marcas especificadas" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Não destacar resultados de busca atual" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Destacar resultado de busca atual" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Mostrar informações sobre a versão" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Falha ao executar xdg-open." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "Link: página %d" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "Link: %s" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "Link: Inválido" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Reparar a janela especificada por xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Caminho de diretório para configuração" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Caminho para diretório de dados" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Caminho de diretório que contenham plugins" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Deslocar no fundo" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Senha do documento" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "Número da página para ir" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Nível de log (depurar, informação, aviso, erro)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Imprimir informações sobre a versão" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Editor synctex (encaminhado para o comando synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Carregando..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Copiar imagem" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Salvar imagem para" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Este documento não contem qualquer índice" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Sem nome]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "Não foi possível ler o arquivo a partir de stdin e gravá-lo em um arquivo temporário." +msgstr "" +"Não foi possível ler o arquivo a partir de stdin e gravá-lo em um arquivo " +"temporário." -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "Formato de arquivo não suportado. Por favor, instale o plugin necessário." +msgstr "" +"Formato de arquivo não suportado. Por favor, instale o plugin necessário." -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "Documento não contém quaisquer páginas" diff --git a/po/ru.po b/po/ru.po index 5eaf34b..6059480 100644 --- a/po/ru.po +++ b/po/ru.po @@ -10,41 +10,41 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-12-16 13:11+0000\n" +"Last-Translator: vp1981 \n" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" "ru/)\n" "Language: ru\n" -"Last-Translator: vp1981 \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Неправильный ввод: %s." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Получен неверный индекс: %s." -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Выделенный текст скопирован в буфер: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Нет открытых документов." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Указано неверное число аргументов." @@ -139,37 +139,37 @@ msgstr "Не удалось сохранить документ." msgid "Invalid number of arguments." msgstr "Неверное количество аргументов." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Не удалось сохранить приложенный файл «%s» в «%s»." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Файл «%s» сохранён в «%s»." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Изображение «%s» сохранено в «%s»." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Не удалось записать изображение «%s» в «%s»." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Неизвестное изображение «%s»." -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Неизвестное вложение или изображение «%s»." -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Аргумент должен быть числом." @@ -188,333 +188,356 @@ msgid "Images" msgstr "Изображения" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Бэкэнд базы данных" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Шаг увеличения" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Разрыв между страницами" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Количество страниц в ряд" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "Столбец первой страницы" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Шаг прокрутки" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Шаг горизонтальной прокрутки" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Перекрытие страниц при прокрутке" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Минимальное увеличение" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Максимальное увеличение" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "Максимальное количество страниц хранимых в кэше" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Длина истории переходов" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Перекрашивание (тёмные тона)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Перекрашивание (светлые тона)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Цвет для подсветки" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Цвет для подсветки (активной)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "Цвет фона загрузочной заставки" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "Цвет загрузочной заставки" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Перекрасить страницы" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "При перекраске сохранять оттенок и изменять только осветление" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Плавная прокрутка" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "Постраничная прокрутка" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Увеличить количество страниц в ряду" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Центрировать увеличение по горизонтали" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "Выровнять цель ссылки по левому краю" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "Разрешить изменять размер при следовании по ссылкам" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "Центрировать результат по горизонтали" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Прозрачность подсветки" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Рендер «Загружается ...»" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Подогнать размеры при открытии документа" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Показывать скрытые файлы и каталоги" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Показывать каталоги" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Всегда открывать на первой странице" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Подсветить результаты поиска" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Включить инкрементальный поиск" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Сбросить результаты при отмене поиска" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Использовать базовое имя файла в заголовке" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "Показывать номер страницы в заголовке" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "Использовать базовое имя файла в строке состояния" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "Включить поддержку synctex" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "Буфер для записи данных из области выделенных мышкой" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Добавить закладку" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Удалить закладку" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Показать все закладки" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Закрыть текущий файл" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Показать информацию о файле" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Выполнить команду" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Помощь" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Открыть документ" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Выход" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Печать" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Сохранить документ" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Сохранить документ (с перезаписью)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Сохранить прикреплённые файлы" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Сохранить смещение страницы" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Пометить текущую позицию в документе" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Удалить указанные пометки" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Не подсвечивать результаты текущего поиска" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Подсветить результаты текущего поиска" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Показать информацию о версии файла" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Не удалось запустить xdg-open" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "Ссылка: страница %d" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "Ссылка: %s" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "Ссылка: неправильная" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Сменить материнское окно на окно, указанное в xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Путь к каталогу с настройкой" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Путь к каталогу с данными" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Путь к каталогу с плагинами" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Запустить в фоне" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Пароль документа" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "Перейти к странице номер" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Уровень журналирования (debug, info, warning, error)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Показать информацию о файле" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Редактор для synctex (передаётся далее программе synctex)" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Загрузка..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Скопировать изображение" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Сохранить изображение как" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "В документе нет индекса" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Без названия]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "Не удалось прочитать файл со стандартного входа и записать его во временный файл." +msgstr "" +"Не удалось прочитать файл со стандартного входа и записать его во временный " +"файл." -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "Тип файла не поддерживается. Установите соответствующий плагин." -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "В документе нет страниц" diff --git a/po/ta_IN.po b/po/ta_IN.po index e130d3b..711cd95 100644 --- a/po/ta_IN.po +++ b/po/ta_IN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: mankand007 \n" "Language-Team: Tamil (India) (http://www.transifex.net/projects/p/zathura/" @@ -18,29 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "கொடுக்கப்பட்ட உள்ளீடு(input) '%s' தவறு" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "கொடுக்கப்பட்ட index '%s' தவறு" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "எந்தக் ஆவணமும் திறக்கப்படவில்லை" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "கொடுக்கப்பட்ட arguments-களின் எண்ணிக்கை தவறு" @@ -135,37 +135,37 @@ msgstr "ஆவணத்தை சேமிக்க இயலவில்லை" msgid "Invalid number of arguments." msgstr "கொடுக்கப்பட்ட argument-களின் எண்ணிக்கை தவறு" -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Argument ஒரு எண்ணாக இருக்க வேண்டும்" @@ -184,333 +184,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Zoom அமைப்பு" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "இரு பக்கங்களுக்கிடையில் உள்ள நிரப்பல்(padding)" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "ஒரு வரிசையில் எத்தனை பக்கங்களைக் காட்ட வேண்டும்" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "திரை உருளல்(scroll) அளவு" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "முடிந்தவரை சிறியதாகக் காட்டு" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "முடிந்தவரை பெரிதாகக் காட்டு" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "புதிய bookmark உருவாக்கு" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Bookmark-ஐ அழித்துவிடு" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "அனைத்து bookmark-களையும் பட்டியலிடு" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "ஆவணம் பற்றிய தகவல்களைக் காட்டு" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "உதவியைக் காட்டு" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "ஒரு ஆவணத்தைத் திற" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "zathura-வை விட்டு வெளியேறு" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "ஆவணத்தை அச்சிடு" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "ஆவணத்தை சேமிக்கவும்" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "இணைப்புகளைச் சேமிக்கவும்" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "xdg-open-ஐ இயக்க முடியவில்லை" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "ஆவணம் பற்றிய தகவல்களைக் காட்டு" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "" -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "படத்தை ஒரு பிரதியெடு" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "இந்த ஆவணத்தில் எந்த index-ம் இல்லை" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "பெயரற்ற ஆவணம்" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/tr.po b/po/tr.po index 18f3384..8586935 100644 --- a/po/tr.po +++ b/po/tr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: hsngrms \n" "Language-Team: Turkish (http://www.transifex.net/projects/p/zathura/language/" @@ -19,29 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Hatalı girdi '%s'" -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Hatalı dizin '%s'" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Seçili metin panoya kopyalandı: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Açık belge yok." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Yanlış sayıda argüman" @@ -136,37 +136,37 @@ msgstr "Belge kaydedilemedi." msgid "Invalid number of arguments." msgstr "Yanlış sayıda argüman." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazılamadı." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazıldı." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazıldı." -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazılamadı." -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "Tanınmayan resim dosyası '%s'" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Tanınmayan eklenti veya resim dosyası '%s'" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Argüman bir sayı olmalı." @@ -185,333 +185,354 @@ msgid "Images" msgstr "Resimler" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Veritabanı arkayüzü" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Yakınlaşma/uzaklaşma aralığı" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Sayfalar arasındaki boşluk" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Satır başına sayfa sayısı" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "İlk sayfanın sütunu" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Kaydırma aralığı" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "Yatay kaydırma adımı" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "Tam ekran kaydırma kaplaması" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "En fazla uzaklaşma" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "En fazla yakınlaşma" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "Atlama listesinde hatırlanacak pozisyon sayısı" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Renk değişimi (koyu renk)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Renk değişimi (açık renk)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "İşaretleme rengi" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "İşaretleme rengi (etkin)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Sayga rengini değiştir" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "Yeniden renklendirirken renk değerini tut ve sadece parlaklığı ayarla" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Kaydırmayı sarmala" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "Satır başına sayfa sayısı" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "Yatay olarak ortalanmış büyütme" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Ön plana çıkarmak için saydamlaştır" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "'Yüklüyor ...' yazısını göster" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Dosya açarken ayarla" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Gizli dosyaları ve dizinleri göster" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Dizinleri göster" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Her zaman ilk sayfayı aç" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "Arama sonuçlarını vurgula" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "Artımlı aramayı etkinleştir" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "Kapatınca arama sonuçlarını temizle" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "Pencere başlığı olarak dosyanın adını kullan" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Yer imi ekle" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Yer imi sil" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Yer imlerini listele" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Geçerli dosyayı kapat" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Dosya bilgisi göster" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "Bir komut çalıştır" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Yardım bilgisi göster" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Belge aç" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Zathura'yı kapat" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Belge yazdır" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Belgeyi kaydet" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Belgeyi kaydet (ve sormadan üzerine yaz)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Ekleri kaydet" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Sayfa derinliğini ayarla" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "Bu belgede bu konumu işaretle" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "Seçilen işaretlemeleri sil" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "Şuanki arama sonuçlarını vurgulama" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "Şuanki arama sonuçlarını vurgula" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "Versiyon bilgisi göster" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "xdg-open çalıştırılamadı" -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Xid tarafından belirlendiği gibi bir üst seviye pencereye bağlı" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Ayar dizini adresi" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Veri dizini adresi" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Eklentileri içeren dizinin adresi" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Arka planda işlemden çocuk oluştur" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "Belge şifresi" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Kayıt seviyesi (hata ayıklama, bilgi, uyarı, hata)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Dosya bilgisi göster" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "Yüklüyor ..." -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Resim kopyala" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "Resmi farklı kaydet" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Bu belge fihrist içermiyor" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[İsimsiz]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" diff --git a/po/uk_UA.po b/po/uk_UA.po index 04c8e2a..b6a02e5 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-04 19:57+0100\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" "PO-Revision-Date: 2013-11-20 09:50+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" @@ -19,29 +19,29 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" -#: ../callbacks.c:297 +#: ../callbacks.c:301 #, c-format msgid "Invalid input '%s' given." msgstr "Вказано невірний аргумент: %s." -#: ../callbacks.c:333 +#: ../callbacks.c:337 #, c-format msgid "Invalid index '%s' given." msgstr "Вказано невірний індекс: %s" -#: ../callbacks.c:546 +#: ../callbacks.c:550 #, c-format msgid "Copied selected text to clipboard: %s" msgstr "Вибраний текст скопійовано до буферу: %s" #: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 -#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:419 -#: ../commands.c:540 ../shortcuts.c:403 ../shortcuts.c:1163 -#: ../shortcuts.c:1192 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 msgid "No document opened." msgstr "Документ не відкрито." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 msgid "Invalid number of arguments given." msgstr "Вказана невірна кількість аргументів." @@ -136,37 +136,37 @@ msgstr "Документ не вдалося зберегти." msgid "Invalid number of arguments." msgstr "Невірна кількість аргументів." -#: ../commands.c:443 +#: ../commands.c:446 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Неможливо записати прикріплення '%s' до '%s'." -#: ../commands.c:445 +#: ../commands.c:448 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Прикріплення записано %s до %s." -#: ../commands.c:489 +#: ../commands.c:492 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:491 +#: ../commands.c:494 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:498 +#: ../commands.c:501 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:502 +#: ../commands.c:505 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:553 +#: ../commands.c:556 msgid "Argument must be a number." msgstr "Аргумент повинен бути цифрою." @@ -185,333 +185,354 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:131 +#: ../config.c:136 msgid "Database backend" msgstr "Буфер бази" -#: ../config.c:133 +#: ../config.c:138 msgid "Zoom step" msgstr "Збільшення" -#: ../config.c:135 +#: ../config.c:140 msgid "Padding between pages" msgstr "Заповнення між сторінками" -#: ../config.c:137 +#: ../config.c:142 msgid "Number of pages per row" msgstr "Кількість сторінок в одному рядку" -#: ../config.c:139 +#: ../config.c:144 msgid "Column of the first page" msgstr "" -#: ../config.c:141 +#: ../config.c:146 msgid "Scroll step" msgstr "Прокручування" -#: ../config.c:143 +#: ../config.c:148 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:145 +#: ../config.c:150 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:147 +#: ../config.c:152 msgid "Zoom minimum" msgstr "Максимальне зменшення" -#: ../config.c:149 +#: ../config.c:154 msgid "Zoom maximum" msgstr "Максимальне збільшення" -#: ../config.c:151 +#: ../config.c:156 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:153 +#: ../config.c:158 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:155 +#: ../config.c:160 msgid "Recoloring (dark color)" msgstr "Перефарбування (темний колір)" -#: ../config.c:156 +#: ../config.c:161 msgid "Recoloring (light color)" msgstr "Перефарбування (світлий колір)" -#: ../config.c:157 +#: ../config.c:162 msgid "Color for highlighting" msgstr "Колір для виділення" -#: ../config.c:159 +#: ../config.c:164 msgid "Color for highlighting (active)" msgstr "Колір для виділення (активний)" -#: ../config.c:161 +#: ../config.c:166 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:163 +#: ../config.c:168 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:167 +#: ../config.c:172 msgid "Recolor pages" msgstr "Змінити кольори" -#: ../config.c:169 +#: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:171 +#: ../config.c:176 msgid "Wrap scrolling" msgstr "Плавне прокручування" -#: ../config.c:173 +#: ../config.c:178 msgid "Page aware scrolling" msgstr "" -#: ../config.c:175 +#: ../config.c:180 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:177 +#: ../config.c:182 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:179 +#: ../config.c:184 msgid "Align link target to the left" msgstr "" -#: ../config.c:181 +#: ../config.c:186 msgid "Let zoom be changed when following links" msgstr "" -#: ../config.c:183 +#: ../config.c:188 msgid "Center result horizontally" msgstr "" -#: ../config.c:185 +#: ../config.c:190 msgid "Transparency for highlighting" msgstr "Прозорість для виділення" -#: ../config.c:187 +#: ../config.c:192 msgid "Render 'Loading ...'" msgstr "Рендер 'Завантажується ...'" -#: ../config.c:188 +#: ../config.c:193 msgid "Adjust to when opening file" msgstr "Підлаштовутись при відкритті файлу" -#: ../config.c:190 +#: ../config.c:195 msgid "Show hidden files and directories" msgstr "Показати приховані файли та директорії" -#: ../config.c:192 +#: ../config.c:197 msgid "Show directories" msgstr "Показати диреторії" -#: ../config.c:194 +#: ../config.c:199 msgid "Always open on first page" msgstr "Завжди відкривати на першій сторінці" -#: ../config.c:196 +#: ../config.c:201 msgid "Highlight search results" msgstr "" -#: ../config.c:198 +#: ../config.c:204 msgid "Enable incremental search" msgstr "" -#: ../config.c:200 +#: ../config.c:206 msgid "Clear search results on abort" msgstr "" -#: ../config.c:202 +#: ../config.c:208 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:204 +#: ../config.c:210 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:206 +#: ../config.c:212 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:208 ../main.c:67 +#: ../config.c:214 ../main.c:66 msgid "Enable synctex support" msgstr "" -#: ../config.c:210 +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "" + +#: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" msgstr "" #. define default inputbar commands -#: ../config.c:369 +#: ../config.c:398 msgid "Add a bookmark" msgstr "Додати закладку" -#: ../config.c:370 +#: ../config.c:399 msgid "Delete a bookmark" msgstr "Вилучити закладку" -#: ../config.c:371 +#: ../config.c:400 msgid "List all bookmarks" msgstr "Дивитись усі закладки" -#: ../config.c:372 +#: ../config.c:401 msgid "Close current file" msgstr "Закрити документ" -#: ../config.c:373 +#: ../config.c:402 msgid "Show file information" msgstr "Показати інформацію файлу" -#: ../config.c:374 +#: ../config.c:403 msgid "Execute a command" msgstr "" -#: ../config.c:375 +#: ../config.c:404 msgid "Show help" msgstr "Показати довідку" -#: ../config.c:376 +#: ../config.c:405 msgid "Open document" msgstr "Відкрити документ" -#: ../config.c:377 +#: ../config.c:406 msgid "Close zathura" msgstr "Вийти із zathura" -#: ../config.c:378 +#: ../config.c:407 msgid "Print document" msgstr "Друкувати документ" -#: ../config.c:379 +#: ../config.c:408 msgid "Save document" msgstr "Зберегти документ" -#: ../config.c:380 +#: ../config.c:409 msgid "Save document (and force overwriting)" msgstr "Зберегти документ (форсувати перезапис)" -#: ../config.c:381 +#: ../config.c:410 msgid "Save attachments" msgstr "Зберегти прикріплення" -#: ../config.c:382 +#: ../config.c:411 msgid "Set page offset" msgstr "Встановити зміщення сторінки" -#: ../config.c:383 +#: ../config.c:412 msgid "Mark current location within the document" msgstr "" -#: ../config.c:384 +#: ../config.c:413 msgid "Delete the specified marks" msgstr "" -#: ../config.c:385 +#: ../config.c:414 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:386 +#: ../config.c:415 msgid "Highlight current search results" msgstr "" -#: ../config.c:387 +#: ../config.c:416 msgid "Show version information" msgstr "" -#: ../links.c:199 ../links.c:278 +#: ../links.c:202 ../links.c:281 msgid "Failed to run xdg-open." msgstr "Запуск xdg-open не вдався." -#: ../links.c:217 +#: ../links.c:220 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:224 +#: ../links.c:227 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:228 +#: ../links.c:231 msgid "Link: Invalid" msgstr "" -#: ../main.c:58 +#: ../main.c:57 msgid "Reparents to window specified by xid" msgstr "Вертатися до вікна, вказаного xid" -#: ../main.c:59 +#: ../main.c:58 msgid "Path to the config directory" msgstr "Шлях до теки конфігурації" -#: ../main.c:60 +#: ../main.c:59 msgid "Path to the data directory" msgstr "Шлях до теки з даними" -#: ../main.c:61 +#: ../main.c:60 msgid "Path to the directories containing plugins" msgstr "Шлях до теки з плаґінами" -#: ../main.c:62 +#: ../main.c:61 msgid "Fork into the background" msgstr "Працювати у фоні" -#: ../main.c:63 +#: ../main.c:62 msgid "Document password" msgstr "" -#: ../main.c:64 +#: ../main.c:63 msgid "Page number to go to" msgstr "" -#: ../main.c:65 +#: ../main.c:64 msgid "Log level (debug, info, warning, error)" msgstr "Рівень логування (налагодження, інфо, застереження, помилка)" -#: ../main.c:66 +#: ../main.c:65 msgid "Print version information" msgstr "Показати інформацію файлу" -#: ../main.c:68 +#: ../main.c:67 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:526 +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "" + +#: ../page-widget.c:493 msgid "Loading..." msgstr "" -#: ../page-widget.c:845 +#: ../page-widget.c:808 msgid "Copy image" msgstr "Копіювати картинку" -#: ../page-widget.c:846 +#: ../page-widget.c:809 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1076 +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "" + +#: ../shortcuts.c:1114 msgid "This document does not contain any index" msgstr "Індекс відсутній в цьому документі" -#: ../zathura.c:213 ../zathura.c:959 +#: ../zathura.c:192 ../zathura.c:988 msgid "[No name]" msgstr "[Без назви]" -#: ../zathura.c:486 +#: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." msgstr "" -#: ../zathura.c:535 +#: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:545 +#: ../zathura.c:544 msgid "Document does not contain any pages" msgstr "" From a85decc8ccf493161e55b926b022bbb148fb83e4 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 14 Feb 2014 11:46:17 +0100 Subject: [PATCH 120/129] Only copy selected text in normal and fullscreen mode Signed-off-by: Sebastian Ramacher --- callbacks.c | 8 +++++++- dbus-interface.c | 4 ++-- shortcuts.c | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/callbacks.c b/callbacks.c index af6a699..5389cc2 100644 --- a/callbacks.c +++ b/callbacks.c @@ -50,7 +50,8 @@ cb_buffer_changed(girara_session_t* session) } static void -update_visible_pages(zathura_t* zathura) { +update_visible_pages(zathura_t* zathura) +{ const unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) { @@ -539,6 +540,11 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data) g_return_if_fail(data != NULL); zathura_t* zathura = data; + girara_mode_t mode = girara_mode_get(zathura->ui.session); + if (mode != zathura->modes.normal && mode != zathura->modes.fullscreen) { + return; + } + GdkAtom* selection = get_selection(zathura); /* copy to clipboard */ diff --git a/dbus-interface.c b/dbus-interface.c index 00f96c0..eeee0f4 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -483,8 +483,8 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page, } GError* error = NULL; - GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, - NULL, &error); + GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, + &error); if (connection == NULL) { girara_error("Could not connect to session bus: %s", error->message); g_error_free(error); diff --git a/shortcuts.c b/shortcuts.c index 0f5c807..91f17db 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -1242,7 +1242,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* girara_mode_set(session, zathura->modes.fullscreen); } - fullscreen = fullscreen ? false : true; + fullscreen = !fullscreen; return false; } @@ -1315,7 +1315,7 @@ sc_toggle_presentation(girara_session_t* session, girara_argument_t* girara_mode_set(session, zathura->modes.presentation); } - fullscreen = fullscreen ? false : true; + fullscreen = !fullscreen; return false; } From 806b69a1fe1ba461408da635ebadfef29aa68032 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 14 Feb 2014 12:09:47 +0100 Subject: [PATCH 121/129] Disable a mode_set call that hasn't been doing anything for ages Signed-off-by: Sebastian Ramacher --- shortcuts.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shortcuts.c b/shortcuts.c index 91f17db..c453fbb 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -87,7 +87,10 @@ sc_abort(girara_session_t* session, girara_argument_t* UNUSED(argument), } } - girara_mode_set(session, session->modes.normal); + /* Setting the mode back here has not worked for ages. We need another way to + * do this. Let's disable this for now. + */ + /* girara_mode_set(session, session->modes.normal); */ girara_sc_abort(session, NULL, NULL, 0); return false; From 70f8e20e19a5a291d2290229f7c8bbd8083a7020 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 14 Feb 2014 12:11:12 +0100 Subject: [PATCH 122/129] Use the actual mode in mode toggle calls --- shortcuts.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index c453fbb..0705afb 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -1234,19 +1234,17 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* return false; } - static bool fullscreen = false; - if (fullscreen == true) { + const girara_mode_t old_mode = girara_mode_get(session); + if (old_mode == zathura->modes.fullscreen) { gtk_window_unfullscreen(GTK_WINDOW(session->gtk.window)); refresh_view(zathura); girara_mode_set(session, zathura->modes.normal); - } else { + } else if (old_mode == zathura->modes.normal) { gtk_window_fullscreen(GTK_WINDOW(session->gtk.window)); refresh_view(zathura); girara_mode_set(session, zathura->modes.fullscreen); } - fullscreen = !fullscreen; - return false; } @@ -1263,12 +1261,12 @@ sc_toggle_presentation(girara_session_t* session, girara_argument_t* return false; } - static bool fullscreen = false; static int pages_per_row = 1; static int first_page_column = 1; static double zoom = 1.0; - if (fullscreen == true) { + const girara_mode_t old_mode = girara_mode_get(session); + if (old_mode == zathura->modes.presentation) { /* reset pages per row */ girara_setting_set(session, "pages-per-row", &pages_per_row); @@ -1288,7 +1286,7 @@ sc_toggle_presentation(girara_session_t* session, girara_argument_t* /* setm ode */ girara_mode_set(session, zathura->modes.normal); - } else { + } else if (old_mode == zathura->modes.normal) { /* backup pages per row */ girara_setting_get(session, "pages-per-row", &pages_per_row); @@ -1318,8 +1316,6 @@ sc_toggle_presentation(girara_session_t* session, girara_argument_t* girara_mode_set(session, zathura->modes.presentation); } - fullscreen = !fullscreen; - return false; } From 35f278e1f3a149fd3ff8ba63870b29efc509e1aa Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 14 Feb 2014 12:59:25 +0100 Subject: [PATCH 123/129] Add shortcuts for ^C and Esc in all modes This should fix #392 and hopefully doesn't break anything else. Signed-off-by: Sebastian Ramacher --- config.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index 0e9b0b0..7216647 100644 --- a/config.c +++ b/config.c @@ -129,6 +129,14 @@ config_load_default(zathura_t* zathura) #define FULLSCREEN zathura->modes.fullscreen #define PRESENTATION zathura->modes.presentation + const girara_mode_t all_modes[] = { + NORMAL, + INSERT, + INDEX, + FULLSCREEN, + PRESENTATION + }; + /* Set default mode */ girara_mode_set(gsession, zathura->modes.normal); @@ -318,9 +326,13 @@ config_load_default(zathura_t* zathura) girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, GIRARA_MOUSE_BUTTON2, sc_mouse_scroll, (mode), GIRARA_EVENT_BUTTON_RELEASE, 0, NULL); \ girara_mouse_event_add(gsession, GDK_BUTTON2_MASK, 0, sc_mouse_scroll, (mode), GIRARA_EVENT_MOTION_NOTIFY, 0, NULL); \ - /* Define mode-less shortcuts */ - girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_Escape, NULL, sc_abort, 0, 0, NULL); + /* Define mode-less shortcuts + * girara adds them only for normal mode, so passing 0 as mode is currently + * not enough. We need to add/override for every mode. */ + for (size_t idx = 0; idx != LENGTH(all_modes); ++idx) { + girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, all_modes[idx], 0, NULL); + girara_shortcut_add(gsession, 0, GDK_KEY_Escape, NULL, sc_abort, all_modes[idx], 0, NULL); + } /* Normal mode */ girara_shortcut_add(gsession, 0, GDK_KEY_F5, NULL, sc_toggle_presentation, NORMAL, 0, NULL); From b2b9b4df129be756d5843614a4cb4fa5bffed642 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 14 Feb 2014 13:40:30 +0100 Subject: [PATCH 124/129] Update translations Signed-off-by: Sebastian Ramacher --- po/ca.po | 2 +- po/cs.po | 2 +- po/de.po | 24 +++++++++++------------- po/el.po | 6 ++---- po/eo.po | 2 +- po/es.po | 8 +++----- po/es_CL.po | 2 +- po/et.po | 2 +- po/fr.po | 13 ++++--------- po/he.po | 2 +- po/hr.po | 2 +- po/id_ID.po | 5 ++--- po/it.po | 2 +- po/pl.po | 2 +- po/pt_BR.po | 16 +++++----------- po/ru.po | 16 +++++++--------- po/ta_IN.po | 2 +- po/tr.po | 2 +- po/uk_UA.po | 2 +- 19 files changed, 46 insertions(+), 66 deletions(-) diff --git a/po/ca.po b/po/ca.po index d8a6007..580ec24 100644 --- a/po/ca.po +++ b/po/ca.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2014-01-04 20:20+0100\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Catalan (http://www.transifex.com/projects/p/zathura/language/" "ca/)\n" diff --git a/po/cs.po b/po/cs.po index fe03d9b..3e5ffa8 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Martin Pelikan \n" "Language-Team: pwmt.org \n" "Language: cs\n" diff --git a/po/de.po b/po/de.po index 0722c27..a011cba 100644 --- a/po/de.po +++ b/po/de.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" -"Last-Translator: Sebastian Ramacher \n" +"PO-Revision-Date: 2014-02-11 22:39+0000\n" +"Last-Translator: simon04 \n" "Language-Team: German (http://www.transifex.com/projects/p/zathura/language/" "de/)\n" "Language: de\n" @@ -262,9 +262,7 @@ msgstr "Färbe die Seiten ein" #: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Behalte beim Neuzeichnen den ursprünglichen Hue-Wert bei und stimme nur die " -"Helligkeit ab" +msgstr "Behalte beim Neuzeichnen den ursprünglichen Hue-Wert bei und stimme nur die Helligkeit ab" #: ../config.c:176 msgid "Wrap scrolling" @@ -288,7 +286,7 @@ msgstr "Linkziel links ausrichten" #: ../config.c:186 msgid "Let zoom be changed when following links" -msgstr "" +msgstr "Erlaube Zoom-Änderungen beim Folgen von Links" #: ../config.c:188 msgid "Center result horizontally" @@ -348,11 +346,11 @@ msgstr "Aktiviere SyncTeX-Unterstützung" #: ../config.c:216 msgid "Enable D-Bus service" -msgstr "" +msgstr "D-Bus-Dienst aktivieren" #: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" -msgstr "" +msgstr "Zwischenablage, in die mit der Maus gewählte Text kopiert wird" #. define default inputbar commands #: ../config.c:398 @@ -491,15 +489,15 @@ msgstr "Synctex Editor (wird an synctex weitergeleitet)" #: ../main.c:68 msgid "Move to given synctex position" -msgstr "" +msgstr "Zur gewählten SyncTeX-Position springen" #: ../main.c:69 msgid "Highlight given position in the given process" -msgstr "" +msgstr "Gewählte Position im Prozess hervorheben" #: ../main.c:70 msgid "Start in a non-default mode" -msgstr "" +msgstr "In einem Nicht-Standardmodus starten" #: ../page-widget.c:493 msgid "Loading..." @@ -516,7 +514,7 @@ msgstr "Bild speichern als" #: ../print.c:64 ../print.c:211 #, c-format msgid "Printing failed: %s" -msgstr "" +msgstr "Drucken fehlgeschlagen: %s" #: ../shortcuts.c:1114 msgid "This document does not contain any index" @@ -528,7 +526,7 @@ msgstr "[Kein Name]" #: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" +msgstr "Konnte Datei nicht von stdin lesen und in temporäre Datei schreiben." #: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." diff --git a/po/el.po b/po/el.po index 450274b..8622194 100644 --- a/po/el.po +++ b/po/el.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Greek (http://www.transifex.com/projects/p/zathura/language/" "el/)\n" @@ -263,9 +263,7 @@ msgstr "Επαναχρωματισμός σελίδων" #: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Κατά τον επαναχρωματισμό της σελιδάς διατήρηση της αρχικής απόχρωσης και " -"αλλαγή μόνο της φωτεινότητας" +msgstr "Κατά τον επαναχρωματισμό της σελιδάς διατήρηση της αρχικής απόχρωσης και αλλαγή μόνο της φωτεινότητας" #: ../config.c:176 msgid "Wrap scrolling" diff --git a/po/eo.po b/po/eo.po index 4f6b54e..c5befea 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" "language/eo/)\n" diff --git a/po/es.po b/po/es.po index ea0b083..4aedabd 100644 --- a/po/es.po +++ b/po/es.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" -"Last-Translator: Moritz Lipp \n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" +"Last-Translator: Sebastian Ramacher \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" "zathura/language/es/)\n" "Language: es\n" @@ -261,9 +261,7 @@ msgstr "Recolorear páginas" #: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Cuando se recoloree, mantener el tono original y ajustar únicamente la " -"luminosidad" +msgstr "Cuando se recoloree, mantener el tono original y ajustar únicamente la luminosidad" #: ../config.c:176 msgid "Wrap scrolling" diff --git a/po/es_CL.po b/po/es_CL.po index 7ebd42c..b3393a0 100644 --- a/po/es_CL.po +++ b/po/es_CL.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: watsh1ken \n" "Language-Team: Spanish (Chile) (http://www.transifex.net/projects/p/zathura/" "language/es_CL/)\n" diff --git a/po/et.po b/po/et.po index aa2b29a..861df01 100644 --- a/po/et.po +++ b/po/et.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Rivo Zängov \n" "Language-Team: Estonian (http://www.transifex.net/projects/p/zathura/" "language/et/)\n" diff --git a/po/fr.po b/po/fr.po index 986897a..d50aaf9 100644 --- a/po/fr.po +++ b/po/fr.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2014-01-02 18:42+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: rike\n" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" "fr/)\n" @@ -266,9 +266,7 @@ msgstr "Recoloriser les pages" #: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Lors de la recoloration garder la teinte d'origine et ajuster seulement la " -"luminosité" +msgstr "Lors de la recoloration garder la teinte d'origine et ajuster seulement la luminosité" #: ../config.c:176 msgid "Wrap scrolling" @@ -532,14 +530,11 @@ msgstr "[Sans nom]" #: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" -"Impossible de lire le fichier depuis stdin et de le sauvegarder dans un " -"fichier temporaire." +msgstr "Impossible de lire le fichier depuis stdin et de le sauvegarder dans un fichier temporaire." #: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" -"Type de fichier non supporté. Veuillez installer l'extension nécessaire." +msgstr "Type de fichier non supporté. Veuillez installer l'extension nécessaire." #: ../zathura.c:544 msgid "Document does not contain any pages" diff --git a/po/he.po b/po/he.po index 0112d7c..959f0d2 100644 --- a/po/he.po +++ b/po/he.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Hebrew (http://www.transifex.com/projects/p/zathura/language/" "he/)\n" diff --git a/po/hr.po b/po/hr.po index 7cd828b..64466ed 100644 --- a/po/hr.po +++ b/po/hr.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Croatian (http://www.transifex.com/projects/p/zathura/" "language/hr/)\n" diff --git a/po/id_ID.po b/po/id_ID.po index 8d1fa5f..15a4bc6 100644 --- a/po/id_ID.po +++ b/po/id_ID.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-12-15 05:57+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: andjeng \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/" "zathura/language/id_ID/)\n" @@ -526,8 +526,7 @@ msgstr "[Tidak berjudul]" #: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" -"Tidak dapat membaca berkas dari stdin dan menulisnya ke berkas sementar" +msgstr "Tidak dapat membaca berkas dari stdin dan menulisnya ke berkas sementar" #: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." diff --git a/po/it.po b/po/it.po index ec2dfec..0f28c60 100644 --- a/po/it.po +++ b/po/it.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Italian (http://www.transifex.com/projects/p/zathura/language/" "it/)\n" diff --git a/po/pl.po b/po/pl.po index 9276f5d..2a4d2b0 100644 --- a/po/pl.po +++ b/po/pl.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" "pl/)\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index ce6c570..6501e06 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: salmora8 \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" "zathura/language/pt_BR/)\n" @@ -263,8 +263,7 @@ msgstr "Recolorir páginas" #: ../config.c:174 msgid "When recoloring keep original hue and adjust lightness only" -msgstr "" -"Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" +msgstr "Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" #: ../config.c:176 msgid "Wrap scrolling" @@ -352,9 +351,7 @@ msgstr "" #: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" -msgstr "" -"A área de transferência em que o dados selecionados com o mouse vão ser " -"escritos" +msgstr "A área de transferência em que o dados selecionados com o mouse vão ser escritos" #. define default inputbar commands #: ../config.c:398 @@ -530,14 +527,11 @@ msgstr "[Sem nome]" #: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" -"Não foi possível ler o arquivo a partir de stdin e gravá-lo em um arquivo " -"temporário." +msgstr "Não foi possível ler o arquivo a partir de stdin e gravá-lo em um arquivo temporário." #: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" -"Formato de arquivo não suportado. Por favor, instale o plugin necessário." +msgstr "Formato de arquivo não suportado. Por favor, instale o plugin necessário." #: ../zathura.c:544 msgid "Document does not contain any pages" diff --git a/po/ru.po b/po/ru.po index 6059480..b8fbb25 100644 --- a/po/ru.po +++ b/po/ru.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-12-16 13:11+0000\n" +"PO-Revision-Date: 2014-02-14 03:22+0000\n" "Last-Translator: vp1981 \n" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" "ru/)\n" @@ -350,7 +350,7 @@ msgstr "Включить поддержку synctex" #: ../config.c:216 msgid "Enable D-Bus service" -msgstr "" +msgstr "Включить сервис D-Bus" #: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" @@ -493,15 +493,15 @@ msgstr "Редактор для synctex (передаётся далее про #: ../main.c:68 msgid "Move to given synctex position" -msgstr "" +msgstr "Перейти к указанному положению synctex" #: ../main.c:69 msgid "Highlight given position in the given process" -msgstr "" +msgstr "Подсветка заданного положения в заданном процессе" #: ../main.c:70 msgid "Start in a non-default mode" -msgstr "" +msgstr "Запустить в специальном режиме" #: ../page-widget.c:493 msgid "Loading..." @@ -518,7 +518,7 @@ msgstr "Сохранить изображение как" #: ../print.c:64 ../print.c:211 #, c-format msgid "Printing failed: %s" -msgstr "" +msgstr "Не удалось напечатать %s" #: ../shortcuts.c:1114 msgid "This document does not contain any index" @@ -530,9 +530,7 @@ msgstr "[Без названия]" #: ../zathura.c:473 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "" -"Не удалось прочитать файл со стандартного входа и записать его во временный " -"файл." +msgstr "Не удалось прочитать файл со стандартного входа и записать его во временный файл." #: ../zathura.c:534 msgid "Unsupported file type. Please install the necessary plugin." diff --git a/po/ta_IN.po b/po/ta_IN.po index 711cd95..3e8eabe 100644 --- a/po/ta_IN.po +++ b/po/ta_IN.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: mankand007 \n" "Language-Team: Tamil (India) (http://www.transifex.net/projects/p/zathura/" "language/ta_IN/)\n" diff --git a/po/tr.po b/po/tr.po index 8586935..518d3b4 100644 --- a/po/tr.po +++ b/po/tr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: hsngrms \n" "Language-Team: Turkish (http://www.transifex.net/projects/p/zathura/language/" "tr/)\n" diff --git a/po/uk_UA.po b/po/uk_UA.po index b6a02e5..61b44b3 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2013-11-20 09:50+0000\n" +"PO-Revision-Date: 2014-01-31 09:37+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" "zathura/language/uk_UA/)\n" From e2388f32006f77fe0de17ad0d64f74f8c1d734be Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 17 Feb 2014 12:06:27 +0100 Subject: [PATCH 125/129] Add Norwegian translation Signed-off-by: Sebastian Ramacher --- zathura.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/zathura.desktop b/zathura.desktop index 8efe8a2..09f8e7b 100644 --- a/zathura.desktop +++ b/zathura.desktop @@ -12,6 +12,7 @@ Comment[fr]=Un visionneur de document minimaliste Comment[he]=מציג מסמכים מינימליסטי Comment[id_ID]=Pembaca dokumen minimalis Comment[it]=Un visualizzatore di documenti minimalista +Comment[no]=En minimalistisk dokumentleser Comment[pl]=Minimalistyczna przeglądarka dokumentów Comment[pt_BR]=Um visualizador de documentos minimalista Comment[ru]=Минималистичный просмотрщик документов From d1a1f254586174d77ea4099dd227373065aec879 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 17 Feb 2014 12:10:23 +0100 Subject: [PATCH 126/129] Add Lithuanian translation Signed-off-by: Sebastian Ramacher --- zathura.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/zathura.desktop b/zathura.desktop index 09f8e7b..a9b29d9 100644 --- a/zathura.desktop +++ b/zathura.desktop @@ -12,6 +12,7 @@ Comment[fr]=Un visionneur de document minimaliste Comment[he]=מציג מסמכים מינימליסטי Comment[id_ID]=Pembaca dokumen minimalis Comment[it]=Un visualizzatore di documenti minimalista +Comment[lt]=Paprasta dokumentų skaitytuvė Comment[no]=En minimalistisk dokumentleser Comment[pl]=Minimalistyczna przeglądarka dokumentów Comment[pt_BR]=Um visualizador de documentos minimalista From d1b4aea056ee0331d74033c5b2127912bb691d72 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 17 Feb 2014 12:15:00 +0100 Subject: [PATCH 127/129] Update Portuguese translation Signed-off-by: Sebastian Ramacher --- po/pt_BR.po | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 6501e06..74c776f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -2,21 +2,19 @@ # See LICENSE file for license and copyright information # # Translators: -# salmora8 , 2013 -# salmora8 , 2012-2013 +# salmora8 , 2012-2014 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2014-01-31 10:35+0100\n" -"PO-Revision-Date: 2014-01-31 09:37+0000\n" +"PO-Revision-Date: 2014-02-17 12:14+0100\n" "Last-Translator: salmora8 \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" -"zathura/language/pt_BR/)\n" -"Language: pt_BR\n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/zathura/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../callbacks.c:301 @@ -347,7 +345,7 @@ msgstr "Ativar suporte synctex" #: ../config.c:216 msgid "Enable D-Bus service" -msgstr "" +msgstr "Habilitar serviço D-Bus" #: ../config.c:218 msgid "The clipboard into which mouse-selected data will be written" @@ -490,15 +488,15 @@ msgstr "Editor synctex (encaminhado para o comando synctex)" #: ../main.c:68 msgid "Move to given synctex position" -msgstr "" +msgstr "Mover para determinada posição synctex" #: ../main.c:69 msgid "Highlight given position in the given process" -msgstr "" +msgstr "Destacar determinada posição no determinado processo" #: ../main.c:70 msgid "Start in a non-default mode" -msgstr "" +msgstr "Começar em um modo não padrão" #: ../page-widget.c:493 msgid "Loading..." @@ -515,7 +513,7 @@ msgstr "Salvar imagem para" #: ../print.c:64 ../print.c:211 #, c-format msgid "Printing failed: %s" -msgstr "" +msgstr "Impressão falhou: %s" #: ../shortcuts.c:1114 msgid "This document does not contain any index" From 475871fe200c48695fe2603e6e0450294731c5fd Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 17 Feb 2014 14:20:54 +0100 Subject: [PATCH 128/129] Add Norwegian translation Signed-off-by: Sebastian Ramacher --- po/no.po | 536 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 536 insertions(+) create mode 100644 po/no.po diff --git a/po/no.po b/po/no.po new file mode 100644 index 0000000..d82a7ef --- /dev/null +++ b/po/no.po @@ -0,0 +1,536 @@ +# zathura - language file (Norwegian) +# See LICENSE file for license and copyright information +# +# Translators: +# maccyber , 2014 +msgid "" +msgstr "" +"Project-Id-Version: zathura\n" +"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" +"POT-Creation-Date: 2014-01-31 10:35+0100\n" +"PO-Revision-Date: 2014-02-17 12:13+0100\n" +"Last-Translator: maccyber \n" +"Language-Team: Norwegian (http://www.transifex.com/projects/p/zathura/language/no/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: no\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../callbacks.c:301 +#, c-format +msgid "Invalid input '%s' given." +msgstr "Ugyldig inndata '%s' gitt." + +#: ../callbacks.c:337 +#, c-format +msgid "Invalid index '%s' given." +msgstr "Ugyldig index '%s' gitt." + +#: ../callbacks.c:550 +#, c-format +msgid "Copied selected text to clipboard: %s" +msgstr "Kopierte markert tekst til utklippstavlen: %s" + +#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:152 +#: ../commands.c:268 ../commands.c:298 ../commands.c:324 ../commands.c:422 +#: ../commands.c:543 ../shortcuts.c:403 ../shortcuts.c:1201 +#: ../shortcuts.c:1230 ../shortcuts.c:1259 +msgid "No document opened." +msgstr "Ingen dokumenter åpnet." + +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:427 +msgid "Invalid number of arguments given." +msgstr "Ugyldig nummer av argumenter gitt." + +#: ../commands.c:53 +#, c-format +msgid "Could not update bookmark: %s" +msgstr "Kunne ikke oppdatere bokmerke: %s" + +#: ../commands.c:55 +#, c-format +msgid "Could not create bookmark: %s" +msgstr "Kunne ikke lage bokmerke: %s" + +#: ../commands.c:60 +#, c-format +msgid "Bookmark successfully updated: %s" +msgstr "Bokmerke er oppdatert: %s" + +#: ../commands.c:62 +#, c-format +msgid "Bookmark successfully created: %s" +msgstr "Bokmerket er laget: %s" + +#: ../commands.c:88 +#, c-format +msgid "Removed bookmark: %s" +msgstr "Fjernet bokmerke: %s" + +#: ../commands.c:90 +#, c-format +msgid "Failed to remove bookmark: %s" +msgstr "Kunne ikke fjerne bokmerke: %s" + +#: ../commands.c:116 +#, c-format +msgid "No such bookmark: %s" +msgstr "Bokmerke eksisterer ikke: %s" + +#: ../commands.c:162 +msgid "Title" +msgstr "Tittel" + +#: ../commands.c:163 +msgid "Author" +msgstr "Forfatter" + +#: ../commands.c:164 +msgid "Subject" +msgstr "Subjekt" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "Nøkkelord" + +#: ../commands.c:166 +msgid "Creator" +msgstr "Laget av" + +#: ../commands.c:167 +msgid "Producer" +msgstr "Produsent" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "Laget dato" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "Modifisert dato" + +#: ../commands.c:174 ../commands.c:196 +msgid "No information available." +msgstr "Ingen informasjon tilgjengelig." + +#: ../commands.c:234 +msgid "Too many arguments." +msgstr "For mange argumenter." + +#: ../commands.c:245 +msgid "No arguments given." +msgstr "Ingen argumenter gitt." + +#: ../commands.c:304 ../commands.c:330 +msgid "Document saved." +msgstr "Dokumentet er lagret." + +#: ../commands.c:306 ../commands.c:332 +msgid "Failed to save document." +msgstr "Kunne ikke lagre dokumentet." + +#: ../commands.c:309 ../commands.c:335 +msgid "Invalid number of arguments." +msgstr "Ugyldig nummer av argumenter." + +#: ../commands.c:446 +#, c-format +msgid "Couldn't write attachment '%s' to '%s'." +msgstr "Kunne ikke skrive vedlegg '%s' til '%s'." + +#: ../commands.c:448 +#, c-format +msgid "Wrote attachment '%s' to '%s'." +msgstr "Skrev vedlegg '%s' til '%s'." + +#: ../commands.c:492 +#, c-format +msgid "Wrote image '%s' to '%s'." +msgstr "Skrev bilde '%s' til '%s'." + +#: ../commands.c:494 +#, c-format +msgid "Couldn't write image '%s' to '%s'." +msgstr "Kunne ikke skrive bilde '%s' til '%s'." + +#: ../commands.c:501 +#, c-format +msgid "Unknown image '%s'." +msgstr "Ukjent bilde '%s'." + +#: ../commands.c:505 +#, c-format +msgid "Unknown attachment or image '%s'." +msgstr "Ukjent vedlegg eller bilde '%s'." + +#: ../commands.c:556 +msgid "Argument must be a number." +msgstr "Argumentet må være et tall." + +#: ../completion.c:250 +#, c-format +msgid "Page %d" +msgstr "Side %d" + +#: ../completion.c:293 +msgid "Attachments" +msgstr "Vedlegg" + +#. add images +#: ../completion.c:324 +msgid "Images" +msgstr "Bilder" + +#. zathura settings +#: ../config.c:136 +msgid "Database backend" +msgstr "Database backend" + +#: ../config.c:138 +msgid "Zoom step" +msgstr "Zoom nivå" + +#: ../config.c:140 +msgid "Padding between pages" +msgstr "Avstand mellom sider" + +#: ../config.c:142 +msgid "Number of pages per row" +msgstr "Nummer av sider per rad" + +#: ../config.c:144 +msgid "Column of the first page" +msgstr "" + +#: ../config.c:146 +msgid "Scroll step" +msgstr "Skrolle nivå" + +#: ../config.c:148 +msgid "Horizontal scroll step" +msgstr "" + +#: ../config.c:150 +msgid "Full page scroll overlap" +msgstr "" + +#: ../config.c:152 +msgid "Zoom minimum" +msgstr "Zoom minimum" + +#: ../config.c:154 +msgid "Zoom maximum" +msgstr "Zoom maximum" + +#: ../config.c:156 +msgid "Maximum number of pages to keep in the cache" +msgstr "Maksimum antall sider å holde i mellomlagringen" + +#: ../config.c:158 +msgid "Number of positions to remember in the jumplist" +msgstr "Antall posisjoner å huske i hopp-til-listen" + +#: ../config.c:160 +msgid "Recoloring (dark color)" +msgstr "Om-farger (mørk farge)" + +#: ../config.c:161 +msgid "Recoloring (light color)" +msgstr "Om-farge (lys farge)" + +#: ../config.c:162 +msgid "Color for highlighting" +msgstr "Farge for utheving" + +#: ../config.c:164 +msgid "Color for highlighting (active)" +msgstr "Farge for utheving (aktiv)" + +#: ../config.c:166 +msgid "'Loading ...' background color" +msgstr "'Laster ...' bakgrunnsfarge" + +#: ../config.c:168 +msgid "'Loading ...' foreground color" +msgstr "'Laster ...' forgrunnsfarge" + +#: ../config.c:172 +msgid "Recolor pages" +msgstr "Om-farge sider" + +#: ../config.c:174 +msgid "When recoloring keep original hue and adjust lightness only" +msgstr "" + +#: ../config.c:176 +msgid "Wrap scrolling" +msgstr "" + +#: ../config.c:178 +msgid "Page aware scrolling" +msgstr "" + +#: ../config.c:180 +msgid "Advance number of pages per row" +msgstr "" + +#: ../config.c:182 +msgid "Horizontally centered zoom" +msgstr "Horisontalsentrert zoom" + +#: ../config.c:184 +msgid "Align link target to the left" +msgstr "" + +#: ../config.c:186 +msgid "Let zoom be changed when following links" +msgstr "La zoom bli endret når følgende linker" + +#: ../config.c:188 +msgid "Center result horizontally" +msgstr "Sentrer resultatene horisontalt" + +#: ../config.c:190 +msgid "Transparency for highlighting" +msgstr "Klarhet for utheving" + +#: ../config.c:192 +msgid "Render 'Loading ...'" +msgstr "Render 'Laster ...'" + +#: ../config.c:193 +msgid "Adjust to when opening file" +msgstr "Juster til når du åpner filen" + +#: ../config.c:195 +msgid "Show hidden files and directories" +msgstr "Vis skjulte filer og mapper" + +#: ../config.c:197 +msgid "Show directories" +msgstr "Vis mapper" + +#: ../config.c:199 +msgid "Always open on first page" +msgstr "Alltid åpne på første side" + +#: ../config.c:201 +msgid "Highlight search results" +msgstr "Uthev søkeresultater" + +#: ../config.c:204 +msgid "Enable incremental search" +msgstr "" + +#: ../config.c:206 +msgid "Clear search results on abort" +msgstr "Stryk ut søkeresulteter ved avbrytelse" + +#: ../config.c:208 +msgid "Use basename of the file in the window title" +msgstr "" + +#: ../config.c:210 +msgid "Display the page number in the window title" +msgstr "Vis nummer av sider i vinduestittelen" + +#: ../config.c:212 +msgid "Use basename of the file in the statusbar" +msgstr "" + +#: ../config.c:214 ../main.c:66 +msgid "Enable synctex support" +msgstr "" + +#: ../config.c:216 +msgid "Enable D-Bus service" +msgstr "Aktiv D-Bus servicen" + +#: ../config.c:218 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + +#. define default inputbar commands +#: ../config.c:398 +msgid "Add a bookmark" +msgstr "Legg til bokmerke" + +#: ../config.c:399 +msgid "Delete a bookmark" +msgstr "Slett bokmerke" + +#: ../config.c:400 +msgid "List all bookmarks" +msgstr "List alle bokmerker" + +#: ../config.c:401 +msgid "Close current file" +msgstr "Lukk den gjeldende filen" + +#: ../config.c:402 +msgid "Show file information" +msgstr "Vis filinformasjon" + +#: ../config.c:403 +msgid "Execute a command" +msgstr "Kjør en kommando" + +#: ../config.c:404 +msgid "Show help" +msgstr "Vis hjelp" + +#: ../config.c:405 +msgid "Open document" +msgstr "Åpne dokument" + +#: ../config.c:406 +msgid "Close zathura" +msgstr "Lukk zathura" + +#: ../config.c:407 +msgid "Print document" +msgstr "Skriv ut dokument" + +#: ../config.c:408 +msgid "Save document" +msgstr "Lagre dokument" + +#: ../config.c:409 +msgid "Save document (and force overwriting)" +msgstr "Lagre dokument (og tving til å skrive over)" + +#: ../config.c:410 +msgid "Save attachments" +msgstr "Lagre vedlegg" + +#: ../config.c:411 +msgid "Set page offset" +msgstr "" + +#: ../config.c:412 +msgid "Mark current location within the document" +msgstr "Marker nåværende lokalasjon i dokumentet" + +#: ../config.c:413 +msgid "Delete the specified marks" +msgstr "Slett spesifiserte merker" + +#: ../config.c:414 +msgid "Don't highlight current search results" +msgstr "Ikke uthev gjeldende søkeresultater" + +#: ../config.c:415 +msgid "Highlight current search results" +msgstr "Uthev følgende søkeresultater" + +#: ../config.c:416 +msgid "Show version information" +msgstr "Vis versjonsinformasjon" + +#: ../links.c:202 ../links.c:281 +msgid "Failed to run xdg-open." +msgstr "Klarte ikke å kjøre xdg-open." + +#: ../links.c:220 +#, c-format +msgid "Link: page %d" +msgstr "Link: side %d" + +#: ../links.c:227 +#, c-format +msgid "Link: %s" +msgstr "" + +#: ../links.c:231 +msgid "Link: Invalid" +msgstr "Link: Ugyldig" + +#: ../main.c:57 +msgid "Reparents to window specified by xid" +msgstr "" + +#: ../main.c:58 +msgid "Path to the config directory" +msgstr "Sti til konfigureringsmappe" + +#: ../main.c:59 +msgid "Path to the data directory" +msgstr "Sti til data-mappe" + +#: ../main.c:60 +msgid "Path to the directories containing plugins" +msgstr "Sti til mapper som inneholder plugins" + +#: ../main.c:61 +msgid "Fork into the background" +msgstr "" + +#: ../main.c:62 +msgid "Document password" +msgstr "Dokument passord" + +#: ../main.c:63 +msgid "Page number to go to" +msgstr "Sidetall å gå til" + +#: ../main.c:64 +msgid "Log level (debug, info, warning, error)" +msgstr "Logg nivå (diagnostisering, info, advarsler, feil)" + +#: ../main.c:65 +msgid "Print version information" +msgstr "Skriv ut versjonsinformasjon" + +#: ../main.c:67 +msgid "Synctex editor (forwarded to the synctex command)" +msgstr "" + +#: ../main.c:68 +msgid "Move to given synctex position" +msgstr "" + +#: ../main.c:69 +msgid "Highlight given position in the given process" +msgstr "" + +#: ../main.c:70 +msgid "Start in a non-default mode" +msgstr "Start i ikke-standard modus" + +#: ../page-widget.c:493 +msgid "Loading..." +msgstr "Laster..." + +#: ../page-widget.c:808 +msgid "Copy image" +msgstr "Kopier bilde" + +#: ../page-widget.c:809 +msgid "Save image as" +msgstr "Lagre bilde som" + +#: ../print.c:64 ../print.c:211 +#, c-format +msgid "Printing failed: %s" +msgstr "Utskrift feilet: %s" + +#: ../shortcuts.c:1114 +msgid "This document does not contain any index" +msgstr "Dette dokumenetet inneholder ikke noen index" + +#: ../zathura.c:192 ../zathura.c:988 +msgid "[No name]" +msgstr "[Inget navn]" + +#: ../zathura.c:473 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "Kunne ikke lese fil fra stdin og skrive til temporærfil." + +#: ../zathura.c:534 +msgid "Unsupported file type. Please install the necessary plugin." +msgstr "Usupportert filtype. Vennligst innstaller den nødvendige pluginen." + +#: ../zathura.c:544 +msgid "Document does not contain any pages" +msgstr "Dokumentet inneholder ingen sider" From 0f005c0d5dd56ddb5bdafd7b2f522a39d68af6e8 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Mon, 17 Feb 2014 15:33:53 +0100 Subject: [PATCH 129/129] Version 0.2.7 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index f954c41..656bc5d 100644 --- a/config.mk +++ b/config.mk @@ -3,7 +3,7 @@ ZATHURA_VERSION_MAJOR = 0 ZATHURA_VERSION_MINOR = 2 -ZATHURA_VERSION_REV = 6 +ZATHURA_VERSION_REV = 7 # If the API changes, the API version and the ABI version have to be bumped. ZATHURA_API_VERSION = 2 # If the ABI breaks for any reason, this has to be bumped.