mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 01:03:47 +01:00
Merge branch 'develop' of pwmt.org:zathura into develop
This commit is contained in:
commit
ab03d2dd0b
@ -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(¢er, &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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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*
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
2
print.c
2
print.c
@ -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);
|
||||
}
|
||||
|
2
render.c
2
render.c
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user