Window system for organizing window elements in a graphical user interface (GUI)
See "AVR1614: Widget Toolkit - Getting Started".
The window system is a module for organizing two dimensional windows. Windows are organized in a tree strcture where each window can have one parent but several children. The window system also allows events to be queued and handled by the event handler of the affected windows.
A window is defined with the following properties:
The window system can be used separately or together with the Widget toolkit.
The windows are organized in a tree structure. A window can be used for graphical user interface (GUI) elements drawn on a screen or display. These elements are often called widgets. The window system can be used to organize any built-in or custom widget. Some examples of widgets are frame, static text, button, checkbox or more advanced widgets like an analog clock.
Each window can have children, and the child windows must be contained within the area of the parent window. This means the child window can be as large as, but not be larger than the parent window. A root window filling the entire screen is created when the window system is initialized with win_init. If the screen orientation changes the root window can be re-initialized with win_reset_root_geometry. A pointer to the root window is returned from win_get_root.
The following figure shows the relations between windows that are used to represent some example widgets. In the figure we show the top_child and next_sibling pointers. The parent and prev_sibling pointers which point in the opposite direction are omitted to simplify the figure.
The figure also illustrates how the position and size affects how the windows could be represented on a display.
A window can only be shown if it has been mapped to the screen with the win_show function and that the parent windows are also mapped to the screen.
When a window is drawn, the following happens:
Propagation of events are an important part of the window system. Events are added to the event queue with one of queue functions (win_queue_pointer_event, win_queue_keyboard_event, win_queue_command_event). Pending events in the event queue can be processed by calling the win_process_events function in the main application loop.
The events are handled differently depending on the event. Valid event types are defined by win_event_type.
This component driver depends on the following modules:
Data Structures | |
struct | win_area |
Geometric type describing an area on screen. More... | |
struct | win_attributes |
Window attribute data. More... | |
struct | win_clip_region |
Geometric type describing a clipping region, used when drawing windows. More... | |
struct | win_command_event |
Event data for command events, e.g. More... | |
struct | win_event |
Event data for all events. More... | |
struct | win_event_queue |
Event queue control struct. More... | |
struct | win_keyboard_event |
Event data for all keyboard events, e.g. More... | |
struct | win_point |
Geometric type describing a point or vector on screen, relative or absolute. More... | |
struct | win_pointer_event |
Event data for all pointer events, e.g. More... | |
struct | win_window |
Window control data. More... | |
Macros | |
#define | WIN_ATTR_BACKGROUND (1 << 2) |
Attribute mask for updating window background type and color/pixmap. More... | |
#define | WIN_ATTR_BEHAVIOR (1 << 4) |
Attribute mask for updating window behavior flags. More... | |
#define | WIN_ATTR_CUSTOM (1 << 5) |
Attribute mask for updating window custom data. More... | |
#define | WIN_ATTR_EVENTHANDLER (1 << 3) |
Attribute mask for updating window event handler. More... | |
#define | WIN_ATTR_POSITION (1 << 0) |
Attribute mask for updating window position. More... | |
#define | WIN_ATTR_SIZE (1 << 1) |
Attribute mask for updating window size. More... | |
#define | WIN_BEHAVIOR_RAISE_ON_PRESS (1 << 0) |
Behavior mask for raising a window if itself or children are pressed. More... | |
#define | WIN_BEHAVIOR_REDRAW_PARENT (1 << 1) |
Behavior mask for requiring redraw of parent, e.g. More... | |
#define | WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events. More... | |
#define | WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events. More... | |
#define | WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events. More... | |
#define | WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events. More... | |
#define | WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events. More... | |
#define | WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie. More... | |
#define | WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie. More... | |
#define | WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie. More... | |
#define | WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie. More... | |
#define | WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie. More... | |
#define | WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden. More... | |
#define | WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden. More... | |
#define | WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden. More... | |
#define | WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden. More... | |
#define | WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden. More... | |
#define | WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens. More... | |
#define | WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens. More... | |
#define | WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens. More... | |
#define | WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens. More... | |
#define | WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens. More... | |
Typedefs | |
typedef uint16_t | clock_jiffy_t |
Data type holding timestamp for events. More... | |
typedef uint16_t | clock_jiffy_t |
Data type holding timestamp for events. More... | |
typedef uint16_t | clock_jiffy_t |
Data type holding timestamp for events. More... | |
typedef uint16_t | clock_jiffy_t |
Data type holding timestamp for events. More... | |
typedef uint16_t | clock_jiffy_t |
Data type holding timestamp for events. More... | |
typedef uint8_t | win_attribute_mask_t |
Datatype holding attribute masks, used when updating attributes. More... | |
typedef uint8_t | win_behavior_t |
Data type holding window behavior flags. More... | |
typedef uint8_t | win_button_mask_t |
Datatype holding button state mask for pointer input devices. More... | |
typedef uint8_t | win_button_mask_t |
Datatype holding button state mask for pointer input devices. More... | |
typedef uint8_t | win_button_mask_t |
Datatype holding button state mask for pointer input devices. More... | |
typedef uint8_t | win_button_mask_t |
Datatype holding button state mask for pointer input devices. More... | |
typedef uint8_t | win_button_mask_t |
Datatype holding button state mask for pointer input devices. More... | |
typedef void * | win_command_t |
Custom data, can be used as a data pointer or data depending on the application. More... | |
typedef void * | win_command_t |
Custom data, can be used as a data pointer or data depending on the application. More... | |
typedef void * | win_command_t |
Custom data, can be used as a data pointer or data depending on the application. More... | |
typedef void * | win_command_t |
Custom data, can be used as a data pointer or data depending on the application. More... | |
typedef char | win_command_t |
Custom data, can be used as a data pointer or data depending on the application. More... | |
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. More... | |
typedef uint8_t | win_event_queue_size_t |
Datatype holding sizes for the event queue. More... | |
typedef uint8_t | win_event_queue_size_t |
Datatype holding sizes for the event queue. More... | |
typedef uint8_t | win_event_queue_size_t |
Datatype holding sizes for the event queue. More... | |
typedef uint8_t | win_event_queue_size_t |
Datatype holding sizes for the event queue. More... | |
typedef uint8_t | win_event_queue_size_t |
Datatype holding sizes for the event queue. More... | |
typedef uint8_t | win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices. More... | |
typedef uint8_t | win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices. More... | |
typedef uint8_t | win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices. More... | |
typedef uint8_t | win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices. More... | |
typedef uint8_t | win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices. More... | |
Enumerations | |
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... | |
enum | win_keyboard_event_type { WIN_KEYBOARD_PRESS, WIN_KEYBOARD_RELEASE } |
Valid keyboard event types. More... | |
enum | win_pointer_event_type { WIN_POINTER_PRESS, WIN_POINTER_MOVE, WIN_POINTER_RELEASE } |
Valid pointer event types. More... | |
Functions | |
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 coords from window and dirty area. More... | |
bool | win_compute_intersection (struct win_clip_region *clip, const struct win_area *area) |
Compute the intersection of clipping region and area. More... | |
void | win_compute_union (struct win_area *area, const struct win_area *merge) |
Compute the smallest square containing two areas. More... | |
struct win_window * | win_create (struct win_window *parent, const struct win_attributes *attributes) |
Create a window and return its pointer. More... | |
void | win_destroy (struct win_window *win) |
Destroy a window, its contents and children to free up memory. More... | |
struct win_area * | win_get_area (const struct win_window *win) |
Get a pointer to the window area struct. More... | |
struct win_attributes * | win_get_attributes (const struct win_window *win) |
Get a pointer to the window attribute struct. More... | |
void * | win_get_custom_data (const struct win_window *win) |
Get window custom data. More... | |
struct win_window * | win_get_parent (const struct win_window *win) |
Get pointer to parent window, or NULL for root window. More... | |
struct win_window * | win_get_root (void) |
Get pointer to root window, i.e. More... | |
void | win_grab_pointer (struct win_window *win) |
Set pointer focus window or NULL, i.e. More... | |
void | win_hide (struct win_window *win) |
Hide window, clear it from screen if it was visible. More... | |
void | win_inflate_area (struct win_area *area, int16_t size) |
Expands a given area in all directions by a given amount. More... | |
void | win_init (void) |
Initialize window system, set up root window, hook into touch driver. More... | |
bool | win_is_inside_area (const struct win_area *area, const struct win_point *point) |
Check if point is inside area. More... | |
bool | win_is_inside_clip (const struct win_clip_region *clip, const struct win_point *point) |
Check if point is inside clipping region. More... | |
bool | win_is_inside_window (const struct win_window *win, const struct win_point *point) |
Check if global point is inside window. More... | |
void | win_lower (struct win_window *win) |
Lower window to bottom of all its siblings. More... | |
static void | win_process_command_event (struct win_command_event *cevent) |
Process a command event. More... | |
void | win_process_events (void) |
Process all pending events from the internal queue. More... | |
static void | win_process_keyboard_event (struct win_keyboard_event *kevent) |
Process a keyboard event. More... | |
void | win_queue_command_event (const struct win_command_event *event) |
Add a command event to the internal event queue. More... | |
void | win_queue_keyboard_event (const struct win_keyboard_event *event) |
Add a keyboard event to the internal event queue. More... | |
void | win_queue_pointer_event (const struct win_pointer_event *event) |
Add a pointer event to the internal event queue. More... | |
void | win_raise (struct win_window *win) |
Raise window to top of all its siblings. More... | |
void | win_redraw (struct win_window *win) |
Redraw window and its contents, if visible. More... | |
void | win_reparent (struct win_window *child, struct win_window *new_parent) |
Change a window's parent. More... | |
void | win_reset_root_geometry (void) |
Reset root window geometry to fullscreen. More... | |
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. More... | |
void | win_set_attributes (struct win_window *win, const struct win_attributes *new_attributes, win_attribute_mask_t attribute_mask) |
Update window attributes specified in attribute mask. More... | |
void | win_set_keyboard_focus (struct win_window *win) |
Set keyboard focus window or NULL, i.e., receiver of keyboard events. More... | |
void | win_show (struct win_window *win) |
Show window, draw it to screen if parent is visible. More... | |
void | win_translate_win_to_root (struct win_window const *start_win, struct win_point *return_pos) |
Compute window position on root window. More... | |
Internal functions | |
| |
static bool | win_is_visible (const struct win_window *win) |
Check if window and all parents, grand parents, etc. More... | |
static void | win_draw (struct win_window *win, const struct win_area *dirty_area) |
Draw window, all its siblings and parents within dirty area. More... | |
static void | win_draw_parent (struct win_window *child, const struct win_area *dirty_area) |
Draw parent window, with all child windows, within dirty area. More... | |
static void | win_draw_contents (struct win_window *win, const struct win_clip_region *clip) |
Draw window background and contents, including children, within clip. More... | |
static void | win_draw_child (struct win_window *child, const struct win_clip_region *parent_clip) |
Draw child window, with automatic translation of parent's clip region. More... | |
static bool | win_translate_area_to_parent (struct win_area *area, const struct win_window *parent) |
Translate an area to coordinates relative to parent's origin. More... | |
static void | win_destroy_children (struct win_window *win) |
Destroy child windows, freeing allocated memory. More... | |
static void | win_unlink (struct win_window *win) |
Remove window from parent's linked list. More... | |
static void | win_add_top_child (struct win_window *parent, struct win_window *child) |
Add window as first child in parent's linked list. More... | |
static void | win_process_pointer_event (struct win_pointer_event *event) |
Helper function for processing pointer events. More... | |
static bool | win_handle_pointer_event (struct win_window *win, const struct win_pointer_event *event, const struct win_point *pos) |
Handle pointer event in the window at the pointer coordinates. More... | |
static bool | win_handle_event (struct win_window *win, enum win_event_type type, const void *data) |
Call window's event handler, if one is set. More... | |
static void | win_queue_event (const struct win_event *event) |
Add an event to the internal queue. More... | |
static void | win_pop_front_event (void) |
Remove front event from internal queue. More... | |
static bool | win_are_events_pending (void) |
Check if internal queue has pending events. More... | |
Internal variables | |
static struct win_window | win_root |
Root window, i.e. More... | |
static struct win_event | win_event_queue_buffer [WIN_EVENT_QUEUE_SIZE] |
Event queue data buffer. More... | |
static struct win_event_queue | win_event_queue |
Window event queue. More... | |
static uint32_t | win_num_dropped_events |
Diagnostic value counting number of dropped events due to event queue full. More... | |
static struct win_window * | win_pointer_grabber |
Current pointer grabbing window, or NULL. More... | |
static struct win_window * | win_keyboard_focus |
Current keyboard focus, or NULL. More... | |
static struct win_point | win_last_pointer_pos |
Stores last pointer event position, in absolute coordinates. More... | |
static struct gfx_bitmap | win_root_background |
Frame background bitmap. More... | |
#define WIN_ATTR_BACKGROUND (1 << 2) |
Attribute mask for updating window background type and color/pixmap.
Referenced by setup_gui_root_window(), setup_root_window(), and win_set_attributes().
#define WIN_ATTR_BEHAVIOR (1 << 4) |
Attribute mask for updating window behavior flags.
Referenced by win_set_attributes().
#define WIN_ATTR_CUSTOM (1 << 5) |
Attribute mask for updating window custom data.
Referenced by win_set_attributes().
#define WIN_ATTR_EVENTHANDLER (1 << 3) |
Attribute mask for updating window event handler.
Referenced by win_set_attributes().
#define WIN_ATTR_POSITION (1 << 0) |
Attribute mask for updating window position.
Referenced by win_set_area(), win_set_attributes(), wtk_handle_frame_release(), and wtk_resize_frame().
#define WIN_ATTR_SIZE (1 << 1) |
Attribute mask for updating window size.
Referenced by win_reset_root_geometry(), win_set_area(), win_set_attributes(), and wtk_resize_frame().
#define WIN_BEHAVIOR_RAISE_ON_PRESS (1 << 0) |
Behavior mask for raising a window if itself or children are pressed.
Referenced by win_handle_pointer_event(), and wtk_frame_create().
#define WIN_BEHAVIOR_REDRAW_PARENT (1 << 1) |
Behavior mask for requiring redraw of parent, e.g.
transparent windows.
Referenced by win_draw(), wtk_basic_frame_create(), wtk_check_box_create(), wtk_label_create(), wtk_plot_create(), and wtk_radio_button_create().
#define WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events.
#define WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events.
#define WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events.
Referenced by win_init().
#define WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events.
#define WIN_EVENT_QUEUE_SIZE 10 |
Size of event queue, holding both input and command events.
#define WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie.
the desktop.
#define WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie.
the desktop.
#define WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie.
the desktop.
#define WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie.
the desktop.
#define WIN_ROOT_COLOR GFX_COLOR(0, 0, 0) |
Background color of root window, ie.
the desktop.
#define WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden.
#define WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden.
#define WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden.
#define WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden.
Referenced by win_hide().
#define WIN_SCREEN_COLOR GFX_COLOR(0, 0, 0) |
Screen background color used when root window is hidden.
#define WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens.
#define WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens.
#define WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens.
Referenced by main(), and read_touch_event().
#define WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens.
#define WIN_TOUCH_BUTTON (1 << 0) |
Button mask for touch screens.
typedef uint16_t clock_jiffy_t |
Data type holding timestamp for events.
typedef uint16_t clock_jiffy_t |
Data type holding timestamp for events.
typedef uint16_t clock_jiffy_t |
Data type holding timestamp for events.
typedef uint16_t clock_jiffy_t |
Data type holding timestamp for events.
typedef uint16_t clock_jiffy_t |
Data type holding timestamp for events.
typedef uint8_t win_attribute_mask_t |
Datatype holding attribute masks, used when updating attributes.
typedef uint8_t win_behavior_t |
Data type holding window behavior flags.
typedef uint8_t win_button_mask_t |
Datatype holding button state mask for pointer input devices.
typedef uint8_t win_button_mask_t |
Datatype holding button state mask for pointer input devices.
typedef uint8_t win_button_mask_t |
Datatype holding button state mask for pointer input devices.
typedef uint8_t win_button_mask_t |
Datatype holding button state mask for pointer input devices.
typedef uint8_t win_button_mask_t |
Datatype holding button state mask for pointer input devices.
typedef void* win_command_t |
Custom data, can be used as a data pointer or data depending on the application.
typedef void* win_command_t |
Custom data, can be used as a data pointer or data depending on the application.
typedef void* win_command_t |
Custom data, can be used as a data pointer or data depending on the application.
typedef void* win_command_t |
Custom data, can be used as a data pointer or data depending on the application.
typedef char win_command_t |
Custom data, can be used as a data pointer or data depending on the application.
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.
win | Pointer to window to handle the event for. |
type | Event type specifier. |
data | Pointer to event-specific data. |
true | if event was accepted by the window. |
false | if event was rejected by the window. |
typedef uint8_t win_event_queue_size_t |
Datatype holding sizes for the event queue.
typedef uint8_t win_event_queue_size_t |
Datatype holding sizes for the event queue.
typedef uint8_t win_event_queue_size_t |
Datatype holding sizes for the event queue.
typedef uint8_t win_event_queue_size_t |
Datatype holding sizes for the event queue.
typedef uint8_t win_event_queue_size_t |
Datatype holding sizes for the event queue.
typedef uint8_t win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices.
typedef uint8_t win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices.
typedef uint8_t win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices.
typedef uint8_t win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices.
typedef uint8_t win_keycode_t |
Datatype holding the key "scan" code for keyboard input devices.
enum win_event_type |
Valid event types sent to a window event handler.
|
static |
Add window as first child in parent's linked list.
This function adds a child window as the top window of a parent.
parent | Parent window for this child. |
child | Child window to add to parent. |
References win_window::next_sibling, win_window::parent, win_window::prev_sibling, and win_window::top_child.
Referenced by win_create(), win_lower(), win_raise(), and win_reparent().
|
static |
Check if internal queue has pending events.
This function returns true if the internal event queue is not empty.
References cpu_irq_restore(), cpu_irq_save(), and win_event_queue::used.
Referenced by win_process_events().
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 coords from window and dirty area.
This function computes a clipping region given a window and an area given in that window's coordinate system. The area is translated to screen coordinates by translating from parent to parent until the root window is reached. Also, the area is clipped to fit, inside the window, and its parents. Use this function to compute a clipping region for updating parts of a window. If the resulting region is an empty set, the function returns false.
The dirty_area parameter is given in the same coordinate system as the window's area struct. This means that if you provide a pointer to the window's area as the dirty_area parameter, you get a clipping region covering the entire window.
win | The window to start from. |
dirty_area | Area to be clipped, same coordinate system as window. |
clip | Resulting clipping region, global coordinates. |
true | The resulting region is valid. |
false | The resulting region is an empty set. |
References win_attributes::area, win_window::attributes, win_clip_region::NW, win_clip_region::origin, win_window::parent, win_area::pos, win_clip_region::SE, win_area::size, win_compute_intersection(), win_root, win_point::x, and win_point::y.
Referenced by win_draw(), and win_is_inside_window().
bool win_compute_intersection | ( | struct win_clip_region * | clip, |
const struct win_area * | area | ||
) |
Compute the intersection of clipping region and area.
This function computes the intersection of a clipping region and an area. The clipping region is updated with the result, so that the new region only contains the area common to both the original region and the area. If the clipping region and the area did not share any areas, i.e. the result is empty set, then the function returns false.
clip | Original clipping region, and also where the result is stored. |
area | Area to compute intersection with. |
true | The resulting area is valid. |
false | The resulting area is an empty set. |
References win_clip_region::NW, win_area::pos, win_clip_region::SE, win_area::size, win_point::x, and win_point::y.
Referenced by win_compute_clipping().
Compute the smallest square containing two areas.
This function computes the smallest area the will fit both areas. The new area is copied into the first parameter.
area | First area, and also where the result is stored. |
merge | Second area, which is "merged" with the first. |
References win_area::pos, win_area::size, win_point::x, and win_point::y.
Referenced by win_set_area().
struct win_window * win_create | ( | struct win_window * | parent, |
const struct win_attributes * | attributes | ||
) |
Create a window and return its pointer.
This function attempts to allocate memory for a new window from the dynamic memory pool. If successful, it initializes the window and attaches it to the parent, raising it to the top of all siblings, and returns the window pointer. If it fails, the function returns NULL.
Use win_destroy() to properly free the allocated memory. Refer to the win_destroy() function for more details on the destroy procedure.
parent | Pointer to parent window. |
attributes | Pointer to initial attributes. |
References Assert, win_window::attributes, win_window::is_mapped, membag_alloc(), win_window::top_child, and win_add_top_child().
Referenced by wtk_basic_frame_create(), wtk_button_create(), wtk_check_box_create(), wtk_frame_create(), wtk_icon_button_create(), wtk_label_create(), wtk_plot_create(), wtk_progress_bar_create(), wtk_radio_button_create(), and wtk_slider_create().
void win_destroy | ( | struct win_window * | win | ) |
Destroy a window, its contents and children to free up memory.
This function hides a window, detaches it from its parent. It then frees all memory allocated by all its children, grand children etc, and itself. Before freeing the memory, a DESTROY event is sent to each window's event handler. Use this event to free memory and resources allocated by e.g. widget toolkits. Since each window is detached from its parent before sending the DESTROY event, the event handling should never attempt to refer to parent windows.
win | Pointer to window. |
References Assert, win_window::is_mapped, membag_free(), win_destroy_children(), WIN_EVENT_DESTROY, win_handle_event(), win_hide(), win_root, and win_unlink().
Referenced by app_widget_launch(), wtk_basic_frame_handler(), wtk_frame_create(), and wtk_frame_handler().
|
static |
Destroy child windows, freeing allocated memory.
This function is a helper function for the win_destroy() function. For every child window, it asks it to destroy its children, then it send a DESTROY event to the child, and finally frees the allocated memory. The window's DESTROY event handler should free any other memory or resources allocated by e.g. widgets.
win | Window whose children should be destroyed. |
References membag_free(), win_window::next_sibling, win_window::top_child, WIN_EVENT_DESTROY, and win_handle_event().
Referenced by win_destroy().
|
static |
Draw window, all its siblings and parents within dirty area.
This function takes care of the actual drawing of all or parts of a window. If the window is not the top window, i.e. obscured by other windows, these other windows are also redrawn in the proper order. Only the parts of the windows that need to will be redrawn.
The dirty_area parameter dictates which areas of the window to draw or redraw. The area is given in the same coordinate system as the window itself, which means that providing the window's own area struct will result in drawing the entire window. If only smaller parts of the window needs to be drawn, make a copy of the window's area struct and update to your liking before passing to this function.
For windows that are partly transparent, e.g. drop shadows or round corners, the parent is asked to redraw all its child windows, in order to provide a fresh background for the window to draw upon. This applies to windows with the behavior flag REDRAW_PARENT set.
win | Window to draw or redraw. |
dirty_area | Area dictating which parts to draw. |
References win_attributes::area, win_window::attributes, win_attributes::behavior, win_window::is_mapped, win_clip_region::origin, win_window::parent, win_area::pos, win_window::prev_sibling, win_window::top_child, WIN_BEHAVIOR_REDRAW_PARENT, win_compute_clipping(), win_draw_child(), win_draw_contents(), win_draw_parent(), win_root, win_point::x, and win_point::y.
Referenced by win_draw_parent(), win_lower(), win_raise(), win_redraw(), win_set_area(), and win_set_attributes().
|
static |
Draw child window, with automatic translation of parent's clip region.
This function is a helper function for the win_draw() and win_draw_contents() functions. It takes care of updating the clipping region, intersecting it with the child window area. Then it draws the child window's contents.
child | Child window to draw. |
parent_clip | Clipping region, in global coordinates. |
References win_attributes::area, win_window::attributes, win_clip_region::NW, win_clip_region::origin, win_area::pos, win_clip_region::SE, win_area::size, win_draw_contents(), win_point::x, and win_point::y.
Referenced by win_draw(), and win_draw_contents().
|
static |
Draw window background and contents, including children, within clip.
This function is a helper function for the win_draw() function. It draws the actual contents of a window, given a clipping region. First, it draws the window background itself, depending on the type. Then it sends a DRAW event to the window, so that e.g. widgets or other handlers can draw the rest of the window contents. Finally, it asks all mapped children, if any, to draw themselves.
Note that when the DRAW event is sent to the window, the TFT clipping region is already set, so all TFT graphics functions called from the event handler will be subject to proper clipping automatically.
win | The window to draw. |
clip | Clipping region, in global coordinates. |
References win_window::attributes, win_attributes::background, gfx_draw_bitmap_tiled(), gfx_set_clipping(), win_window::is_mapped, win_clip_region::NW, win_clip_region::origin, win_window::prev_sibling, win_clip_region::SE, win_window::top_child, win_draw_child(), WIN_EVENT_DRAW, win_handle_event(), win_point::x, and win_point::y.
Referenced by win_draw(), and win_draw_child().
|
static |
Draw parent window, with all child windows, within dirty area.
This function is a shortcut to ask a window's parent to draw all its children. However, the area to draw is given in the same coordinate system as the child window, i.e. point 0,0 is top left corner of the parent window. This function is used e.g. when rearranging child windows or to draw partly transparent windows.
child | Child window. |
dirty_area | The area, given in same coordinate system as the child. |
References win_window::parent, win_draw(), and win_translate_area_to_parent().
Referenced by win_draw(), win_hide(), and win_set_area().
struct win_area * win_get_area | ( | const struct win_window * | win | ) |
Get a pointer to the window area struct.
This function returns a pointer to the internal area struct of a window. It cannot be modified, but could be copied from.
win | Pointer to window. |
References win_attributes::area, Assert, and win_window::attributes.
Referenced by wtk_button_handler(), wtk_frame_handler(), wtk_handle_frame_release(), wtk_handle_resize_release(), wtk_icon_button_handler(), wtk_label_handler(), wtk_plot_add_value(), wtk_plot_handler(), wtk_plot_set_grid(), wtk_progress_bar_handler(), wtk_progress_bar_set_value(), wtk_resize_frame(), wtk_slider_handler(), and wtk_slider_set_value().
struct win_attributes * win_get_attributes | ( | const struct win_window * | win | ) |
Get a pointer to the window attribute struct.
This function returns a pointer to the internal attribute struct of a window. It cannot be modified, but could be copied from.
win | Pointer to window. |
References Assert, and win_window::attributes.
Referenced by app_widget_launch(), setup_gui_root_window(), and setup_root_window().
void * win_get_custom_data | ( | const struct win_window * | win | ) |
Get window custom data.
This function returns the custom data from the window's attributes. The custom data can be used for e.g. linking to associated widgets.
win | Pointer to window. |
References win_window::attributes, and win_attributes::custom.
Referenced by wtk_basic_frame_handler(), wtk_button_handler(), wtk_check_box_handler(), wtk_frame_handler(), wtk_icon_button_handler(), wtk_label_handler(), wtk_plot_handler(), wtk_progress_bar_handler(), wtk_radio_button_handler(), and wtk_slider_handler().
struct win_window * win_get_parent | ( | const struct win_window * | win | ) |
Get pointer to parent window, or NULL for root window.
Return pointer to parent window, or NULL for root window.
win | Child window. |
References win_window::parent.
Referenced by wtk_handle_frame_release(), and wtk_handle_resize_release().
struct win_window * win_get_root | ( | void | ) |
Get pointer to root window, i.e.
desktop window.
Return a pointer to the root window. Use this to change the attributes of the root window, or use the root window as a parent for new windows.
References win_root.
Referenced by app_widget_launch(), setup_gui_root_window(), and setup_root_window().
void win_grab_pointer | ( | struct win_window * | win | ) |
Set pointer focus window or NULL, i.e.
override pointer event receiver.
This function sets a pointer grabber window. The window that has grabbed the pointer will receive all further pointer events until another window grabs to pointer, or the pointer is ungrabbed by setting the grabbing window to NULL. Use this function to grab the pointer to widgets that in certain states needs to get all pointer events, e.g. dragging.
win | Pointer to grabbing window, or NULL. |
Referenced by wtk_button_handler(), wtk_check_box_handler(), wtk_handle_frame_press(), wtk_handle_frame_release(), wtk_handle_resize_press(), wtk_handle_resize_release(), wtk_icon_button_handler(), wtk_radio_button_handler(), and wtk_slider_handler().
|
static |
Call window's event handler, if one is set.
This function is a small helper function that checks if a window has an event handler at all, and in that case, sends it an event for handling. If an event handler is present, and accepts the event, this function returns true. If the event handler rejects it, or there's no event handler present, this function returns false.
win | Window to handle event. |
type | Event type. |
data | Custom data, dependent on event type. |
true | Event handler present and accepts event |
false | No event handler present or event handler doesn't accept event. |
References win_window::attributes, and win_attributes::event_handler.
Referenced by win_destroy(), win_destroy_children(), win_draw_contents(), win_handle_pointer_event(), win_lower(), win_process_command_event(), win_process_keyboard_event(), win_process_pointer_event(), win_raise(), win_reset_root_geometry(), win_set_area(), win_set_attributes(), and win_set_keyboard_focus().
|
static |
Handle pointer event in the window at the pointer coordinates.
This function is a helper function for the win_process_pointer_event() function. The pointer event is already processed, so this function searches through its child windows to find the one beneath the pointer. If no suitable child windows are found, the window handles the pointer event itself. If either a child or this window accepts the event, this function returns true.
Any window encountered with the RAISE_ON_BUTTON behavior flag set will be raised to the top inside it's parent, if the event was a POINTER_PRESS.
win | Window to handle the event itself, or pass on to children. |
event | Pointer event to handle. |
pos | Absolute position, translated to window's own coordinates. |
References win_attributes::area, win_window::attributes, win_attributes::behavior, win_window::is_mapped, win_window::next_sibling, win_area::pos, pos, win_window::top_child, win_pointer_event::type, WIN_BEHAVIOR_RAISE_ON_PRESS, WIN_EVENT_POINTER, win_handle_event(), win_is_inside_area(), WIN_POINTER_PRESS, win_raise(), win_point::x, and win_point::y.
Referenced by win_process_pointer_event().
void win_hide | ( | struct win_window * | win | ) |
Hide window, clear it from screen if it was visible.
This function unmaps a window from its parent. If it was visible, it will be removed from the screen. If the root window is hidden, the screen background will be erased to the color WIN_SCREEN_COLOR.
win | Pointer to window. |
References win_attributes::area, Assert, win_window::attributes, gfx_draw_filled_rect, gfx_get_height(), gfx_get_width(), gfx_set_clipping(), win_window::is_mapped, win_draw_parent(), win_is_visible(), win_root, and WIN_SCREEN_COLOR.
Referenced by win_destroy(), and win_reparent().
void win_inflate_area | ( | struct win_area * | area, |
int16_t | size | ||
) |
Expands a given area in all directions by a given amount.
This function expands a given area in all directions by a given amount, keeping the area's center point fixed in the same location (i.e. the logical position of the center point does not move). Negative values can be specified to shrink an area by a given amount.
Note that the area boundaries are expanded on all sides by the given amount, thus the size expansion is twice the specified amount.
area | Pointer to the area to expand. |
size | Signed amount to expand the area by. |
References Assert, win_area::pos, win_area::size, win_point::x, and win_point::y.
Referenced by app_widget_launch(), and wtk_slider_handler().
void win_init | ( | void | ) |
Initialize window system, set up root window, hook into touch driver.
This function initializes the windowing system. Call this function before any other window system operations, as this initializes the root window, internal queues and other internals.
References win_attributes::area, win_window::attributes, win_event_queue::back, win_attributes::background, win_event_queue::end, win_event_queue::free, win_event_queue::front, gfx_get_height(), gfx_get_width(), win_area::size, win_event_queue::start, win_event_queue_buffer, WIN_EVENT_QUEUE_SIZE, win_last_pointer_pos, win_root, win_root_background, win_point::x, and win_point::y.
Referenced by main().
Check if point is inside area.
This function checks if a point is inside a given area.
area | Pointer to area. |
point | Pointer to point to check. |
References win_area::pos, win_area::size, win_point::x, and win_point::y.
Referenced by win_handle_pointer_event().
bool win_is_inside_clip | ( | const struct win_clip_region * | clip, |
const struct win_point * | point | ||
) |
Check if point is inside clipping region.
This function checks if a point is inside the clipping region. The origin field of the clipping region is not relevant, only the corners of the clipping region itself.
clip | Pointer to clipping region. |
point | Pointer to point to check. |
References win_clip_region::NW, win_clip_region::SE, win_point::x, and win_point::y.
Referenced by win_is_inside_window().
bool win_is_inside_window | ( | const struct win_window * | win, |
const struct win_point * | point | ||
) |
Check if global point is inside window.
This function checks if point given in global coordinates is inside a given window.
win | Window to check. |
point | Point in global coordinates. |
true | if point is inside win. |
false | if point is not inside win. |
References win_attributes::area, win_window::attributes, win_compute_clipping(), and win_is_inside_clip().
Referenced by wtk_button_handler(), wtk_check_box_handler(), wtk_handle_frame_release(), wtk_handle_resize_release(), wtk_icon_button_handler(), and wtk_radio_button_handler().
|
static |
Check if window and all parents, grand parents, etc.
are visible.
This function checks if the window should be visible on screen, or at least drawn on screen but maybe obscured by other windows. If a window's parent is visible, all mapped children are also visible. If any parent on the path up to, and including, the root window is unmapped, the window is not visible. Once again, note that even if a window is "visible", i.e. this function returns true, it might be obscured by other windows on top.
win | Window to check. |
true | win is visible. |
false | win is not visible. |
References win_window::is_mapped, and win_window::parent.
Referenced by win_hide(), win_lower(), win_raise(), win_redraw(), win_set_area(), and win_set_attributes().
void win_lower | ( | struct win_window * | win | ) |
Lower window to bottom of all its siblings.
This function lowers a window to the bottom of the Z-stack of child windows. Proper redraw calls are issued to update graphics. Before rearranging windows, this window is sent an UNRAISE event, and the window the gets to be on top after rearranging is sent a RAISE event. Use these events to update any focus and highlight related graphics.
win | Pointer to window. |
References win_attributes::area, Assert, win_window::attributes, win_window::next_sibling, win_window::parent, win_window::prev_sibling, win_window::top_child, win_add_top_child(), win_draw(), WIN_EVENT_RAISE, WIN_EVENT_UNRAISE, win_handle_event(), win_is_visible(), win_root, and win_unlink().
|
static |
Remove front event from internal queue.
This function will remove the front event from the internal queue. This function will be called once an event has been processed. That way, the event will live in the queue while being processed, hence no copying of data required.
References cpu_irq_restore(), cpu_irq_save(), win_event_queue::end, win_event_queue::free, win_event_queue::front, win_event_queue::start, and win_event_queue::used.
Referenced by win_process_events().
|
static |
Process a command event.
This function is only called by win_process_events().
cevent | The command event being processed. |
References Assert, win_command_event::data, win_window::parent, win_command_event::recipient, WIN_EVENT_COMMAND, and win_handle_event().
Referenced by win_process_events().
void win_process_events | ( | void | ) |
Process all pending events from the internal queue.
This function processes all pending events from the internal queue. In order for the window system to work properly, this function should be called as often as possible, to process new events. In this implementation, whenever a new event is added to the queue, the system automatically adds a work item to the main application work queue. This work item refers to win_event_worker() which in turn will call this function to process all pending events.
References Assert, win_event_queue::front, win_are_events_pending(), WIN_EVENT_COMMAND, WIN_EVENT_KEYBOARD, WIN_EVENT_POINTER, win_pop_front_event(), win_process_command_event(), win_process_keyboard_event(), and win_process_pointer_event().
Referenced by main().
|
static |
Process a keyboard event.
This function is only called by win_process_events().
kevent | The keyboard event being processed. |
References win_window::parent, WIN_EVENT_KEYBOARD, win_handle_event(), and win_keyboard_focus.
Referenced by win_process_events().
|
static |
Helper function for processing pointer events.
This function is a helper function for the win_process_events() function. It processes a pointer event by sending it to either the current pointer grabbing window or into the window tree to find the window that is directly beneath the pointer. The function also converts any relative coordinates to absolute screen coordinates.
event | Pointer event data to process. |
References win_pointer_event::is_relative, WIN_EVENT_POINTER, win_handle_event(), win_handle_pointer_event(), win_last_pointer_pos, win_root, win_point::x, and win_point::y.
Referenced by win_process_events().
void win_queue_command_event | ( | const struct win_command_event * | event | ) |
Add a command event to the internal event queue.
This function creates a struct win_event from the command event and adds it to the internal event queue. The event data is copied, so there is no need to keep the event variable alive after calling this function.
event | Pointer to command event data. |
References win_event::command, win_event::type, WIN_EVENT_COMMAND, and win_queue_event().
Referenced by widget_frame_command_handler(), wtk_button_handler(), wtk_check_box_handler(), wtk_icon_button_handler(), wtk_radio_button_handler(), and wtk_slider_handler().
|
static |
Add an event to the internal queue.
This function adds a window event to the internal queue, taking care of the internals of updating the circular queue. This function is reentrant and protected from interrupts, so it can be called at any time from anywhere without concern for concurrency. The event data is copied into the queue, so there is no need to keep the event variable alive after calling this function. This function also takes care of adding a work item to the main work queue of the application once new events arrive. If there are already events in the queue, no extra work items will be added.
event | Event to add to the queue. |
References win_event_queue::back, cpu_irq_restore(), cpu_irq_save(), win_event_queue::end, win_event_queue::free, win_event_queue::start, win_event::timestamp, win_event_queue::used, and win_num_dropped_events.
Referenced by win_queue_command_event(), win_queue_keyboard_event(), and win_queue_pointer_event().
void win_queue_keyboard_event | ( | const struct win_keyboard_event * | event | ) |
Add a keyboard event to the internal event queue.
This function creates a struct win_event from the keyboard event and adds it to the internal event queue. The event data is copied, so there is no need to keep the event variable alive after calling this function.
event | Pointer to keyboard event data. |
References win_event::keyboard, win_event::type, WIN_EVENT_KEYBOARD, and win_queue_event().
void win_queue_pointer_event | ( | const struct win_pointer_event * | event | ) |
Add a pointer event to the internal event queue.
This function creates a struct win_event from the pointer event and adds it to the internal event queue. The event data is copied, so there is no need to keep the event variable alive after calling this function.
event | Pointer to pointer event data. |
References win_event::pointer, win_event::type, WIN_EVENT_POINTER, and win_queue_event().
Referenced by main().
void win_raise | ( | struct win_window * | win | ) |
Raise window to top of all its siblings.
This function raises a window to the top of the Z-stack of child windows. Proper redraw calls are issued to update graphics. Before rearranging windows, the current top window is sent an UNRAISE event, and after putting this window on top, this gets a RAISE event. Use these events to update any focus and highlight related graphics.
win | Pointer to window. |
References win_attributes::area, Assert, win_window::attributes, win_window::parent, win_window::top_child, win_add_top_child(), win_draw(), WIN_EVENT_RAISE, WIN_EVENT_UNRAISE, win_handle_event(), win_is_visible(), win_root, and win_unlink().
Referenced by win_handle_pointer_event().
void win_redraw | ( | struct win_window * | win | ) |
Redraw window and its contents, if visible.
This function redraws a window, if it is mapped and visible. Use this function to refresh graphics if e.g. a widget's state is changed.
win | Pointer to window. |
References win_attributes::area, win_window::attributes, win_draw(), and win_is_visible().
Referenced by app_widget_update_colors(), widget_frame_command_handler(), win_reset_root_geometry(), win_show(), wtk_button_handler(), wtk_check_box_handler(), wtk_check_box_set(), wtk_check_box_toggle(), wtk_icon_button_handler(), wtk_icon_button_select(), wtk_label_change(), wtk_progress_bar_set_value(), wtk_radio_button_handler(), wtk_radio_button_select(), wtk_slider_handler(), and wtk_slider_set_value().
void win_reparent | ( | struct win_window * | child, |
struct win_window * | new_parent | ||
) |
Change a window's parent.
This function detaches a window from its parent and attaches it to a new parent, as the top child window. This essentially moves a window from one parent to another. If the window is not mapped, it will still be unmapped at the new parent.
child | Pointer to child window to reparent. |
new_parent | Pointer to new parent. |
References Assert, win_window::is_mapped, win_add_top_child(), win_hide(), win_root, win_show(), and win_unlink().
void win_reset_root_geometry | ( | void | ) |
Reset root window geometry to fullscreen.
This function resets the root window size to fill the entire screen. Use this function to reconfigure the root window after a change in screen orientation.
References win_attributes::area, win_window::attributes, gfx_get_height(), gfx_get_width(), win_area::size, WIN_ATTR_SIZE, WIN_EVENT_ATTRIBUTES, win_handle_event(), win_redraw(), win_root, win_point::x, and win_point::y.
Referenced by main().
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.
This function updates the window position and/or size. The flags of the attribute mask decides what to update. Note that you cannot change the position or size of the root window, since the root window is always fullscreen.
win | Pointer to window that will be updated. |
new_area | Pointer to new area attributes. |
attribute_mask | Attribute flags selecting which attributes to update. |
References win_attributes::area, Assert, win_window::attributes, win_area::pos, win_area::size, WIN_ATTR_POSITION, WIN_ATTR_SIZE, win_compute_union(), win_draw(), win_draw_parent(), WIN_EVENT_ATTRIBUTES, win_handle_event(), win_is_visible(), win_root, win_point::x, and win_point::y.
Referenced by win_set_attributes(), wtk_handle_frame_release(), and wtk_resize_frame().
void win_set_attributes | ( | struct win_window * | win, |
const struct win_attributes * | new_attributes, | ||
win_attribute_mask_t | attribute_mask | ||
) |
Update window attributes specified in attribute mask.
This function updates one or more of a window's attributes. Only the the attributes corresponding to the flags of the attribute mask are updated. The others are left untouched.
win | Pointer to window that will be updated. |
new_attributes | Pointer to new attribute values. |
attribute_mask | Attribute flags selecting which attributes to update. |
References win_attributes::area, Assert, win_window::attributes, win_attributes::background, win_attributes::behavior, win_attributes::custom, win_attributes::event_handler, WIN_ATTR_BACKGROUND, WIN_ATTR_BEHAVIOR, WIN_ATTR_CUSTOM, WIN_ATTR_EVENTHANDLER, WIN_ATTR_POSITION, WIN_ATTR_SIZE, win_draw(), WIN_EVENT_ATTRIBUTES, win_handle_event(), win_is_visible(), and win_set_area().
Referenced by setup_gui_root_window(), and setup_root_window().
void win_set_keyboard_focus | ( | struct win_window * | win | ) |
Set keyboard focus window or NULL, i.e., receiver of keyboard events.
This function changes the keyboard focus window. The current keyboard focus window is sent a LOSEFOCUS event, and the new focus window is sent a GETFOCUS event. The keyboard focus window will receive all keyboard events. Set the focus window to NULL to remove the focus.
win | Pointer to the new keyboard focus window, or NULL. |
References WIN_EVENT_GETFOCUS, WIN_EVENT_LOSEFOCUS, and win_handle_event().
void win_show | ( | struct win_window * | win | ) |
Show window, draw it to screen if parent is visible.
This function maps a window to its parent. Mapping means that the window will be visible and drawn if the parent is visible, unless obscured by other windows of course.
win | Pointer to window. |
References Assert, win_window::is_mapped, and win_redraw().
Referenced by app_widget_launch(), setup_gui_root_window(), setup_root_window(), win_reparent(), and wtk_frame_create().
|
static |
Translate an area to coordinates relative to parent's origin.
This function is a helper function for the win_draw_parent() function. It translates an area given in the same coordinate system as the child window, to the same system as the parent window. The area is clipped inside the parent extents if required. If the resulting area is en empty set, the function returns false.
area | The area to translate. |
parent | Parent window. |
true | The resulting area is valid. |
false | The resulting area is an empty set. |
References win_attributes::area, win_window::attributes, win_area::pos, win_area::size, win_point::x, and win_point::y.
Referenced by win_draw_parent().
void win_translate_win_to_root | ( | struct win_window const * | start_win, |
struct win_point * | return_pos | ||
) |
Compute window position on root window.
This function calculates the position of a window on the root window. It traverses all parent windows and adds their position to get the position of the given window.
start_win | The window of which to find absolute position. |
return_pos | The absolute position of the window |
References win_attributes::area, Assert, win_window::attributes, win_window::parent, win_area::pos, win_point::x, and win_point::y.
Referenced by wtk_slider_create(), and wtk_slider_handler().
|
static |
Remove window from parent's linked list.
This function pulls out a window from the parent window's linked list of of child windows. This function is used when rearranging child windows.
win | Window to be unlinked from parent. |
References win_window::next_sibling, win_window::parent, win_window::prev_sibling, and win_window::top_child.
Referenced by win_destroy(), win_lower(), win_raise(), and win_reparent().
|
static |
Window event queue.
|
static |
Event queue data buffer.
Referenced by win_init().
|
static |
Current keyboard focus, or NULL.
Keyboard focus gets all keyboard events.
Referenced by win_process_keyboard_event().
|
static |
Stores last pointer event position, in absolute coordinates.
Referenced by win_init(), and win_process_pointer_event().
|
static |
Diagnostic value counting number of dropped events due to event queue full.
Referenced by win_queue_event().
|
static |
Current pointer grabbing window, or NULL.
Grabber gets all pointer events.
|
static |
Root window, i.e.
desktop window.
Referenced by app_widget_launch(), setup_gui_root_window(), setup_root_window(), win_compute_clipping(), win_destroy(), win_draw(), win_get_root(), win_hide(), win_init(), win_lower(), win_process_pointer_event(), win_raise(), win_reparent(), win_reset_root_geometry(), and win_set_area().
|
static |
Frame background bitmap.
Referenced by win_init().