From 10115db62f636a1b42cf7941acab6014ce133fb7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 21 Aug 2013 18:32:18 +0200 Subject: [PATCH 01/90] Rewrite render thread as request based system ZathuraRenderer is a thread pool rendering the pages. Every page widget holds a ZathuraRenderRequest instance to request its page to be rendered. This object can also be used to abort the request in case the page is not visible anymore. Signed-off-by: Sebastian Ramacher --- commands.c | 4 +- page-widget.c | 22 ++- print.c | 8 +- render.c | 488 +++++++++++++++++++++++++++++++++++--------------- render.h | 140 ++++++++++++--- types.h | 5 + zathura.c | 19 +- zathura.h | 6 +- 8 files changed, 500 insertions(+), 192 deletions(-) diff --git a/commands.c b/commands.c index 76e2a27..b12c979 100644 --- a/commands.c +++ b/commands.c @@ -381,9 +381,9 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu GtkWidget* page_widget = zathura_page_get_widget(zathura, page); g_object_set(page_widget, "draw-links", FALSE, NULL); - render_lock(zathura->sync.render_thread); + zathura_renderer_lock(zathura->sync.render_thread); girara_list_t* result = zathura_page_search_text(page, input, &error); - render_unlock(zathura->sync.render_thread); + zathura_renderer_unlock(zathura->sync.render_thread); if (result == NULL || girara_list_size(result) == 0) { girara_list_free(result); diff --git a/page-widget.c b/page-widget.c index adf69da..86096eb 100644 --- a/page-widget.c +++ b/page-widget.c @@ -15,6 +15,7 @@ #include "utils.h" #include "shortcuts.h" #include "synctex.h" +#include "zathura.h" G_DEFINE_TYPE(ZathuraPage, zathura_page_widget, GTK_TYPE_DRAWING_AREA) @@ -22,6 +23,7 @@ typedef struct zathura_page_widget_private_s { zathura_page_t* page; /**< Page object */ zathura_t* zathura; /**< Zathura object */ cairo_surface_t* surface; /**< Cairo surface */ + ZathuraRenderRequest* render_request; /* Request object */ bool render_requested; /**< No surface and rendering has been requested */ gint64 last_view; /**< Last time the page has been viewed */ mutex lock; /**< Lock */ @@ -144,6 +146,7 @@ zathura_page_widget_init(ZathuraPage* widget) priv->page = NULL; priv->surface = NULL; priv->render_requested = false; + priv->render_request = NULL; priv->last_view = g_get_real_time(); priv->links.list = NULL; @@ -177,7 +180,18 @@ zathura_page_widget_new(zathura_t* zathura, zathura_page_t* page) { g_return_val_if_fail(page != NULL, NULL); - return g_object_new(ZATHURA_TYPE_PAGE, "page", page, "zathura", zathura, NULL); + GObject* ret = g_object_new(ZATHURA_TYPE_PAGE, "page", page, "zathura", zathura, NULL); + if (ret == NULL) { + return NULL; + } + + ZathuraPage* widget = ZATHURA_PAGE(ret); + zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); + priv->render_request = zathura_render_request_new(zathura->sync.render_thread, page); + g_signal_connect_object(priv->render_request, "completed", + G_CALLBACK(zathura_page_widget_update_surface), widget, G_CONNECT_SWAPPED); + + return GTK_WIDGET(ret); } static void @@ -190,6 +204,10 @@ 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); } @@ -485,7 +503,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* render real page */ if (priv->render_requested == false) { priv->render_requested = true; - render_page(priv->zathura->sync.render_thread, priv->page); + zathura_render_request(priv->render_request); } } mutex_unlock(&(priv->lock)); diff --git a/print.c b/print.c index b32e5b3..8f0a39c 100644 --- a/print.c +++ b/print.c @@ -109,9 +109,9 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* /* Try to render the page without a temporary surface. This only works with * plugins that support rendering to any surface. */ girara_debug("printing page %d ...", page_number); - render_lock(zathura->sync.render_thread); + zathura_renderer_lock(zathura->sync.render_thread); int err = zathura_page_render(page, cairo, true); - render_unlock(zathura->sync.render_thread); + zathura_renderer_unlock(zathura->sync.render_thread); if (err == ZATHURA_ERROR_OK) { return; } @@ -144,9 +144,9 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* /* Render the page to the temporary surface */ girara_debug("printing page %d ...", page_number); - render_lock(zathura->sync.render_thread); + zathura_renderer_lock(zathura->sync.render_thread); err = zathura_page_render(page, temp_cairo, true); - render_unlock(zathura->sync.render_thread); + zathura_renderer_unlock(zathura->sync.render_thread); if (err != ZATHURA_ERROR_OK) { cairo_destroy(temp_cairo); cairo_surface_destroy(surface); diff --git a/render.c b/render.c index e8bcde3..648b78a 100644 --- a/render.c +++ b/render.c @@ -5,7 +5,6 @@ #include #include #include - #include "glib-compat.h" #include "render.h" #include "zathura.h" @@ -14,80 +13,298 @@ #include "page-widget.h" #include "utils.h" -static void render_job(void* data, void* user_data); -static bool render(zathura_t* zathura, zathura_page_t* page); -static gint render_thread_sort(gconstpointer a, gconstpointer b, gpointer data); +/* define the two types */ +G_DEFINE_TYPE(ZathuraRenderer, zathura_renderer, G_TYPE_OBJECT) +G_DEFINE_TYPE(ZathuraRenderRequest, zathura_render_request, G_TYPE_OBJECT) -struct render_thread_s { +/* private methods for ZathuraRenderer */ +static void zathura_renderer_finalize(GObject* object); +/* private methods for ZathuraRenderRequest */ +static void zathura_render_request_finalize(GObject* object); + +static void render_job(void* data, void* user_data); +static bool render(ZathuraRenderRequest* request, ZathuraRenderer* renderer); +static gint render_thread_sort(gconstpointer a, gconstpointer b, gpointer data); +static void color2double(GdkColor* col, double* v); + + +/* private data for ZathuraRenderer */ +typedef struct private_s { GThreadPool* pool; /**< Pool of threads */ mutex mutex; /**< Render lock */ - bool about_to_close; /**< Render thread is to be freed */ + volatile bool about_to_close; /**< Render thread is to be freed */ + + /* recolor information */ + struct { + bool enabled; + bool hue; + + double light[3]; + double dark[3]; + } recolor; +} private_t; + +/* private data for ZathuraRenderRequest */ +typedef struct request_private_s { + ZathuraRenderer* renderer; + zathura_page_t* page; + bool requested; + bool aborted; +} request_private_t; + +#define GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_RENDERER, private_t)) +#define REQUEST_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_RENDER_REQUEST, \ + request_private_t)) + +/* init, new and free for ZathuraRenderer */ + +static void +zathura_renderer_class_init(ZathuraRendererClass* class) +{ + /* add private members */ + g_type_class_add_private(class, sizeof(private_t)); + + /* overwrite methods */ + GObjectClass* object_class = G_OBJECT_CLASS(class); + object_class->finalize = zathura_renderer_finalize; +// object_class->set_property = zathura_page_widget_set_property; +// object_class->get_property = zathura_page_widget_get_property; +} + +static void +zathura_renderer_init(ZathuraRenderer* renderer) +{ + private_t* priv = GET_PRIVATE(renderer); + priv->pool = g_thread_pool_new(render_job, renderer, 1, TRUE, NULL); + priv->about_to_close = false; + g_thread_pool_set_sort_function(priv->pool, render_thread_sort, NULL); + mutex_init(&priv->mutex); + + priv->recolor.enabled = false; + priv->recolor.hue = true; + priv->recolor.light[0] = priv->recolor.light[1] = priv->recolor.light[2] = 1; + priv->recolor.dark[0] = priv->recolor.dark[1] = priv->recolor.dark[2] = 1; +} + +ZathuraRenderer* +zathura_renderer_new(zathura_t* zathura) +{ + g_return_val_if_fail(zathura != NULL, NULL); + + return g_object_new(ZATHURA_TYPE_RENDERER, /*"page", page, "zathura", zathura, */ NULL); +} + +static void +zathura_renderer_finalize(GObject* object) +{ + ZathuraRenderer* renderer = ZATHURA_RENDERER(object); + private_t* priv = GET_PRIVATE(renderer); + + zathura_renderer_stop(renderer); + if (priv->pool) { + g_thread_pool_free(priv->pool, TRUE, TRUE); + } + mutex_free(&(priv->mutex)); +} + +/* init, new and free for ZathuraRenderRequest */ + +enum { + REQUEST_COMPLETED, + REQUEST_LAST_SIGNAL }; +static guint request_signals[REQUEST_LAST_SIGNAL] = { 0 }; + +static void +zathura_render_request_class_init(ZathuraRenderRequestClass* class) +{ + /* add private members */ + g_type_class_add_private(class, sizeof(request_private_t)); + + /* overwrite methods */ + GObjectClass* object_class = G_OBJECT_CLASS(class); + object_class->finalize = zathura_render_request_finalize; +// object_class->set_property = zathura_page_widget_set_property; +// object_class->get_property = zathura_page_widget_get_property; + + request_signals[REQUEST_COMPLETED] = g_signal_new("completed", + ZATHURA_TYPE_RENDER_REQUEST, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); +} + +static void +zathura_render_request_init(ZathuraRenderRequest* request) +{ + request_private_t* priv = REQUEST_GET_PRIVATE(request); + priv->renderer = NULL; + priv->page = NULL; +} + +ZathuraRenderRequest* +zathura_render_request_new(ZathuraRenderer* renderer, zathura_page_t* page) +{ + g_return_val_if_fail(renderer != NULL && page != NULL, NULL); + + GObject* obj = g_object_new(ZATHURA_TYPE_RENDER_REQUEST, NULL); + if (obj == NULL) { + return NULL; + } + + ZathuraRenderRequest* request = ZATHURA_RENDER_REQUEST(obj); + request_private_t* priv = REQUEST_GET_PRIVATE(request); + /* we want to make sure that renderer lives long enough */ + priv->renderer = g_object_ref(renderer); + priv->page = page; + priv->aborted = false; + priv->requested = false; + + return request; +} + +static void +zathura_render_request_finalize(GObject* object) +{ + ZathuraRenderRequest* request = ZATHURA_RENDER_REQUEST(object); + request_private_t* priv = REQUEST_GET_PRIVATE(request); + + if (priv->renderer) { + g_object_unref(priv->renderer); + } +} + +/* renderer methods */ + +bool +zathura_renderer_recolor_enabled(ZathuraRenderer* renderer) +{ + g_return_val_if_fail(ZATHURA_IS_RENDERER(renderer), false); + + return GET_PRIVATE(renderer)->recolor.enabled; +} + +void +zathura_renderer_enable_recolor(ZathuraRenderer* renderer, bool enable) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + GET_PRIVATE(renderer)->recolor.enabled = enable; +} + +bool +zathura_renderer_recolor_hue_enabled(ZathuraRenderer* renderer) +{ + g_return_val_if_fail(ZATHURA_IS_RENDERER(renderer), false); + + return GET_PRIVATE(renderer)->recolor.hue; +} + +void +zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, bool enable) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + GET_PRIVATE(renderer)->recolor.hue = enable; +} + +void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, + GdkColor* light, GdkColor* dark) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + g_return_if_fail(light != NULL && dark != NULL); + + private_t* priv = GET_PRIVATE(renderer); + color2double(light, priv->recolor.light); + color2double(dark, priv->recolor.dark); +} + +void +zathura_renderer_lock(ZathuraRenderer* renderer) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + private_t* priv = GET_PRIVATE(renderer); + mutex_lock(&priv->mutex); +} + +void +zathura_renderer_unlock(ZathuraRenderer* renderer) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + private_t* priv = GET_PRIVATE(renderer); + mutex_unlock(&priv->mutex); +} + +void +zathura_renderer_stop(ZathuraRenderer* renderer) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + GET_PRIVATE(renderer)->about_to_close = true; +} + + +/* ZathuraRenderRequest methods */ + +void +zathura_render_request(ZathuraRenderRequest* request) +{ + g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); + + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + private_t* priv = GET_PRIVATE(request_priv->renderer); + if (request_priv->requested == false) { + request_priv->requested = true; + request_priv->aborted = false; + + g_thread_pool_push(priv->pool, request, NULL); + } +} + +void +zathura_render_request_abort(ZathuraRenderRequest* request) +{ + g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); + + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + if (request_priv->requested == true) { + request_priv->aborted = true; + } +} + + static void render_job(void* data, void* user_data) { - zathura_page_t* page = data; - zathura_t* zathura = user_data; - if (page == NULL || zathura == NULL) { + ZathuraRenderRequest* request = data; + ZathuraRenderer* renderer = user_data; + g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + private_t* priv = GET_PRIVATE(renderer); + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + if (priv->about_to_close == true || request_priv->aborted == true) { + /* back out early */ + request_priv->requested = false; return; } - girara_debug("rendering page %d ...", zathura_page_get_index(page) + 1); - if (render(zathura, page) != true) { - girara_error("Rendering failed (page %d)\n", zathura_page_get_index(page) + 1); + girara_debug("Rendering page %d ...", zathura_page_get_index(request_priv->page) + 1); + if (render(request, renderer) != true) { + girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); } + request_priv->requested = false; } -render_thread_t* -render_init(zathura_t* zathura) -{ - render_thread_t* render_thread = g_malloc0(sizeof(render_thread_t)); - - /* setup */ - render_thread->pool = g_thread_pool_new(render_job, zathura, 1, TRUE, NULL); - if (render_thread->pool == NULL) { - goto error_free; - } - - render_thread->about_to_close = false; - g_thread_pool_set_sort_function(render_thread->pool, render_thread_sort, zathura); - mutex_init(&render_thread->mutex); - - return render_thread; - -error_free: - - render_free(render_thread); - return NULL; -} - -void -render_free(render_thread_t* render_thread) -{ - if (render_thread == NULL) { - return; - } - - render_thread->about_to_close = true; - if (render_thread->pool) { - g_thread_pool_free(render_thread->pool, TRUE, TRUE); - } - - mutex_free(&(render_thread->mutex)); - g_free(render_thread); -} - -bool -render_page(render_thread_t* render_thread, zathura_page_t* page) -{ - if (render_thread == NULL || page == NULL || render_thread->pool == NULL || render_thread->about_to_close == true) { - return false; - } - - g_thread_pool_push(render_thread->pool, page, NULL); - return true; -} static void color2double(GdkColor* col, double* v) @@ -101,7 +318,7 @@ color2double(GdkColor* col, double* v) Assumes that l is in the interval l1, l2 and corrects the value to force u=0 on l1 and l2 */ static double -colorumax(double* h, double l, double l1, double l2) +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) { @@ -143,11 +360,11 @@ colorumax(double* h, double l, double l1, double l2) static bool -render(zathura_t* zathura, zathura_page_t* page) +render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) { - if (zathura == NULL || page == NULL || zathura->sync.render_thread->about_to_close == true) { - return false; - } + private_t* priv = GET_PRIVATE(renderer); + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + zathura_page_t* page = request_priv->page; /* create cairo surface */ unsigned int page_width = 0; @@ -155,13 +372,11 @@ render(zathura_t* zathura, zathura_page_t* page) const double real_scale = page_calc_height_width(page, &page_height, &page_width, false); cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height); - if (surface == NULL) { return false; } cairo_t* cairo = cairo_create(surface); - if (cairo == NULL) { cairo_surface_destroy(surface); return false; @@ -178,20 +393,24 @@ render(zathura_t* zathura, zathura_page_t* page) cairo_scale(cairo, real_scale, real_scale); } - render_lock(zathura->sync.render_thread); + zathura_renderer_lock(renderer); if (zathura_page_render(page, cairo, false) != ZATHURA_ERROR_OK) { - render_unlock(zathura->sync.render_thread); + zathura_renderer_unlock(renderer); cairo_destroy(cairo); cairo_surface_destroy(surface); return false; } - render_unlock(zathura->sync.render_thread); + zathura_renderer_unlock(renderer); cairo_restore(cairo); cairo_destroy(cairo); - const int rowstride = cairo_image_surface_get_stride(surface); - unsigned char* image = cairo_image_surface_get_data(surface); + /* before recoloring, check if we've been aborted */ + if (priv->about_to_close == true || request_priv->aborted == true) { + cairo_surface_destroy(surface); + return true; + } + /* recolor */ /* uses a representation of a rgb color as follows: @@ -199,72 +418,84 @@ render(zathura_t* zathura, zathura_page_t* page) - a hue vector, which indicates a radian direction from the grey axis, inside the equal lightness plane. - a saturation scalar between 0,1. It is 0 when grey, 1 when the color is in the boundary of the rgb cube. */ - if (zathura->global.recolor == true) { + if (priv->recolor.enabled == true) { + const int rowstride = cairo_image_surface_get_stride(surface); + unsigned char* image = cairo_image_surface_get_data(surface); + /* RGB weights for computing lightness. Must sum to one */ - double a[] = {0.30, 0.59, 0.11}; + static const double a[] = {0.30, 0.59, 0.11}; - double l1, l2, l, s, u, t; - double h[3]; - double rgb1[3], rgb2[3], rgb[3]; - - color2double(&zathura->ui.colors.recolor_dark_color, rgb1); - color2double(&zathura->ui.colors.recolor_light_color, rgb2); - - l1 = (a[0]*rgb1[0] + a[1]*rgb1[1] + a[2]*rgb1[2]); - l2 = (a[0]*rgb2[0] + a[1]*rgb2[1] + a[2]*rgb2[2]); +#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]); for (unsigned int y = 0; y < page_height; y++) { unsigned char* data = image + y * rowstride; - for (unsigned int x = 0; x < page_width; x++) { + for (unsigned int x = 0; x < page_width; x++, data += 4) { /* Careful. data color components blue, green, red. */ - rgb[0] = (double) data[2] / 256.; - rgb[1] = (double) data[1] / 256.; - rgb[2] = (double) data[0] / 256.; + const double rgb[3] = { + (double) data[2] / 256., + (double) data[1] / 256., + (double) data[0] / 256. + }; /* compute h, s, l data */ - l = a[0]*rgb[0] + a[1]*rgb[1] + a[2]*rgb[2]; + double l = a[0]*rgb[0] + a[1]*rgb[1] + a[2]*rgb[2]; - h[0] = rgb[0] - l; - h[1] = rgb[1] - l; - h[2] = rgb[2] - l; + const double h[3] = { + rgb[0] - l, + rgb[1] - l, + rgb[2] - l + }; - /* u is the maximum possible saturation for given h and l. s is a rescaled saturation between 0 and 1 */ - u = colorumax(h, l, 0, 1); + /* u is the maximum possible saturation for given h and l. s is a + * rescaled saturation between 0 and 1 */ + double u = colorumax(h, l, 0, 1); + double s; if (u == 0) { s = 0; } else { s = 1/u; } - /* Interpolates lightness between light and dark colors. white goes to light, and black goes to dark. */ - t = l; + /* Interpolates lightness between light and dark colors. white goes to + * light, and black goes to dark. */ + const double t = l; l = t * (l2 - l1) + l1; - if (zathura->global.recolor_keep_hue == true) { - /* adjusting lightness keeping hue of current color. white and black go to grays of same ligtness - as light and dark colors. */ + if (priv->recolor.hue == true) { + /* adjusting lightness keeping hue of current color. white and black + * go to grays of same ligtness as light and dark colors. */ u = colorumax(h, l, l1, l2); data[2] = (unsigned char)round(255.*(l + s*u * h[0])); data[1] = (unsigned char)round(255.*(l + s*u * h[1])); data[0] = (unsigned char)round(255.*(l + s*u * h[2])); } else { - /* Linear interpolation between dark and light with color ligtness as a parameter */ + /* linear interpolation between dark and light with color ligtness as + * a parameter */ data[2] = (unsigned char)round(255.*(t * (rgb2[0] - rgb1[0]) + rgb1[0])); data[1] = (unsigned char)round(255.*(t * (rgb2[1] - rgb1[1]) + rgb1[1])); data[0] = (unsigned char)round(255.*(t * (rgb2[2] - rgb1[2]) + rgb1[2])); } - - data += 4; } } + +#undef rgb1 +#undef rgb2 } - if (zathura->sync.render_thread->about_to_close == false) { + if (priv->about_to_close == false && request_priv->aborted == false) { /* update the widget */ + /* gdk_threads_enter(); GtkWidget* widget = zathura_page_get_widget(zathura, page); zathura_page_widget_update_surface(ZATHURA_PAGE(widget), surface); + gdk_threads_leave(); */ + + gdk_threads_enter(); + g_signal_emit(request, request_signals[REQUEST_COMPLETED], 0, surface); gdk_threads_leave(); } @@ -296,48 +527,21 @@ render_all(zathura_t* zathura) static gint render_thread_sort(gconstpointer a, gconstpointer b, gpointer data) { - if (a == NULL || b == NULL || data == NULL) { + if (a == NULL || b == NULL) { return 0; } - zathura_page_t* page_a = (zathura_page_t*) a; - zathura_page_t* page_b = (zathura_page_t*) b; - zathura_t* zathura = (zathura_t*) data; - - unsigned int page_a_index = zathura_page_get_index(page_a); - unsigned int page_b_index = zathura_page_get_index(page_b); - - gint64 last_view_a = 0; - gint64 last_view_b = 0; - - g_object_get(zathura->pages[page_a_index], "last-view", &last_view_a, NULL); - g_object_get(zathura->pages[page_b_index], "last-view", &last_view_b, NULL); - - if (last_view_a < last_view_b) { - return -1; - } else if (last_view_a > last_view_b) { - return 1; + ZathuraRenderRequest* request_a = (ZathuraRenderRequest*) a; + ZathuraRenderRequest* request_b = (ZathuraRenderRequest*) b; + request_private_t* priv_a = REQUEST_GET_PRIVATE(request_a); + request_private_t* priv_b = REQUEST_GET_PRIVATE(request_b); + if (priv_a->aborted == priv_b->aborted) { + unsigned int page_a_index = zathura_page_get_index(priv_a->page); + unsigned int page_b_index = zathura_page_get_index(priv_b->page); + return page_a_index < page_b_index ? -1 : + (page_a_index > page_b_index ? 1 : 0); } - return 0; -} - -void -render_lock(render_thread_t* render_thread) -{ - if (render_thread == NULL) { - return; - } - - mutex_lock(&render_thread->mutex); -} - -void -render_unlock(render_thread_t* render_thread) -{ - if (render_thread == NULL) { - return; - } - - mutex_unlock(&render_thread->mutex); + /* sort aborted entries earlier so that the are thrown out of the queue */ + return priv_a->aborted ? 1 : -1; } diff --git a/render.h b/render.h index 2d7a12c..950ed66 100644 --- a/render.h +++ b/render.h @@ -6,34 +6,131 @@ #include #include #include +#include "types.h" -#include "zathura.h" -#include "callbacks.h" +typedef struct zathura_renderer_class_s ZathuraRendererClass; + +struct zathura_renderer_s +{ + GObject parent; +}; + +struct zathura_renderer_class_s +{ + GObjectClass parent_class; +}; + +#define ZATHURA_TYPE_RENDERER \ + (zathura_renderer_get_type()) +#define ZATHURA_RENDERER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), ZATHURA_TYPE_RENDERER, ZathuraRenderer)) +#define ZATHURA_RENDERER_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_CAST((obj), ZATHURA_TYPE_RENDERER, ZathuraRendererClass)) +#define ZATHURA_IS_RENDERER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZATHURA_TYPE_RENDERER)) +#define ZATHURA_IS_RENDERER_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((obj), ZATHURA_TYPE_RENDERER)) +#define ZATHURA_RENDERER_GET_CLASS \ + (G_TYPE_INSTANCE_GET_CLASS((obj), ZATHURA_TYPE_RENDERER, ZathuraRendererClass)) /** - * This function initializes a render thread - * - * @param zathura object - * @return The render thread object or NULL if an error occured + * Returns the type of the renderer. + * @return the type */ -render_thread_t* render_init(zathura_t* zathura); +GType zathura_renderer_get_type(void); +/** + * Create a page view widget. + * @param zathura the zathura instance + * @param page the page to be displayed + * @return a page view widget + */ +ZathuraRenderer* zathura_renderer_new(zathura_t* zathura); + +bool zathura_renderer_recolor_enabled(ZathuraRenderer* renderer); +void zathura_renderer_enable_recolor(ZathuraRenderer* renderer, bool enable); +bool zathura_renderer_recolor_hue_enabled(ZathuraRenderer* renderer); +void zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, + bool enable); +void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, + GdkColor* light, GdkColor* dark); + +void zathura_renderer_stop(ZathuraRenderer* renderer); /** - * This function destroys the render thread object + * Lock the render thread. This is useful if you want to render on your own (e.g + * for printing). * - * @param render_thread The render thread object + * @param render_thread The render thread object. */ -void render_free(render_thread_t* render_thread); +void zathura_renderer_lock(ZathuraRenderer* renderer); + +/** + * Unlock the render thread. + * + * @param render_thread The render thread object. + */ +void zathura_renderer_unlock(ZathuraRenderer* renderer); + + + +typedef struct zathura_render_request_s ZathuraRenderRequest; +typedef struct zathura_render_request_class_s ZathuraRenderRequestClass; + +struct zathura_render_request_s +{ + GObject parent; +}; + +struct zathura_render_request_class_s +{ + GObjectClass parent_class; +}; + +#define ZATHURA_TYPE_RENDER_REQUEST \ + (zathura_render_request_get_type()) +#define ZATHURA_RENDER_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), ZATHURA_TYPE_RENDER_REQUEST, \ + ZathuraRenderRequest)) +#define ZATHURA_RENDER_REQUEST_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_CAST((obj), ZATHURA_TYPE_RENDER_REQUEST, \ + ZathuraRenderRequestClass)) +#define ZATHURA_IS_RENDER_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZATHURA_TYPE_RENDER_REQUEST)) +#define ZATHURA_IS_RENDER_REQUEST_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((obj), ZATHURA_TYPE_RENDER_REQUEST)) +#define ZATHURA_RENDER_REQUEST_GET_CLASS \ + (G_TYPE_INSTANCE_GET_CLASS((obj), ZATHURA_TYPE_RENDER_REQUEST, \ + ZathuraRenderRequestClass)) + +/** + * Returns the type of the renderer. + * @return the type + */ +GType zathura_page_render_info_get_type(void); +/** + * Create a page view widget. + * @param zathura the zathura instance + * @param page the page to be displayed + * @return a page view widget + */ +ZathuraRenderRequest* zathura_render_request_new(ZathuraRenderer* renderer, + zathura_page_t* page); /** * This function is used to add a page to the render thread list * that should be rendered. * - * @param render_thread The render thread object - * @param page The page that should be rendered - * @return true if no error occured + * @param request request object of the page that should be renderer */ -bool render_page(render_thread_t* render_thread, zathura_page_t* page); +void zathura_render_request(ZathuraRenderRequest* request); + +/** + * Abort an existing render request. + * + * @param reqeust request that should be aborted + */ +void zathura_render_request_abort(ZathuraRenderRequest* request); + /** * This function is used to unmark all pages as not rendered. This should @@ -44,19 +141,4 @@ bool render_page(render_thread_t* render_thread, zathura_page_t* page); */ void render_all(zathura_t* zathura); -/** - * Lock the render thread. This is useful if you want to render on your own (e.g - * for printing). - * - * @param render_thread The render thread object. - */ -void render_lock(render_thread_t* render_thread); - -/** - * Unlock the render thread. - * - * @param render_thread The render thread object. - */ -void render_unlock(render_thread_t* render_thread); - #endif // RENDER_H diff --git a/types.h b/types.h index 50bacb6..6c4731a 100644 --- a/types.h +++ b/types.h @@ -25,6 +25,11 @@ typedef struct zathura_s zathura_t; */ typedef struct zathura_plugin_manager_s zathura_plugin_manager_t; +/** + * Renderer + */ +typedef struct zathura_renderer_s ZathuraRenderer; + /** * Error types */ diff --git a/zathura.c b/zathura.c index 182a99a..82a2839 100644 --- a/zathura.c +++ b/zathura.c @@ -711,6 +711,13 @@ document_open(zathura_t* zathura, const char* path, const char* password, zathura->document = document; + /* threads */ + zathura->sync.render_thread = zathura_renderer_new(zathura); + + if (zathura->sync.render_thread == NULL) { + goto error_free; + } + /* create blank pages */ zathura->pages = calloc(number_of_pages, sizeof(GtkWidget*)); if (zathura->pages == NULL) { @@ -759,13 +766,6 @@ document_open(zathura_t* zathura, const char* path, const char* password, girara_set_view(zathura->ui.session, zathura->ui.page_widget_alignment); - /* threads */ - zathura->sync.render_thread = render_init(zathura); - - if (zathura->sync.render_thread == NULL) { - goto error_free; - } - for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) { gtk_widget_realize(zathura->pages[page_id]); } @@ -883,6 +883,9 @@ document_close(zathura_t* zathura, bool keep_monitor) return false; } + /* stop rendering */ + zathura_renderer_stop(zathura->sync.render_thread); + /* remove monitor */ if (keep_monitor == false) { if (zathura->file_monitor.monitor != NULL) { @@ -945,7 +948,7 @@ document_close(zathura_t* zathura, bool keep_monitor) zathura->jumplist.size = 0; /* release render thread */ - render_free(zathura->sync.render_thread); + g_object_unref(zathura->sync.render_thread); zathura->sync.render_thread = NULL; /* remove widgets */ diff --git a/zathura.h b/zathura.h index 13df384..8864021 100644 --- a/zathura.h +++ b/zathura.h @@ -31,10 +31,6 @@ enum { /* forward declaration for types from database.h */ typedef struct _ZathuraDatabase zathura_database_t; -/* forward declaration for types from render.h */ -struct render_thread_s; -typedef struct render_thread_s render_thread_t; - /** * Jump */ @@ -78,7 +74,7 @@ struct zathura_s struct { - render_thread_t* render_thread; /**< The thread responsible for rendering the pages */ + ZathuraRenderer* render_thread; /**< The thread responsible for rendering the pages */ } sync; struct From b460c711a00e6f5243bcbd91eb63b1a9fc3a6d3e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 22 Aug 2013 22:26:52 +0200 Subject: [PATCH 02/90] Save some forks Signed-off-by: Sebastian Ramacher --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 669d6a4..1769ff5 100644 --- a/Makefile +++ b/Makefile @@ -56,11 +56,11 @@ options: @echo "CC = ${CC}" version.h: version.h.in config.mk - $(QUIET)sed 's/ZVMAJOR/${ZATHURA_VERSION_MAJOR}/' < version.h.in | \ - sed 's/ZVMINOR/${ZATHURA_VERSION_MINOR}/' | \ - sed 's/ZVREV/${ZATHURA_VERSION_REV}/' | \ - sed 's/ZVAPI/${ZATHURA_API_VERSION}/' | \ - sed 's/ZVABI/${ZATHURA_ABI_VERSION}/' > version.h + $(QUIET)sed -e 's/ZVMAJOR/${ZATHURA_VERSION_MAJOR}/' \ + -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 %.o: %.c $(ECHO) CC $< From b02d3d4b8f06fd6d7f8702afe2694674cf73358e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 24 Aug 2013 00:07:32 +0200 Subject: [PATCH 03/90] Move recolor state to the renderer Signed-off-by: Sebastian Ramacher --- callbacks.c | 16 +++++------ config.c | 14 +++++----- page-widget.c | 10 ++++--- render.c | 73 ++++++++++++++++++++++++++++++++++++++++++--------- render.h | 4 +++ zathura.c | 10 ++++++- zathura.h | 4 --- 7 files changed, 95 insertions(+), 36 deletions(-) diff --git a/callbacks.c b/callbacks.c index 1c49df0..2ce408b 100644 --- a/callbacks.c +++ b/callbacks.c @@ -488,11 +488,11 @@ cb_setting_recolor_change(girara_session_t* session, const char* name, g_return_if_fail(name != NULL); zathura_t* zathura = session->global.data; - bool bool_value = *((bool*) value); + const bool bool_value = *((bool*) value); - if (zathura->global.recolor != bool_value) { - zathura->global.recolor = bool_value; - render_all(zathura); + if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_enabled(zathura->sync.render_thread) != bool_value) { + zathura_renderer_enable_recolor(zathura->sync.render_thread, bool_value); + render_all(zathura); } } @@ -506,11 +506,11 @@ cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name, g_return_if_fail(name != NULL); zathura_t* zathura = session->global.data; - bool bool_value = *((bool*) value); + const bool bool_value = *((bool*) value); - if (zathura->global.recolor_keep_hue != bool_value) { - zathura->global.recolor_keep_hue = bool_value; - render_all(zathura); + if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_hue_enabled(zathura->sync.render_thread) != bool_value) { + zathura_renderer_enable_recolor_hue(zathura->sync.render_thread, bool_value); + render_all(zathura); } } diff --git a/config.c b/config.c index 88f007d..2cd00aa 100644 --- a/config.c +++ b/config.c @@ -57,9 +57,13 @@ cb_color_change(girara_session_t* session, const char* name, } else if (g_strcmp0(name, "highlight-active-color") == 0) { gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color_active)); } else if (g_strcmp0(name, "recolor-darkcolor") == 0) { - gdk_color_parse(string_value, &(zathura->ui.colors.recolor_dark_color)); + if (zathura->sync.render_thread != NULL) { + zathura_renderer_set_recolor_colors_str(zathura->sync.render_thread, NULL, string_value); + } } else if (g_strcmp0(name, "recolor-lightcolor") == 0) { - gdk_color_parse(string_value, &(zathura->ui.colors.recolor_light_color)); + if (zathura->sync.render_thread != NULL) { + 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)); } else if (g_strcmp0(name, "render-loading-fg") == 0) { @@ -168,10 +172,8 @@ config_load_default(zathura_t* zathura) int_value = 2000; girara_setting_add(gsession, "jumplist-size", &int_value, INT, false, _("Number of positions to remember in the jumplist"), cb_jumplist_change, NULL); - girara_setting_add(gsession, "recolor-darkcolor", NULL, STRING, false, _("Recoloring (dark color)"), cb_color_change, NULL); - girara_setting_set(gsession, "recolor-darkcolor", "#FFFFFF"); - girara_setting_add(gsession, "recolor-lightcolor", NULL, STRING, false, _("Recoloring (light color)"), cb_color_change, NULL); - girara_setting_set(gsession, "recolor-lightcolor", "#000000"); + girara_setting_add(gsession, "recolor-darkcolor", "#FFFFFF", STRING, false, _("Recoloring (dark color)"), cb_color_change, NULL); + girara_setting_add(gsession, "recolor-lightcolor", "#000000", STRING, false, _("Recoloring (light color)"), cb_color_change, NULL); girara_setting_add(gsession, "highlight-color", NULL, STRING, false, _("Color for highlighting"), cb_color_change, NULL); girara_setting_set(gsession, "highlight-color", "#9FBC00"); girara_setting_add(gsession, "highlight-active-color", NULL, STRING, false, _("Color for highlighting (active)"), cb_color_change, NULL); diff --git a/page-widget.c b/page-widget.c index 86096eb..71572f1 100644 --- a/page-widget.c +++ b/page-widget.c @@ -466,8 +466,9 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) } } else { /* set background color */ - if (priv->zathura->global.recolor == true) { - GdkColor color = priv->zathura->ui.colors.recolor_light_color; + if (zathura_renderer_recolor_enabled(priv->zathura->sync.render_thread) == true) { + GdkColor 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); } else { GdkColor color = priv->zathura->ui.colors.render_loading_bg; @@ -481,8 +482,9 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* write text */ if (render_loading == true) { - if (priv->zathura->global.recolor == true) { - GdkColor color = priv->zathura->ui.colors.recolor_dark_color; + if (zathura_renderer_recolor_enabled(priv->zathura->sync.render_thread) == true) { + GdkColor 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); } else { GdkColor color = priv->zathura->ui.colors.render_loading_fg; diff --git a/render.c b/render.c index 648b78a..8ca519f 100644 --- a/render.c +++ b/render.c @@ -25,7 +25,7 @@ static void zathura_render_request_finalize(GObject* object); static void render_job(void* data, void* user_data); static bool render(ZathuraRenderRequest* request, ZathuraRenderer* renderer); static gint render_thread_sort(gconstpointer a, gconstpointer b, gpointer data); -static void color2double(GdkColor* col, double* v); +static void color2double(const GdkColor* col, double* v); /* private data for ZathuraRenderer */ @@ -40,7 +40,9 @@ typedef struct private_s { bool hue; double light[3]; + GdkColor light_gdk; double dark[3]; + GdkColor dark_gdk; } recolor; } private_t; @@ -69,8 +71,6 @@ zathura_renderer_class_init(ZathuraRendererClass* class) /* overwrite methods */ GObjectClass* object_class = G_OBJECT_CLASS(class); object_class->finalize = zathura_renderer_finalize; -// object_class->set_property = zathura_page_widget_set_property; -// object_class->get_property = zathura_page_widget_get_property; } static void @@ -84,8 +84,8 @@ zathura_renderer_init(ZathuraRenderer* renderer) priv->recolor.enabled = false; priv->recolor.hue = true; - priv->recolor.light[0] = priv->recolor.light[1] = priv->recolor.light[2] = 1; - priv->recolor.dark[0] = priv->recolor.dark[1] = priv->recolor.dark[2] = 1; + + zathura_renderer_set_recolor_colors_str(renderer, "#000000", "#FFFFFF"); } ZathuraRenderer* @@ -127,8 +127,6 @@ zathura_render_request_class_init(ZathuraRenderRequestClass* class) /* overwrite methods */ GObjectClass* object_class = G_OBJECT_CLASS(class); object_class->finalize = zathura_render_request_finalize; -// object_class->set_property = zathura_page_widget_set_property; -// object_class->get_property = zathura_page_widget_get_property; request_signals[REQUEST_COMPLETED] = g_signal_new("completed", ZATHURA_TYPE_RENDER_REQUEST, @@ -216,15 +214,64 @@ zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, bool enable) GET_PRIVATE(renderer)->recolor.hue = enable; } -void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, +void +zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, + const GdkColor* light, const GdkColor* 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); + } + 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); + } +} + +void +zathura_renderer_set_recolor_colors_str(ZathuraRenderer* renderer, + const char* light, const char* dark) +{ + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + if (dark != NULL) { + GdkColor color; + gdk_color_parse(dark, &color); + zathura_renderer_set_recolor_colors(renderer, NULL, &color); + } + if (light != NULL) { + GdkColor color; + gdk_color_parse(light, &color); + zathura_renderer_set_recolor_colors(renderer, &color, NULL); + } +} + +void +zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer, GdkColor* light, GdkColor* dark) { g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); - g_return_if_fail(light != NULL && dark != NULL); private_t* priv = GET_PRIVATE(renderer); - color2double(light, priv->recolor.light); - color2double(dark, priv->recolor.dark); + if (light != NULL) { + light->red = priv->recolor.light_gdk.red; + light->blue = priv->recolor.light_gdk.blue; + light->green = priv->recolor.light_gdk.green; + color2double(light, priv->recolor.light); + } + if (dark != NULL) { + dark->red = priv->recolor.dark_gdk.red; + dark->blue = priv->recolor.dark_gdk.blue; + dark->green = priv->recolor.dark_gdk.green; + color2double(dark, priv->recolor.dark); + } } void @@ -307,7 +354,7 @@ render_job(void* data, void* user_data) static void -color2double(GdkColor* col, double* v) +color2double(const GdkColor* col, double* v) { v[0] = (double) col->red / 65535.; v[1] = (double) col->green / 65535.; @@ -525,7 +572,7 @@ render_all(zathura_t* zathura) } static gint -render_thread_sort(gconstpointer a, gconstpointer b, gpointer data) +render_thread_sort(gconstpointer a, gconstpointer b, gpointer UNUSED(data)) { if (a == NULL || b == NULL) { return 0; diff --git a/render.h b/render.h index 950ed66..019c485 100644 --- a/render.h +++ b/render.h @@ -52,6 +52,10 @@ bool zathura_renderer_recolor_hue_enabled(ZathuraRenderer* renderer); void zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, bool enable); void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, + const GdkColor* light, const GdkColor* dark); +void zathura_renderer_set_recolor_colors_str(ZathuraRenderer* renderer, + const char* light, const char* dark); +void zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer, GdkColor* light, GdkColor* dark); void zathura_renderer_stop(ZathuraRenderer* renderer); diff --git a/zathura.c b/zathura.c index 82a2839..ce2650a 100644 --- a/zathura.c +++ b/zathura.c @@ -68,7 +68,6 @@ zathura_create(void) zathura_t* zathura = g_malloc0(sizeof(zathura_t)); /* global settings */ - zathura->global.recolor = false; zathura->global.update_page_number = true; zathura->global.search_direction = FORWARD; @@ -718,6 +717,15 @@ document_open(zathura_t* zathura, const char* path, const char* password, goto error_free; } + char* recolor_dark = NULL; + char* recolor_light = NULL; + girara_setting_get(zathura->ui.session, "recolor-darkcolor", &recolor_dark); + girara_setting_get(zathura->ui.session, "recolor-lightcolor", &recolor_light); + zathura_renderer_set_recolor_colors_str(zathura->sync.render_thread, + recolor_light, recolor_dark); + g_free(recolor_dark); + g_free(recolor_light); + /* create blank pages */ zathura->pages = calloc(number_of_pages, sizeof(GtkWidget*)); if (zathura->pages == NULL) { diff --git a/zathura.h b/zathura.h index 8864021..bea5d0a 100644 --- a/zathura.h +++ b/zathura.h @@ -56,8 +56,6 @@ struct zathura_s struct { - GdkColor recolor_dark_color; /**< Dark color for recoloring */ - GdkColor recolor_light_color; /**< Light color for recoloring */ GdkColor highlight_color; /**< Color for highlighting */ GdkColor highlight_color_active; /** Color for highlighting */ GdkColor render_loading_bg; /**< Background color for render "Loading..." */ @@ -102,8 +100,6 @@ struct zathura_s struct { - bool recolor_keep_hue; /**< Keep hue when recoloring */ - bool recolor; /**< Recoloring mode switch */ bool update_page_number; /**< Update current page number */ int search_direction; /**< Current search direction (FORWARD or BACKWARD) */ girara_list_t* marks; /**< Marker */ From e733e032ced6760416018365b9271957b23b5664 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 12:59:27 +0200 Subject: [PATCH 04/90] Add a callback for the signal Signed-off-by: Sebastian Ramacher --- page-widget.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/page-widget.c b/page-widget.c index 71572f1..5669afb 100644 --- a/page-widget.c +++ b/page-widget.c @@ -77,6 +77,7 @@ static gboolean cb_zathura_page_widget_motion_notify(GtkWidget* widget, GdkEvent static gboolean cb_zathura_page_widget_popup_menu(GtkWidget* widget); static void cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page); static void cb_menu_image_save(GtkMenuItem* item, ZathuraPage* page); +static void cb_update_surface(ZathuraRenderRequest* request, cairo_surface_t* surface, void* data); enum properties_e { PROP_0, @@ -189,7 +190,7 @@ zathura_page_widget_new(zathura_t* zathura, zathura_page_t* page) zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); priv->render_request = zathura_render_request_new(zathura->sync.render_thread, page); g_signal_connect_object(priv->render_request, "completed", - G_CALLBACK(zathura_page_widget_update_surface), widget, G_CONNECT_SWAPPED); + G_CALLBACK(cb_update_surface), widget, 0); return GTK_WIDGET(ret); } @@ -544,6 +545,14 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface } } +static void +cb_update_surface(ZathuraRenderRequest* UNUSED(request), cairo_surface_t* surface, void* data) +{ + ZathuraPage* widget = data; + g_return_if_fail(ZATHURA_IS_PAGE(widget)); + zathura_page_widget_update_surface(widget, surface); +} + static void zathura_page_widget_size_allocate(GtkWidget* widget, GdkRectangle* allocation) { From 35bd419e49ea8380a2a9225eb08e1591488c2456 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 13:25:22 +0200 Subject: [PATCH 05/90] Emit signal from main context Signed-off-by: Sebastian Ramacher --- README | 1 + config.mk | 7 +++++-- render.c | 32 +++++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README b/README index c6c966a..d057887 100644 --- a/README +++ b/README @@ -6,6 +6,7 @@ girara user interface library and several document libraries. Requirements ------------ gtk2 (>= 2.28) +glib (>= 2.28) girara sqlite3 (optional, >= 3.5.9) check (for tests) diff --git a/config.mk b/config.mk index 30a0285..07b9ab6 100644 --- a/config.mk +++ b/config.mk @@ -52,6 +52,9 @@ GTHREAD_LIB ?= $(shell pkg-config --libs gthread-2.0) GMODULE_INC ?= $(shell pkg-config --cflags gmodule-no-export-2.0) GMODULE_LIB ?= $(shell pkg-config --libs gmodule-no-export-2.0) +GLIB_INC ?= $(shell pkg-config --cflags --atleast-version=2.28 glib-2.0) +GLIB_LIB ?= $(shell pkg-config --libs --atleast-version=2.28 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}) @@ -65,8 +68,8 @@ MAGIC_INC ?= MAGIC_LIB ?= -lmagic endif -INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} -LIBS = ${GIRARA_LIB} ${GTK_LIB} ${GTHREAD_LIB} ${GMODULE_LIB} -lpthread -lm +INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC} +LIBS = ${GIRARA_LIB} ${GTK_LIB} ${GTHREAD_LIB} ${GMODULE_LIB} ${GLIB_LIB} -lpthread -lm # flags CFLAGS += -std=c99 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS) diff --git a/render.c b/render.c index 8ca519f..91e154e 100644 --- a/render.c +++ b/render.c @@ -405,6 +405,23 @@ colorumax(const double* h, double l, double l1, double l2) return fmin(u, v); } +typedef struct emit_completed_signal_s +{ + ZathuraRenderRequest* request; + cairo_surface_t* surface; +} emit_completed_signal_t; + +static gboolean +emit_completed_signal(void* data) +{ + emit_completed_signal_t* ecs = data; + /* emit the signal */ + g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); + /* clean up the data */ + cairo_surface_destroy(ecs->surface); + g_free(ecs); + return true; +} static bool render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) @@ -534,16 +551,13 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) } if (priv->about_to_close == false && request_priv->aborted == false) { - /* update the widget */ - /* - gdk_threads_enter(); - GtkWidget* widget = zathura_page_get_widget(zathura, page); - zathura_page_widget_update_surface(ZATHURA_PAGE(widget), surface); - gdk_threads_leave(); */ + emit_completed_signal_t* ecs = g_malloc(sizeof(ecs)); + ecs->request = request; + ecs->surface = surface; + cairo_surface_reference(surface); - gdk_threads_enter(); - g_signal_emit(request, request_signals[REQUEST_COMPLETED], 0, surface); - gdk_threads_leave(); + /* emit signal from the main context, i.e. the main thread */ + g_main_context_invoke(NULL, emit_completed_signal, ecs); } cairo_surface_destroy(surface); From 9e77b26a3d5d31be6de683883fde0bf5d82f6415 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 13:25:59 +0200 Subject: [PATCH 06/90] Don't loop Signed-off-by: Sebastian Ramacher --- render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render.c b/render.c index 91e154e..e4b13e5 100644 --- a/render.c +++ b/render.c @@ -420,7 +420,7 @@ emit_completed_signal(void* data) /* clean up the data */ cairo_surface_destroy(ecs->surface); g_free(ecs); - return true; + return FALSE; } static bool From 08a87f679e0be9ed780f7be12d732783c02f64b9 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 13:52:58 +0200 Subject: [PATCH 07/90] Mark the request as done in the signal emitter Signed-off-by: Sebastian Ramacher --- render.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/render.c b/render.c index e4b13e5..3faf11a 100644 --- a/render.c +++ b/render.c @@ -349,10 +349,8 @@ render_job(void* data, void* user_data) if (render(request, renderer) != true) { girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); } - request_priv->requested = false; } - static void color2double(const GdkColor* col, double* v) { @@ -407,6 +405,7 @@ colorumax(const double* h, double l, double l1, double l2) typedef struct emit_completed_signal_s { + ZathuraRenderer* renderer; ZathuraRenderRequest* request; cairo_surface_t* surface; } emit_completed_signal_t; @@ -415,11 +414,22 @@ static gboolean emit_completed_signal(void* data) { emit_completed_signal_t* ecs = data; - /* emit the signal */ - g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); + private_t* priv = GET_PRIVATE(ecs->renderer); + request_private_t* request_priv = REQUEST_GET_PRIVATE(ecs->request); + + if (priv->about_to_close == false && request_priv->aborted == false) { + /* emit the signal */ + g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); + } + /* mark the request as done */ + request_priv->requested = false; + /* clean up the data */ cairo_surface_destroy(ecs->surface); + g_object_unref(ecs->renderer); + g_object_unref(ecs->request); g_free(ecs); + return FALSE; } @@ -550,15 +560,16 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) #undef rgb2 } - if (priv->about_to_close == false && request_priv->aborted == false) { - emit_completed_signal_t* ecs = g_malloc(sizeof(ecs)); - ecs->request = request; - ecs->surface = surface; - cairo_surface_reference(surface); + emit_completed_signal_t* ecs = g_malloc(sizeof(ecs)); + ecs->renderer = renderer; + ecs->request = request; + ecs->surface = surface; + g_object_ref(renderer); + g_object_ref(request); + cairo_surface_reference(surface); - /* emit signal from the main context, i.e. the main thread */ - g_main_context_invoke(NULL, emit_completed_signal, ecs); - } + /* emit signal from the main context, i.e. the main thread */ + g_main_context_invoke(NULL, emit_completed_signal, ecs); cairo_surface_destroy(surface); From 7d5863ae1d9087f074cdd375f270ad99442a9693 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 15:05:00 +0200 Subject: [PATCH 08/90] Clean up includes Signed-off-by: Sebastian Ramacher --- render.c | 16 +++++++++------- render.h | 2 ++ zathura.c | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/render.c b/render.c index 3faf11a..d0acdab 100644 --- a/render.c +++ b/render.c @@ -3,8 +3,6 @@ #include #include #include -#include -#include #include "glib-compat.h" #include "render.h" #include "zathura.h" @@ -264,13 +262,11 @@ zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer, light->red = priv->recolor.light_gdk.red; light->blue = priv->recolor.light_gdk.blue; light->green = priv->recolor.light_gdk.green; - color2double(light, priv->recolor.light); } if (dark != NULL) { dark->red = priv->recolor.dark_gdk.red; dark->blue = priv->recolor.dark_gdk.blue; dark->green = priv->recolor.dark_gdk.green; - color2double(dark, priv->recolor.dark); } } @@ -504,6 +500,12 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) 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 rgb_diff[] = { + rgb2[0] - rgb1[0], + rgb2[1] - rgb1[1], + rgb2[2] - rgb1[2] + }; + for (unsigned int y = 0; y < page_height; y++) { unsigned char* data = image + y * rowstride; @@ -549,9 +551,9 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) } else { /* linear interpolation between dark and light with color ligtness as * a parameter */ - data[2] = (unsigned char)round(255.*(t * (rgb2[0] - rgb1[0]) + rgb1[0])); - data[1] = (unsigned char)round(255.*(t * (rgb2[1] - rgb1[1]) + rgb1[1])); - data[0] = (unsigned char)round(255.*(t * (rgb2[2] - rgb1[2]) + rgb1[2])); + data[2] = (unsigned char)round(255.*(t * rgb_diff[0] + rgb1[0])); + data[1] = (unsigned char)round(255.*(t * rgb_diff[1] + rgb1[1])); + data[0] = (unsigned char)round(255.*(t * rgb_diff[2] + rgb1[2])); } } } diff --git a/render.h b/render.h index 019c485..a781cd8 100644 --- a/render.h +++ b/render.h @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include "types.h" diff --git a/zathura.c b/zathura.c index ce2650a..d639a38 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; } + /* set up recolor info in ZathuraRenderer */ char* recolor_dark = NULL; char* recolor_light = NULL; girara_setting_get(zathura->ui.session, "recolor-darkcolor", &recolor_dark); From 8a9bd7f512818d07eccf3a0d8861a76e3d4b7e8a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 15:43:43 +0200 Subject: [PATCH 09/90] We don't need zathura Signed-off-by: Sebastian Ramacher --- page-widget.c | 2 +- render.c | 9 +++++---- render.h | 2 +- zathura.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/page-widget.c b/page-widget.c index 5669afb..775c6d8 100644 --- a/page-widget.c +++ b/page-widget.c @@ -299,7 +299,7 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v */ if (priv->search.list != NULL && zathura_page_get_visibility(priv->page)) { - gtk_widget_queue_draw(GTK_WIDGET(object)); + gtk_widget_queue_draw(GTK_WIDGET(object)); } break; default: diff --git a/render.c b/render.c index d0acdab..99644e6 100644 --- a/render.c +++ b/render.c @@ -87,11 +87,10 @@ zathura_renderer_init(ZathuraRenderer* renderer) } ZathuraRenderer* -zathura_renderer_new(zathura_t* zathura) +zathura_renderer_new() { - g_return_val_if_fail(zathura != NULL, NULL); - - return g_object_new(ZATHURA_TYPE_RENDERER, /*"page", page, "zathura", zathura, */ NULL); + GObject* obj = g_object_new(ZATHURA_TYPE_RENDERER, NULL); + return ZATHURA_RENDERER(obj); } static void @@ -325,6 +324,8 @@ zathura_render_request_abort(ZathuraRenderRequest* request) } +/* render job */ + static void render_job(void* data, void* user_data) { diff --git a/render.h b/render.h index a781cd8..f8b7e75 100644 --- a/render.h +++ b/render.h @@ -46,7 +46,7 @@ GType zathura_renderer_get_type(void); * @param page the page to be displayed * @return a page view widget */ -ZathuraRenderer* zathura_renderer_new(zathura_t* zathura); +ZathuraRenderer* zathura_renderer_new(void); bool zathura_renderer_recolor_enabled(ZathuraRenderer* renderer); void zathura_renderer_enable_recolor(ZathuraRenderer* renderer, bool enable); diff --git a/zathura.c b/zathura.c index d639a38..19d4a20 100644 --- a/zathura.c +++ b/zathura.c @@ -711,7 +711,7 @@ document_open(zathura_t* zathura, const char* path, const char* password, zathura->document = document; /* threads */ - zathura->sync.render_thread = zathura_renderer_new(zathura); + zathura->sync.render_thread = zathura_renderer_new(); if (zathura->sync.render_thread == NULL) { goto error_free; From 8d53833d815ea5baa67ca84f239f72f76b042ba1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 16:10:44 +0200 Subject: [PATCH 10/90] Move recolor code into separate function Signed-off-by: Sebastian Ramacher --- render.c | 158 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 81 insertions(+), 77 deletions(-) diff --git a/render.c b/render.c index 99644e6..e4d87a9 100644 --- a/render.c +++ b/render.c @@ -430,6 +430,86 @@ emit_completed_signal(void* data) return FALSE; } +static void +recolor(private_t* priv, unsigned int page_width, unsigned int page_height, + cairo_surface_t* surface) +{ + /* uses a representation of a rgb color as follows: + - a lightness scalar (between 0,1), which is a weighted average of r, g, b, + - a hue vector, which indicates a radian direction from the grey axis, inside the equal lightness plane. + - a saturation scalar between 0,1. It is 0 when grey, 1 when the color is in the boundary of the rgb cube. + */ + + const int rowstride = cairo_image_surface_get_stride(surface); + unsigned char* image = cairo_image_surface_get_data(surface); + + /* RGB weights for computing lightness. Must sum to one */ + static const double a[] = {0.30, 0.59, 0.11}; + +#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 rgb_diff[] = { + rgb2[0] - rgb1[0], + rgb2[1] - rgb1[1], + rgb2[2] - rgb1[2] + }; + + for (unsigned int y = 0; y < page_height; y++) { + unsigned char* data = image + y * rowstride; + + for (unsigned int x = 0; x < page_width; x++, data += 4) { + /* Careful. data color components blue, green, red. */ + const double rgb[3] = { + (double) data[2] / 256., + (double) data[1] / 256., + (double) data[0] / 256. + }; + + /* compute h, s, l data */ + double l = a[0]*rgb[0] + a[1]*rgb[1] + a[2]*rgb[2]; + + if (priv->recolor.hue == true) { + /* adjusting lightness keeping hue of current color. white and black + * go to grays of same ligtness as light and dark colors. */ + const double h[3] = { + rgb[0] - l, + rgb[1] - l, + rgb[2] - l + }; + + /* u is the maximum possible saturation for given h and l. s is a + * rescaled saturation between 0 and 1 */ + double u = colorumax(h, l, 0, 1); + double s = 0; + if (u != 0) { + s = 1/u; + } + + /* Interpolates lightness between light and dark colors. white goes to + * light, and black goes to dark. */ + l = l * (l2 - l1) + l1; + u = colorumax(h, l, l1, l2); + + data[2] = (unsigned char)round(255.*(l + s*u * h[0])); + data[1] = (unsigned char)round(255.*(l + s*u * h[1])); + data[0] = (unsigned char)round(255.*(l + s*u * h[2])); + } 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])); + } + } + } + +#undef rgb1 +#undef rgb2 +} + static bool render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) { @@ -482,85 +562,9 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) return true; } - /* recolor */ - /* uses a representation of a rgb color as follows: - - a lightness scalar (between 0,1), which is a weighted average of r, g, b, - - a hue vector, which indicates a radian direction from the grey axis, inside the equal lightness plane. - - a saturation scalar between 0,1. It is 0 when grey, 1 when the color is in the boundary of the rgb cube. - */ if (priv->recolor.enabled == true) { - const int rowstride = cairo_image_surface_get_stride(surface); - unsigned char* image = cairo_image_surface_get_data(surface); - - /* RGB weights for computing lightness. Must sum to one */ - static const double a[] = {0.30, 0.59, 0.11}; - -#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 rgb_diff[] = { - rgb2[0] - rgb1[0], - rgb2[1] - rgb1[1], - rgb2[2] - rgb1[2] - }; - - for (unsigned int y = 0; y < page_height; y++) { - unsigned char* data = image + y * rowstride; - - for (unsigned int x = 0; x < page_width; x++, data += 4) { - /* Careful. data color components blue, green, red. */ - const double rgb[3] = { - (double) data[2] / 256., - (double) data[1] / 256., - (double) data[0] / 256. - }; - - /* compute h, s, l data */ - double l = a[0]*rgb[0] + a[1]*rgb[1] + a[2]*rgb[2]; - - const double h[3] = { - rgb[0] - l, - rgb[1] - l, - rgb[2] - l - }; - - /* u is the maximum possible saturation for given h and l. s is a - * rescaled saturation between 0 and 1 */ - double u = colorumax(h, l, 0, 1); - double s; - if (u == 0) { - s = 0; - } else { - s = 1/u; - } - - /* Interpolates lightness between light and dark colors. white goes to - * light, and black goes to dark. */ - const double t = l; - l = t * (l2 - l1) + l1; - - if (priv->recolor.hue == true) { - /* adjusting lightness keeping hue of current color. white and black - * go to grays of same ligtness as light and dark colors. */ - u = colorumax(h, l, l1, l2); - data[2] = (unsigned char)round(255.*(l + s*u * h[0])); - data[1] = (unsigned char)round(255.*(l + s*u * h[1])); - data[0] = (unsigned char)round(255.*(l + s*u * h[2])); - } else { - /* linear interpolation between dark and light with color ligtness as - * a parameter */ - data[2] = (unsigned char)round(255.*(t * rgb_diff[0] + rgb1[0])); - data[1] = (unsigned char)round(255.*(t * rgb_diff[1] + rgb1[1])); - data[0] = (unsigned char)round(255.*(t * rgb_diff[2] + rgb1[2])); - } - } - } - -#undef rgb1 -#undef rgb2 + recolor(priv, page_width, page_height, surface); } emit_completed_signal_t* ecs = g_malloc(sizeof(ecs)); From 07005886f8f8323446da63f2fd3daf5c00af2a85 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 17:50:34 +0200 Subject: [PATCH 11/90] Sort requests based on last view time again Signed-off-by: Sebastian Ramacher --- page-widget.c | 2 +- render.c | 104 +++++++++++++++++++++++++------------------------- render.h | 66 +++++++++++++++++++++++++------- 3 files changed, 106 insertions(+), 66 deletions(-) diff --git a/page-widget.c b/page-widget.c index 775c6d8..fea6810 100644 --- a/page-widget.c +++ b/page-widget.c @@ -506,7 +506,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* render real page */ if (priv->render_requested == false) { priv->render_requested = true; - zathura_render_request(priv->render_request); + zathura_render_request(priv->render_request, priv->last_view); } } mutex_unlock(&(priv->lock)); diff --git a/render.c b/render.c index e4d87a9..9c7a4ac 100644 --- a/render.c +++ b/render.c @@ -21,7 +21,6 @@ static void zathura_renderer_finalize(GObject* object); static void zathura_render_request_finalize(GObject* object); static void render_job(void* data, void* user_data); -static bool render(ZathuraRenderRequest* request, ZathuraRenderer* renderer); static gint render_thread_sort(gconstpointer a, gconstpointer b, gpointer data); static void color2double(const GdkColor* col, double* v); @@ -50,6 +49,7 @@ typedef struct request_private_s { zathura_page_t* page; bool requested; bool aborted; + gint64 last_view_time; } request_private_t; #define GET_PRIVATE(obj) \ @@ -298,7 +298,7 @@ zathura_renderer_stop(ZathuraRenderer* renderer) /* ZathuraRenderRequest methods */ void -zathura_render_request(ZathuraRenderRequest* request) +zathura_render_request(ZathuraRenderRequest* request, gint64 last_view_time) { g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); @@ -307,6 +307,7 @@ zathura_render_request(ZathuraRenderRequest* request) if (request_priv->requested == false) { request_priv->requested = true; request_priv->aborted = false; + request_priv->last_view_time = last_view_time; g_thread_pool_push(priv->pool, request, NULL); } @@ -326,26 +327,34 @@ zathura_render_request_abort(ZathuraRenderRequest* request) /* render job */ -static void -render_job(void* data, void* user_data) +typedef struct emit_completed_signal_s { - ZathuraRenderRequest* request = data; - ZathuraRenderer* renderer = user_data; - g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); - g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + ZathuraRenderer* renderer; + ZathuraRenderRequest* request; + cairo_surface_t* surface; +} emit_completed_signal_t; - private_t* priv = GET_PRIVATE(renderer); - request_private_t* request_priv = REQUEST_GET_PRIVATE(request); - if (priv->about_to_close == true || request_priv->aborted == true) { - /* back out early */ - request_priv->requested = false; - return; - } +static gboolean +emit_completed_signal(void* data) +{ + emit_completed_signal_t* ecs = data; + private_t* priv = GET_PRIVATE(ecs->renderer); + request_private_t* request_priv = REQUEST_GET_PRIVATE(ecs->request); - girara_debug("Rendering page %d ...", zathura_page_get_index(request_priv->page) + 1); - if (render(request, renderer) != true) { - girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); + if (priv->about_to_close == false && request_priv->aborted == false) { + /* emit the signal */ + g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); } + /* mark the request as done */ + request_priv->requested = false; + + /* clean up the data */ + cairo_surface_destroy(ecs->surface); + g_object_unref(ecs->renderer); + g_object_unref(ecs->request); + g_free(ecs); + + return FALSE; } static void @@ -400,36 +409,6 @@ colorumax(const double* h, double l, double l1, double l2) return fmin(u, v); } -typedef struct emit_completed_signal_s -{ - ZathuraRenderer* renderer; - ZathuraRenderRequest* request; - cairo_surface_t* surface; -} emit_completed_signal_t; - -static gboolean -emit_completed_signal(void* data) -{ - emit_completed_signal_t* ecs = data; - private_t* priv = GET_PRIVATE(ecs->renderer); - request_private_t* request_priv = REQUEST_GET_PRIVATE(ecs->request); - - if (priv->about_to_close == false && request_priv->aborted == false) { - /* emit the signal */ - g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); - } - /* mark the request as done */ - request_priv->requested = false; - - /* clean up the data */ - cairo_surface_destroy(ecs->surface); - g_object_unref(ecs->renderer); - g_object_unref(ecs->request); - g_free(ecs); - - return FALSE; -} - static void recolor(private_t* priv, unsigned int page_width, unsigned int page_height, cairo_surface_t* surface) @@ -583,6 +562,29 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) return true; } +static void +render_job(void* data, void* user_data) +{ + ZathuraRenderRequest* request = data; + ZathuraRenderer* renderer = user_data; + g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + + private_t* priv = GET_PRIVATE(renderer); + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + if (priv->about_to_close == true || request_priv->aborted == true) { + /* back out early */ + request_priv->requested = false; + return; + } + + girara_debug("Rendering page %d ...", zathura_page_get_index(request_priv->page) + 1); + if (render(request, renderer) != true) { + girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); + } +} + + void render_all(zathura_t* zathura) { @@ -615,10 +617,8 @@ render_thread_sort(gconstpointer a, gconstpointer b, gpointer UNUSED(data)) request_private_t* priv_a = REQUEST_GET_PRIVATE(request_a); request_private_t* priv_b = REQUEST_GET_PRIVATE(request_b); if (priv_a->aborted == priv_b->aborted) { - unsigned int page_a_index = zathura_page_get_index(priv_a->page); - unsigned int page_b_index = zathura_page_get_index(priv_b->page); - return page_a_index < page_b_index ? -1 : - (page_a_index > page_b_index ? 1 : 0); + return priv_a->last_view_time < priv_b->last_view_time ? -1 : + (priv_a->last_view_time > priv_b->last_view_time ? 1 : 0); } /* sort aborted entries earlier so that the are thrown out of the queue */ diff --git a/render.h b/render.h index f8b7e75..00d1e07 100644 --- a/render.h +++ b/render.h @@ -41,44 +41,82 @@ struct zathura_renderer_class_s */ GType zathura_renderer_get_type(void); /** - * Create a page view widget. - * @param zathura the zathura instance - * @param page the page to be displayed - * @return a page view widget + * Create a renderer. + * @return a renderer object */ ZathuraRenderer* zathura_renderer_new(void); +/** + * Return whether recoloring is enabled. + * @param renderer a renderer object + * @returns true if recoloring is enabled, false otherwise + */ bool zathura_renderer_recolor_enabled(ZathuraRenderer* renderer); +/** + * Enable/disable recoloring. + * @param renderer a renderer object + * @param enable wheter to enable or disable recoloring + */ void zathura_renderer_enable_recolor(ZathuraRenderer* renderer, bool enable); +/** + * Return whether hue should be preserved while recoloring. + * @param renderer a renderer object + * @returns true if hue should be preserved, false otherwise + */ bool zathura_renderer_recolor_hue_enabled(ZathuraRenderer* renderer); +/** + * Enable/disable preservation of hue while recoloring. + * @param renderer a renderer object + * @param enable wheter to enable or disable hue preservation + */ void zathura_renderer_enable_recolor_hue(ZathuraRenderer* renderer, bool enable); +/** + * Set light and dark colors for recoloring. + * @param renderer a renderer object + * @param light light color + * @param dark dark color + */ void zathura_renderer_set_recolor_colors(ZathuraRenderer* renderer, const GdkColor* light, const GdkColor* dark); +/** + * Set light and dark colors for recoloring. + * @param renderer a renderer object + * @param light light color + * @param dark dark color + */ void zathura_renderer_set_recolor_colors_str(ZathuraRenderer* renderer, const char* light, const char* dark); +/** + * Get light and dark colors for recoloring. + * @param renderer a renderer object + * @param light light color + * @param dark dark color + */ void zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer, GdkColor* light, GdkColor* dark); - +/** + * Stop rendering. + * @param renderer a render object + */ void zathura_renderer_stop(ZathuraRenderer* renderer); /** * Lock the render thread. This is useful if you want to render on your own (e.g * for printing). * - * @param render_thread The render thread object. + * @param renderer renderer object */ void zathura_renderer_lock(ZathuraRenderer* renderer); /** * Unlock the render thread. * - * @param render_thread The render thread object. + * @param renderer renderer object. */ void zathura_renderer_unlock(ZathuraRenderer* renderer); - typedef struct zathura_render_request_s ZathuraRenderRequest; typedef struct zathura_render_request_class_s ZathuraRenderRequestClass; @@ -109,15 +147,15 @@ struct zathura_render_request_class_s ZathuraRenderRequestClass)) /** - * Returns the type of the renderer. + * Returns the type of the render request. * @return the type */ GType zathura_page_render_info_get_type(void); /** - * Create a page view widget. - * @param zathura the zathura instance + * Create a render request object + * @param renderer a renderer object * @param page the page to be displayed - * @return a page view widget + * @returns render request object */ ZathuraRenderRequest* zathura_render_request_new(ZathuraRenderer* renderer, zathura_page_t* page); @@ -127,8 +165,10 @@ ZathuraRenderRequest* zathura_render_request_new(ZathuraRenderer* renderer, * that should be rendered. * * @param request request object of the page that should be renderer + * @param last_view_time last view time of the page */ -void zathura_render_request(ZathuraRenderRequest* request); +void zathura_render_request(ZathuraRenderRequest* request, + gint64 last_view_time); /** * Abort an existing render request. From a9f044c951424bc50fb56d47436e1525d0358595 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 18:55:42 +0200 Subject: [PATCH 12/90] Set recolor info initially Signed-off-by: Sebastian Ramacher --- zathura.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zathura.c b/zathura.c index 19d4a20..eb5635f 100644 --- a/zathura.c +++ b/zathura.c @@ -727,6 +727,12 @@ document_open(zathura_t* zathura, const char* path, const char* password, g_free(recolor_dark); g_free(recolor_light); + bool recolor = false; + girara_setting_get(zathura->ui.session, "recolor", &recolor); + zathura_renderer_enable_recolor(zathura->sync.render_thread, recolor); + girara_setting_get(zathura->ui.session, "recolor-keephue", &recolor); + zathura_renderer_enable_recolor_hue(zathura->sync.render_thread, recolor); + /* create blank pages */ zathura->pages = calloc(number_of_pages, sizeof(GtkWidget*)); if (zathura->pages == NULL) { From 16fbefa5cfdd905e77764391683f11757c61eee7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 18:56:15 +0200 Subject: [PATCH 13/90] Abort requests if the page becomes invisible Signed-off-by: Sebastian Ramacher --- callbacks.c | 12 ++++++++---- page-widget.c | 20 +++++++++++--------- page-widget.h | 7 +++++++ render.c | 2 ++ render.h | 1 - 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/callbacks.c b/callbacks.c index 2ce408b..31364ec 100644 --- a/callbacks.c +++ b/callbacks.c @@ -90,13 +90,14 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi .height = zathura_page_get_height(page) * scale }; GtkWidget* page_widget = zathura_page_get_widget(zathura, page); + ZathuraPage* zathura_page_widget = ZATHURA_PAGE(page_widget); gtk_widget_translate_coordinates(page_widget, zathura->ui.session->gtk.view, 0, 0, &page_rect.x, &page_rect.y); if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) { if (zathura_page_get_visibility(page) == false) { zathura_page_set_visibility(page, true); - zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget)); + zathura_page_widget_update_view_time(zathura_page_widget); zathura_page_cache_add(zathura, zathura_page_get_index(page)); } if (zathura->global.update_page_number == true && updated == false @@ -106,11 +107,13 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi } } else { zathura_page_set_visibility(page, false); + /* If a page becomes invisible, abort all render requests. */ + zathura_page_widget_abort_render_request(zathura_page_widget); /* if the page is not visible and not cached, but still has a surface, we * need to get rid of the surface */ - if (zathura_page_widget_have_surface(ZATHURA_PAGE(page_widget)) == true && + if (zathura_page_widget_have_surface(zathura_page_widget) == true && zathura_page_cache_is_cached(zathura, zathura_page_get_index(page)) == false) { - zathura_page_widget_update_surface(ZATHURA_PAGE(page_widget), NULL); + zathura_page_widget_update_surface(zathura_page_widget, NULL); } girara_list_t* results = NULL; @@ -529,7 +532,8 @@ cb_unknown_command(girara_session_t* session, const char* input) } /* check for number */ - for (unsigned int i = 0; i < strlen(input); i++) { + const size_t size = strlen(input); + for (size_t i = 0; i < size; i++) { if (g_ascii_isdigit(input[i]) == FALSE) { return false; } diff --git a/page-widget.c b/page-widget.c index fea6810..5f5cd32 100644 --- a/page-widget.c +++ b/page-widget.c @@ -24,7 +24,6 @@ typedef struct zathura_page_widget_private_s { zathura_t* zathura; /**< Zathura object */ cairo_surface_t* surface; /**< Cairo surface */ ZathuraRenderRequest* render_request; /* Request object */ - bool render_requested; /**< No surface and rendering has been requested */ gint64 last_view; /**< Last time the page has been viewed */ mutex lock; /**< Lock */ @@ -146,7 +145,6 @@ zathura_page_widget_init(ZathuraPage* widget) zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); priv->page = NULL; priv->surface = NULL; - priv->render_requested = false; priv->render_request = NULL; priv->last_view = g_get_real_time(); @@ -504,10 +502,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) } /* render real page */ - if (priv->render_requested == false) { - priv->render_requested = true; - zathura_render_request(priv->render_request, priv->last_view); - } + zathura_render_request(priv->render_request, priv->last_view); } mutex_unlock(&(priv->lock)); return FALSE; @@ -529,11 +524,10 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface cairo_surface_destroy(priv->surface); priv->surface = NULL; } - priv->render_requested = false; if (surface != NULL) { /* if we're not visible or not cached, we don't care about the surface */ - if (zathura_page_get_visibility(priv->page) == true || - zathura_page_cache_is_cached(priv->zathura, zathura_page_get_index(priv->page)) == true) { + /*if (zathura_page_get_visibility(priv->page) == true || + zathura_page_cache_is_cached(priv->zathura, zathura_page_get_index(priv->page)) == true) */ { priv->surface = surface; cairo_surface_reference(surface); } @@ -919,3 +913,11 @@ zathura_page_widget_have_surface(ZathuraPage* widget) return priv->surface != NULL; } +void +zathura_page_widget_abort_render_request(ZathuraPage* widget) +{ + g_return_if_fail(ZATHURA_IS_PAGE(widget)); + zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); + zathura_render_request_abort(priv->render_request); +} + diff --git a/page-widget.h b/page-widget.h index b9a1c38..08944d1 100644 --- a/page-widget.h +++ b/page-widget.h @@ -96,4 +96,11 @@ void zathura_page_widget_update_view_time(ZathuraPage* widget); */ bool zathura_page_widget_have_surface(ZathuraPage* widget); +/** + * Abort outstanding render requests + * + * @param widget the widget + */ +void zathura_page_widget_abort_render_request(ZathuraPage* widget); + #endif diff --git a/render.c b/render.c index 9c7a4ac..050cc4f 100644 --- a/render.c +++ b/render.c @@ -537,6 +537,7 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) /* before recoloring, check if we've been aborted */ if (priv->about_to_close == true || request_priv->aborted == true) { + request_priv->requested = false; cairo_surface_destroy(surface); return true; } @@ -581,6 +582,7 @@ render_job(void* data, void* user_data) girara_debug("Rendering page %d ...", zathura_page_get_index(request_priv->page) + 1); if (render(request, renderer) != true) { girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); + request_priv->requested = false; } } diff --git a/render.h b/render.h index 00d1e07..0963a9e 100644 --- a/render.h +++ b/render.h @@ -177,7 +177,6 @@ void zathura_render_request(ZathuraRenderRequest* request, */ void zathura_render_request_abort(ZathuraRenderRequest* request); - /** * This function is used to unmark all pages as not rendered. This should * be used if all pages should be rendered again (e.g.: the zoom level or the From 7127a46033f3d49eb08561cd30040a51c1114d0d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 30 Aug 2013 19:25:24 +0200 Subject: [PATCH 14/90] Fix deprecated gdk thread function calls Signed-off-by: Sebastian Ramacher --- callbacks.c | 13 +++++++++---- main.c | 8 +++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/callbacks.c b/callbacks.c index 31364ec..14a629b 100644 --- a/callbacks.c +++ b/callbacks.c @@ -107,7 +107,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi } } else { zathura_page_set_visibility(page, false); - /* If a page becomes invisible, abort all render requests. */ + /* If a page becomes invisible, abort the render request. */ zathura_page_widget_abort_render_request(zathura_page_widget); /* if the page is not visible and not cached, but still has a surface, we * need to get rid of the surface */ @@ -370,6 +370,13 @@ cb_sc_display_link(GtkEntry* entry, girara_session_t* session) return handle_link(entry, session, ZATHURA_LINK_ACTION_DISPLAY); } +static gboolean +file_monitor_reload(void* data) +{ + sc_reload((girara_session_t*) data, NULL, NULL, 0); + return FALSE; +} + void cb_file_monitor(GFileMonitor* monitor, GFile* file, GFile* UNUSED(other_file), GFileMonitorEvent event, girara_session_t* session) { @@ -380,9 +387,7 @@ cb_file_monitor(GFileMonitor* monitor, GFile* file, GFile* UNUSED(other_file), G switch (event) { case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: case G_FILE_MONITOR_EVENT_CREATED: - gdk_threads_enter(); - sc_reload(session, NULL, NULL, 0); - gdk_threads_leave(); + g_main_context_invoke(NULL, file_monitor_reload, session); break; default: return; diff --git a/main.c b/main.c index 26d561a..692aa67 100644 --- a/main.c +++ b/main.c @@ -25,7 +25,9 @@ main(int argc, char* argv[]) #if !GLIB_CHECK_VERSION(2, 31, 0) g_thread_init(NULL); #endif +#if !GTK_CHECK_VERSION(3, 6, 0) gdk_threads_init(); +#endif gtk_init(&argc, &argv); /* create zathura session */ @@ -46,7 +48,7 @@ main(int argc, char* argv[]) bool synctex = false; int page_number = ZATHURA_PAGE_NUMBER_UNSPECIFIED; -#if (GTK_MAJOR_VERSION == 3) +#if GTK_CHECK_VERSION(3, 0, 0) Window embed = 0; #else GdkNativeWindow embed = 0; @@ -148,9 +150,13 @@ main(int argc, char* argv[]) } /* run zathura */ +#if !GTK_CHECK_VERSION(3, 6, 0) gdk_threads_enter(); +#endif gtk_main(); +#if !GTK_CHECK_VERSION(3, 6, 0) gdk_threads_leave(); +#endif /* free zathura */ zathura_free(zathura); From d09cd5c62cd0a71425011fa3361c032519003669 Mon Sep 17 00:00:00 2001 From: Marwan Tanager Date: Sat, 31 Aug 2013 06:18:31 +0200 Subject: [PATCH 15/90] Make the X clipboard buffer configurable This patch adds a new configuration setting, selection-clipboard, which allows us to choose between the PRIMARY selection, and the CLIPBOARD selection, for determining which X clipboard to use for storing mouse-selected data. It has only two valid values: "primary" and "clipboard", with "clipboard" being set as the it's default value. Signed-off-by: Sebastian Ramacher --- config.c | 3 +++ page-widget.c | 18 ++++++++++++++---- shortcuts.c | 14 +++++++++++--- utils.c | 26 ++++++++++++++++++++++++++ utils.h | 10 ++++++++++ zathurarc.5.rst | 11 +++++++++++ 6 files changed, 75 insertions(+), 7 deletions(-) diff --git a/config.c b/config.c index 88f007d..d5fb533 100644 --- a/config.c +++ b/config.c @@ -128,6 +128,7 @@ config_load_default(zathura_t* zathura) float float_value = 0; bool bool_value = false; bool inc_search = true; + char* string_value = NULL; girara_session_t* gsession = zathura->ui.session; /* mode settings */ @@ -222,6 +223,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); + string_value = "clipboard"; + 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); diff --git a/page-widget.c b/page-widget.c index adf69da..d5ebd96 100644 --- a/page-widget.c +++ b/page-widget.c @@ -669,15 +669,20 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b char* text = zathura_page_get_text(priv->page, tmp, NULL); if (text != NULL) { if (strlen(text) > 0) { - /* copy to clipboard */ - gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), text, -1); + GdkAtom* selection = get_selection(priv->zathura); + /* copy to clipboard */ + if (selection != NULL) { + gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1); + } if (priv->page != NULL && document != NULL && priv->zathura != NULL) { char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' '); girara_notify(priv->zathura->ui.session, GIRARA_INFO, _("Copied selected text to clipboard: %s"), stripped_text); g_free(stripped_text); } + + g_free(selection); } g_free(text); @@ -832,9 +837,14 @@ cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page) GdkPixbuf* pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, 0, 0, 0, 0, width, height); - gtk_clipboard_set_image(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), pixbuf); - gtk_clipboard_set_image(gtk_clipboard_get(GDK_SELECTION_PRIMARY), pixbuf); + GdkAtom* selection = get_selection(priv->zathura); + if (selection != NULL) { + gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf); + gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf); + } + + g_free(selection); /* reset */ priv->images.current = NULL; #endif diff --git a/shortcuts.c b/shortcuts.c index d251cdd..1191144 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -274,16 +274,24 @@ sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument, girara g_free(tmp); } + GdkAtom* selection = get_selection(zathura); + /* we save the X clipboard that will be clear by "grab_focus" */ - gchar* x_clipboard_text = gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY)); + gchar* x_clipboard_text; + + if (selection != NULL) { + x_clipboard_text = gtk_clipboard_wait_for_text(gtk_clipboard_get(*selection)); + } gtk_editable_set_position(GTK_EDITABLE(session->gtk.inputbar_entry), -1); - if (x_clipboard_text != NULL) { + if (x_clipboard_text != NULL && selection != NULL) { /* we reset the X clipboard with saved text */ - gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), x_clipboard_text, -1); + gtk_clipboard_set_text(gtk_clipboard_get(*selection), x_clipboard_text, -1); g_free(x_clipboard_text); } + + g_free(selection); } return true; diff --git a/utils.c b/utils.c index 7c462b3..e92c8f3 100644 --- a/utils.c +++ b/utils.c @@ -411,3 +411,29 @@ replace_substring(const char* string, const char* old, const char* new) return ret; } + +GdkAtom* get_selection(zathura_t* zathura) +{ + g_return_val_if_fail(zathura != NULL, NULL); + + 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; + } + + g_free(value); + + return selection; +} diff --git a/utils.h b/utils.h index ce6baf6..d42baf5 100644 --- a/utils.h +++ b/utils.h @@ -154,4 +154,14 @@ char* zathura_get_version_string(zathura_t* zathura, bool markup); */ char* replace_substring(const char* string, const char* old, const char* new); +/** + * Get a pointer to the GdkAtom of the current clipboard. + * + * @param zathura The zathura instance + * + * @return A pointer to a GdkAtom object correspoinding to the current + * clipboard, or NULL. + */ +GdkAtom* get_selection(zathura_t* zathura); + #endif // UTILS_H diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 17bad11..c7c520f 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -749,6 +749,17 @@ Defines the amount of percent that is zoomed in or out on each command. * Value type: Integer * Default value: 10 +selection-clipboard +^^^^^^^^^^^^^^^^^^^ +Defines the X clipbaord into which mouse-selected data will be written. When it +is "clipboard", selected data will be written to the CLIPBOARD clipboard, and +can be pasted using the Ctrl+v key combination. When it is "primary", selected +data will be written to the PRIMARY clipboard, and can be pasted using the +middle mouse button, or the Shift-Insert key combination. + +* Value type: String +* Default value: clipbaord + SEE ALSO ======== From d48f1e023ba7b83f9eb3fe27dd87b97f9e66329b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 31 Aug 2013 12:32:12 +0200 Subject: [PATCH 16/90] Use primary selection as before Signed-off-by: Sebastian Ramacher --- config.c | 2 +- zathurarc.5.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index d5fb533..ecb8075 100644 --- a/config.c +++ b/config.c @@ -223,7 +223,7 @@ 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); - string_value = "clipboard"; + 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 */ diff --git a/zathurarc.5.rst b/zathurarc.5.rst index c7c520f..56cb71b 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -758,7 +758,7 @@ data will be written to the PRIMARY clipboard, and can be pasted using the middle mouse button, or the Shift-Insert key combination. * Value type: String -* Default value: clipbaord +* Default value: primary SEE ALSO ======== From 2ad2b9e0c4bf1a32e099d6262d25b10fddb32c0b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 31 Aug 2013 13:12:41 +0200 Subject: [PATCH 17/90] Use signals for selected images and text The page widget shouldn't have to care what should be done with selected images and text. Signed-off-by: Sebastian Ramacher --- callbacks.c | 39 +++++++++++++++++++++++++++++++++++ callbacks.h | 13 ++++++++++++ page-widget.c | 56 ++++++++++++++++++++++++++++++++------------------- page-widget.h | 4 +--- types.h | 5 +++++ zathura.c | 5 +++++ 6 files changed, 98 insertions(+), 24 deletions(-) diff --git a/callbacks.c b/callbacks.c index 1c49df0..992ff23 100644 --- a/callbacks.c +++ b/callbacks.c @@ -541,3 +541,42 @@ cb_unknown_command(girara_session_t* session, const char* input) return true; } + +void +cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data) +{ + g_return_if_fail(page != NULL); + g_return_if_fail(text != NULL); + g_return_if_fail(data != NULL); + + zathura_t* zathura = data; + GdkAtom* selection = get_selection(zathura); + + /* copy to clipboard */ + if (selection != NULL) { + gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1); + + char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' '); + girara_notify(zathura->ui.session, GIRARA_INFO, _("Copied selected text to clipboard: %s"), stripped_text); + g_free(stripped_text); + } + + g_free(selection); +} + +void +cb_page_widget_image_selected(ZathuraPage* page, GdkPixbuf* pixbuf, void* data) +{ + g_return_if_fail(page != NULL); + g_return_if_fail(pixbuf != NULL); + g_return_if_fail(data != NULL); + + zathura_t* zathura = data; + GdkAtom* selection = get_selection(zathura); + + if (selection != NULL) { + gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf); + } + + g_free(selection); +} diff --git a/callbacks.h b/callbacks.h index d879732..e1af85d 100644 --- a/callbacks.h +++ b/callbacks.h @@ -202,4 +202,17 @@ void cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* n */ bool cb_unknown_command(girara_session_t* session, const char* input); +/** + * Emitted when text has been selected in the page widget + * + * @param widget page view widget + * @param text selected text + * @param data user data + */ +void cb_page_widget_text_selected(ZathuraPage* page, const char* text, + void* data); + +void cb_page_widget_image_selected(ZathuraPage* page, GdkPixbuf* pixbuf, + void* data); + #endif // CALLBACKS_H diff --git a/page-widget.c b/page-widget.c index d5ebd96..5f0cf26 100644 --- a/page-widget.c +++ b/page-widget.c @@ -90,6 +90,14 @@ enum properties_e { PROP_LAST_VIEW, }; +enum { + TEXT_SELECTED, + IMAGE_SELECTED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + static void zathura_page_widget_class_init(ZathuraPageClass* class) { @@ -135,6 +143,29 @@ zathura_page_widget_class_init(ZathuraPageClass* class) g_param_spec_boolean("draw-search-results", "draw-search-results", "Set to true if search results should be drawn", FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, PROP_LAST_VIEW, g_param_spec_int64("last-view", "last-view", "Last time the page has been viewed", -1, G_MAXINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /* add signals */ + signals[TEXT_SELECTED] = g_signal_new("text-selected", + ZATHURA_TYPE_PAGE, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, + G_TYPE_STRING); + + signals[IMAGE_SELECTED] = g_signal_new("image-selected", + ZATHURA_TYPE_PAGE, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, + G_TYPE_OBJECT); } static void @@ -669,20 +700,8 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b char* text = zathura_page_get_text(priv->page, tmp, NULL); if (text != NULL) { if (strlen(text) > 0) { - GdkAtom* selection = get_selection(priv->zathura); - - /* copy to clipboard */ - if (selection != NULL) { - gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1); - } - - if (priv->page != NULL && document != NULL && priv->zathura != NULL) { - char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' '); - girara_notify(priv->zathura->ui.session, GIRARA_INFO, _("Copied selected text to clipboard: %s"), stripped_text); - g_free(stripped_text); - } - - g_free(selection); + /* emit text-selected signal */ + g_signal_emit(ZATHURA_PAGE(widget), signals[TEXT_SELECTED], 0, text); } g_free(text); @@ -837,14 +856,9 @@ cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page) GdkPixbuf* pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, 0, 0, 0, 0, width, height); - GdkAtom* selection = get_selection(priv->zathura); + g_signal_emit(page, signals[IMAGE_SELECTED], 0, pixbuf); + g_object_unref(pixbuf); - if (selection != NULL) { - gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf); - gtk_clipboard_set_image(gtk_clipboard_get(*selection), pixbuf); - } - - g_free(selection); /* reset */ priv->images.current = NULL; #endif diff --git a/page-widget.h b/page-widget.h index b9a1c38..1a54708 100644 --- a/page-widget.h +++ b/page-widget.h @@ -4,6 +4,7 @@ #define PAGE_WIDGET_H #include +#include "types.h" #include "document.h" /** @@ -14,9 +15,6 @@ * Before the properties contain the correct values, 'draw-links' has to be set * to TRUE at least one time. * */ -typedef struct zathura_page_widget_s ZathuraPage; -typedef struct zathura_page_widget_class_s ZathuraPageClass; - struct zathura_page_widget_s { GtkDrawingArea parent; diff --git a/types.h b/types.h index 50bacb6..e3d915e 100644 --- a/types.h +++ b/types.h @@ -15,6 +15,11 @@ typedef struct zathura_document_s zathura_document_t; * Page */ typedef struct zathura_page_s zathura_page_t; +/** + * Page widget + */ +typedef struct zathura_page_widget_s ZathuraPage; +typedef struct zathura_page_widget_class_s ZathuraPageClass; /** * Zathura */ diff --git a/zathura.c b/zathura.c index 182a99a..c647cc9 100644 --- a/zathura.c +++ b/zathura.c @@ -736,6 +736,11 @@ document_open(zathura_t* zathura, const char* path, const char* password, page_calc_height_width(page, &page_height, &page_width, true); gtk_widget_set_size_request(page_widget, page_width, page_height); + + g_signal_connect(G_OBJECT(page_widget), "text-selected", + G_CALLBACK(cb_page_widget_text_selected), zathura); + g_signal_connect(G_OBJECT(page_widget), "image-selected", + G_CALLBACK(cb_page_widget_text_selected), zathura); } /* view mode */ From fef9d8f27ef9bf0cf7a1c3f1f062a5e63bb47822 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 1 Sep 2013 18:23:21 +0200 Subject: [PATCH 18/90] Update list of possible arguments Signed-off-by: Sebastian Ramacher --- zathurarc.5.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 56cb71b..1c90221 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -246,9 +246,14 @@ behaviour of them. Those can be passed as the last argument: Possible arguments are: +* best-fit * bottom +* collapse +* collapse-all * default * down +* expand +* expand-all * full-down * full-up * half-down @@ -259,13 +264,12 @@ Possible arguments are: * out * previous * right +* rotate-ccw +* rotate-cw * specific * top * up -* best-fit * width -* rotate-cw -* rotate-ccw unmap - Removing a shortcut --------------------------- From 9d70da690cc969705ce2897b5093d326ec386440 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 12 Sep 2013 19:55:51 +0200 Subject: [PATCH 19/90] Add Keywords Signed-off-by: Sebastian Ramacher --- zathura.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/zathura.desktop b/zathura.desktop index 9bf8a6e..8efe8a2 100644 --- a/zathura.desktop +++ b/zathura.desktop @@ -20,3 +20,4 @@ Comment[uk_UA]=Легкий переглядач документів Exec=zathura %f Terminal=false Categories=Office;Viewer; +Keywords=PDF;PS;PostScript;DjVU;document;presentation; From 4e010616e8db5778b2ee7a72fa926b76f31a2e88 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 13 Sep 2013 00:01:55 +0200 Subject: [PATCH 20/90] It's clipboard Signed-off-by: Sebastian Ramacher --- zathurarc.5.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 1c90221..260b993 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -755,7 +755,7 @@ Defines the amount of percent that is zoomed in or out on each command. selection-clipboard ^^^^^^^^^^^^^^^^^^^ -Defines the X clipbaord into which mouse-selected data will be written. When it +Defines the X clipboard into which mouse-selected data will be written. When it is "clipboard", selected data will be written to the CLIPBOARD clipboard, and can be pasted using the Ctrl+v key combination. When it is "primary", selected data will be written to the PRIMARY clipboard, and can be pasted using the From d423ff7305a29f9a9a95d0eab6b7d5185d117298 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Sat, 14 Sep 2013 23:43:39 +0200 Subject: [PATCH 21/90] Allow numbers for quickmarks --- marks.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/marks.c b/marks.c index c00b2cc..41144ad 100644 --- a/marks.c +++ b/marks.c @@ -71,8 +71,10 @@ cb_marks_view_key_press_event_add(GtkWidget* UNUSED(widget), GdkEventKey* event, G_CALLBACK(girara_callback_view_key_press_event), session); /* evaluate key */ - if (((event->keyval >= 0x41 && event->keyval <= 0x5A) || (event->keyval >= - 0x61 && event->keyval <= 0x7A)) == false) { + if (((event->keyval >= '0' && event->keyval <= '9') || + (event->keyval >= 'a' && event->keyval <= 'z') || + (event->keyval >= 'A' && event->keyval <= 'Z') + ) == false) { return false; } @@ -95,8 +97,10 @@ bool cb_marks_view_key_press_event_evaluate(GtkWidget* UNUSED(widget), GdkEventK G_CALLBACK(girara_callback_view_key_press_event), session); /* evaluate key */ - if (((event->keyval >= 0x41 && event->keyval <= 0x5A) || (event->keyval >= - 0x61 && event->keyval <= 0x7A)) == false) { + if (((event->keyval >= '0' && event->keyval <= '9') || + (event->keyval >= 'a' && event->keyval <= 'z') || + (event->keyval >= 'A' && event->keyval <= 'Z') + ) == false) { return true; } From f3ef76f909a14ef3c2883b4932e573570a39a9f1 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Mon, 7 Oct 2013 09:02:38 +0200 Subject: [PATCH 22/90] Initialize x_clipboard_text with NULL --- shortcuts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shortcuts.c b/shortcuts.c index 1191144..1820a98 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -277,7 +277,7 @@ sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument, girara GdkAtom* selection = get_selection(zathura); /* we save the X clipboard that will be clear by "grab_focus" */ - gchar* x_clipboard_text; + gchar* x_clipboard_text = NULL; if (selection != NULL) { x_clipboard_text = gtk_clipboard_wait_for_text(gtk_clipboard_get(*selection)); From e7cd4e5f8c06c381ba35b82813f3b173ea31775d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 18 Oct 2013 20:00:04 +0200 Subject: [PATCH 23/90] Move page cache to ZathuraRenderer Signed-off-by: Sebastian Ramacher --- callbacks.c | 4 +- render.c | 224 ++++++++++++++++++++++++++++++++++++++++++++++++---- render.h | 25 +++++- zathura.c | 147 +++------------------------------- zathura.h | 35 ++------ 5 files changed, 252 insertions(+), 183 deletions(-) diff --git a/callbacks.c b/callbacks.c index 414bcb7..c562d5d 100644 --- a/callbacks.c +++ b/callbacks.c @@ -98,7 +98,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi if (zathura_page_get_visibility(page) == false) { zathura_page_set_visibility(page, true); zathura_page_widget_update_view_time(zathura_page_widget); - zathura_page_cache_add(zathura, zathura_page_get_index(page)); + zathura_page_cache_add(zathura->sync.render_thread, zathura_page_get_index(page)); } if (zathura->global.update_page_number == true && updated == false && gdk_rectangle_intersect(¢er, &page_rect, NULL) == TRUE) { @@ -112,7 +112,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi /* if the page is not visible and not cached, but still has a surface, we * need to get rid of the surface */ if (zathura_page_widget_have_surface(zathura_page_widget) == true && - zathura_page_cache_is_cached(zathura, zathura_page_get_index(page)) == false) { + zathura_page_cache_is_cached(zathura->sync.render_thread, zathura_page_get_index(page)) == false) { zathura_page_widget_update_surface(zathura_page_widget, NULL); } diff --git a/render.c b/render.c index 050cc4f..1ba7234 100644 --- a/render.c +++ b/render.c @@ -16,13 +16,17 @@ G_DEFINE_TYPE(ZathuraRenderer, zathura_renderer, G_TYPE_OBJECT) G_DEFINE_TYPE(ZathuraRenderRequest, zathura_render_request, G_TYPE_OBJECT) /* private methods for ZathuraRenderer */ -static void zathura_renderer_finalize(GObject* object); +static void renderer_finalize(GObject* object); /* private methods for ZathuraRenderRequest */ -static void zathura_render_request_finalize(GObject* object); +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); + /* private data for ZathuraRenderer */ @@ -31,7 +35,9 @@ typedef struct private_s { mutex mutex; /**< Render lock */ volatile bool about_to_close; /**< Render thread is to be freed */ - /* recolor information */ + /** + * recolor information + */ struct { bool enabled; bool hue; @@ -41,6 +47,18 @@ typedef struct private_s { double dark[3]; GdkColor dark_gdk; } recolor; + + /* + * page cache + */ + struct { + int* cache; + size_t size; + size_t num_cached_pages; + } page_cache; + + /* render requests */ + girara_list_t* requests; } private_t; /* private data for ZathuraRenderRequest */ @@ -68,7 +86,7 @@ zathura_renderer_class_init(ZathuraRendererClass* class) /* overwrite methods */ GObjectClass* object_class = G_OBJECT_CLASS(class); - object_class->finalize = zathura_renderer_finalize; + object_class->finalize = renderer_finalize; } static void @@ -80,21 +98,44 @@ zathura_renderer_init(ZathuraRenderer* renderer) g_thread_pool_set_sort_function(priv->pool, render_thread_sort, NULL); mutex_init(&priv->mutex); + /* recolor */ priv->recolor.enabled = false; priv->recolor.hue = true; - zathura_renderer_set_recolor_colors_str(renderer, "#000000", "#FFFFFF"); -} + /* page cache */ + priv->page_cache.size = 0; + priv->page_cache.cache = NULL; + priv->page_cache.num_cached_pages = 0; -ZathuraRenderer* -zathura_renderer_new() -{ - GObject* obj = g_object_new(ZATHURA_TYPE_RENDERER, NULL); - return ZATHURA_RENDERER(obj); + zathura_renderer_set_recolor_colors_str(renderer, "#000000", "#FFFFFF"); + + priv->requests = girara_list_new(); } static void -zathura_renderer_finalize(GObject* object) +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)); + page_cache_invalidate_all(renderer); +} + +ZathuraRenderer* +zathura_renderer_new(size_t cache_size) +{ + g_return_val_if_fail(cache_size > 0, NULL); + + GObject* obj = g_object_new(ZATHURA_TYPE_RENDERER, NULL); + ZathuraRenderer* ret = ZATHURA_RENDERER(obj); + page_cache_init(ret, cache_size); + + return ret; +} + +static void +renderer_finalize(GObject* object) { ZathuraRenderer* renderer = ZATHURA_RENDERER(object); private_t* priv = GET_PRIVATE(renderer); @@ -104,6 +145,29 @@ zathura_renderer_finalize(GObject* object) g_thread_pool_free(priv->pool, TRUE, TRUE); } mutex_free(&(priv->mutex)); + + free(priv->page_cache.cache); + girara_list_free(priv->requests); +} + +/* (un)register requests at the renderer */ + +static void +renderer_unregister_request(ZathuraRenderer* renderer, + ZathuraRenderRequest* request) +{ + private_t* priv = GET_PRIVATE(renderer); + girara_list_remove(priv->requests, request); +} + +static void +renderer_register_request(ZathuraRenderer* renderer, + ZathuraRenderRequest* request) +{ + private_t* priv = GET_PRIVATE(renderer); + if (girara_list_contains(priv->requests, request) == false) { + girara_list_append(priv->requests, request); + } } /* init, new and free for ZathuraRenderRequest */ @@ -123,7 +187,7 @@ zathura_render_request_class_init(ZathuraRenderRequestClass* class) /* overwrite methods */ GObjectClass* object_class = G_OBJECT_CLASS(class); - object_class->finalize = zathura_render_request_finalize; + object_class->finalize = render_request_finalize; request_signals[REQUEST_COMPLETED] = g_signal_new("completed", ZATHURA_TYPE_RENDER_REQUEST, @@ -163,16 +227,22 @@ zathura_render_request_new(ZathuraRenderer* renderer, zathura_page_t* page) priv->aborted = false; priv->requested = false; + /* register the request with the renderer */ + renderer_register_request(renderer, request); + return request; } static void -zathura_render_request_finalize(GObject* object) +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); } } @@ -626,3 +696,129 @@ render_thread_sort(gconstpointer a, gconstpointer b, gpointer UNUSED(data)) /* sort aborted entries earlier so that the are thrown out of the queue */ return priv_a->aborted ? 1 : -1; } + + +/* cache functions */ + +bool +zathura_page_cache_is_cached(ZathuraRenderer* renderer, unsigned int page_index) +{ + g_return_val_if_fail(renderer != NULL, false); + private_t* priv = GET_PRIVATE(renderer); + + if (priv->page_cache.num_cached_pages != 0) { + for (size_t i = 0; i < priv->page_cache.size; ++i) { + if (priv->page_cache.cache[i] >= 0 && + page_index == (unsigned int)priv->page_cache.cache[i]) { + girara_debug("Page %d is a cache hit", page_index + 1); + return true; + } + } + } + + girara_debug("Page %d is a cache miss", page_index + 1); + return false; +} + +static int +find_request_by_page_index(const void* req, const void* data) +{ + const ZathuraRenderRequest* request = req; + const unsigned int page_index = *((const int*)data); + + request_private_t* priv = REQUEST_GET_PRIVATE(request); + if (zathura_page_get_index(priv->page) == page_index) { + return 0; + } + return 1; +} + +static ssize_t +page_cache_lru_invalidate(ZathuraRenderer* renderer) +{ + g_return_val_if_fail(renderer != NULL, -1); + private_t* priv = GET_PRIVATE(renderer); + g_return_val_if_fail(priv->page_cache.size != 0, -1); + + ssize_t lru_index = 0; + gint64 lru_view_time = G_MAXINT64; + + for (size_t i = 0; i < priv->page_cache.size; ++i) { + ZathuraRenderRequest* request = girara_list_find(priv->requests, + find_request_by_page_index, &priv->page_cache.cache[i]); + g_return_val_if_fail(request != NULL, -1); + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + + if (request_priv->last_view_time < lru_view_time) { + lru_view_time = request_priv->last_view_time; + lru_index = i; + } + } + + ZathuraRenderRequest* request = girara_list_find(priv->requests, + find_request_by_page_index, &priv->page_cache.cache[lru_index]); + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + + /* emit the signal */ + g_signal_emit(request, request_signals[REQUEST_COMPLETED], 0, NULL); + girara_debug("Invalidated page %d at cache index %zd", + zathura_page_get_index(request_priv->page) + 1, lru_index); + priv->page_cache.cache[lru_index] = -1; + --priv->page_cache.num_cached_pages; + + return lru_index; +} + +static bool +page_cache_is_full(ZathuraRenderer* renderer, bool* result) +{ + g_return_val_if_fail(renderer != NULL && result != NULL, false); + private_t* priv = GET_PRIVATE(renderer); + + *result = priv->page_cache.num_cached_pages == priv->page_cache.size; + + return true; +} + +void +page_cache_invalidate_all(ZathuraRenderer* renderer) +{ + g_return_if_fail(renderer != NULL); + + private_t* priv = GET_PRIVATE(renderer); + for (size_t i = 0; i < priv->page_cache.size; ++i) { + priv->page_cache.cache[i] = -1; + } + priv->page_cache.num_cached_pages = 0; +} + +void +zathura_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index) +{ + g_return_if_fail(renderer != NULL); + if (zathura_page_cache_is_cached(renderer, page_index) == true) { + return; + } + + private_t* priv = GET_PRIVATE(renderer); + bool full = false; + if (page_cache_is_full(renderer, &full) == false) { + return; + } else if (full == true) { + ssize_t idx = page_cache_lru_invalidate(renderer); + + if (idx == -1) { + return; + } + + priv->page_cache.cache[idx] = page_index; + ++priv->page_cache.num_cached_pages; + girara_debug("Page %d is cached at cache index %zd", page_index + 1, idx); + return; + } + + priv->page_cache.cache[priv->page_cache.num_cached_pages++] = page_index; + girara_debug("Page %d is cached at cache index %zu", page_index + 1, + priv->page_cache.num_cached_pages - 1); + return; +} diff --git a/render.h b/render.h index 0963a9e..0b48c85 100644 --- a/render.h +++ b/render.h @@ -44,7 +44,7 @@ GType zathura_renderer_get_type(void); * Create a renderer. * @return a renderer object */ -ZathuraRenderer* zathura_renderer_new(void); +ZathuraRenderer* zathura_renderer_new(size_t cache_size); /** * Return whether recoloring is enabled. @@ -116,6 +116,29 @@ void zathura_renderer_lock(ZathuraRenderer* renderer); */ void zathura_renderer_unlock(ZathuraRenderer* renderer); +/** + * Add a page to the page cache + * + * @param zathura The zathura session + * @param page_index The index of the page to be cached + */ +void zathura_page_cache_add(ZathuraRenderer* renderer, + unsigned int page_index); + +/** + * Checks if the given page is cached + * + * @param zathura The zathura session + * @param page_index The index of the page that may be cached + * + * @return true if page is cached otherwise false + */ +bool zathura_page_cache_is_cached(ZathuraRenderer* renderer, + unsigned int page_index); + + + + typedef struct zathura_render_request_s ZathuraRenderRequest; typedef struct zathura_render_request_class_s ZathuraRenderRequestClass; diff --git a/zathura.c b/zathura.c index bbf2f42..8ba2e80 100644 --- a/zathura.c +++ b/zathura.c @@ -54,9 +54,6 @@ typedef struct position_set_delayed_s { } position_set_delayed_t; static gboolean document_info_open(gpointer data); -static ssize_t zathura_page_cache_lru_invalidate(zathura_t* zathura); -static void zathura_page_cache_invalidate_all(zathura_t* zathura); -static bool zathura_page_cache_is_full(zathura_t* zathura, bool* result); static void zathura_jumplist_reset_current(zathura_t* zathura); static void zathura_jumplist_append_jump(zathura_t* zathura); static void zathura_jumplist_save(zathura_t* zathura); @@ -279,20 +276,6 @@ zathura_init(zathura_t* zathura) zathura->jumplist.size = 0; zathura->jumplist.cur = NULL; - /* page cache */ - - int cache_size = 0; - girara_setting_get(zathura->ui.session, "page-cache-size", &cache_size); - if (cache_size <= 0) { - girara_warning("page-cache-size is not positive, using %d instead", ZATHURA_PAGE_CACHE_DEFAULT_SIZE); - zathura->page_cache.size = ZATHURA_PAGE_CACHE_DEFAULT_SIZE; - } else { - zathura->page_cache.size = cache_size; - } - - zathura->page_cache.cache = g_malloc(zathura->page_cache.size * sizeof(int)); - zathura_page_cache_invalidate_all(zathura); - return true; error_free: @@ -367,8 +350,6 @@ zathura_free(zathura_t* zathura) girara_list_iterator_free(zathura->jumplist.cur); } - g_free(zathura->page_cache.cache); - g_free(zathura); } @@ -710,8 +691,17 @@ document_open(zathura_t* zathura, const char* path, const char* password, zathura->document = document; + /* page cache size */ + int cache_size = 0; + girara_setting_get(zathura->ui.session, "page-cache-size", &cache_size); + if (cache_size <= 0) { + girara_warning("page-cache-size is not positive, using %d instead", + ZATHURA_PAGE_CACHE_DEFAULT_SIZE); + cache_size = ZATHURA_PAGE_CACHE_DEFAULT_SIZE; + } + /* threads */ - zathura->sync.render_thread = zathura_renderer_new(); + zathura->sync.render_thread = zathura_renderer_new(cache_size); if (zathura->sync.render_thread == NULL) { goto error_free; @@ -821,9 +811,6 @@ document_open(zathura_t* zathura, const char* path, const char* password, cb_view_vadjustment_value_changed(NULL, zathura); } - /* Invalidate all current entries in the page cache */ - zathura_page_cache_invalidate_all(zathura); - return true; error_free: @@ -1400,117 +1387,3 @@ zathura_jumplist_save(zathura_t* zathura) cur->y = zathura_adjustment_get_ratio(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); } } - -bool -zathura_page_cache_is_cached(zathura_t* zathura, unsigned int page_index) -{ - g_return_val_if_fail(zathura != NULL, false); - - unsigned int i; - - if (zathura->page_cache.num_cached_pages != 0) { - for (i = 0; i < zathura->page_cache.size; ++i) { - if (zathura->page_cache.cache[i] >= 0 && page_index == (unsigned int)zathura->page_cache.cache[i]) { - girara_debug("Page %d is a cache hit", page_index + 1); - return true; - } - } - } - - girara_debug("Page %d is a cache miss", page_index + 1); - return false; -} - -static ssize_t -zathura_page_cache_lru_invalidate(zathura_t* zathura) -{ - g_return_val_if_fail(zathura != NULL, -1); - - ssize_t lru_index = 0; - gint64 view_time = 0; - gint64 lru_view_time = G_MAXINT64; - GtkWidget* page_widget; - - for (unsigned int i = 0; i < zathura->page_cache.size; ++i) { - page_widget = zathura_page_get_widget(zathura, zathura_document_get_page(zathura->document, zathura->page_cache.cache[i])); - g_return_val_if_fail(page_widget != NULL, -1); - g_object_get(G_OBJECT(page_widget), "last-view", &view_time, NULL); - - if (view_time < lru_view_time) { - lru_view_time = view_time; - lru_index = i; - } - } - - zathura_page_t* page = zathura_document_get_page(zathura->document, zathura->page_cache.cache[lru_index]); - g_return_val_if_fail(page != NULL, -1); - - page_widget = zathura_page_get_widget(zathura, page); - g_return_val_if_fail(page_widget != NULL, -1); - - zathura_page_widget_update_surface(ZATHURA_PAGE(page_widget), NULL); - girara_debug("Invalidated page %d at cache index %zd", zathura->page_cache.cache[lru_index] + 1, lru_index); - zathura->page_cache.cache[lru_index] = -1; - --zathura->page_cache.num_cached_pages; - - return lru_index; -} - -static bool -zathura_page_cache_is_full(zathura_t* zathura, bool* result) -{ - g_return_val_if_fail(zathura != NULL && result != NULL, false); - - *result = zathura->page_cache.num_cached_pages == zathura->page_cache.size; - - return true; -} - -void -zathura_page_cache_invalidate_all(zathura_t* zathura) -{ - g_return_if_fail(zathura != NULL); - - unsigned int i; - - for (i = 0; i < zathura->page_cache.size; ++i) { - zathura->page_cache.cache[i] = -1; - } - - zathura->page_cache.num_cached_pages = 0; -} - -void -zathura_page_cache_add(zathura_t* zathura, unsigned int page_index) -{ - g_return_if_fail(zathura != NULL); - - zathura_page_t* page = zathura_document_get_page(zathura->document, page_index); - - g_return_if_fail(page != NULL); - - if (zathura_page_cache_is_cached(zathura, page_index) == true) { - return; - } - - bool full; - - if (zathura_page_cache_is_full(zathura, &full) == false) { - return; - } else if (full == true) { - ssize_t idx = zathura_page_cache_lru_invalidate(zathura); - - if (idx == -1) { - return; - } - - zathura->page_cache.cache[idx] = page_index; - ++zathura->page_cache.num_cached_pages; - girara_debug("Page %d is cached at cache index %zd", page_index + 1, idx); - return; - } - - zathura->page_cache.cache[zathura->page_cache.num_cached_pages++] = page_index; - girara_debug("Page %d is cached at cache index %d", page_index + 1, zathura->page_cache.num_cached_pages - 1); - return; -} diff --git a/zathura.h b/zathura.h index bea5d0a..1ed99a4 100644 --- a/zathura.h +++ b/zathura.h @@ -13,8 +13,6 @@ #include #endif -#define ZATHURA_PAGE_CACHE_DEFAULT_SIZE 15 - 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, @@ -28,6 +26,12 @@ enum { ZATHURA_PAGE_NUMBER_UNSPECIFIED = INT_MIN }; +/* cache constants */ +enum { + ZATHURA_PAGE_CACHE_DEFAULT_SIZE = 15, + ZATHURA_PAGE_CACHE_MAX_SIZE = 1024 +}; + /* forward declaration for types from database.h */ typedef struct _ZathuraDatabase zathura_database_t; @@ -147,15 +151,6 @@ struct zathura_s gchar* password; /**< Save password */ } file_monitor; - /** - * The page cache - */ - struct { - int* cache; - unsigned int size; - unsigned int num_cached_pages; - } page_cache; - /** * Bisect stage */ @@ -405,22 +400,4 @@ void zathura_jumplist_trim(zathura_t* zathura); */ bool zathura_jumplist_load(zathura_t* zathura, const char* file); -/** - * Add a page to the page cache - * - * @param zathura The zathura session - * @param page_index The index of the page to be cached - */ -void zathura_page_cache_add(zathura_t* zathura, unsigned int page_index); - -/** - * Checks if the given page is cached - * - * @param zathura The zathura session - * @param page_index The index of the page that may be cached - * - * @return true if page is cached otherwise false - */ -bool zathura_page_cache_is_cached(zathura_t* zathura, unsigned int page_index); - #endif // ZATHURA_H From 5df5357fb0263c874714e10fb0a71d22a8199957 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 19 Oct 2013 17:45:12 +0200 Subject: [PATCH 24/90] Finish moving of the page cache Add two more signals to ZathuraRenderRequest to notify pages if they are cached or not. This allows us to move some logic away from cb_view_vadjutment_value_changed to more appropriate places. ZathuraPageWidget will now release the surface if * it gets the signal that the page is no longer cached and the page is invisible, * the page is not cached and the render request is aborted. Signed-off-by: Sebastian Ramacher --- callbacks.c | 24 ++++++------- page-widget.c | 93 ++++++++++++++++++++++++++++++++--------------- render.c | 99 +++++++++++++++++++++++++++++++++++---------------- render.h | 16 ++------- 4 files changed, 144 insertions(+), 88 deletions(-) diff --git a/callbacks.c b/callbacks.c index c562d5d..2b3f48a 100644 --- a/callbacks.c +++ b/callbacks.c @@ -60,7 +60,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi GtkAdjustment* view_hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); /* current adjustment values */ - GdkRectangle view_rect = { + const GdkRectangle view_rect = { .x = 0, .y = 0, .width = gtk_adjustment_get_page_size(view_hadjustment), @@ -70,15 +70,15 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi int page_padding = 1; girara_setting_get(zathura->ui.session, "page-padding", &page_padding); - GdkRectangle center = { + const GdkRectangle center = { .x = (view_rect.width + 1) / 2, .y = (view_rect.height + 1) / 2, .width = (2 * page_padding) + 1, .height = (2 * page_padding) + 1 }; - unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); - double scale = zathura_document_get_scale(zathura->document); + const unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); + const double scale = zathura_document_get_scale(zathura->document); bool updated = false; /* find page that fits */ @@ -91,8 +91,8 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi }; GtkWidget* page_widget = zathura_page_get_widget(zathura, page); ZathuraPage* zathura_page_widget = ZATHURA_PAGE(page_widget); - gtk_widget_translate_coordinates(page_widget, - zathura->ui.session->gtk.view, 0, 0, &page_rect.x, &page_rect.y); + gtk_widget_translate_coordinates(page_widget, zathura->ui.session->gtk.view, + 0, 0, &page_rect.x, &page_rect.y); if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) { if (zathura_page_get_visibility(page) == false) { @@ -106,14 +106,10 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi updated = true; } } else { - zathura_page_set_visibility(page, false); - /* If a page becomes invisible, abort the render request. */ - zathura_page_widget_abort_render_request(zathura_page_widget); - /* if the page is not visible and not cached, but still has a surface, we - * need to get rid of the surface */ - if (zathura_page_widget_have_surface(zathura_page_widget) == true && - zathura_page_cache_is_cached(zathura->sync.render_thread, zathura_page_get_index(page)) == false) { - zathura_page_widget_update_surface(zathura_page_widget, NULL); + if (zathura_page_get_visibility(page) == true) { + zathura_page_set_visibility(page, false); + /* If a page becomes invisible, abort the render request. */ + zathura_page_widget_abort_render_request(zathura_page_widget); } girara_list_t* results = NULL; diff --git a/page-widget.c b/page-widget.c index 094af15..689580a 100644 --- a/page-widget.c +++ b/page-widget.c @@ -24,8 +24,8 @@ typedef struct zathura_page_widget_private_s { zathura_t* zathura; /**< Zathura object */ cairo_surface_t* surface; /**< Cairo surface */ ZathuraRenderRequest* render_request; /* Request object */ - gint64 last_view; /**< Last time the page has been viewed */ mutex lock; /**< Lock */ + bool cached; /**< Cached state */ struct { girara_list_t* list; /**< List of links on the page */ @@ -57,7 +57,8 @@ typedef struct zathura_page_widget_private_s { } zathura_page_widget_private_t; #define ZATHURA_PAGE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZATHURA_TYPE_PAGE, zathura_page_widget_private_t)) + (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_PAGE, \ + zathura_page_widget_private_t)) static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo); #if GTK_MAJOR_VERSION == 2 @@ -77,6 +78,8 @@ static gboolean cb_zathura_page_widget_popup_menu(GtkWidget* widget); static void cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page); static void cb_menu_image_save(GtkMenuItem* item, ZathuraPage* page); static void cb_update_surface(ZathuraRenderRequest* request, cairo_surface_t* surface, void* data); +static void cb_cache_added(ZathuraRenderRequest* request, void* data); +static void cb_cache_invalidated(ZathuraRenderRequest* request, void* data); enum properties_e { PROP_0, @@ -108,10 +111,10 @@ zathura_page_widget_class_init(ZathuraPageClass* class) /* overwrite methods */ GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(class); -#if GTK_MAJOR_VERSION == 3 - widget_class->draw = zathura_page_widget_draw; -#else +#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; @@ -143,8 +146,6 @@ zathura_page_widget_class_init(ZathuraPageClass* class) g_param_spec_int("search-length", "search-length", "The number of search results", -1, INT_MAX, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, PROP_DRAW_SEARCH_RESULTS, g_param_spec_boolean("draw-search-results", "draw-search-results", "Set to true if search results should be drawn", FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property(object_class, PROP_LAST_VIEW, - g_param_spec_int64("last-view", "last-view", "Last time the page has been viewed", -1, G_MAXINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /* add signals */ signals[TEXT_SELECTED] = g_signal_new("text-selected", @@ -177,7 +178,7 @@ zathura_page_widget_init(ZathuraPage* widget) priv->page = NULL; priv->surface = NULL; priv->render_request = NULL; - priv->last_view = g_get_real_time(); + priv->cached = false; priv->links.list = NULL; priv->links.retrieved = false; @@ -220,6 +221,10 @@ zathura_page_widget_new(zathura_t* zathura, zathura_page_t* page) priv->render_request = zathura_render_request_new(zathura->sync.render_thread, page); g_signal_connect_object(priv->render_request, "completed", G_CALLBACK(cb_update_surface), widget, 0); + g_signal_connect_object(priv->render_request, "cache-added", + G_CALLBACK(cb_cache_added), widget, 0); + g_signal_connect_object(priv->render_request, "cache-invalidated", + G_CALLBACK(cb_cache_invalidated), widget, 0); return GTK_WIDGET(ret); } @@ -355,9 +360,6 @@ zathura_page_widget_get_property(GObject* object, guint prop_id, GValue* value, case PROP_SEARCH_RESULTS: g_value_set_pointer(value, priv->search.list); break; - case PROP_LAST_VIEW: - g_value_set_int64(value, priv->last_view); - break; case PROP_DRAW_SEARCH_RESULTS: g_value_set_boolean(value, priv->search.draw); break; @@ -533,7 +535,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) } /* render real page */ - zathura_render_request(priv->render_request, priv->last_view); + zathura_render_request(priv->render_request, g_get_real_time()); } mutex_unlock(&(priv->lock)); return FALSE; @@ -556,12 +558,8 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface priv->surface = NULL; } if (surface != NULL) { - /* if we're not visible or not cached, we don't care about the surface */ - /*if (zathura_page_get_visibility(priv->page) == true || - zathura_page_cache_is_cached(priv->zathura, zathura_page_get_index(priv->page)) == true) */ { - priv->surface = surface; - cairo_surface_reference(surface); - } + priv->surface = surface; + cairo_surface_reference(surface); } mutex_unlock(&(priv->lock)); /* force a redraw here */ @@ -571,13 +569,41 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface } static void -cb_update_surface(ZathuraRenderRequest* UNUSED(request), cairo_surface_t* surface, void* data) +cb_update_surface(ZathuraRenderRequest* UNUSED(request), + cairo_surface_t* surface, void* data) { ZathuraPage* widget = data; g_return_if_fail(ZATHURA_IS_PAGE(widget)); zathura_page_widget_update_surface(widget, surface); } +static void +cb_cache_added(ZathuraRenderRequest* UNUSED(request), void* data) +{ + ZathuraPage* widget = data; + g_return_if_fail(ZATHURA_IS_PAGE(widget)); + + zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); + priv->cached = true; +} + +static void +cb_cache_invalidated(ZathuraRenderRequest* UNUSED(request), void* data) +{ + ZathuraPage* widget = data; + g_return_if_fail(ZATHURA_IS_PAGE(widget)); + + zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); + if (zathura_page_widget_have_surface(widget) == true && + priv->cached == true && + zathura_page_get_visibility(priv->page) == false) { + /* The page was in the cache but got removed and is invisible, so get rid of + * the surface. */ + zathura_page_widget_update_surface(widget, NULL); + } + priv->cached = false; +} + static void zathura_page_widget_size_allocate(GtkWidget* widget, GdkRectangle* allocation) { @@ -594,10 +620,10 @@ 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 == 3) - gtk_widget_queue_draw_area(GTK_WIDGET(widget), grect.x, grect.y, grect.width, grect.height); -#else +#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 } @@ -901,11 +927,11 @@ cb_menu_image_save(GtkMenuItem* item, ZathuraPage* page) unsigned int image_id = 1; GIRARA_LIST_FOREACH(priv->images.list, zathura_image_t*, iter, image_it) - if (image_it == priv->images.current) { - break; - } + if (image_it == priv->images.current) { + break; + } - image_id++; + image_id++; GIRARA_LIST_FOREACH_END(priv->images.list, zathura_image_t*, iter, image_it); /* set command */ @@ -921,18 +947,18 @@ cb_menu_image_save(GtkMenuItem* item, ZathuraPage* page) void zathura_page_widget_update_view_time(ZathuraPage* widget) { - g_return_if_fail(ZATHURA_IS_PAGE(widget) == TRUE); + g_return_if_fail(ZATHURA_IS_PAGE(widget)); zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); if (zathura_page_get_visibility(priv->page) == true) { - priv->last_view = g_get_real_time(); + zathura_render_request_update_view_time(priv->render_request); } } bool zathura_page_widget_have_surface(ZathuraPage* widget) { - g_return_val_if_fail(ZATHURA_IS_PAGE(widget) == TRUE, false); + g_return_val_if_fail(ZATHURA_IS_PAGE(widget), false); zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); return priv->surface != NULL; } @@ -943,5 +969,14 @@ zathura_page_widget_abort_render_request(ZathuraPage* widget) g_return_if_fail(ZATHURA_IS_PAGE(widget)); zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); zathura_render_request_abort(priv->render_request); + + /* Make sure that if we are not cached and invisible, that there is no + * surface. + * + * TODO: Maybe this should be moved somewhere else. */ + if (zathura_page_widget_have_surface(widget) == true && + priv->cached == false) { + zathura_page_widget_update_surface(widget, NULL); + } } diff --git a/render.c b/render.c index 1ba7234..9b6fe0f 100644 --- a/render.c +++ b/render.c @@ -28,7 +28,6 @@ static void page_cache_invalidate_all(ZathuraRenderer* renderer); static bool page_cache_is_full(ZathuraRenderer* renderer, bool* result); - /* private data for ZathuraRenderer */ typedef struct private_s { GThreadPool* pool; /**< Pool of threads */ @@ -174,6 +173,8 @@ renderer_register_request(ZathuraRenderer* renderer, enum { REQUEST_COMPLETED, + REQUEST_CACHE_ADDED, + REQUEST_CACHE_INVALIDATED, REQUEST_LAST_SIGNAL }; @@ -199,6 +200,26 @@ zathura_render_request_class_init(ZathuraRenderRequestClass* class) G_TYPE_NONE, 1, G_TYPE_POINTER); + + request_signals[REQUEST_CACHE_ADDED] = g_signal_new("cache-added", + ZATHURA_TYPE_RENDER_REQUEST, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + + request_signals[REQUEST_CACHE_INVALIDATED] = g_signal_new("cache-invalidated", + ZATHURA_TYPE_RENDER_REQUEST, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); } static void @@ -373,12 +394,12 @@ zathura_render_request(ZathuraRenderRequest* request, gint64 last_view_time) g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); request_private_t* request_priv = REQUEST_GET_PRIVATE(request); - private_t* priv = GET_PRIVATE(request_priv->renderer); if (request_priv->requested == false) { request_priv->requested = true; request_priv->aborted = false; request_priv->last_view_time = last_view_time; + private_t* priv = GET_PRIVATE(request_priv->renderer); g_thread_pool_push(priv->pool, request, NULL); } } @@ -394,6 +415,14 @@ zathura_render_request_abort(ZathuraRenderRequest* request) } } +void +zathura_render_request_update_view_time(ZathuraRenderRequest* request) +{ + g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); + + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + request_priv->last_view_time = g_get_real_time(); +} /* render job */ @@ -485,8 +514,10 @@ recolor(private_t* priv, unsigned int page_width, unsigned int page_height, { /* uses a representation of a rgb color as follows: - a lightness scalar (between 0,1), which is a weighted average of r, g, b, - - a hue vector, which indicates a radian direction from the grey axis, inside the equal lightness plane. - - a saturation scalar between 0,1. It is 0 when grey, 1 when the color is in the boundary of the rgb cube. + - a hue vector, which indicates a radian direction from the grey axis, + inside the equal lightness plane. + - a saturation scalar between 0,1. It is 0 when grey, 1 when the color is + in the boundary of the rgb cube. */ const int rowstride = cairo_image_surface_get_stride(surface); @@ -569,9 +600,11 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) /* create cairo surface */ unsigned int page_width = 0; unsigned int page_height = 0; - const double real_scale = page_calc_height_width(page, &page_height, &page_width, false); + const double real_scale = page_calc_height_width(page, &page_height, + &page_width, false); - cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height); + cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, + page_width, page_height); if (surface == NULL) { return false; } @@ -649,9 +682,11 @@ render_job(void* data, void* user_data) return; } - girara_debug("Rendering page %d ...", zathura_page_get_index(request_priv->page) + 1); + girara_debug("Rendering page %d ...", + zathura_page_get_index(request_priv->page) + 1); if (render(request, renderer) != true) { - girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); + girara_error("Rendering failed (page %d)\n", + zathura_page_get_index(request_priv->page) + 1); request_priv->requested = false; } } @@ -667,7 +702,8 @@ render_all(zathura_t* zathura) /* unmark all pages */ 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); + zathura_page_t* page = zathura_document_get_page(zathura->document, + page_id); unsigned int page_height = 0, page_width = 0; page_calc_height_width(page, &page_height, &page_width, true); @@ -700,8 +736,8 @@ render_thread_sort(gconstpointer a, gconstpointer b, gpointer UNUSED(data)) /* cache functions */ -bool -zathura_page_cache_is_cached(ZathuraRenderer* renderer, unsigned int page_index) +static bool +page_cache_is_cached(ZathuraRenderer* renderer, unsigned int page_index) { g_return_val_if_fail(renderer != NULL, false); private_t* priv = GET_PRIVATE(renderer); @@ -742,25 +778,24 @@ page_cache_lru_invalidate(ZathuraRenderer* renderer) ssize_t lru_index = 0; gint64 lru_view_time = G_MAXINT64; - + ZathuraRenderRequest* request = NULL; for (size_t i = 0; i < priv->page_cache.size; ++i) { - ZathuraRenderRequest* request = girara_list_find(priv->requests, + ZathuraRenderRequest* tmp_request = girara_list_find(priv->requests, find_request_by_page_index, &priv->page_cache.cache[i]); - g_return_val_if_fail(request != NULL, -1); - request_private_t* request_priv = REQUEST_GET_PRIVATE(request); + g_return_val_if_fail(tmp_request != NULL, -1); + request_private_t* request_priv = REQUEST_GET_PRIVATE(tmp_request); if (request_priv->last_view_time < lru_view_time) { lru_view_time = request_priv->last_view_time; lru_index = i; + request = tmp_request; } } - ZathuraRenderRequest* request = girara_list_find(priv->requests, - find_request_by_page_index, &priv->page_cache.cache[lru_index]); request_private_t* request_priv = REQUEST_GET_PRIVATE(request); /* emit the signal */ - g_signal_emit(request, request_signals[REQUEST_COMPLETED], 0, NULL); + g_signal_emit(request, request_signals[REQUEST_CACHE_INVALIDATED], 0); girara_debug("Invalidated page %d at cache index %zd", zathura_page_get_index(request_priv->page) + 1, lru_index); priv->page_cache.cache[lru_index] = -1; @@ -772,18 +807,18 @@ page_cache_lru_invalidate(ZathuraRenderer* renderer) static bool page_cache_is_full(ZathuraRenderer* renderer, bool* result) { - g_return_val_if_fail(renderer != NULL && result != NULL, false); - private_t* priv = GET_PRIVATE(renderer); + g_return_val_if_fail(ZATHURA_IS_RENDERER(renderer) && result != NULL, false); + private_t* priv = GET_PRIVATE(renderer); *result = priv->page_cache.num_cached_pages == priv->page_cache.size; return true; } -void +static void page_cache_invalidate_all(ZathuraRenderer* renderer) { - g_return_if_fail(renderer != NULL); + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); private_t* priv = GET_PRIVATE(renderer); for (size_t i = 0; i < priv->page_cache.size; ++i) { @@ -795,8 +830,8 @@ page_cache_invalidate_all(ZathuraRenderer* renderer) void zathura_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index) { - g_return_if_fail(renderer != NULL); - if (zathura_page_cache_is_cached(renderer, page_index) == true) { + g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); + if (page_cache_is_cached(renderer, page_index) == true) { return; } @@ -805,8 +840,7 @@ zathura_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index) if (page_cache_is_full(renderer, &full) == false) { return; } else if (full == true) { - ssize_t idx = page_cache_lru_invalidate(renderer); - + const ssize_t idx = page_cache_lru_invalidate(renderer); if (idx == -1) { return; } @@ -814,11 +848,14 @@ zathura_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index) priv->page_cache.cache[idx] = page_index; ++priv->page_cache.num_cached_pages; girara_debug("Page %d is cached at cache index %zd", page_index + 1, idx); - return; + } else { + priv->page_cache.cache[priv->page_cache.num_cached_pages++] = page_index; + girara_debug("Page %d is cached at cache index %zu", page_index + 1, + priv->page_cache.num_cached_pages - 1); } - priv->page_cache.cache[priv->page_cache.num_cached_pages++] = page_index; - girara_debug("Page %d is cached at cache index %zu", page_index + 1, - priv->page_cache.num_cached_pages - 1); - return; + ZathuraRenderRequest* request = girara_list_find(priv->requests, + find_request_by_page_index, &page_index); + g_return_if_fail(request != NULL); + g_signal_emit(request, request_signals[REQUEST_CACHE_ADDED], 0); } diff --git a/render.h b/render.h index 0b48c85..ee53215 100644 --- a/render.h +++ b/render.h @@ -125,20 +125,6 @@ void zathura_renderer_unlock(ZathuraRenderer* renderer); void zathura_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index); -/** - * Checks if the given page is cached - * - * @param zathura The zathura session - * @param page_index The index of the page that may be cached - * - * @return true if page is cached otherwise false - */ -bool zathura_page_cache_is_cached(ZathuraRenderer* renderer, - unsigned int page_index); - - - - typedef struct zathura_render_request_s ZathuraRenderRequest; typedef struct zathura_render_request_class_s ZathuraRenderRequestClass; @@ -200,6 +186,8 @@ void zathura_render_request(ZathuraRenderRequest* request, */ void zathura_render_request_abort(ZathuraRenderRequest* request); +void zathura_render_request_update_view_time(ZathuraRenderRequest* request); + /** * This function is used to unmark all pages as not rendered. This should * be used if all pages should be rendered again (e.g.: the zoom level or the From c918c590eebdb4782b49c6a4d6f96d5c8a99adde Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 20 Oct 2013 16:06:15 +0200 Subject: [PATCH 25/90] Rename zathura_page_cache_add Signed-off-by: Sebastian Ramacher --- callbacks.c | 2 +- render.c | 3 ++- render.h | 14 ++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/callbacks.c b/callbacks.c index 2b3f48a..5d41ed2 100644 --- a/callbacks.c +++ b/callbacks.c @@ -98,7 +98,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi if (zathura_page_get_visibility(page) == false) { zathura_page_set_visibility(page, true); zathura_page_widget_update_view_time(zathura_page_widget); - zathura_page_cache_add(zathura->sync.render_thread, zathura_page_get_index(page)); + zathura_renderer_page_cache_add(zathura->sync.render_thread, zathura_page_get_index(page)); } if (zathura->global.update_page_number == true && updated == false && gdk_rectangle_intersect(¢er, &page_rect, NULL) == TRUE) { diff --git a/render.c b/render.c index 9b6fe0f..913f463 100644 --- a/render.c +++ b/render.c @@ -828,7 +828,8 @@ page_cache_invalidate_all(ZathuraRenderer* renderer) } void -zathura_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index) +zathura_renderer_page_cache_add(ZathuraRenderer* renderer, + unsigned int page_index) { g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); if (page_cache_is_cached(renderer, page_index) == true) { diff --git a/render.h b/render.h index ee53215..07368f6 100644 --- a/render.h +++ b/render.h @@ -117,12 +117,12 @@ void zathura_renderer_lock(ZathuraRenderer* renderer); void zathura_renderer_unlock(ZathuraRenderer* renderer); /** - * Add a page to the page cache + * Add a page to the page cache. * - * @param zathura The zathura session - * @param page_index The index of the page to be cached + * @param renderer renderer object. + * @param page_index The index of the page to be cached. */ -void zathura_page_cache_add(ZathuraRenderer* renderer, +void zathura_renderer_page_cache_add(ZathuraRenderer* renderer, unsigned int page_index); @@ -186,6 +186,12 @@ void zathura_render_request(ZathuraRenderRequest* request, */ void zathura_render_request_abort(ZathuraRenderRequest* request); +/** + * Update the time the page associated to the render request has been viewed the + * last time. + * + * @param request request that should be updated + */ void zathura_render_request_update_view_time(ZathuraRenderRequest* request); /** From 157c9d6d535bc5adc5b2055609400b7e8cc6cf33 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 21 Oct 2013 14:16:38 +0200 Subject: [PATCH 26/90] girara_notify takes something the markup parser can understand This should fix #347. Signed-off-by: Sebastian Ramacher --- callbacks.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/callbacks.c b/callbacks.c index 5d41ed2..3d2bfbb 100644 --- a/callbacks.c +++ b/callbacks.c @@ -562,8 +562,12 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data) gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1); char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' '); - girara_notify(zathura->ui.session, GIRARA_INFO, _("Copied selected text to clipboard: %s"), stripped_text); + char* escaped_text = g_markup_printf_escaped( + _("Copied selected text to clipboard: %s"), stripped_text); g_free(stripped_text); + + girara_notify(zathura->ui.session, GIRARA_INFO, escaped_text); + g_free(escaped_text); } g_free(selection); From f27769d1b782cceac814ff14af5da7a49f30de10 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 21 Oct 2013 14:19:28 +0200 Subject: [PATCH 27/90] Fix format string not a string literal Signed-off-by: Sebastian Ramacher --- callbacks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/callbacks.c b/callbacks.c index 3d2bfbb..2c6323a 100644 --- a/callbacks.c +++ b/callbacks.c @@ -566,7 +566,7 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data) _("Copied selected text to clipboard: %s"), stripped_text); g_free(stripped_text); - girara_notify(zathura->ui.session, GIRARA_INFO, escaped_text); + girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text); g_free(escaped_text); } From 1d5efad36ac79b81811d93c8bf863c394c45ec13 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Mon, 21 Oct 2013 18:01:04 +0200 Subject: [PATCH 28/90] add a config setting to prevent link_evaluate from changing scale Signed-off-by: Sebastian Ramacher --- config.c | 2 ++ links.c | 5 ++++- zathurarc.5.rst | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index e14d7e2..fb126a4 100644 --- a/config.c +++ b/config.c @@ -199,6 +199,8 @@ config_load_default(zathura_t* zathura) bool_value = true; girara_setting_add(gsession, "link-hadjust", &bool_value, BOOLEAN, false, _("Align link target to the left"), NULL, NULL); bool_value = true; + girara_setting_add(gsession, "link-zoom", &bool_value, BOOLEAN, false, _("Let zoom be changed when following links"), NULL, NULL); + bool_value = true; girara_setting_add(gsession, "search-hadjust", &bool_value, BOOLEAN, false, _("Center result horizontally"), NULL, NULL); float_value = 0.5; girara_setting_add(gsession, "highlight-transparency", &float_value, FLOAT, false, _("Transparency for highlighting"), NULL, NULL); diff --git a/links.c b/links.c index 981c446..929e678 100644 --- a/links.c +++ b/links.c @@ -122,10 +122,13 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) return; } + bool link_zoom = true; + girara_setting_get(zathura->ui.session, "link-zoom", &link_zoom); + switch (link->type) { case ZATHURA_LINK_GOTO_DEST: if (link->target.destination_type != ZATHURA_LINK_DESTINATION_UNKNOWN) { - if (link->target.scale != 0) { + if (link->target.scale != 0 && link_zoom) { zathura_document_set_scale(zathura->document, link->target.scale); } diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 260b993..8a4208d 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -690,6 +690,13 @@ Defines if scrolling by half or full pages stops at page boundaries. * Value type: Boolean * Default value: false +link-zoom +^^^^^^^^^ +En/Disables the hability 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 From 3629e3acd296a684e4292eb621fbdf193ce8d6f1 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 03:03:54 +0200 Subject: [PATCH 29/90] fix gtk_widget_get_requisition deprecation warning in GTK3 Signed-off-by: Sebastian Ramacher --- shortcuts.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 1820a98..b9336ff 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -169,10 +169,16 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, GTK_SCROLLED_WINDOW(session->gtk.view)); if (vscrollbar != NULL) { + int scroll_width; +#if (GTK_MAJOR_VERSION == 3) + gtk_widget_get_preferred_width(GTK_WIDGET(vscrollbar), NULL, &scroll_width); +#else GtkRequisition requisition; gtk_widget_get_requisition(vscrollbar, &requisition); - if (0 < requisition.width && (unsigned)requisition.width < width) { - width -= requisition.width; + scroll_width = requisition.width; +#endif + if (0 < scroll_width && (unsigned)scroll_width < width) { + width -= scroll_width; scale = (double)(width - (pages_per_row - 1) * padding) / (double)(pages_per_row * cell_width); zathura_document_set_scale(zathura->document, scale); From 834bc8f4c94193427c89e409102fcaf43a34c01d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 26 Oct 2013 01:16:19 +0200 Subject: [PATCH 30/90] CS Signed-off-by: Sebastian Ramacher --- shortcuts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index b9336ff..cba4c65 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -169,15 +169,15 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, GTK_SCROLLED_WINDOW(session->gtk.view)); if (vscrollbar != NULL) { - int scroll_width; + int scroll_width; #if (GTK_MAJOR_VERSION == 3) - gtk_widget_get_preferred_width(GTK_WIDGET(vscrollbar), NULL, &scroll_width); + gtk_widget_get_preferred_width(GTK_WIDGET(vscrollbar), NULL, &scroll_width); #else GtkRequisition requisition; gtk_widget_get_requisition(vscrollbar, &requisition); scroll_width = requisition.width; #endif - if (0 < scroll_width && (unsigned)scroll_width < width) { + if (0 < scroll_width && (unsigned int)scroll_width < width) { width -= scroll_width; scale = (double)(width - (pages_per_row - 1) * padding) / (double)(pages_per_row * cell_width); From cba5d8df7743ed1f6293db8788dbab3035a79401 Mon Sep 17 00:00:00 2001 From: Marwan Tanager Date: Sat, 26 Oct 2013 00:56:30 +0200 Subject: [PATCH 31/90] Fix issue 345 (http://bugs.pwmt.org/issue345) Signed-off-by: Sebastian Ramacher --- shortcuts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shortcuts.c b/shortcuts.c index cba4c65..bf43446 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -971,7 +971,7 @@ sc_search(girara_session_t* session, girara_argument_t* argument, continue; } - if (first_time_after_abort == true && num_search_results > 0) { + if ((first_time_after_abort == true && num_search_results > 0) || ((tmp + num_pages) % num_pages != cur_page)) { target_page = page; target_idx = diff == 1 ? 0 : num_search_results - 1; break; From ed27f8b88e80b5c5aba878232ee44206c5ebb1e6 Mon Sep 17 00:00:00 2001 From: Marwan Tanager Date: Sat, 26 Oct 2013 03:00:32 +0200 Subject: [PATCH 32/90] Minor cleanup Since we 'continue' the loop if num_search_results is 0, there is no need for the second check. Signed-off-by: Sebastian Ramacher --- shortcuts.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index bf43446..435d089 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -965,13 +965,12 @@ sc_search(girara_session_t* session, girara_argument_t* argument, GtkWidget* page_widget = zathura_page_get_widget(zathura, page); int num_search_results = 0, current = -1; - g_object_get(page_widget, "search-current", ¤t, - "search-length", &num_search_results, NULL); + g_object_get(page_widget, "search-current", ¤t, "search-length", &num_search_results, NULL); if (num_search_results == 0 || current == -1) { continue; } - if ((first_time_after_abort == true && num_search_results > 0) || ((tmp + num_pages) % num_pages != cur_page)) { + if (first_time_after_abort == true || (tmp + num_pages) % num_pages != cur_page) { target_page = page; target_idx = diff == 1 ? 0 : num_search_results - 1; break; From 7329209d84595c1a2c073d2f1eaef028ee842f56 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 19:20:03 +0200 Subject: [PATCH 33/90] change arguments to page_calc_height_width now accepts a document object and explicit width and height. This will make it easier to reuse this function for computing the document page cell width and height. --- render.c | 14 +++++++++++--- utils.c | 12 +++--------- utils.h | 5 +++-- zathura.c | 5 ++++- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/render.c b/render.c index 913f463..6f22d61 100644 --- a/render.c +++ b/render.c @@ -600,8 +600,14 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) /* create cairo surface */ unsigned int page_width = 0; unsigned int page_height = 0; - const double real_scale = page_calc_height_width(page, &page_height, - &page_width, false); + + zathura_document_t* document = zathura_page_get_document(page); + double height = zathura_page_get_height(page); + double width = zathura_page_get_width(page); + + const double real_scale = page_calc_height_width(document, height, width, + &page_height, &page_width, false); + cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height); @@ -705,7 +711,9 @@ render_all(zathura_t* zathura) zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); unsigned int page_height = 0, page_width = 0; - page_calc_height_width(page, &page_height, &page_width, true); + double height = zathura_page_get_height(page); + double width = zathura_page_get_width(page); + page_calc_height_width(zathura->document, height, width, &page_height, &page_width, true); GtkWidget* widget = zathura_page_get_widget(zathura, page); gtk_widget_set_size_request(widget, page_width, page_height); diff --git a/utils.c b/utils.c index e92c8f3..363245e 100644 --- a/utils.c +++ b/utils.c @@ -241,17 +241,11 @@ error_ret: } double -page_calc_height_width(zathura_page_t* page, unsigned int* page_height, unsigned int* page_width, bool rotate) +page_calc_height_width(zathura_document_t* document, double height, double width, + unsigned int* page_height, unsigned int* page_width, bool rotate) { - g_return_val_if_fail(page != NULL && page_height != NULL && page_width != NULL, 0.0); + g_return_val_if_fail(document != NULL && page_height != NULL && page_width != NULL, 0.0); - zathura_document_t* document = zathura_page_get_document(page); - if (document == NULL) { - return 0.0; - } - - double height = zathura_page_get_height(page); - double width = zathura_page_get_width(page); double scale = zathura_document_get_scale(document); double real_scale; diff --git a/utils.h b/utils.h index d42baf5..8276ede 100644 --- a/utils.h +++ b/utils.h @@ -96,7 +96,8 @@ zathura_rectangle_t recalc_rectangle(zathura_page_t* page, zathura_rectangle_t r * @return real scale after rounding */ double -page_calc_height_width(zathura_page_t* page, unsigned int* page_height, unsigned int* page_width, bool rotate); +page_calc_height_width(zathura_document_t* document, double height, double width, + unsigned int* page_height, unsigned int* page_width, bool rotate); /** * Compute the size of the entire document to be displayed (in pixels), taking @@ -138,7 +139,7 @@ void document_draw_search_results(zathura_t* zathura, bool value); * * @param zathura The zathura instance * @param markup Enable markup - * @return Version string + * @return Version string */ char* zathura_get_version_string(zathura_t* zathura, bool markup); diff --git a/zathura.c b/zathura.c index 8ba2e80..56cbe02 100644 --- a/zathura.c +++ b/zathura.c @@ -745,7 +745,10 @@ document_open(zathura_t* zathura, const char* path, const char* password, /* set widget size */ unsigned int page_height = 0; unsigned int page_width = 0; - page_calc_height_width(page, &page_height, &page_width, true); + + double height = zathura_page_get_height(page); + 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(page_widget, page_width, page_height); From f617ee61e544f37063cc6531cf0d6f141d13cd89 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 17:00:07 +0200 Subject: [PATCH 34/90] faster zathura_document_get_cell_size We precompute the maximum width and maximum height when opening the document. Then, when someone calls zathura_document_get_cell_size we use page_calc_width_height to apply the rotation and scale the precomputed values. --- document.c | 34 +++++++++++++++------------------- document.h | 2 +- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/document.c b/document.c index ced8ea3..aa55a5e 100644 --- a/document.c +++ b/document.c @@ -50,6 +50,8 @@ struct zathura_document_s { void* data; /**< Custom data */ zathura_adjust_mode_t adjust_mode; /**< Adjust mode (best-fit, width) */ int page_offset; /**< Page offset */ + double cell_width; /**< width of a page cell in the document (not ransformed by scale and rotation) */ + double cell_height; /**< height of a page cell in the document (not ransformed by scale and rotation) */ /** * Document pages @@ -124,6 +126,8 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* document->scale = 1.0; document->plugin = plugin; document->adjust_mode = ZATHURA_ADJUST_NONE; + document->cell_width = 0.0; + document->cell_height = 0.0; /* open document */ zathura_plugin_functions_t* functions = zathura_plugin_get_functions(plugin); @@ -155,6 +159,15 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* } document->pages[page_id] = page; + + /* cell_width and cell_height is the maximum of all the pages width and height */ + double width = zathura_page_get_width(page); + if (document->cell_width < width) + document->cell_width = width; + + double height = zathura_page_get_height(page); + if (document->cell_height < height) + document->cell_height = height; } return document; @@ -406,26 +419,9 @@ zathura_document_get_cell_size(zathura_document_t* document, { g_return_if_fail(document != NULL && height != NULL && width != NULL); - unsigned int number_of_pages = - zathura_document_get_number_of_pages(document); - *width = 0; - *height = 0; + page_calc_height_width(document, document->cell_height, document->cell_width, + height, width, true); - /* Get the size of each cell of the table/grid, assuming it is homogeneous - * (i.e. each cell has the same dimensions. */ - for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) { - zathura_page_t* page = zathura_document_get_page(document, page_id); - if (page == NULL) - continue; - - unsigned int page_width = 0, page_height = 0; - page_calc_height_width(page, &page_height, &page_width, true); - - if (*width < page_width) - *width = page_width; - if (*height < page_height) - *height = page_height; - } } zathura_error_t diff --git a/document.h b/document.h index 2ce1c68..d803d34 100644 --- a/document.h +++ b/document.h @@ -178,7 +178,7 @@ void* zathura_document_get_data(zathura_document_t* document); void zathura_document_set_data(zathura_document_t* document, void* data); /** - * Computes the size of a cell in the document's layout table, assuming that + * Return the size of a cell in the document's layout table, assuming that * the table is homogeneous (i.e. every cell has the same dimensions). It takes * the current scale into account. * From 25998f832079decd8cbb2092b3cfb41d9fb75a3b Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 17:05:15 +0200 Subject: [PATCH 35/90] make the document object aware of page layout Now the document object knows about pages_per_row, first_page_column and page_padding, so we will be able to compute sizes and positions of the document view without querying the GTK widgets. --- document.c | 40 ++++++++++++++++++++++++++++++++++++++++ document.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/document.c b/document.c index aa55a5e..7fd104d 100644 --- a/document.c +++ b/document.c @@ -52,6 +52,9 @@ struct zathura_document_s { int page_offset; /**< Page offset */ double cell_width; /**< width of a page cell in the document (not ransformed by scale and rotation) */ double cell_height; /**< height of a page cell in the document (not ransformed by scale and rotation) */ + unsigned int pages_per_row; /**< number of pages in a row */ + unsigned int first_page_column; /**< column of the first page */ + unsigned int page_padding; /**< padding between pages */ /** * Document pages @@ -424,6 +427,43 @@ zathura_document_get_cell_size(zathura_document_t* document, } +void +zathura_document_set_page_layout(zathura_document_t* document, unsigned int page_padding, + unsigned int pages_per_row, unsigned int first_page_column) +{ + g_return_if_fail(document != NULL); + document->page_padding = page_padding; + document->pages_per_row = pages_per_row; + document->first_page_column = first_page_column; +} + +unsigned int +zathura_document_get_page_padding(zathura_document_t* document) +{ + if (document == NULL) { + return 0; + } + return document->page_padding; +} + +unsigned int +zathura_document_get_pages_per_row(zathura_document_t* document) +{ + if (document == NULL) { + return 0; + } + return document->pages_per_row; +} + +unsigned int +zathura_document_get_first_page_column(zathura_document_t* document) +{ + if (document == NULL) { + return 0; + } + return document->first_page_column; +} + zathura_error_t zathura_document_save_as(zathura_document_t* document, const char* path) { diff --git a/document.h b/document.h index d803d34..3264abe 100644 --- a/document.h +++ b/document.h @@ -188,6 +188,41 @@ void zathura_document_set_data(zathura_document_t* document, void* data); void zathura_document_get_cell_size(zathura_document_t* document, unsigned int* height, unsigned int* width); +/** + * Sets the layout of the pages in the document + * + * @param[in] document The document instance + * @param[in] page_padding pixels of padding between pages + * @param[in] pages_per_row number of pages per row + * @param[in] first_page_column column of the first page (first column is 1) + */ +void zathura_document_set_page_layout(zathura_document_t* document, unsigned int page_padding, + unsigned int pages_per_row, unsigned int first_page_column); + +/** + * Returns the padding in pixels betwen pages + * + * @param document The document + * @return The padding in pixels between pages + */ +unsigned int zathura_document_get_page_padding(zathura_document_t* document); + +/** + * Returns the number of pages per row + * + * @param document The document + * @return The number of pages per row + */ +unsigned int zathura_document_get_pages_per_row(zathura_document_t* document); + +/** + * Returns the column for the first page (first column = 1) + * + * @param document The document + * @return The column for the first page + */ +unsigned int zathura_document_get_first_page_column(zathura_document_t* document); + /** * Save the document * From c5930c900a8a19f3c19b1f8a808851d4670c28f0 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 16:07:07 +0200 Subject: [PATCH 36/90] page_widget_set_mode now sets the page-padding too - fix the computation of the number of rows in the table. Doing a ceil of an integer division has no effect... - set the page_padding in page_widget_set_mode function, instead of doing it independently. - call zathura_document_set_layout after calling page_widget_set_mode to save the page layout settings into the document object. --- callbacks.c | 12 ++++++++++-- zathura.c | 39 +++++++++++++++++++++------------------ zathura.h | 4 +++- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/callbacks.c b/callbacks.c index 2c6323a..c01221e 100644 --- a/callbacks.c +++ b/callbacks.c @@ -223,7 +223,11 @@ cb_pages_per_row_value_changed(girara_session_t* session, const char* UNUSED(nam unsigned int first_page_column = 1; girara_setting_get(session, "first-page-column", &first_page_column); - page_widget_set_mode(zathura, pages_per_row, first_page_column); + unsigned int page_padding = 1; + girara_setting_get(session, "page-padding", &page_padding); + + page_widget_set_mode(zathura, page_padding, pages_per_row, first_page_column); + zathura_document_set_page_layout(zathura->document, page_padding, pages_per_row, first_page_column); if (zathura->document != NULL) { unsigned int current_page = zathura_document_get_current_page_number(zathura->document); @@ -248,7 +252,11 @@ cb_first_page_column_value_changed(girara_session_t* session, const char* UNUSED unsigned int pages_per_row = 1; girara_setting_get(session, "pages-per-row", &pages_per_row); - page_widget_set_mode(zathura, pages_per_row, first_page_column); + unsigned int page_padding = 1; + girara_setting_get(session, "page-padding", &page_padding); + + page_widget_set_mode(zathura, page_padding, pages_per_row, first_page_column); + zathura_document_set_page_layout(zathura->document, page_padding, pages_per_row, first_page_column); if (zathura->document != NULL) { unsigned int current_page = zathura_document_get_current_page_number(zathura->document); diff --git a/zathura.c b/zathura.c index 56cbe02..39b88c1 100644 --- a/zathura.c +++ b/zathura.c @@ -225,18 +225,6 @@ zathura_init(zathura_t* zathura) /* signals */ g_signal_connect(G_OBJECT(zathura->ui.session->gtk.window), "destroy", G_CALLBACK(cb_destroy), zathura); - /* set page padding */ - int page_padding = 1; - girara_setting_get(zathura->ui.session, "page-padding", &page_padding); - -#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); -#endif - /* database */ char* database = NULL; girara_setting_get(zathura->ui.session, "database", &database); @@ -759,8 +747,12 @@ document_open(zathura_t* zathura, const char* path, const char* password, } /* view mode */ - int pages_per_row = 1; - int first_page_column = 1; + unsigned int pages_per_row = 1; + unsigned int first_page_column = 1; + unsigned int page_padding = 1; + + girara_setting_get(zathura->ui.session, "page-padding", &page_padding); + if (file_info.pages_per_row > 0) { pages_per_row = file_info.pages_per_row; } else { @@ -775,7 +767,9 @@ document_open(zathura_t* zathura, const char* path, const char* password, girara_setting_set(zathura->ui.session, "pages-per-row", &pages_per_row); girara_setting_set(zathura->ui.session, "first-page-column", &first_page_column); - page_widget_set_mode(zathura, pages_per_row, first_page_column); + + page_widget_set_mode(zathura, page_padding, pages_per_row, first_page_column); + zathura_document_set_page_layout(zathura->document, page_padding, pages_per_row, first_page_column); girara_set_view(zathura->ui.session, zathura->ui.page_widget_alignment); @@ -1092,7 +1086,8 @@ statusbar_page_number_update(zathura_t* zathura) } void -page_widget_set_mode(zathura_t* zathura, unsigned int pages_per_row, unsigned int first_page_column) +page_widget_set_mode(zathura_t* zathura, unsigned int page_padding, + unsigned int pages_per_row, unsigned int first_page_column) { /* show at least one page */ if (pages_per_row == 0) { @@ -1103,7 +1098,6 @@ page_widget_set_mode(zathura_t* zathura, unsigned int pages_per_row, unsigned in if (first_page_column < 1) { first_page_column = 1; } - if (first_page_column > pages_per_row) { first_page_column = ((first_page_column - 1) % pages_per_row) + 1; } @@ -1115,9 +1109,18 @@ page_widget_set_mode(zathura_t* zathura, unsigned int pages_per_row, unsigned in gtk_container_foreach(GTK_CONTAINER(zathura->ui.page_widget), remove_page_from_table, (gpointer)0); 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_resize(GTK_TABLE(zathura->ui.page_widget), ceil((number_of_pages + first_page_column - 1) / pages_per_row), pages_per_row); + 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++) { diff --git a/zathura.h b/zathura.h index 1ed99a4..4f39b35 100644 --- a/zathura.h +++ b/zathura.h @@ -325,10 +325,12 @@ void position_set(zathura_t* zathura, double position_x, double position_y); * Builds the box structure to show the rendered pages * * @param zathura The zathura session + * @param page_padding padding in pixels between pages * @param pages_per_row Number of shown pages per row * @param first_page_column Column on which first page start */ -void page_widget_set_mode(zathura_t* zathura, unsigned int pages_per_row, unsigned int first_page_column); +void page_widget_set_mode(zathura_t* zathura, unsigned int page_padding, + unsigned int pages_per_row, unsigned int first_page_column); /** * Updates the page number in the statusbar. Note that 1 will be added to the From 0da491f78b3cc1a8ac11bf1d362f867b04af5105 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 16:20:08 +0200 Subject: [PATCH 37/90] merge callbacks for pages-per-row, first-page-column and page-padding All of those callbacks are conceptually related (change the page layout), and depend from one another. Now the single callback page_layout_value_changed defers to page_widget_set_mode to change whatever is needed in the GTK widgets. --- callbacks.c | 44 ++++---------------------------------------- callbacks.h | 14 +------------- config.c | 27 +++------------------------ 3 files changed, 8 insertions(+), 77 deletions(-) diff --git a/callbacks.c b/callbacks.c index c01221e..95d555e 100644 --- a/callbacks.c +++ b/callbacks.c @@ -207,61 +207,25 @@ cb_adjustment_track_bounds(GtkAdjustment* adjustment, gpointer data) } void -cb_pages_per_row_value_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) +cb_page_layout_value_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) { g_return_if_fail(value != NULL); g_return_if_fail(session != NULL); g_return_if_fail(session->global.data != NULL); zathura_t* zathura = session->global.data; - int pages_per_row = *(int*) value; - if (pages_per_row < 1) { - pages_per_row = 1; - } + unsigned int pages_per_row = 1; + girara_setting_get(session, "pages-per-row", &pages_per_row); unsigned int first_page_column = 1; girara_setting_get(session, "first-page-column", &first_page_column); unsigned int page_padding = 1; - girara_setting_get(session, "page-padding", &page_padding); + girara_setting_get(zathura->ui.session, "page-padding", &page_padding); page_widget_set_mode(zathura, page_padding, pages_per_row, first_page_column); zathura_document_set_page_layout(zathura->document, page_padding, pages_per_row, first_page_column); - - if (zathura->document != NULL) { - unsigned int current_page = zathura_document_get_current_page_number(zathura->document); - page_set_delayed(zathura, current_page); - } -} - -void -cb_first_page_column_value_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) -{ - g_return_if_fail(value != NULL); - g_return_if_fail(session != NULL); - g_return_if_fail(session->global.data != NULL); - zathura_t* zathura = session->global.data; - - int first_page_column = *(int*) value; - - if (first_page_column < 1) { - first_page_column = 1; - } - - unsigned int pages_per_row = 1; - girara_setting_get(session, "pages-per-row", &pages_per_row); - - unsigned int page_padding = 1; - girara_setting_get(session, "page-padding", &page_padding); - - page_widget_set_mode(zathura, page_padding, pages_per_row, first_page_column); - zathura_document_set_page_layout(zathura->document, page_padding, pages_per_row, first_page_column); - - if (zathura->document != NULL) { - unsigned int current_page = zathura_document_get_current_page_number(zathura->document); - page_set_delayed(zathura, current_page); - } } void diff --git a/callbacks.h b/callbacks.h index e1af85d..97e00d7 100644 --- a/callbacks.h +++ b/callbacks.h @@ -92,19 +92,7 @@ void cb_adjustment_track_bounds(GtkAdjustment* adjustment, gpointer data); * @param value The value * @param data Custom data */ -void cb_pages_per_row_value_changed(girara_session_t* session, const char* name, - girara_setting_type_t type, void* value, void* data); -/** - * This function gets called when the value of the "first-page-column" - * variable changes - * - * @param session The current girara session - * @param name The name of the row - * @param type The settings type - * @param value The value - * @param data Custom data - */ -void cb_first_page_column_value_changed(girara_session_t* session, const char* name, +void cb_page_layout_value_changed(girara_session_t* session, const char* name, girara_setting_type_t type, void* value, void* data); /** diff --git a/config.c b/config.c index fb126a4..4a759d5 100644 --- a/config.c +++ b/config.c @@ -73,27 +73,6 @@ cb_color_change(girara_session_t* session, const char* name, render_all(zathura); } -static void -cb_page_padding_changed(girara_session_t* session, const char* UNUSED(name), - girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) -{ - g_return_if_fail(value != NULL); - g_return_if_fail(session != NULL); - g_return_if_fail(session->global.data != NULL); - zathura_t* zathura = session->global.data; - - int val = *(int*) value; - if (GTK_IS_TABLE(zathura->ui.page_widget) == TRUE) { -#if (GTK_MAJOR_VERSION == 3) - gtk_grid_set_row_spacing(GTK_GRID(zathura->ui.page_widget), val); - gtk_grid_set_column_spacing(GTK_GRID(zathura->ui.page_widget), val); -#else - gtk_table_set_row_spacings(GTK_TABLE(zathura->ui.page_widget), val); - gtk_table_set_col_spacings(GTK_TABLE(zathura->ui.page_widget), val); -#endif - } -} - static void cb_nohlsearch_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) @@ -153,11 +132,11 @@ config_load_default(zathura_t* zathura) int_value = 10; girara_setting_add(gsession, "zoom-step", &int_value, INT, false, _("Zoom step"), NULL, NULL); int_value = 1; - girara_setting_add(gsession, "page-padding", &int_value, INT, false, _("Padding between pages"), cb_page_padding_changed, NULL); + girara_setting_add(gsession, "page-padding", &int_value, INT, false, _("Padding between pages"), cb_page_layout_value_changed, NULL); int_value = 1; - girara_setting_add(gsession, "pages-per-row", &int_value, INT, false, _("Number of pages per row"), cb_pages_per_row_value_changed, NULL); + girara_setting_add(gsession, "pages-per-row", &int_value, INT, false, _("Number of pages per row"), cb_page_layout_value_changed, NULL); int_value = 1; - girara_setting_add(gsession, "first-page-column", &int_value, INT, false, _("Column of the first page"),cb_first_page_column_value_changed, NULL); + girara_setting_add(gsession, "first-page-column", &int_value, INT, false, _("Column of the first page"),cb_page_layout_value_changed, NULL); float_value = 40; girara_setting_add(gsession, "scroll-step", &float_value, FLOAT, false, _("Scroll step"), NULL, NULL); float_value = 40; From a0a64832d98b7e146461119eaf4dd7ccd757e7f8 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 16:40:56 +0200 Subject: [PATCH 38/90] move zathura_get_document_size to document.c It makes more sense, plus now the document knows about the page layout and can do the computation. --- document.c | 20 ++++++++++++++++++++ document.h | 12 ++++++++++++ shortcuts.c | 6 ++---- utils.c | 36 ------------------------------------ utils.h | 17 ----------------- 5 files changed, 34 insertions(+), 57 deletions(-) diff --git a/document.c b/document.c index 7fd104d..6586392 100644 --- a/document.c +++ b/document.c @@ -427,6 +427,26 @@ zathura_document_get_cell_size(zathura_document_t* document, } +void +zathura_document_get_document_size(zathura_document_t* document, + unsigned int* height, unsigned int* width) +{ + g_return_if_fail(document != NULL && height != NULL && width != NULL); + + + unsigned int npag = zathura_document_get_number_of_pages(document); + unsigned int ncol = zathura_document_get_pages_per_row(document); + unsigned int c0 = zathura_document_get_first_page_column(document); + unsigned int nrow = (npag + c0 - 1 + ncol - 1) / ncol; /* number of rows */ + unsigned int pad = zathura_document_get_page_padding(document); + + unsigned int cell_height=0, cell_width=0; + zathura_document_get_cell_size(document, &cell_height, &cell_width); + + *width = ncol * cell_width + (ncol - 1) * pad; + *height = nrow * cell_height + (nrow - 1) * pad; +} + void zathura_document_set_page_layout(zathura_document_t* document, unsigned int page_padding, unsigned int pages_per_row, unsigned int first_page_column) diff --git a/document.h b/document.h index 3264abe..03cb778 100644 --- a/document.h +++ b/document.h @@ -188,6 +188,18 @@ void zathura_document_set_data(zathura_document_t* document, void* data); void zathura_document_get_cell_size(zathura_document_t* document, unsigned int* height, unsigned int* width); +/** + * Compute the size of the entire document to be displayed (in pixels), taking + * into account the scale, the layout of the pages, and the padding between + * them. It should be equal to the allocation of zathura->ui.page_widget once + * it's shown. + * + * @param[in] document The document + * @param[out] height,width The height and width of the document + */ +void zathura_document_get_document_size(zathura_document_t* document, + unsigned int* height, unsigned int* width); + /** * Sets the layout of the pages in the document * diff --git a/shortcuts.c b/shortcuts.c index 435d089..2d51742 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -144,8 +144,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, zathura_document_set_scale(zathura->document, scale); zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); - zathura_get_document_size(zathura, cell_height, cell_width, - &document_height, &document_width); + zathura_document_get_document_size(zathura->document, &document_height, &document_width); double page_ratio = (double)cell_height / (double)document_width; double window_ratio = (double)height / (double)width; @@ -162,8 +161,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, if (show_vscrollbar) { /* If the document is taller than the view, there's a vertical * scrollbar; we need to substract its width from the view's width. */ - zathura_get_document_size(zathura, cell_height, cell_width, - &document_height, &document_width); + zathura_document_get_document_size(zathura->document, &document_height, &document_width); if (height < document_height) { GtkWidget* vscrollbar = gtk_scrolled_window_get_vscrollbar( GTK_SCROLLED_WINDOW(session->gtk.view)); diff --git a/utils.c b/utils.c index 363245e..88975a6 100644 --- a/utils.c +++ b/utils.c @@ -262,42 +262,6 @@ page_calc_height_width(zathura_document_t* document, double height, double width return real_scale; } -void -zathura_get_document_size(zathura_t* zathura, - unsigned int cell_height, unsigned int cell_width, - unsigned int* height, unsigned int* width) -{ - g_return_if_fail(zathura != NULL && zathura->document != NULL && - height != NULL && width != NULL); - - unsigned int pages_per_row = 1; - girara_setting_get(zathura->ui.session, "pages-per-row", &pages_per_row); - if (pages_per_row == 0) - pages_per_row = 1; - - unsigned int first_page_column = 1; - girara_setting_get(zathura->ui.session, "first-page-column", &first_page_column); - if (first_page_column < 1) - first_page_column = 1; - if (first_page_column > pages_per_row) - first_page_column = (first_page_column - 1) % pages_per_row + 1; - - int padding = 1; - girara_setting_get(zathura->ui.session, "page-padding", &padding); - - double scale = zathura_document_get_scale(zathura->document); - - cell_height = ceil(cell_height * scale); - cell_width = ceil(cell_width * scale); - - *width = pages_per_row * cell_width + (pages_per_row - 1) * padding; - unsigned int effective_number_of_pages = - zathura_document_get_number_of_pages(zathura->document) + - first_page_column - 1; - unsigned int rows = effective_number_of_pages / pages_per_row + - (effective_number_of_pages % pages_per_row ? 1 : 0); - *height = rows * cell_height + (rows - 1) * padding; -} GtkWidget* zathura_page_get_widget(zathura_t* zathura, zathura_page_t* page) diff --git a/utils.h b/utils.h index 8276ede..84d2a62 100644 --- a/utils.h +++ b/utils.h @@ -99,23 +99,6 @@ double page_calc_height_width(zathura_document_t* document, double height, double width, unsigned int* page_height, unsigned int* page_width, bool rotate); -/** - * Compute the size of the entire document to be displayed (in pixels), taking - * into account the scale, the layout of the pages, and the padding between - * them. It should be equal to the allocation of zathura->ui.page_widget once - * it's shown. - * - * @param[in] zathura The zathura instance - * @param[in] cell_height,cell_width The height and width of a cell containing - * a single page; it should be obtained - * using zathura_document_get_cell_size() - * with the document scale set to 1.0 - * @param[out] height,width The height and width of the document - */ -void zathura_get_document_size(zathura_t* zathura, - unsigned int cell_height, unsigned int cell_width, - unsigned int* height, unsigned int* width); - /** * Returns the page widget of the page * From bca5bcc57193606c20f391c3a7b9bb75407c1998 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 25 Oct 2013 11:33:34 +0200 Subject: [PATCH 39/90] let the document know about the current adjustments The document object now has functions to set and get the position and the viewport size. The position is a relative position with respect to the size of the entire document, i.e. position_y=0 means top of the document and position_y=1 bottom. The viewport size is stored in screen coordinates, in pixels. --- document.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ document.h | 77 +++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 145 insertions(+), 7 deletions(-) diff --git a/document.c b/document.c index 6586392..9125f0b 100644 --- a/document.c +++ b/document.c @@ -52,9 +52,13 @@ struct zathura_document_s { int page_offset; /**< Page offset */ double cell_width; /**< width of a page cell in the document (not ransformed by scale and rotation) */ double cell_height; /**< height of a page cell in the document (not ransformed by scale and rotation) */ + unsigned int view_width; /**< width of current viewport */ + unsigned int view_height; /**< height of current viewport */ unsigned int pages_per_row; /**< number of pages in a row */ unsigned int first_page_column; /**< column of the first page */ unsigned int page_padding; /**< padding between pages */ + double position_x; /**< X adjustment */ + double position_y; /**< Y adjustment */ /** * Document pages @@ -131,6 +135,10 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* document->adjust_mode = ZATHURA_ADJUST_NONE; document->cell_width = 0.0; document->cell_height = 0.0; + document->view_height = 0; + document->view_width = 0; + document->position_x = 0.0; + document->position_y = 0.0; /* open document */ zathura_plugin_functions_t* functions = zathura_plugin_get_functions(plugin); @@ -326,6 +334,46 @@ zathura_document_set_current_page_number(zathura_document_t* document, unsigned document->current_page_number = current_page; } +double +zathura_document_get_position_x(zathura_document_t* document) +{ + if (document == NULL) { + return 0; + } + + return document->position_x; +} + +double +zathura_document_get_position_y(zathura_document_t* document) +{ + if (document == NULL) { + return 0; + } + + return document->position_y; +} + +void +zathura_document_set_position_x(zathura_document_t* document, double position_x) +{ + if (document == NULL) { + return; + } + + document->position_x = position_x; +} + +void +zathura_document_set_position_y(zathura_document_t* document, double position_y) +{ + if (document == NULL) { + return; + } + + document->position_y = position_y; +} + double zathura_document_get_scale(zathura_document_t* document) { @@ -416,6 +464,33 @@ zathura_document_set_page_offset(zathura_document_t* document, unsigned int page document->page_offset = page_offset; } +void +zathura_document_set_viewport_width(zathura_document_t* document, unsigned int width) +{ + if (document == NULL) { + return; + } + document->view_width = width; +} + +void +zathura_document_set_viewport_height(zathura_document_t* document, unsigned int height) +{ + if (document == NULL) { + return; + } + document->view_height = height; +} + +void +zathura_document_get_viewport_size(zathura_document_t* document, + unsigned int *height, unsigned int* width) +{ + g_return_if_fail(document != NULL && height != NULL && width != NULL); + *height = document->view_height; + *width = document->view_width; +} + void zathura_document_get_cell_size(zathura_document_t* document, unsigned int* height, unsigned int* width) diff --git a/document.h b/document.h index 03cb778..4b23125 100644 --- a/document.h +++ b/document.h @@ -97,6 +97,42 @@ unsigned int zathura_document_get_current_page_number(zathura_document_t* docume void zathura_document_set_current_page_number(zathura_document_t* document, unsigned int current_page); +/** + * Returns the X position, as a value relative to the document width (0=left, + * 1=right). + * + * @param document The document + * @return X adjustment + */ +double zathura_document_get_position_x(zathura_document_t* document); + +/** + * Returns the Y position as value relative to the document height (0=top, + * 1=bottom) + * + * @param document The document + * @return Y adjustment + */ +double zathura_document_get_position_y(zathura_document_t* document); + +/** + * Sets the X position as a value relative to the document width (0=left, + * 1=right) + * + * @param document The document + * @param position_x the X adjustment + */ +void zathura_document_set_position_x(zathura_document_t* document, double position_x); + +/** + * Sets the Y position as a value relative to the document height (0=top, + * 1=bottom) + * + * @param document The document + * @param position_y the Y adjustment + */ +void zathura_document_set_position_y(zathura_document_t* document, double position_y); + /** * Returns the current scale value of the document * @@ -178,9 +214,37 @@ void* zathura_document_get_data(zathura_document_t* document); void zathura_document_set_data(zathura_document_t* document, void* data); /** - * Return the size of a cell in the document's layout table, assuming that - * the table is homogeneous (i.e. every cell has the same dimensions). It takes - * the current scale into account. + * Sets the width of the viewport in pixels. + * + * @param[in] document The document instance + * @param[in] width The width of the viewport + */ +void +zathura_document_set_viewport_width(zathura_document_t* document, unsigned int width); + +/** + * Sets the height of the viewport in pixels. + * + * @param[in] document The document instance + * @param[in] height The height of the viewport + */ +void +zathura_document_set_viewport_height(zathura_document_t* document, unsigned int height); + +/** + * Return the size of the viewport in pixels. + * + * @param[in] document The document instance + * @param[out] height,width The width and height of the viewport + */ +void +zathura_document_get_viewport_size(zathura_document_t* document, + unsigned int *height, unsigned int* width); + +/** + * Return the size of a cell from the document's layout table in pixels. Assumes + * that the table is homogeneous (i.e. every cell has the same dimensions). It + * takes the current scale into account. * * @param[in] document The document instance * @param[out] height,width The computed height and width of the cell @@ -189,10 +253,9 @@ void zathura_document_get_cell_size(zathura_document_t* document, unsigned int* height, unsigned int* width); /** - * Compute the size of the entire document to be displayed (in pixels), taking - * into account the scale, the layout of the pages, and the padding between - * them. It should be equal to the allocation of zathura->ui.page_widget once - * it's shown. + * Compute the size of the entire document to be displayed in pixels. Takes into + * account the scale, the layout of the pages, and the padding between them. It + * should be equal to the allocation of zathura->ui.page_widget once it's shown. * * @param[in] document The document * @param[out] height,width The height and width of the document From 030a8c65c1e01324ed7d5abec7e5176d9e5e5cd7 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 23 Oct 2013 09:46:00 +0200 Subject: [PATCH 40/90] add functions to compute page positions The plan is to put in adjustment.c every piece of code that has to do with document positioning, either computing it from data on the document side, or talking to GTK. We want to have at our disposal functions to compute sizes and positions without having to ask for it to a GTK widget. The new functions are: - move page_calc_height_width to adjustment.c - add page_calc_position that rotates a position relative to a page according to the rotation settings. - add position_to_page_number that computes the number of a page sitting at a given position (given in document-relative coordinates) - add page_number_to_position that computes the position (in document relative coordinates) that will be placed at the center of the viewport. - add page_is_visible that checks whether the given page intersects the viewport. --- adjustment.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++ adjustment.h | 67 ++++++++++++++++++++++++- document.c | 1 + links.c | 1 + render.c | 2 + utils.c | 23 --------- utils.h | 13 ----- 7 files changed, 208 insertions(+), 37 deletions(-) diff --git a/adjustment.c b/adjustment.c index 9452c54..8eda6e3 100644 --- a/adjustment.c +++ b/adjustment.c @@ -2,6 +2,144 @@ #include "adjustment.h" #include "utils.h" +#include + + +double +page_calc_height_width(zathura_document_t* document, double height, double width, + unsigned int* page_height, unsigned int* page_width, bool rotate) +{ + g_return_val_if_fail(document != NULL && page_height != NULL && page_width != NULL, 0.0); + + double scale = zathura_document_get_scale(document); + double real_scale; + + if (rotate && zathura_document_get_rotation(document) % 180) { + *page_width = round(height * scale); + *page_height = round(width * scale); + real_scale = MAX(*page_width / height, *page_height / width); + } else { + *page_width = round(width * scale); + *page_height = round(height * scale); + real_scale = MAX(*page_width / width, *page_height / height); + } + + return real_scale; +} + +void +page_calc_position(zathura_document_t* document, double x, double y, + double *xn, double *yn) { + + g_return_if_fail(document != NULL && xn != NULL && yn != NULL); + + unsigned int rot = zathura_document_get_rotation(document); + + if (rot == 90) { + *xn = 1 - y; + *yn = x; + }else if (rot == 180) { + *xn = 1 - x; + *yn = 1 - y; + } else if (rot == 270) { + *xn = y; + *yn = 1 - x; + } else { + *xn = x; + *yn = y; + } +} + + +unsigned int +position_to_page_number(zathura_document_t* document, + double pos_x, double pos_y){ + + g_return_val_if_fail(document != NULL, 0); + + unsigned int doc_width, doc_height; + zathura_document_get_document_size(document, &doc_height, &doc_width); + + unsigned int cell_width, cell_height; + zathura_document_get_cell_size(document, &cell_height, &cell_width); + + unsigned int c0 = zathura_document_get_first_page_column(document); + unsigned int npag = zathura_document_get_number_of_pages(document); + unsigned int ncol = zathura_document_get_pages_per_row(document); + unsigned int nrow = (npag + c0 - 1 + ncol - 1) / ncol; /* number of rows */ + unsigned int pad = zathura_document_get_page_padding(document); + + unsigned int col = floor(pos_x * (double)doc_width / (double)(cell_width + pad)); + unsigned int row = floor(pos_y * (double)doc_height / (double)(cell_height + pad)); + + return ncol * (row % nrow) + (col % ncol) - (c0 - 1); +} + + +void +page_number_to_position(zathura_document_t* document, unsigned int page_number, + double xalign, double yalign, double *pos_x, double *pos_y) { + g_return_if_fail(document != NULL); + + unsigned int c0 = zathura_document_get_first_page_column(document); + unsigned int npag = zathura_document_get_number_of_pages(document); + unsigned int ncol = zathura_document_get_pages_per_row(document); + unsigned int nrow = (npag + c0 - 1 + ncol - 1) / ncol; /* number of rows */ + + /* row and column for page_number indexed from 0 */ + unsigned int row = (page_number + c0 - 1) / ncol; + unsigned int col = (page_number + c0 - 1) % ncol; + + /* sizes of page cell, viewport and document */ + unsigned int cell_height = 0, cell_width = 0; + zathura_document_get_cell_size(document, &cell_height, &cell_width); + + unsigned int view_height = 0, view_width = 0; + zathura_document_get_viewport_size(document, &view_height, &view_width); + + unsigned int doc_height = 0, doc_width = 0; + zathura_document_get_document_size(document, &doc_height, &doc_width); + + /* compute the shift to align to the viewport. If the page fits to viewport, just center it. */ + double shift_x = 0.5, shift_y = 0.5; + if (cell_width > view_width) { + shift_x = 0.5 + (xalign - 0.5) * ((double)cell_width - (double)view_width) / (double)cell_width; + } + + if (cell_height > view_height) { + shift_y = 0.5 + (yalign - 0.5) * ((double)cell_height - (double)view_height) / (double)cell_height; + } + + /* compute the position */ + *pos_x = ((double)col + shift_x) / (double)ncol; + *pos_y = ((double)row + shift_y) / (double)nrow; +} + + +bool +page_is_visible(zathura_document_t *document, unsigned int page_number) { + g_return_val_if_fail(document != NULL, false); + + /* position at the center of the viewport */ + double pos_x = zathura_document_get_position_x(document); + double pos_y = zathura_document_get_position_y(document); + + /* get the center of page page_number */ + double page_x, page_y; + page_number_to_position(document, page_number, 0.5, 0.5, &page_x, &page_y); + + unsigned int cell_width, cell_height; + zathura_document_get_cell_size(document, &cell_height, &cell_width); + + unsigned int doc_width, doc_height; + zathura_document_get_document_size(document, &doc_height, &doc_width); + + unsigned int view_width, view_height; + zathura_document_get_viewport_size(document, &view_height, &view_width); + + return ( fabs(pos_x - page_x) < 0.5 * (double)(view_width + cell_width) / (double)doc_width && + fabs(pos_y - page_y) < 0.5 * (double)(view_height + cell_height) / (double)doc_height); +} GtkAdjustment* zathura_adjustment_clone(GtkAdjustment* adjustment) diff --git a/adjustment.h b/adjustment.h index 63b4f88..96ceb4c 100644 --- a/adjustment.h +++ b/adjustment.h @@ -4,8 +4,73 @@ #define ZATHURA_ADJUSTMENT_H #include +#include +#include "document.h" -/* Clone a GtkAdjustment +/** + * Calculate the page size according to the corrent scaling and rotation if + * desired. + * + * @param document the document + * @param height width the original height and width + * @return page_height page_width the scaled and rotated height and width + * @param rotate honor page's rotation + * @return real scale after rounding + */ +double page_calc_height_width(zathura_document_t* document, double height, double width, + unsigned int* page_height, unsigned int* page_width, bool rotate); + +/** + * Calculate a page relative position after a rotation. The positions x y are + * relative to a page, i.e. 0=top of page, 1=bottom of page. They are NOT + * relative to the entire document. + * + * @param document the document + * @param x y the x y coordinates on the unrotated page + * @param xn yn the x y coordinates after rotation + */ +void page_calc_position(zathura_document_t* document, double x, double y, + double *xn, double *yn); + +/** + * Converts a relative position within the document to a page number. + * + * @param document The document + * @param pos_x pos_y the position relative to the document + * @return page sitting in that position + */ +unsigned int position_to_page_number(zathura_document_t* document, + double pos_x, double pos_y); + +/** + * Converts a page number to a position in units relative to the document + * + * We can specify where to aliwn the viewport and the page. For instance, xalign + * = 0 means align them on the left margin, xalign = 0.5 means centered, and + * xalign = 1.0 align them on the right margin. + * + * The return value is the position in in units relative to the document (0=top + * 1=bottom) of the point thet will lie at the center of the viewport. + * + * @param document The document + * @param page_number the given page number + * @param xalign yalign where to align the viewport and the page + * @return pos_x pos_y position that will lie at the center of the viewport. + */ +void page_number_to_position(zathura_document_t* document, unsigned int page_number, + double xalign, double yalign, double *pos_x, double *pos_y); + +/** + * Checks whether a given page falls within the viewport + * + * @param document The document + * @param page_number the page number + * @return true if the page intersects the viewport + */ +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. diff --git a/document.c b/document.c index 9125f0b..8b820b6 100644 --- a/document.c +++ b/document.c @@ -22,6 +22,7 @@ #include #include +#include "adjustment.h" #include "document.h" #include "utils.h" #include "zathura.h" diff --git a/links.c b/links.c index 929e678..ec63c9f 100644 --- a/links.c +++ b/links.c @@ -6,6 +6,7 @@ #include #include +#include "adjustment.h" #include "links.h" #include "zathura.h" #include "document.h" diff --git a/render.c b/render.c index 6f22d61..0c941d9 100644 --- a/render.c +++ b/render.c @@ -4,7 +4,9 @@ #include #include #include "glib-compat.h" + #include "render.h" +#include "adjustment.h" #include "zathura.h" #include "document.h" #include "page.h" diff --git a/utils.c b/utils.c index 88975a6..cd40ec6 100644 --- a/utils.c +++ b/utils.c @@ -240,29 +240,6 @@ error_ret: return rectangle; } -double -page_calc_height_width(zathura_document_t* document, double height, double width, - unsigned int* page_height, unsigned int* page_width, bool rotate) -{ - g_return_val_if_fail(document != NULL && page_height != NULL && page_width != NULL, 0.0); - - double scale = zathura_document_get_scale(document); - double real_scale; - - if (rotate && zathura_document_get_rotation(document) % 180) { - *page_width = ceil(height * scale); - *page_height = ceil(width * scale); - real_scale = MAX(*page_width / height, *page_height / width); - } else { - *page_width = ceil(width * scale); - *page_height = ceil(height * scale); - real_scale = MAX(*page_width / width, *page_height / height); - } - - return real_scale; -} - - GtkWidget* zathura_page_get_widget(zathura_t* zathura, zathura_page_t* page) { diff --git a/utils.h b/utils.h index 84d2a62..20da943 100644 --- a/utils.h +++ b/utils.h @@ -86,19 +86,6 @@ zathura_rectangle_t rotate_rectangle(zathura_rectangle_t rectangle, unsigned int */ zathura_rectangle_t recalc_rectangle(zathura_page_t* page, zathura_rectangle_t rectangle); -/** - * Calculate the page size according to the corrent scaling and rotation if - * desired. - * @param page the page - * @param page_height the resulting page height - * @param page_width the resultung page width - * @param rotate honor page's rotation - * @return real scale after rounding - */ -double -page_calc_height_width(zathura_document_t* document, double height, double width, - unsigned int* page_height, unsigned int* page_width, bool rotate); - /** * Returns the page widget of the page * From 692e72abd4a29a6857a32abd2854e38e5fe7bfbb Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 21:24:26 +0200 Subject: [PATCH 41/90] add a custom refresh-view signal Now we can trigger a gtk page refresh calling refresh_view. This function triggers a custom signal refresh-view, whose handler copies the position from the document object to the adjustments. --- callbacks.c | 26 ++++++++++++++++++++++++++ callbacks.h | 11 +++++++++++ zathura.c | 25 +++++++++++++++++++++++++ zathura.h | 12 ++++++++++++ 4 files changed, 74 insertions(+) diff --git a/callbacks.c b/callbacks.c index 95d555e..0c4bebd 100644 --- a/callbacks.c +++ b/callbacks.c @@ -176,6 +176,32 @@ cb_view_vadjustment_changed(GtkAdjustment* adjustment, gpointer data) zathura_adjustment_set_value_from_ratio(adjustment, ratio); } +void +cb_refresh_view(GtkWidget* GIRARA_UNUSED(view), gpointer data) +{ + zathura_t* zathura = data; + if (zathura == NULL || zathura->document == NULL) { + return; + } + + unsigned int page_id = zathura_document_get_current_page_number(zathura->document); + zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); + if (page == NULL) { + return; + } + + GtkAdjustment* vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); + GtkAdjustment* hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); + + double position_x = zathura_document_get_position_x(zathura->document); + double position_y = zathura_document_get_position_y(zathura->document); + + zathura_adjustment_set_value_from_ratio(vadj, position_y); + zathura_adjustment_set_value_from_ratio(hadj, position_x); + + statusbar_page_number_update(zathura); +} + void cb_adjustment_track_value(GtkAdjustment* adjustment, gpointer data) { diff --git a/callbacks.h b/callbacks.h index 97e00d7..856f71b 100644 --- a/callbacks.h +++ b/callbacks.h @@ -61,6 +61,17 @@ void cb_view_hadjustment_changed(GtkAdjustment *adjustment, gpointer data); */ void cb_view_vadjustment_changed(GtkAdjustment *adjustment, gpointer data); +/** + * This function gets called when the program need to refresh the document view. + * + * It adjusts the value of the scrollbars, triggering a redraw in the new + * position. + * + * @param view The view GtkWidget + * @param data The zathura instance + */ +void cb_refresh_view(GtkWidget* view, gpointer data); + /* This function gets called when the value of the adjustment changes. * * It updates the value of the tracking adjustment, only if the bounds of the diff --git a/zathura.c b/zathura.c index 39b88c1..74b0a49 100644 --- a/zathura.c +++ b/zathura.c @@ -141,6 +141,21 @@ zathura_init(zathura_t* zathura) zathura->ui.session->events.buffer_changed = cb_buffer_changed; zathura->ui.session->events.unknown_command = cb_unknown_command; + /* zathura signals */ + zathura->signals.refresh_view = g_signal_new("refresh-view", + GTK_TYPE_WIDGET, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + + g_signal_connect(G_OBJECT(zathura->ui.session->gtk.view), "refresh-view", + G_CALLBACK(cb_refresh_view), zathura); + /* page view */ #if (GTK_MAJOR_VERSION == 3) zathura->ui.page_widget = gtk_grid_new(); @@ -1195,6 +1210,16 @@ position_set(zathura_t* zathura, double position_x, double position_y) } } + +void +refresh_view(zathura_t* zathura) { + g_return_if_fail(zathura != NULL); + + /* emit a custom refresh-view signal */ + g_signal_emit(zathura->ui.session->gtk.view, zathura->signals.refresh_view, + 0, zathura); +} + static void zathura_jumplist_hide_inputbar(zathura_t* zathura) { diff --git a/zathura.h b/zathura.h index 4f39b35..d89f55e 100644 --- a/zathura.h +++ b/zathura.h @@ -132,6 +132,11 @@ struct zathura_s unsigned int max_size; } jumplist; + struct + { + guint refresh_view; + } signals; + struct { gchar* file; @@ -321,6 +326,13 @@ void position_set_delayed(zathura_t* zathura, double position_x, double position */ void position_set(zathura_t* zathura, double position_x, double position_y); +/** + * Refresh the page view + * + * @param zathura Zathura session + */ +void refresh_view(zathura_t* zathura); + /** * Builds the box structure to show the rendered pages * From 54b6f7336df837c2300636b7bf1d60b195cf4efc Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 21:37:02 +0200 Subject: [PATCH 42/90] make position_set and page_set more asynchronous Now page_set and position_set save the computed page and position to the document object, then trigger a refresh-view signal. They do not handle GTK adjustments anymore. --- zathura.c | 77 +++++++++++++++++++++++++++++++++---------------------- zathura.h | 3 ++- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/zathura.c b/zathura.c index 74b0a49..abed66e 100644 --- a/zathura.c +++ b/zathura.c @@ -1035,33 +1035,17 @@ page_set(zathura_t* zathura, unsigned int page_id) goto error_out; } - /* render page */ zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); - if (page == NULL) { goto error_out; } zathura_document_set_current_page_number(zathura->document, page_id); - zathura->global.update_page_number = false; - page_offset_t offset; - page_calculate_offset(zathura, page, &offset); - - GtkAdjustment* view_vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - GtkAdjustment* view_hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - zathura_adjustment_set_value(view_hadjustment, offset.x); - zathura_adjustment_set_value(view_vadjustment, offset.y); - - /* refresh horizontal adjustment, to honor zoom-center */ - cb_view_hadjustment_changed(view_hadjustment, zathura); - - statusbar_page_number_update(zathura); - - return true; + /* negative position means auto */ + return position_set(zathura, -1, -1); error_out: - return false; } @@ -1191,23 +1175,56 @@ position_set_delayed(zathura_t* zathura, double position_x, double position_y) gdk_threads_add_idle(position_set_delayed_impl, p); } -void +bool position_set(zathura_t* zathura, double position_x, double position_y) { - g_return_if_fail(zathura != NULL); - - GtkScrolledWindow *window = GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view); - GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(window); - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(window); - - /* negative values mean: don't set the position */ - if (position_x >= 0) { - zathura_adjustment_set_value(hadjustment, position_x); + if (zathura == NULL || zathura->document == NULL) { + goto error_out; } - if (position_y >= 0) { - zathura_adjustment_set_value(vadjustment, position_y); + double comppos_x, comppos_y; + unsigned int page_id = zathura_document_get_current_page_number(zathura->document); + + /* xalign = 0.5: center horizontally (with the page, not the document) */ + /* yalign = 0.0: align page an viewport edges at the top */ + page_number_to_position(zathura->document, page_id, 0.5, 0.0, &comppos_x, &comppos_y); + + /* automatic horizontal adjustment */ + zathura_adjust_mode_t adjust_mode = zathura_document_get_adjust_mode(zathura->document); + + /* negative position_x mean: use the computed value */ + if (position_x < 0) { + position_x = comppos_x; + bool zoom_center = false; + girara_setting_get(zathura->ui.session, "zoom-center", &zoom_center); + + /* center horizontally */ + if (adjust_mode == ZATHURA_ADJUST_BESTFIT || + adjust_mode == ZATHURA_ADJUST_WIDTH || + zoom_center) { + position_x = 0.5; + } } + + if (position_y < 0) { + position_y = comppos_y; + } + + /* set the position */ + zathura_document_set_position_x(zathura->document, position_x); + zathura_document_set_position_y(zathura->document, position_y); + + /* prevent cb_view_adjustment_value_changed from updating document page number and + position from the adjustments. */ + zathura->global.update_page_number = false; + + /* trigger a 'change' event for both adjustments */ + refresh_view(zathura); + + return true; + +error_out: + return false; } diff --git a/zathura.h b/zathura.h index d89f55e..a305156 100644 --- a/zathura.h +++ b/zathura.h @@ -323,8 +323,9 @@ void position_set_delayed(zathura_t* zathura, double position_x, double position * @param zathura Zathura session * @param position_x X coordinate * @param position_y Y coordinate + * @return If no error occured true, otherwise false, is returned. */ -void position_set(zathura_t* zathura, double position_x, double position_y); +bool position_set(zathura_t* zathura, double position_x, double position_y); /** * Refresh the page view From c4245600c9f3ec45f98789267b1e984d031e4d3e Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Thu, 24 Oct 2013 22:11:52 +0200 Subject: [PATCH 43/90] move adjustment code from sc_adjust_window to adjust_view This new function adjust_view is in charge of recomputing the scale according to adjustment settings and trigger a render_all. adjust_view contains the old sc_adjust_window code, slightly simplified thanks to the availability of the document_get_viewport_size. Then it is used by sc_adjust_window, document_open and the cb_view_resized callback. Makes slightly more sense this way than calling the shortcut sc_adjust_window directly. --- callbacks.c | 18 ++++------ shortcuts.c | 95 +---------------------------------------------------- zathura.c | 69 ++++++++++++++++++++++++++++++++++++-- zathura.h | 7 ++++ 4 files changed, 81 insertions(+), 108 deletions(-) diff --git a/callbacks.c b/callbacks.c index 0c4bebd..13621f6 100644 --- a/callbacks.c +++ b/callbacks.c @@ -459,23 +459,19 @@ error_ret: } bool -cb_view_resized(GtkWidget* UNUSED(widget), GtkAllocation* allocation, zathura_t* zathura) +cb_view_resized(GtkWidget* UNUSED(widget), GtkAllocation* UNUSED(allocation), zathura_t* zathura) { if (zathura == NULL || zathura->document == NULL) { return false; } - static int height = -1; - static int width = -1; + /* adjust the scale according to settings. If nothing needs to be resized, + it does not trigger the resize event. - /* adjust only if the allocation changed */ - if (width != allocation->width || height != allocation->height) { - girara_argument_t argument = { zathura_document_get_adjust_mode(zathura->document), NULL }; - sc_adjust_window(zathura->ui.session, &argument, NULL, 0); - - width = allocation->width; - height = allocation->height; - } + The right viewport size is already in the document object, due to a + previous call to adjustment_changed. We don't want to use the allocation in + here, because we would have to subtract scrollbars, etc. */ + adjust_view(zathura); return false; } diff --git a/shortcuts.c b/shortcuts.c index 2d51742..276979d 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -102,101 +102,8 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, zathura_t* zathura = session->global.data; g_return_val_if_fail(argument != NULL, false); - unsigned int pages_per_row = 1; - girara_setting_get(session, "pages-per-row", &pages_per_row); - - unsigned int first_page_column = 1; - girara_setting_get(session, "first-page-column", &first_page_column); - - int padding = 1; - girara_setting_get(zathura->ui.session, "page-padding", &padding); - - if (zathura->ui.page_widget == NULL || zathura->document == NULL) { - goto error_ret; - } - zathura_document_set_adjust_mode(zathura->document, argument->n); - if (argument->n == ZATHURA_ADJUST_NONE) { - /* there is nothing todo */ - goto error_ret; - } - - /* get window size */ - GtkAllocation allocation; - gtk_widget_get_allocation(session->gtk.view, &allocation); - unsigned int width = allocation.width; - unsigned int height = allocation.height; - - /* scrollbar spacing */ - gint spacing; - gtk_widget_style_get(session->gtk.view, "scrollbar_spacing", &spacing, NULL); - width -= spacing; - - /* correct view size */ - if (gtk_widget_get_visible(GTK_WIDGET(session->gtk.inputbar)) == true) { - gtk_widget_get_allocation(session->gtk.inputbar, &allocation); - height += allocation.height; - } - - double scale = 1.0; - unsigned int cell_height = 0, cell_width = 0; - unsigned int document_height = 0, document_width = 0; - - zathura_document_set_scale(zathura->document, scale); - zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); - zathura_document_get_document_size(zathura->document, &document_height, &document_width); - - double page_ratio = (double)cell_height / (double)document_width; - double window_ratio = (double)height / (double)width; - - if (argument->n == ZATHURA_ADJUST_WIDTH || - (argument->n == ZATHURA_ADJUST_BESTFIT && page_ratio < window_ratio)) { - scale = (double)(width - (pages_per_row - 1) * padding) / - (double)(pages_per_row * cell_width); - zathura_document_set_scale(zathura->document, scale); - - bool show_vscrollbar = false; - girara_setting_get(session, "show-v-scrollbar", &show_vscrollbar); - - if (show_vscrollbar) { - /* If the document is taller than the view, there's a vertical - * scrollbar; we need to substract its width from the view's width. */ - zathura_document_get_document_size(zathura->document, &document_height, &document_width); - if (height < document_height) { - GtkWidget* vscrollbar = gtk_scrolled_window_get_vscrollbar( - GTK_SCROLLED_WINDOW(session->gtk.view)); - - if (vscrollbar != NULL) { - int scroll_width; -#if (GTK_MAJOR_VERSION == 3) - gtk_widget_get_preferred_width(GTK_WIDGET(vscrollbar), NULL, &scroll_width); -#else - GtkRequisition requisition; - gtk_widget_get_requisition(vscrollbar, &requisition); - scroll_width = requisition.width; -#endif - if (0 < scroll_width && (unsigned int)scroll_width < width) { - width -= scroll_width; - scale = (double)(width - (pages_per_row - 1) * padding) / - (double)(pages_per_row * cell_width); - zathura_document_set_scale(zathura->document, scale); - } - } - } - } - } - else if (argument->n == ZATHURA_ADJUST_BESTFIT) { - scale = (double)height / (double)cell_height; - zathura_document_set_scale(zathura->document, scale); - } - else { - goto error_ret; - } - - /* re-render all pages */ - render_all(zathura); - -error_ret: + adjust_view(zathura); return false; } diff --git a/zathura.c b/zathura.c index abed66e..0660934 100644 --- a/zathura.c +++ b/zathura.c @@ -811,9 +811,9 @@ document_open(zathura_t* zathura, const char* path, const char* password, g_free(file_uri); - /* adjust window */ - girara_argument_t argument = { zathura_document_get_adjust_mode(document), NULL }; - sc_adjust_window(zathura->ui.session, &argument, NULL, 0); + + /* adjust_view and set position*/ + adjust_view(zathura); /* set position */ if (file_info.position_x != 0 || file_info.position_y != 0) { @@ -1271,6 +1271,69 @@ zathura_jumplist_hide_inputbar(zathura_t* zathura) } } +bool +adjust_view(zathura_t* zathura) { + g_return_val_if_fail(zathura != NULL, false); + + if (zathura->ui.page_widget == NULL || zathura->document == NULL) { + goto error_ret; + } + + zathura_adjust_mode_t adjust_mode = zathura_document_get_adjust_mode(zathura->document); + if (adjust_mode == ZATHURA_ADJUST_NONE) { + /* there is nothing todo */ + goto error_ret; + } + + unsigned int cell_height = 0, cell_width = 0; + unsigned int document_height = 0, document_width = 0; + unsigned int view_height = 0, view_width = 0; + + zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); + zathura_document_get_document_size(zathura->document, &document_height, &document_width); + zathura_document_get_viewport_size(zathura->document, &view_height, &view_width); + + double scale = zathura_document_get_scale(zathura->document); + + if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0) { + goto error_ret; + } + + double page_ratio = (double)cell_height / (double)document_width; + double view_ratio = (double)view_height / (double)view_width; + double newscale = scale; + + if (adjust_mode == ZATHURA_ADJUST_WIDTH || + (adjust_mode == ZATHURA_ADJUST_BESTFIT && page_ratio < view_ratio)) { + newscale = scale * (double)view_width / (double)document_width; + + } else if (adjust_mode == ZATHURA_ADJUST_BESTFIT) { + newscale = scale * (double)view_height / (double)cell_height; + + } else { + goto error_ret; + } + + /* save new scale and recompute cell size */ + zathura_document_set_scale(zathura->document, newscale); + unsigned int new_cell_height = 0, new_cell_width = 0; + zathura_document_get_cell_size(zathura->document, &new_cell_height, &new_cell_width); + + /* if the change in scale changes page cell dimensions by at least one pixel, render */ + if (abs(new_cell_width - cell_width) > 1 || + abs(new_cell_height - cell_height) > 1) { + render_all(zathura); + refresh_view(zathura); + + /* otherwise set the old scale and leave */ + } else { + zathura_document_set_scale(zathura->document, scale); + } + +error_ret: + return false; +} + bool zathura_jumplist_has_previous(zathura_t* zathura) { diff --git a/zathura.h b/zathura.h index a305156..a23f465 100644 --- a/zathura.h +++ b/zathura.h @@ -334,6 +334,13 @@ bool position_set(zathura_t* zathura, double position_x, double position_y); */ void refresh_view(zathura_t* zathura); +/** + * Recompute the scale according to settings + * + * @param zathura Zathura session + */ +bool adjust_view(zathura_t* zathura); + /** * Builds the box structure to show the rendered pages * From 3634636227b28042de15783c00659e42ba1f610c Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:00:21 +0200 Subject: [PATCH 44/90] adapt view_adjustment callbacks to new document/view separation The adjustment callbacks act as an interface between position data in the document object, and the adjustments. We remove the horizontal centering code, as now it is done by position_set. Those callbacks should not change the position read from the document object in any way. Also, we split the adjustment_value_changed callback into a vertical and an horizontal version. Previously a single callback was reused for both, horizontal and vertical. That lead to a subtle problem when coming out of index mode. What happened was the following: 1. horizontal adjustment bounds change coming out of index mode. This triggers an hadjustment changed signal. 2. the hadjustment_changed callback handles it, and resets the hadjustment value, as the bound may have changed. This triggers a value_changed event. 3. the value_changed callback handles the event, and captures the position for *BOTH*, horizontal and vertical adjustments, saving them to the document object. 1..3 is repeated for the vertical adjustment. Now, if in 3. the horizontal adjustment bounds were not yet updated after the index mode, we got ourselves at the wrong vertical position. This race condition is avoided now because both value_changed callbacks *ONLY* handle their own direction, either vertical or horizontal, not both. --- callbacks.c | 134 +++++++++++++++++++++++++--------------------------- callbacks.h | 9 ++++ zathura.c | 2 +- 3 files changed, 75 insertions(+), 70 deletions(-) diff --git a/callbacks.c b/callbacks.c index 13621f6..f5ad9dc 100644 --- a/callbacks.c +++ b/callbacks.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "callbacks.h" #include "links.h" @@ -48,78 +49,79 @@ cb_buffer_changed(girara_session_t* session) } } -void -cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpointer data) -{ - zathura_t* zathura = data; - if (zathura == NULL || zathura->document == NULL || zathura->ui.page_widget == NULL) { - return; - } - - GtkAdjustment* view_vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - GtkAdjustment* view_hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - - /* current adjustment values */ - const GdkRectangle view_rect = { - .x = 0, - .y = 0, - .width = gtk_adjustment_get_page_size(view_hadjustment), - .height = gtk_adjustment_get_page_size(view_vadjustment) - }; - - int page_padding = 1; - girara_setting_get(zathura->ui.session, "page-padding", &page_padding); - - const GdkRectangle center = { - .x = (view_rect.width + 1) / 2, - .y = (view_rect.height + 1) / 2, - .width = (2 * page_padding) + 1, - .height = (2 * page_padding) + 1 - }; - +static void +update_visible_pages(zathura_t* zathura) { const unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); - const double scale = zathura_document_get_scale(zathura->document); - bool updated = false; - /* find page that fits */ 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); - - GdkRectangle page_rect = { - .width = zathura_page_get_width(page) * scale, - .height = zathura_page_get_height(page) * scale - }; GtkWidget* page_widget = zathura_page_get_widget(zathura, page); ZathuraPage* zathura_page_widget = ZATHURA_PAGE(page_widget); - gtk_widget_translate_coordinates(page_widget, zathura->ui.session->gtk.view, - 0, 0, &page_rect.x, &page_rect.y); - if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) { + if (page_is_visible(zathura->document, page_id) == true) { + /* make page visible */ if (zathura_page_get_visibility(page) == false) { zathura_page_set_visibility(page, true); zathura_page_widget_update_view_time(zathura_page_widget); zathura_renderer_page_cache_add(zathura->sync.render_thread, zathura_page_get_index(page)); } - if (zathura->global.update_page_number == true && updated == false - && gdk_rectangle_intersect(¢er, &page_rect, NULL) == TRUE) { - zathura_document_set_current_page_number(zathura->document, page_id); - updated = true; - } + } else { + /* make page invisible */ if (zathura_page_get_visibility(page) == true) { zathura_page_set_visibility(page, false); /* If a page becomes invisible, abort the render request. */ zathura_page_widget_abort_render_request(zathura_page_widget); } + /* reset current search result */ girara_list_t* results = NULL; g_object_get(page_widget, "search-results", &results, NULL); - if (results != NULL) { g_object_set(page_widget, "search-current", 0, NULL); } } } +} + +void +cb_view_hadjustment_value_changed(GtkAdjustment* adjustment, gpointer data) +{ + zathura_t* zathura = data; + if (zathura == NULL || zathura->document == NULL) { + return; + } + + update_visible_pages(zathura); + + double position_x = zathura_adjustment_get_ratio(adjustment); + double position_y = zathura_document_get_position_y(zathura->document); + unsigned int page_id = position_to_page_number(zathura->document, position_x, position_y); + + zathura_document_set_position_x(zathura->document, position_x); + zathura_document_set_position_y(zathura->document, position_y); + zathura_document_set_current_page_number(zathura->document, page_id); + + statusbar_page_number_update(zathura); +} + +void +cb_view_vadjustment_value_changed(GtkAdjustment* adjustment, gpointer data) +{ + zathura_t* zathura = data; + if (zathura == NULL || zathura->document == NULL) { + return; + } + + update_visible_pages(zathura); + + double position_x = zathura_document_get_position_x(zathura->document); + double position_y = zathura_adjustment_get_ratio(adjustment); + unsigned int page_id = position_to_page_number(zathura->document, position_x, position_y); + + zathura_document_set_position_x(zathura->document, position_x); + zathura_document_set_position_y(zathura->document, position_y); + zathura_document_set_current_page_number(zathura->document, page_id); statusbar_page_number_update(zathura); } @@ -133,29 +135,18 @@ cb_view_hadjustment_changed(GtkAdjustment* adjustment, gpointer data) zathura_adjust_mode_t adjust_mode = zathura_document_get_adjust_mode(zathura->document); - gdouble lower, upper, page_size, value, ratio; - bool zoom_center = false; - - switch (adjust_mode) { - center: - case ZATHURA_ADJUST_BESTFIT: - case ZATHURA_ADJUST_WIDTH: - lower = gtk_adjustment_get_lower(adjustment); - upper = gtk_adjustment_get_upper(adjustment); - page_size = gtk_adjustment_get_page_size(adjustment); - value = ((upper - lower) - page_size) / 2.0; - zathura_adjustment_set_value(adjustment, value); - break; - default: - girara_setting_get(zathura->ui.session, "zoom-center", &zoom_center); - if (zoom_center) { - goto center; - } - - ratio = zathura_adjustment_get_ratio(zathura->ui.hadjustment); - zathura_adjustment_set_value_from_ratio(adjustment, ratio); - break; + /* Don't scroll we're focusing the inputbar. */ + if (adjust_mode == ZATHURA_ADJUST_INPUTBAR) { + return; } + + /* save the viewport size */ + unsigned int view_width = (unsigned int)floor(gtk_adjustment_get_page_size(adjustment)); + zathura_document_set_viewport_width(zathura->document, view_width); + + /* reset the adjustment, in case bounds have changed */ + double ratio = zathura_document_get_position_x(zathura->document); + zathura_adjustment_set_value_from_ratio(adjustment, ratio); } void @@ -172,7 +163,12 @@ cb_view_vadjustment_changed(GtkAdjustment* adjustment, gpointer data) return; } - double ratio = zathura_adjustment_get_ratio(zathura->ui.vadjustment); + /* save the viewport size */ + unsigned int view_height = (unsigned int)floor(gtk_adjustment_get_page_size(adjustment)); + zathura_document_set_viewport_height(zathura->document, view_height); + + /* reset the adjustment, in case bounds have changed */ + double ratio = zathura_document_get_position_y(zathura->document); zathura_adjustment_set_value_from_ratio(adjustment, ratio); } diff --git a/callbacks.h b/callbacks.h index 856f71b..9683f81 100644 --- a/callbacks.h +++ b/callbacks.h @@ -27,6 +27,15 @@ gboolean cb_destroy(GtkWidget* widget, zathura_t* zathura); */ void cb_buffer_changed(girara_session_t* session); +/** + * This function gets called when the value of the horizontal scrollbars + * changes (e.g.: by scrolling, moving to another page) + * + * @param adjustment The hadjustment of the page view + * @param data NULL + */ +void cb_view_hadjustment_value_changed(GtkAdjustment *adjustment, gpointer data); + /** * This function gets called when the value of the vertical scrollbars * changes (e.g.: by scrolling, moving to another page) diff --git a/zathura.c b/zathura.c index 0660934..5c9bbef 100644 --- a/zathura.c +++ b/zathura.c @@ -178,7 +178,7 @@ zathura_init(zathura_t* zathura) /* Connect hadjustment signals */ g_signal_connect(G_OBJECT(hadjustment), "value-changed", - G_CALLBACK(cb_view_vadjustment_value_changed), zathura); + G_CALLBACK(cb_view_hadjustment_value_changed), zathura); g_signal_connect(G_OBJECT(hadjustment), "value-changed", G_CALLBACK(cb_adjustment_track_value), zathura->ui.hadjustment); g_signal_connect(G_OBJECT(hadjustment), "changed", From 018e026e620d0a1ddbc459092cd25d6c774989be Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 23 Oct 2013 16:09:50 +0200 Subject: [PATCH 45/90] disable adjustment callbacks in index mode Otherwise the document object gets updated with wrong position values, because the adjustment belong to the index, not the document view. --- callbacks.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/callbacks.c b/callbacks.c index f5ad9dc..9a5f816 100644 --- a/callbacks.c +++ b/callbacks.c @@ -92,6 +92,11 @@ cb_view_hadjustment_value_changed(GtkAdjustment* adjustment, gpointer data) return; } + /* Do nothing in index mode */ + if (girara_mode_get(zathura->ui.session) == zathura->modes.index) { + return; + } + update_visible_pages(zathura); double position_x = zathura_adjustment_get_ratio(adjustment); @@ -113,6 +118,11 @@ cb_view_vadjustment_value_changed(GtkAdjustment* adjustment, gpointer data) return; } + /* Do nothing in index mode */ + if (girara_mode_get(zathura->ui.session) == zathura->modes.index) { + return; + } + update_visible_pages(zathura); double position_x = zathura_document_get_position_x(zathura->document); @@ -135,6 +145,11 @@ cb_view_hadjustment_changed(GtkAdjustment* adjustment, gpointer data) zathura_adjust_mode_t adjust_mode = zathura_document_get_adjust_mode(zathura->document); + /* Do nothing in index mode */ + if (girara_mode_get(zathura->ui.session) == zathura->modes.index) { + return; + } + /* Don't scroll we're focusing the inputbar. */ if (adjust_mode == ZATHURA_ADJUST_INPUTBAR) { return; @@ -158,6 +173,11 @@ cb_view_vadjustment_changed(GtkAdjustment* adjustment, gpointer data) zathura_adjust_mode_t adjust_mode = zathura_document_get_adjust_mode(zathura->document); + /* Do nothing in index mode */ + if (girara_mode_get(zathura->ui.session) == zathura->modes.index) { + return; + } + /* Don't scroll we're focusing the inputbar. */ if (adjust_mode == ZATHURA_ADJUST_INPUTBAR) { return; From 1171bffb6b34786f3c67adc43bee47f7417c6575 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:11:33 +0200 Subject: [PATCH 46/90] replace delayed versions of page_set and position_set The new page_set and position_set behave as delayed, but with the immediate availability of the new positions through the document object. We no longer need to keep delayed and non-delayed versions! --- shortcuts.c | 9 +++++---- synctex.c | 2 +- zathura.c | 6 ++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 276979d..b05dded 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -475,7 +475,7 @@ sc_rotate(girara_session_t* session, girara_argument_t* argument, /* render all pages again */ render_all(zathura); - page_set_delayed(zathura, page_number); + page_set(zathura, page_number); return false; } @@ -1122,7 +1122,7 @@ sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument), girara_mode_set(zathura->ui.session, zathura->modes.normal); /* reset adjustment */ - position_set_delayed(zathura, hvalue, vvalue); + position_set(zathura, hvalue, vvalue); } else { /* save adjustment */ GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); @@ -1220,7 +1220,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* /* reset scale */ zathura_document_set_scale(zathura->document, zoom); render_all(zathura); - page_set_delayed(zathura, zathura_document_get_current_page_number(zathura->document)); + page_set(zathura, zathura_document_get_current_page_number(zathura->document)); /* setm ode */ girara_mode_set(session, zathura->modes.normal); @@ -1248,7 +1248,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* /* set full screen */ gtk_window_fullscreen(GTK_WINDOW(session->gtk.window)); - page_set_delayed(zathura, zathura_document_get_current_page_number(zathura->document)); + page_set(zathura, zathura_document_get_current_page_number(zathura->document)); /* setm ode */ girara_mode_set(session, zathura->modes.fullscreen); @@ -1325,6 +1325,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* } render_all(zathura); + page_set(zathura, zathura_document_get_current_page_number(zathura->document)); return false; } diff --git a/synctex.c b/synctex.c index 6d8c71f..3a9ea29 100644 --- a/synctex.c +++ b/synctex.c @@ -97,7 +97,7 @@ synctex_record_hits(zathura_t* zathura, int page_idx, girara_list_t* hits, bool g_object_set(page_widget, "search-results", hits, NULL); if (first) { - page_set_delayed(zathura, zathura_page_get_index(page)); + page_set(zathura, zathura_page_get_index(page)); g_object_set(page_widget, "search-current", 0, NULL); } } diff --git a/zathura.c b/zathura.c index 5c9bbef..6228c2f 100644 --- a/zathura.c +++ b/zathura.c @@ -816,11 +816,9 @@ document_open(zathura_t* zathura, const char* path, const char* password, adjust_view(zathura); /* set position */ + page_set(zathura, zathura_document_get_current_page_number(document)); if (file_info.position_x != 0 || file_info.position_y != 0) { - position_set_delayed(zathura, file_info.position_x, file_info.position_y); - } else { - page_set_delayed(zathura, zathura_document_get_current_page_number(document)); - cb_view_vadjustment_value_changed(NULL, zathura); + position_set(zathura, file_info.position_x, file_info.position_y); } return true; From f94d43d2e656c826d939f1b4c726322f22bc6d4b Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 23 Oct 2013 22:15:57 +0200 Subject: [PATCH 47/90] replace some page_set with refresh_view page_set changes page and aligns the page according to settings. In those cases we do not want to change the position, only refresh. --- shortcuts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index b05dded..288fad9 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -1220,7 +1220,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* /* reset scale */ zathura_document_set_scale(zathura->document, zoom); render_all(zathura); - page_set(zathura, zathura_document_get_current_page_number(zathura->document)); + refresh_view(zathura); /* setm ode */ girara_mode_set(session, zathura->modes.normal); @@ -1248,7 +1248,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* /* set full screen */ gtk_window_fullscreen(GTK_WINDOW(session->gtk.window)); - page_set(zathura, zathura_document_get_current_page_number(zathura->document)); + refresh_view(zathura); /* setm ode */ girara_mode_set(session, zathura->modes.fullscreen); @@ -1325,7 +1325,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* } render_all(zathura); - page_set(zathura, zathura_document_get_current_page_number(zathura->document)); + refresh_view(zathura); return false; } From 6ca81e3716868c00d3629d3dd72b85845ed0510b Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:14:15 +0200 Subject: [PATCH 48/90] use the new document functions for marks, bookmarks and initialization We get the position data from the document object instead of the gtk adjustment itself. --- bookmarks.c | 12 ++++++------ commands.c | 13 +++---------- marks.c | 22 +++++++++------------- zathura.c | 8 ++------ 4 files changed, 20 insertions(+), 35 deletions(-) diff --git a/bookmarks.c b/bookmarks.c index e7e792a..28f6b5e 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -25,14 +25,14 @@ zathura_bookmark_add(zathura_t* zathura, const gchar* id, unsigned int page) g_return_val_if_fail(zathura && zathura->document && zathura->bookmarks.bookmarks, NULL); g_return_val_if_fail(id, NULL); - double x = zathura_adjustment_get_ratio(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); - double y = zathura_adjustment_get_ratio(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); + double position_x = zathura_document_get_position_x(zathura->document); + double position_y = zathura_document_get_position_y(zathura->document); zathura_bookmark_t* old = zathura_bookmark_get(zathura, id); if (old != NULL) { old->page = page; - old->x = x; - old->y = y; + old->x = position_x; + old->y = position_y; if (zathura->database != NULL) { const char* path = zathura_document_get_path(zathura->document); @@ -52,8 +52,8 @@ zathura_bookmark_add(zathura_t* zathura, const gchar* id, unsigned int page) bookmark->id = g_strdup(id); bookmark->page = page; - bookmark->x = x; - bookmark->y = y; + bookmark->x = position_x; + bookmark->y = position_y; girara_list_append(zathura->bookmarks.bookmarks, bookmark); if (zathura->database != NULL) { diff --git a/commands.c b/commands.c index b12c979..900bfc3 100644 --- a/commands.c +++ b/commands.c @@ -118,16 +118,9 @@ cmd_bookmark_open(girara_session_t* session, girara_list_t* argument_list) } zathura_jumplist_add(zathura); - if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN) { - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - zathura_adjustment_set_value_from_ratio(hadjustment, bookmark->x); - zathura_adjustment_set_value_from_ratio(vadjustment, bookmark->y); - zathura_document_set_current_page_number(zathura->document, bookmark->page - 1); - statusbar_page_number_update(zathura); - } else { - page_set(zathura, bookmark->page - 1); - } + page_set(zathura, bookmark->page - 1); + if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN) + position_set(zathura, bookmark->x, bookmark->y); zathura_jumplist_add(zathura); return true; diff --git a/marks.c b/marks.c index 41144ad..614bb41 100644 --- a/marks.c +++ b/marks.c @@ -23,7 +23,8 @@ struct zathura_mark_s { int key; /**> Marks key */ double position_x; /**> Horizontal adjustment */ double position_y; /**> Vertical adjustment */ - float scale; /**> Zoom level */ + unsigned int page; /**> Page number */ + double scale; /**> Zoom level */ }; bool @@ -196,21 +197,16 @@ mark_add(zathura_t* zathura, int key) return; } - GtkScrolledWindow *window = GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view); - GtkAdjustment* v_adjustment = gtk_scrolled_window_get_vadjustment(window); - GtkAdjustment* h_adjustment = gtk_scrolled_window_get_hadjustment(window); + unsigned int page_id = zathura_document_get_current_page_number(zathura->document); + double position_x = zathura_document_get_position_x(zathura->document); + double position_y = zathura_document_get_position_y(zathura->document); - if (v_adjustment == NULL || h_adjustment == NULL) { - return; - } - - double position_x = gtk_adjustment_get_value(h_adjustment); - double position_y = gtk_adjustment_get_value(v_adjustment); - float scale = zathura_document_get_scale(zathura->document); + double scale = zathura_document_get_scale(zathura->document); /* search for existing mark */ GIRARA_LIST_FOREACH(zathura->global.marks, zathura_mark_t*, iter, mark) if (mark->key == key) { + mark->page = page_id; mark->position_x = position_x; mark->position_y = position_y; mark->scale = scale; @@ -222,6 +218,7 @@ mark_add(zathura_t* zathura, int key) zathura_mark_t* mark = g_malloc0(sizeof(zathura_mark_t)); mark->key = key; + mark->page = page_id; mark->position_x = position_x; mark->position_y = position_y; mark->scale = scale; @@ -243,11 +240,10 @@ mark_evaluate(zathura_t* zathura, int key) render_all(zathura); zathura_jumplist_add(zathura); + page_set(zathura, mark->page); position_set(zathura, mark->position_x, mark->position_y); zathura_jumplist_add(zathura); - cb_view_vadjustment_value_changed(NULL, zathura); - zathura->global.update_page_number = true; return; } diff --git a/zathura.c b/zathura.c index 6228c2f..0a63b10 100644 --- a/zathura.c +++ b/zathura.c @@ -946,12 +946,8 @@ document_close(zathura_t* zathura, bool keep_monitor) girara_setting_get(zathura->ui.session, "first-page-column", &(file_info.first_page_column)); /* get position */ - GtkScrolledWindow *window = GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view); - GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(window); - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(window); - - file_info.position_x = gtk_adjustment_get_value(hadjustment); - file_info.position_y = gtk_adjustment_get_value(vadjustment); + file_info.position_x = zathura_document_get_position_x(zathura->document); + file_info.position_y = zathura_document_get_position_y(zathura->document); /* save file info */ zathura_db_set_fileinfo(zathura->database, path, &file_info); From 4a75efd4f2840a1d737fac9abc776b509f60532e Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:14:51 +0200 Subject: [PATCH 49/90] use the new document functions for the jumplist And get rid of explicit gtk calls to the adjustment --- shortcuts.c | 15 ++++++--------- zathura.c | 12 ++++++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 288fad9..1dcd9db 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -648,10 +648,9 @@ sc_jumplist(girara_session_t* session, girara_argument_t* argument, return true; } - GtkAdjustment* hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - GtkAdjustment* vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - double x = zathura_adjustment_get_ratio(hadj); - double y = zathura_adjustment_get_ratio(vadj); + double x = zathura_document_get_position_x(zathura->document); + double y = zathura_document_get_position_y(zathura->document); + zathura_jump_t* jump = NULL; zathura_jump_t* prev_jump = zathura_jumplist_current(zathura); bool go_to_current = false; @@ -691,11 +690,9 @@ sc_jumplist(girara_session_t* session, girara_argument_t* argument, } if (jump != NULL) { - zathura_adjustment_set_value_from_ratio(hadj, jump->x); - zathura_adjustment_set_value_from_ratio(vadj, jump->y); - zathura_document_set_current_page_number(zathura->document, jump->page); - statusbar_page_number_update(zathura); -} + page_set(zathura, jump->page); + position_set(zathura, jump->x, jump->y); + } return false; } diff --git a/zathura.c b/zathura.c index 0a63b10..d264076 100644 --- a/zathura.c +++ b/zathura.c @@ -1426,12 +1426,12 @@ zathura_jumplist_trim(zathura_t* zathura) void zathura_jumplist_add(zathura_t* zathura) { - g_return_if_fail(zathura != NULL && zathura->jumplist.list != NULL); + g_return_if_fail(zathura != NULL && zathura->document != NULL && zathura->jumplist.list != NULL); zathura_jumplist_hide_inputbar(zathura); unsigned int pagenum = zathura_document_get_current_page_number(zathura->document); - double x = zathura_adjustment_get_ratio(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); - double y = zathura_adjustment_get_ratio(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); + double x = zathura_document_get_position_x(zathura->document); + double y = zathura_document_get_position_y(zathura->document); if (zathura->jumplist.size != 0) { zathura_jumplist_reset_current(zathura); @@ -1480,7 +1480,7 @@ zathura_jumplist_load(zathura_t* zathura, const char* file) static void zathura_jumplist_save(zathura_t* zathura) { - g_return_if_fail(zathura != NULL); + g_return_if_fail(zathura != NULL && zathura->document != NULL); zathura_jump_t* cur = zathura_jumplist_current(zathura); @@ -1488,7 +1488,7 @@ zathura_jumplist_save(zathura_t* zathura) if (cur) { cur->page = pagenum; - cur->x = zathura_adjustment_get_ratio(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); - cur->y = zathura_adjustment_get_ratio(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view))); + cur->x = zathura_document_get_position_x(zathura->document); + cur->y = zathura_document_get_position_y(zathura->document); } } From efc7d23f92298cd8df86f1d3553b379332ba5baf Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:19:07 +0200 Subject: [PATCH 50/90] use the new document functions in link evaluation We now use the data available on the document object to compute the exact positioning of the link target. This way we get rid of page_calculate_offset, which uses explicit GTK calls. --- links.c | 52 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/links.c b/links.c index ec63c9f..c221cc3 100644 --- a/links.c +++ b/links.c @@ -11,6 +11,7 @@ #include "zathura.h" #include "document.h" #include "utils.h" +#include "page.h" struct zathura_link_s { zathura_rectangle_t position; /**< Position of the link */ @@ -140,34 +141,47 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) return; } - page_offset_t offset; - page_calculate_offset(zathura, page, &offset); + /* compute the position with the page aligned to the top and left + of the viewport */ + double pos_x=0, pos_y=0; + page_number_to_position(zathura->document, link->target.page_number, + 0.0, 0.0, &pos_x, &pos_y); - if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ) { - if (link->target.left != -1) { - offset.x += link->target.left * zathura_document_get_scale(zathura->document); - } + /* correct to place the target position at the top of the viewport */ + /* NOTE: link->target is in page units, needs to be scaled and rotated */ + unsigned int cell_height=0, cell_width=0; + zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); - if (link->target.top != -1) { - offset.y += link->target.top * zathura_document_get_scale(zathura->document); - } - } + unsigned int doc_height=0, doc_width=0; + zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); - zathura_jumplist_add(zathura); - - /* jump to the page */ - page_set(zathura, link->target.page_number); - - /* move to the target position */ bool link_hadjust = true; girara_setting_get(zathura->ui.session, "link-hadjust", &link_hadjust); - if (link_hadjust == true) { - position_set(zathura, offset.x, offset.y); + /* scale and rotate */ + double scale = zathura_document_get_scale(zathura->document); + double shiftx = link->target.left * scale / (double)cell_width; + double shifty = link->target.top * scale / (double)cell_height; + page_calc_position(zathura->document, shiftx, shifty, &shiftx, &shifty); + + /* shift the position or set to auto */ + if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ && + link->target.left != -1 && link_hadjust == true) { + pos_x += shiftx / (double)doc_width; } else { - position_set(zathura, -1, offset.y); + pos_x = -1; /* -1 means automatic */ } + if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ && + link->target.top != -1) { + pos_y += shifty / (double)doc_height; + } else { + pos_y = -1; /* -1 means automatic */ + } + + /* move to position */ + zathura_jumplist_add(zathura); + position_set(zathura, pos_x, pos_y); zathura_jumplist_add(zathura); } break; From ace0836a198d38d88d2e1ce2a2cbbdcf85fd27c5 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:36:45 +0200 Subject: [PATCH 51/90] use the new document functions in sc_search This way we can get rid of explicit GTK calls to the adjustment --- shortcuts.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 1dcd9db..30ad2f2 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -913,26 +913,32 @@ sc_search(girara_session_t* session, girara_argument_t* argument, zathura_rectangle_t* rect = girara_list_nth(results, target_idx); zathura_rectangle_t rectangle = recalc_rectangle(target_page, *rect); - page_offset_t offset; - page_calculate_offset(zathura, target_page, &offset); - zathura_jumplist_add(zathura); - - if (zathura_page_get_index(target_page) != cur_page) { - page_set(zathura, zathura_page_get_index(target_page)); - } - - GtkAdjustment* view_vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - int y = offset.y - gtk_adjustment_get_page_size(view_vadjustment) / 2 + rectangle.y1; - zathura_adjustment_set_value(view_vadjustment, y); bool search_hadjust = true; girara_setting_get(session, "search-hadjust", &search_hadjust); + + /* compute the position of the center of the page */ + double pos_x=0, pos_y=0; + page_number_to_position(zathura->document, zathura_page_get_index(target_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, cell_width=0; + zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); + + unsigned int doc_height=0, 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; + if (search_hadjust == true) { - GtkAdjustment* view_hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - int x = offset.x - gtk_adjustment_get_page_size(view_hadjustment) / 2 + rectangle.x1; - zathura_adjustment_set_value(view_hadjustment, x); + 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); } From e51a3265b6de5af13f81c9f1ca83eac713cf26b2 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 23 Oct 2013 21:17:15 +0200 Subject: [PATCH 52/90] use the new document functions in sc_scroll This way we get rid of page_calculate_offset that involves explicit GTK calls. Also, we can make use of page_number_to_position to align page and viewport as desired. I've also tried to make the code for this function a bit more readable. --- shortcuts.c | 175 ++++++++++++++++++++++++++-------------------------- 1 file changed, 87 insertions(+), 88 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 30ad2f2..d118a0b 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -496,18 +496,14 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, t = 1; } - GtkAdjustment* adjustment = NULL; - if ( (argument->n == LEFT) || (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT) || - (argument->n == RIGHT) || (argument->n == FULL_RIGHT) || (argument->n == HALF_RIGHT)) { - adjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - } else { - adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - } + unsigned int view_width=0, view_height=0; + zathura_document_get_viewport_size(zathura->document, &view_height, &view_width); - gdouble view_size = gtk_adjustment_get_page_size(adjustment); - gdouble value = gtk_adjustment_get_value(adjustment); - gdouble max = gtk_adjustment_get_upper(adjustment) - view_size; - zathura->global.update_page_number = true; + unsigned int cell_width=0, cell_height=0; + zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width); + + unsigned int doc_width=0, doc_height=0; + zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); float scroll_step = 40; girara_setting_get(session, "scroll-step", &scroll_step); @@ -527,108 +523,111 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, int padding = 1; girara_setting_get(session, "page-padding", &padding); - gdouble new_value; + 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; + } + + /* 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)) { + direction = -1.0; + } else { + direction = 1.0; + } + + double vstep = (double)(cell_height + padding) / (double)doc_height; + double hstep = (double)(cell_width + padding) / (double)doc_width; + + /* compute new position */ switch(argument->n) { case FULL_UP: - case FULL_LEFT: - new_value = value - (1.0 - scroll_full_overlap) * view_size - padding; - break; case FULL_DOWN: + pos_y += direction * (1.0 - scroll_full_overlap) * vstep; + break; + + case FULL_LEFT: case FULL_RIGHT: - new_value = value + (1.0 - scroll_full_overlap) * view_size + padding; + pos_x += direction * (1.0 - scroll_full_overlap) * hstep; break; + case HALF_UP: - case HALF_LEFT: - new_value = value - ((view_size + padding) / 2); - break; case HALF_DOWN: + pos_y += direction * 0.5 * vstep; + break; + + case HALF_LEFT: case HALF_RIGHT: - new_value = value + ((view_size + padding) / 2); - break; - case LEFT: - new_value = value - scroll_hstep * t; + pos_x += direction * 0.5 * hstep; break; + case UP: - new_value = value - scroll_step * t; - break; - case RIGHT: - new_value = value + scroll_hstep * t; - break; case DOWN: - new_value = value + scroll_step * t; + pos_y += direction * t * scroll_step / (double)doc_height; break; - case TOP: - new_value = 0; + + case LEFT: + case RIGHT: + pos_x += direction * t * scroll_hstep / (double)doc_width; break; - case BOTTOM: - new_value = max; - break; - default: - new_value = value; } - if (scroll_wrap == true) { - if (new_value < 0) - new_value = max; - else if (new_value > max) - new_value = 0; + /* handle boundaries */ + double end_x = 0.5 * (double)view_width / (double)doc_width; + 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; + + if (pos_x < end_x) { + pos_x = new_x; + } else if (pos_x > 1.0 - end_x) { + pos_x = 1 - new_x; } - if (scroll_page_aware == true) { - int page_offset; - double page_size; + if (pos_y < end_y) { + pos_y = new_y; + } else if (pos_y > 1.0 - end_y) { + pos_y = 1 - new_y; + } - { - unsigned int page_id = zathura_document_get_current_page_number(zathura->document); - zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); - page_offset_t offset; - page_calculate_offset(zathura, page, &offset); + /* 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); + if (scroll_page_aware == true && page_id != new_page_id) { + switch(argument->n) { + case FULL_LEFT: + case HALF_LEFT: + page_number_to_position(zathura->document, new_page_id, 1.0, 0.0, &pos_x, &dummy); + break; - double scale = zathura_document_get_scale(zathura->document); + case FULL_RIGHT: + case HALF_RIGHT: + page_number_to_position(zathura->document, new_page_id, 0.0, 0.0, &pos_x, &dummy); + break; - if ((argument->n == LEFT) || (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT) || - (argument->n == RIGHT) || (argument->n == FULL_RIGHT) || (argument->n == HALF_RIGHT)) { - page_offset = offset.x; - page_size = zathura_page_get_width(page) * scale; - } else { - page_offset = offset.y; - page_size = zathura_page_get_height(page) * scale; - } + case FULL_UP: + case HALF_UP: + page_number_to_position(zathura->document, new_page_id, 0.0, 1.0, &dummy, &pos_y); + break; - page_offset -= padding / 2; - page_size += padding; - } - - if ((argument->n == FULL_DOWN) || (argument->n == HALF_DOWN) || - (argument->n == FULL_RIGHT) || (argument->n == HALF_RIGHT)) { - if ((page_offset > value) && - (page_offset < value + view_size)) { - new_value = page_offset; - } else if ((page_offset <= value) && - (page_offset + page_size < value + view_size)) { - new_value = page_offset + page_size + 1; - } else if ((page_offset <= value) && - (page_offset + page_size < new_value + view_size)) { - new_value = page_offset + page_size - view_size + 1; - } - } else if ((argument->n == FULL_UP) || (argument->n == HALF_UP) || - (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT)) { - if ((page_offset + 1 >= value) && - (page_offset < value + view_size)) { - new_value = page_offset - view_size; - } else if ((page_offset <= value) && - (page_offset + page_size + 1 < value + view_size)) { - new_value = page_offset + page_size - view_size; - } else if ((page_offset <= value) && - (page_offset > new_value)) { - new_value = page_offset; - } + case FULL_DOWN: + case HALF_DOWN: + page_number_to_position(zathura->document, new_page_id, 0.0, 0.0, &dummy, &pos_y); + break; } } - zathura_adjustment_set_value(adjustment, new_value); - + position_set(zathura, pos_x, pos_y); return false; } From ab9338cb33efb01dffc2d4d1885e977d5b50d217 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Tue, 22 Oct 2013 23:21:17 +0200 Subject: [PATCH 53/90] get rid of a couple of static variables to remember adjustment. Now the document object remembers it! and refresh_view is the one who restores the position. --- shortcuts.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index d118a0b..e7182d6 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -1115,24 +1115,14 @@ sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument), gtk_widget_show(treeview); } - static double vvalue = 0; - static double hvalue = 0; - if (gtk_widget_get_visible(GTK_WIDGET(zathura->ui.index))) { girara_set_view(session, zathura->ui.page_widget_alignment); gtk_widget_hide(GTK_WIDGET(zathura->ui.index)); girara_mode_set(zathura->ui.session, zathura->modes.normal); - /* reset adjustment */ - position_set(zathura, hvalue, vvalue); + /* refresh view */ + refresh_view(zathura); } else { - /* save adjustment */ - GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - - vvalue = gtk_adjustment_get_value(vadjustment); - hvalue = gtk_adjustment_get_value(hadjustment); - /* save current position to the jumplist */ zathura_jumplist_add(zathura); From 860c748889da253569b199ee922bb06fdad6168f Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 12:37:47 +0200 Subject: [PATCH 54/90] remove delayed versions of page_set and position_set We don't need the anymore since the new page_set and position_set are already 'delayed'. --- zathura.c | 72 ------------------------------------------------------- zathura.h | 18 -------------- 2 files changed, 90 deletions(-) diff --git a/zathura.c b/zathura.c index d264076..e74cc51 100644 --- a/zathura.c +++ b/zathura.c @@ -42,16 +42,6 @@ typedef struct zathura_document_info_s { int page_number; } zathura_document_info_t; -typedef struct page_set_delayed_s { - zathura_t* zathura; - unsigned int page; -} page_set_delayed_t; - -typedef struct position_set_delayed_s { - zathura_t* zathura; - double position_x; - double position_y; -} position_set_delayed_t; static gboolean document_info_open(gpointer data); static void zathura_jumplist_reset_current(zathura_t* zathura); @@ -997,31 +987,6 @@ document_close(zathura_t* zathura, bool keep_monitor) return true; } -static gboolean -page_set_delayed_impl(gpointer data) -{ - page_set_delayed_t* p = data; - page_set(p->zathura, p->page); - - g_free(p); - return FALSE; -} - -bool -page_set_delayed(zathura_t* zathura, unsigned int page_id) -{ - if (zathura == NULL || zathura->document == NULL || - (page_id >= zathura_document_get_number_of_pages(zathura->document))) { - return false; - } - - page_set_delayed_t* p = g_malloc(sizeof(page_set_delayed_t)); - p->zathura = zathura; - p->page = page_id; - gdk_threads_add_idle(page_set_delayed_impl, p); - return true; -} - bool page_set(zathura_t* zathura, unsigned int page_id) { @@ -1132,43 +1097,6 @@ page_widget_set_mode(zathura_t* zathura, unsigned int page_padding, gtk_widget_show_all(zathura->ui.page_widget); } -static gboolean -position_set_delayed_impl(gpointer data) -{ - position_set_delayed_t* p = (position_set_delayed_t*) data; - - GtkScrolledWindow *window = GTK_SCROLLED_WINDOW(p->zathura->ui.session->gtk.view); - GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(window); - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(window); - - /* negative values mean: don't set the position */ - if (p->position_x >= 0) { - zathura_adjustment_set_value(hadjustment, p->position_x); - } - - if (p->position_y >= 0) { - zathura_adjustment_set_value(vadjustment, p->position_y); - } - - g_free(p); - - return FALSE; -} - -void -position_set_delayed(zathura_t* zathura, double position_x, double position_y) -{ - g_return_if_fail(zathura != NULL); - - position_set_delayed_t* p = g_malloc0(sizeof(position_set_delayed_t)); - - p->zathura = zathura; - p->position_x = position_x; - p->position_y = position_y; - - gdk_threads_add_idle(position_set_delayed_impl, p); -} - bool position_set(zathura_t* zathura, double position_x, double position_y) { diff --git a/zathura.h b/zathura.h index a23f465..1a5dd0f 100644 --- a/zathura.h +++ b/zathura.h @@ -299,24 +299,6 @@ bool document_close(zathura_t* zathura, bool keep_monitor); */ bool page_set(zathura_t* zathura, unsigned int page_id); -/** - * Opens the page with the given number (delayed) - * - * @param zathura The zathura session - * @param page_id The id of the page that should be set - * @return If no error occured true, otherwise false, is returned. - */ -bool page_set_delayed(zathura_t* zathura, unsigned int page_id); - -/** - * Moves to the given position - * - * @param zathura Zathura session - * @param position_x X coordinate - * @param position_y Y coordinate - */ -void position_set_delayed(zathura_t* zathura, double position_x, double position_y); - /** * Moves to the given position * From 9367d646d9667a038fcedd8ffde47d385b9ef5eb Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 23:57:24 +0200 Subject: [PATCH 55/90] get rid of tracking adjustments They are not used anywere, and do not seem to become useful anymore in the light of the new separation of document and view. --- callbacks.c | 30 ------------------------------ callbacks.h | 25 +------------------------ zathura.c | 25 ++----------------------- zathura.h | 3 --- 4 files changed, 3 insertions(+), 80 deletions(-) diff --git a/callbacks.c b/callbacks.c index 9a5f816..cee7731 100644 --- a/callbacks.c +++ b/callbacks.c @@ -218,36 +218,6 @@ cb_refresh_view(GtkWidget* GIRARA_UNUSED(view), gpointer data) statusbar_page_number_update(zathura); } -void -cb_adjustment_track_value(GtkAdjustment* adjustment, gpointer data) -{ - GtkAdjustment* tracker = data; - - gdouble lower = gtk_adjustment_get_lower(adjustment); - gdouble upper = gtk_adjustment_get_upper(adjustment); - if (lower != gtk_adjustment_get_lower(tracker) || - upper != gtk_adjustment_get_upper(tracker)) { - return; - } - - gdouble value = gtk_adjustment_get_value(adjustment); - gtk_adjustment_set_value(tracker, value); -} - -void -cb_adjustment_track_bounds(GtkAdjustment* adjustment, gpointer data) -{ - GtkAdjustment* tracker = data; - gdouble value = gtk_adjustment_get_value(adjustment); - gdouble lower = gtk_adjustment_get_lower(adjustment); - gdouble upper = gtk_adjustment_get_upper(adjustment); - gdouble page_size = gtk_adjustment_get_page_size(adjustment); - gtk_adjustment_set_value(tracker, value); - gtk_adjustment_set_lower(tracker, lower); - gtk_adjustment_set_upper(tracker, upper); - gtk_adjustment_set_page_size(tracker, page_size); -} - void cb_page_layout_value_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data)) { diff --git a/callbacks.h b/callbacks.h index 9683f81..48cbf90 100644 --- a/callbacks.h +++ b/callbacks.h @@ -49,9 +49,7 @@ void cb_view_vadjustment_value_changed(GtkAdjustment *adjustment, gpointer data) * This function gets called when the bounds or the page_size of the horizontal * scrollbar change (e.g. when the zoom level is changed). * - * It adjusts the value of the horizontal scrollbar, possibly based on its - * previous adjustment, stored in the tracking adjustment - * zathura->ui.hadjustment. + * It adjusts the value of the horizontal scrollbar * * @param adjustment The horizontal adjustment of a gtkScrolledWindow * @param data The zathura instance @@ -81,27 +79,6 @@ void cb_view_vadjustment_changed(GtkAdjustment *adjustment, gpointer data); */ void cb_refresh_view(GtkWidget* view, gpointer data); -/* This function gets called when the value of the adjustment changes. - * - * It updates the value of the tracking adjustment, only if the bounds of the - * adjustment have not changed (if they did change, - * cb_adjustment_track_bounds() will take care of updating everything). - * - * @param adjustment The adjustment instance - * @param data The tracking adjustment instance - */ -void cb_adjustment_track_value(GtkAdjustment* adjustment, gpointer data); - -/* This function gets called when the bounds or the page_size of the adjustment - * change. - * - * It updates the value, bounds and page_size of the tracking adjustment. - * - * @param adjustment The adjustment instance - * @param data The tracking adjustment instance - */ -void cb_adjustment_track_bounds(GtkAdjustment* adjustment, gpointer data); - /** * This function gets called when the value of the "pages-per-row" * variable changes diff --git a/zathura.c b/zathura.c index e74cc51..c4e6aa3 100644 --- a/zathura.c +++ b/zathura.c @@ -160,37 +160,23 @@ zathura_init(zathura_t* zathura) g_signal_connect(G_OBJECT(zathura->ui.session->gtk.window), "size-allocate", G_CALLBACK(cb_view_resized), zathura); - /* Setup hadjustment tracker */ GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment( - GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - zathura->ui.hadjustment = zathura_adjustment_clone(hadjustment); - g_object_ref_sink(zathura->ui.hadjustment); + GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); /* Connect hadjustment signals */ g_signal_connect(G_OBJECT(hadjustment), "value-changed", G_CALLBACK(cb_view_hadjustment_value_changed), zathura); - g_signal_connect(G_OBJECT(hadjustment), "value-changed", - G_CALLBACK(cb_adjustment_track_value), zathura->ui.hadjustment); g_signal_connect(G_OBJECT(hadjustment), "changed", G_CALLBACK(cb_view_hadjustment_changed), zathura); - g_signal_connect(G_OBJECT(hadjustment), "changed", - G_CALLBACK(cb_adjustment_track_bounds), zathura->ui.hadjustment); - /* Setup vadjustment tracker */ GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment( - GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - zathura->ui.vadjustment = zathura_adjustment_clone(vadjustment); - g_object_ref_sink(zathura->ui.vadjustment); + GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); /* Connect vadjustment signals */ g_signal_connect(G_OBJECT(vadjustment), "value-changed", G_CALLBACK(cb_view_vadjustment_value_changed), zathura); - g_signal_connect(G_OBJECT(vadjustment), "value-changed", - G_CALLBACK(cb_adjustment_track_value), zathura->ui.vadjustment); g_signal_connect(G_OBJECT(vadjustment), "changed", G_CALLBACK(cb_view_vadjustment_changed), zathura); - g_signal_connect(G_OBJECT(vadjustment), "changed", - G_CALLBACK(cb_adjustment_track_bounds), zathura->ui.vadjustment); /* page view alignment */ zathura->ui.page_widget_alignment = gtk_alignment_new(0.5, 0.5, 0, 0); @@ -297,13 +283,6 @@ zathura_free(zathura_t* zathura) girara_session_destroy(zathura->ui.session); } - if (zathura->ui.hadjustment != NULL) { - g_object_unref(G_OBJECT(zathura->ui.hadjustment)); - } - if (zathura->ui.vadjustment != NULL) { - g_object_unref(G_OBJECT(zathura->ui.vadjustment)); - } - /* stdin support */ if (zathura->stdin_support.file != NULL) { g_unlink(zathura->stdin_support.file); diff --git a/zathura.h b/zathura.h index 1a5dd0f..113585e 100644 --- a/zathura.h +++ b/zathura.h @@ -69,9 +69,6 @@ struct zathura_s GtkWidget *page_widget_alignment; GtkWidget *page_widget; /**< Widget that contains all rendered pages */ GtkWidget *index; /**< Widget to show the index of the document */ - - GtkAdjustment *hadjustment; /**< Tracking hadjustment */ - GtkAdjustment *vadjustment; /**< Tracking vadjustment */ } ui; struct From 84736dc89bcd707a9073c708af85ddd17997a147 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sun, 20 Oct 2013 23:51:13 +0200 Subject: [PATCH 56/90] remove zathura->global.update_page_number global hack The callbacks are no longer aware of it anyways --- marks.c | 1 - shortcuts.c | 1 - zathura.c | 5 ----- zathura.h | 1 - 4 files changed, 8 deletions(-) diff --git a/marks.c b/marks.c index 614bb41..4cd294c 100644 --- a/marks.c +++ b/marks.c @@ -244,7 +244,6 @@ mark_evaluate(zathura_t* zathura, int key) position_set(zathura, mark->position_x, mark->position_y); zathura_jumplist_add(zathura); - zathura->global.update_page_number = true; return; } GIRARA_LIST_FOREACH_END(zathura->global.marks, zathura_mark_t*, iter, mark); diff --git a/shortcuts.c b/shortcuts.c index e7182d6..f50325e 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -305,7 +305,6 @@ sc_mouse_scroll(girara_session_t* session, girara_argument_t* argument, girara_e gtk_adjustment_get_value(x_adj) - (event->x - x)); zathura_adjustment_set_value(y_adj, gtk_adjustment_get_value(y_adj) - (event->y - y)); - zathura->global.update_page_number = true; break; /* unhandled events */ diff --git a/zathura.c b/zathura.c index c4e6aa3..b95ab75 100644 --- a/zathura.c +++ b/zathura.c @@ -55,7 +55,6 @@ zathura_create(void) zathura_t* zathura = g_malloc0(sizeof(zathura_t)); /* global settings */ - zathura->global.update_page_number = true; zathura->global.search_direction = FORWARD; /* plugins */ @@ -1115,10 +1114,6 @@ position_set(zathura_t* zathura, double position_x, double position_y) zathura_document_set_position_x(zathura->document, position_x); zathura_document_set_position_y(zathura->document, position_y); - /* prevent cb_view_adjustment_value_changed from updating document page number and - position from the adjustments. */ - zathura->global.update_page_number = false; - /* trigger a 'change' event for both adjustments */ refresh_view(zathura); diff --git a/zathura.h b/zathura.h index 113585e..4b198ed 100644 --- a/zathura.h +++ b/zathura.h @@ -101,7 +101,6 @@ struct zathura_s struct { - bool update_page_number; /**< Update current page number */ int search_direction; /**< Current search direction (FORWARD or BACKWARD) */ girara_list_t* marks; /**< Marker */ char** arguments; /**> Arguments that were passed at startup */ From e02806b6e230ef092eefb8f714bf654259bb1bd5 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 23 Oct 2013 19:51:31 +0200 Subject: [PATCH 57/90] get rid of the hide_inputbar hack We no longer need to hide the inputbar to get the right jump position, since now showing or hiding the inputbar does not change the position stored in the document object. Wen the adjustments get resized, the changed_callback resets the value from what is stored in the document object, effectively recentering the position to the middle of the viewport. --- zathura.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/zathura.c b/zathura.c index b95ab75..86f3f8e 100644 --- a/zathura.c +++ b/zathura.c @@ -1133,39 +1133,6 @@ refresh_view(zathura_t* zathura) { 0, zathura); } -static void -zathura_jumplist_hide_inputbar(zathura_t* zathura) -{ - g_return_if_fail(zathura != NULL && zathura->ui.session->gtk.inputbar != NULL); - - girara_argument_t arg = { GIRARA_HIDE, NULL }; - girara_isc_completion(zathura->ui.session, &arg, NULL, 0); - - if (zathura->ui.session->global.autohide_inputbar == true) { - /* XXX: This is a workaround for incremental-search. We should revisit this - * when we drop GTK+3 support and the inputbar is placed in a GtkOverlay - * widget. */ - char *input = gtk_editable_get_chars(GTK_EDITABLE(zathura->ui.session->gtk.inputbar_entry), 0, -1); - bool res = false; - - girara_setting_get(zathura->ui.session, "incremental-search", &res); - - if ((*input == '/' || *input == '?') && res == true) { - g_free(input); - - return; - } - /* */ - - gtk_widget_hide(zathura->ui.session->gtk.inputbar); - } - - /* we want to do it immediately */ - /* XXX: ... and we want this to go away */ - while (gtk_events_pending()) { - gtk_main_iteration(); - } -} bool adjust_view(zathura_t* zathura) { @@ -1329,7 +1296,6 @@ void zathura_jumplist_add(zathura_t* zathura) { g_return_if_fail(zathura != NULL && zathura->document != NULL && zathura->jumplist.list != NULL); - zathura_jumplist_hide_inputbar(zathura); unsigned int pagenum = zathura_document_get_current_page_number(zathura->document); double x = zathura_document_get_position_x(zathura->document); From 117a32c3d4074709ec98202278dddc1ffaeeaaee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= Date: Sat, 26 Oct 2013 18:11:55 +0200 Subject: [PATCH 58/90] pkg-config is not happy with --atleast-version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, It seems that pkg-config complains when using --atleast-version together with --cflags or --libs. I attach a patch. Abdó. From d01e128e7b4c2decb4d3a05e23b9b12cfda62879 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sat, 26 Oct 2013 16:51:39 +0200 Subject: [PATCH] pkg-config complains about --atleast-version pkg-config spits out Ignoring incompatible output option "--atleast-version" when using --atleast-version together with --cflags or --libs. Signed-off-by: Sebastian Ramacher --- config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index 07b9ab6..6c1cb8d 100644 --- a/config.mk +++ b/config.mk @@ -52,8 +52,8 @@ GTHREAD_LIB ?= $(shell pkg-config --libs gthread-2.0) GMODULE_INC ?= $(shell pkg-config --cflags gmodule-no-export-2.0) GMODULE_LIB ?= $(shell pkg-config --libs gmodule-no-export-2.0) -GLIB_INC ?= $(shell pkg-config --cflags --atleast-version=2.28 glib-2.0) -GLIB_LIB ?= $(shell pkg-config --libs --atleast-version=2.28 glib-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}) From 0c0c3b8903814b572978888e596a2c3386799de4 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 26 Oct 2013 19:02:55 +0200 Subject: [PATCH 59/90] Redo version checks and add check for GTK Signed-off-by: Sebastian Ramacher --- .gitignore | 2 +- Makefile | 20 ++++++++++++-------- README | 2 +- config.mk | 17 ++++++++++++++--- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index f357c42..851795d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ doc/ *.tmp zathura.1 zathurarc.5 -girara-version-check +.version-checks/ diff --git a/Makefile b/Makefile index 1769ff5..e1f4a54 100644 --- a/Makefile +++ b/Makefile @@ -42,11 +42,15 @@ DOBJECTS = $(patsubst %.c, %.do, $(SOURCE)) all: options ${PROJECT} po build-manpages -girara-version-check: -ifneq ($(GIRARA_VERSION_CHECK), 0) - $(error "The minimum required version of girara is ${GIRARA_MIN_VERSION}") -endif - $(QUIET)touch girara-version-check +# pkg-config based version checks +.version-checks/%: + $(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \ + pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \ + echo "The minium required version of $(*) is $($(*)_MIN_VERSION)" && \ + false \ + ) + @mkdir -p .version-checks + $(QUIET)touch $@ options: @echo ${PROJECT} build options: @@ -72,8 +76,8 @@ version.h: version.h.in config.mk @mkdir -p .depend $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep -${OBJECTS}: config.mk version.h girara-version-check -${DOBJECTS}: config.mk version.h girara-version-check +${OBJECTS} ${DOBJECTS}: config.mk version.h \ + .version-checks/GIRARA .version-checks/GLIB .version-checks/GTK ${PROJECT}: ${OBJECTS} $(ECHO) CC -o $@ @@ -83,7 +87,7 @@ clean: $(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \ ${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \ *gcda *gcno $(PROJECT).info gcov *.tmp \ - girara-version-check + .version-checks ifneq "$(wildcard ${RSTTOMAN})" "" $(QUIET)rm -f zathura.1 zathurarc.5 endif diff --git a/README b/README index d057887..1ce70ff 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ girara user interface library and several document libraries. Requirements ------------ -gtk2 (>= 2.28) +gtk2 (>= 2.18) glib (>= 2.28) girara sqlite3 (optional, >= 3.5.9) diff --git a/config.mk b/config.mk index 6c1cb8d..d7c255b 100644 --- a/config.mk +++ b/config.mk @@ -14,10 +14,21 @@ VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_RE # note: zathura with GTK+ 3 is broken! ZATHURA_GTK_VERSION ?= 2 -# minimum required zathura version -# If you want to disable the check, set GIRARA_VERSION_CHECK to 0. +# 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.6 -GIRARA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(GIRARA_MIN_VERSION) girara-gtk${ZATHURA_GTK_VERSION}; echo $$?) +GIRARA_PKG_CONFIG_NAME = girara-gtk$(ZATHURA_GTK_VERSION) +# 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 # database # To disable support for the sqlite backend set WITH_SQLITE to 0. From 459b8ba3fc715af79953c0f19d290a1694b1f0fb Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sat, 26 Oct 2013 19:36:42 +0200 Subject: [PATCH 60/90] after a set_scale we need a render_all Signed-off-by: Sebastian Ramacher --- links.c | 1 + 1 file changed, 1 insertion(+) diff --git a/links.c b/links.c index 929e678..fc99bb8 100644 --- a/links.c +++ b/links.c @@ -130,6 +130,7 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) if (link->target.destination_type != ZATHURA_LINK_DESTINATION_UNKNOWN) { if (link->target.scale != 0 && link_zoom) { zathura_document_set_scale(zathura->document, link->target.scale); + render_all(zathura); } /* get page */ From 5c49792cb820796371be3d3ab917832096a3a46f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 30 Oct 2013 03:27:10 +0100 Subject: [PATCH 61/90] CS Signed-off-by: Sebastian Ramacher --- links.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/links.c b/links.c index fc99bb8..987fa8a 100644 --- a/links.c +++ b/links.c @@ -140,8 +140,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) return; } - page_offset_t offset; - page_calculate_offset(zathura, page, &offset); + page_offset_t offset; + page_calculate_offset(zathura, page, &offset); if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ) { if (link->target.left != -1) { From e99be0fcce444fd256a76e0c8d977aa2b3c5e121 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 30 Oct 2013 03:29:45 +0100 Subject: [PATCH 62/90] CS Signed-off-by: Sebastian Ramacher --- config.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config.c b/config.c index 4a759d5..33c1419 100644 --- a/config.c +++ b/config.c @@ -128,21 +128,21 @@ config_load_default(zathura_t* zathura) girara_mode_set(gsession, zathura->modes.normal); /* zathura settings */ - girara_setting_add(gsession, "database", "plain", STRING, true, _("Database backend"), NULL, NULL); + girara_setting_add(gsession, "database", "plain", STRING, true, _("Database backend"), NULL, NULL); int_value = 10; - girara_setting_add(gsession, "zoom-step", &int_value, INT, false, _("Zoom step"), NULL, NULL); + girara_setting_add(gsession, "zoom-step", &int_value, INT, false, _("Zoom step"), NULL, NULL); int_value = 1; - girara_setting_add(gsession, "page-padding", &int_value, INT, false, _("Padding between pages"), cb_page_layout_value_changed, NULL); + girara_setting_add(gsession, "page-padding", &int_value, INT, false, _("Padding between pages"), cb_page_layout_value_changed, NULL); int_value = 1; - girara_setting_add(gsession, "pages-per-row", &int_value, INT, false, _("Number of pages per row"), cb_page_layout_value_changed, NULL); + girara_setting_add(gsession, "pages-per-row", &int_value, INT, false, _("Number of pages per row"), cb_page_layout_value_changed, NULL); int_value = 1; - girara_setting_add(gsession, "first-page-column", &int_value, INT, false, _("Column of the first page"),cb_page_layout_value_changed, NULL); + girara_setting_add(gsession, "first-page-column", &int_value, INT, false, _("Column of the first page"), cb_page_layout_value_changed, NULL); float_value = 40; - girara_setting_add(gsession, "scroll-step", &float_value, FLOAT, false, _("Scroll step"), NULL, NULL); + girara_setting_add(gsession, "scroll-step", &float_value, FLOAT, false, _("Scroll step"), NULL, NULL); float_value = 40; - girara_setting_add(gsession, "scroll-hstep", &float_value, FLOAT, false, _("Horizontal scroll step"), NULL, NULL); + girara_setting_add(gsession, "scroll-hstep", &float_value, FLOAT, false, _("Horizontal scroll step"), NULL, NULL); float_value = 0.0; - girara_setting_add(gsession, "scroll-full-overlap", &float_value, FLOAT, false, _("Full page scroll overlap"), NULL, NULL); + girara_setting_add(gsession, "scroll-full-overlap", &float_value, FLOAT, false, _("Full page scroll overlap"), NULL, NULL); int_value = 10; girara_setting_add(gsession, "zoom-min", &int_value, INT, false, _("Zoom minimum"), NULL, NULL); int_value = 1000; @@ -154,13 +154,13 @@ config_load_default(zathura_t* zathura) girara_setting_add(gsession, "recolor-darkcolor", "#FFFFFF", STRING, false, _("Recoloring (dark color)"), cb_color_change, NULL); girara_setting_add(gsession, "recolor-lightcolor", "#000000", STRING, false, _("Recoloring (light color)"), cb_color_change, NULL); - girara_setting_add(gsession, "highlight-color", NULL, STRING, false, _("Color for highlighting"), cb_color_change, NULL); + girara_setting_add(gsession, "highlight-color", NULL, STRING, false, _("Color for highlighting"), cb_color_change, NULL); girara_setting_set(gsession, "highlight-color", "#9FBC00"); - girara_setting_add(gsession, "highlight-active-color", NULL, STRING, false, _("Color for highlighting (active)"), cb_color_change, NULL); + girara_setting_add(gsession, "highlight-active-color", NULL, STRING, false, _("Color for highlighting (active)"), cb_color_change, NULL); girara_setting_set(gsession, "highlight-active-color", "#00BC00"); - girara_setting_add(gsession, "render-loading-bg", NULL, STRING, false, _("'Loading ...' background color"), cb_color_change, NULL); + girara_setting_add(gsession, "render-loading-bg", NULL, STRING, false, _("'Loading ...' background color"), cb_color_change, NULL); girara_setting_set(gsession, "render-loading-bg", "#FFFFFF"); - girara_setting_add(gsession, "render-loading-fg", NULL, STRING, false, _("'Loading ...' foreground color"), cb_color_change, NULL); + girara_setting_add(gsession, "render-loading-fg", NULL, STRING, false, _("'Loading ...' foreground color"), cb_color_change, NULL); girara_setting_set(gsession, "render-loading-fg", "#000000"); bool_value = false; From f10d847a95f007d43e392a1c418eb0a6168e33f5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 30 Oct 2013 03:35:56 +0100 Subject: [PATCH 63/90] CS Signed-off-by: Sebastian Ramacher --- commands.c | 3 ++- links.c | 9 ++++++--- shortcuts.c | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/commands.c b/commands.c index 900bfc3..9b2e798 100644 --- a/commands.c +++ b/commands.c @@ -119,8 +119,9 @@ cmd_bookmark_open(girara_session_t* session, girara_list_t* argument_list) zathura_jumplist_add(zathura); page_set(zathura, bookmark->page - 1); - if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN) + if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN) { position_set(zathura, bookmark->x, bookmark->y); + } zathura_jumplist_add(zathura); return true; diff --git a/links.c b/links.c index c221cc3..085fcaa 100644 --- a/links.c +++ b/links.c @@ -143,16 +143,19 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) /* compute the position with the page aligned to the top and left of the viewport */ - double pos_x=0, pos_y=0; + double pos_x = 0; + double pos_y = 0; page_number_to_position(zathura->document, link->target.page_number, 0.0, 0.0, &pos_x, &pos_y); /* correct to place the target position at the top of the viewport */ /* NOTE: link->target is in page units, needs to be scaled and rotated */ - unsigned int cell_height=0, cell_width=0; + 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, doc_width=0; + unsigned int doc_height = 0; + unsigned int doc_width = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); bool link_hadjust = true; diff --git a/shortcuts.c b/shortcuts.c index f50325e..3908167 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -916,16 +916,19 @@ sc_search(girara_session_t* session, girara_argument_t* argument, girara_setting_get(session, "search-hadjust", &search_hadjust); /* compute the position of the center of the page */ - double pos_x=0, pos_y=0; + double pos_x = 0; + double pos_y = 0; page_number_to_position(zathura->document, zathura_page_get_index(target_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, cell_width=0; + 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, doc_width=0; + unsigned int doc_height = 0; + 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; From 9f201f4a1ff60290e1978302f92c39c08bb97d39 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 30 Oct 2013 12:46:10 +0100 Subject: [PATCH 64/90] need to set the page number before the position In the case we want to automatically set the position by by passing -1 to position_set, we better tell it the page before. Signed-off-by: Sebastian Ramacher --- links.c | 1 + 1 file changed, 1 insertion(+) diff --git a/links.c b/links.c index 085fcaa..20915d9 100644 --- a/links.c +++ b/links.c @@ -184,6 +184,7 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) /* move to position */ zathura_jumplist_add(zathura); + zathura_document_set_current_page_number(zathura->document, link->target.page_number); position_set(zathura, pos_x, pos_y); zathura_jumplist_add(zathura); } From 7d7fe1d86452975f5f4a91f91a3f30edee59cfca Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 31 Oct 2013 05:37:44 +0100 Subject: [PATCH 65/90] Workaround printing quality issues Signed-off-by: Sebastian Ramacher --- print.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/print.c b/print.c index 8f0a39c..454512e 100644 --- a/print.c +++ b/print.c @@ -120,8 +120,9 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* const gdouble width = gtk_print_context_get_width(context); const gdouble height = gtk_print_context_get_height(context); - const double page_height = zathura_page_get_height(page); - const double page_width = zathura_page_get_width(page); + /* Render to a surface that is 5 times larger to workaround quality issues. */ + const double page_height = zathura_page_get_height(page) * 5; + const double page_width = zathura_page_get_width(page) * 5; cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height); if (surface == NULL) { gtk_print_operation_cancel(print_operation); @@ -143,7 +144,7 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* cairo_restore(temp_cairo); /* Render the page to the temporary surface */ - girara_debug("printing page %d ...", page_number); + girara_debug("printing page %d (fallback) ...", page_number); zathura_renderer_lock(zathura->sync.render_thread); err = zathura_page_render(page, temp_cairo, true); zathura_renderer_unlock(zathura->sync.render_thread); From 73e0754d58f1e20186d21ed9c2587c348c4293d5 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Thu, 31 Oct 2013 08:49:25 +0100 Subject: [PATCH 66/90] Resolve implicit declaration of render_all --- links.c | 1 + 1 file changed, 1 insertion(+) diff --git a/links.c b/links.c index 8db3b4b..33d56f1 100644 --- a/links.c +++ b/links.c @@ -12,6 +12,7 @@ #include "document.h" #include "utils.h" #include "page.h" +#include "render.h" struct zathura_link_s { zathura_rectangle_t position; /**< Position of the link */ From 3575157cb26e77fa483c0765aed65d4e210d853f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 31 Oct 2013 14:39:32 +0100 Subject: [PATCH 67/90] Connect the correct callback Signed-off-by: Sebastian Ramacher --- zathura.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zathura.c b/zathura.c index 86f3f8e..0c515b7 100644 --- a/zathura.c +++ b/zathura.c @@ -726,7 +726,7 @@ document_open(zathura_t* zathura, const char* path, const char* password, g_signal_connect(G_OBJECT(page_widget), "text-selected", G_CALLBACK(cb_page_widget_text_selected), zathura); g_signal_connect(G_OBJECT(page_widget), "image-selected", - G_CALLBACK(cb_page_widget_text_selected), zathura); + G_CALLBACK(cb_page_widget_image_selected), zathura); } /* view mode */ From 7b8f5d17cbb9b0c30f6568092c960cd7b11c3e25 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 31 Oct 2013 14:53:51 +0100 Subject: [PATCH 68/90] Implement image-selected event for GTK+3 Signed-off-by: Sebastian Ramacher --- page-widget.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/page-widget.c b/page-widget.c index 689580a..6f328bc 100644 --- a/page-widget.c +++ b/page-widget.c @@ -809,10 +809,6 @@ zathura_page_widget_popup_menu(GtkWidget* widget, GdkEventButton* event) g_return_if_fail(event != NULL); zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); -#if GTK_MAJOR_VERSION == 3 // FIXME - return; -#endif - if (priv->images.retrieved == false) { priv->images.list = zathura_page_images_get(priv->page, NULL); priv->images.retrieved = true; @@ -881,7 +877,6 @@ cb_zathura_page_widget_popup_menu(GtkWidget* widget) static void cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page) { -#if GTK_MAJOR_VERSION == 2 // FIXME g_return_if_fail(item != NULL); g_return_if_fail(page != NULL); zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(page); @@ -892,9 +887,10 @@ cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page) return; } - int width = cairo_image_surface_get_width(surface); - int height = cairo_image_surface_get_height(surface); + 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); @@ -904,13 +900,15 @@ cb_menu_image_copy(GtkMenuItem* item, ZathuraPage* page) 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); /* reset */ priv->images.current = NULL; -#endif } static void From 9e85c2f7c837852085112855497d41a30291357b Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Thu, 31 Oct 2013 16:43:44 +0100 Subject: [PATCH 69/90] Reduce the scope of val_list --- database-plain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/database-plain.c b/database-plain.c index 39033c1..0c5b938 100644 --- a/database-plain.c +++ b/database-plain.c @@ -394,14 +394,13 @@ plain_load_bookmarks(zathura_database_t* db, const char* file) return NULL; } - char **val_list = NULL; gsize num_vals = 0; for (gsize i = 0; i < num_keys; i++) { zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t)); - bookmark->id = g_strdup(keys[i]); - val_list = g_key_file_get_string_list(priv->bookmarks, name, keys[i], &num_vals, NULL); + bookmark->id = g_strdup(keys[i]); + char **val_list = g_key_file_get_string_list(priv->bookmarks, name, keys[i], &num_vals, NULL); bookmark->page = atoi(val_list[0]); From a85074614d95c532f3ba73d2d47db7723852d205 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 1 Nov 2013 14:01:49 +0100 Subject: [PATCH 70/90] Fix typo in cmd_info (Closes: #353) Thanks to tharvik for the patch. Signed-off-by: Sebastian Ramacher --- commands.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/commands.c b/commands.c index 9b2e798..128b590 100644 --- a/commands.c +++ b/commands.c @@ -159,14 +159,14 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list)) }; struct meta_field meta_fields[] = { - { "Title", ZATHURA_DOCUMENT_INFORMATION_TITLE }, - { "Author", ZATHURA_DOCUMENT_INFORMATION_AUTHOR }, - { "Subject", ZATHURA_DOCUMENT_INFORMATION_SUBJECT }, - { "Keywords", ZATHURA_DOCUMENT_INFORMATION_KEYWORDS }, - { "Creator", ZATHURA_DOCUMENT_INFORMATION_CREATOR }, - { "Producer", ZATHURA_DOCUMENT_INFORMATION_PRODUCER }, - { "Creation date", ZATHURA_DOCUMENT_INFORMATION_CREATION_DATE }, - { "Modiciation date", ZATHURA_DOCUMENT_INFORMATION_MODIFICATION_DATE } + { "Title", ZATHURA_DOCUMENT_INFORMATION_TITLE }, + { "Author", ZATHURA_DOCUMENT_INFORMATION_AUTHOR }, + { "Subject", ZATHURA_DOCUMENT_INFORMATION_SUBJECT }, + { "Keywords", ZATHURA_DOCUMENT_INFORMATION_KEYWORDS }, + { "Creator", ZATHURA_DOCUMENT_INFORMATION_CREATOR }, + { "Producer", ZATHURA_DOCUMENT_INFORMATION_PRODUCER }, + { "Creation date", ZATHURA_DOCUMENT_INFORMATION_CREATION_DATE }, + { "Modification date", ZATHURA_DOCUMENT_INFORMATION_MODIFICATION_DATE } }; girara_list_t* information = zathura_document_get_information(zathura->document, NULL); From a91108b07870318718fe01c2407b9cba745f394a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 1 Nov 2013 14:06:56 +0100 Subject: [PATCH 71/90] Translate fields in cmd_info Signed-off-by: Sebastian Ramacher --- commands.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/commands.c b/commands.c index 128b590..30709a7 100644 --- a/commands.c +++ b/commands.c @@ -158,15 +158,15 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list)) zathura_document_information_type_t field; }; - struct meta_field meta_fields[] = { - { "Title", ZATHURA_DOCUMENT_INFORMATION_TITLE }, - { "Author", ZATHURA_DOCUMENT_INFORMATION_AUTHOR }, - { "Subject", ZATHURA_DOCUMENT_INFORMATION_SUBJECT }, - { "Keywords", ZATHURA_DOCUMENT_INFORMATION_KEYWORDS }, - { "Creator", ZATHURA_DOCUMENT_INFORMATION_CREATOR }, - { "Producer", ZATHURA_DOCUMENT_INFORMATION_PRODUCER }, - { "Creation date", ZATHURA_DOCUMENT_INFORMATION_CREATION_DATE }, - { "Modification date", ZATHURA_DOCUMENT_INFORMATION_MODIFICATION_DATE } + const struct meta_field meta_fields[] = { + { _("Title"), ZATHURA_DOCUMENT_INFORMATION_TITLE }, + { _("Author"), ZATHURA_DOCUMENT_INFORMATION_AUTHOR }, + { _("Subject"), ZATHURA_DOCUMENT_INFORMATION_SUBJECT }, + { _("Keywords"), ZATHURA_DOCUMENT_INFORMATION_KEYWORDS }, + { _("Creator"), ZATHURA_DOCUMENT_INFORMATION_CREATOR }, + { _("Producer"), ZATHURA_DOCUMENT_INFORMATION_PRODUCER }, + { _("Creation date"), ZATHURA_DOCUMENT_INFORMATION_CREATION_DATE }, + { _("Modification date"), ZATHURA_DOCUMENT_INFORMATION_MODIFICATION_DATE } }; girara_list_t* information = zathura_document_get_information(zathura->document, NULL); From 0b5423081103b96f7c85d7685c81b147ffe14c51 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 1 Nov 2013 14:11:40 +0100 Subject: [PATCH 72/90] Run update-po for new translatable strings Signed-off-by: Sebastian Ramacher --- po/ca.po | 250 +++++++++++++++++++++++++++++--------------------- po/cs.po | 250 +++++++++++++++++++++++++++++--------------------- po/de.po | 260 ++++++++++++++++++++++++++++++---------------------- po/el.po | 250 +++++++++++++++++++++++++++++--------------------- po/eo.po | 250 +++++++++++++++++++++++++++++--------------------- po/es.po | 250 +++++++++++++++++++++++++++++--------------------- po/es_CL.po | 250 +++++++++++++++++++++++++++++--------------------- po/et.po | 250 +++++++++++++++++++++++++++++--------------------- po/fr.po | 250 +++++++++++++++++++++++++++++--------------------- po/he.po | 250 +++++++++++++++++++++++++++++--------------------- po/hr.po | 250 +++++++++++++++++++++++++++++--------------------- po/id_ID.po | 250 +++++++++++++++++++++++++++++--------------------- po/it.po | 250 +++++++++++++++++++++++++++++--------------------- po/pl.po | 250 +++++++++++++++++++++++++++++--------------------- po/pt_BR.po | 250 +++++++++++++++++++++++++++++--------------------- po/ru.po | 250 +++++++++++++++++++++++++++++--------------------- po/ta_IN.po | 250 +++++++++++++++++++++++++++++--------------------- po/tr.po | 250 +++++++++++++++++++++++++++++--------------------- po/uk_UA.po | 250 +++++++++++++++++++++++++++++--------------------- 19 files changed, 2760 insertions(+), 2000 deletions(-) diff --git a/po/ca.po b/po/ca.po index fec38b6..a8324f3 100644 --- a/po/ca.po +++ b/po/ca.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:33+0200\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Catalan (http://www.transifex.com/projects/p/zathura/language/" @@ -20,24 +20,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Entrada invàlida '%s'." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Índex invàlid '%s'." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "No s'ha obert cap document." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Nombre d'arguments invàlids." @@ -76,61 +81,93 @@ msgstr "No s'ha pogut esborrar el marcador: %s" msgid "No such bookmark: %s" msgstr "Marcador no existent: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Cap informació disponible." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Massa arguments." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Cap argument subministrat." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Document desat." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "No s'ha pogut desar el document." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Nombre d'arguments invàlids." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "No s'ha pogut escriure el fitxer adjunt '%s' a '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "S'ha escrit el fitxer adjunt '%s' a '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "S'ha escrit la imatge '%s' a '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "No s'ha pogut escriure la imatge '%s' a '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Imatge desconeguda '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Imatge o fitxer adjunt desconegut '%s'." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "L'argument ha de ser un nombre." @@ -149,326 +186,329 @@ msgid "Images" msgstr "Imatges" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Base de dades de rerefons" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Pas d'ampliació" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Separació entre pàgines" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Nombre de pàgines per fila" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Columna de la primera pàgina" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Pas de desplaçament" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Pas de desplaçament horitzontal" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "Superposició de pàgines completes de desplaçament" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Zoom mínim" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Zoom màxim" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "Nombre de posicions per recordar al jumplist" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Recolorejant (color fosc)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Recolorejant (color clar)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Color de realçament" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Color de realçament (activat)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Recolorejant les pàgines" -#: ../config.c:187 +#: ../config.c:169 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:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Desplaçament recollit" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "Desplaçament recollit" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Avançar nombre de pàgines per fila" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Zoom centrat horitzontalment" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Centra el resultat horitzontalment" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparència del realçat" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Renderitza 'Carregant ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Ajustar al fitxer quan s'obri" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Mostra els directoris i fitxers ocults" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Mostra els directoris" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Obrir sempre la primera pàgina" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Realça els resultats de recerca" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "Habilita la cerca incremental" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Esborra els resultats de recerca a l'interrompre" -#: ../config.c:218 +#: ../config.c:202 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:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Habilitar la compatibilitat amb synctex" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Afegir un marcador" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Esborrar un marcador" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Llista tots els marcadors" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Tancar el fitxer actual" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Mostra informació sobre el fitxer" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Executar una comanda" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Mostrar l'ajuda" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Obrir document" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Tancar Zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Imprimir document" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Desar document" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Desar document (i forçar la sobreescritura)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Desa els fitxers adjunts" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Assigna el desplaçament de pàgina" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Marca la posició actual dins el document" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Esborrar les marques especificades" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "No realcis els resultats de la recerca actual" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Realça els resultats de recerca actual" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Mostra informació sobre la versió" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "No s'ha pogut executar xdg-open." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "Enllaçar: pàgina %d" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "Enllaç: %s" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "Enllaç: Invàlid" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Reassigna a la finestra especificada per xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Ruta al directori de configuració" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Camí al directori de dades" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Camí al directori que conté els plugins" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Bifurca en segon pla" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Contrasenya del document" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Nivell de registre (depuració, informació, advertiments, errors)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Imprimeix informació sobre la versió" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Editor synctex (reenviat a l'ordre synctex)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Carregant..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Copiat el text seleccionat al porta-retalls: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Copia la imatge" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Desa imatge com a" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Aquest document no conté cap índex" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Sense nom]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/cs.po b/po/cs.po index 4e898ba..7afe47d 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:33+0200\n" "Last-Translator: Martin Pelikan \n" "Language-Team: pwmt.org \n" @@ -14,24 +14,29 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Neplatný vstup: %s" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Neplatný index: %s" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Není otevřený žádný dokument." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Špatný počet argumentů." @@ -70,61 +75,93 @@ msgstr "Nemůžu smazat záložku: %s" msgid "No such bookmark: %s" msgstr "Záložka neexistuje: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Nejsou dostupné žádné informace." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Příliš mnoho argumentů." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Nezadali jste argumenty." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Dokument uložen." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Nepovedlo se uložit dokument." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Špatný počet argumentů." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Nepovedlo se zapsat přílohu '%s' do '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Příloha '%s' zapsána do '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Obrázek '%s' zapsán do '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Nepovedlo se zapsat obrázek '%s' do '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Neznámý obrázek '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Neznámá příloha nebo obrázek '%s'." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Argumentem musí být číslo." @@ -143,326 +180,329 @@ msgid "Images" msgstr "Obrázky" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Databázový backend" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Zoom step" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Mezery mezi stránkami" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Počet stránek na řádek" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Scroll step" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Oddálit" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Přiblížit" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Přebarvuji do tmava" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Přebarvuji do světla" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Barva zvýrazňovače" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Barva zvýrazňovače (aktivní)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Přebarvit stránky" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Scrollovat přes konce" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Průhlednost při zvýrazňování" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Vypisovat 'Načítám ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Přiblížení po otevření souboru" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Zobrazovat skryté soubory" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Zobrazovat adresáře" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Vždy otevírat na první straně" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Zvýrazňovat výsledky hledání" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Při abortu smazat výsledky hledání" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Přidat záložku" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Smazat záložku" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Vypsat záložky" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Zavřít tenhle soubor" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Zobrazit informace o souboru" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Zobrazit nápovědu" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Otevřít dokument" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Zavřít zathuru" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Tisknout dokument" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Uložit dokument" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Uložit a přepsat dokument" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Uložit přílohy" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Označit současnou pozici v dokumentu" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Smazat vybrané značky" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Nezvýrazňovat výsledky tohoto hledání" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Zvýrazňovat výsledky tohoto hledání" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Nepovedlo se spustit xdg-open." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Cesta k souboru s nastavením" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Cesta k adresáři s daty" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Cesta k adresářům s pluginy" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Forknout se na pozadí" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Heslo" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Úroveň logování (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Zobrazit informace o souboru" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Načítám ..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Vybraný text zkopírován do schránky: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Zkopíruj obrázek" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Ulož obrázek jako" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Tenhle dokument neobsahuje žádné indexy" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Nepojmenovaný]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/de.po b/po/de.po index 4ad8166..b258c9d 100644 --- a/po/de.po +++ b/po/de.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-08-15 00:28+0200\n" -"PO-Revision-Date: 2013-08-15 00:37+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" +"PO-Revision-Date: 2013-11-01 14:11+0100\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: German (http://www.transifex.com/projects/p/zathura/language/" "de/)\n" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Ungültige Eingabe '%s' angegeben." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Ungültiger Index '%s' angegeben." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Kein Dokument geöffnet." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Ungültige Anzahl an Argumenten angegeben." @@ -74,61 +79,93 @@ msgstr "Konnte Lesezeichen nicht entfernen: %s" msgid "No such bookmark: %s" msgstr "Lesezeichen existiert nicht: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "Titel" + +#: ../commands.c:163 +msgid "Author" +msgstr "Autor" + +#: ../commands.c:164 +msgid "Subject" +msgstr "Betreff" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "Schlagwörter" + +#: ../commands.c:166 +msgid "Creator" +msgstr "Ersteller" + +#: ../commands.c:167 +msgid "Producer" +msgstr "Produzent" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "Erstellungsdatum" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "Modifikationsdatum" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Keine Information verfügbar." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Zu viele Argumente angegeben." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Keine Argumente angegeben." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Dokument gespeichert." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Konnte Dokument nicht speichern." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Ungültige Anzahl an Argumenten." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Konnte Anhang '%s' nicht nach '%s' schreiben." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Anhang '%s' nach '%s' geschrieben." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Anhang '%s' nach '%s' geschrieben." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Konnte Anhang '%s' nicht nach '%s' schreiben." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Unbekanntes Bild '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Unbekannter Anhanng oder Bild '%s'." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Das Argument ist keine Zahl." @@ -147,328 +184,331 @@ msgid "Images" msgstr "Bilder" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Datenbank Backend" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Vergrößerungsstufe" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Abstand zwischen den Seiten" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Anzahl der Seiten in einer Reihe" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Spalte der ersten Seite" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Schrittgröße beim Scrollen" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Horizontale Schrittgröße beim Scrollen" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Minimale Vergrößerungsstufe" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Maximale Vergrößerungsstufe" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Neufärben (Dunkle Farbe)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Neufärben (Helle Farbe)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Farbe für eine Markierung" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Farbe für die aktuelle Markierung" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" -msgstr "" +msgstr "Hintergrundfarbe von 'Lädt...'" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" -msgstr "" +msgstr "Vordergrundfarbe von 'Lädt...'" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Färbe die Seiten ein" -#: ../config.c:187 +#: ../config.c:169 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:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Scroll-Umbruch" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Gehe Anzahl der Seiten in einer Reihe weiter" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Horizontal zentrierter Zoom" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Zentriere Ergebnis horizontal" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparenz einer Markierung" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Zeige 'Lädt...'-Text beim Zeichnen einer Seite" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Seite einpassen" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Zeige versteckte Dateien und Ordner an" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Zeige Ordner an" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Öffne Dokument immer auf der ersten Seite" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Hebe Suchergebnisse hervor" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Lösche Suchergebnisse bei Abbruch" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "Verwende den Dateinamen der Datei im Fenstertitel" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "Verwende die Seitenzal im Fenstertitel" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "Verwende den Dateinamen der Datei in der Statusleiste" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Aktiviere SyncTeX-Unterstützung" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Füge Lesezeichen hinzu" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Lösche ein Lesezeichen" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Liste all Lesezeichen auf" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Schließe das aktuelle Dokument" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Zeige Dokumentinformationen an" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Führe einen Befehl aus" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Zeige Hilfe an" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Öffne Dokument" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Beende zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Drucke Dokument" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Speichere Dokument" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Speichere Dokument (und überschreibe bestehende)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Speichere Anhänge" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Setze den Seitenabstand" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Markiere aktuelle Position im Doukument" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Lösche angegebene Markierung" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Hebe aktuelle Suchergebnisse nicht hervor" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Hebe aktuelle Suchergebnisse hervor" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Zeige Versionsinformationen an" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Konnte xdg-open nicht ausführen." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "Verknüpfung: Seite %d" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "Verknüpfung: %s" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "Verknüpfung: ungültig" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Reparentiert zathura an das Fenster mit der xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Pfad zum Konfigurationsverzeichnis" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Pfad zum Datenverzeichnis" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Pfad zum Pluginverzeichnis" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Forkt den Prozess in den Hintergrund" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Dokument Passwort" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" -msgstr "" +msgstr "Seitenzahl zu der gewechselt werden soll" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Log-Stufe (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Zeige Versionsinformationen an" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Synctex Editor (wird an synctex weitergeleitet)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Lädt..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Der gewählte Text wurde in die Zwischenablage kopiert: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Bild kopieren" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Bild speichern als" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Dieses Dokument beinhaltet kein Inhaltsverzeichnis." -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Kein Name]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" +msgstr "Dateityp ist nicht unterstützt. Installiere das benötigete Plugin." -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "Dieses Dokument beinhaltet kein Seiten" diff --git a/po/el.po b/po/el.po index 6054066..157458b 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:34+0200\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Greek (http://www.transifex.com/projects/p/zathura/language/" @@ -19,24 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Η είσοδος '%s' είναι άκυρη." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Ο δείκτης '%s' είναι άκυρος." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Δεν άνοιξε κανένα αρχείο. " -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Μη έγκυρος αριθμός παραμέτρων." @@ -75,61 +80,93 @@ msgstr "Η διαγραφή του σελιδοδείκτη: %s απέτυχε. msgid "No such bookmark: %s" msgstr "Ο σελιδοδείκτης: %s δεν βρέθηκε. " -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Δεν υπάρχουν διαθέσιμες πληροφορίες." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Εισήχθησαν πολλές παράμετροι. " -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Δεν εισήχθησαν παράμετροι. " -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Το αρχείο αποθηκεύτηκε." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Η αποθήκευση του αρχείου απέτυχε. " -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Μη έγκυρος ο αριθμός των παραμέτρων. " -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Μη επιτυχής η εγγραγή της προσάρτησης '%s' στην '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Επιτυχής η εγγραφή της προσάρτησης '%s' στην '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Ενεγράφει η εικόνα '%s' στην '%s'" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Δεν ενεγράφει η εικόνα '%s' στην '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Άγνωστη εικόνα '%s'. " -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Άγνωστο προσάρτημα είτε εικόνα '%s'. " -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Η παράμετρος πρέπει να είναι αριθμός." @@ -148,329 +185,332 @@ msgid "Images" msgstr "Εικόνες" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Το βασικό εργαλείο της βάσης δεδομένων" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Βήμα μεγέθυνσης" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Διάκενο μεταξύ σελίδων" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Αριθμός σελίδων ανά γραμμή" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Στήλη της πρώτης σελίδας" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Βήμα κύλισης" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Βήμα οριζόντιας κύλησης" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Ελάχιστη μεγέθυνση" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Μέγιστη μεγέθυνση" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Επαναχρωματισμός (σκούρο χρώμα)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Επαναχρωματισμός (ανοικτό χρώμα)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Χρώμα τονισμού" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Χρώμα τονισμού (ενεργό)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Επαναχρωματισμός σελίδων" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" "Κατά τον επαναχρωματισμό της σελιδάς διατήρηση της αρχικής απόχρωσης και " "αλλαγή μόνο της φωτεινότητας" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Κυκλική κύληση" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Προώθηση σε αριθμό σελίδων ανά γραμμή" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Μεγένθηση οριζοντίως κεντραρισμένη" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Οριζόντιο κεντράρισμα αποτελεσμάτων" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Διαφάνεια για τονισμό" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Εμφάνιση της ένδειξης 'Φορτώνει ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Προσαρμογή κατά το άνοιγμα του αρχείου" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Εμφάνιση κρυφών αρχείων και φακέλων" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Εμφάνιση καταλόγων" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Άνοιγμα πάντα στην πρώτη σελίδα" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Τονισμός αποτελεσμάτων αναζήτησης" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Εκκαθάριση των απολεσμάτων αναζήτησης κατά την διακοπή" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "Χρήση του ονόματος του αρχείο στο τίτλο του παραθύρου" -#: ../config.c:220 +#: ../config.c:204 #, fuzzy msgid "Display the page number in the window title" msgstr "Χρήση του ονόματος του αρχείο στο τίτλο του παραθύρου" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Ενεργοποίηση υποστήριξης synctex" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Προσθήκη σελιδοδείκτη" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Διαγραφή σελιδοδείκτη" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Εμφάνιση όλων των σελιδοδεικτών" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Κλείσιμο αρχείου" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Προβολή πληροφοριών αρχείου" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Εκτέλεση εντολής" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Εμφάνιση βοήθειας" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Άνοιγμα αρχείου" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Κλείσιμο" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Εκτύπωση αρχείου" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Αποθήκευση αρχείου" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Αποθήκευση αρχείου (και αντικατάσταση)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Αποθήκευση προσαρτήσεων. " -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Ρύθμιση αντιστάθμισης σελίδας" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Επισήμανση τρέχουσας θέσης στο κείμενο" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Διαγραφή επιλεγμένων σημείων" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Χωρίς τονισμό τα τρέχοντα αποτελέσματα της αναζήτησης" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Τονισμός στα τρέχοντα αποτελέσματα της αναζήτησης" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Εμφάνιση πληροφοριών έκδοσης" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Απέτυχε η εκτέλεση του xdg-open. " -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Reparents to window specified by xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Διαδρομή του αρχείου ρυθμίσεων" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Διαδρομή του φακέλου δεδομένων" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Διαδρομή φακέλου που περιέχει τα πρόσθετα" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Διακλάδωση στο παρασκήνιο" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Κωδικός αρχείου" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Επίπεδο καταγραφής (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Εκτύπωση πληροφοριών έκδοσης" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Synctex editor (Προώθηση στην εντολή synctex)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Φορτώνει ..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Το επιλεγμένο κείμενο αποθηκεύτηκε στην μνήμη: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Αντιγραφή εικόνας" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Αποθήκευση εικόνας ως..." -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Το αρχείο δεν περιέχει κανένα δείκτη" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Χωρίς όνομα]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/eo.po b/po/eo.po index 1fa16a3..8787162 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:34+0200\n" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Nevalida enigo '%s' uzata." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Nevalida indekso '%s' uzata." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Neniu dokumento malfermita." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Nevalida nombro da argumentoj uzata." @@ -74,61 +79,93 @@ msgstr "Neeble forigi paĝosignon: %s" msgid "No such bookmark: %s" msgstr "Neniu paĝosigno: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Neniu informacio disponebla." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Tro multe da argumentoj." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Neniuj argumentoj uzata." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Dokumento konservita." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Neeble konservi dokumenton." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Nevalida nombro da argumentoj." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Neeble skribi kunsendaĵon '%s' en '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Skribis kunsendaĵon '%s' en '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Skribis kunsendaĵon '%s' en '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Neeble skribi kunsendaĵon '%s' en '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Nekonata bildo '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Argumento devas esti nombro." @@ -147,326 +184,329 @@ msgid "Images" msgstr "Bildoj" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Zompaŝo" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Interpaĝa plenigo" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Nombro da paĝoj po vico" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Rulumpaŝo" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Mimimuma zomo" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Maksimuma zomo" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Rekolorigo (malhela koloro)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Rekolorigo (hela koloro)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Koloro por fonlumo" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Koloro por fonlumo (aktiva)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Rekoloru paĝojn" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Ĉirkaŭflua rulumado" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Travidebleco por fonlumo" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Bildigu 'Ŝargado ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Adaptaĵo ĉe malfermo de dosiero" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Montru kaŝitajn dosierojn kaj -ujojn" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Montru dosierujojn" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Ĉiam malfermu ĉe unua paĝo" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Aldonu paĝosignon" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Forigu paĝosignon" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Listigu ĉiujn paĝosignojn" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Fermu nunan dosieron" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Montru dosiera informacio" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Montru helpon" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Malfermu dokumenton" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Fermu zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Presu dokumenton" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Konservu dokumenton" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Konservu dokumenton (deviga anstataŭo)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Konservu kunsendaĵojn" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Agordu paĝdelokado" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Fiaskis iro de xdg-open" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Vojo al la agorda dosierujo" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Vojo al la datuma dosierujo" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Vojoj al dosierujoj enhavantaj kromaĵojn" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Nivelo de ĵurnalo (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Montru dosiera informacio" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Ŝargado ..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Selektita teksto estas kopiita en la poŝo: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Kopiu bildon" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Savi bildojn kiel" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Ĉi-tiu dokumento enhavas neniam indekson." -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Neniu nomo]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/es.po b/po/es.po index d54c162..a174760 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:34+0200\n" "Last-Translator: Moritz Lipp \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" @@ -17,24 +17,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Entrada inválida: '%s'." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Índice invalido: '%s'." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Ningún documento abierto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Número de argumentos inválido." @@ -73,61 +78,93 @@ msgstr "Error al eliminar el favorito: %s" msgid "No such bookmark: %s" msgstr "No existe el favorito: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "No hay información disponible." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Demasiados argumentos." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Ningún argumento recibido." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Documento guardado." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Error al guardar el documento." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Número de argumentos inválido." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Escrito fichero adjunto '%s' a '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Escrito fichero adjunto '%s' a '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Imagen desconocida '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Adjunto o imagen desconocidos '%s'." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "El argumento ha de ser un número." @@ -146,329 +183,332 @@ msgid "Images" msgstr "Imágenes" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Base de datos" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Unidad de zoom" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Separación entre páginas" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Número de páginas por fila" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Columna de la primera página" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Paso de desplazamiento" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Paso de desplazamiento horizontal" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "Solapamiento del desplazamiento de página" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Zoom mínimo" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Zoom máximo" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "Número de posiciones a recordar en la lista de saltos" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Recoloreado (color oscuro)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Recoloreado (color claro)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Color para destacar" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Color para destacar (activo)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Recolorear páginas" -#: ../config.c:187 +#: ../config.c:169 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:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Navegación/Scroll cíclica/o" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Zoom centrado horizontalmente" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Centrar el resultado horizontalmente" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparencia para el destacado" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Renderizado 'Cargando ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Ajustarse al abrir un fichero" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Mostrar directorios y ficheros ocultos" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Mostrar directorios" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Abrir siempre la primera página" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Destacar los resultados de búsqueda" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "Habilitar la búsqueda incremental" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Borrar resultados de búsqueda al abortar" -#: ../config.c:218 +#: ../config.c:202 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:220 +#: ../config.c:204 #, fuzzy msgid "Display the page number in the window title" msgstr "Usar el nombre del archivo en el título de la ventana" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Habilitar soporte synctex" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Añadir Favorito" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Eliminar Favorito" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Listar favoritos" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Cerrar fichero actual" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Mostrar información del fichero" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Ejecutar un comando" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Mostrar ayuda" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Abrir documento" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Salir de zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Imprimir documento" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Guardar documento" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Guardar documento (y sobreescribir)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Guardar ficheros adjuntos" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Asignar el desplazamiento de página" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Marcar la posición actual en el documento" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Borrar las marcas especificadas" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "No destacar los resultados de la búsqueda actual" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Destacar los resultados de la búsqueda actual" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Mostrar versión" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Error al tratar de ejecutar xdg-open" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Reasignar a la ventana especificada por xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Ruta al directorio de configuración" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Ruta para el directorio de datos" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Ruta a los directorios que contienen los plugins" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Fork, ejecutándose en background" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Contraseña del documento" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Nivel de log (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Mostrar información del fichero" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Editor de Synctex (reenvíado al commando synctex)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Cargando ..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Se ha copiado el texto seleccionado al portapapeles: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Copiar imagen" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Salvar imagen como" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Este documento no contiene ningún índice" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Sin nombre]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/es_CL.po b/po/es_CL.po index a163d2f..3440009 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:34+0200\n" "Last-Translator: watsh1ken \n" "Language-Team: Spanish (Chile) (http://www.transifex.net/projects/p/zathura/" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Entrada inválida: '%s'." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Índice invalido: '%s'." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Ningún documento abierto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Número de argumentos inválido." @@ -74,61 +79,93 @@ msgstr "Error al eliminar marcador: %s" msgid "No such bookmark: %s" msgstr "No existe marcador: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "No hay información disponible." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Demasiados argumentos." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Ningún argumento recibido." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Documento guardado." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Error al guardar el documento." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Número de argumentos inválido." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Fichero adjunto escrito '%s' a '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Fichero adjunto escrito '%s' a '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "No se pudo escribir el fichero adjunto '%s' a '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "El argumento debe ser un número." @@ -147,326 +184,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Fin de la base de datos." -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Unidad de zoom" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Separación entre páginas" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Numero de páginas por fila" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Unidad de desplazamiento" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Zoom mínimo" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Zoom máximo" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Recolorando (color oscuro)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Recolorando (color claro)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Color para destacar" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Color para destacar (activo)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Recolorar páginas" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Scroll cíclico" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparencia para lo destacado" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Renderizando 'Cargando...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Ajustar al abrirse un archivo" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Mostrar archivos ocultos y directorios" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Mostrar directorios" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Siempre abrir en primera página" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Agregar un marcador" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Eliminar un marcador" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Listar todos los marcadores" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Cerrar archivo actual" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Mostrar información del archivo" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Mostrar ayuda" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Abrir documento" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Cerrar zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Imprimir documento" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Guardar documento" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Guardar documento (y forzar sobreescritura)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Guardar archivos adjuntos" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Asignar desplazamiento de la página" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Error al ejecutar xdg-open." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Reasignar a la ventana especificada por xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Ruta al directorio de configuración" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Ruta al directorio de datos" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Ruta al directorio que contiene plugins" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Ejecución en background" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Nivel de log (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Mostrar información del archivo" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Cargando..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Texto seleccionado copiado al portapapeles: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Copiar imagen" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Este document no contiene índice" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Sin nombre]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/et.po b/po/et.po index 6594aea..bda39ca 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2012-04-03 15:25+0000\n" "Last-Translator: Rivo Zängov \n" "Language-Team: Estonian (http://www.transifex.net/projects/p/zathura/" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "" @@ -74,61 +79,93 @@ msgstr "" msgid "No such bookmark: %s" msgstr "" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "" @@ -147,326 +184,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Esiletõstmise värv" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Esiletõstmise värv (aktiivne)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Näita kaustasid" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Ava alati esimene leht" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Lisa järjehoidja" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Kustuta järjehoidja" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Näita kõiki järjehoidjaid" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Sulge praegune fail" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Näita faili infot" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Näita abiinfot" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Ava dokument" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Sule zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Prindi dokument" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Salvesta dokument" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Salvesta manused" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Näita faili infot" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Kopeeri pilt" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Nime pole]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/fr.po b/po/fr.po index 8ca7846..10c34c8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:34+0200\n" "Last-Translator: Benoît Knecht \n" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" @@ -21,24 +21,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Entrée invalide : '%s'" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Index invalide : '%s'" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Aucun document ouvert." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Nombre d'arguments invalide." @@ -77,61 +82,93 @@ msgstr "Échec lors de la suppression du marque-page : %s" msgid "No such bookmark: %s" msgstr "Aucun marque-page correspondant : %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Aucune information disponible." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Trop d'arguments." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Aucun argument passé." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Document enregistré." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Échec lors de l'enregistrement du document." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Nombre d'arguments invalide." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Impossible d'écrire la pièce jointe '%s' dans '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Pièce jointe '%s' écrite dans '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Image '%s' écrite dans '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Impossible d'écrire l'image '%s' dans '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Image '%s' inconnue." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Pièce jointe ou image '%s' inconnue." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "L'argument doit être un nombre." @@ -150,330 +187,333 @@ msgid "Images" msgstr "Images" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Gestionnaire de base de données" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Incrément de zoom" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Espacement entre les pages" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Nombre de page par rangée" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Colonne de la première page" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Incrément de défilement" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Incrément de défilement horizontal" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "Recouvrement lors du défilement par page entière" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Zoom minimum" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Zoom maximum" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "Nombre de positions à mémoriser dans la liste de sauts" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Recoloration (couleur sombre)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Recoloration (couleur claire)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Couleur de surbrillance" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Couleur de surbrillance (active)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "Couleur d'arrière-plan de 'Chargement...'" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "Couleur de 'Chargement...'" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Recoloriser les pages" -#: ../config.c:187 +#: ../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é" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Défiler en boucle" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "Défilement tenant compte des limites de page" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Augmenter le nombre de pages par rangée" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Zoom centré horizontalement" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Centrer le résultat horizontalement" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparence de la surbrillance" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Afficher 'Chargement...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Ajuster à l'ouverture du fichier" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Montrer les fichiers et dossiers cachés" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Montrer les dossiers" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Toujours ouvrir à la première page" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Surligner les résultats de la recherche" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "Activer la recherche incrémentale" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Effacer les résultats de recherche en cas d'annulation" -#: ../config.c:218 +#: ../config.c:202 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:220 +#: ../config.c:204 #, fuzzy msgid "Display the page number in the window title" msgstr "Utiliser le nom de base du fichier dans le titre de la fenêtre" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "Utiliser le nom de base du fichier dans la barre d'état" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Activer la prise en charge de synctex" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Ajouter un marque-page" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Supprimer un marque-page" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Lister tous les marque-pages" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Fermer le fichier actuel" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Montrer les informations sur le fichier" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Exécuter une commande" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Afficher l'aide" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Ouvrir un document" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Quitter zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Imprimer le document" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Sauver le document" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Sauver le document (et forcer l'écrasement)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Enregistrer les pièces jointes" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Définir le décalage de page" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Marquer l'emplacement actuel dans le document" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Supprimer les marques indiquées" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Ne pas surligner les résultats de la recherche en cours" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Surligner les résultats de la recherche en cours" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Afficher les informations de version" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Échec lors du lancement de xdg-open." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "Lien : page %d" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "Lien : %s" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "Lien : Invalide" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Rattacher à la fenêtre spécifiée par xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Chemin vers le dossier de configuration" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Chemin vers le dossier de données" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Chemin vers le dossier de plugins" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Détacher en arrière-plan" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Mot de passe du document" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "Numéro de page où aller" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Niveau de journalisation (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Afficher les informations de version" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Éditeur synctex (transféré à la commande synctex)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Chargement..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Texte sélectionné copié dans le presse-papiers : %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Copier l'image" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Enregistrer l'image sous" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Ce document ne contient pas d'index" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Sans nom]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 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 8300235..8e5780d 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-01-13 14:12+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Hebrew (http://www.transifex.com/projects/p/zathura/language/" @@ -17,24 +17,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "" @@ -73,61 +78,93 @@ msgstr "" msgid "No such bookmark: %s" msgstr "" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "" @@ -146,326 +183,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/hr.po b/po/hr.po index ba9aec3..2e3ac61 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-01-13 14:12+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Croatian (http://www.transifex.com/projects/p/zathura/" @@ -18,24 +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:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "" @@ -74,61 +79,93 @@ msgstr "" msgid "No such bookmark: %s" msgstr "" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "" @@ -147,326 +184,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/id_ID.po b/po/id_ID.po index f8b11f6..2c44b08 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:34+0200\n" "Last-Translator: andjeng \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Masukan '%s' tidak valid" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Index '%s' tidak valid" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Tidak ada dokumen yang terbuka." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "jumlah argumen yang diberikan tidak valid" @@ -74,61 +79,93 @@ msgstr "Gagal menghapus bookmark: %s" msgid "No such bookmark: %s" msgstr "Tidak ada bookmark: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Tidak ada informasi tersedia" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Argumen terlalu banyak" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Tidak ada argumen yang diberikan" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Dokumen telah disimpan" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Gagal menyimpan dokumen" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Jumlah argumen tidak valid" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Tidak dapat menulis lampiran '%s' ke '%s'" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Tidak dapat menyimpan lampiran '%s' ke '%s'" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Menulis citra dari '%s' ke '%s'" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Tidak dapat menulis citra '%s' ke %s'" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Citra tidak diketahui '%s'" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Lampiran atau gambar tidak diketahui '%s'" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Argumen harus berupa angka." @@ -147,326 +184,329 @@ msgid "Images" msgstr "Citra" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Tingkat pembesaran" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Selisih antar halaman" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Jumlah halaman tiap kolom" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Kolom pada halaman pertama" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Tingkat menggulung" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Tingkat penggulungan horisontal" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Pembesaran minimum" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Pembesaran maksimal" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "Jumlah posisi yang diingat pada jumplist" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Mewarnai ulang (warna gelap)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Mewarnai ulang (warna cerah)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Warna sorotan" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Warna sorotan (aktif)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Mewarnai ulang halaman" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "Ketika mewarnai ulang, jaga hue dan sesuaikan kecerahan saja" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "Penggulungan sadar halaman" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Jumlah halaman per baris \"lanjutan\"" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Pembesaran horisontal tengah" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Tengah-horisontalkan hasil" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparansi sorotan" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Memuat Render..." -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Menyesuaikan ketika membuka file" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Perlihatkan file dan direktori tersembunyi" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Perlihatkan direktori" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Selalu buka halaman pertama" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Sorot hasil pencarian" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "Fungsikan pencarian berkelanjutan" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Hapus hasil pencarian ketika batal mencari" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "Gunakan nama dasar file pada judul jendela" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Support synctex" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Tambahkan pada bookmark" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Hapus bookmark" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Perlihatkan semua bookmark" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Tutup file ini" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Informasi file" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Jalankan perintah" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Bantuan" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Buka dokumen" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Tutup zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Cetak dokumen" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Simpan dokumen" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Simpan dokumen (dan menimpa berkas)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Simpan lampiran" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Set offset halaman" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Tandai lokasi sekarang dalam dokumen" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Hapus tanda terpilih" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Jangan menyorot hasil cari sekarang" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Tunjukan informasi versi" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Gagal menjalankan program xdg-open" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "Link: halaman %d" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "Link: %s" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "Link: Tidak valid" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Mengembalikan jendela sesuai dengan xid yang ditentukan" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Path ke direktori konfigurasi" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Path ke direktori data" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Path ke direktori plugin" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Jalankan pada latar" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Kata sandi dokumen" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Tingkat log (debug, info, peringatan, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Cetak informasi versi" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Synctex editor (diteruskan ke perintah synctex)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Memuat....." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Menyalin teks terpilih ke papan semat: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Salin gambar" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Simpan gambar sebagai" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Dokumen ini tidak mempunyai indeks" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Tidak berjudul]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/it.po b/po/it.po index 59e848a..3471550 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:35+0200\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Italian (http://www.transifex.com/projects/p/zathura/language/" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Input inserito '%s' non valido." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Indice inserito '%s' non valido." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Nessun documento aperto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Numero di argomenti errato." @@ -74,61 +79,93 @@ msgstr "Impossibile rimuovere il segnalibro:%s" msgid "No such bookmark: %s" msgstr "Nessun segnalibro corrispondente:%s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Nessun' informazione disponibile." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Numero di argomenti eccessivo." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Nessun argomento specificato." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Documento salvato." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Impossibile salvare il documento." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Numero di argomenti non valido." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Impossibile salvare l' allegato '%s' in '%s'" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Allegato '%s' salvato in '%s'" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "L' argomento dev' essere un numero." @@ -147,326 +184,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Backend del database" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Spaziatura tra le pagine" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Numero di pagine per riga" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Zoom minimo" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Zoom massimo" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Ricolora le pagine" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Scrolling continuo" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Mostra file e cartelle nascosti" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Mostra cartelle" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Apri sempre alla prima pagina" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Aggiungi un segnalibro" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Elimina un segnalibro" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Mostra i segnalibri" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Chiudi il file corrente" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Mostra le informazioni sul file" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Mostra l' aiuto" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Apri un documento" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Chiudi zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Stampa il documento" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Salva il documento" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Salva il documento (e sovrascrivi)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Salva allegati" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Imposta l' offset della pagina" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Impossibile eseguire xdg-open." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Percorso della directory della configurazione" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Percorso della directory dei dati" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Percorso della directory contenente i plugin" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Crea un processo separato" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Livello di log (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Mostra le informazioni sul file" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "La selezione è stato copiata negli appunti:%s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Copia immagine" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Questo documento non contiene l' indice" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Nessun nome]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/pl.po b/po/pl.po index fe35cc7..8ba8891 100644 --- a/po/pl.po +++ b/po/pl.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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:35+0200\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" @@ -19,24 +19,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:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Nieprawidłowy argument: %s" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Nieprawidłowy indeks: %s" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Nie otwarto żadnego pliku" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Nieprawidłowa liczba parametrów polecenia" @@ -75,61 +80,93 @@ msgstr "Nie można usunąć zakładki: %s" msgid "No such bookmark: %s" msgstr "Nie znaleziono zakładki: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Brak informacji o pliku" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Za dużo parametrów polecenia" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Nie podano parametrów polecenia" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Zapisano dokument" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Błąd zapisu" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Niewłaściwa liczba parametrów polecenia" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Nie można dodać załącznika %s do pliku %s" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Zapisano załącznik %s do pliku %s" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Zapisano obrazek %s do pliku %s" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Nie można dodać obrazka %s do pliku %s" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Nieznany obrazek '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Nieznany załącznik lub obrazek '%s'." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Parametr polecenia musi być liczbą" @@ -148,326 +185,329 @@ msgid "Images" msgstr "Obrazki" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Baza danych" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Skok powiększenia" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Odstęp pomiędzy stronami" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Liczba stron w wierszu" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Skok przewijania" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Minimalne powiększenie" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Maksymalne powiększenie" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Ciemny kolor negatywu" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Jasny kolor negatywu" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Kolor wyróżnienia" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Kolor wyróżnienia bieżącego elementu" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Negatyw" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Zawijanie dokumentu" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Liczba stron w wierszu" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Przezroczystość wyróżnienia" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Wyświetlaj: „Wczytywanie pliku...”" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Dopasowanie widoku pliku" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Wyświetl ukryte pliki i katalogi" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Wyświetl katalogi" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Zawsze otwieraj na pierwszej stronie" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Podświetl wyniki wyszukiwania" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Wyczyść wyniki wyszukiwania po przerwaniu" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Dodaj zakładkę" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Usuń zakładkę" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Wyświetl zakładki" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Zamknij plik" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Wyświetl informacje o pliku" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Wyświetl pomoc" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Otwórz plik" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Zakończ" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Wydrukuj" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Zapisz" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Zapisz (nadpisując istniejący plik)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Zapisz załączniki" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Ustaw przesunięcie numerów stron" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Zaznacz aktualną pozycję w dokumencie" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Skasuj określone zakładki" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Nie podświetlaj aktualnych wyników wyszukiwania " -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Podświetl aktualne wyniki wyszukiwania" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Wyświetl informacje o wersji" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Wystąpił problem z uruchomieniem xdg-open" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Przypisz proces do rodzica o danym xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Ścieżka do katalogu konfiguracyjnego" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Ścieżka do katalogu danych" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Ścieżka do katalogu wtyczek" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Forkuj w tle" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Hasło dokumentu" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Szczegółowość komunikatów (debug, info, warning, error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Wyświetl informacje o wersji" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Wczytywanie pliku..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Zaznaczony tekst skopiowano do schowka: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Skopiuj obrazek" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Zapisz obrazek jako" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Dokument nie zawiera indeksu" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[bez nazwy]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 5e678ef..aa68f84 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:35+0200\n" "Last-Translator: salmora8 \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" @@ -19,24 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Dados de entrada inválida '%s' ." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Dados de índice invalido '%s'." -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Nenhum documento aberto." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Número de argumentos dados inválidos." @@ -75,61 +80,93 @@ msgstr "Falha ao remover favorito: %s" msgid "No such bookmark: %s" msgstr "Não há favoritos: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Nenhuma informação disponível." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Muitos argumentos." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Nenhum argumento dado." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Documento salvo." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Falha ao salvar o documento." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Número de argumento invalido." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Não foi possível gravar anexo '%s' para '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Escreveu anexo '%s' para '%s'." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "Escreveu imagem '%s' para '%s'." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "Não foi possível gravar imagem '%s' para '%s'." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Imagem desconhecida '%s'." -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Anexo desconhecido ou imagem '%s'." -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "O argumento deve ser um número." @@ -148,327 +185,330 @@ msgid "Images" msgstr "Imagens" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Fim da base de dados" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Grau de Zoom" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Preenchimento entre páginas" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Número de paginas por linha" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "Coluna da primeira página" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Fase de Rolagem" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Etapa de rolagem horizontal" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "Sobreposição de rolagem de página inteira" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Zoom minimo" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Zoom máximo" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "Número máximo de páginas para manter no cache" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "Numero de posições para lembrar na lista de salto" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Recolorindo (cor escura)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Recolorindo (cor clara)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Cor para destacar" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Cor para destacar (ativo)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "'Carregando ...' cor de fundo" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "'Carregando ...' cor de primeiro plano" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Recolorir páginas" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" "Quando recolorir, manter tonalidade original e ajustar somente a luminosidade" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Rolagem envoltório" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "Rolagem de página consciente" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Numero de avanço de paginas por linha" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Zoom centrado horizontalmente" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "Alinhe destino do link à esquerda" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "Resultado centrado horizontalmente" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Transparência para destacar" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Renderizando 'Carregando...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Ajuste para quando abrir o arquivo" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Mostrar arquivos ocultos e diretórios" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Mostrar diretórios" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Sempre abrir na primeira página" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Destaque resultados de busca" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "Ativar pesquisa incremental" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Limpar resultados de busca ou abortar" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "Usar nome do arquivo na barra de titulo" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "Use o nome do arquivo na barra de status" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "Ativar suporte synctex" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Adicionar um favorito" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Deletar um favorito" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Listar todos favoritos" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Fechar arquivo atual" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Mostrar informações do arquivo" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Executar um comando" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Mostrar ajuda" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Abrir documento" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Fechar zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Imprimir documento" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Salvar documento" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Salvar documento (e forçar sobrescrever)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Salvar anexos" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Definir deslocamento da página" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Marcar localização atual no documento" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Apagar as marcas especificadas" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Não destacar resultados de busca atual" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Destacar resultado de busca atual" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Mostrar informações sobre a versão" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Falha ao executar xdg-open." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "Link: página %d" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "Link: %s" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "Link: Inválido" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Reparar a janela especificada por xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Caminho de diretório para configuração" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Caminho para diretório de dados" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Caminho de diretório que contenham plugins" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Deslocar no fundo" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Senha do documento" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "Número da página para ir" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Nível de log (depurar, informação, aviso, erro)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Imprimir informações sobre a versão" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "Editor synctex (encaminhado para o comando synctex)" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Carregando..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Texto selecionado copiado para área de transferência: %s " - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Copiar imagem" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Salvar imagem para" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Este documento não contem qualquer índice" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Sem nome]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 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 69498fe..e1451b4 100644 --- a/po/ru.po +++ b/po/ru.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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:35+0200\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" @@ -19,24 +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:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Неправильный ввод: %s" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Получен неверный индекс %s" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Документ не открыт" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Неверное число аргументов" @@ -75,61 +80,93 @@ msgstr "Не удалось удалить закладку %s" msgid "No such bookmark: %s" msgstr "Закладки %s не существует" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Нет доступной информации" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Слишком много аргументов" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Отсутствуют аргументы" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Документ сохранён" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Не удалось сохранить документ" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Неверное количество аргументов" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Не могу сохранить приложенный файл %s в %s" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Файл %s сохранён в %s" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Аргумент должен быть числом" @@ -148,326 +185,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Бэкэнд базы данных" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Шаг увеличения" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Разрыв между страницами" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Количество страниц в ряд" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Шаг прокрутки" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Минимальное увеличение" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Максимальное увеличение" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Перекрашивание (тёмные тона)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Перекрашивание (светлые тона)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Цвет для подсветки" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Цвет для подсветки (активной)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Перекрасить страницы" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Плавная прокрутка" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Увеличить количество страниц в ряду" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Прозрачность подсветки" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Рендер 'Загружается ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Показывать скрытые файлы и директории" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Показывать директории" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Всегда открывать на первой странице" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Добавить закладку" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Удалить закладку" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Показать все закладки" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Закрыть текущий файл" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Показать информацию о файле" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Помощь" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Открыть документ" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Выход" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Печать" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Сохранить документ" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Сохранить документ (с перезапиьсю)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Сохранить прикреплённые файлы" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Сохранить смещение страницы" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Пометить текущую позицию в документе" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Удалить указанные пометки" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Не удалось запустить xdg-open" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Сменить материнское окно на окно, указанное в xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Путь к директории конфига" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Путь к директории с данными" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Путь к директории с плагинами" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Уйти в бэкграунд" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Уровень логирования (debug,info,warning,error)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Показать информацию о файле" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Выделенный текст скопирован в буфер: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Скопировать изображение" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "В документе нету индекса" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[No name]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/ta_IN.po b/po/ta_IN.po index 50b4452..3c8aae5 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:35+0200\n" "Last-Translator: mankand007 \n" "Language-Team: Tamil (India) (http://www.transifex.net/projects/p/zathura/" @@ -18,24 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "கொடுக்கப்பட்ட உள்ளீடு(input) '%s' தவறு" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "கொடுக்கப்பட்ட index '%s' தவறு" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "எந்தக் ஆவணமும் திறக்கப்படவில்லை" -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "கொடுக்கப்பட்ட arguments-களின் எண்ணிக்கை தவறு" @@ -74,61 +79,93 @@ msgstr "Bookmark-ஐ அழிக்க இயலவில்லை: %s" msgid "No such bookmark: %s" msgstr "அந்தப் பெயரில் எந்த bookmark-ம் இல்லை: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "எந்தத் தகவலும் இல்லை" -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Argumentகளின் எண்ணிக்கை மிகவும் அதிகம்" -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "எந்த argument-ம் தரப்படவில்லை" -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "கோப்பு சேமிக்கப்பட்டது" -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "ஆவணத்தை சேமிக்க இயலவில்லை" -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "கொடுக்கப்பட்ட argument-களின் எண்ணிக்கை தவறு" -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "" -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "" -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Argument ஒரு எண்ணாக இருக்க வேண்டும்" @@ -147,326 +184,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Zoom அமைப்பு" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "இரு பக்கங்களுக்கிடையில் உள்ள நிரப்பல்(padding)" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "ஒரு வரிசையில் எத்தனை பக்கங்களைக் காட்ட வேண்டும்" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "திரை உருளல்(scroll) அளவு" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "முடிந்தவரை சிறியதாகக் காட்டு" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "முடிந்தவரை பெரிதாகக் காட்டு" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "புதிய bookmark உருவாக்கு" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Bookmark-ஐ அழித்துவிடு" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "அனைத்து bookmark-களையும் பட்டியலிடு" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "ஆவணம் பற்றிய தகவல்களைக் காட்டு" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "உதவியைக் காட்டு" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "ஒரு ஆவணத்தைத் திற" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "zathura-வை விட்டு வெளியேறு" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "ஆவணத்தை அச்சிடு" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "ஆவணத்தை சேமிக்கவும்" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "இணைப்புகளைச் சேமிக்கவும்" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "xdg-open-ஐ இயக்க முடியவில்லை" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "ஆவணம் பற்றிய தகவல்களைக் காட்டு" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "படத்தை ஒரு பிரதியெடு" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "இந்த ஆவணத்தில் எந்த index-ம் இல்லை" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "பெயரற்ற ஆவணம்" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/tr.po b/po/tr.po index 4eea9f8..5b7d06f 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:36+0200\n" "Last-Translator: hsngrms \n" "Language-Team: Turkish (http://www.transifex.net/projects/p/zathura/language/" @@ -19,24 +19,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../callbacks.c:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Hatalı girdi '%s'" -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Hatalı dizin '%s'" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Açık belge yok." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Yanlış sayıda argüman" @@ -75,61 +80,93 @@ msgstr "Yer imi silinemedi: %s" msgid "No such bookmark: %s" msgstr "Böyle bir yer imi yok: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Bilgi mevcut değil." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Çok fazla sayıda argüman." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Argüman verilmedi." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Belge kaydedildi." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Belge kaydedilemedi." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Yanlış sayıda argüman." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazılamadı." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazıldı." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazıldı." -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "'%s' eki '%s' konumuna yazılamadı." -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "Tanınmayan resim dosyası '%s'" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "Tanınmayan eklenti veya resim dosyası '%s'" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Argüman bir sayı olmalı." @@ -148,326 +185,329 @@ msgid "Images" msgstr "Resimler" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Veritabanı arkayüzü" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Yakınlaşma/uzaklaşma aralığı" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Sayfalar arasındaki boşluk" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Satır başına sayfa sayısı" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "İlk sayfanın sütunu" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Kaydırma aralığı" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "Yatay kaydırma adımı" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "Tam ekran kaydırma kaplaması" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "En fazla uzaklaşma" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "En fazla yakınlaşma" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "Atlama listesinde hatırlanacak pozisyon sayısı" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Renk değişimi (koyu renk)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Renk değişimi (açık renk)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "İşaretleme rengi" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "İşaretleme rengi (etkin)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Sayga rengini değiştir" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "Yeniden renklendirirken renk değerini tut ve sadece parlaklığı ayarla" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Kaydırmayı sarmala" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "Satır başına sayfa sayısı" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "Yatay olarak ortalanmış büyütme" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Ön plana çıkarmak için saydamlaştır" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "'Yüklüyor ...' yazısını göster" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Dosya açarken ayarla" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Gizli dosyaları ve dizinleri göster" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Dizinleri göster" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Her zaman ilk sayfayı aç" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "Arama sonuçlarını vurgula" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "Artımlı aramayı etkinleştir" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "Kapatınca arama sonuçlarını temizle" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "Pencere başlığı olarak dosyanın adını kullan" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Yer imi ekle" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Yer imi sil" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Yer imlerini listele" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Geçerli dosyayı kapat" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Dosya bilgisi göster" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "Bir komut çalıştır" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Yardım bilgisi göster" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Belge aç" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Zathura'yı kapat" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Belge yazdır" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Belgeyi kaydet" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Belgeyi kaydet (ve sormadan üzerine yaz)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Ekleri kaydet" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Sayfa derinliğini ayarla" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "Bu belgede bu konumu işaretle" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "Seçilen işaretlemeleri sil" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "Şuanki arama sonuçlarını vurgulama" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "Şuanki arama sonuçlarını vurgula" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "Versiyon bilgisi göster" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "xdg-open çalıştırılamadı" -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Xid tarafından belirlendiği gibi bir üst seviye pencereye bağlı" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Ayar dizini adresi" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Veri dizini adresi" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Eklentileri içeren dizinin adresi" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Arka planda işlemden çocuk oluştur" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "Belge şifresi" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Kayıt seviyesi (hata ayıklama, bilgi, uyarı, hata)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Dosya bilgisi göster" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "Yüklüyor ..." -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Seçili metin panoya kopyalandı: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Resim kopyala" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "Resmi farklı kaydet" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Bu belge fihrist içermiyor" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[İsimsiz]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" diff --git a/po/uk_UA.po b/po/uk_UA.po index 4c026e0..99d04ed 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-08-15 00:28+0200\n" +"POT-Creation-Date: 2013-11-01 14:05+0100\n" "PO-Revision-Date: 2013-08-15 00:36+0200\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" @@ -19,24 +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:314 +#: ../callbacks.c:297 #, c-format msgid "Invalid input '%s' given." msgstr "Вказано невірний аргумент: %s." -#: ../callbacks.c:350 +#: ../callbacks.c:333 #, c-format msgid "Invalid index '%s' given." msgstr "Вказано невірний індекс: %s" -#: ../commands.c:36 ../commands.c:76 ../commands.c:103 ../commands.c:158 -#: ../commands.c:274 ../commands.c:304 ../commands.c:330 ../commands.c:425 -#: ../commands.c:546 ../shortcuts.c:485 ../shortcuts.c:1251 -#: ../shortcuts.c:1280 +#: ../callbacks.c:546 +#, 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 msgid "No document opened." msgstr "Документ не відкрито." -#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:430 +#: ../commands.c:42 ../commands.c:82 ../commands.c:109 ../commands.c:424 msgid "Invalid number of arguments given." msgstr "Вказана невірна кількість аргументів." @@ -75,61 +80,93 @@ msgstr "Видалення закладки невдалося: %s" msgid "No such bookmark: %s" msgstr "Такої закладки немає: %s" -#: ../commands.c:180 ../commands.c:202 +#: ../commands.c:162 +msgid "Title" +msgstr "" + +#: ../commands.c:163 +msgid "Author" +msgstr "" + +#: ../commands.c:164 +msgid "Subject" +msgstr "" + +#: ../commands.c:165 +msgid "Keywords" +msgstr "" + +#: ../commands.c:166 +msgid "Creator" +msgstr "" + +#: ../commands.c:167 +msgid "Producer" +msgstr "" + +#: ../commands.c:168 +msgid "Creation date" +msgstr "" + +#: ../commands.c:169 +msgid "Modification date" +msgstr "" + +#: ../commands.c:174 ../commands.c:196 msgid "No information available." msgstr "Інформація недоступна." -#: ../commands.c:240 +#: ../commands.c:234 msgid "Too many arguments." msgstr "Забагато аргументів." -#: ../commands.c:251 +#: ../commands.c:245 msgid "No arguments given." msgstr "Жодного аргументу не вказано." -#: ../commands.c:310 ../commands.c:336 +#: ../commands.c:304 ../commands.c:330 msgid "Document saved." msgstr "Документ збережено." -#: ../commands.c:312 ../commands.c:338 +#: ../commands.c:306 ../commands.c:332 msgid "Failed to save document." msgstr "Документ не вдалося зберегти." -#: ../commands.c:315 ../commands.c:341 +#: ../commands.c:309 ../commands.c:335 msgid "Invalid number of arguments." msgstr "Невірна кількість аргументів." -#: ../commands.c:449 +#: ../commands.c:443 #, c-format msgid "Couldn't write attachment '%s' to '%s'." msgstr "Неможливо записати прикріплення '%s' до '%s'." -#: ../commands.c:451 +#: ../commands.c:445 #, c-format msgid "Wrote attachment '%s' to '%s'." msgstr "Прикріплення записано %s до %s." -#: ../commands.c:495 +#: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." msgstr "" -#: ../commands.c:497 +#: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." msgstr "" -#: ../commands.c:504 +#: ../commands.c:498 #, c-format msgid "Unknown image '%s'." msgstr "" -#: ../commands.c:508 +#: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." msgstr "" -#: ../commands.c:559 +#: ../commands.c:553 msgid "Argument must be a number." msgstr "Аргумент повинен бути цифрою." @@ -148,326 +185,329 @@ msgid "Images" msgstr "" #. zathura settings -#: ../config.c:147 +#: ../config.c:131 msgid "Database backend" msgstr "Буфер бази" -#: ../config.c:149 +#: ../config.c:133 msgid "Zoom step" msgstr "Збільшення" -#: ../config.c:151 +#: ../config.c:135 msgid "Padding between pages" msgstr "Заповнення між сторінками" -#: ../config.c:153 +#: ../config.c:137 msgid "Number of pages per row" msgstr "Кількість сторінок в одному рядку" -#: ../config.c:155 +#: ../config.c:139 msgid "Column of the first page" msgstr "" -#: ../config.c:157 +#: ../config.c:141 msgid "Scroll step" msgstr "Прокручування" -#: ../config.c:159 +#: ../config.c:143 msgid "Horizontal scroll step" msgstr "" -#: ../config.c:161 +#: ../config.c:145 msgid "Full page scroll overlap" msgstr "" -#: ../config.c:163 +#: ../config.c:147 msgid "Zoom minimum" msgstr "Максимальне зменшення" -#: ../config.c:165 +#: ../config.c:149 msgid "Zoom maximum" msgstr "Максимальне збільшення" -#: ../config.c:167 +#: ../config.c:151 msgid "Maximum number of pages to keep in the cache" msgstr "" -#: ../config.c:169 +#: ../config.c:153 msgid "Number of positions to remember in the jumplist" msgstr "" -#: ../config.c:171 +#: ../config.c:155 msgid "Recoloring (dark color)" msgstr "Перефарбування (темний колір)" -#: ../config.c:173 +#: ../config.c:156 msgid "Recoloring (light color)" msgstr "Перефарбування (світлий колір)" -#: ../config.c:175 +#: ../config.c:157 msgid "Color for highlighting" msgstr "Колір для виділення" -#: ../config.c:177 +#: ../config.c:159 msgid "Color for highlighting (active)" msgstr "Колір для виділення (активний)" -#: ../config.c:179 +#: ../config.c:161 msgid "'Loading ...' background color" msgstr "" -#: ../config.c:181 +#: ../config.c:163 msgid "'Loading ...' foreground color" msgstr "" -#: ../config.c:185 +#: ../config.c:167 msgid "Recolor pages" msgstr "Змінити кольори" -#: ../config.c:187 +#: ../config.c:169 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -#: ../config.c:189 +#: ../config.c:171 msgid "Wrap scrolling" msgstr "Плавне прокручування" -#: ../config.c:191 +#: ../config.c:173 msgid "Page aware scrolling" msgstr "" -#: ../config.c:193 +#: ../config.c:175 msgid "Advance number of pages per row" msgstr "" -#: ../config.c:195 +#: ../config.c:177 msgid "Horizontally centered zoom" msgstr "" -#: ../config.c:197 +#: ../config.c:179 msgid "Align link target to the left" msgstr "" -#: ../config.c:199 +#: ../config.c:181 +msgid "Let zoom be changed when following links" +msgstr "" + +#: ../config.c:183 msgid "Center result horizontally" msgstr "" -#: ../config.c:201 +#: ../config.c:185 msgid "Transparency for highlighting" msgstr "Прозорість для виділення" -#: ../config.c:203 +#: ../config.c:187 msgid "Render 'Loading ...'" msgstr "Рендер 'Завантажується ...'" -#: ../config.c:204 +#: ../config.c:188 msgid "Adjust to when opening file" msgstr "Підлаштовутись при відкритті файлу" -#: ../config.c:206 +#: ../config.c:190 msgid "Show hidden files and directories" msgstr "Показати приховані файли та директорії" -#: ../config.c:208 +#: ../config.c:192 msgid "Show directories" msgstr "Показати диреторії" -#: ../config.c:210 +#: ../config.c:194 msgid "Always open on first page" msgstr "Завжди відкривати на першій сторінці" -#: ../config.c:212 +#: ../config.c:196 msgid "Highlight search results" msgstr "" -#: ../config.c:214 +#: ../config.c:198 msgid "Enable incremental search" msgstr "" -#: ../config.c:216 +#: ../config.c:200 msgid "Clear search results on abort" msgstr "" -#: ../config.c:218 +#: ../config.c:202 msgid "Use basename of the file in the window title" msgstr "" -#: ../config.c:220 +#: ../config.c:204 msgid "Display the page number in the window title" msgstr "" -#: ../config.c:222 +#: ../config.c:206 msgid "Use basename of the file in the statusbar" msgstr "" -#: ../config.c:224 ../main.c:65 +#: ../config.c:208 ../main.c:67 msgid "Enable synctex support" msgstr "" +#: ../config.c:210 +msgid "The clipboard into which mouse-selected data will be written" +msgstr "" + #. define default inputbar commands -#: ../config.c:383 +#: ../config.c:369 msgid "Add a bookmark" msgstr "Додати закладку" -#: ../config.c:384 +#: ../config.c:370 msgid "Delete a bookmark" msgstr "Вилучити закладку" -#: ../config.c:385 +#: ../config.c:371 msgid "List all bookmarks" msgstr "Дивитись усі закладки" -#: ../config.c:386 +#: ../config.c:372 msgid "Close current file" msgstr "Закрити документ" -#: ../config.c:387 +#: ../config.c:373 msgid "Show file information" msgstr "Показати інформацію файлу" -#: ../config.c:388 +#: ../config.c:374 msgid "Execute a command" msgstr "" -#: ../config.c:389 +#: ../config.c:375 msgid "Show help" msgstr "Показати довідку" -#: ../config.c:390 +#: ../config.c:376 msgid "Open document" msgstr "Відкрити документ" -#: ../config.c:391 +#: ../config.c:377 msgid "Close zathura" msgstr "Вийти із zathura" -#: ../config.c:392 +#: ../config.c:378 msgid "Print document" msgstr "Друкувати документ" -#: ../config.c:393 +#: ../config.c:379 msgid "Save document" msgstr "Зберегти документ" -#: ../config.c:394 +#: ../config.c:380 msgid "Save document (and force overwriting)" msgstr "Зберегти документ (форсувати перезапис)" -#: ../config.c:395 +#: ../config.c:381 msgid "Save attachments" msgstr "Зберегти прикріплення" -#: ../config.c:396 +#: ../config.c:382 msgid "Set page offset" msgstr "Встановити зміщення сторінки" -#: ../config.c:397 +#: ../config.c:383 msgid "Mark current location within the document" msgstr "" -#: ../config.c:398 +#: ../config.c:384 msgid "Delete the specified marks" msgstr "" -#: ../config.c:399 +#: ../config.c:385 msgid "Don't highlight current search results" msgstr "" -#: ../config.c:400 +#: ../config.c:386 msgid "Highlight current search results" msgstr "" -#: ../config.c:401 +#: ../config.c:387 msgid "Show version information" msgstr "" -#: ../links.c:175 ../links.c:254 +#: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." msgstr "Запуск xdg-open не вдався." -#: ../links.c:193 +#: ../links.c:217 #, c-format msgid "Link: page %d" msgstr "" -#: ../links.c:200 +#: ../links.c:224 #, c-format msgid "Link: %s" msgstr "" -#: ../links.c:204 +#: ../links.c:228 msgid "Link: Invalid" msgstr "" -#: ../main.c:56 +#: ../main.c:58 msgid "Reparents to window specified by xid" msgstr "Вертатися до вікна, вказаного xid" -#: ../main.c:57 +#: ../main.c:59 msgid "Path to the config directory" msgstr "Шлях до теки конфігурації" -#: ../main.c:58 +#: ../main.c:60 msgid "Path to the data directory" msgstr "Шлях до теки з даними" -#: ../main.c:59 +#: ../main.c:61 msgid "Path to the directories containing plugins" msgstr "Шлях до теки з плаґінами" -#: ../main.c:60 +#: ../main.c:62 msgid "Fork into the background" msgstr "Працювати у фоні" -#: ../main.c:61 +#: ../main.c:63 msgid "Document password" msgstr "" -#: ../main.c:62 +#: ../main.c:64 msgid "Page number to go to" msgstr "" -#: ../main.c:63 +#: ../main.c:65 msgid "Log level (debug, info, warning, error)" msgstr "Рівень логування (налагодження, інфо, застереження, помилка)" -#: ../main.c:64 +#: ../main.c:66 msgid "Print version information" msgstr "Показати інформацію файлу" -#: ../main.c:66 +#: ../main.c:68 msgid "Synctex editor (forwarded to the synctex command)" msgstr "" -#: ../page-widget.c:474 +#: ../page-widget.c:526 msgid "Loading..." msgstr "" -#: ../page-widget.c:678 -#, c-format -msgid "Copied selected text to clipboard: %s" -msgstr "Вибраний текст скопійовано до буферу: %s" - -#: ../page-widget.c:776 +#: ../page-widget.c:845 msgid "Copy image" msgstr "Копіювати картинку" -#: ../page-widget.c:777 +#: ../page-widget.c:846 msgid "Save image as" msgstr "" -#: ../shortcuts.c:1154 +#: ../shortcuts.c:1076 msgid "This document does not contain any index" msgstr "Індекс відсутній в цьому документі" -#: ../zathura.c:227 ../zathura.c:975 +#: ../zathura.c:213 ../zathura.c:959 msgid "[No name]" msgstr "[Без назви]" -#: ../zathura.c:584 +#: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" -#: ../zathura.c:594 +#: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "" From b3fdb8c05e26025359940fe4c8f69c10b27fe639 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 15:38:13 +0100 Subject: [PATCH 73/90] Document return value if an error occurs Signed-off-by: Sebastian Ramacher --- document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document.h b/document.h index 4b23125..08f6b20 100644 --- a/document.h +++ b/document.h @@ -15,7 +15,7 @@ * @param path Path to the document * @param password Password of the document or NULL * @param error Optional error parameter - * @return The document object + * @return The document object and NULL if an error occurs */ zathura_document_t* zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* path, const char* password, zathura_error_t* From 2ec8675bec44ac18de8bdd795e95ff2576caafc8 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 19:55:57 +0100 Subject: [PATCH 74/90] Update translations --- po/ca.po | 2 +- po/cs.po | 2 +- po/de.po | 16 ++++++------- po/el.po | 5 ++-- po/eo.po | 1 - po/es.po | 5 ++-- po/es_CL.po | 4 ++-- po/et.po | 4 ++-- po/fr.po | 19 +++++---------- po/he.po | 2 +- po/hr.po | 2 +- po/id_ID.po | 2 +- po/it.po | 4 ++-- po/pl.po | 7 +++--- po/pt_BR.po | 6 ++--- po/ru.po | 66 +++++++++++++++++++++++++++-------------------------- po/ta_IN.po | 4 ++-- po/tr.po | 2 +- po/uk_UA.po | 4 ++-- 19 files changed, 75 insertions(+), 82 deletions(-) diff --git a/po/ca.po b/po/ca.po index a8324f3..28c6861 100644 --- a/po/ca.po +++ b/po/ca.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:33+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+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 7afe47d..9bc9cdb 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:33+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+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 b258c9d..b4125d1 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-11-01 14:11+0100\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: German (http://www.transifex.com/projects/p/zathura/language/" "de/)\n" @@ -214,7 +214,7 @@ msgstr "Horizontale Schrittgröße beim Scrollen" #: ../config.c:145 msgid "Full page scroll overlap" -msgstr "" +msgstr "Überlappung beim Scrollen von ganzen Seiten" #: ../config.c:147 msgid "Zoom minimum" @@ -226,11 +226,11 @@ msgstr "Maximale Vergrößerungsstufe" #: ../config.c:151 msgid "Maximum number of pages to keep in the cache" -msgstr "" +msgstr "Maximale Seitenzahl im Zwischenspeicher" #: ../config.c:153 msgid "Number of positions to remember in the jumplist" -msgstr "" +msgstr "Anzahl der Liste zu behaltenden Positionen" #: ../config.c:155 msgid "Recoloring (dark color)" @@ -272,7 +272,7 @@ msgstr "Scroll-Umbruch" #: ../config.c:173 msgid "Page aware scrolling" -msgstr "" +msgstr "Seiten beim Scrollen beachten" #: ../config.c:175 msgid "Advance number of pages per row" @@ -284,7 +284,7 @@ msgstr "Horizontal zentrierter Zoom" #: ../config.c:179 msgid "Align link target to the left" -msgstr "" +msgstr "Linkziel links ausrichten" #: ../config.c:181 msgid "Let zoom be changed when following links" @@ -324,7 +324,7 @@ msgstr "Hebe Suchergebnisse hervor" #: ../config.c:198 msgid "Enable incremental search" -msgstr "" +msgstr "Aktiviere inkrementelle Suche" #: ../config.c:200 msgid "Clear search results on abort" @@ -471,7 +471,7 @@ msgstr "Dokument Passwort" #: ../main.c:64 msgid "Page number to go to" -msgstr "Seitenzahl zu der gewechselt werden soll" +msgstr "Zur Seitenzahl springen" #: ../main.c:65 msgid "Log level (debug, info, warning, error)" diff --git a/po/el.po b/po/el.po index 157458b..93de0b9 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:34+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Greek (http://www.transifex.com/projects/p/zathura/language/" "el/)\n" @@ -336,9 +336,8 @@ msgid "Use basename of the file in the window title" msgstr "Χρήση του ονόματος του αρχείο στο τίτλο του παραθύρου" #: ../config.c:204 -#, fuzzy msgid "Display the page number in the window title" -msgstr "Χρήση του ονόματος του αρχείο στο τίτλο του παραθύρου" +msgstr "" #: ../config.c:206 msgid "Use basename of the file in the statusbar" diff --git a/po/eo.po b/po/eo.po index 8787162..cc516b7 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8,7 +8,6 @@ msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:34+0200\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 a174760..9791fb8 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:34+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Moritz Lipp \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" "zathura/language/es/)\n" @@ -334,9 +334,8 @@ 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 -#, fuzzy msgid "Display the page number in the window title" -msgstr "Usar el nombre del archivo en el título de la ventana" +msgstr "" #: ../config.c:206 msgid "Use basename of the file in the statusbar" diff --git a/po/es_CL.po b/po/es_CL.po index 3440009..1d2e140 100644 --- a/po/es_CL.po +++ b/po/es_CL.po @@ -2,13 +2,13 @@ # See LICENSE file for license and copyright information # # Translators: -# , 2012. +# watsh1ken , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:34+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+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 bda39ca..6e2e8e6 100644 --- a/po/et.po +++ b/po/et.po @@ -2,13 +2,13 @@ # See LICENSE file for license and copyright information # # Translators: -# Rivo Zängov , 2012. +# Rivo Zängov , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2012-04-03 15:25+0000\n" +"PO-Revision-Date: 2013-11-01 13:12+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 10c34c8..da9bccf 100644 --- a/po/fr.po +++ b/po/fr.po @@ -2,16 +2,16 @@ # See LICENSE file for license and copyright information # # Translators: -# Dorian , 2012. -# Quentin Stiévenart , 2012. -# Stéphane Aulery , 2012. -# Benoît Knecht , 2012. +# bknecht , 2012 +# Dorian , 2012 +# Quentin Stiévenart , 2012 +# 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:34+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Benoît Knecht \n" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" "fr/)\n" @@ -338,9 +338,8 @@ 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 -#, fuzzy msgid "Display the page number in the window title" -msgstr "Utiliser le nom de base du fichier dans le titre de la fenêtre" +msgstr "" #: ../config.c:206 msgid "Use basename of the file in the statusbar" @@ -516,9 +515,3 @@ msgstr "" #: ../zathura.c:545 msgid "Document does not contain any pages" msgstr "Ce document ne contient aucune page" - -#~ msgid "Life time (in seconds) of a hidden page" -#~ msgstr "Durée de vie (en secondes) d'une page cachée" - -#~ msgid "Amount of seconds between each cache purge" -#~ msgstr "Délai en secondes entre chaque purge du cache" diff --git a/po/he.po b/po/he.po index 8e5780d..f864335 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-01-13 14:12+0000\n" +"PO-Revision-Date: 2013-11-01 13:12+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 2e3ac61..1d42d5c 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-01-13 14:12+0000\n" +"PO-Revision-Date: 2013-11-01 13:12+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 2c44b08..ac79134 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:34+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: andjeng \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/" "zathura/language/id_ID/)\n" diff --git a/po/it.po b/po/it.po index 3471550..8d503e6 100644 --- a/po/it.po +++ b/po/it.po @@ -2,13 +2,13 @@ # See LICENSE file for license and copyright information # # Translators: -# , 2012. +# TheLemonMan , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:35+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+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 8ba8891..b028309 100644 --- a/po/pl.po +++ b/po/pl.po @@ -2,13 +2,14 @@ # See LICENSE file for license and copyright information # # Translators: -# p , 2012. +# Łukasz Hryniuk , 2013 +# p , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:35+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" "pl/)\n" @@ -372,7 +373,7 @@ msgstr "Wyświetl informacje o pliku" #: ../config.c:374 msgid "Execute a command" -msgstr "" +msgstr "Wykonaj polecenie" #: ../config.c:375 msgid "Show help" diff --git a/po/pt_BR.po b/po/pt_BR.po index aa68f84..d36c479 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:35+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: salmora8 \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" "zathura/language/pt_BR/)\n" @@ -336,7 +336,7 @@ msgstr "Usar nome do arquivo na barra de titulo" #: ../config.c:204 msgid "Display the page number in the window title" -msgstr "" +msgstr "Exibir o número da página no título da janela." #: ../config.c:206 msgid "Use basename of the file in the statusbar" @@ -507,7 +507,7 @@ msgstr "[Sem nome]" #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" +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 e1451b4..447c227 100644 --- a/po/ru.po +++ b/po/ru.po @@ -2,13 +2,15 @@ # See LICENSE file for license and copyright information # # Translators: -# Mikhail Krutov <>, 2012. +# AlexanderR , 2013 +# Alissa , 2013 +# Mikhail Krutov <>, 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:35+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" "ru/)\n" @@ -149,22 +151,22 @@ msgstr "Файл %s сохранён в %s" #: ../commands.c:489 #, c-format msgid "Wrote image '%s' to '%s'." -msgstr "" +msgstr "Файл '%s' сохранён в '%s'" #: ../commands.c:491 #, c-format msgid "Couldn't write image '%s' to '%s'." -msgstr "" +msgstr "Не могу сохранить приложенный файл %s в %s" #: ../commands.c:498 #, c-format msgid "Unknown image '%s'." -msgstr "" +msgstr "Неизвестный файл %s." #: ../commands.c:502 #, c-format msgid "Unknown attachment or image '%s'." -msgstr "" +msgstr "Неизвестное вложение %s." #: ../commands.c:553 msgid "Argument must be a number." @@ -173,16 +175,16 @@ msgstr "Аргумент должен быть числом" #: ../completion.c:250 #, c-format msgid "Page %d" -msgstr "" +msgstr "Страница %d" #: ../completion.c:293 msgid "Attachments" -msgstr "" +msgstr "Прикепленные файлы" #. add images #: ../completion.c:324 msgid "Images" -msgstr "" +msgstr "Изображения" #. zathura settings #: ../config.c:131 @@ -211,7 +213,7 @@ msgstr "Шаг прокрутки" #: ../config.c:143 msgid "Horizontal scroll step" -msgstr "" +msgstr "Шаг горизонтальной прокрутки" #: ../config.c:145 msgid "Full page scroll overlap" @@ -231,7 +233,7 @@ msgstr "" #: ../config.c:153 msgid "Number of positions to remember in the jumplist" -msgstr "" +msgstr "Длина истории переходов" #: ../config.c:155 msgid "Recoloring (dark color)" @@ -251,11 +253,11 @@ msgstr "Цвет для подсветки (активной)" #: ../config.c:161 msgid "'Loading ...' background color" -msgstr "" +msgstr "Цвет фона загрузочной заставки" #: ../config.c:163 msgid "'Loading ...' foreground color" -msgstr "" +msgstr "Цвет загрузочной заставки" #: ../config.c:167 msgid "Recolor pages" @@ -291,7 +293,7 @@ msgstr "" #: ../config.c:183 msgid "Center result horizontally" -msgstr "" +msgstr "Центрировать результат по горизонтали" #: ../config.c:185 msgid "Transparency for highlighting" @@ -319,27 +321,27 @@ msgstr "Всегда открывать на первой странице" #: ../config.c:196 msgid "Highlight search results" -msgstr "" +msgstr "Подсветить результаты поиска" #: ../config.c:198 msgid "Enable incremental search" -msgstr "" +msgstr "Инкрементальный поиск" #: ../config.c:200 msgid "Clear search results on abort" -msgstr "" +msgstr "Сбросить результаты при отмене поиска" #: ../config.c:202 msgid "Use basename of the file in the window title" -msgstr "" +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" -msgstr "" +msgstr "Использовать базовое имя файла в строке состояния" #: ../config.c:208 ../main.c:67 msgid "Enable synctex support" @@ -372,7 +374,7 @@ msgstr "Показать информацию о файле" #: ../config.c:374 msgid "Execute a command" -msgstr "" +msgstr "Выполнить команду" #: ../config.c:375 msgid "Show help" @@ -416,15 +418,15 @@ msgstr "Удалить указанные пометки" #: ../config.c:385 msgid "Don't highlight current search results" -msgstr "" +msgstr "Не подсвечивать результаты текущего поиска" #: ../config.c:386 msgid "Highlight current search results" -msgstr "" +msgstr "Подсветить результаты текущего поиска" #: ../config.c:387 msgid "Show version information" -msgstr "" +msgstr "Показать информацию о версии файла" #: ../links.c:199 ../links.c:278 msgid "Failed to run xdg-open." @@ -433,12 +435,12 @@ msgstr "Не удалось запустить xdg-open" #: ../links.c:217 #, c-format msgid "Link: page %d" -msgstr "" +msgstr "Ссылка: страница %d" #: ../links.c:224 #, c-format msgid "Link: %s" -msgstr "" +msgstr "Ссылка: %s" #: ../links.c:228 msgid "Link: Invalid" @@ -466,11 +468,11 @@ msgstr "Уйти в бэкграунд" #: ../main.c:63 msgid "Document password" -msgstr "" +msgstr "Пароль документа" #: ../main.c:64 msgid "Page number to go to" -msgstr "" +msgstr "Перейти к странице номер" #: ../main.c:65 msgid "Log level (debug, info, warning, error)" @@ -486,7 +488,7 @@ msgstr "" #: ../page-widget.c:526 msgid "Loading..." -msgstr "" +msgstr "Загрузка..." #: ../page-widget.c:845 msgid "Copy image" @@ -494,7 +496,7 @@ msgstr "Скопировать изображение" #: ../page-widget.c:846 msgid "Save image as" -msgstr "" +msgstr "Созранить как" #: ../shortcuts.c:1076 msgid "This document does not contain any index" @@ -506,8 +508,8 @@ msgstr "[No name]" #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." -msgstr "" +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 3c8aae5..d2efc30 100644 --- a/po/ta_IN.po +++ b/po/ta_IN.po @@ -2,13 +2,13 @@ # See LICENSE file for license and copyright information # # Translators: -# , 2012. +# mankand007 , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:35+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+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 5b7d06f..823a850 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-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:36+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+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 99d04ed..45dfbf9 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -2,13 +2,13 @@ # See LICENSE file for license and copyright information # # Translators: -# , 2012. +# sevenfourk , 2012 msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" "POT-Creation-Date: 2013-11-01 14:05+0100\n" -"PO-Revision-Date: 2013-08-15 00:36+0200\n" +"PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" "zathura/language/uk_UA/)\n" From cc0ad0ad64ebc4e62f5ab300407b074d1324bf00 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 19:57:23 +0100 Subject: [PATCH 75/90] Make a string translatable --- main.c | 2 +- zathura.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 692aa67..7f3ac59 100644 --- a/main.c +++ b/main.c @@ -111,7 +111,7 @@ main(int argc, char* argv[]) zathura_set_argv(zathura, argv); /* Init zathura */ - if(zathura_init(zathura) == false) { + if (zathura_init(zathura) == false) { girara_error("Could not initialize zathura."); zathura_free(zathura); return -1; diff --git a/zathura.c b/zathura.c index 0c515b7..4374f18 100644 --- a/zathura.c +++ b/zathura.c @@ -483,7 +483,7 @@ document_info_open(gpointer data) file = prepare_document_open_from_stdin(document_info->zathura); if (file == NULL) { girara_notify(document_info->zathura->ui.session, GIRARA_ERROR, - "Could not read file from stdin and write it to a temporary file."); + _("Could not read file from stdin and write it to a temporary file.")); } else { document_info->zathura->stdin_support.file = g_strdup(file); } From 11bd96201aa643c1c6b9a4414dd18d1d51d62012 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 19:58:20 +0100 Subject: [PATCH 76/90] Run update-po Signed-off-by: Sebastian Ramacher --- po/ca.po | 6 +++++- po/cs.po | 6 +++++- po/de.po | 6 +++++- po/el.po | 6 +++++- po/eo.po | 6 +++++- po/es.po | 6 +++++- po/es_CL.po | 6 +++++- po/et.po | 6 +++++- po/fr.po | 6 +++++- po/he.po | 6 +++++- po/hr.po | 6 +++++- po/id_ID.po | 6 +++++- po/it.po | 6 +++++- po/pl.po | 6 +++++- po/pt_BR.po | 9 +++++++-- po/ru.po | 6 +++++- po/ta_IN.po | 6 +++++- po/tr.po | 6 +++++- po/uk_UA.po | 6 +++++- 19 files changed, 97 insertions(+), 20 deletions(-) diff --git a/po/ca.po b/po/ca.po index 28c6861..b331ecb 100644 --- a/po/ca.po +++ b/po/ca.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-01 14:05+0100\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" "Language-Team: Catalan (http://www.transifex.com/projects/p/zathura/language/" @@ -505,6 +505,10 @@ msgstr "Aquest document no conté cap índex" msgid "[No name]" msgstr "[Sense nom]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/cs.po b/po/cs.po index 9bc9cdb..083a527 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Martin Pelikan \n" "Language-Team: pwmt.org \n" @@ -499,6 +499,10 @@ msgstr "Tenhle dokument neobsahuje žádné indexy" msgid "[No name]" msgstr "[Nepojmenovaný]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/de.po b/po/de.po index b4125d1..f8eb78c 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-01 14:05+0100\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" "Language-Team: German (http://www.transifex.com/projects/p/zathura/language/" @@ -505,6 +505,10 @@ msgstr "Dieses Dokument beinhaltet kein Inhaltsverzeichnis." msgid "[No name]" msgstr "[Kein Name]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "Dateityp ist nicht unterstützt. Installiere das benötigete Plugin." diff --git a/po/el.po b/po/el.po index 93de0b9..e789213 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-01 14:05+0100\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" "Language-Team: Greek (http://www.transifex.com/projects/p/zathura/language/" @@ -506,6 +506,10 @@ msgstr "Το αρχείο δεν περιέχει κανένα δείκτη" msgid "[No name]" msgstr "[Χωρίς όνομα]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/eo.po b/po/eo.po index cc516b7..a8e3c54 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" "language/eo/)\n" @@ -502,6 +502,10 @@ msgstr "Ĉi-tiu dokumento enhavas neniam indekson." msgid "[No name]" msgstr "[Neniu nomo]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/es.po b/po/es.po index 9791fb8..1d69579 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Moritz Lipp \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" @@ -504,6 +504,10 @@ msgstr "Este documento no contiene ningún índice" msgid "[No name]" msgstr "[Sin nombre]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/es_CL.po b/po/es_CL.po index 1d2e140..aae2625 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: watsh1ken \n" "Language-Team: Spanish (Chile) (http://www.transifex.net/projects/p/zathura/" @@ -503,6 +503,10 @@ msgstr "Este document no contiene índice" msgid "[No name]" msgstr "[Sin nombre]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/et.po b/po/et.po index 6e2e8e6..eb99602 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: Rivo Zängov \n" "Language-Team: Estonian (http://www.transifex.net/projects/p/zathura/" @@ -503,6 +503,10 @@ msgstr "" msgid "[No name]" msgstr "[Nime pole]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/fr.po b/po/fr.po index da9bccf..7c36cb0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-01 14:05+0100\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" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" @@ -508,6 +508,10 @@ msgstr "Ce document ne contient pas d'index" msgid "[No name]" msgstr "[Sans nom]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/he.po b/po/he.po index f864335..35c6ffd 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-01 14:05+0100\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" "Language-Team: Hebrew (http://www.transifex.com/projects/p/zathura/language/" @@ -502,6 +502,10 @@ msgstr "" msgid "[No name]" msgstr "" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/hr.po b/po/hr.po index 1d42d5c..3a1c2a7 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-01 14:05+0100\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" "Language-Team: Croatian (http://www.transifex.com/projects/p/zathura/" @@ -503,6 +503,10 @@ msgstr "" msgid "[No name]" msgstr "" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/id_ID.po b/po/id_ID.po index ac79134..2af438b 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: andjeng \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/" @@ -503,6 +503,10 @@ msgstr "Dokumen ini tidak mempunyai indeks" msgid "[No name]" msgstr "[Tidak berjudul]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/it.po b/po/it.po index 8d503e6..215c000 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-01 14:05+0100\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" "Language-Team: Italian (http://www.transifex.com/projects/p/zathura/language/" @@ -503,6 +503,10 @@ msgstr "Questo documento non contiene l' indice" msgid "[No name]" msgstr "[Nessun nome]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/pl.po b/po/pl.po index b028309..83bc94d 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" @@ -505,6 +505,10 @@ msgstr "Dokument nie zawiera indeksu" msgid "[No name]" msgstr "[bez nazwy]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index d36c479..452e0ea 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: salmora8 \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" @@ -505,9 +505,14 @@ msgstr "Este documento não contem qualquer índice" msgid "[No name]" msgstr "[Sem nome]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../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 447c227..6c62284 100644 --- a/po/ru.po +++ b/po/ru.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2013-11-01 14:05+0100\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" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" @@ -506,6 +506,10 @@ msgstr "В документе нету индекса" msgid "[No name]" msgstr "[No name]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "Тип файла не поддерживается. Установите соответствующий плагин." diff --git a/po/ta_IN.po b/po/ta_IN.po index d2efc30..c0aa749 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: mankand007 \n" "Language-Team: Tamil (India) (http://www.transifex.net/projects/p/zathura/" @@ -503,6 +503,10 @@ msgstr "இந்த ஆவணத்தில் எந்த index-ம் இ msgid "[No name]" msgstr "பெயரற்ற ஆவணம்" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/tr.po b/po/tr.po index 823a850..81d20aa 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-01 14:05+0100\n" +"POT-Creation-Date: 2013-11-04 19:57+0100\n" "PO-Revision-Date: 2013-11-01 13:12+0000\n" "Last-Translator: hsngrms \n" "Language-Team: Turkish (http://www.transifex.net/projects/p/zathura/language/" @@ -504,6 +504,10 @@ msgstr "Bu belge fihrist içermiyor" msgid "[No name]" msgstr "[İsimsiz]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" diff --git a/po/uk_UA.po b/po/uk_UA.po index 45dfbf9..bf63e17 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-01 14:05+0100\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" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" @@ -504,6 +504,10 @@ msgstr "Індекс відсутній в цьому документі" msgid "[No name]" msgstr "[Без назви]" +#: ../zathura.c:486 +msgid "Could not read file from stdin and write it to a temporary file." +msgstr "" + #: ../zathura.c:535 msgid "Unsupported file type. Please install the necessary plugin." msgstr "" From 2981996eccb4418a0aeb299e09b5cc664e0883b7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 20:10:17 +0100 Subject: [PATCH 77/90] Remove note about broken GTK+3 support Signed-off-by: Sebastian Ramacher --- config.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/config.mk b/config.mk index d7c255b..619980f 100644 --- a/config.mk +++ b/config.mk @@ -11,7 +11,6 @@ ZATHURA_ABI_VERSION = 2 VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_REV} # the GTK+ version to use -# note: zathura with GTK+ 3 is broken! ZATHURA_GTK_VERSION ?= 2 # version checks From 594e816aa82e03aaf0449f02092003a566b91c36 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 20:55:54 +0100 Subject: [PATCH 78/90] Add Bugs section to README Signed-off-by: Sebastian Ramacher --- README | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README b/README index 1ce70ff..8811f03 100644 --- a/README +++ b/README @@ -37,8 +37,13 @@ To build and install zathura: make install -Uninstall: ----------- +Uninstall +--------- To delete zathura from your system, just type: make uninstall + +Bugs +---- +Please report bugs at http://bugs.pwmt.org or contact us on our mailing list at +zathura@lists.pwmt.org. From 234008e2097c115b53ce2f0689910a6907dac1c0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 20:56:39 +0100 Subject: [PATCH 79/90] Change default GTK+ version to 3 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 619980f..8d4586d 100644 --- a/config.mk +++ b/config.mk @@ -11,7 +11,7 @@ ZATHURA_ABI_VERSION = 2 VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_REV} # the GTK+ version to use -ZATHURA_GTK_VERSION ?= 2 +ZATHURA_GTK_VERSION ?= 3 # version checks # If you want to disable any of the checks, set *_VERSION_CHECK to 0. From dd81a0bcc8eae9a0d6e2a48236dd0c202927668a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Nov 2013 20:59:06 +0100 Subject: [PATCH 80/90] Update dependencies --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 8811f03..111cdf2 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ girara user interface library and several document libraries. Requirements ------------ -gtk2 (>= 2.18) +gtk2 (>= 2.18) or gtk3 glib (>= 2.28) girara sqlite3 (optional, >= 3.5.9) From c51a7bdda19467cf3ac924dd30a704b11dff5106 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 5 Nov 2013 01:07:05 +0100 Subject: [PATCH 81/90] Fix up header Signed-off-by: Sebastian Ramacher --- po/eo.po | 1 + 1 file changed, 1 insertion(+) diff --git a/po/eo.po b/po/eo.po index a8e3c54..db89adc 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8,6 +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" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" "language/eo/)\n" From 08d799a1f8e155f6a180f659314ed14beaf91505 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 5 Nov 2013 02:22:30 +0100 Subject: [PATCH 82/90] Set viewport info early and set correct page size the first time Signed-off-by: Sebastian Ramacher --- zathura.c | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/zathura.c b/zathura.c index 4374f18..0ce00c1 100644 --- a/zathura.c +++ b/zathura.c @@ -694,6 +694,17 @@ document_open(zathura_t* zathura, const char* path, const char* password, girara_setting_get(zathura->ui.session, "recolor-keephue", &recolor); zathura_renderer_enable_recolor_hue(zathura->sync.render_thread, recolor); + /* get view port size */ + GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment( + GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); + GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment( + GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); + + const unsigned int view_width = (unsigned int)floor(gtk_adjustment_get_page_size(vadjustment)); + zathura_document_set_viewport_width(zathura->document, view_width); + const unsigned int view_height = (unsigned int)floor(gtk_adjustment_get_page_size(hadjustment)); + zathura_document_set_viewport_height(zathura->document, view_height); + /* create blank pages */ zathura->pages = calloc(number_of_pages, sizeof(GtkWidget*)); if (zathura->pages == NULL) { @@ -713,16 +724,6 @@ document_open(zathura_t* zathura, const char* path, const char* password, zathura->pages[page_id] = page_widget; - /* set widget size */ - unsigned int page_height = 0; - unsigned int page_width = 0; - - double height = zathura_page_get_height(page); - 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(page_widget, page_width, page_height); - g_signal_connect(G_OBJECT(page_widget), "text-selected", G_CALLBACK(cb_page_widget_text_selected), zathura); g_signal_connect(G_OBJECT(page_widget), "image-selected", @@ -756,9 +757,6 @@ document_open(zathura_t* zathura, const char* path, const char* password, girara_set_view(zathura->ui.session, zathura->ui.page_widget_alignment); - for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) { - gtk_widget_realize(zathura->pages[page_id]); - } /* bookmarks */ zathura_bookmarks_load(zathura, file_path); @@ -779,9 +777,25 @@ document_open(zathura_t* zathura, const char* path, const char* password, g_free(file_uri); - - /* adjust_view and set position*/ + /* adjust_view */ adjust_view(zathura); + for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) { + /* set widget size */ + zathura_page_t* page = zathura_document_get_page(document, page_id); + unsigned int page_height = 0; + unsigned int page_width = 0; + + /* 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); + 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); + + /* show widget */ + gtk_widget_show(zathura->pages[page_id]); + } /* set position */ page_set(zathura, zathura_document_get_current_page_number(document)); @@ -1156,14 +1170,13 @@ adjust_view(zathura_t* zathura) { zathura_document_get_document_size(zathura->document, &document_height, &document_width); zathura_document_get_viewport_size(zathura->document, &view_height, &view_width); - double scale = zathura_document_get_scale(zathura->document); - if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0) { goto error_ret; } - double page_ratio = (double)cell_height / (double)document_width; + double page_ratio = (double)cell_height / (double)document_width; double view_ratio = (double)view_height / (double)view_width; + double scale = zathura_document_get_scale(zathura->document); double newscale = scale; if (adjust_mode == ZATHURA_ADJUST_WIDTH || From 403d867ca417cb16e942e0c553283c832474614a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 5 Nov 2013 02:23:52 +0100 Subject: [PATCH 83/90] Some CS Signed-off-by: Sebastian Ramacher --- adjustment.c | 10 ++++------ document.c | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/adjustment.c b/adjustment.c index 8eda6e3..50a0418 100644 --- a/adjustment.c +++ b/adjustment.c @@ -11,20 +11,18 @@ page_calc_height_width(zathura_document_t* document, double height, double width { g_return_val_if_fail(document != NULL && page_height != NULL && page_width != NULL, 0.0); - double scale = zathura_document_get_scale(document); - double real_scale; - + double scale = zathura_document_get_scale(document); if (rotate && zathura_document_get_rotation(document) % 180) { *page_width = round(height * scale); *page_height = round(width * scale); - real_scale = MAX(*page_width / height, *page_height / width); + scale = MAX(*page_width / height, *page_height / width); } else { *page_width = round(width * scale); *page_height = round(height * scale); - real_scale = MAX(*page_width / width, *page_height / height); + scale = MAX(*page_width / width, *page_height / height); } - return real_scale; + return scale; } void diff --git a/document.c b/document.c index 8b820b6..506fb89 100644 --- a/document.c +++ b/document.c @@ -173,11 +173,11 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* document->pages[page_id] = page; /* cell_width and cell_height is the maximum of all the pages width and height */ - double width = zathura_page_get_width(page); + const double width = zathura_page_get_width(page); if (document->cell_width < width) document->cell_width = width; - double height = zathura_page_get_height(page); + const double height = zathura_page_get_height(page); if (document->cell_height < height) document->cell_height = height; } @@ -500,7 +500,6 @@ zathura_document_get_cell_size(zathura_document_t* document, page_calc_height_width(document, document->cell_height, document->cell_width, height, width, true); - } void @@ -509,14 +508,14 @@ zathura_document_get_document_size(zathura_document_t* document, { g_return_if_fail(document != NULL && height != NULL && width != NULL); - unsigned int npag = zathura_document_get_number_of_pages(document); unsigned int ncol = zathura_document_get_pages_per_row(document); unsigned int c0 = zathura_document_get_first_page_column(document); unsigned int nrow = (npag + c0 - 1 + ncol - 1) / ncol; /* number of rows */ unsigned int pad = zathura_document_get_page_padding(document); - unsigned int cell_height=0, cell_width=0; + unsigned int cell_height = 0; + unsigned int cell_width = 0; zathura_document_get_cell_size(document, &cell_height, &cell_width); *width = ncol * cell_width + (ncol - 1) * pad; From 903dae55e07c38cbefab14da342db5bcf1f6d1e8 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 5 Nov 2013 02:29:20 +0100 Subject: [PATCH 84/90] Get the correct adjustment Signed-off-by: Sebastian Ramacher --- zathura.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zathura.c b/zathura.c index 0ce00c1..2449698 100644 --- a/zathura.c +++ b/zathura.c @@ -700,9 +700,9 @@ document_open(zathura_t* zathura, const char* path, const char* password, GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment( GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - const unsigned int view_width = (unsigned int)floor(gtk_adjustment_get_page_size(vadjustment)); + const unsigned int view_width = (unsigned int)floor(gtk_adjustment_get_page_size(hadjustment)); zathura_document_set_viewport_width(zathura->document, view_width); - const unsigned int view_height = (unsigned int)floor(gtk_adjustment_get_page_size(hadjustment)); + const unsigned int view_height = (unsigned int)floor(gtk_adjustment_get_page_size(vadjustment)); zathura_document_set_viewport_height(zathura->document, view_height); /* create blank pages */ From f093046d9cef2ac3c673411430b2791c1182714d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 7 Nov 2013 02:56:57 +0100 Subject: [PATCH 85/90] Reduce the amount of code a bit Signed-off-by: Sebastian Ramacher --- render.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/render.c b/render.c index 0c941d9..b3a8663 100644 --- a/render.c +++ b/render.c @@ -604,8 +604,8 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) unsigned int page_height = 0; zathura_document_t* document = zathura_page_get_document(page); - 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); const double real_scale = page_calc_height_width(document, height, width, &page_height, &page_width, false); @@ -635,16 +635,14 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) } zathura_renderer_lock(renderer); - if (zathura_page_render(page, cairo, false) != ZATHURA_ERROR_OK) { - zathura_renderer_unlock(renderer); - cairo_destroy(cairo); - cairo_surface_destroy(surface); - return false; - } - + const int err = zathura_page_render(page, cairo, false); zathura_renderer_unlock(renderer); cairo_restore(cairo); cairo_destroy(cairo); + if (err != ZATHURA_ERROR_OK) { + cairo_surface_destroy(surface); + return false; + } /* before recoloring, check if we've been aborted */ if (priv->about_to_close == true || request_priv->aborted == true) { @@ -659,12 +657,9 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) } emit_completed_signal_t* ecs = g_malloc(sizeof(ecs)); - ecs->renderer = renderer; - ecs->request = request; - ecs->surface = surface; - g_object_ref(renderer); - g_object_ref(request); - cairo_surface_reference(surface); + ecs->renderer = g_object_ref(renderer); + ecs->request = g_object_ref(request); + ecs->surface = cairo_surface_reference(surface); /* emit signal from the main context, i.e. the main thread */ g_main_context_invoke(NULL, emit_completed_signal, ecs); @@ -708,7 +703,7 @@ render_all(zathura_t* zathura) } /* unmark all pages */ - unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document); + 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++) { zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); From 3abf46a1645768af04513a7e150e671810aa34b5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 7 Nov 2013 03:18:44 +0100 Subject: [PATCH 86/90] request and aborted need to be volatile Signed-off-by: Sebastian Ramacher --- render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render.c b/render.c index b3a8663..9b3b14c 100644 --- a/render.c +++ b/render.c @@ -66,8 +66,8 @@ typedef struct private_s { typedef struct request_private_s { ZathuraRenderer* renderer; zathura_page_t* page; - bool requested; - bool aborted; + volatile bool requested; + volatile bool aborted; gint64 last_view_time; } request_private_t; From 1a34fb0257997a9fbbc5b0c02ced848cc351855d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 7 Nov 2013 03:29:38 +0100 Subject: [PATCH 87/90] Add some debug output for signals Signed-off-by: Sebastian Ramacher --- render.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/render.c b/render.c index 9b3b14c..e9fbc1f 100644 --- a/render.c +++ b/render.c @@ -444,7 +444,12 @@ emit_completed_signal(void* data) if (priv->about_to_close == false && request_priv->aborted == false) { /* emit the signal */ + girara_debug("Emitting signal for page %d", + zathura_page_get_index(request_priv->page) + 1); g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); + } else { + girara_debug("Rendering of page %d aborted", + zathura_page_get_index(request_priv->page) + 1); } /* mark the request as done */ request_priv->requested = false; @@ -646,6 +651,8 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) /* before recoloring, check if we've been aborted */ if (priv->about_to_close == true || request_priv->aborted == true) { + girara_debug("Rendering of page %d aborted", + zathura_page_get_index(request_priv->page) + 1); request_priv->requested = false; cairo_surface_destroy(surface); return true; From 11de9b606bb47c84b8960835d1d8dbfdb53dfbdd Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 7 Nov 2013 03:56:29 +0100 Subject: [PATCH 88/90] Fix a type and add some consts Signed-off-by: Sebastian Ramacher --- render.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/render.c b/render.c index e9fbc1f..625de6c 100644 --- a/render.c +++ b/render.c @@ -663,7 +663,7 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) recolor(priv, page_width, page_height, surface); } - emit_completed_signal_t* ecs = g_malloc(sizeof(ecs)); + emit_completed_signal_t* ecs = g_malloc(sizeof(emit_completed_signal_t)); ecs->renderer = g_object_ref(renderer); ecs->request = g_object_ref(request); ecs->surface = cairo_surface_reference(surface); @@ -715,8 +715,8 @@ render_all(zathura_t* zathura) zathura_page_t* page = zathura_document_get_page(zathura->document, page_id); unsigned int page_height = 0, page_width = 0; - 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); GtkWidget* widget = zathura_page_get_widget(zathura, page); From 63a4152f93fc7c8fdb00efe7c45f1facc1fb2cec Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 7 Nov 2013 12:36:21 +0100 Subject: [PATCH 89/90] Be more explicit about render jobs Manage render jobs explicitly. This will help with situations where still have an aborted request in the queue but a new render job has been requested. Signed-off-by: Sebastian Ramacher --- render.c | 116 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 38 deletions(-) diff --git a/render.c b/render.c index 625de6c..3dc72d8 100644 --- a/render.c +++ b/render.c @@ -66,9 +66,9 @@ typedef struct private_s { typedef struct request_private_s { ZathuraRenderer* renderer; zathura_page_t* page; - volatile bool requested; - volatile bool aborted; gint64 last_view_time; + girara_list_t* active_jobs; + mutex jobs_mutex; } request_private_t; #define GET_PRIVATE(obj) \ @@ -77,6 +77,12 @@ typedef struct request_private_s { (G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_RENDER_REQUEST, \ request_private_t)) +/* job descritption for render thread */ +typedef struct render_job_s { + ZathuraRenderRequest* request; + volatile bool aborted; +} render_job_t; + /* init, new and free for ZathuraRenderer */ static void @@ -247,8 +253,8 @@ zathura_render_request_new(ZathuraRenderer* renderer, zathura_page_t* page) /* we want to make sure that renderer lives long enough */ priv->renderer = g_object_ref(renderer); priv->page = page; - priv->aborted = false; - priv->requested = false; + priv->active_jobs = girara_list_new(); + mutex_init(&priv->jobs_mutex); /* register the request with the renderer */ renderer_register_request(renderer, request); @@ -268,6 +274,11 @@ render_request_finalize(GObject* object) /* 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); } /* renderer methods */ @@ -396,14 +407,30 @@ zathura_render_request(ZathuraRenderRequest* request, gint64 last_view_time) g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); request_private_t* request_priv = REQUEST_GET_PRIVATE(request); - if (request_priv->requested == false) { - request_priv->requested = true; - request_priv->aborted = false; + mutex_lock(&request_priv->jobs_mutex); + + bool unfinished_jobs = false; + /* check if there are any active jobs left */ + GIRARA_LIST_FOREACH(request_priv->active_jobs, render_job_t*, iter, job) + if (job->aborted != false) { + unfinished_jobs = true; + } + GIRARA_LIST_FOREACH_END(request_priv->active_jobs, render_job_t*, iter, job); + + /* only add a new job if there are no active ones left */ + if (unfinished_jobs == false) { request_priv->last_view_time = last_view_time; + render_job_t* job = g_malloc0(sizeof(render_job_t)); + job->request = g_object_ref(request); + job->aborted = false; + girara_list_append(request_priv->active_jobs, job); + private_t* priv = GET_PRIVATE(request_priv->renderer); - g_thread_pool_push(priv->pool, request, NULL); + g_thread_pool_push(priv->pool, job, NULL); } + + mutex_unlock(&request_priv->jobs_mutex); } void @@ -412,9 +439,11 @@ zathura_render_request_abort(ZathuraRenderRequest* request) g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); request_private_t* request_priv = REQUEST_GET_PRIVATE(request); - if (request_priv->requested == true) { - request_priv->aborted = true; - } + mutex_lock(&request_priv->jobs_mutex); + GIRARA_LIST_FOREACH(request_priv->active_jobs, render_job_t*, iter, job) + job->aborted = true; + GIRARA_LIST_FOREACH_END(request_priv->active_jobs, render_job_t*, iter, job); + mutex_unlock(&request_priv->jobs_mutex); } void @@ -428,10 +457,22 @@ zathura_render_request_update_view_time(ZathuraRenderRequest* request) /* render job */ +static void +remove_job_and_free(render_job_t* job) +{ + request_private_t* request_priv = REQUEST_GET_PRIVATE(job->request); + + mutex_lock(&request_priv->jobs_mutex); + girara_list_remove(request_priv->active_jobs, job); + mutex_unlock(&request_priv->jobs_mutex); + + g_object_unref(job->request); + g_free(job); +} + typedef struct emit_completed_signal_s { - ZathuraRenderer* renderer; - ZathuraRenderRequest* request; + render_job_t* job; cairo_surface_t* surface; } emit_completed_signal_t; @@ -439,25 +480,24 @@ static gboolean emit_completed_signal(void* data) { emit_completed_signal_t* ecs = data; - private_t* priv = GET_PRIVATE(ecs->renderer); - request_private_t* request_priv = REQUEST_GET_PRIVATE(ecs->request); + render_job_t* job = ecs->job; + request_private_t* request_priv = REQUEST_GET_PRIVATE(job->request); + private_t* priv = GET_PRIVATE(request_priv->renderer); - if (priv->about_to_close == false && request_priv->aborted == false) { + if (priv->about_to_close == false && job->aborted == false) { /* emit the signal */ girara_debug("Emitting signal for page %d", zathura_page_get_index(request_priv->page) + 1); - g_signal_emit(ecs->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); + g_signal_emit(job->request, request_signals[REQUEST_COMPLETED], 0, ecs->surface); } else { girara_debug("Rendering of page %d aborted", zathura_page_get_index(request_priv->page) + 1); } /* mark the request as done */ - request_priv->requested = false; + remove_job_and_free(job); /* clean up the data */ cairo_surface_destroy(ecs->surface); - g_object_unref(ecs->renderer); - g_object_unref(ecs->request); g_free(ecs); return FALSE; @@ -598,7 +638,7 @@ recolor(private_t* priv, unsigned int page_width, unsigned int page_height, } static bool -render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) +render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* renderer) { private_t* priv = GET_PRIVATE(renderer); request_private_t* request_priv = REQUEST_GET_PRIVATE(request); @@ -650,10 +690,10 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) } /* before recoloring, check if we've been aborted */ - if (priv->about_to_close == true || request_priv->aborted == true) { + if (priv->about_to_close == true || job->aborted == true) { girara_debug("Rendering of page %d aborted", zathura_page_get_index(request_priv->page) + 1); - request_priv->requested = false; + remove_job_and_free(job); cairo_surface_destroy(surface); return true; } @@ -664,8 +704,7 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) } emit_completed_signal_t* ecs = g_malloc(sizeof(emit_completed_signal_t)); - ecs->renderer = g_object_ref(renderer); - ecs->request = g_object_ref(request); + ecs->job = job; ecs->surface = cairo_surface_reference(surface); /* emit signal from the main context, i.e. the main thread */ @@ -679,25 +718,26 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer) static void render_job(void* data, void* user_data) { - ZathuraRenderRequest* request = data; + render_job_t* job = data; + ZathuraRenderRequest* request = job->request; ZathuraRenderer* renderer = user_data; g_return_if_fail(ZATHURA_IS_RENDER_REQUEST(request)); g_return_if_fail(ZATHURA_IS_RENDERER(renderer)); private_t* priv = GET_PRIVATE(renderer); - request_private_t* request_priv = REQUEST_GET_PRIVATE(request); - if (priv->about_to_close == true || request_priv->aborted == true) { + if (priv->about_to_close == true || job->aborted == true) { /* back out early */ - request_priv->requested = false; + remove_job_and_free(job); return; } + request_private_t* request_priv = REQUEST_GET_PRIVATE(request); girara_debug("Rendering page %d ...", zathura_page_get_index(request_priv->page) + 1); - if (render(request, renderer) != true) { + if (render(job, request, renderer) != true) { girara_error("Rendering failed (page %d)\n", zathura_page_get_index(request_priv->page) + 1); - request_priv->requested = false; + remove_job_and_free(job); } } @@ -732,20 +772,20 @@ render_thread_sort(gconstpointer a, gconstpointer b, gpointer UNUSED(data)) return 0; } - ZathuraRenderRequest* request_a = (ZathuraRenderRequest*) a; - ZathuraRenderRequest* request_b = (ZathuraRenderRequest*) b; - request_private_t* priv_a = REQUEST_GET_PRIVATE(request_a); - request_private_t* priv_b = REQUEST_GET_PRIVATE(request_b); - if (priv_a->aborted == priv_b->aborted) { + const render_job_t* job_a = a; + const render_job_t* job_b = b; + if (job_a->aborted == job_b->aborted) { + request_private_t* priv_a = REQUEST_GET_PRIVATE(job_a->request); + request_private_t* priv_b = REQUEST_GET_PRIVATE(job_b->request); + return priv_a->last_view_time < priv_b->last_view_time ? -1 : (priv_a->last_view_time > priv_b->last_view_time ? 1 : 0); } /* sort aborted entries earlier so that the are thrown out of the queue */ - return priv_a->aborted ? 1 : -1; + return job_a->aborted ? 1 : -1; } - /* cache functions */ static bool From b2c14a3733baa5f46b64d0bda1f3ebf8eb00bf10 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Fri, 8 Nov 2013 20:29:08 +0100 Subject: [PATCH 90/90] Version 0.2.5 --- config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index 8d4586d..5223ac5 100644 --- a/config.mk +++ b/config.mk @@ -3,7 +3,7 @@ ZATHURA_VERSION_MAJOR = 0 ZATHURA_VERSION_MINOR = 2 -ZATHURA_VERSION_REV = 4 +ZATHURA_VERSION_REV = 5 # 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. @@ -18,7 +18,7 @@ ZATHURA_GTK_VERSION ?= 3 # girara GIRARA_VERSION_CHECK ?= 1 -GIRARA_MIN_VERSION = 0.1.6 +GIRARA_MIN_VERSION = 0.1.8 GIRARA_PKG_CONFIG_NAME = girara-gtk$(ZATHURA_GTK_VERSION) # glib GLIB_VERSION_CHECK ?= 1