Fix up some types

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2014-01-10 18:53:21 +01:00
parent bacdc19d23
commit 8d2e331b1a
3 changed files with 13 additions and 11 deletions

View file

@ -29,7 +29,6 @@
#include "render.h" #include "render.h"
#include "database.h" #include "database.h"
#include "page.h" #include "page.h"
#include "page-widget.h"
#include "plugin.h" #include "plugin.h"
/** Read a most GT_MAX_READ bytes before falling back to file. */ /** Read a most GT_MAX_READ bytes before falling back to file. */

3
page.c
View file

@ -316,7 +316,8 @@ zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathu
return functions->page_image_get_cairo(page, page->data, image, error); return functions->page_image_get_cairo(page, page->data, image, error);
} }
char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error) char*
zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error)
{ {
if (page == NULL || page->document == NULL ) { if (page == NULL || page->document == NULL ) {
if (error) { if (error) {

View file

@ -984,10 +984,12 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument,
switch(argument->n) { switch(argument->n) {
case TOP: case TOP:
/* go to the first node */
gtk_tree_path_free(path); gtk_tree_path_free(path);
path = gtk_tree_path_new_first(); path = gtk_tree_path_new_first();
break; break;
case BOTTOM: case BOTTOM:
/* go to the last visiible node */
gtk_tree_path_free(path); gtk_tree_path_free(path);
path = gtk_tree_path_new_from_indices(gtk_tree_model_iter_n_children(model, NULL) - 1, -1); path = gtk_tree_path_new_from_indices(gtk_tree_model_iter_n_children(model, NULL) - 1, -1);
gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get_iter(model, &iter, path);
@ -1343,9 +1345,9 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
int value = 1; int value = 1;
girara_setting_get(zathura->ui.session, "zoom-step", &value); girara_setting_get(zathura->ui.session, "zoom-step", &value);
int nt = (t == 0) ? 1 : t; const int nt = (t == 0) ? 1 : t;
float zoom_step = value / 100.0f * nt; const double zoom_step = value / 100.0 * nt;
float old_zoom = zathura_document_get_scale(zathura->document); const double old_zoom = zathura_document_get_scale(zathura->document);
/* specify new zoom value */ /* specify new zoom value */
if (argument->n == ZOOM_IN) { if (argument->n == ZOOM_IN) {
@ -1354,12 +1356,12 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
zathura_document_set_scale(zathura->document, old_zoom - zoom_step); zathura_document_set_scale(zathura->document, old_zoom - zoom_step);
} else if (argument->n == ZOOM_SPECIFIC) { } else if (argument->n == ZOOM_SPECIFIC) {
if (t == 0) { if (t == 0) {
zathura_document_set_scale(zathura->document, 1.0f); zathura_document_set_scale(zathura->document, 1.0);
} else { } else {
zathura_document_set_scale(zathura->document, t / 100.0f); zathura_document_set_scale(zathura->document, t / 100.0);
} }
} else { } else {
zathura_document_set_scale(zathura->document, 1.0f); zathura_document_set_scale(zathura->document, 1.0);
} }
/* zoom limitations */ /* zoom limitations */
@ -1368,10 +1370,10 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
girara_setting_get(session, "zoom-min", &zoom_min_int); girara_setting_get(session, "zoom-min", &zoom_min_int);
girara_setting_get(session, "zoom-max", &zoom_max_int); girara_setting_get(session, "zoom-max", &zoom_max_int);
float zoom_min = zoom_min_int * 0.01f; const double zoom_min = zoom_min_int * 0.01;
float zoom_max = zoom_max_int * 0.01f; const double zoom_max = zoom_max_int * 0.01;
float scale = zathura_document_get_scale(zathura->document); const double scale = zathura_document_get_scale(zathura->document);
if (scale < zoom_min) { if (scale < zoom_min) {
zathura_document_set_scale(zathura->document, zoom_min); zathura_document_set_scale(zathura->document, zoom_min);
} else if (scale > zoom_max) { } else if (scale > zoom_max) {