-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathdraw_device_svg.v
More file actions
184 lines (140 loc) · 4.7 KB
/
draw_device_svg.v
File metadata and controls
184 lines (140 loc) · 4.7 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
module ui
import gg
// Note: libvg-based SVG rendering is temporarily stubbed out
// due to V compiler submodule resolution issue with src/ layout.
// Restore full implementation when `import ui.libvg` works again.
struct DrawDeviceSVG {
mut:
id string = 'dd_svg'
ts voidptr = unsafe { nil }
pub mut:
s voidptr = unsafe { nil }
}
@[params]
struct DrawDeviceSVGParams {
pub:
id string = 'dd_svg'
}
// TODO: documentation
pub fn draw_device_svg(p DrawDeviceSVGParams) &DrawDeviceSVG {
return &DrawDeviceSVG{
id: p.id
}
}
// screenshot method for SVG device
@[manualfree]
pub fn (mut d DrawDeviceSVG) screenshot_window(filename string, mut w Window) {
// stubbed: requires ui.libvg
}
// methods
// TODO: documentation
pub fn (d &DrawDeviceSVG) begin(win_bg_color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) end() {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) save(filepath string) {
}
// interface DrawDevice
// TODO: documentation
pub fn (d DrawDeviceSVG) set_bg_color(color gg.Color) {}
// TODO: documentation
pub fn (d &DrawDeviceSVG) has_text_style() bool {
return true
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) set_text_style(font_name string, font_path string, size int, color gg.Color, align int, vertical_align int) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_text(x int, y int, text string, cfg gg.TextCfg) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_text_default(x int, y int, text string) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_text_def(x int, y int, text string) {}
// TODO: documentation
pub fn (d &DrawDeviceSVG) set_text_cfg(c gg.TextCfg) {}
// TODO: documentation
pub fn (d &DrawDeviceSVG) text_size(s string) (int, int) {
return 0, 0
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) text_width(s string) int {
return 0
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) text_height(s string) int {
return 0
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) reset_clipping() {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) set_clipping(rect Rect) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) get_clipping() Rect {
return Rect{0, 0, int(max_i32), int(max_i32)}
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_pixel(x f32, y f32, color gg.Color, params gg.DrawPixelConfig) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_pixels(points []f32, color gg.Color, params gg.DrawPixelConfig) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_image(x f32, y f32, width f32, height f32, img &gg.Image) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_triangle_empty(x f32, y f32, x2 f32, y2 f32, x3 f32, y3 f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_triangle_filled(x f32, y f32, x2 f32, y2 f32, x3 f32, y3 f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_rect_empty(x f32, y f32, w f32, h f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_rect_filled(x f32, y f32, w f32, h f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_rounded_rect_filled(x f32, y f32, w f32, h f32, radius f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_rounded_rect_empty(x f32, y f32, w f32, h f32, radius f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_circle_line(x f32, y f32, r int, segments int, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_circle_empty(x f32, y f32, r f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_circle_filled(x f32, y f32, r f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_slice_empty(x f32, y f32, r f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_slice_filled(x f32, y f32, r f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_arc_empty(x f32, y f32, radius f32, thickness f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_arc_filled(x f32, y f32, radius f32, thickness f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_arc_line(x f32, y f32, radius f32, start_angle f32, end_angle f32, segments int, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_line(x f32, y f32, x2 f32, y2 f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_convex_poly(points []f32, color gg.Color) {
}
// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_poly_empty(points []f32, color gg.Color) {
}