FreeRDP
Loading...
Searching...
No Matches
rdtk.h
1
19#ifndef RDTK_H
20#define RDTK_H
21
22#include <winpr/assert.h>
23#include <winpr/winpr.h>
24
25#include <stdint.h>
26#include <rdtk/api.h>
27
28typedef struct rdtk_engine rdtkEngine;
29typedef struct rdtk_font rdtkFont;
30typedef struct rdtk_glyph rdtkGlyph;
31typedef struct rdtk_surface rdtkSurface;
32typedef struct rdtk_button rdtkButton;
33typedef struct rdtk_label rdtkLabel;
34typedef struct rdtk_text_field rdtkTextField;
35typedef struct rdtk_nine_patch rdtkNinePatch;
36
37#ifdef __cplusplus
38extern "C"
39{
40#endif
41
42 /* Engine */
43
44 RDTK_EXPORT void rdtk_engine_free(rdtkEngine* engine);
45
46 WINPR_ATTR_MALLOC(rdtk_engine_free, 1)
47 WINPR_ATTR_NODISCARD
48 RDTK_EXPORT rdtkEngine* rdtk_engine_new(void);
49
50 /* Surface */
51
52 RDTK_EXPORT int rdtk_surface_fill(rdtkSurface* surface, uint16_t x, uint16_t y, uint16_t width,
53 uint16_t height, uint32_t color);
54
55 RDTK_EXPORT rdtkSurface* rdtk_surface_new(rdtkEngine* engine, uint8_t* data, uint16_t width,
56 uint16_t height, uint32_t scanline);
57 RDTK_EXPORT void rdtk_surface_free(rdtkSurface* surface);
58
59 /* Font */
60
61 RDTK_EXPORT int rdtk_font_draw_text(rdtkSurface* surface, uint16_t nXDst, uint16_t nYDst,
62 rdtkFont* font, const char* text);
63
64 /* Button */
65
66 RDTK_EXPORT int rdtk_button_draw(rdtkSurface* surface, uint16_t nXDst, uint16_t nYDst,
67 uint16_t nWidth, uint16_t nHeight, rdtkButton* button,
68 const char* text);
69
70 /* Label */
71
72 RDTK_EXPORT int rdtk_label_draw(rdtkSurface* surface, uint16_t nXDst, uint16_t nYDst,
73 uint16_t nWidth, uint16_t nHeight, rdtkLabel* label,
74 const char* text, uint16_t hAlign, uint16_t vAlign);
75
76 /* TextField */
77
78 RDTK_EXPORT int rdtk_text_field_draw(rdtkSurface* surface, uint16_t nXDst, uint16_t nYDst,
79 uint16_t nWidth, uint16_t nHeight,
80 rdtkTextField* textField, const char* text);
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* RDTK_H */