compositor-x11: Rename the output make to "weston-X11"
[platform/upstream/weston.git] / clients / window.h
index ff7c87b..5247f19 100644 (file)
 #ifndef _WINDOW_H_
 #define _WINDOW_H_
 
+#include "config.h"
+
 #include <xkbcommon/xkbcommon.h>
 #include <wayland-client.h>
 #include <cairo.h>
 #include "../shared/config-parser.h"
 #include "../shared/zalloc.h"
-#include "subsurface-client-protocol.h"
 
 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
 
@@ -62,6 +63,8 @@ void *
 xzalloc(size_t s);
 char *
 xstrdup(const char *s);
+void *
+xrealloc(char *p, size_t s);
 
 struct display *
 display_create(int *argc, char *argv[]);
@@ -87,9 +90,6 @@ display_get_cairo_device(struct display *display);
 struct wl_compositor *
 display_get_compositor(struct display *display);
 
-struct wl_shell *
-display_get_shell(struct display *display);
-
 struct output *
 display_get_output(struct display *display);
 
@@ -214,11 +214,13 @@ typedef void (*window_drop_handler_t)(struct window *window,
                                      struct input *input,
                                      int32_t x, int32_t y, void *data);
 
-typedef void (*window_close_handler_t)(struct window *window, void *data);
+typedef void (*window_close_handler_t)(void *data);
 typedef void (*window_fullscreen_handler_t)(struct window *window, void *data);
 
 typedef void (*window_output_handler_t)(struct window *window, struct output *output,
                                        int enter, void *data);
+typedef void (*window_state_changed_handler_t)(struct window *window,
+                                              void *data);
 
 typedef void (*widget_resize_handler_t)(struct widget *widget,
                                        int32_t width, int32_t height,
@@ -272,17 +274,23 @@ typedef void (*widget_axis_handler_t)(struct widget *widget,
 struct window *
 window_create(struct display *display);
 struct window *
-window_create_transient(struct display *display, struct window *parent,
-                       int32_t x, int32_t y, uint32_t flags);
-struct window *
 window_create_custom(struct display *display);
 
+void
+window_set_parent(struct window *window, struct window *parent_window);
+struct window *
+window_get_parent(struct window *window);
+
 int
 window_has_focus(struct window *window);
 
-typedef void (*menu_func_t)(struct window *window,
-                           struct input *input, int index, void *data);
+typedef void (*menu_func_t)(void *data, struct input *input, int index);
 
+struct window *
+window_create_menu(struct display *display,
+                  struct input *input, uint32_t time,
+                  menu_func_t func, const char **entries, int count,
+                  void *user_data);
 void
 window_show_menu(struct display *display,
                 struct input *input, uint32_t time, struct window *parent,
@@ -333,8 +341,6 @@ window_get_display(struct window *window);
 void
 window_move(struct window *window, struct input *input, uint32_t time);
 void
-window_touch_move(struct window *window, struct input *input, uint32_t time);
-void
 window_get_allocation(struct window *window, struct rectangle *allocation);
 void
 window_schedule_redraw(struct window *window);
@@ -351,8 +357,8 @@ window_get_surface(struct window *window);
 struct wl_surface *
 window_get_wl_surface(struct window *window);
 
-struct wl_shell_surface *
-window_get_wl_shell_surface(struct window *window);
+struct wl_subsurface *
+widget_get_wl_subsurface(struct widget *widget);
 
 enum window_buffer_type {
        WINDOW_BUFFER_TYPE_EGL_WINDOW,
@@ -366,21 +372,27 @@ display_surface_damage(struct display *display, cairo_surface_t *cairo_surface,
 void
 window_set_buffer_type(struct window *window, enum window_buffer_type type);
 
+enum window_buffer_type
+window_get_buffer_type(struct window *window);
+
 int
 window_is_fullscreen(struct window *window);
 
 void
 window_set_fullscreen(struct window *window, int fullscreen);
 
-void
-window_set_fullscreen_method(struct window *window,
-                            enum wl_shell_surface_fullscreen_method method);
 int
 window_is_maximized(struct window *window);
 
 void
 window_set_maximized(struct window *window, int maximized);
 
+int
+window_is_resizing(struct window *window);
+
+void
+window_set_minimized(struct window *window);
+
 void
 window_set_user_data(struct window *window, void *data);
 
@@ -412,6 +424,9 @@ window_set_fullscreen_handler(struct window *window,
 void
 window_set_output_handler(struct window *window,
                          window_output_handler_t handler);
+void
+window_set_state_changed_handler(struct window *window,
+                                window_state_changed_handler_t handler);
 
 void
 window_set_title(struct window *window, const char *title);
@@ -510,6 +525,8 @@ widget_set_axis_handler(struct widget *widget,
                        widget_axis_handler_t handler);
 void
 widget_schedule_redraw(struct widget *widget);
+void
+widget_set_use_cairo(struct widget *widget, int use_cairo);
 
 struct widget *
 window_frame_create(struct window *window, void *data);
@@ -524,6 +541,9 @@ input_set_pointer_image(struct input *input, int pointer);
 void
 input_get_position(struct input *input, int32_t *x, int32_t *y);
 
+int
+input_get_touch(struct input *input, int32_t id, float *x, float *y);
+
 #define MOD_SHIFT_MASK         0x01
 #define MOD_ALT_MASK           0x02
 #define MOD_CONTROL_MASK       0x04
@@ -532,6 +552,12 @@ uint32_t
 input_get_modifiers(struct input *input);
 
 void
+touch_grab(struct input *input, int32_t touch_id);
+
+void
+touch_ungrab(struct input *input);
+
+void
 input_grab(struct input *input, struct widget *widget, uint32_t button);
 
 void
@@ -593,6 +619,12 @@ output_get_transform(struct output *output);
 uint32_t
 output_get_scale(struct output *output);
 
+const char *
+output_get_make(struct output *output);
+
+const char *
+output_get_model(struct output *output);
+
 void
 keysym_modifiers_add(struct wl_array *modifiers_map,
                     const char *name);