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