Skip to main content

freya_engine/
mocked.rs

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