inkanim_types/ink/widget/
layout.rs

1use serde::{Deserialize, Serialize};
2
3use crate::Vector2;
4
5#[allow(non_camel_case_types)]
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub enum inkEAnchor {
8    TopLeft = 0,
9    TopCenter = 1,
10    TopRight = 2,
11    CenterLeft = 3,
12    Centered = 4,
13    CenterRight = 5,
14    BottomLeft = 6,
15    BottomCenter = 7,
16    BottomRight = 8,
17    TopFillHorizontaly = 9,
18    CenterFillHorizontaly = 10,
19    BottomFillHorizontaly = 11,
20    LeftFillVerticaly = 12,
21    CenterFillVerticaly = 13,
22    RightFillVerticaly = 14,
23    Fill = 15,
24}
25
26#[allow(non_camel_case_types)]
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub enum inkEHorizontalAlign {
29    Fill = 0,
30    Left = 1,
31    Center = 2,
32    Right = 3,
33}
34
35#[allow(non_camel_case_types)]
36#[derive(Debug, Clone, Serialize, Deserialize)]
37pub enum inkEVerticalAlign {
38    Fill = 0,
39    Top = 1,
40    Center = 2,
41    Bottom = 3,
42}
43
44#[allow(non_camel_case_types)]
45#[derive(Debug, Clone, Serialize, Deserialize)]
46pub struct inkUITransform {
47    pub translation: Vector2,
48    pub scale: Vector2,
49    pub shear: Vector2,
50    pub rotation: f32,
51}
52
53#[allow(non_camel_case_types)]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55pub enum textJustificationType {
56    Left = 0,
57    Center = 1,
58    Right = 2,
59}
60
61#[allow(non_camel_case_types)]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(tag = "$type")]
64pub struct inkMargin {
65    pub left: f32,
66    pub right: f32,
67    pub top: f32,
68    pub bottom: f32,
69}
70
71#[allow(non_camel_case_types)]
72#[derive(Debug, Clone, Serialize, Deserialize)]
73#[serde(tag = "$type", rename_all = "camelCase")]
74pub struct inkWidgetLayout {
75    pub anchor: inkEAnchor,
76    pub anchor_point: Vector2,
77    pub padding: inkMargin,
78    pub margin: inkMargin,
79    #[serde(rename = "HAlign")]
80    pub h_align: inkEHorizontalAlign,
81}
82
83#[allow(non_camel_case_types)]
84#[derive(Debug, Clone, Serialize, Deserialize)]
85pub enum inkEChildOrder {
86    Forward = 0,
87    Backward = 1,
88}