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)]
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 Rect {
1383    pub fn new(_left: f32, _top: f32, _right: f32, _bottom: f32) -> Self {
1384        unimplemented!("This is mocked")
1385    }
1386
1387    pub fn x(&self) -> f32 {
1388        unimplemented!("This is mocked")
1389    }
1390
1391    pub fn y(&self) -> f32 {
1392        unimplemented!("This is mocked")
1393    }
1394
1395    pub fn width(&self) -> f32 {
1396        unimplemented!("This is mocked")
1397    }
1398
1399    pub fn height(&self) -> f32 {
1400        unimplemented!("This is mocked")
1401    }
1402
1403    pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1404        unimplemented!("This is mocked")
1405    }
1406
1407    pub fn round_in(&self) -> IRect {
1408        unimplemented!("This is mocked")
1409    }
1410
1411    pub fn from_xywh(x: f32, y: f32, w: f32, h: f32) -> IRect {
1412        unimplemented!("This is mocked")
1413    }
1414}
1415
1416#[derive(Clone, Debug)]
1417pub struct Image;
1418
1419impl AsRef<Image> for Image {
1420    fn as_ref(&self) -> &Image {
1421        self
1422    }
1423}
1424
1425impl Image {
1426    pub fn from_encoded(_data: Data) -> Option<Self> {
1427        unimplemented!("This is mocked")
1428    }
1429
1430    pub fn width(&self) -> i32 {
1431        unimplemented!("This is mocked")
1432    }
1433
1434    pub fn height(&self) -> i32 {
1435        unimplemented!("This is mocked")
1436    }
1437
1438    pub fn encode<'a>(
1439        &self,
1440        context: impl Into<Option<&'a mut DirectContext>>,
1441        format: EncodedImageFormat,
1442        quality: impl Into<Option<u32>>,
1443    ) -> Option<Data> {
1444        unimplemented!("This is mocked")
1445    }
1446}
1447
1448pub struct Data;
1449
1450impl Data {
1451    pub fn new_copy(_bytes: &[u8]) -> Self {
1452        unimplemented!("This is mocked")
1453    }
1454
1455    pub unsafe fn new_bytes(_bytes: &[u8]) -> Self {
1456        unimplemented!("This is mocked")
1457    }
1458}
1459
1460impl Deref for Data {
1461    type Target = [u8];
1462    fn deref(&self) -> &Self::Target {
1463        unimplemented!("This is mocked")
1464    }
1465}
1466
1467#[repr(C)]
1468#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
1469pub struct IRect {
1470    /// The x coordinate of the rectangle's left edge.
1471    pub left: i32,
1472    /// The y coordinate of the rectangle's top edge.
1473    pub top: i32,
1474    /// The x coordinate of the rectangle's right edge.
1475    pub right: i32,
1476    /// The y coordinate of the rectangle's bottom edge.
1477    pub bottom: i32,
1478}
1479
1480impl IRect {
1481    pub fn new(_left: i32, _top: i32, _right: i32, _bottom: i32) -> Self {
1482        unimplemented!("This is mocked")
1483    }
1484}
1485
1486impl From<IRect> for Rect {
1487    fn from(irect: IRect) -> Self {
1488        unimplemented!("This is mocked")
1489    }
1490}
1491
1492#[repr(i32)]
1493#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1494pub enum FilterMode {
1495    Nearest = 0,
1496    Linear = 1,
1497}
1498
1499impl FilterMode {
1500    pub const Last: FilterMode = FilterMode::Linear;
1501}
1502
1503#[repr(i32)]
1504#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1505pub enum MipmapMode {
1506    None = 0,
1507    Nearest = 1,
1508    Linear = 2,
1509}
1510
1511impl MipmapMode {
1512    pub const Last: MipmapMode = MipmapMode::Linear;
1513}
1514
1515pub struct Path;
1516
1517impl Path {
1518    pub fn new() -> Self {
1519        unimplemented!("This is mocked")
1520    }
1521
1522    pub fn bounds(&self) -> &Rect {
1523        unimplemented!("This is mocked")
1524    }
1525
1526    pub fn add_path(
1527        &mut self,
1528        _src: &Path,
1529        _d: impl Into<Point>,
1530        _mode: Option<&PathAddPathMode>,
1531    ) -> &mut Self {
1532        unimplemented!("This is mocked")
1533    }
1534
1535    pub fn move_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1536        unimplemented!("This is mocked")
1537    }
1538
1539    pub fn line_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1540        unimplemented!("This is mocked")
1541    }
1542
1543    pub fn cubic_to(
1544        &mut self,
1545        _p1: impl Into<Point>,
1546        _p2: impl Into<Point>,
1547        _p3: impl Into<Point>,
1548    ) -> &mut Self {
1549        unimplemented!("This is mocked")
1550    }
1551
1552    pub fn r_arc_to_rotated(
1553        &mut self,
1554        _r: impl Into<Point>,
1555        _x_axis_rotate: f32,
1556        _large_arc: ArcSize,
1557        _sweep: PathDirection,
1558        _d: impl Into<Point>,
1559    ) -> &mut Self {
1560        unimplemented!("This is mocked")
1561    }
1562
1563    pub fn close(&self) {
1564        unimplemented!("This is mocked")
1565    }
1566
1567    pub fn add_rrect(
1568        &mut self,
1569        _rrect: impl AsRef<RRect>,
1570        _dir_start: Option<(PathDirection, usize)>,
1571    ) -> &mut Self {
1572        unimplemented!("This is mocked")
1573    }
1574
1575    pub fn offset(&mut self, _d: impl Into<Point>) -> &mut Self {
1576        unimplemented!("This is mocked")
1577    }
1578
1579    pub fn set_fill_type(&mut self, _ft: PathFillType) -> &mut Self {
1580        unimplemented!("This is mocked")
1581    }
1582}
1583
1584#[repr(i32)]
1585#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1586pub enum PathAddPathMode {
1587    Append = 0,
1588    Extend = 1,
1589}
1590
1591#[derive(Copy, Clone)]
1592#[repr(transparent)]
1593pub struct RRect;
1594
1595impl AsRef<RRect> for RRect {
1596    fn as_ref(&self) -> &RRect {
1597        self
1598    }
1599}
1600
1601impl RRect {
1602    pub fn new_rect_radii(_rect: Rect, _radii: &[Point; 4]) -> Self {
1603        unimplemented!("This is mocked")
1604    }
1605
1606    pub fn rect(&self) -> &Rect {
1607        unimplemented!("This is mocked")
1608    }
1609
1610    pub fn bounds(&self) -> &Rect {
1611        unimplemented!("This is mocked")
1612    }
1613
1614    pub fn width(&self) -> f32 {
1615        unimplemented!("This is mocked")
1616    }
1617
1618    pub fn height(&self) -> f32 {
1619        unimplemented!("This is mocked")
1620    }
1621
1622    pub fn radii(&self, _corner: Corner) -> Point {
1623        unimplemented!("This is mocked")
1624    }
1625
1626    pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1627        unimplemented!("This is mocked")
1628    }
1629
1630    pub fn contains(&self, other: Rect) -> bool {
1631        unimplemented!("This is mocked")
1632    }
1633}
1634
1635#[repr(i32)]
1636#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1637pub enum ArcSize {
1638    Small = 0,
1639    Large = 1,
1640}
1641
1642#[repr(i32)]
1643#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1644pub enum Corner {
1645    UpperLeft = 0,
1646    UpperRight = 1,
1647    LowerRight = 2,
1648    LowerLeft = 3,
1649}
1650
1651#[repr(i32)]
1652#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1653pub enum PathFillType {
1654    Winding = 0,
1655    EvenOdd = 1,
1656    InverseWinding = 2,
1657    InverseEvenOdd = 3,
1658}
1659
1660#[repr(i32)]
1661#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1662pub enum PathDirection {
1663    CW = 0,
1664    CCW = 1,
1665}
1666
1667pub struct MaskFilter;
1668
1669impl MaskFilter {
1670    pub fn blur(
1671        _style: BlurStyle,
1672        _sigma: f32,
1673        _respect_ctm: impl Into<Option<bool>>,
1674    ) -> Option<Self> {
1675        unimplemented!("This is mocked")
1676    }
1677}
1678
1679#[repr(i32)]
1680#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1681pub enum BlendMode {
1682    Clear = 0,
1683    Src = 1,
1684    Dst = 2,
1685    SrcOver = 3,
1686    DstOver = 4,
1687    SrcIn = 5,
1688    DstIn = 6,
1689    SrcOut = 7,
1690    DstOut = 8,
1691    SrcATop = 9,
1692    DstATop = 10,
1693    Xor = 11,
1694    Plus = 12,
1695    Modulate = 13,
1696    Screen = 14,
1697    Overlay = 15,
1698    Darken = 16,
1699    Lighten = 17,
1700    ColorDodge = 18,
1701    ColorBurn = 19,
1702    HardLight = 20,
1703    SoftLight = 21,
1704    Difference = 22,
1705    Exclusion = 23,
1706    Multiply = 24,
1707    Hue = 25,
1708    Saturation = 26,
1709    Color = 27,
1710    Luminosity = 28,
1711}
1712
1713impl BlurStyle {
1714    pub const LastEnum: BlurStyle = BlurStyle::Inner;
1715}
1716#[repr(i32)]
1717#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1718pub enum BlurStyle {
1719    Normal = 0,
1720    Solid = 1,
1721    Outer = 2,
1722    Inner = 3,
1723}
1724
1725pub mod svg {
1726    use super::{
1727        Canvas,
1728        Color,
1729        LocalResourceProvider,
1730        Size,
1731    };
1732
1733    pub enum LengthUnit {
1734        Percentage,
1735        PX,
1736    }
1737
1738    pub struct Length {
1739        pub value: f32,
1740    }
1741
1742    impl Length {
1743        pub fn new(value: f32, unit: LengthUnit) -> Self {
1744            unimplemented!("This is mocked")
1745        }
1746    }
1747
1748    pub struct Paint;
1749
1750    impl Paint {
1751        pub fn none() -> Self {
1752            unimplemented!("This is mocked")
1753        }
1754
1755        pub fn current_color() -> Self {
1756            unimplemented!("This is mocked")
1757        }
1758
1759        pub fn from_color(_color: Color) -> Self {
1760            unimplemented!("This is mocked")
1761        }
1762    }
1763
1764    pub struct SvgNode;
1765
1766    impl SvgNode {
1767        pub fn width(&self) -> Length {
1768            unimplemented!("This is mocked")
1769        }
1770
1771        pub fn height(&self) -> Length {
1772            unimplemented!("This is mocked")
1773        }
1774
1775        pub fn set_width(&mut self, _width: Length) {
1776            unimplemented!("This is mocked")
1777        }
1778
1779        pub fn set_height(&mut self, _height: Length) {
1780            unimplemented!("This is mocked")
1781        }
1782
1783        pub fn set_color(&mut self, _value: Color) {
1784            unimplemented!("This is mocked")
1785        }
1786
1787        pub fn set_fill(&mut self, _value: Paint) {
1788            unimplemented!("This is mocked")
1789        }
1790
1791        pub fn set_stroke(&mut self, _value: Paint) {
1792            unimplemented!("This is mocked")
1793        }
1794    }
1795
1796    pub struct Dom;
1797
1798    impl Dom {
1799        pub fn from_bytes(_bytes: &[u8], provider: LocalResourceProvider) -> Result<Self, ()> {
1800            unimplemented!("This is mocked")
1801        }
1802
1803        pub fn set_container_size(&mut self, _size: impl Into<Size>) {
1804            unimplemented!("This is mocked")
1805        }
1806
1807        pub fn render(&self, _canvas: &Canvas) {
1808            unimplemented!("This is mocked")
1809        }
1810
1811        pub fn root(&self) -> SvgNode {
1812            unimplemented!("This is mocked")
1813        }
1814    }
1815}
1816
1817#[repr(C)]
1818#[derive(Copy, Clone, PartialEq, Default, Debug)]
1819pub struct Size;
1820
1821impl From<(f32, f32)> for Size {
1822    fn from(_source: (f32, f32)) -> Self {
1823        unimplemented!("This is mocked")
1824    }
1825}
1826
1827impl From<(i32, i32)> for Size {
1828    fn from(_source: (i32, i32)) -> Self {
1829        unimplemented!("This is mocked")
1830    }
1831}
1832
1833#[derive(Clone)]
1834pub struct Surface;
1835
1836impl Surface {
1837    pub fn canvas(&mut self) -> &Canvas {
1838        unimplemented!("This is mocked")
1839    }
1840
1841    pub fn image_snapshot(&mut self) -> Image {
1842        unimplemented!("This is mocked")
1843    }
1844
1845    pub fn direct_context(&self) -> Option<DirectContext> {
1846        unimplemented!("This is mocked")
1847    }
1848
1849    pub fn swap_buffers(&self, _: &PossiblyCurrentContext) {
1850        unimplemented!("This is mocked")
1851    }
1852
1853    pub fn from_backend_render_target(
1854        _context: &mut RecordingContext,
1855        _backend_render_target: &BackendRenderTarget,
1856        _origin: SurfaceOrigin,
1857        _color_type: ColorType,
1858        _color_space: impl Into<Option<ColorSpace>>,
1859        _surface_props: Option<&SurfaceProps>,
1860    ) -> Option<Self> {
1861        unimplemented!("This is mocked")
1862    }
1863
1864    pub fn draw(
1865        &self,
1866        canvas: &Canvas,
1867        offset: impl Into<Point>,
1868        sampling: impl Into<SamplingOptions>,
1869        paint: Option<&Paint>,
1870    ) {
1871        unimplemented!("This is mocked")
1872    }
1873
1874    pub fn new_surface_with_dimensions(&mut self, dim: impl Into<ISize>) -> Option<Self> {
1875        unimplemented!("This is mocked")
1876    }
1877}
1878
1879pub struct ISize;
1880
1881impl ISize {
1882    pub fn new(w: i32, h: i32) -> Self {
1883        unimplemented!("This is mocked")
1884    }
1885}
1886
1887impl From<(i32, i32)> for ISize {
1888    fn from(source: (i32, i32)) -> Self {
1889        unimplemented!("This is mocked")
1890    }
1891}
1892
1893pub struct ColorSpace;
1894
1895#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
1896#[repr(i32)]
1897pub enum ColorType {
1898    RGBA8888,
1899    BGRA8888,
1900}
1901
1902pub struct SurfaceProps;
1903
1904use std::ops::{
1905    Deref,
1906    DerefMut,
1907};
1908
1909pub struct RecordingContext;
1910
1911#[repr(i32)]
1912#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1913pub enum SurfaceOrigin {
1914    TopLeft = 0,
1915    BottomLeft = 1,
1916}
1917
1918pub mod gpu {
1919    #[repr(C)]
1920    #[derive(Debug, Default)]
1921    pub struct ContextOptions;
1922}
1923
1924pub mod direct_contexts {
1925    use super::{
1926        DirectContext,
1927        Interface,
1928        gpu,
1929        vk,
1930    };
1931    pub fn make_gl<'a>(
1932        _interface: impl Into<Option<Interface>>,
1933        _options: impl Into<Option<&'a gpu::ContextOptions>>,
1934    ) -> Option<DirectContext> {
1935        unimplemented!("This is mocked")
1936    }
1937
1938    pub fn make_vulkan<'a>(
1939        backend_context: &vk::BackendContext,
1940        options: impl Into<Option<&'a gpu::ContextOptions>>,
1941    ) -> Option<DirectContext> {
1942        unimplemented!("This is mocked")
1943    }
1944}
1945
1946pub struct DirectContext;
1947
1948impl From<DirectContext> for RecordingContext {
1949    fn from(_direct_context: DirectContext) -> Self {
1950        unimplemented!("This is mocked")
1951    }
1952}
1953
1954impl Deref for DirectContext {
1955    type Target = RecordingContext;
1956
1957    fn deref(&self) -> &Self::Target {
1958        unimplemented!("This is mocked")
1959    }
1960}
1961
1962impl DerefMut for DirectContext {
1963    fn deref_mut(&mut self) -> &mut Self::Target {
1964        unimplemented!("This is mocked")
1965    }
1966}
1967
1968impl DirectContext {
1969    pub fn flush_and_submit(&self) {
1970        unimplemented!("This is mocked")
1971    }
1972
1973    pub fn abandon(&self) {
1974        unimplemented!("This is mocked")
1975    }
1976
1977    pub fn set_resource_cache_limit(&mut self, max_resource_bytes: usize) {
1978        unimplemented!("This is mocked")
1979    }
1980
1981    pub fn flush_submit_and_sync_cpu(&self) {
1982        unimplemented!("This is mocked")
1983    }
1984}
1985
1986pub fn raster_from_data(
1987    info: &ImageInfo,
1988    pixels: impl Into<Data>,
1989    row_bytes: usize,
1990) -> Option<Image> {
1991    unimplemented!("This is mocked")
1992}
1993
1994pub struct ImageInfo {}
1995impl ImageInfo {
1996    pub fn new(
1997        _dimensions: impl Into<ISize>,
1998        _ct: ColorType,
1999        _at: AlphaType,
2000        _cs: impl Into<Option<ColorSpace>>,
2001    ) -> Self {
2002        unimplemented!("This is mocked")
2003    }
2004}
2005
2006pub enum AlphaType {
2007    Unknown = 0,
2008    Opaque = 1,
2009    Premul = 2,
2010    Unpremul = 3,
2011}
2012
2013use std::ffi::c_void;
2014
2015#[repr(u8)]
2016#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2017pub enum Protected {
2018    No,
2019    Yes,
2020}
2021
2022#[derive(Copy, Clone, PartialEq, Eq, Debug)]
2023#[repr(C)]
2024pub struct FramebufferInfo {
2025    pub fboid: i32,
2026    pub format: Format,
2027    pub protected: Protected,
2028}
2029
2030impl Default for FramebufferInfo {
2031    fn default() -> Self {
2032        unimplemented!("This is mocked")
2033    }
2034}
2035
2036pub fn wrap_backend_render_target(
2037    context: &mut RecordingContext,
2038    backend_render_target: &BackendRenderTarget,
2039    origin: SurfaceOrigin,
2040    color_type: ColorType,
2041    color_space: impl Into<Option<ColorSpace>>,
2042    surface_props: Option<&SurfaceProps>,
2043) -> Option<Surface> {
2044    unimplemented!("This is mocked")
2045}
2046
2047pub struct Interface;
2048
2049impl Interface {
2050    pub fn new_load_with<F>(_load_fn: F) -> Option<Self>
2051    where
2052        F: FnMut(&str) -> *const c_void,
2053    {
2054        unimplemented!("This is mocked")
2055    }
2056}
2057
2058#[repr(i32)]
2059#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2060pub enum Format {
2061    Unknown = 0,
2062    RGBA8 = 1,
2063    R8 = 2,
2064    ALPHA8 = 3,
2065    LUMINANCE8 = 4,
2066    LUMINANCE8_ALPHA8 = 5,
2067    BGRA8 = 6,
2068    RGB565 = 7,
2069    RGBA16F = 8,
2070    R16F = 9,
2071    RGB8 = 10,
2072    RGBX8 = 11,
2073    RG8 = 12,
2074    RGB10_A2 = 13,
2075    RGBA4 = 14,
2076    SRGB8_ALPHA8 = 15,
2077    COMPRESSED_ETC1_RGB8 = 16,
2078    COMPRESSED_RGB8_ETC2 = 17,
2079    COMPRESSED_RGB8_BC1 = 18,
2080    COMPRESSED_RGBA8_BC1 = 19,
2081    R16 = 20,
2082    RG16 = 21,
2083    RGBA16 = 22,
2084    RG16F = 23,
2085    LUMINANCE16F = 24,
2086    STENCIL_INDEX8 = 25,
2087    STENCIL_INDEX16 = 26,
2088    DEPTH24_STENCIL8 = 27,
2089}
2090
2091pub struct BackendRenderTarget;
2092
2093impl BackendRenderTarget {
2094    pub fn new_gl(
2095        (_width, _height): (i32, i32),
2096        _sample_count: impl Into<Option<usize>>,
2097        _stencil_bits: usize,
2098        _info: FramebufferInfo,
2099    ) -> Self {
2100        unimplemented!("This is mocked")
2101    }
2102}
2103
2104pub mod backend_render_targets {
2105    use crate::prelude::*;
2106    pub fn make_gl(
2107        (width, height): (i32, i32),
2108        sample_count: impl Into<Option<usize>>,
2109        stencil_bits: usize,
2110        info: FramebufferInfo,
2111    ) -> BackendRenderTarget {
2112        unimplemented!("This is mocked")
2113    }
2114    pub fn make_vk((width, height): (i32, i32), info: &vk::ImageInfo) -> BackendRenderTarget {
2115        unimplemented!("This is mocked")
2116    }
2117}
2118
2119pub fn set_resource_cache_total_bytes_limit(new_limit: usize) -> usize {
2120    unimplemented!("This is mocked")
2121}
2122
2123pub fn set_resource_cache_single_allocation_byte_limit(new_limit: Option<usize>) -> Option<usize> {
2124    unimplemented!("This is mocked")
2125}
2126
2127pub enum EncodedImageFormat {
2128    BMP = 0,
2129    GIF = 1,
2130    ICO = 2,
2131    JPEG = 3,
2132    PNG = 4,
2133    WBMP = 5,
2134    WEBP = 6,
2135    PKM = 7,
2136    KTX = 8,
2137    ASTC = 9,
2138    DNG = 10,
2139    HEIF = 11,
2140    AVIF = 12,
2141    JPEGXL = 13,
2142}
2143
2144pub struct LocalResourceProvider;
2145
2146impl LocalResourceProvider {
2147    pub fn new(font_mgr: &FontMgr) -> Self {
2148        unimplemented!("This is mocked")
2149    }
2150}
2151
2152pub fn raster_n32_premul(size: impl Into<ISize>) -> Option<Surface> {
2153    unimplemented!("This is mocked")
2154}
2155pub mod vk {
2156
2157    #[derive(Default)]
2158    pub struct Alloc {}
2159
2160    pub struct ImageInfo {
2161        image: Image,
2162        alloc: Alloc,
2163        pub tiling: ImageTiling,
2164        pub layout: ImageLayout,
2165        pub format: Format,
2166        pub image_usage_flags: ImageUsageFlags,
2167        pub sample_count: u32,
2168        pub level_count: u32,
2169        pub current_queue_family: u32,
2170        pub protected: Protected,
2171        pub ycbcr_conversion_info: YcbcrConversionInfo,
2172        pub sharing_mode: SharingMode,
2173    }
2174
2175    pub struct ImageUsageFlags;
2176    pub struct YcbcrConversionInfo;
2177    pub struct Protected;
2178
2179    impl ImageInfo {
2180        #[allow(clippy::too_many_arguments)]
2181        pub unsafe fn new(
2182            image: Image,
2183            alloc: Alloc,
2184            tiling: ImageTiling,
2185            layout: ImageLayout,
2186            format: Format,
2187            level_count: u32,
2188            current_queue_family: impl Into<Option<u32>>,
2189            ycbcr_conversion_info: impl Into<Option<YcbcrConversionInfo>>,
2190            protected: impl Into<Option<Protected>>,
2191            sharing_mode: impl Into<Option<SharingMode>>,
2192        ) -> Self {
2193            unimplemented!("This is mocked")
2194        }
2195    }
2196
2197    pub type Image = u8;
2198
2199    pub enum ImageTiling {
2200        OPTIMAL,
2201    }
2202    pub enum ImageLayout {
2203        UNDEFINED,
2204    }
2205    pub enum Format {
2206        B8G8R8A8_UNORM,
2207    }
2208    pub enum SharingMode {
2209        EXCLUSIVE,
2210    }
2211
2212    #[derive(Copy, Clone, Debug)]
2213    pub struct BackendContext {}
2214    impl BackendContext {
2215        pub unsafe fn new(
2216            instance: Instance,
2217            physical_device: PhysicalDevice,
2218            device: Device,
2219            (queue, queue_index): (Queue, usize),
2220            get_proc: &impl GetProc,
2221        ) -> BackendContext {
2222            unimplemented!("This is mocked")
2223        }
2224
2225        pub fn set_max_api_version(&mut self, version: impl Into<Version>) -> &mut Self {
2226            unimplemented!("This is mocked")
2227        }
2228    }
2229
2230    pub trait GetProc: Fn(GetProcOf) -> u8 {}
2231
2232    impl<T> GetProc for T where T: Fn(GetProcOf) -> u8 {}
2233    #[derive(Copy, Clone, Debug)]
2234    pub enum GetProcOf {
2235        Instance(Instance, *const std::os::raw::c_char),
2236        Device(Device, *const std::os::raw::c_char),
2237    }
2238    pub type Instance = u8;
2239    pub type PhysicalDevice = u8;
2240    pub type Queue = u8;
2241    pub type Device = u8;
2242
2243    #[repr(transparent)]
2244    #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
2245    pub struct Version(u32);
2246    impl Version {
2247        pub fn new(major: usize, minor: usize, patch: usize) -> Self {
2248            unimplemented!("This is mocked")
2249        }
2250    }
2251}