diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-12-07 19:59:11 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-12-07 20:05:36 -0500 |
commit | 0c4457f0c287aace452880674db8b3785b819235 (patch) | |
tree | 883195725bf643c285f3a76b3cda4e1da869470d /window.h | |
parent | dc0f355f0ace3538dfea541907aca53ec2ff9590 (diff) |
Refactor window logic into reusable parts, add a new terminal application.
The gears code is moved into a new file gearc.c and the window decoration
and management code stays in window.c. A new application 'terminal' is the
second user of the windowing code, but doesn't do anything useful yet.
Diffstat (limited to 'window.h')
-rw-r--r-- | window.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/window.h b/window.h new file mode 100644 index 0000000..cf35787 --- /dev/null +++ b/window.h @@ -0,0 +1,67 @@ +/* + * Copyright © 2008 Kristian Høgsberg + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _WINDOW_H_ +#define _WINDOW_H_ + +struct window; + +struct rectangle { + int32_t x; + int32_t y; + int32_t width; + int32_t height; +}; + +typedef void (*window_resize_handler_t)(struct window *window, int32_t width, int32_t height, void *data); +typedef void (*window_frame_handler_t)(struct window *window, uint32_t frame, uint32_t timestamp, void *data); +typedef void (*window_acknowledge_handler_t)(struct window *window, uint32_t key, void *data); + +struct window * +window_create(struct wl_display *display, int fd, + const char *title, + int32_t x, int32_t y, int32_t width, int32_t height); + +void +window_set_minimum_size(struct window *window, uint32_t width, int32_t height); + +void +window_draw(struct window *window); +void +window_get_child_rectangle(struct window *window, + struct rectangle *rectangle); +void +window_copy(struct window *window, + struct rectangle *rectangle, + uint32_t name, uint32_t stride); + +void +window_set_resize_handler(struct window *window, + window_resize_handler_t handler, void *data); +void +window_set_frame_handler(struct window *window, + window_frame_handler_t handler, void *data); +void +window_set_acknowledge_handler(struct window *window, + window_acknowledge_handler_t handler, void *data); + +#endif |