diff --git a/commands.c b/commands.c index d81e9ac..4876c21 100644 --- a/commands.c +++ b/commands.c @@ -328,7 +328,7 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu g_object_set(page_widget, "search-results", result, NULL); if (firsthit == true) { if (page_id != 0) { - page_set_delayed(zathura, zathura_page_get_id(page)); + page_set_delayed(zathura, zathura_page_get_index(page)); } g_object_set(page_widget, "search-current", 0, NULL); firsthit = false; diff --git a/page.c b/page.c index c4a1a5c..7db963e 100644 --- a/page.c +++ b/page.c @@ -12,7 +12,7 @@ struct zathura_page_s { double height; /**< Page height */ double width; /**< Page width */ - unsigned int id; /**< Page number */ + unsigned int index; /**< Page number */ void* data; /**< Custom data */ bool visible; /**< Page is visible */ GtkWidget* widget; /**< Drawing area */ @@ -20,7 +20,7 @@ struct zathura_page_s { }; zathura_page_t* -zathura_page_new(zathura_document_t* document, unsigned int id, zathura_plugin_error_t* error) +zathura_page_new(zathura_document_t* document, unsigned int index, zathura_plugin_error_t* error) { if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) { if (error != NULL) { @@ -32,7 +32,7 @@ zathura_page_new(zathura_document_t* document, unsigned int id, zathura_plugin_e /* init page */ zathura_page_t* page = g_malloc0(sizeof(zathura_page_t)); - page->id = id; + page->index = index; page->visible = false; page->document = document; page->widget = zathura_page_widget_new(page); @@ -118,13 +118,13 @@ zathura_page_get_document(zathura_page_t* page) } unsigned int -zathura_page_get_id(zathura_page_t* page) +zathura_page_get_index(zathura_page_t* page) { if (page == NULL) { return 0; } - return page->id; + return page->index; } GtkWidget* diff --git a/page.h b/page.h index f85e397..3af64ae 100644 --- a/page.h +++ b/page.h @@ -11,11 +11,12 @@ * Get the page object * * @param document The document - * @param id Page number + * @param index Page number * @param error Optional error * @return Page object or NULL if an error occured */ -zathura_page_t* zathura_page_new(zathura_document_t* document, unsigned int id, zathura_plugin_error_t* error); +zathura_page_t* zathura_page_new(zathura_document_t* document, unsigned int + index, zathura_plugin_error_t* error); /** * Frees the page object @@ -41,7 +42,7 @@ zathura_document_t* zathura_page_get_document(zathura_page_t* page); * @param page The page object * @return The id of the page */ -unsigned int zathura_page_get_id(zathura_page_t* page); +unsigned int zathura_page_get_index(zathura_page_t* page); /** * Returns the page widget of the page diff --git a/render.c b/render.c index 6cb7a28..cea04a1 100644 --- a/render.c +++ b/render.c @@ -31,7 +31,7 @@ render_job(void* data, void* user_data) } if (render(zathura, page) != true) { - girara_error("Rendering failed (page %d)\n", zathura_page_get_id(page)); + girara_error("Rendering failed (page %d)\n", zathura_page_get_index(page)); } } diff --git a/shortcuts.c b/shortcuts.c index de04b48..15eca99 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -572,7 +572,7 @@ sc_search(girara_session_t* session, girara_argument_t* argument, for (int npage_id = 1; page_id < num_pages; ++npage_id) { int ntmp = cur_page + diff * (page_id + npage_id); zathura_page_t* npage = zathura->document->pages[(ntmp + 2*num_pages) % num_pages]; - zathura->document->current_page_number = zathura_page_get_id(npage); + zathura->document->current_page_number = zathura_page_get_index(npage); GtkWidget* npage_page_widget = zathura_page_get_widget(npage); g_object_get(npage_page_widget, "search-length", &num_search_results, NULL); if (num_search_results != 0) {