1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// SPDX-FileCopyrightText: Copyright (c) 2026 Mike Li/Mikewolfli/Wei Li(mikewolfli@163.com)
// SPDX-License-Identifier: MIT
macro_rules! impl_container_widgets {
() => {
fn create_scroll_area(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::ScrollArea, parent, "", x, y, width, height)
}
#[cfg(widgets_unstripped)]
fn create_dock_panel(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::DockPanel, parent, "", x, y, width, height)
}
#[cfg(widgets_unstripped)]
fn create_tab_widget(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::TabWidget, parent, "", x, y, width, height)
}
#[cfg(widgets_unstripped)]
fn create_splitter(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::Splitter, parent, "", x, y, width, height)
}
#[cfg(widgets_unstripped)]
fn create_stack_widget(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::StackedWidget, parent, "", x, y, width, height)
}
#[cfg(widgets_unstripped)]
fn create_mdi_area(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::MdiArea, parent, "", x, y, width, height)
}
#[cfg(widgets_unstripped)]
fn create_toolbox(
&self,
parent: ObjectId,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
// By name, so the two spellings of this control (`tool_box`, and the
// `toolbox` alias the factory also accepts) both land on the same
// constructor rather than one of them depending on kind resolution.
// A profile without the factory has no constructors either way and
// reports `0`, so it keeps the kind-based call.
#[cfg(full_widgets)]
{
self.mount_named_widget("toolbox", parent, "", x, y, width, height)
}
#[cfg(not(full_widgets))]
{
self.mount_widget_of_kind(WidgetKind::Toolbox, parent, "", x, y, width, height)
}
}
#[cfg(widgets_unstripped)]
fn create_collapsible_pane(
&self,
parent: ObjectId,
title: &str,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(
WidgetKind::CollapsiblePane,
parent,
title,
x,
y,
width,
height,
)
}
#[cfg(widgets_unstripped)]
fn create_dock_widget(
&self,
parent: ObjectId,
title: &str,
x: i32,
y: i32,
width: u32,
height: u32,
) -> ObjectId {
self.mount_widget_of_kind(WidgetKind::DockWidget, parent, title, x, y, width, height)
}
};
}