1#![allow(dead_code)]
2#![allow(non_upper_case_globals)]
3#![allow(clippy::upper_case_acronyms)]
4#![allow(non_camel_case_types)]
5#![allow(unused_variables)]
6
7use std::ops::*;
8
9use bitflags::bitflags;
10use glutin::context::PossiblyCurrentContext;
11
12#[derive(Copy, Clone, PartialEq, Debug)]
13#[repr(C)]
14pub struct Color4f {
15 pub r: f32,
16 pub g: f32,
17 pub b: f32,
18 pub a: f32,
19}
20
21impl Color4f {
22 pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Color4f {
23 Self { r, g, b, a }
24 }
25}
26
27#[derive(Clone, Debug, PartialEq, Copy, Eq)]
28pub struct Color(u32);
29
30impl From<u32> for Color {
31 fn from(argb: u32) -> Self {
32 Color(argb)
33 }
34}
35
36impl Default for Color {
37 fn default() -> Self {
38 unimplemented!("This is mocked")
39 }
40}
41
42impl Color {
43 pub const TRANSPARENT: Self = Color(0);
44 pub const BLACK: Self = Color(4278190080);
45 pub const DARK_GRAY: Self = Color(4282664004);
46 pub const GRAY: Self = Color(4287137928);
47 pub const LIGHT_GRAY: Self = Color(4291611852);
48 pub const DARK_GREY: Self = Color(4282664004);
49 pub const GREY: Self = Color(4287137928);
50 pub const LIGHT_GREY: Self = Color(4291611852);
51 pub const WHITE: Self = Color(4294967295);
52 pub const RED: Self = Color(4294901760);
53 pub const GREEN: Self = Color(4278255360);
54 pub const BLUE: Self = Color(4278190335);
55 pub const YELLOW: Self = Color(4294967040);
56 pub const CYAN: Self = Color(4278255615);
57 pub const MAGENTA: Self = Color(4294902015);
58
59 #[inline]
60 pub fn new(_argb: u32) -> Self {
61 unimplemented!("This is mocked")
62 }
63
64 #[inline]
65 pub fn from_argb(_a: u8, _r: u8, _g: u8, _b: u8) -> Color {
66 unimplemented!("This is mocked")
67 }
68
69 #[inline]
70 pub fn from_rgb(_r: u8, _g: u8, _b: u8) -> Color {
71 unimplemented!("This is mocked")
72 }
73
74 #[inline]
75 pub fn a(self) -> u8 {
76 unimplemented!("This is mocked")
77 }
78
79 #[inline]
80 pub fn r(self) -> u8 {
81 unimplemented!("This is mocked")
82 }
83
84 #[inline]
85 pub fn g(self) -> u8 {
86 unimplemented!("This is mocked")
87 }
88
89 #[inline]
90 pub fn b(self) -> u8 {
91 unimplemented!("This is mocked")
92 }
93
94 #[inline]
95 #[must_use]
96 pub fn with_a(self, _a: u8) -> Self {
97 unimplemented!("This is mocked")
98 }
99
100 #[inline]
101 pub fn to_rgb(self) -> RGB {
102 unimplemented!("This is mocked")
103 }
104
105 #[inline]
106 pub fn to_hsv(self) -> HSV {
107 unimplemented!("This is mocked")
108 }
109}
110
111#[derive(Copy, Clone, PartialEq, Eq, Debug)]
112pub struct RGB {
113 pub r: u8,
114 pub g: u8,
115 pub b: u8,
116}
117
118impl From<(u8, u8, u8)> for RGB {
119 fn from(_rgb: (u8, u8, u8)) -> Self {
120 unimplemented!("This is mocked")
121 }
122}
123
124#[derive(Copy, Clone, PartialEq, Debug)]
125pub struct HSV {
126 pub h: f32,
127 pub s: f32,
128 pub v: f32,
129}
130
131impl From<(f32, f32, f32)> for HSV {
132 fn from(_hsv: (f32, f32, f32)) -> Self {
133 unimplemented!("This is mocked")
134 }
135}
136
137impl HSV {
138 pub fn to_color(self, _alpha: u8) -> Color {
139 unimplemented!("This is mocked")
140 }
141}
142
143pub enum GradientShaderColors<'a> {
144 Colors(&'a [Color]),
145 }
147
148pub struct Shader;
149
150impl Shader {
151 pub fn linear_gradient<'a>(
152 _points: (impl Into<Point>, impl Into<Point>),
153 _colors: impl Into<GradientShaderColors<'a>>,
154 _pos: impl Into<Option<&'a [f32]>>,
155 _mode: TileMode,
156 _flags: impl Into<Option<GradientFlags>>,
157 _local_matrix: impl Into<Option<&'a Matrix>>,
158 ) -> Option<Self> {
159 unimplemented!("This is mocked")
160 }
161
162 pub fn radial_gradient<'a>(
163 _center: impl Into<Point>,
164 _radius: f32,
165 _colors: impl Into<GradientShaderColors<'a>>,
166 _pos: impl Into<Option<&'a [f32]>>,
167 _mode: TileMode,
168 _flags: impl Into<Option<GradientFlags>>,
169 _local_matrix: impl Into<Option<&'a Matrix>>,
170 ) -> Option<Self> {
171 unimplemented!("This is mocked")
172 }
173
174 pub fn sweep_gradient<'a>(
175 _center: impl Into<Point>,
176 _colors: impl Into<GradientShaderColors<'a>>,
177 _pos: impl Into<Option<&'a [f32]>>,
178 _mode: TileMode,
179 _angles: impl Into<Option<(f32, f32)>>,
180 _flags: impl Into<Option<GradientFlags>>,
181 _local_matrix: impl Into<Option<&'a Matrix>>,
182 ) -> Option<Self> {
183 unimplemented!("This is mocked")
184 }
185}
186
187#[derive(Copy, Clone)]
188pub enum TileMode {
189 Clamp = 0,
190 Repeat = 1,
191 Mirror = 2,
192 Decal = 3,
193}
194
195bitflags! {
196 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
197 pub struct GradientFlags: u32 {
198 const INTERPOLATE_COLORS_IN_PREMUL = 1;
199 }
200}
201
202bitflags! {
203 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
204 pub struct Flags: u32 {
205 const INTERPOLATE_COLORS_IN_PREMUL = 1;
206 }
207}
208
209impl Default for Flags {
210 fn default() -> Self {
211 Self::empty()
212 }
213}
214
215#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
216#[repr(C)]
217pub struct Interpolation {
218 pub in_premul: bool,
219 pub color_space: u8,
220 pub hue_method: u8,
221}
222
223impl Default for Interpolation {
224 fn default() -> Self {
225 Self {
226 in_premul: false,
227 color_space: 0,
228 hue_method: 0,
229 }
230 }
231}
232
233impl From<Flags> for Interpolation {
234 fn from(flags: Flags) -> Self {
235 Self {
236 in_premul: flags.contains(Flags::INTERPOLATE_COLORS_IN_PREMUL),
237 color_space: 0,
238 hue_method: 0,
239 }
240 }
241}
242
243pub struct Colors<'a> {
244 colors: &'a [Color4f],
245 pos: Option<&'a [f32]>,
246 tile_mode: TileMode,
247 color_space: Option<ColorSpace>,
248}
249
250impl<'a> Colors<'a> {
251 pub fn new(
252 colors: &'a [Color4f],
253 pos: Option<&'a [f32]>,
254 tile_mode: TileMode,
255 color_space: impl Into<Option<ColorSpace>>,
256 ) -> Self {
257 Self {
258 colors,
259 pos,
260 tile_mode,
261 color_space: color_space.into(),
262 }
263 }
264
265 pub fn colors(&self) -> &'a [Color4f] {
266 self.colors
267 }
268
269 pub fn positions(&self) -> Option<&'a [f32]> {
270 self.pos
271 }
272
273 pub fn tile_mode(&self) -> TileMode {
274 self.tile_mode
275 }
276
277 pub fn color_space(&self) -> Option<&ColorSpace> {
278 self.color_space.as_ref()
279 }
280}
281
282pub struct Gradient<'a> {
283 colors: Colors<'a>,
284 interpolation: Interpolation,
285}
286
287impl<'a> Gradient<'a> {
288 pub fn new(colors: Colors<'a>, interpolation: impl Into<Interpolation>) -> Self {
289 Self {
290 colors,
291 interpolation: interpolation.into(),
292 }
293 }
294
295 pub fn colors(&self) -> &Colors<'a> {
296 &self.colors
297 }
298
299 pub fn interpolation(&self) -> &Interpolation {
300 &self.interpolation
301 }
302}
303
304pub mod shaders {
305 use super::{
306 Gradient,
307 Matrix,
308 Point,
309 Shader,
310 };
311
312 pub fn linear_gradient<'a>(
313 _points: (impl Into<Point>, impl Into<Point>),
314 _gradient: &Gradient<'a>,
315 _local_matrix: impl Into<Option<&'a Matrix>>,
316 ) -> Option<Shader> {
317 unimplemented!("This is mocked")
318 }
319
320 pub fn radial_gradient<'a>(
321 _center_radius: (impl Into<Point>, f32),
322 _gradient: &Gradient<'a>,
323 _local_matrix: impl Into<Option<&'a Matrix>>,
324 ) -> Option<Shader> {
325 unimplemented!("This is mocked")
326 }
327
328 pub fn sweep_gradient<'a>(
329 _center: impl Into<Point>,
330 _angles: (f32, f32),
331 _gradient: &Gradient<'a>,
332 _local_matrix: impl Into<Option<&'a Matrix>>,
333 ) -> Option<Shader> {
334 unimplemented!("This is mocked")
335 }
336}
337
338#[repr(C)]
339#[derive(Copy, Clone, Debug)]
340pub struct Matrix {
341 mat: [f32; 9usize],
342 type_mask: u32,
343}
344
345impl Matrix {
346 pub fn new_identity() -> Self {
347 unimplemented!("This is mocked")
348 }
349
350 pub fn set_rotate(&mut self, _degrees: f32, _pivot: impl Into<Option<Point>>) -> &mut Self {
351 unimplemented!("This is mocked")
352 }
353
354 pub fn rotate_deg_pivot(_degrees: f32, _pivot: impl Into<Point>) -> Self {
355 unimplemented!("This is mocked")
356 }
357}
358
359#[repr(C)]
360#[derive(Copy, Clone, PartialEq, Default, Debug)]
361pub struct Point {
362 pub x: f32,
363 pub y: f32,
364}
365
366impl Point {
367 pub fn new(_: f32, _: f32) -> Self {
368 unimplemented!("This is mocked")
369 }
370}
371
372impl Neg for Point {
373 type Output = Point;
374 fn neg(self) -> Self::Output {
375 Point::new(-self.x, -self.y)
376 }
377}
378
379impl Add for Point {
380 type Output = Point;
381 fn add(self, rhs: Self) -> Self {
382 Point::new(self.x + rhs.x, self.y + rhs.y)
383 }
384}
385
386impl Sub for Point {
387 type Output = Point;
388 fn sub(self, rhs: Self) -> Self {
389 Point::new(self.x - rhs.x, self.y - rhs.y)
390 }
391}
392impl Mul<f32> for Point {
393 type Output = Self;
394 fn mul(self, rhs: f32) -> Self {
395 Self::new(self.x * rhs, self.y * rhs)
396 }
397}
398
399impl MulAssign<f32> for Point {
400 fn mul_assign(&mut self, rhs: f32) {
401 self.x *= rhs;
402 self.y *= rhs;
403 }
404}
405
406impl Div<f32> for Point {
407 type Output = Self;
408 fn div(self, rhs: f32) -> Self {
409 Self::new(self.x / rhs, self.y / rhs)
410 }
411}
412
413impl DivAssign<f32> for Point {
414 fn div_assign(&mut self, rhs: f32) {
415 self.x /= rhs;
416 self.y /= rhs;
417 }
418}
419
420#[repr(C)]
421#[derive(Copy, Clone, Debug, PartialEq)]
422pub struct TextShadow {
423 pub color: Color,
424 pub offset: Point,
425 pub blur_sigma: f64,
426}
427
428impl Default for TextShadow {
429 fn default() -> Self {
430 unimplemented!("This is mocked")
431 }
432}
433
434impl TextShadow {
435 pub fn new(color: Color, _: impl Into<Point>, _: f64) -> Self {
436 unimplemented!("This is mocked")
437 }
438}
439
440impl From<(f32, f32)> for Point {
441 fn from(source: (f32, f32)) -> Self {
442 Point::new(source.0, source.1)
443 }
444}
445
446impl From<(i32, i32)> for Point {
447 fn from(source: (i32, i32)) -> Self {
448 (source.0 as f32, source.1 as f32).into()
449 }
450}
451
452#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
453#[repr(transparent)]
454pub struct Weight(i32);
455
456impl From<i32> for Weight {
457 fn from(weight: i32) -> Self {
458 Self(weight)
459 }
460}
461
462#[allow(non_upper_case_globals)]
463impl Weight {
464 pub const INVISIBLE: Self = Self(0);
465 pub const THIN: Self = Self(100);
466 pub const EXTRA_LIGHT: Self = Self(200);
467 pub const LIGHT: Self = Self(300);
468 pub const NORMAL: Self = Self(400);
469 pub const MEDIUM: Self = Self(500);
470 pub const SEMI_BOLD: Self = Self(600);
471 pub const BOLD: Self = Self(700);
472 pub const EXTRA_BOLD: Self = Self(800);
473 pub const BLACK: Self = Self(900);
474 pub const EXTRA_BLACK: Self = Self(1000);
475}
476
477#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
478pub enum Slant {
479 Upright = 0,
480 Italic = 1,
481 Oblique = 2,
482}
483
484#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
485#[repr(transparent)]
486pub struct Width(i32);
487
488#[allow(non_upper_case_globals)]
489impl Width {
490 pub const ULTRA_CONDENSED: Self = Self(1);
491 pub const EXTRA_CONDENSED: Self = Self(2);
492 pub const CONDENSED: Self = Self(3);
493 pub const SEMI_CONDENSED: Self = Self(4);
494 pub const NORMAL: Self = Self(5);
495 pub const SEMI_EXPANDED: Self = Self(6);
496 pub const EXPANDED: Self = Self(7);
497 pub const EXTRA_EXPANDED: Self = Self(8);
498 pub const ULTRA_EXPANDED: Self = Self(9);
499}
500
501impl From<i32> for Width {
502 fn from(value: i32) -> Width {
503 Width(value)
504 }
505}
506
507bitflags! {
508 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
509 pub struct SkTextDecoration: u32 {
510 const NO_DECORATION = 0;
511 const UNDERLINE = 1;
512 const OVERLINE = 2;
513 const LINE_THROUGH = 4;
514 }
515}
516
517impl Default for SkTextDecoration {
518 fn default() -> Self {
519 SkTextDecoration::NO_DECORATION
520 }
521}
522
523#[repr(C)]
524#[derive(Copy, Clone, PartialEq, Default, Debug)]
525pub struct Decoration {
526 pub ty: SkTextDecoration,
527 pub mode: SkTextDecorationMode,
528 pub color: Color,
529 pub style: SkTextDecorationStyle,
530 pub thickness_multiplier: f32,
531}
532
533#[repr(C)]
534#[derive(Copy, Clone, PartialEq, Debug, Default)]
535pub enum SkTextDecorationMode {
536 #[default]
537 Gaps = 0,
538 Through = 1,
539}
540
541#[repr(C)]
542#[derive(Copy, Clone, PartialEq, Debug, Default)]
543pub enum SkTextDecorationStyle {
544 #[default]
545 Solid = 0,
546 Double = 1,
547 Dotted = 2,
548 Dashed = 3,
549 Wavy = 4,
550}
551
552#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
553pub enum TextAlign {
554 #[default]
555 Left = 0,
556 Right = 1,
557 Center = 2,
558 Justify = 3,
559 Start = 4,
560 End = 5,
561}
562
563#[derive(Default, Clone)]
564pub struct TextStyle;
565
566impl TextStyle {
567 pub fn new() -> Self {
568 unimplemented!("This is mocked")
569 }
570
571 #[deprecated(since = "0.51.0", note = "Use clone_for_placeholder")]
572 #[must_use]
573 pub fn to_placeholder(&self) -> Self {
574 unimplemented!("This is mocked")
575 }
576
577 #[must_use]
578 pub fn clone_for_placeholder(&self) -> Self {
579 unimplemented!("This is mocked")
580 }
581
582 pub fn equals(&self, _other: &TextStyle) -> bool {
583 unimplemented!("This is mocked")
584 }
585
586 pub fn equals_by_fonts(&self, _that: &TextStyle) -> bool {
587 unimplemented!("This is mocked")
588 }
589
590 pub fn color(&self) -> Color {
591 unimplemented!("This is mocked")
592 }
593
594 pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self {
595 unimplemented!("This is mocked")
596 }
597
598 pub fn foreground(&self) -> Paint {
599 unimplemented!("This is mocked")
600 }
601
602 pub fn set_foreground_color(&mut self, _paint: &Paint) -> &mut Self {
603 unimplemented!("This is mocked")
604 }
605
606 pub fn clear_foreground_color(&mut self) -> &mut Self {
607 unimplemented!("This is mocked")
608 }
609
610 pub fn background(&self) -> Paint {
611 unimplemented!("This is mocked")
612 }
613
614 pub fn set_background_color(&mut self, _paint: &Paint) -> &mut Self {
615 unimplemented!("This is mocked")
616 }
617
618 pub fn clear_background_color(&mut self) -> &mut Self {
619 unimplemented!("This is mocked")
620 }
621
622 pub fn decoration(&self) -> &Decoration {
623 unimplemented!("This is mocked")
624 }
625
626 pub fn set_decoration(&mut self, decoration: &Decoration) {
627 unimplemented!("This is mocked")
628 }
629
630 pub fn set_decoration_type(&mut self, decoration: SkTextDecoration) {
631 unimplemented!("This is mocked")
632 }
633
634 pub fn set_decoration_mode(&mut self, mode: SkTextDecorationMode) {
635 unimplemented!("This is mocked")
636 }
637
638 pub fn set_decoration_style(&mut self, style: SkTextDecorationStyle) {
639 unimplemented!("This is mocked")
640 }
641
642 pub fn set_decoration_color(&mut self, color: impl Into<Color>) {
643 unimplemented!("This is mocked")
644 }
645
646 pub fn font_style(&self) -> FontStyle {
647 unimplemented!("This is mocked")
648 }
649
650 pub fn set_font_style(&mut self, _font_style: FontStyle) -> &mut Self {
651 unimplemented!("This is mocked")
652 }
653
654 pub fn shadows(&self) -> &[TextShadow] {
655 unimplemented!("This is mocked")
656 }
657
658 pub fn add_shadow(&mut self, _shadow: TextShadow) -> &mut Self {
659 unimplemented!("This is mocked")
660 }
661
662 pub fn reset_shadows(&mut self) -> &mut Self {
663 unimplemented!("This is mocked")
664 }
665
666 pub fn font_features(&self) -> &[FontFeature] {
667 unimplemented!("This is mocked")
668 }
669
670 pub fn add_font_feature(&mut self, _font_feature: impl AsRef<str>, _value: i32) {
671 unimplemented!("This is mocked")
672 }
673
674 pub fn reset_font_features(&mut self) {
675 unimplemented!("This is mocked")
676 }
677
678 pub fn font_size(&self) -> f32 {
679 unimplemented!("This is mocked")
680 }
681
682 pub fn set_font_size(&mut self, _size: f32) -> &mut Self {
683 unimplemented!("This is mocked")
684 }
685
686 pub fn font_families(&self) -> FontFamilies {
687 unimplemented!("This is mocked")
688 }
689
690 pub fn set_font_families(&mut self, _families: &[impl AsRef<str>]) -> &mut Self {
691 unimplemented!("This is mocked")
692 }
693
694 pub fn baseline_shift(&self) -> f32 {
695 unimplemented!("This is mocked")
696 }
697
698 pub fn set_baseline_shift(&mut self, _baseline_shift: f32) -> &mut Self {
699 unimplemented!("This is mocked")
700 }
701
702 pub fn set_height(&mut self, _height: f32) -> &mut Self {
703 unimplemented!("This is mocked")
704 }
705
706 pub fn height(&self) -> f32 {
707 unimplemented!("This is mocked")
708 }
709
710 pub fn set_height_override(&mut self, _height_override: bool) -> &mut Self {
711 unimplemented!("This is mocked")
712 }
713
714 pub fn height_override(&self) -> bool {
715 unimplemented!("This is mocked")
716 }
717
718 pub fn set_half_leading(&mut self, _half_leading: bool) -> &mut Self {
719 unimplemented!("This is mocked")
720 }
721
722 pub fn half_leading(&self) -> bool {
723 unimplemented!("This is mocked")
724 }
725
726 pub fn set_letter_spacing(&mut self, _letter_spacing: f32) -> &mut Self {
727 unimplemented!("This is mocked")
728 }
729
730 pub fn letter_spacing(&self) -> f32 {
731 unimplemented!("This is mocked")
732 }
733
734 pub fn set_word_spacing(&mut self, _word_spacing: f32) -> &mut Self {
735 unimplemented!("This is mocked")
736 }
737
738 pub fn word_spacing(&self) -> f32 {
739 unimplemented!("This is mocked")
740 }
741
742 pub fn typeface(&self) -> Option<Typeface> {
743 unimplemented!("This is mocked")
744 }
745
746 pub fn set_typeface(&mut self, _typeface: impl Into<Option<Typeface>>) -> &mut Self {
747 unimplemented!("This is mocked")
748 }
749
750 pub fn locale(&self) -> &str {
751 unimplemented!("This is mocked")
752 }
753
754 pub fn set_locale(&mut self, _locale: impl AsRef<str>) -> &mut Self {
755 unimplemented!("This is mocked")
756 }
757
758 pub fn text_baseline(&self) -> TextBaseline {
759 unimplemented!("This is mocked")
760 }
761
762 pub fn set_text_baseline(&mut self, _baseline: TextBaseline) -> &mut Self {
763 unimplemented!("This is mocked")
764 }
765
766 pub fn font_metrics(&self) -> FontMetrics {
767 unimplemented!("This is mocked")
768 }
769
770 pub fn is_placeholder(&self) -> bool {
771 unimplemented!("This is mocked")
772 }
773
774 pub fn set_placeholder(&mut self) -> &mut Self {
775 unimplemented!("This is mocked")
776 }
777
778 pub fn set_height_behavior(&mut self, behavior: TextHeightBehavior) {
779 unimplemented!("This is mocked")
780 }
781}
782
783#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
784pub enum TextHeightBehavior {
785 All = 0,
786 DisableFirstAscent = 1,
787 DisableLastDescent = 2,
788 DisableAll = 3,
789}
790
791pub struct Typeface;
792
793#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
794pub enum TextBaseline {
795 Alphabetic = 0,
796 Ideographic = 1,
797}
798
799pub struct FontFamilies;
800
801#[derive(Default, Clone)]
802pub struct Paint;
803
804impl Paint {
805 pub fn set_anti_alias(&mut self, _anti_alias: bool) -> &mut Self {
806 unimplemented!("This is mocked")
807 }
808
809 pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self {
810 unimplemented!("This is mocked")
811 }
812
813 pub fn set_blend_mode(&mut self, _mode: BlendMode) -> &mut Self {
814 unimplemented!("This is mocked")
815 }
816
817 pub fn set_style(&mut self, _style: PaintStyle) -> &mut Self {
818 unimplemented!("This is mocked")
819 }
820
821 pub fn set_shader(&mut self, _shader: impl Into<Option<Shader>>) -> &mut Self {
822 unimplemented!("This is mocked")
823 }
824
825 pub fn set_stroke_width(&mut self, _width: f32) -> &mut Self {
826 unimplemented!("This is mocked")
827 }
828
829 pub fn set_mask_filter(&mut self, _mask_filter: impl Into<Option<MaskFilter>>) -> &mut Self {
830 unimplemented!("This is mocked")
831 }
832}
833
834pub enum PaintStyle {
835 Fill = 0,
836 Stroke = 1,
837 StrokeAndFill = 2,
838}
839
840pub struct FontStyle;
841
842impl FontStyle {
843 pub fn new(_weight: Weight, _width: Width, _slant: Slant) -> Self {
844 unimplemented!("This is mocked")
845 }
846}
847
848#[derive(Default, Clone)]
849pub struct FontMgr;
850
851impl FontMgr {
852 pub fn new_from_data(
853 &self,
854 _bytes: &[u8],
855 _ttc_index: impl Into<Option<usize>>,
856 ) -> Option<Typeface> {
857 unimplemented!("This is mocked")
858 }
859}
860
861pub struct FontFeature;
862
863pub struct TypefaceFontProvider;
864
865impl TypefaceFontProvider {
866 pub fn new() -> Self {
867 unimplemented!("This is mocked")
868 }
869
870 pub fn register_typeface(
871 &mut self,
872 _typeface: Typeface,
873 _alias: Option<impl AsRef<str>>,
874 ) -> usize {
875 unimplemented!("This is mocked")
876 }
877}
878
879impl From<TypefaceFontProvider> for FontMgr {
880 fn from(_provider: TypefaceFontProvider) -> Self {
881 unimplemented!("This is mocked")
882 }
883}
884
885#[derive(Clone)]
886pub struct FontCollection;
887
888impl FontCollection {
889 pub fn new() -> Self {
890 unimplemented!("This is mocked")
891 }
892
893 pub fn fallback_manager(&self) -> Option<FontMgr> {
894 unimplemented!("This is mocked")
895 }
896
897 pub fn set_default_font_manager<'a>(
898 &mut self,
899 _font_manager: impl Into<Option<FontMgr>>,
900 _default_family_name: impl Into<Option<&'a str>>,
901 ) {
902 unimplemented!("This is mocked")
903 }
904
905 pub fn set_dynamic_font_manager(&mut self, _font_manager: impl Into<Option<FontMgr>>) {
906 unimplemented!("This is mocked")
907 }
908
909 pub fn paragraph_cache_mut(&mut self) -> &mut ParagraphCache {
910 unimplemented!("This is mocked")
911 }
912}
913
914pub struct ParagraphCache;
915
916impl ParagraphCache {
917 pub fn turn_on(&mut self, on: bool) {
918 unimplemented!("This is mocked")
919 }
920}
921
922pub struct Paragraph;
923
924impl Paragraph {
925 pub fn max_width(&self) -> f32 {
926 unimplemented!("This is mocked")
927 }
928
929 pub fn height(&self) -> f32 {
930 unimplemented!("This is mocked")
931 }
932
933 pub fn min_intrinsic_width(&self) -> f32 {
934 unimplemented!("This is mocked")
935 }
936
937 pub fn max_intrinsic_width(&self) -> f32 {
938 unimplemented!("This is mocked")
939 }
940
941 pub fn alphabetic_baseline(&self) -> f32 {
942 unimplemented!("This is mocked")
943 }
944
945 pub fn ideographic_baseline(&self) -> f32 {
946 unimplemented!("This is mocked")
947 }
948
949 pub fn longest_line(&self) -> f32 {
950 unimplemented!("This is mocked")
951 }
952
953 pub fn did_exceed_max_lines(&self) -> bool {
954 unimplemented!("This is mocked")
955 }
956
957 pub fn layout(&mut self, _width: f32) {
958 unimplemented!("This is mocked")
959 }
960
961 pub fn paint(&self, _canvas: &Canvas, _p: impl Into<Point>) {
962 unimplemented!("This is mocked")
963 }
964
965 pub fn get_rects_for_range(
968 &self,
969 _range: Range<usize>,
970 _rect_height_style: RectHeightStyle,
971 _rect_width_style: RectWidthStyle,
972 ) -> Vec<TextBox> {
973 unimplemented!("This is mocked")
974 }
975
976 pub fn get_rects_for_placeholders(&self) -> Vec<TextBox> {
977 unimplemented!("This is mocked")
978 }
979
980 pub fn get_glyph_position_at_coordinate(&self, _p: impl Into<Point>) -> PositionWithAffinity {
981 unimplemented!("This is mocked")
982 }
983
984 pub fn get_word_boundary(&self, _offset: u32) -> Range<usize> {
985 unimplemented!("This is mocked")
986 }
987
988 pub fn get_line_metrics(&self) -> Vec<LineMetrics> {
989 unimplemented!("This is mocked")
990 }
991
992 pub fn line_number(&self) -> usize {
993 unimplemented!("This is mocked")
994 }
995
996 pub fn mark_dirty(&mut self) {
997 unimplemented!("This is mocked")
998 }
999
1000 pub fn unresolved_glyphs(&mut self) -> Option<usize> {
1001 unimplemented!("This is mocked")
1002 }
1003
1004 pub fn get_line_number_at(&self, _code_unit_index: usize) -> Option<usize> {
1005 unimplemented!("This is mocked")
1006 }
1007
1008 pub fn get_line_metrics_at(&self, _line_number: usize) -> Option<LineMetrics> {
1009 unimplemented!("This is mocked")
1010 }
1011
1012 pub fn get_actual_text_range(
1013 &self,
1014 _line_number: usize,
1015 _include_spaces: bool,
1016 ) -> Range<usize> {
1017 unimplemented!("This is mocked")
1018 }
1019
1020 pub fn get_glyph_cluster_at(&self, _code_unit_index: usize) -> Option<GlyphClusterInfo> {
1021 unimplemented!("This is mocked")
1022 }
1023
1024 pub fn get_closest_glyph_cluster_at(&self, _d: impl Into<Point>) -> Option<GlyphClusterInfo> {
1025 unimplemented!("This is mocked")
1026 }
1027
1028 pub fn get_font_at(&self, _code_unit_index: usize) -> Font {
1029 unimplemented!("This is mocked")
1030 }
1031
1032 pub fn get_fonts(&self) -> Vec<FontInfo> {
1033 unimplemented!("This is mocked")
1034 }
1035}
1036
1037#[derive(Default)]
1038pub struct ParagraphStyle;
1039
1040impl ParagraphStyle {
1041 pub fn new() -> Self {
1042 unimplemented!("This is mocked")
1043 }
1044
1045 pub fn strut_style(&self) -> &StrutStyle {
1046 unimplemented!("This is mocked")
1047 }
1048
1049 pub fn set_strut_style(&mut self, _strut_style: StrutStyle) -> &mut Self {
1050 unimplemented!("This is mocked")
1051 }
1052
1053 pub fn text_style(&self) -> &TextStyle {
1054 unimplemented!("This is mocked")
1055 }
1056
1057 pub fn set_text_style(&mut self, _text_style: &TextStyle) -> &mut Self {
1058 unimplemented!("This is mocked")
1059 }
1060
1061 pub fn text_direction(&self) -> TextDirection {
1062 unimplemented!("This is mocked")
1063 }
1064
1065 pub fn set_text_direction(&mut self, _direction: TextDirection) -> &mut Self {
1066 unimplemented!("This is mocked")
1067 }
1068
1069 pub fn text_align(&self) -> TextAlign {
1070 unimplemented!("This is mocked")
1071 }
1072
1073 pub fn set_text_align(&mut self, _align: TextAlign) -> &mut Self {
1074 unimplemented!("This is mocked")
1075 }
1076
1077 pub fn max_lines(&self) -> Option<usize> {
1078 unimplemented!("This is mocked")
1079 }
1080
1081 pub fn set_max_lines(&mut self, _lines: impl Into<Option<usize>>) -> &mut Self {
1082 unimplemented!("This is mocked")
1083 }
1084
1085 pub fn ellipsis(&self) -> &str {
1088 unimplemented!("This is mocked")
1089 }
1090
1091 pub fn set_ellipsis(&mut self, _ellipsis: impl AsRef<str>) -> &mut Self {
1092 unimplemented!("This is mocked")
1093 }
1094
1095 pub fn height(&self) -> f32 {
1096 unimplemented!("This is mocked")
1097 }
1098
1099 pub fn set_height(&mut self, _height: f32) -> &mut Self {
1100 unimplemented!("This is mocked")
1101 }
1102
1103 pub fn text_height_behavior(&self) -> TextHeightBehavior {
1104 unimplemented!("This is mocked")
1105 }
1106
1107 pub fn set_text_height_behavior(&mut self, _v: TextHeightBehavior) -> &mut Self {
1108 unimplemented!("This is mocked")
1109 }
1110
1111 pub fn unlimited_lines(&self) -> bool {
1112 unimplemented!("This is mocked")
1113 }
1114
1115 pub fn ellipsized(&self) -> bool {
1116 unimplemented!("This is mocked")
1117 }
1118
1119 pub fn effective_align(&self) -> TextAlign {
1120 unimplemented!("This is mocked")
1121 }
1122
1123 pub fn hinting_is_on(&self) -> bool {
1124 unimplemented!("This is mocked")
1125 }
1126
1127 pub fn turn_hinting_off(&mut self) -> &mut Self {
1128 unimplemented!("This is mocked")
1129 }
1130
1131 pub fn replace_tab_characters(&self) -> bool {
1132 unimplemented!("This is mocked")
1133 }
1134
1135 pub fn set_replace_tab_characters(&mut self, _value: bool) -> &mut Self {
1136 unimplemented!("This is mocked")
1137 }
1138}
1139
1140pub struct ParagraphBuilder;
1141
1142impl ParagraphBuilder {
1143 pub fn push_style(&mut self, _style: &TextStyle) -> &mut Self {
1144 unimplemented!("This is mocked")
1145 }
1146
1147 pub fn pop(&mut self) -> &mut Self {
1148 unimplemented!("This is mocked")
1149 }
1150
1151 pub fn peek_style(&mut self) -> TextStyle {
1152 unimplemented!("This is mocked")
1153 }
1154
1155 pub fn add_text(&mut self, _str: impl AsRef<str>) -> &mut Self {
1156 unimplemented!("This is mocked")
1157 }
1158
1159 pub fn add_placeholder(&mut self, _placeholder_style: &PlaceholderStyle) -> &mut Self {
1160 unimplemented!("This is mocked")
1161 }
1162
1163 pub fn build(&mut self) -> Paragraph {
1164 unimplemented!("This is mocked")
1165 }
1166
1167 pub fn reset(&mut self) {
1168 unimplemented!("This is mocked")
1169 }
1170
1171 pub fn new(_style: &ParagraphStyle, _font_collection: impl Into<FontCollection>) -> Self {
1172 unimplemented!("This is mocked")
1173 }
1174}
1175
1176impl From<&FontCollection> for FontCollection {
1177 fn from(value: &FontCollection) -> Self {
1178 value.clone()
1179 }
1180}
1181
1182pub struct StrutStyle;
1183
1184#[repr(i32)]
1185#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1186pub enum TextDirection {
1187 RTL = 0,
1188 LTR = 1,
1189}
1190
1191pub struct PlaceholderStyle;
1192
1193pub struct Canvas;
1194
1195impl Canvas {
1196 pub fn save(&self) -> usize {
1197 unimplemented!("This is mocked")
1198 }
1199
1200 pub fn restore(&self) {
1201 unimplemented!("This is mocked")
1202 }
1203
1204 pub fn restore_to_count(&self, layer: usize) {
1205 unimplemented!("This is mocked")
1206 }
1207
1208 pub fn concat(&self, _matrix: &Matrix) {
1209 unimplemented!("This is mocked")
1210 }
1211
1212 pub fn clip_rect(&self, rect: impl AsRef<Rect>, _clip: impl Into<Option<ClipOp>>, _: bool) {
1213 unimplemented!("This is mocked")
1214 }
1215
1216 pub fn clip_rrect(&self, _rect: RRect, _clip: ClipOp, _: bool) {
1217 unimplemented!("This is mocked")
1218 }
1219
1220 pub fn draw_image(
1221 &self,
1222 _image: impl AsRef<Image>,
1223 _left_top: impl Into<Point>,
1224 _paint: Option<&Paint>,
1225 ) -> &Self {
1226 unimplemented!("This is mocked")
1227 }
1228
1229 pub fn draw_round_rect(
1230 &self,
1231 rect: impl AsRef<Rect>,
1232 rx: f32,
1233 ry: f32,
1234 paint: &Paint,
1235 ) -> &Self {
1236 unimplemented!("This is mocked")
1237 }
1238
1239 pub fn draw_image_nine(
1240 &self,
1241 _image: Image,
1242 _center: IRect,
1243 _dst: Rect,
1244 _filter_mode: FilterMode,
1245 _paint: Option<&Paint>,
1246 ) -> &Self {
1247 unimplemented!("This is mocked")
1248 }
1249
1250 pub fn draw_image_rect(
1251 &self,
1252 image: impl AsRef<Image>,
1253 src: Option<(&Rect, SrcRectConstraint)>,
1254 dst: impl AsRef<Rect>,
1255 paint: &Paint,
1256 ) -> &Self {
1257 unimplemented!("This is mocked")
1258 }
1259
1260 pub fn draw_image_rect_with_sampling_options(
1261 &self,
1262 image: impl AsRef<Image>,
1263 src: Option<(&Rect, SrcRectConstraint)>,
1264 dst: impl AsRef<Rect>,
1265 sampling_options: impl Into<SamplingOptions>,
1266 paint: &Paint,
1267 ) -> &Self {
1268 unimplemented!("This is mocked")
1269 }
1270
1271 pub fn draw_rect(&self, _rect: Rect, _paint: &Paint) -> &Self {
1272 unimplemented!("This is mocked")
1273 }
1274
1275 pub fn draw_drrect(
1276 &self,
1277 outer: impl AsRef<RRect>,
1278 inner: impl AsRef<RRect>,
1279 paint: &Paint,
1280 ) -> &Self {
1281 unimplemented!("This is mocked")
1282 }
1283
1284 pub fn draw_path(&self, _path: &Path, _paint: &Paint) -> &Self {
1285 unimplemented!("This is mocked")
1286 }
1287
1288 pub fn clip_path(
1289 &self,
1290 _path: &Path,
1291 _op: impl Into<Option<ClipOp>>,
1292 _do_anti_alias: impl Into<Option<bool>>,
1293 ) -> &Self {
1294 unimplemented!("This is mocked")
1295 }
1296
1297 pub fn translate(&self, _d: impl Into<Point>) -> &Self {
1298 unimplemented!("This is mocked")
1299 }
1300
1301 pub fn scale(&self, _: impl Into<Point>) {
1302 unimplemented!("This is mocked")
1303 }
1304
1305 pub fn clear(&self, _: impl Into<Color>) {
1306 unimplemented!("This is mocked")
1307 }
1308
1309 pub fn draw_paint(&self, _: &Paint) -> &Self {
1310 unimplemented!("This is mocked")
1311 }
1312
1313 pub fn draw_line(&self, _p1: impl Into<Point>, _p2: impl Into<Point>, _paint: &Paint) -> &Self {
1314 unimplemented!("This is mocked")
1315 }
1316
1317 pub fn draw_circle(&self, _center: impl Into<Point>, _radius: f32, _paint: &Paint) -> &Self {
1318 unimplemented!("This is mocked")
1319 }
1320
1321 pub fn save_layer(&self, layer_rec: &SaveLayerRec) -> usize {
1322 unimplemented!("This is mocked")
1323 }
1324
1325 pub fn save_layer_alpha_f(&self, bounds: impl Into<Option<Rect>>, alpha: f32) -> usize {
1326 unimplemented!("This is mocked")
1327 }
1328}
1329
1330pub enum SrcRectConstraint {
1331 Strict = 0,
1332 Fast = 1,
1333}
1334
1335#[derive(Default)]
1336pub struct SamplingOptions;
1337
1338pub struct ImageFilter;
1339
1340pub fn blur(
1341 (sigma_x, sigma_y): (f32, f32),
1342 tile_mode: impl Into<Option<()>>,
1343 input: impl Into<Option<()>>,
1344 crop_rect: &Rect,
1345) -> Option<ImageFilter> {
1346 unimplemented!("This is mocked")
1347}
1348
1349#[repr(C)]
1350#[derive(Default)]
1351pub struct SaveLayerRec;
1352
1353impl<'a> SaveLayerRec {
1354 pub fn bounds(self, bounds: &'a Rect) -> Self {
1355 unimplemented!("This is mocked")
1356 }
1357
1358 pub fn paint(self, paint: &'a Paint) -> Self {
1359 unimplemented!("This is mocked")
1360 }
1361
1362 pub fn backdrop(self, backdrop: &'a ImageFilter) -> Self {
1363 unimplemented!("This is mocked")
1364 }
1365
1366 pub fn color_space(self, color_space: &'a ColorSpace) -> Self {
1367 unimplemented!("This is mocked")
1368 }
1369}
1370
1371impl SamplingOptions {
1372 pub fn new(filter_mode: FilterMode, mm: MipmapMode) -> Self {
1373 unimplemented!("This is mocked")
1374 }
1375}
1376
1377pub struct CubicResampler;
1378
1379impl CubicResampler {
1380 pub fn mitchell() -> Self {
1381 unimplemented!("This is mocked")
1382 }
1383
1384 pub fn catmull_rom() -> Self {
1385 unimplemented!("This is mocked")
1386 }
1387}
1388
1389impl From<CubicResampler> for SamplingOptions {
1390 fn from(_: CubicResampler) -> Self {
1391 unimplemented!("This is mocked")
1392 }
1393}
1394
1395#[repr(i32)]
1396#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
1397pub enum RectHeightStyle {
1398 #[default]
1400 Tight,
1401 Max,
1404 IncludeLineSpacingMiddle,
1412 IncludeLineSpacingTop,
1414 IncludeLineSpacingBottom,
1416 Strut,
1417}
1418
1419#[repr(i32)]
1420#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
1421pub enum RectWidthStyle {
1422 #[default]
1425 Tight,
1426 Max,
1429}
1430
1431pub struct LineMetrics;
1432
1433impl LineMetrics {
1434 pub fn get_style_metrics(&self, range: Range<usize>) -> Vec<(usize, &StyleMetrics)> {
1435 unimplemented!("This is mocked")
1436 }
1437}
1438
1439pub struct StyleMetrics {
1440 pub font_metrics: FontMetrics,
1441}
1442
1443pub struct FontMetrics {
1444 pub ascent: f32,
1445 pub descent: f32,
1446}
1447
1448pub struct GlyphClusterInfo;
1449
1450pub struct TextBox {
1451 pub rect: Rect,
1452}
1453
1454pub struct Font;
1455
1456pub struct FontInfo;
1457
1458pub struct PositionWithAffinity {
1459 pub position: i32,
1460}
1461
1462pub struct RuntimeEffect;
1463
1464impl RuntimeEffect {
1465 pub fn uniforms(&self) -> &[Uniform] {
1466 unimplemented!("This is mocked")
1467 }
1468}
1469
1470#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1471pub enum Uniform {
1472 Float = 0,
1473 Float2 = 1,
1474 Float3 = 2,
1475 Float4 = 3,
1476 Float2x2 = 4,
1477 Float3x3 = 5,
1478 Float4x4 = 6,
1479 Int = 7,
1480 Int2 = 8,
1481 Int3 = 9,
1482 Int4 = 10,
1483}
1484
1485impl Uniform {
1486 pub fn name(&self) -> &str {
1487 unimplemented!("This is mocked")
1488 }
1489}
1490
1491#[repr(i32)]
1492#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1493pub enum ClipOp {
1494 Difference = 0,
1495 Intersect = 1,
1496}
1497
1498#[repr(C)]
1499#[derive(Copy, Clone, PartialEq, Default, Debug)]
1500pub struct Rect {
1501 pub left: f32,
1503 pub top: f32,
1505 pub right: f32,
1507 pub bottom: f32,
1509}
1510
1511impl AsRef<Rect> for Rect {
1512 fn as_ref(&self) -> &Rect {
1513 self
1514 }
1515}
1516
1517impl AsRef<IRect> for Rect {
1518 fn as_ref(&self) -> &IRect {
1519 unimplemented!("This is mocked")
1520 }
1521}
1522
1523impl AsRef<Rect> for IRect {
1524 fn as_ref(&self) -> &Rect {
1525 unimplemented!("This is mocked")
1526 }
1527}
1528
1529impl From<Rect> for IRect {
1530 fn from(value: Rect) -> IRect {
1531 unimplemented!("This is mocked")
1532 }
1533}
1534
1535impl Rect {
1536 pub fn new(_left: f32, _top: f32, _right: f32, _bottom: f32) -> Self {
1537 unimplemented!("This is mocked")
1538 }
1539
1540 pub fn x(&self) -> f32 {
1541 unimplemented!("This is mocked")
1542 }
1543
1544 pub fn y(&self) -> f32 {
1545 unimplemented!("This is mocked")
1546 }
1547
1548 pub fn width(&self) -> f32 {
1549 unimplemented!("This is mocked")
1550 }
1551
1552 pub fn height(&self) -> f32 {
1553 unimplemented!("This is mocked")
1554 }
1555
1556 pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1557 unimplemented!("This is mocked")
1558 }
1559
1560 pub fn round_in(&self) -> IRect {
1561 unimplemented!("This is mocked")
1562 }
1563
1564 pub fn from_xywh(x: f32, y: f32, w: f32, h: f32) -> IRect {
1565 unimplemented!("This is mocked")
1566 }
1567}
1568
1569#[derive(Clone, Debug)]
1570pub struct Image;
1571
1572impl AsRef<Image> for Image {
1573 fn as_ref(&self) -> &Image {
1574 self
1575 }
1576}
1577
1578impl Image {
1579 pub fn from_encoded(_data: Data) -> Option<Self> {
1580 unimplemented!("This is mocked")
1581 }
1582
1583 pub fn width(&self) -> i32 {
1584 unimplemented!("This is mocked")
1585 }
1586
1587 pub fn height(&self) -> i32 {
1588 unimplemented!("This is mocked")
1589 }
1590
1591 pub fn encode<'a>(
1592 &self,
1593 context: impl Into<Option<&'a mut DirectContext>>,
1594 format: EncodedImageFormat,
1595 quality: impl Into<Option<u32>>,
1596 ) -> Option<Data> {
1597 unimplemented!("This is mocked")
1598 }
1599}
1600
1601pub struct Data;
1602
1603impl Data {
1604 pub fn new_copy(_bytes: &[u8]) -> Self {
1605 unimplemented!("This is mocked")
1606 }
1607
1608 pub unsafe fn new_bytes(_bytes: &[u8]) -> Self {
1609 unimplemented!("This is mocked")
1610 }
1611}
1612
1613impl Deref for Data {
1614 type Target = [u8];
1615 fn deref(&self) -> &Self::Target {
1616 unimplemented!("This is mocked")
1617 }
1618}
1619
1620#[repr(C)]
1621#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
1622pub struct IRect {
1623 pub left: i32,
1625 pub top: i32,
1627 pub right: i32,
1629 pub bottom: i32,
1631}
1632
1633impl IRect {
1634 pub fn new(_left: i32, _top: i32, _right: i32, _bottom: i32) -> Self {
1635 unimplemented!("This is mocked")
1636 }
1637}
1638
1639impl From<IRect> for Rect {
1640 fn from(irect: IRect) -> Self {
1641 unimplemented!("This is mocked")
1642 }
1643}
1644
1645#[repr(i32)]
1646#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1647pub enum FilterMode {
1648 Nearest = 0,
1649 Linear = 1,
1650}
1651
1652impl FilterMode {
1653 pub const Last: FilterMode = FilterMode::Linear;
1654}
1655
1656#[repr(i32)]
1657#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1658pub enum MipmapMode {
1659 None = 0,
1660 Nearest = 1,
1661 Linear = 2,
1662}
1663
1664impl MipmapMode {
1665 pub const Last: MipmapMode = MipmapMode::Linear;
1666}
1667
1668pub struct PathBuilder;
1669
1670impl PathBuilder {
1671 pub fn new() -> Self {
1672 unimplemented!("This is mocked")
1673 }
1674
1675 pub fn detach(self) -> Path {
1676 unimplemented!("This is mocked")
1677 }
1678
1679 pub fn add_path(&mut self, _src: &Path) -> &mut Self {
1680 unimplemented!("This is mocked")
1681 }
1682
1683 pub fn move_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1684 unimplemented!("This is mocked")
1685 }
1686
1687 pub fn line_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1688 unimplemented!("This is mocked")
1689 }
1690
1691 pub fn cubic_to(
1692 &mut self,
1693 _p1: impl Into<Point>,
1694 _p2: impl Into<Point>,
1695 _p3: impl Into<Point>,
1696 ) -> &mut Self {
1697 unimplemented!("This is mocked")
1698 }
1699
1700 pub fn r_arc_to(
1701 &mut self,
1702 _r: impl Into<Point>,
1703 _x_axis_rotate: f32,
1704 _large_arc: ArcSize,
1705 _sweep: PathDirection,
1706 _d: impl Into<Point>,
1707 ) -> &mut Self {
1708 unimplemented!("This is mocked")
1709 }
1710
1711 pub fn close(&self) {
1712 unimplemented!("This is mocked")
1713 }
1714
1715 pub fn add_rrect(
1716 &mut self,
1717 _rrect: impl AsRef<RRect>,
1718 _dir_start: Option<(PathDirection, usize)>,
1719 _start_index: Option<usize>,
1720 ) -> &mut Self {
1721 unimplemented!("This is mocked")
1722 }
1723
1724 pub fn offset(&mut self, _d: impl Into<Point>) -> &mut Self {
1725 unimplemented!("This is mocked")
1726 }
1727
1728 pub fn set_fill_type(&mut self, _ft: PathFillType) -> &mut Self {
1729 unimplemented!("This is mocked")
1730 }
1731}
1732
1733pub struct Path;
1734
1735impl Path {
1736 pub fn new() -> Self {
1737 unimplemented!("This is mocked")
1738 }
1739
1740 pub fn bounds(&self) -> &Rect {
1741 unimplemented!("This is mocked")
1742 }
1743}
1744
1745#[repr(i32)]
1746#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1747pub enum PathAddPathMode {
1748 Append = 0,
1749 Extend = 1,
1750}
1751
1752#[derive(Copy, Clone)]
1753#[repr(transparent)]
1754pub struct RRect;
1755
1756impl AsRef<RRect> for RRect {
1757 fn as_ref(&self) -> &RRect {
1758 self
1759 }
1760}
1761
1762impl RRect {
1763 pub fn new_rect_radii(_rect: Rect, _radii: &[Point; 4]) -> Self {
1764 unimplemented!("This is mocked")
1765 }
1766
1767 pub fn rect(&self) -> &Rect {
1768 unimplemented!("This is mocked")
1769 }
1770
1771 pub fn bounds(&self) -> &Rect {
1772 unimplemented!("This is mocked")
1773 }
1774
1775 pub fn width(&self) -> f32 {
1776 unimplemented!("This is mocked")
1777 }
1778
1779 pub fn height(&self) -> f32 {
1780 unimplemented!("This is mocked")
1781 }
1782
1783 pub fn radii(&self, _corner: Corner) -> Point {
1784 unimplemented!("This is mocked")
1785 }
1786
1787 pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1788 unimplemented!("This is mocked")
1789 }
1790
1791 pub fn contains(&self, other: Rect) -> bool {
1792 unimplemented!("This is mocked")
1793 }
1794}
1795
1796#[repr(i32)]
1797#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1798pub enum ArcSize {
1799 Small = 0,
1800 Large = 1,
1801}
1802
1803#[repr(i32)]
1804#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1805pub enum Corner {
1806 UpperLeft = 0,
1807 UpperRight = 1,
1808 LowerRight = 2,
1809 LowerLeft = 3,
1810}
1811
1812#[repr(i32)]
1813#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1814pub enum PathFillType {
1815 Winding = 0,
1816 EvenOdd = 1,
1817 InverseWinding = 2,
1818 InverseEvenOdd = 3,
1819}
1820
1821#[repr(i32)]
1822#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1823pub enum PathDirection {
1824 CW = 0,
1825 CCW = 1,
1826}
1827
1828pub struct MaskFilter;
1829
1830impl MaskFilter {
1831 pub fn blur(
1832 _style: BlurStyle,
1833 _sigma: f32,
1834 _respect_ctm: impl Into<Option<bool>>,
1835 ) -> Option<Self> {
1836 unimplemented!("This is mocked")
1837 }
1838}
1839
1840#[repr(i32)]
1841#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1842pub enum BlendMode {
1843 Clear = 0,
1844 Src = 1,
1845 Dst = 2,
1846 SrcOver = 3,
1847 DstOver = 4,
1848 SrcIn = 5,
1849 DstIn = 6,
1850 SrcOut = 7,
1851 DstOut = 8,
1852 SrcATop = 9,
1853 DstATop = 10,
1854 Xor = 11,
1855 Plus = 12,
1856 Modulate = 13,
1857 Screen = 14,
1858 Overlay = 15,
1859 Darken = 16,
1860 Lighten = 17,
1861 ColorDodge = 18,
1862 ColorBurn = 19,
1863 HardLight = 20,
1864 SoftLight = 21,
1865 Difference = 22,
1866 Exclusion = 23,
1867 Multiply = 24,
1868 Hue = 25,
1869 Saturation = 26,
1870 Color = 27,
1871 Luminosity = 28,
1872}
1873
1874impl BlurStyle {
1875 pub const LastEnum: BlurStyle = BlurStyle::Inner;
1876}
1877#[repr(i32)]
1878#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1879pub enum BlurStyle {
1880 Normal = 0,
1881 Solid = 1,
1882 Outer = 2,
1883 Inner = 3,
1884}
1885
1886pub mod svg {
1887 use super::{
1888 Canvas,
1889 Color,
1890 LocalResourceProvider,
1891 Size,
1892 };
1893
1894 pub enum LengthUnit {
1895 Percentage,
1896 PX,
1897 }
1898
1899 pub struct Length {
1900 pub value: f32,
1901 }
1902
1903 impl Length {
1904 pub fn new(value: f32, unit: LengthUnit) -> Self {
1905 unimplemented!("This is mocked")
1906 }
1907 }
1908
1909 pub struct Paint;
1910
1911 impl Paint {
1912 pub fn none() -> Self {
1913 unimplemented!("This is mocked")
1914 }
1915
1916 pub fn current_color() -> Self {
1917 unimplemented!("This is mocked")
1918 }
1919
1920 pub fn from_color(_color: Color) -> Self {
1921 unimplemented!("This is mocked")
1922 }
1923 }
1924
1925 pub struct SvgNode;
1926
1927 impl SvgNode {
1928 pub fn width(&self) -> Length {
1929 unimplemented!("This is mocked")
1930 }
1931
1932 pub fn height(&self) -> Length {
1933 unimplemented!("This is mocked")
1934 }
1935
1936 pub fn set_width(&mut self, _width: Length) {
1937 unimplemented!("This is mocked")
1938 }
1939
1940 pub fn set_height(&mut self, _height: Length) {
1941 unimplemented!("This is mocked")
1942 }
1943
1944 pub fn set_color(&mut self, _value: Color) {
1945 unimplemented!("This is mocked")
1946 }
1947
1948 pub fn set_fill(&mut self, _value: Paint) {
1949 unimplemented!("This is mocked")
1950 }
1951
1952 pub fn set_stroke(&mut self, _value: Paint) {
1953 unimplemented!("This is mocked")
1954 }
1955 }
1956
1957 pub struct Dom;
1958
1959 impl Dom {
1960 pub fn from_bytes(_bytes: &[u8], provider: LocalResourceProvider) -> Result<Self, ()> {
1961 unimplemented!("This is mocked")
1962 }
1963
1964 pub fn set_container_size(&mut self, _size: impl Into<Size>) {
1965 unimplemented!("This is mocked")
1966 }
1967
1968 pub fn render(&self, _canvas: &Canvas) {
1969 unimplemented!("This is mocked")
1970 }
1971
1972 pub fn root(&self) -> SvgNode {
1973 unimplemented!("This is mocked")
1974 }
1975 }
1976}
1977
1978#[repr(C)]
1979#[derive(Copy, Clone, PartialEq, Default, Debug)]
1980pub struct Size;
1981
1982impl From<(f32, f32)> for Size {
1983 fn from(_source: (f32, f32)) -> Self {
1984 unimplemented!("This is mocked")
1985 }
1986}
1987
1988impl From<(i32, i32)> for Size {
1989 fn from(_source: (i32, i32)) -> Self {
1990 unimplemented!("This is mocked")
1991 }
1992}
1993
1994#[derive(Clone)]
1995pub struct Surface;
1996
1997impl Surface {
1998 pub fn canvas(&mut self) -> &Canvas {
1999 unimplemented!("This is mocked")
2000 }
2001
2002 pub fn image_snapshot(&mut self) -> Image {
2003 unimplemented!("This is mocked")
2004 }
2005
2006 pub fn direct_context(&self) -> Option<DirectContext> {
2007 unimplemented!("This is mocked")
2008 }
2009
2010 pub fn swap_buffers(&self, _: &PossiblyCurrentContext) {
2011 unimplemented!("This is mocked")
2012 }
2013
2014 pub fn from_backend_render_target(
2015 _context: &mut RecordingContext,
2016 _backend_render_target: &BackendRenderTarget,
2017 _origin: SurfaceOrigin,
2018 _color_type: ColorType,
2019 _color_space: impl Into<Option<ColorSpace>>,
2020 _surface_props: Option<&SurfaceProps>,
2021 ) -> Option<Self> {
2022 unimplemented!("This is mocked")
2023 }
2024
2025 pub fn draw(
2026 &self,
2027 canvas: &Canvas,
2028 offset: impl Into<Point>,
2029 sampling: impl Into<SamplingOptions>,
2030 paint: Option<&Paint>,
2031 ) {
2032 unimplemented!("This is mocked")
2033 }
2034
2035 pub fn new_surface_with_dimensions(&mut self, dim: impl Into<ISize>) -> Option<Self> {
2036 unimplemented!("This is mocked")
2037 }
2038}
2039
2040pub struct ISize;
2041
2042impl ISize {
2043 pub fn new(w: i32, h: i32) -> Self {
2044 unimplemented!("This is mocked")
2045 }
2046}
2047
2048impl From<(i32, i32)> for ISize {
2049 fn from(source: (i32, i32)) -> Self {
2050 unimplemented!("This is mocked")
2051 }
2052}
2053
2054pub struct ColorSpace;
2055
2056#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
2057#[repr(i32)]
2058pub enum ColorType {
2059 RGBA8888,
2060 BGRA8888,
2061}
2062
2063pub struct SurfaceProps;
2064
2065use std::ops::{
2066 Deref,
2067 DerefMut,
2068};
2069
2070pub struct RecordingContext;
2071
2072#[repr(i32)]
2073#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2074pub enum SurfaceOrigin {
2075 TopLeft = 0,
2076 BottomLeft = 1,
2077}
2078
2079pub mod gpu {
2080 #[repr(C)]
2081 #[derive(Debug, Default)]
2082 pub struct ContextOptions;
2083}
2084
2085pub mod direct_contexts {
2086 use super::{
2087 DirectContext,
2088 Interface,
2089 gpu,
2090 vk,
2091 };
2092 pub fn make_gl<'a>(
2093 _interface: impl Into<Option<Interface>>,
2094 _options: impl Into<Option<&'a gpu::ContextOptions>>,
2095 ) -> Option<DirectContext> {
2096 unimplemented!("This is mocked")
2097 }
2098
2099 pub fn make_vulkan<'a>(
2100 backend_context: &vk::BackendContext,
2101 options: impl Into<Option<&'a gpu::ContextOptions>>,
2102 ) -> Option<DirectContext> {
2103 unimplemented!("This is mocked")
2104 }
2105}
2106
2107pub struct DirectContext;
2108
2109impl From<DirectContext> for RecordingContext {
2110 fn from(_direct_context: DirectContext) -> Self {
2111 unimplemented!("This is mocked")
2112 }
2113}
2114
2115impl Deref for DirectContext {
2116 type Target = RecordingContext;
2117
2118 fn deref(&self) -> &Self::Target {
2119 unimplemented!("This is mocked")
2120 }
2121}
2122
2123impl DerefMut for DirectContext {
2124 fn deref_mut(&mut self) -> &mut Self::Target {
2125 unimplemented!("This is mocked")
2126 }
2127}
2128
2129impl DirectContext {
2130 pub fn flush_and_submit(&self) {
2131 unimplemented!("This is mocked")
2132 }
2133
2134 pub fn abandon(&self) {
2135 unimplemented!("This is mocked")
2136 }
2137
2138 pub fn release_resources_and_abandon(&self) {
2139 unimplemented!("This is mocked")
2140 }
2141
2142 pub fn set_resource_cache_limit(&mut self, max_resource_bytes: usize) {
2143 unimplemented!("This is mocked")
2144 }
2145
2146 pub fn flush_submit_and_sync_cpu(&self) {
2147 unimplemented!("This is mocked")
2148 }
2149}
2150
2151pub fn raster_from_data(
2152 info: &ImageInfo,
2153 pixels: impl Into<Data>,
2154 row_bytes: usize,
2155) -> Option<Image> {
2156 unimplemented!("This is mocked")
2157}
2158
2159pub struct ImageInfo {}
2160impl ImageInfo {
2161 pub fn new(
2162 _dimensions: impl Into<ISize>,
2163 _ct: ColorType,
2164 _at: AlphaType,
2165 _cs: impl Into<Option<ColorSpace>>,
2166 ) -> Self {
2167 unimplemented!("This is mocked")
2168 }
2169}
2170
2171pub enum AlphaType {
2172 Unknown = 0,
2173 Opaque = 1,
2174 Premul = 2,
2175 Unpremul = 3,
2176}
2177
2178use std::ffi::c_void;
2179
2180#[repr(u8)]
2181#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2182pub enum Protected {
2183 No,
2184 Yes,
2185}
2186
2187#[derive(Copy, Clone, PartialEq, Eq, Debug)]
2188#[repr(C)]
2189pub struct FramebufferInfo {
2190 pub fboid: i32,
2191 pub format: Format,
2192 pub protected: Protected,
2193}
2194
2195impl Default for FramebufferInfo {
2196 fn default() -> Self {
2197 unimplemented!("This is mocked")
2198 }
2199}
2200
2201pub fn wrap_backend_render_target(
2202 context: &mut RecordingContext,
2203 backend_render_target: &BackendRenderTarget,
2204 origin: SurfaceOrigin,
2205 color_type: ColorType,
2206 color_space: impl Into<Option<ColorSpace>>,
2207 surface_props: Option<&SurfaceProps>,
2208) -> Option<Surface> {
2209 unimplemented!("This is mocked")
2210}
2211
2212pub struct Interface;
2213
2214impl Interface {
2215 pub fn new_load_with<F>(_load_fn: F) -> Option<Self>
2216 where
2217 F: FnMut(&str) -> *const c_void,
2218 {
2219 unimplemented!("This is mocked")
2220 }
2221}
2222
2223#[repr(i32)]
2224#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2225pub enum Format {
2226 Unknown = 0,
2227 RGBA8 = 1,
2228 R8 = 2,
2229 ALPHA8 = 3,
2230 LUMINANCE8 = 4,
2231 LUMINANCE8_ALPHA8 = 5,
2232 BGRA8 = 6,
2233 RGB565 = 7,
2234 RGBA16F = 8,
2235 R16F = 9,
2236 RGB8 = 10,
2237 RGBX8 = 11,
2238 RG8 = 12,
2239 RGB10_A2 = 13,
2240 RGBA4 = 14,
2241 SRGB8_ALPHA8 = 15,
2242 COMPRESSED_ETC1_RGB8 = 16,
2243 COMPRESSED_RGB8_ETC2 = 17,
2244 COMPRESSED_RGB8_BC1 = 18,
2245 COMPRESSED_RGBA8_BC1 = 19,
2246 R16 = 20,
2247 RG16 = 21,
2248 RGBA16 = 22,
2249 RG16F = 23,
2250 LUMINANCE16F = 24,
2251 STENCIL_INDEX8 = 25,
2252 STENCIL_INDEX16 = 26,
2253 DEPTH24_STENCIL8 = 27,
2254}
2255
2256pub struct BackendRenderTarget;
2257
2258impl BackendRenderTarget {
2259 pub fn new_gl(
2260 (_width, _height): (i32, i32),
2261 _sample_count: impl Into<Option<usize>>,
2262 _stencil_bits: usize,
2263 _info: FramebufferInfo,
2264 ) -> Self {
2265 unimplemented!("This is mocked")
2266 }
2267}
2268
2269pub mod backend_render_targets {
2270 use crate::prelude::*;
2271 pub fn make_gl(
2272 (width, height): (i32, i32),
2273 sample_count: impl Into<Option<usize>>,
2274 stencil_bits: usize,
2275 info: FramebufferInfo,
2276 ) -> BackendRenderTarget {
2277 unimplemented!("This is mocked")
2278 }
2279 pub fn make_vk((width, height): (i32, i32), info: &vk::ImageInfo) -> BackendRenderTarget {
2280 unimplemented!("This is mocked")
2281 }
2282}
2283
2284pub fn set_resource_cache_total_bytes_limit(new_limit: usize) -> usize {
2285 unimplemented!("This is mocked")
2286}
2287
2288pub fn set_resource_cache_single_allocation_byte_limit(new_limit: Option<usize>) -> Option<usize> {
2289 unimplemented!("This is mocked")
2290}
2291
2292pub enum EncodedImageFormat {
2293 BMP = 0,
2294 GIF = 1,
2295 ICO = 2,
2296 JPEG = 3,
2297 PNG = 4,
2298 WBMP = 5,
2299 WEBP = 6,
2300 PKM = 7,
2301 KTX = 8,
2302 ASTC = 9,
2303 DNG = 10,
2304 HEIF = 11,
2305 AVIF = 12,
2306 JPEGXL = 13,
2307}
2308
2309pub struct LocalResourceProvider;
2310
2311impl LocalResourceProvider {
2312 pub fn new(font_mgr: &FontMgr) -> Self {
2313 unimplemented!("This is mocked")
2314 }
2315}
2316
2317pub fn raster_n32_premul(size: impl Into<ISize>) -> Option<Surface> {
2318 unimplemented!("This is mocked")
2319}
2320pub mod vk {
2321
2322 #[derive(Default)]
2323 pub struct Alloc {}
2324
2325 pub struct ImageInfo {
2326 image: Image,
2327 alloc: Alloc,
2328 pub tiling: ImageTiling,
2329 pub layout: ImageLayout,
2330 pub format: Format,
2331 pub image_usage_flags: ImageUsageFlags,
2332 pub sample_count: u32,
2333 pub level_count: u32,
2334 pub current_queue_family: u32,
2335 pub protected: Protected,
2336 pub ycbcr_conversion_info: YcbcrConversionInfo,
2337 pub sharing_mode: SharingMode,
2338 }
2339
2340 pub struct ImageUsageFlags;
2341 pub struct YcbcrConversionInfo;
2342 pub struct Protected;
2343
2344 impl ImageInfo {
2345 #[allow(clippy::too_many_arguments)]
2346 pub unsafe fn new(
2347 image: Image,
2348 alloc: Alloc,
2349 tiling: ImageTiling,
2350 layout: ImageLayout,
2351 format: Format,
2352 level_count: u32,
2353 current_queue_family: impl Into<Option<u32>>,
2354 ycbcr_conversion_info: impl Into<Option<YcbcrConversionInfo>>,
2355 protected: impl Into<Option<Protected>>,
2356 sharing_mode: impl Into<Option<SharingMode>>,
2357 ) -> Self {
2358 unimplemented!("This is mocked")
2359 }
2360 }
2361
2362 pub type Image = u8;
2363
2364 pub enum ImageTiling {
2365 OPTIMAL,
2366 }
2367 pub enum ImageLayout {
2368 UNDEFINED,
2369 }
2370 pub enum Format {
2371 B8G8R8A8_UNORM,
2372 }
2373 pub enum SharingMode {
2374 EXCLUSIVE,
2375 }
2376
2377 #[derive(Copy, Clone, Debug)]
2378 pub struct BackendContext {}
2379 impl BackendContext {
2380 pub unsafe fn new(
2381 instance: Instance,
2382 physical_device: PhysicalDevice,
2383 device: Device,
2384 (queue, queue_index): (Queue, usize),
2385 get_proc: &impl GetProc,
2386 ) -> BackendContext {
2387 unimplemented!("This is mocked")
2388 }
2389
2390 pub fn set_max_api_version(&mut self, version: impl Into<Version>) -> &mut Self {
2391 unimplemented!("This is mocked")
2392 }
2393 }
2394
2395 pub trait GetProc: Fn(GetProcOf) -> u8 {}
2396
2397 impl<T> GetProc for T where T: Fn(GetProcOf) -> u8 {}
2398 #[derive(Copy, Clone, Debug)]
2399 pub enum GetProcOf {
2400 Instance(Instance, *const std::os::raw::c_char),
2401 Device(Device, *const std::os::raw::c_char),
2402 }
2403 pub type Instance = u8;
2404 pub type PhysicalDevice = u8;
2405 pub type Queue = u8;
2406 pub type Device = u8;
2407
2408 #[repr(transparent)]
2409 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
2410 pub struct Version(u32);
2411 impl Version {
2412 pub fn new(major: usize, minor: usize, patch: usize) -> Self {
2413 unimplemented!("This is mocked")
2414 }
2415 }
2416}