|
ginnOS
The reference: libc, the libraries and the kernel
|
idunn: a window's widgets: layout, drawing what changed, and the pointer and the keys. More...
Macros | |
| #define | HOVER_MS 100 |
| #define | DOUBLE_CLICK_MS 500 |
| #define | DOUBLE_CLICK_PX 4 |
| #define | TIP_MS 600 |
| #define | TIP_AGAIN_MS 300 |
Functions | |
| idunn_window_t * | idunn_window_offscreen (idunn_context_t *ctx, int32_t width, int32_t height) |
| a window that draws into its own buffer, of that many pixels. | |
| void | idunn_window_free_widgets (idunn_window_t *win) |
| void | idunn_window_set_root (idunn_window_t *win, idunn_widget_t *root) |
| the widget that fills the window (a row or a column, usually). | |
| void | idunn_window_use_buffer (idunn_window_t *win, gfx_buffer_t *buf) |
| void | idunn_window_resize (idunn_window_t *win, int32_t width, int32_t height) |
| a new size for the window's buffer (the window lays out again). | |
| gfx_buffer_t * | idunn_window_buffer (const idunn_window_t *win) |
| void | idunn_window_invalidate (idunn_window_t *win) |
| the whole window must be drawn again (after a theme change). | |
| void | idunn_window_add_damage (idunn_window_t *win, gfx_rect_t r) |
| add a rect of the window that must be drawn again | |
| void | idunn_window_move_pixels (idunn_widget_t *w, gfx_rect_t area, int32_t dy) |
| move the pixels of a rect of the window up (dy < 0) or down, as when its content scrolls: what stays in it is not drawn again, only the strip that comes into view. | |
| int | idunn_window_draw_parts (idunn_window_t *win, gfx_rect_t parts[IDUNN_DAMAGE_MAX+1]) |
| lay out and draw what changed, part by part. | |
| gfx_rect_t | idunn_window_draw (idunn_window_t *win) |
| lay out and draw what changed. | |
| bool | idunn_window_tick (idunn_window_t *win, uint32_t now) |
| the time now in ms, for transitions. | |
| uint32_t | idunn_window_next_wake (const idunn_window_t *win) |
| the next time (ms) the window must be ticked for a timer, or 0 for none. | |
| void | idunn_wake (idunn_widget_t *w, uint32_t at) |
| a TIMER event for w at a time (ms, as window->now); one time per widget | |
| void | idunn_copy (idunn_widget_t *w, const char *text, size_t length) |
| put text on the clipboard; ask for its text (a PASTE event comes) | |
| void | idunn_paste (idunn_widget_t *w) |
| void | idunn_window_paste (idunn_window_t *win, const char *text, size_t length) |
| the clipboard text a widget asked for came (from the window server). | |
| uint32_t | idunn_window_cursor (const idunn_window_t *win) |
| the pointer shape for where the pointer is (IDUNN_CURSOR_). | |
| idunn_widget_t * | idunn_window_focus (const idunn_window_t *win) |
| the widget with the keyboard focus, or NULL. | |
| bool | idunn_send (idunn_widget_t *w, const idunn_event_t *ev) |
| send an event to a widget: true if it used it | |
| void | idunn_window_pointer (idunn_window_t *win, idunn_pointer_t kind, int32_t x, int32_t y, uint32_t mods) |
| the pointer moved, or the left button went down or up, at (x, y), with these modifier keys held (Shift+click extends a selection). | |
| void | idunn_window_on_key (idunn_window_t *win, idunn_key_hook_t on_key, void *data) |
| void | idunn_window_key (idunn_window_t *win, uint16_t code, uint32_t mods, const char *text) |
| a key press (or repeat). | |
| void | idunn_focus (idunn_widget_t *w) |
| give w the keyboard (without the ring) | |
| void | idunn_set_focus (idunn_widget_t *w) |
| give the keyboard to a widget in a window (a canvas at the start). | |
| void | idunn_focus_first (idunn_widget_t *w) |
| give the keyboard to the first widget that takes it in w | |
| void | idunn_window_scroll (idunn_window_t *win, int32_t x, int32_t y, int32_t steps) |
| the wheel turned over (x, y): steps, up is positive. | |
idunn: a window's widgets: layout, drawing what changed, and the pointer and the keys.
no window server here (app.c has it), so the host tests can drive a window.
| #define HOVER_MS 100 |
| #define DOUBLE_CLICK_MS 500 |
| #define DOUBLE_CLICK_PX 4 |
| #define TIP_MS 600 |
| #define TIP_AGAIN_MS 300 |
| idunn_window_t * idunn_window_offscreen | ( | idunn_context_t * | ctx, |
| int32_t | width, | ||
| int32_t | height ) |
a window that draws into its own buffer, of that many pixels.
| void idunn_window_free_widgets | ( | idunn_window_t * | win | ) |
| void idunn_window_set_root | ( | idunn_window_t * | win, |
| idunn_widget_t * | root ) |
the widget that fills the window (a row or a column, usually).
the window owns the tree from now on.
| void idunn_window_use_buffer | ( | idunn_window_t * | win, |
| gfx_buffer_t * | buf ) |
| void idunn_window_resize | ( | idunn_window_t * | win, |
| int32_t | width, | ||
| int32_t | height ) |
a new size for the window's buffer (the window lays out again).
| gfx_buffer_t * idunn_window_buffer | ( | const idunn_window_t * | win | ) |
| void idunn_window_invalidate | ( | idunn_window_t * | win | ) |
the whole window must be drawn again (after a theme change).
| void idunn_window_add_damage | ( | idunn_window_t * | win, |
| gfx_rect_t | r ) |
add a rect of the window that must be drawn again
| void idunn_window_move_pixels | ( | idunn_widget_t * | w, |
| gfx_rect_t | area, | ||
| int32_t | dy ) |
move the pixels of a rect of the window up (dy < 0) or down, as when its content scrolls: what stays in it is not drawn again, only the strip that comes into view.
w is the widget the rect belongs to (its clip).
| int idunn_window_draw_parts | ( | idunn_window_t * | win, |
| gfx_rect_t | parts[IDUNN_DAMAGE_MAX+1] ) |
lay out and draw what changed, part by part.
| gfx_rect_t idunn_window_draw | ( | idunn_window_t * | win | ) |
lay out and draw what changed.
| bool idunn_window_tick | ( | idunn_window_t * | win, |
| uint32_t | now ) |
the time now in ms, for transitions.
| uint32_t idunn_window_next_wake | ( | const idunn_window_t * | win | ) |
the next time (ms) the window must be ticked for a timer, or 0 for none.
| void idunn_wake | ( | idunn_widget_t * | w, |
| uint32_t | at ) |
a TIMER event for w at a time (ms, as window->now); one time per widget
| void idunn_copy | ( | idunn_widget_t * | w, |
| const char * | text, | ||
| size_t | length ) |
put text on the clipboard; ask for its text (a PASTE event comes)
| void idunn_paste | ( | idunn_widget_t * | w | ) |
| void idunn_window_paste | ( | idunn_window_t * | win, |
| const char * | text, | ||
| size_t | length ) |
the clipboard text a widget asked for came (from the window server).
| uint32_t idunn_window_cursor | ( | const idunn_window_t * | win | ) |
the pointer shape for where the pointer is (IDUNN_CURSOR_).
| idunn_widget_t * idunn_window_focus | ( | const idunn_window_t * | win | ) |
the widget with the keyboard focus, or NULL.
| bool idunn_send | ( | idunn_widget_t * | w, |
| const idunn_event_t * | ev ) |
send an event to a widget: true if it used it
| void idunn_window_pointer | ( | idunn_window_t * | win, |
| idunn_pointer_t | kind, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| uint32_t | mods ) |
the pointer moved, or the left button went down or up, at (x, y), with these modifier keys held (Shift+click extends a selection).
| void idunn_window_on_key | ( | idunn_window_t * | win, |
| idunn_key_hook_t | on_key, | ||
| void * | data ) |
| void idunn_window_key | ( | idunn_window_t * | win, |
| uint16_t | code, | ||
| uint32_t | mods, | ||
| const char * | text ) |
a key press (or repeat).
| code | a Linux key code (KEY_ in sys/input.h). |
| text | the characters it types (UTF-8), or "". |
| void idunn_focus | ( | idunn_widget_t * | w | ) |
give w the keyboard (without the ring)
| void idunn_set_focus | ( | idunn_widget_t * | w | ) |
give the keyboard to a widget in a window (a canvas at the start).
| void idunn_focus_first | ( | idunn_widget_t * | w | ) |
give the keyboard to the first widget that takes it in w
| void idunn_window_scroll | ( | idunn_window_t * | win, |
| int32_t | x, | ||
| int32_t | y, | ||
| int32_t | steps ) |
the wheel turned over (x, y): steps, up is positive.