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
1725pub struct Data;
1726
1727impl Data {
1728    pub fn new_copy(_bytes: &[u8]) -> Self {
1729        unimplemented!("This is mocked")
1730    }
1731
1732    pub unsafe fn new_bytes(_bytes: &[u8]) -> Self {
1733        unimplemented!("This is mocked")
1734    }
1735}
1736
1737impl Deref for Data {
1738    type Target = [u8];
1739    fn deref(&self) -> &Self::Target {
1740        unimplemented!("This is mocked")
1741    }
1742}
1743
1744#[repr(C)]
1745#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
1746pub struct IRect {
1747    /// The x coordinate of the rectangle's left edge.
1748    pub left: i32,
1749    /// The y coordinate of the rectangle's top edge.
1750    pub top: i32,
1751    /// The x coordinate of the rectangle's right edge.
1752    pub right: i32,
1753    /// The y coordinate of the rectangle's bottom edge.
1754    pub bottom: i32,
1755}
1756
1757impl IRect {
1758    pub fn new(_left: i32, _top: i32, _right: i32, _bottom: i32) -> Self {
1759        unimplemented!("This is mocked")
1760    }
1761}
1762
1763impl From<IRect> for Rect {
1764    fn from(irect: IRect) -> Self {
1765        unimplemented!("This is mocked")
1766    }
1767}
1768
1769#[repr(i32)]
1770#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1771pub enum FilterMode {
1772    Nearest = 0,
1773    Linear = 1,
1774}
1775
1776impl FilterMode {
1777    pub const Last: FilterMode = FilterMode::Linear;
1778}
1779
1780#[repr(i32)]
1781#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1782pub enum MipmapMode {
1783    None = 0,
1784    Nearest = 1,
1785    Linear = 2,
1786}
1787
1788impl MipmapMode {
1789    pub const Last: MipmapMode = MipmapMode::Linear;
1790}
1791
1792pub struct PathBuilder;
1793
1794impl PathBuilder {
1795    pub fn new() -> Self {
1796        unimplemented!("This is mocked")
1797    }
1798
1799    pub fn detach(self) -> Path {
1800        unimplemented!("This is mocked")
1801    }
1802
1803    pub fn add_path(&mut self, _src: &Path) -> &mut Self {
1804        unimplemented!("This is mocked")
1805    }
1806
1807    pub fn move_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1808        unimplemented!("This is mocked")
1809    }
1810
1811    pub fn line_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1812        unimplemented!("This is mocked")
1813    }
1814
1815    pub fn cubic_to(
1816        &mut self,
1817        _p1: impl Into<Point>,
1818        _p2: impl Into<Point>,
1819        _p3: impl Into<Point>,
1820    ) -> &mut Self {
1821        unimplemented!("This is mocked")
1822    }
1823
1824    pub fn r_arc_to(
1825        &mut self,
1826        _r: impl Into<Point>,
1827        _x_axis_rotate: f32,
1828        _large_arc: ArcSize,
1829        _sweep: PathDirection,
1830        _d: impl Into<Point>,
1831    ) -> &mut Self {
1832        unimplemented!("This is mocked")
1833    }
1834
1835    pub fn close(&self) {
1836        unimplemented!("This is mocked")
1837    }
1838
1839    pub fn add_rrect(
1840        &mut self,
1841        _rrect: impl AsRef<RRect>,
1842        _dir_start: Option<(PathDirection, usize)>,
1843        _start_index: Option<usize>,
1844    ) -> &mut Self {
1845        unimplemented!("This is mocked")
1846    }
1847
1848    pub fn offset(&mut self, _d: impl Into<Point>) -> &mut Self {
1849        unimplemented!("This is mocked")
1850    }
1851
1852    pub fn set_fill_type(&mut self, _ft: PathFillType) -> &mut Self {
1853        unimplemented!("This is mocked")
1854    }
1855}
1856
1857pub struct Path;
1858
1859impl Path {
1860    pub fn new() -> Self {
1861        unimplemented!("This is mocked")
1862    }
1863
1864    pub fn bounds(&self) -> &Rect {
1865        unimplemented!("This is mocked")
1866    }
1867}
1868
1869#[repr(i32)]
1870#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1871pub enum PathAddPathMode {
1872    Append = 0,
1873    Extend = 1,
1874}
1875
1876#[derive(Copy, Clone)]
1877#[repr(transparent)]
1878pub struct RRect;
1879
1880impl AsRef<RRect> for RRect {
1881    fn as_ref(&self) -> &RRect {
1882        self
1883    }
1884}
1885
1886impl RRect {
1887    pub fn new_rect_radii(_rect: Rect, _radii: &[Point; 4]) -> Self {
1888        unimplemented!("This is mocked")
1889    }
1890
1891    pub fn rect(&self) -> &Rect {
1892        unimplemented!("This is mocked")
1893    }
1894
1895    pub fn bounds(&self) -> &Rect {
1896        unimplemented!("This is mocked")
1897    }
1898
1899    pub fn width(&self) -> f32 {
1900        unimplemented!("This is mocked")
1901    }
1902
1903    pub fn height(&self) -> f32 {
1904        unimplemented!("This is mocked")
1905    }
1906
1907    pub fn radii(&self, _corner: Corner) -> Point {
1908        unimplemented!("This is mocked")
1909    }
1910
1911    pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1912        unimplemented!("This is mocked")
1913    }
1914
1915    pub fn contains(&self, other: Rect) -> bool {
1916        unimplemented!("This is mocked")
1917    }
1918}
1919
1920#[repr(i32)]
1921#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1922pub enum ArcSize {
1923    Small = 0,
1924    Large = 1,
1925}
1926
1927#[repr(i32)]
1928#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1929pub enum Corner {
1930    UpperLeft = 0,
1931    UpperRight = 1,
1932    LowerRight = 2,
1933    LowerLeft = 3,
1934}
1935
1936#[repr(i32)]
1937#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1938pub enum PathFillType {
1939    Winding = 0,
1940    EvenOdd = 1,
1941    InverseWinding = 2,
1942    InverseEvenOdd = 3,
1943}
1944
1945#[repr(i32)]
1946#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1947pub enum PathDirection {
1948    CW = 0,
1949    CCW = 1,
1950}
1951
1952pub struct MaskFilter;
1953
1954impl MaskFilter {
1955    pub fn blur(
1956        _style: BlurStyle,
1957        _sigma: f32,
1958        _respect_ctm: impl Into<Option<bool>>,
1959    ) -> Option<Self> {
1960        unimplemented!("This is mocked")
1961    }
1962}
1963
1964#[repr(i32)]
1965#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1966pub enum BlendMode {
1967    Clear = 0,
1968    Src = 1,
1969    Dst = 2,
1970    SrcOver = 3,
1971    DstOver = 4,
1972    SrcIn = 5,
1973    DstIn = 6,
1974    SrcOut = 7,
1975    DstOut = 8,
1976    SrcATop = 9,
1977    DstATop = 10,
1978    Xor = 11,
1979    Plus = 12,
1980    Modulate = 13,
1981    Screen = 14,
1982    Overlay = 15,
1983    Darken = 16,
1984    Lighten = 17,
1985    ColorDodge = 18,
1986    ColorBurn = 19,
1987    HardLight = 20,
1988    SoftLight = 21,
1989    Difference = 22,
1990    Exclusion = 23,
1991    Multiply = 24,
1992    Hue = 25,
1993    Saturation = 26,
1994    Color = 27,
1995    Luminosity = 28,
1996}
1997
1998impl BlurStyle {
1999    pub const LastEnum: BlurStyle = BlurStyle::Inner;
2000}
2001#[repr(i32)]
2002#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2003pub enum BlurStyle {
2004    Normal = 0,
2005    Solid = 1,
2006    Outer = 2,
2007    Inner = 3,
2008}
2009
2010pub mod svg {
2011    use super::{
2012        Canvas,
2013        Color,
2014        LocalResourceProvider,
2015        Size,
2016    };
2017
2018    pub enum LengthUnit {
2019        Percentage,
2020        PX,
2021    }
2022
2023    pub struct Length {
2024        pub value: f32,
2025    }
2026
2027    impl Length {
2028        pub fn new(value: f32, unit: LengthUnit) -> Self {
2029            unimplemented!("This is mocked")
2030        }
2031    }
2032
2033    pub struct Paint;
2034
2035    impl Paint {
2036        pub fn none() -> Self {
2037            unimplemented!("This is mocked")
2038        }
2039
2040        pub fn current_color() -> Self {
2041            unimplemented!("This is mocked")
2042        }
2043
2044        pub fn from_color(_color: Color) -> Self {
2045            unimplemented!("This is mocked")
2046        }
2047    }
2048
2049    pub struct SvgNode;
2050
2051    impl SvgNode {
2052        pub fn width(&self) -> Length {
2053            unimplemented!("This is mocked")
2054        }
2055
2056        pub fn height(&self) -> Length {
2057            unimplemented!("This is mocked")
2058        }
2059
2060        pub fn set_width(&mut self, _width: Length) {
2061            unimplemented!("This is mocked")
2062        }
2063
2064        pub fn set_height(&mut self, _height: Length) {
2065            unimplemented!("This is mocked")
2066        }
2067
2068        pub fn set_color(&mut self, _value: Color) {
2069            unimplemented!("This is mocked")
2070        }
2071
2072        pub fn set_fill(&mut self, _value: Paint) {
2073            unimplemented!("This is mocked")
2074        }
2075
2076        pub fn set_stroke(&mut self, _value: Paint) {
2077            unimplemented!("This is mocked")
2078        }
2079
2080        pub fn set_stroke_width(&mut self, _value: Length) {
2081            unimplemented!("This is mocked")
2082        }
2083    }
2084
2085    pub struct Dom;
2086
2087    impl Dom {
2088        pub fn from_bytes(_bytes: &[u8], provider: LocalResourceProvider) -> Result<Self, ()> {
2089            unimplemented!("This is mocked")
2090        }
2091
2092        pub fn set_container_size(&mut self, _size: impl Into<Size>) {
2093            unimplemented!("This is mocked")
2094        }
2095
2096        pub fn render(&self, _canvas: &Canvas) {
2097            unimplemented!("This is mocked")
2098        }
2099
2100        pub fn root(&self) -> SvgNode {
2101            unimplemented!("This is mocked")
2102        }
2103    }
2104}
2105
2106#[repr(C)]
2107#[derive(Copy, Clone, PartialEq, Default, Debug)]
2108pub struct Size;
2109
2110impl From<(f32, f32)> for Size {
2111    fn from(_source: (f32, f32)) -> Self {
2112        unimplemented!("This is mocked")
2113    }
2114}
2115
2116impl From<(i32, i32)> for Size {
2117    fn from(_source: (i32, i32)) -> Self {
2118        unimplemented!("This is mocked")
2119    }
2120}
2121
2122#[derive(Clone)]
2123pub struct Surface;
2124
2125impl Surface {
2126    pub fn canvas(&mut self) -> &Canvas {
2127        unimplemented!("This is mocked")
2128    }
2129
2130    pub fn image_snapshot(&mut self) -> Image {
2131        unimplemented!("This is mocked")
2132    }
2133
2134    pub fn direct_context(&self) -> Option<DirectContext> {
2135        unimplemented!("This is mocked")
2136    }
2137
2138    pub fn swap_buffers(&self, _: &PossiblyCurrentContext) {
2139        unimplemented!("This is mocked")
2140    }
2141
2142    pub fn from_backend_render_target(
2143        _context: &mut RecordingContext,
2144        _backend_render_target: &BackendRenderTarget,
2145        _origin: SurfaceOrigin,
2146        _color_type: ColorType,
2147        _color_space: impl Into<Option<ColorSpace>>,
2148        _surface_props: Option<&SurfaceProps>,
2149    ) -> Option<Self> {
2150        unimplemented!("This is mocked")
2151    }
2152
2153    pub fn draw(
2154        &self,
2155        canvas: &Canvas,
2156        offset: impl Into<Point>,
2157        sampling: impl Into<SamplingOptions>,
2158        paint: Option<&Paint>,
2159    ) {
2160        unimplemented!("This is mocked")
2161    }
2162
2163    pub fn new_surface_with_dimensions(&mut self, dim: impl Into<ISize>) -> Option<Self> {
2164        unimplemented!("This is mocked")
2165    }
2166}
2167
2168pub struct ISize;
2169
2170impl ISize {
2171    pub fn new(w: i32, h: i32) -> Self {
2172        unimplemented!("This is mocked")
2173    }
2174}
2175
2176impl From<(i32, i32)> for ISize {
2177    fn from(source: (i32, i32)) -> Self {
2178        unimplemented!("This is mocked")
2179    }
2180}
2181
2182pub struct ColorSpace;
2183
2184#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
2185#[repr(i32)]
2186pub enum ColorType {
2187    RGBA8888,
2188    BGRA8888,
2189}
2190
2191pub struct SurfaceProps;
2192
2193use std::ops::{
2194    Deref,
2195    DerefMut,
2196};
2197
2198pub struct RecordingContext;
2199
2200#[repr(i32)]
2201#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2202pub enum SurfaceOrigin {
2203    TopLeft = 0,
2204    BottomLeft = 1,
2205}
2206
2207pub mod gpu {
2208    #[repr(C)]
2209    #[derive(Debug, Default)]
2210    pub struct ContextOptions;
2211}
2212
2213pub mod direct_contexts {
2214    use super::{
2215        DirectContext,
2216        Interface,
2217        gpu,
2218        vk,
2219    };
2220    pub fn make_gl<'a>(
2221        _interface: impl Into<Option<Interface>>,
2222        _options: impl Into<Option<&'a gpu::ContextOptions>>,
2223    ) -> Option<DirectContext> {
2224        unimplemented!("This is mocked")
2225    }
2226
2227    pub fn make_vulkan<'a>(
2228        backend_context: &vk::BackendContext,
2229        options: impl Into<Option<&'a gpu::ContextOptions>>,
2230    ) -> Option<DirectContext> {
2231        unimplemented!("This is mocked")
2232    }
2233}
2234
2235pub struct DirectContext;
2236
2237impl From<DirectContext> for RecordingContext {
2238    fn from(_direct_context: DirectContext) -> Self {
2239        unimplemented!("This is mocked")
2240    }
2241}
2242
2243impl Deref for DirectContext {
2244    type Target = RecordingContext;
2245
2246    fn deref(&self) -> &Self::Target {
2247        unimplemented!("This is mocked")
2248    }
2249}
2250
2251impl DerefMut for DirectContext {
2252    fn deref_mut(&mut self) -> &mut Self::Target {
2253        unimplemented!("This is mocked")
2254    }
2255}
2256
2257impl DirectContext {
2258    pub fn flush_and_submit(&self) {
2259        unimplemented!("This is mocked")
2260    }
2261
2262    pub fn abandon(&self) {
2263        unimplemented!("This is mocked")
2264    }
2265
2266    pub fn release_resources_and_abandon(&self) {
2267        unimplemented!("This is mocked")
2268    }
2269
2270    pub fn set_resource_cache_limit(&mut self, max_resource_bytes: usize) {
2271        unimplemented!("This is mocked")
2272    }
2273
2274    pub fn flush_submit_and_sync_cpu(&self) {
2275        unimplemented!("This is mocked")
2276    }
2277}
2278
2279pub fn raster_from_data(
2280    info: &ImageInfo,
2281    pixels: impl Into<Data>,
2282    row_bytes: usize,
2283) -> Option<Image> {
2284    unimplemented!("This is mocked")
2285}
2286
2287pub struct ImageInfo {}
2288impl ImageInfo {
2289    pub fn new(
2290        _dimensions: impl Into<ISize>,
2291        _ct: ColorType,
2292        _at: AlphaType,
2293        _cs: impl Into<Option<ColorSpace>>,
2294    ) -> Self {
2295        unimplemented!("This is mocked")
2296    }
2297}
2298
2299pub enum AlphaType {
2300    Unknown = 0,
2301    Opaque = 1,
2302    Premul = 2,
2303    Unpremul = 3,
2304}
2305
2306use std::ffi::c_void;
2307
2308#[repr(u8)]
2309#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2310pub enum Protected {
2311    No,
2312    Yes,
2313}
2314
2315#[derive(Copy, Clone, PartialEq, Eq, Debug)]
2316#[repr(C)]
2317pub struct FramebufferInfo {
2318    pub fboid: i32,
2319    pub format: Format,
2320    pub protected: Protected,
2321}
2322
2323impl Default for FramebufferInfo {
2324    fn default() -> Self {
2325        unimplemented!("This is mocked")
2326    }
2327}
2328
2329pub fn wrap_backend_render_target(
2330    context: &mut RecordingContext,
2331    backend_render_target: &BackendRenderTarget,
2332    origin: SurfaceOrigin,
2333    color_type: ColorType,
2334    color_space: impl Into<Option<ColorSpace>>,
2335    surface_props: Option<&SurfaceProps>,
2336) -> Option<Surface> {
2337    unimplemented!("This is mocked")
2338}
2339
2340pub struct Interface;
2341
2342impl Interface {
2343    pub fn new_load_with<F>(_load_fn: F) -> Option<Self>
2344    where
2345        F: FnMut(&str) -> *const c_void,
2346    {
2347        unimplemented!("This is mocked")
2348    }
2349}
2350
2351#[repr(i32)]
2352#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2353pub enum Format {
2354    Unknown = 0,
2355    RGBA8 = 1,
2356    R8 = 2,
2357    ALPHA8 = 3,
2358    LUMINANCE8 = 4,
2359    LUMINANCE8_ALPHA8 = 5,
2360    BGRA8 = 6,
2361    RGB565 = 7,
2362    RGBA16F = 8,
2363    R16F = 9,
2364    RGB8 = 10,
2365    RGBX8 = 11,
2366    RG8 = 12,
2367    RGB10_A2 = 13,
2368    RGBA4 = 14,
2369    SRGB8_ALPHA8 = 15,
2370    COMPRESSED_ETC1_RGB8 = 16,
2371    COMPRESSED_RGB8_ETC2 = 17,
2372    COMPRESSED_RGB8_BC1 = 18,
2373    COMPRESSED_RGBA8_BC1 = 19,
2374    R16 = 20,
2375    RG16 = 21,
2376    RGBA16 = 22,
2377    RG16F = 23,
2378    LUMINANCE16F = 24,
2379    STENCIL_INDEX8 = 25,
2380    STENCIL_INDEX16 = 26,
2381    DEPTH24_STENCIL8 = 27,
2382}
2383
2384pub struct BackendRenderTarget;
2385
2386impl BackendRenderTarget {
2387    pub fn new_gl(
2388        (_width, _height): (i32, i32),
2389        _sample_count: impl Into<Option<usize>>,
2390        _stencil_bits: usize,
2391        _info: FramebufferInfo,
2392    ) -> Self {
2393        unimplemented!("This is mocked")
2394    }
2395}
2396
2397pub mod backend_render_targets {
2398    use crate::prelude::*;
2399    pub fn make_gl(
2400        (width, height): (i32, i32),
2401        sample_count: impl Into<Option<usize>>,
2402        stencil_bits: usize,
2403        info: FramebufferInfo,
2404    ) -> BackendRenderTarget {
2405        unimplemented!("This is mocked")
2406    }
2407    pub fn make_vk((width, height): (i32, i32), info: &vk::ImageInfo) -> BackendRenderTarget {
2408        unimplemented!("This is mocked")
2409    }
2410}
2411
2412pub fn set_resource_cache_total_bytes_limit(new_limit: usize) -> usize {
2413    unimplemented!("This is mocked")
2414}
2415
2416pub fn set_resource_cache_single_allocation_byte_limit(new_limit: Option<usize>) -> Option<usize> {
2417    unimplemented!("This is mocked")
2418}
2419
2420pub enum EncodedImageFormat {
2421    BMP = 0,
2422    GIF = 1,
2423    ICO = 2,
2424    JPEG = 3,
2425    PNG = 4,
2426    WBMP = 5,
2427    WEBP = 6,
2428    PKM = 7,
2429    KTX = 8,
2430    ASTC = 9,
2431    DNG = 10,
2432    HEIF = 11,
2433    AVIF = 12,
2434    JPEGXL = 13,
2435}
2436
2437pub struct LocalResourceProvider;
2438
2439impl LocalResourceProvider {
2440    pub fn new(font_mgr: &FontMgr) -> Self {
2441        unimplemented!("This is mocked")
2442    }
2443}
2444
2445pub fn raster_n32_premul(size: impl Into<ISize>) -> Option<Surface> {
2446    unimplemented!("This is mocked")
2447}
2448pub mod vk {
2449
2450    #[derive(Default)]
2451    pub struct Alloc {}
2452
2453    pub struct ImageInfo {
2454        image: Image,
2455        alloc: Alloc,
2456        pub tiling: ImageTiling,
2457        pub layout: ImageLayout,
2458        pub format: Format,
2459        pub image_usage_flags: ImageUsageFlags,
2460        pub sample_count: u32,
2461        pub level_count: u32,
2462        pub current_queue_family: u32,
2463        pub protected: Protected,
2464        pub ycbcr_conversion_info: YcbcrConversionInfo,
2465        pub sharing_mode: SharingMode,
2466    }
2467
2468    pub struct ImageUsageFlags;
2469    pub struct YcbcrConversionInfo;
2470    pub struct Protected;
2471
2472    impl ImageInfo {
2473        #[allow(clippy::too_many_arguments)]
2474        pub unsafe fn new(
2475            image: Image,
2476            alloc: Alloc,
2477            tiling: ImageTiling,
2478            layout: ImageLayout,
2479            format: Format,
2480            level_count: u32,
2481            current_queue_family: impl Into<Option<u32>>,
2482            ycbcr_conversion_info: impl Into<Option<YcbcrConversionInfo>>,
2483            protected: impl Into<Option<Protected>>,
2484            sharing_mode: impl Into<Option<SharingMode>>,
2485        ) -> Self {
2486            unimplemented!("This is mocked")
2487        }
2488    }
2489
2490    pub type Image = u8;
2491
2492    pub enum ImageTiling {
2493        OPTIMAL,
2494    }
2495    pub enum ImageLayout {
2496        UNDEFINED,
2497    }
2498    pub enum Format {
2499        B8G8R8A8_UNORM,
2500    }
2501    pub enum SharingMode {
2502        EXCLUSIVE,
2503    }
2504
2505    #[derive(Copy, Clone, Debug)]
2506    pub struct BackendContext {}
2507    impl BackendContext {
2508        pub unsafe fn new(
2509            instance: Instance,
2510            physical_device: PhysicalDevice,
2511            device: Device,
2512            (queue, queue_index): (Queue, usize),
2513            get_proc: &impl GetProc,
2514        ) -> BackendContext {
2515            unimplemented!("This is mocked")
2516        }
2517
2518        pub fn set_max_api_version(&mut self, version: impl Into<Version>) -> &mut Self {
2519            unimplemented!("This is mocked")
2520        }
2521    }
2522
2523    pub trait GetProc: Fn(GetProcOf) -> u8 {}
2524
2525    impl<T> GetProc for T where T: Fn(GetProcOf) -> u8 {}
2526    #[derive(Copy, Clone, Debug)]
2527    pub enum GetProcOf {
2528        Instance(Instance, *const std::os::raw::c_char),
2529        Device(Device, *const std::os::raw::c_char),
2530    }
2531    pub type Instance = u8;
2532    pub type PhysicalDevice = u8;
2533    pub type Queue = u8;
2534    pub type Device = u8;
2535
2536    #[repr(transparent)]
2537    #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
2538    pub struct Version(u32);
2539    impl Version {
2540        pub fn new(major: usize, minor: usize, patch: usize) -> Self {
2541            unimplemented!("This is mocked")
2542        }
2543    }
2544}