1 module bindbc.kw.label;
2 
3 import bindbc.kw.widget;
4 import bindbc.kw.renderdriver;
5 import bindbc.kw.rect;
6 import bindbc.kw.kwbool;
7 
8 enum /*KW_LabelVerticalAlignment*/ {
9     KW_LABEL_ALIGN_TOP,     /** Vertically align label in the top of the geometry. */
10     KW_LABEL_ALIGN_MIDDLE,  /** Vertically align label in the middle of the geometry. */
11     KW_LABEL_ALIGN_BOTTOM   /** Vertically align label in the bottom of the geometry. */
12 }
13 
14 enum /*KW_LabelHorizontalAlignment*/ {
15     KW_LABEL_ALIGN_LEFT,    /** Horizontally align label in the left part of the geometry. */
16     KW_LABEL_ALIGN_CENTER,  /** Horizontally align label in the center part of the geometry. */
17     KW_LABEL_ALIGN_RIGHT    /** Horizontally align label in the right part of the geometry. */
18 }
19 
20 version(BindKiwi_Static){
21     extern (C) @nogc nothrow {
22         KW_Widget * KW_CreateLabel(KW_GUI * gui, KW_Widget * parent, const char * text, const KW_Rect * geometry);
23         void KW_SetLabelText(KW_Widget * widget, const(char)* text);
24         void KW_SetLabelStyle(KW_Widget * widget, int style);
25         void KW_SetLabelTextColor(KW_Widget * widget, KW_Color color);
26         void KW_SetLabelFont(KW_Widget * widget, KW_Font * font);
27         void KW_SetLabelAlignment(KW_Widget * widget, int halign, int hoffset, int valign, int voffset);
28         void KW_SetLabelIcon(KW_Widget * widget, const KW_Rect * iconclip);
29         KW_Font * KW_GetLabelFont(KW_Widget * widget);
30         KW_Color KW_GetLabelTextColor(KW_Widget * widget);
31         KW_bool KW_WasLabelTextColorSet(KW_Widget * widget);
32     }
33 } else {
34     extern (C) @nogc nothrow {
35         alias pKW_CreateLabel = KW_Widget* function(KW_GUI * gui, KW_Widget * parent, const char * text, const KW_Rect * geometry);
36         alias pKW_SetLabelText = void function(KW_Widget * widget, const(char)* text);
37         alias pKW_SetLabelStyle = void function(KW_Widget * widget, int style);
38         alias pKW_SetLabelTextColor = void function(KW_Widget * widget, KW_Color color);
39         alias pKW_SetLabelFont = void function(KW_Widget * widget, KW_Font * font);
40         alias pKW_SetLabelAlignment = void function(KW_Widget * widget, int halign, int hoffset, int valign, int voffset);
41         alias pKW_SetLabelIcon = void function(KW_Widget * widget, const KW_Rect * iconclip);
42         alias pKW_GetLabelFont = KW_Font * function(KW_Widget * widget);
43         alias pKW_GetLabelTextColor = KW_Color function(KW_Widget * widget);
44         alias pKW_WasLabelTextColorSet = KW_bool function(KW_Widget * widget);
45     }
46     __gshared {
47         pKW_CreateLabel KW_CreateLabel;
48         pKW_SetLabelText KW_SetLabelText;
49         pKW_SetLabelStyle KW_SetLabelStyle;
50         pKW_SetLabelTextColor KW_SetLabelTextColor;
51         pKW_SetLabelFont KW_SetLabelFont;
52         pKW_SetLabelAlignment KW_SetLabelAlignment;
53         pKW_SetLabelIcon KW_SetLabelIcon;
54         pKW_GetLabelFont KW_GetLabelFont;
55         pKW_GetLabelTextColor KW_GetLabelTextColor;
56         pKW_WasLabelTextColorSet KW_WasLabelTextColorSet;
57     }
58 }
59 
60