view: Make view compile again
This commit is contained in:
+7
-16
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
struct view {
|
struct view {
|
||||||
struct window *window;
|
struct window *window;
|
||||||
|
struct widget *widget;
|
||||||
struct display *display;
|
struct display *display;
|
||||||
|
|
||||||
PopplerDocument *document;
|
PopplerDocument *document;
|
||||||
@@ -51,8 +52,10 @@ struct view {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
view_draw(struct view *view)
|
redraw_handler(struct widget *widget, void *data)
|
||||||
{
|
{
|
||||||
|
struct view *view = data;
|
||||||
|
|
||||||
struct rectangle allocation;
|
struct rectangle allocation;
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
@@ -64,8 +67,6 @@ view_draw(struct view *view)
|
|||||||
else
|
else
|
||||||
window_set_transparent(view->window, 1);
|
window_set_transparent(view->window, 1);
|
||||||
|
|
||||||
window_draw(view->window);
|
|
||||||
|
|
||||||
widget_get_allocation(view->widget, &allocation);
|
widget_get_allocation(view->widget, &allocation);
|
||||||
|
|
||||||
surface = window_get_surface(view->window);
|
surface = window_get_surface(view->window);
|
||||||
@@ -107,15 +108,6 @@ view_draw(struct view *view)
|
|||||||
cairo_destroy(cr);
|
cairo_destroy(cr);
|
||||||
cairo_surface_destroy(surface);
|
cairo_surface_destroy(surface);
|
||||||
g_object_unref(G_OBJECT(page));
|
g_object_unref(G_OBJECT(page));
|
||||||
window_flush(view->window);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
redraw_handler(struct widget *widget, void *data)
|
|
||||||
{
|
|
||||||
struct view *view = data;
|
|
||||||
|
|
||||||
view_draw(view);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -150,11 +142,10 @@ view_page_down(struct view *view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
button_handler(struct window *window, struct input *input, uint32_t time,
|
button_handler(struct widget *widget, struct input *input, uint32_t time,
|
||||||
int button, int state, void *data)
|
int button, int state, void *data)
|
||||||
{
|
{
|
||||||
struct window *window = data;
|
struct view *view = data;
|
||||||
a struct view *view = window_get_user_data(window);
|
|
||||||
|
|
||||||
if(!state)
|
if(!state)
|
||||||
return;
|
return;
|
||||||
@@ -260,7 +251,7 @@ view_create(struct display *display,
|
|||||||
view->fullscreen = fullscreen;
|
view->fullscreen = fullscreen;
|
||||||
window_set_fullscreen(view->window, view->fullscreen);
|
window_set_fullscreen(view->window, view->fullscreen);
|
||||||
|
|
||||||
view_draw(view);
|
window_schedule_resize(view->window, 500, 400);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -106,7 +106,7 @@ if test x$enable_clients == xyes; then
|
|||||||
|
|
||||||
PKG_CHECK_MODULES(CLIENT, [wayland-client wayland-egl egl >= 7.10 gl cairo >= 1.10.0 gdk-pixbuf-2.0 glib-2.0 gobject-2.0 xkbcommon])
|
PKG_CHECK_MODULES(CLIENT, [wayland-client wayland-egl egl >= 7.10 gl cairo >= 1.10.0 gdk-pixbuf-2.0 glib-2.0 gobject-2.0 xkbcommon])
|
||||||
|
|
||||||
PKG_CHECK_MODULES(POPPLER, [poppler-glib gdk-2.0 gio-2.0],
|
PKG_CHECK_MODULES(POPPLER, [poppler-glib],
|
||||||
[have_poppler=yes], [have_poppler=no])
|
[have_poppler=yes], [have_poppler=no])
|
||||||
PKG_CHECK_MODULES(CAIRO_EGL, [cairo-egl >= 1.11.3],
|
PKG_CHECK_MODULES(CAIRO_EGL, [cairo-egl >= 1.11.3],
|
||||||
[have_cairo_egl=yes], [have_cairo_egl=no])
|
[have_cairo_egl=yes], [have_cairo_egl=no])
|
||||||
|
|||||||
Reference in New Issue
Block a user