Graphical Window system. More...
#include <app/win.h>#include "gfx/gfx.h"#include "membag.h"Go to the source code of this file.
Data Structures | |
| struct | win_point |
| Geometric type describing a point or vector on screen, relative or absolute. More... | |
| struct | win_area |
| Geometric type describing an area on screen. More... | |
| struct | win_clip_region |
| Geometric type describing a clipping region, used when drawing windows. More... | |
| struct | win_pointer_event |
| Event data for all pointer events, e.g. touch screen or mouse. More... | |
| struct | win_keyboard_event |
| Event data for all keyboard events, e.g. full keyboards or smaller matrices. More... | |
| struct | win_command_event |
| Event data for command events, e.g. a button widget action command. More... | |
| struct | win_event |
| Event data for all events. More... | |
| struct | win_attributes |
| Window attribute data. More... | |
Defines | |
| #define | WIN_ATTR_POSITION (1 << 0) |
| Attribute mask for updating window position. | |
| #define | WIN_ATTR_SIZE (1 << 1) |
| Attribute mask for updating window size. | |
| #define | WIN_ATTR_BACKGROUND (1 << 2) |
| Attribute mask for updating window background type and color/pixmap. | |
| #define | WIN_ATTR_EVENTHANDLER (1 << 3) |
| Attribute mask for updating window event handler. | |
| #define | WIN_ATTR_BEHAVIOR (1 << 4) |
| Attribute mask for updating window behavior flags. | |
| #define | WIN_ATTR_CUSTOM (1 << 5) |
| Attribute mask for updating window custom data. | |
| #define | WIN_BEHAVIOR_RAISE_ON_PRESS (1 << 0) |
| Behavior mask for raising a window if itself or children are pressed. | |
| #define | WIN_BEHAVIOR_REDRAW_PARENT (1 << 1) |
| Behavior mask for requiring redraw of parent, e.g. transparent windows. | |
Typedefs | |
| typedef bool(* | win_event_handler_t )(struct win_window *win, enum win_event_type type, const void *data) |
| Function pointer type for window event handlers. | |
| typedef uint8_t | win_behavior_t |
| Data type holding window behavior flags. | |
| typedef uint8_t | win_attribute_mask_t |
| Datatype holding attribute masks, used when updating attributes. | |
Enumerations | |
| enum | win_pointer_event_type { WIN_POINTER_PRESS, WIN_POINTER_MOVE, WIN_POINTER_RELEASE } |
Valid pointer event types. More... | |
| enum | win_keyboard_event_type { WIN_KEYBOARD_PRESS, WIN_KEYBOARD_RELEASE } |
Valid keyboard event types. More... | |
| enum | win_event_type { WIN_EVENT_POINTER, WIN_EVENT_KEYBOARD, WIN_EVENT_COMMAND, WIN_EVENT_RAISE, WIN_EVENT_UNRAISE, WIN_EVENT_GETFOCUS, WIN_EVENT_LOSEFOCUS, WIN_EVENT_DRAW, WIN_EVENT_ATTRIBUTES, WIN_EVENT_DESTROY } |
Valid event types sent to a window event handler. More... | |
Functions | |
| void | win_init (void) |
| Initialize window system, set up root window, hook into touch driver. | |
| struct win_window * | win_get_root (void) |
| Get pointer to root window, i.e. desktop window. | |
| struct win_window * | win_get_parent (const struct win_window *win) |
| Get pointer to parent window, or NULL for root window. | |
| void | win_reset_root_geometry (void) |
| Reset root window geometry to fullscreen, in case screen orientation change. | |
| void | win_set_attributes (struct win_window *win, const struct win_attributes *new_attributes, win_attribute_mask_t attribute_mask) |
| Update window attributes, selected by the attribute mask. | |
| void | win_set_area (struct win_window *win, const struct win_area *new_area, win_attribute_mask_t attribute_mask) |
| Update window position and/or size. | |
| struct win_attributes * | win_get_attributes (const struct win_window *win) |
| Get a pointer to the window attribute struct. | |
| struct win_area * | win_get_area (const struct win_window *win) |
| Get a pointer to the window area struct. | |
| void * | win_get_custom_data (const struct win_window *win) |
| Get window custom data. | |
| struct win_window * | win_create (struct win_window *parent, const struct win_attributes *attributes) |
| Create a window and return its pointer. Use win_destroy() to free memory. | |
| void | win_destroy (struct win_window *win) |
| Destroy a window and its contents including children, freeing up memory. | |
| void | win_reparent (struct win_window *child, struct win_window *new_parent) |
| Change a window's parent. | |
| void | win_show (struct win_window *win) |
| Show window. Will draw it on screen if parent is visible as well. | |
| void | win_redraw (const struct win_window *win) |
| Redraw window and its contents, if visible. | |
| void | win_hide (struct win_window *win) |
| Hide a window, removing it from screen if is was visible. | |
| void | win_raise (struct win_window *win) |
| Raise window to top of all its siblings. | |
| void | win_lower (struct win_window *win) |
| Lower window to bottom of all its siblings. | |
| void | win_queue_pointer_event (const struct win_pointer_event *event) |
| Add a pointer event to the internal event queue. | |
| void | win_queue_keyboard_event (const struct win_keyboard_event *event) |
| Add a keyboard event to the internal event queue. | |
| void | win_queue_command_event (const struct win_command_event *event) |
| Add a command event to the internal event queue. | |
| void | win_process_events (void) |
| Process all pending events from the internal queue. | |
| void | win_set_keyboard_focus (struct win_window *win) |
| Set keyboard focus window or NULL, i.e. receiver of keyboard events. | |
| void | win_grab_pointer (struct win_window *win) |
| Set pointer focus window or NULL, i.e. override pointer event receiver. | |
| void | win_translate_win_to_root (struct win_window const *start_win, struct win_point *return_pos) |
| Compute window position on root window. | |
| bool | win_is_inside_clip (const struct win_clip_region *clip, const struct win_point *point) |
| Return true if point is inside clipping region. | |
| bool | win_is_inside_area (const struct win_area *area, const struct win_point *point) |
| Return true if point is inside area. | |
| bool | win_is_inside_window (const struct win_window *win, const struct win_point *point) |
| Return true if global point is inside window. | |
| void | win_compute_union (struct win_area *area, const struct win_area *merge) |
| Compute smallest box containing both areas, update first parameter. | |
| bool | win_compute_intersection (struct win_clip_region *clip, const struct win_area *area) |
| Compute the intersection of clipping region and area, update clip. | |
| bool | win_compute_clipping (const struct win_window *win, const struct win_area *dirty_area, struct win_clip_region *clip) |
| Compute clipping region in absolute coordinates from window and dirty area. | |
Graphical Window system.
Copyright (C) 2009 Atmel Corporation. All rights reserved.
Definition in file win.h.
1.6.3