summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2012-11-30 17:34:25 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-11-30 14:24:08 -0500
commit15256f66abd8398e240800d72c613fc028e34cf7 (patch)
tree4836de52f67f6ce0229babeedaf3716e9fa8a7d2 /clients
parent6d4cb4e8c425c9997cd7d35b589ce80ea2906785 (diff)
downloadweston-15256f66abd8398e240800d72c613fc028e34cf7.tar.gz
window: Add a way to retrieve a window's output transform
Add the output_get_transform() entry point and an output handler hook.
Diffstat (limited to 'clients')
-rw-r--r--clients/window.c23
-rw-r--r--clients/window.h9
2 files changed, 32 insertions, 0 deletions
diff --git a/clients/window.c b/clients/window.c
index d08542d8..de9e8d10 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -221,6 +221,7 @@ struct window {
window_drop_handler_t drop_handler;
window_close_handler_t close_handler;
window_fullscreen_handler_t fullscreen_handler;
+ window_output_handler_t output_handler;
struct wl_callback *frame_cb;
@@ -3387,6 +3388,13 @@ window_set_fullscreen_handler(struct window *window,
}
void
+window_set_output_handler(struct window *window,
+ window_output_handler_t handler)
+{
+ window->output_handler = handler;
+}
+
+void
window_set_title(struct window *window, const char *title)
{
free(window->title);
@@ -3446,6 +3454,10 @@ surface_enter(void *data,
window_output->output = output_found;
wl_list_insert (&window->window_output_list, &window_output->link);
+
+ if (window->output_handler)
+ window->output_handler(window, output_found, 1,
+ window->user_data);
}
static void
@@ -3465,6 +3477,11 @@ surface_leave(void *data,
if (window_output_found) {
wl_list_remove(&window_output_found->link);
+
+ if (window->output_handler)
+ window->output_handler(window, window_output->output,
+ 0, window->user_data);
+
free(window_output_found);
}
}
@@ -3892,6 +3909,12 @@ output_get_wl_output(struct output *output)
return output->output;
}
+enum wl_output_transform
+output_get_transform(struct output *output)
+{
+ return output->transform;
+}
+
static void
fini_xkb(struct input *input)
{
diff --git a/clients/window.h b/clients/window.h
index f13ea353..d356df98 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -193,6 +193,9 @@ typedef void (*window_drop_handler_t)(struct window *window,
typedef void (*window_close_handler_t)(struct window *window, 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 (*widget_resize_handler_t)(struct widget *widget,
int32_t width, int32_t height,
void *data);
@@ -332,6 +335,9 @@ window_set_close_handler(struct window *window,
void
window_set_fullscreen_handler(struct window *window,
window_fullscreen_handler_t handler);
+void
+window_set_output_handler(struct window *window,
+ window_output_handler_t handler);
void
window_set_title(struct window *window, const char *title);
@@ -465,6 +471,9 @@ output_get_allocation(struct output *output, struct rectangle *allocation);
struct wl_output *
output_get_wl_output(struct output *output);
+enum wl_output_transform
+output_get_transform(struct output *output);
+
void
keysym_modifiers_add(struct wl_array *modifiers_map,
const char *name);