-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathdraw_device_print.v
More file actions
186 lines (147 loc) · 5.47 KB
/
Copy pathdraw_device_print.v
File metadata and controls
186 lines (147 loc) · 5.47 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
module ui
import gg
struct DrawDevicePrint {
id string = 'dd_print'
filename string
}
@[params]
pub struct DrawDevicePrintParams {
pub:
id string = 'dd_print'
filename string
}
// TODO: documentation
pub fn draw_device_print(p DrawDevicePrintParams) &DrawDevicePrint {
return &DrawDevicePrint{p.id, p.filename}
}
fn draw_device_draw_print(filename string, mut w Window) {
mut d := draw_device_print(id: 'test', filename: filename)
mut dd := DrawDevice(d)
dd.draw_window(mut w)
}
// TODO: documentation
pub fn (d &DrawDevicePrint) set_bg_color(color gg.Color) {}
// TODO: documentation
pub fn (d &DrawDevicePrint) has_text_style() bool {
return false
}
// TODO: documentation
pub fn (d &DrawDevicePrint) set_text_style(font_name string, font_path string, size int, color gg.Color, align int, vertical_align int) {}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_text(x int, y int, text string, cfg gg.TextCfg) {
println('${d.id} draw_text(${x}, ${y}, ${text}, ${cfg})')
}
// pub fn (d &DrawDevicePrint) draw_text_def(x int, y int, text string) {
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_text_default(x int, y int, text string) {
println('${d.id} draw_text_default(${x}, ${y}, ${text})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_text_def(x int, y int, text string) {}
// TODO: documentation
pub fn (d &DrawDevicePrint) set_text_cfg(c_ gg.TextCfg) {}
// TODO: documentation
pub fn (d &DrawDevicePrint) text_size(s string) (int, int) {
return 0, 0
}
// TODO: documentation
pub fn (d &DrawDevicePrint) text_width(s string) int {
return 0
}
// TODO: documentation
pub fn (d &DrawDevicePrint) text_height(s string) int {
return 0
}
// TODO: documentation
pub fn (d &DrawDevicePrint) reset_clipping() {
// TODO: implement
}
// TODO: documentation
pub fn (d &DrawDevicePrint) set_clipping(rect Rect) {
// TODO: implement
}
// TODO: documentation
pub fn (d &DrawDevicePrint) get_clipping() Rect {
// TODO: implement
return Rect{0, 0, int(max_i32), int(max_i32)}
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_pixel(x f32, y f32, color gg.Color, params gg.DrawPixelConfig) {
println('${d.id} draw_pixel(${x}, ${y}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_pixels(points []f32, color gg.Color, params gg.DrawPixelConfig) {
println('${d.id} draw_pixels(${points}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_image(x f32, y f32, width f32, height f32, img &gg.Image) {
println('${d.id} draw_image(${x}, ${y}, ${width}, ${height}, img)')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_triangle_empty(x f32, y f32, x2 f32, y2 f32, x3 f32, y3 f32, color gg.Color) {
println('${d.id} draw_triangle_empty(${x}, ${y}, ${x2}, ${y2}, ${x3}, ${y3}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_triangle_filled(x f32, y f32, x2 f32, y2 f32, x3 f32, y3 f32, color gg.Color) {
println('${d.id} draw_triangle_filled(${x}, ${y}, ${x2}, ${y2}, ${x3}, ${y3}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_rect_empty(x f32, y f32, w f32, h f32, color gg.Color) {
println('${d.id} draw_rect_empty(${x}, ${y}, ${w}, ${h}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_rect_filled(x f32, y f32, w f32, h f32, color gg.Color) {
println('${d.id} draw_rect_filled(${x}, ${y}, ${w}, ${h}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_rounded_rect_filled(x f32, y f32, w f32, h f32, radius f32, color gg.Color) {
println('${d.id} draw_rounded_rect_filled(${x}, ${y}, ${w}, ${h}, ${radius}, ${color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_rounded_rect_empty(x f32, y f32, w f32, h f32, radius f32, border_color gg.Color) {
println('${d.id} draw_rounded_rect_empty(${x}, ${y}, ${w}, ${h}, ${radius}, ${border_color})')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_circle_line(x f32, y f32, r int, segments int, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_circle_empty(x f32, y f32, r f32, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_circle_filled(x f32, y f32, r f32, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_slice_empty(x f32, y f32, r f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_slice_filled(x f32, y f32, r f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_arc_empty(x f32, y f32, radius f32, thickness f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_arc_filled(x f32, y f32, radius f32, thickness f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_arc_line(x f32, y f32, radius f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_line(x f32, y f32, x2 f32, y2 f32, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_convex_poly(points []f32, color gg.Color) {
println('${d.id} ')
}
// TODO: documentation
pub fn (d &DrawDevicePrint) draw_poly_empty(points []f32, color gg.Color) {
println('${d.id} ')
}