|
PatchworkOS
|
#include <libpatchwork/display.h>#include <libpatchwork/image.h>#include "internal.h"#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | deco_private_t |
Macros | |
| #define | __STDC_WANT_LIB_EXT1__ 1 |
| #define | WINDOW_CLIENT_ELEM_ID (UINT64_MAX) |
| #define | WINDOW_DECO_ELEM_ID (UINT64_MAX - 1) |
| #define | WINDOW_DECO_CLOSE_BUTTON_ID (UINT64_MAX - 2) |
| #define | WINDOW_DECO_MINIMIZE_BUTTON_ID (UINT64_MAX - 3) |
| #define | WINDOW_DECO_CLOSE_BUTTON_INDEX 0 |
| #define | WINDOW_DECO_MINIMIZE_BUTTON_INDEX 1 |
| #define | WINDOW_DECO_BUTTON_AMOUNT 2 |
Functions | |
| static void | window_deco_titlebar_rect (window_t *win, element_t *elem, rect_t *rect) |
| static void | window_deco_button_rect (window_t *win, element_t *elem, rect_t *rect, uint64_t index) |
| static void | window_deco_draw_titlebar (window_t *win, element_t *elem, drawable_t *draw) |
| static void | window_deco_handle_dragging (window_t *win, element_t *elem, const event_mouse_t *event) |
| static uint64_t | window_deco_init_controls (window_t *win, element_t *elem, deco_private_t *private) |
| static uint64_t | window_deco_init (window_t *win, element_t *elem) |
| static void | window_deco_free (element_t *elem) |
| static void | window_deco_redraw (window_t *win, element_t *elem) |
| static void | window_deco_action (window_t *win, const levent_action_t *action) |
| static void | window_deco_report (window_t *win, element_t *elem, const event_report_t *report) |
| static uint64_t | window_deco_procedure (window_t *win, element_t *elem, const event_t *event) |
| window_t * | window_new (display_t *disp, const char *name, const rect_t *rect, surface_type_t type, window_flags_t flags, procedure_t procedure, void *private) |
| Allocate and initialize a new window. | |
| void | window_free (window_t *win) |
| Free a window. | |
| rect_t | window_get_rect (window_t *win) |
| Get the window's rectangle in screen coordinates. | |
| rect_t | window_get_local_rect (window_t *win) |
| display_t * | window_get_display (window_t *win) |
| Get the display associated with the window. | |
| surface_id_t | window_get_id (window_t *win) |
| Get the surface ID of the window. | |
| surface_type_t | window_get_type (window_t *win) |
| Get the surface type of the window. | |
| element_t * | window_get_client_element (window_t *win) |
| Get the client element of the window. | |
| uint64_t | window_move (window_t *win, const rect_t *rect) |
| Move and/or resize the window. | |
| uint64_t | window_set_timer (window_t *win, timer_flags_t flags, clock_t timeout) |
| Set the window timer. | |
| void | window_invalidate (window_t *win, const rect_t *rect) |
| Invalidate a rectangle of the window. | |
| uint64_t | window_invalidate_flush (window_t *win) |
| Flush invalidated rectangles to the DWM. | |
| uint64_t | window_dispatch (window_t *win, const event_t *event) |
| Dispatch an event to the window's elements. | |
| uint64_t | window_set_focus (window_t *win) |
| Set the focus to the window. | |
| uint64_t | window_set_visible (window_t *win, bool isVisible) |
| Set the visibility of the window. | |
| #define WINDOW_CLIENT_ELEM_ID (UINT64_MAX) |
| #define WINDOW_DECO_CLOSE_BUTTON_ID (UINT64_MAX - 2) |
| #define WINDOW_DECO_ELEM_ID (UINT64_MAX - 1) |
| #define WINDOW_DECO_MINIMIZE_BUTTON_ID (UINT64_MAX - 3) |
|
static |
Definition at line 232 of file window.c.
References ACTION_RELEASE, window_t::disp, display_push(), display_set_is_visible(), LEVENT_QUIT, NULL, levent_action_t::source, window_t::surface, levent_action_t::type, WINDOW_DECO_CLOSE_BUTTON_ID, and WINDOW_DECO_MINIMIZE_BUTTON_ID.
Referenced by window_deco_procedure().
|
static |
Definition at line 44 of file window.c.
References rect_t::bottom, element_get_theme(), rect_t::left, RECT_SHRINK, rect_t::right, rect_t::top, and window_deco_titlebar_rect().
Referenced by window_deco_handle_dragging(), and window_deco_init_controls().
|
static |
Definition at line 53 of file window.c.
References ALIGN_CENTER, ALIGN_MIN, theme_color_set_t::backgroundSelectedEnd, theme_color_set_t::backgroundSelectedStart, theme_color_set_t::backgroundUnselectedEnd, theme_color_set_t::backgroundUnselectedStart, theme_t::bigPadding, theme_t::deco, DIRECTION_HORIZONTAL, draw_frame(), draw_gradient(), draw_text(), element_get_private(), element_get_theme(), theme_color_set_t::foregroundNormal, theme_t::frameSize, theme_color_set_t::highlight, rect_t::left, window_t::name, NULL, theme_t::panelSize, RECT_SHRINK, rect_t::right, theme_color_set_t::shadow, theme, and window_deco_titlebar_rect().
Referenced by window_deco_redraw(), and window_deco_report().
|
static |
Definition at line 198 of file window.c.
References element_get_private(), free(), image_free(), and NULL.
Referenced by window_deco_procedure().
|
static |
Definition at line 79 of file window.c.
References element_get_private(), window_t::flags, event_mouse_t::held, rect_t::left, MOUSE_LEFT, event_mouse_t::pos, event_mouse_t::pressed, window_t::rect, RECT_CONTAINS_POINT, RECT_HEIGHT, RECT_INIT_DIM, RECT_WIDTH, rect_t::right, event_mouse_t::screenPos, rect_t::top, WINDOW_DECO_BUTTON_AMOUNT, window_deco_button_rect(), window_deco_titlebar_rect(), window_move(), WINDOW_NO_CONTROLS, point_t::x, and point_t::y.
Referenced by window_deco_procedure().
Definition at line 172 of file window.c.
References element_set_private(), ERR, window_t::flags, free(), malloc(), NULL, window_deco_init_controls(), and WINDOW_NO_CONTROLS.
Referenced by window_deco_procedure().
|
static |
Definition at line 113 of file window.c.
References button_new(), element_free(), element_get_theme(), ELEMENT_NO_OUTLINE, element_set_image(), ERR, theme_t::iconClose, theme_t::iconMinimize, image_free(), image_new(), NULL, theme, window_deco_button_rect(), WINDOW_DECO_CLOSE_BUTTON_ID, WINDOW_DECO_CLOSE_BUTTON_INDEX, WINDOW_DECO_MINIMIZE_BUTTON_ID, WINDOW_DECO_MINIMIZE_BUTTON_INDEX, and window_get_display().
Referenced by window_deco_init().
|
static |
Definition at line 267 of file window.c.
References EVENT_MOUSE, EVENT_REPORT, event_t::lAction, LEVENT_ACTION, LEVENT_DEINIT, LEVENT_INIT, LEVENT_REDRAW, event_t::mouse, event_t::report, event_t::type, window_deco_action(), window_deco_free(), window_deco_handle_dragging(), window_deco_init(), window_deco_redraw(), and window_deco_report().
Referenced by window_new().
Definition at line 215 of file window.c.
References theme_color_set_t::backgroundNormal, theme_t::deco, draw_frame(), draw_rect(), element_draw_begin(), element_draw_end(), element_get_content_rect(), element_get_theme(), theme_t::frameSize, theme_color_set_t::highlight, RECT_SHRINK, theme_color_set_t::shadow, theme, and window_deco_draw_titlebar().
Referenced by window_deco_procedure().
|
static |
Definition at line 250 of file window.c.
References element_draw_begin(), element_draw_end(), element_get_private(), event_report_t::flags, surface_info_t::flags, event_report_t::info, REPORT_IS_FOCUSED, SURFACE_FOCUSED, SURFACE_VISIBLE, and window_deco_draw_titlebar().
Referenced by window_deco_procedure().
Definition at line 29 of file window.c.
References element_get_content_rect(), element_get_theme(), theme_t::frameSize, rect_t::left, RECT_WIDTH, theme_t::smallPadding, theme, and theme_t::titlebarSize.
Referenced by window_deco_button_rect(), window_deco_draw_titlebar(), and window_deco_handle_dragging().
Definition at line 457 of file window.c.
References NULL, window_t::rect, RECT_HEIGHT, RECT_INIT_DIM, and RECT_WIDTH.