#include <cairo.h>
#include "../shared/config-parser.h"
+#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
+
+#define container_of(ptr, type, member) ({ \
+ const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
struct window;
struct widget;
struct display;
uint32_t
display_get_serial(struct display *display);
+typedef void (*display_global_handler_t)(struct display *display,
+ uint32_t name,
+ const char *interface,
+ uint32_t version, void *data);
+
+void
+display_set_global_handler(struct display *display,
+ display_global_handler_t handler);
+void *
+display_bind(struct display *display, uint32_t name,
+ const struct wl_interface *interface, uint32_t version);
+
typedef void (*display_output_handler_t)(struct output *output, void *data);
/*
void
display_release_window_surface(struct display *display,
struct window *window);
-
-#ifdef HAVE_CAIRO_EGL
-EGLImageKHR
-display_get_image_for_egl_image_surface(struct display *display,
- cairo_surface_t *surface);
-#endif
#endif
#define SURFACE_OPAQUE 0x01
int fd, uint32_t events, struct task *task);
void
+display_unwatch_fd(struct display *display, int fd);
+
+void
display_run(struct display *d);
void
uint32_t button,
enum wl_pointer_button_state state,
void *data);
+typedef void (*widget_axis_handler_t)(struct widget *widget,
+ struct input *input, uint32_t time,
+ uint32_t axis,
+ wl_fixed_t value,
+ void *data);
struct window *
window_create(struct display *display);
struct window *
window_create_custom(struct display *display);
+int
+window_has_focus(struct window *window);
+
typedef void (*menu_func_t)(struct window *window, int index, void *data);
void
void
window_get_allocation(struct window *window, struct rectangle *allocation);
void
-window_set_transparent(struct window *window, int transparent);
-void
window_schedule_redraw(struct window *window);
void
window_schedule_resize(struct window *window, int width, int height);
void
window_set_buffer_type(struct window *window, enum window_buffer_type type);
+int
+window_is_fullscreen(struct window *window);
+
void
window_set_fullscreen(struct window *window, int fullscreen);
+int
+window_is_maximized(struct window *window);
+
void
window_set_maximized(struct window *window, int maximized);
void
widget_set_button_handler(struct widget *widget,
widget_button_handler_t handler);
+void
+widget_set_axis_handler(struct widget *widget,
+ widget_axis_handler_t handler);
void
widget_schedule_redraw(struct widget *widget);