diff options
author | Pekka Paalanen <ppaalanen@gmail.com> | 2011-11-30 10:52:38 +0200 |
---|---|---|
committer | Pekka Paalanen <ppaalanen@gmail.com> | 2011-12-14 11:17:46 +0200 |
commit | 999c5b5dcbd2130236336017c12c7e3c819128e2 (patch) | |
tree | ba4742eef9100a7b220621f2a52b7595793d4943 /clients/window.h | |
parent | 6e16811e5e329ca5101b57b3da36a6ffc5e1f3ef (diff) |
window: expose outputs to applications
Add output_configure_handler as a display property. This exposes only
configured outputs, that is the current mode info is already received,
to applications.
The handler is also called for mode changes on an existing output. This
simplifies the implementation in toytoolkit as we can defer the handler
calls from wl_output binding time to when we receive the current mode.
We do not need separate handlers for "new output" and "mode changed". A
plain "new output" handler would be problematic as the current mode is
not known yet.
Also add delete_handler hook for outputs, but that will never be called
for now, as the protocol lacks a way to signal output disconnections.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'clients/window.h')
-rw-r--r-- | clients/window.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clients/window.h b/clients/window.h index c1a85ee..e5dc008 100644 --- a/clients/window.h +++ b/clients/window.h @@ -49,6 +49,12 @@ struct rectangle { struct display * display_create(int *argc, char **argv[], const GOptionEntry *option_entries); +void +display_set_user_data(struct display *display, void *data); + +void * +display_get_user_data(struct display *display); + struct wl_display * display_get_display(struct display *display); @@ -61,6 +67,19 @@ display_get_shell(struct display *display); struct output * display_get_output(struct display *display); +typedef void (*display_output_handler_t)(struct output *output, void *data); + +/* + * The output configure handler is called, when a new output is connected + * and we know its current mode, or when the current mode changes. + * Test and set the output user data in your handler to know, if the + * output is new. Note: 'data' in the configure handler is the display + * user data. + */ +void +display_set_output_configure_handler(struct display *display, + display_output_handler_t handler); + struct wl_data_source * display_create_data_source(struct display *display); @@ -359,7 +378,19 @@ input_receive_selection_data(struct input *input, const char *mime_type, data_func_t func, void *data); void +output_set_user_data(struct output *output, void *data); + +void * +output_get_user_data(struct output *output); + +void +output_set_destroy_handler(struct output *output, + display_output_handler_t handler); + +void output_get_allocation(struct output *output, struct rectangle *allocation); +struct wl_output * +output_get_wl_output(struct output *output); #endif |