Merge branch 'develop' of pwmt.org:zathura into develop

This commit is contained in:
Moritz Lipp 2012-02-07 16:30:55 +01:00
commit ab03d2dd0b
8 changed files with 8 additions and 35 deletions

View File

@ -82,15 +82,12 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) {
page->visible = true;
girara_info("page %d visible", page_id);
if (updated == false && gdk_rectangle_intersect(&center, &page_rect, NULL) == TRUE) {
zathura->document->current_page_number = page_id;
updated = true;
}
} else {
page->visible = false;
girara_info("page %d not visible", page_id);
}
}

View File

@ -287,7 +287,7 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) {
zathura_page_t* page = zathura->document->pages[page_id];
if (page == NULL) {
if (page == NULL || page->visible == false) {
continue;
}

View File

@ -546,7 +546,7 @@ zathura_page_image_save(zathura_page_t* page, zathura_image_t* image, const char
}
bool
zathura_page_render(zathura_page_t* page, cairo_t* cairo)
zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing)
{
if (page == NULL || page->document == NULL || cairo == NULL) {
return NULL;
@ -557,7 +557,7 @@ zathura_page_render(zathura_page_t* page, cairo_t* cairo)
return NULL;
}
return page->document->functions.page_render_cairo(page, cairo);
return page->document->functions.page_render_cairo(page, cairo, printing);
}
zathura_index_element_t*

View File

@ -249,7 +249,7 @@ struct zathura_document_s
/**
* Renders the page
*/
bool (*page_render_cairo)(zathura_page_t* page, cairo_t* cairo);
bool (*page_render_cairo)(zathura_page_t* page, cairo_t* cairo, bool printing);
/**
* Free page
@ -420,9 +420,10 @@ bool zathura_page_image_save(zathura_page_t* page, zathura_image_t* image, const
*
* @param page The page object
* @param cairo Cairo object
* @param printing render for printing
* @return True if no error occured, otherwise false
*/
bool zathura_page_render(zathura_page_t* page, cairo_t* cairo);
bool zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing);
/**
* Create new index element

View File

@ -29,16 +29,6 @@ static gboolean zathura_page_view_expose(GtkWidget* widget, GdkEventExpose* even
static void zathura_page_view_finalize(GObject* object);
static void zathura_page_view_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec);
static void zathura_page_view_size_allocate(GtkWidget* widget, GdkRectangle* allocation);
static void zathura_page_view_grab_focus(GtkWidget* widget);
static gboolean zathura_page_view_focus_in(GtkWidget *widget, GtkDirectionType GIRARA_UNUSED(event))
{
ZathuraPageView* view = ZATHURA_PAGE_VIEW(widget);
zathura_page_view_private_t* priv = ZATHURA_PAGE_VIEW_GET_PRIVATE(view);
girara_info("lala: %d", priv->page->number);
return false;
}
enum properties_e
{
@ -56,8 +46,6 @@ zathura_page_view_class_init(ZathuraPageViewClass* class)
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(class);
widget_class->expose_event = zathura_page_view_expose;
widget_class->size_allocate = zathura_page_view_size_allocate;
widget_class->grab_focus = zathura_page_view_grab_focus;
widget_class->focus = zathura_page_view_focus_in;
GObjectClass* object_class = G_OBJECT_CLASS(class);
object_class->finalize = zathura_page_view_finalize;
@ -300,12 +288,3 @@ zathura_page_view_clear_rectangles(ZathuraPageView* widget)
GIRARA_LIST_FOREACH_END(priv->rectangles, pv_rect_t*, iter, rect);
girara_list_clear(priv->rectangles);
}
static void
zathura_page_view_grab_focus(GtkWidget* widget)
{
ZathuraPageView* view = ZATHURA_PAGE_VIEW(widget);
zathura_page_view_private_t* priv = ZATHURA_PAGE_VIEW_GET_PRIVATE(view);
girara_info("lala: %d", priv->page->number);
}

View File

@ -89,5 +89,5 @@ cb_print_draw_page(GtkPrintOperation* UNUSED(print_operation), GtkPrintContext*
return;
}
zathura_page_render(page, cairo);
zathura_page_render(page, cairo, true);
}

View File

@ -194,7 +194,7 @@ render(zathura_t* zathura, zathura_page_t* page)
cairo_scale(cairo, zathura->document->scale, zathura->document->scale);
}
if (zathura_page_render(page, cairo) == false) {
if (zathura_page_render(page, cairo, false) == false) {
cairo_destroy(cairo);
cairo_surface_destroy(surface);
gdk_threads_leave();

View File

@ -19,8 +19,6 @@ bool
sc_abort(girara_session_t* session, girara_argument_t* UNUSED(argument),
girara_event_t* UNUSED(event), unsigned int UNUSED(t))
{
girara_info("in sc_abort");
g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
@ -365,8 +363,6 @@ sc_search(girara_session_t* session, girara_argument_t* argument,
g_return_val_if_fail(argument != NULL, false);
g_return_val_if_fail(zathura->document != NULL, false);
girara_info("in sc_search");
return false;
}