C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
ui_layout.h
Go to the documentation of this file.
1#ifndef UI_LAYOUT_H
2#define UI_LAYOUT_H 1
3
4/** @file
5 @brief UI layout management.
6 @ingroup ui_backend
7
8 This module provides functions for creating and managing framed surfaces, which consist of an outer surface (the frame) and an inner surface (the content area).
9 */
10
11#include "ui_backend.h"
12
13/** @struct UiFramedSurface
14 @ingroup ui_backend
15 Represents a framed surface, consisting of an outer surface (the frame) and
16 an inner surface (the content area).
17 */
18typedef struct {
19 UiSurface *outer;
20 UiSurface *inner;
21} UiFramedSurface;
22
23/** @brief Creates a new framed surface with the specified parent and rectangle.
24 @ingroup ui_backend
25 @param ui The UI runtime context.
26 @param parent The parent surface to which the framed surface will be attached.
27 @param rect The rectangle defining the position and size of the framed surface.
28 @return A new UiFramedSurface instance, or NULL on failure.
29 */
30UiFramedSurface ui_framed_surface_new(UiSurface *parent, UiRect rect);
31/** @brief Destroys a framed surface and releases its resources.
32 @ingroup ui_backend
33 @param fs The UiFramedSurface to destroy.
34 */
35void ui_framed_surface_destroy(UiFramedSurface *fs);
36
37#endif
void ui_render()
Definition ui_ncurses.c:800
UiRuntime * ui_init(const UiConfig *config)
Definition ui_ncurses.c:261
UiSurface * ui_surface_new(uint w, UiSurface *parent, uint p, uint lines, uint cols, uint y, uint x)
Definition ui_ncurses.c:414
@ UI_KEY_CHAR
Definition ui_backend.h:44
@ UI_KEY_DOWN
Definition ui_backend.h:51
@ UI_KEY_NONE
Definition ui_backend.h:43
@ UI_KEY_ESCAPE
Definition ui_backend.h:46
@ UI_KEY_LEFT
Definition ui_backend.h:52
@ UI_KEY_F1
Definition ui_backend.h:62
@ UI_KEY_ENTER
Definition ui_backend.h:45
@ UI_KEY_UP
Definition ui_backend.h:50
@ UI_KEY_F12
Definition ui_backend.h:73
@ UI_KEY_RIGHT
Definition ui_backend.h:53
int ui_draw_text(UiSurface *s, uint w, uint y, uint x, const char *text)
void ui_surface_destroy(UiSurface *s)
Definition ui_ncurses.c:377
void ui_get_screen_size(uint *lines, uint *cols)
Definition ui_ncurses.c:692
void ui_shutdown()
Definition ui_ncurses.c:344
uint16_t UiStyle
Definition ui_backend.h:35
void ui_get_caps(UiCaps *caps)
Query the capabilities of the active backend.
Definition ui_ncurses.c:88
@ UI_BACKEND_NCURSES
Definition ui_backend.h:156
@ UI_BACKEND_NOTCURSES
Definition ui_backend.h:157
@ UI_MOUSE_SCROLL_DOWN
Definition ui_backend.h:82
@ UI_MOUSE_PRESS
Definition ui_backend.h:78
@ UI_MOUSE_SCROLL_UP
Definition ui_backend.h:81
@ UI_MOUSE_NONE
Definition ui_backend.h:77
@ UI_MOUSE_RELEASE
Definition ui_backend.h:79
int ui_draw_border(UiSurface *s, uint w, UiBorderKind kind, const UiStyle *style)
UiBackend ui_get_backend()
Return which backend is powering this runtime.
Definition ui_ncurses.c:84
@ UI_BORDER_ROUNDED
Definition ui_backend.h:89
@ UI_BORDER_LIGHT
Definition ui_backend.h:88
UiFramedSurface ui_framed_surface_new(UiSurface *parent, UiRect rect)
Creates a new framed surface with the specified parent and rectangle.
Definition ui_layout.c:26
void ui_framed_surface_destroy(UiFramedSurface *fs)
Destroys a framed surface and releases its resources.
Definition ui_layout.c:54
#define WA_NORMAL
int main(int argc, char **argv)
Capture the current terminal settings for later restoration.
Definition amort.c:30
int cols
Definition ui_backend.h:121
int lines
Definition ui_backend.h:120
bool cursor_visible
Definition ui_backend.h:145
const char * tty_path
Definition ui_backend.h:147
bool enable_mouse
Definition ui_backend.h:143
bool enable_alt_screen
Definition ui_backend.h:144
bool palette256
Definition ui_backend.h:170
bool mouse
Definition ui_backend.h:171
int color_pairs
Definition ui_backend.h:174
bool truecolor
Definition ui_backend.h:169
bool unicode
Definition ui_backend.h:172
bool resize
Definition ui_backend.h:173
UiSurface * inner
Definition ui_layout.h:20
UiSurface * outer
Definition ui_layout.h:19