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(Clone, Debug, PartialEq, Copy, Eq)]
13pub struct Color(u32);
14
15impl From<u32> for Color {
16    fn from(argb: u32) -> Self {
17        Color(argb)
18    }
19}
20
21impl Default for Color {
22    fn default() -> Self {
23        unimplemented!("This is mocked")
24    }
25}
26
27impl Color {
28    pub const TRANSPARENT: Self = Color(0);
29    pub const BLACK: Self = Color(4278190080);
30    pub const DARK_GRAY: Self = Color(4282664004);
31    pub const GRAY: Self = Color(4287137928);
32    pub const LIGHT_GRAY: Self = Color(4291611852);
33    pub const WHITE: Self = Color(4294967295);
34    pub const RED: Self = Color(4294901760);
35    pub const GREEN: Self = Color(4278255360);
36    pub const BLUE: Self = Color(4278190335);
37    pub const YELLOW: Self = Color(4294967040);
38    pub const CYAN: Self = Color(4278255615);
39    pub const MAGENTA: Self = Color(4294902015);
40
41    #[inline]
42    pub fn new(_argb: u32) -> Self {
43        unimplemented!("This is mocked")
44    }
45
46    #[inline]
47    pub fn from_argb(_a: u8, _r: u8, _g: u8, _b: u8) -> Color {
48        unimplemented!("This is mocked")
49    }
50
51    #[inline]
52    pub fn from_rgb(_r: u8, _g: u8, _b: u8) -> Color {
53        unimplemented!("This is mocked")
54    }
55
56    #[inline]
57    pub fn a(self) -> u8 {
58        unimplemented!("This is mocked")
59    }
60
61    #[inline]
62    pub fn r(self) -> u8 {
63        unimplemented!("This is mocked")
64    }
65
66    #[inline]
67    pub fn g(self) -> u8 {
68        unimplemented!("This is mocked")
69    }
70
71    #[inline]
72    pub fn b(self) -> u8 {
73        unimplemented!("This is mocked")
74    }
75
76    #[inline]
77    #[must_use]
78    pub fn with_a(self, _a: u8) -> Self {
79        unimplemented!("This is mocked")
80    }
81
82    #[inline]
83    pub fn to_rgb(self) -> RGB {
84        unimplemented!("This is mocked")
85    }
86
87    #[inline]
88    pub fn to_hsv(self) -> HSV {
89        unimplemented!("This is mocked")
90    }
91}
92
93#[derive(Copy, Clone, PartialEq, Eq, Debug)]
94pub struct RGB {
95    pub r: u8,
96    pub g: u8,
97    pub b: u8,
98}
99
100impl From<(u8, u8, u8)> for RGB {
101    fn from(_rgb: (u8, u8, u8)) -> Self {
102        unimplemented!("This is mocked")
103    }
104}
105
106#[derive(Copy, Clone, PartialEq, Debug)]
107pub struct HSV {
108    pub h: f32,
109    pub s: f32,
110    pub v: f32,
111}
112
113impl From<(f32, f32, f32)> for HSV {
114    fn from(_hsv: (f32, f32, f32)) -> Self {
115        unimplemented!("This is mocked")
116    }
117}
118
119impl HSV {
120    pub fn to_color(self, _alpha: u8) -> Color {
121        unimplemented!("This is mocked")
122    }
123}
124
125pub enum GradientShaderColors<'a> {
126    Colors(&'a [Color]),
127    // ColorsInSpace(&'a [Color4f], Option<ColorSpace>),
128}
129
130pub struct Shader;
131
132impl Shader {
133    pub fn linear_gradient<'a>(
134        _points: (impl Into<Point>, impl Into<Point>),
135        _colors: impl Into<GradientShaderColors<'a>>,
136        _pos: impl Into<Option<&'a [f32]>>,
137        _mode: TileMode,
138        _flags: impl Into<Option<GradientFlags>>,
139        _local_matrix: impl Into<Option<&'a Matrix>>,
140    ) -> Option<Self> {
141        unimplemented!("This is mocked")
142    }
143}
144
145pub enum TileMode {
146    Clamp = 0,
147    Repeat = 1,
148    Mirror = 2,
149    Decal = 3,
150}
151
152bitflags! {
153    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
154    pub struct GradientFlags: u32 {
155        const INTERPOLATE_COLORS_IN_PREMUL = 1;
156    }
157}
158
159#[repr(C)]
160#[derive(Copy, Clone, Debug)]
161pub struct Matrix {
162    mat: [f32; 9usize],
163    type_mask: u32,
164}
165
166impl Matrix {
167    pub fn new_identity() -> Self {
168        unimplemented!("This is mocked")
169    }
170
171    pub fn set_rotate(&mut self, _degrees: f32, _pivot: impl Into<Option<Point>>) -> &mut Self {
172        unimplemented!("This is mocked")
173    }
174}
175
176#[repr(C)]
177#[derive(Copy, Clone, PartialEq, Default, Debug)]
178pub struct Point {
179    pub x: f32,
180    pub y: f32,
181}
182
183impl Point {
184    pub fn new(_: f32, _: f32) -> Self {
185        unimplemented!("This is mocked")
186    }
187}
188
189impl Neg for Point {
190    type Output = Point;
191    fn neg(self) -> Self::Output {
192        Point::new(-self.x, -self.y)
193    }
194}
195
196impl Add for Point {
197    type Output = Point;
198    fn add(self, rhs: Self) -> Self {
199        Point::new(self.x + rhs.x, self.y + rhs.y)
200    }
201}
202
203impl Sub for Point {
204    type Output = Point;
205    fn sub(self, rhs: Self) -> Self {
206        Point::new(self.x - rhs.x, self.y - rhs.y)
207    }
208}
209impl Mul<f32> for Point {
210    type Output = Self;
211    fn mul(self, rhs: f32) -> Self {
212        Self::new(self.x * rhs, self.y * rhs)
213    }
214}
215
216impl MulAssign<f32> for Point {
217    fn mul_assign(&mut self, rhs: f32) {
218        self.x *= rhs;
219        self.y *= rhs;
220    }
221}
222
223impl Div<f32> for Point {
224    type Output = Self;
225    fn div(self, rhs: f32) -> Self {
226        Self::new(self.x / rhs, self.y / rhs)
227    }
228}
229
230impl DivAssign<f32> for Point {
231    fn div_assign(&mut self, rhs: f32) {
232        self.x /= rhs;
233        self.y /= rhs;
234    }
235}
236
237#[repr(C)]
238#[derive(Copy, Clone, Debug, PartialEq)]
239pub struct TextShadow {
240    pub color: Color,
241    pub offset: Point,
242    pub blur_sigma: f64,
243}
244
245impl Default for TextShadow {
246    fn default() -> Self {
247        unimplemented!("This is mocked")
248    }
249}
250
251impl TextShadow {
252    pub fn new(color: Color, _: (f32, f32), _: f32) -> Self {
253        unimplemented!("This is mocked")
254    }
255}
256
257impl From<(f32, f32)> for Point {
258    fn from(source: (f32, f32)) -> Self {
259        Point::new(source.0, source.1)
260    }
261}
262
263impl From<(i32, i32)> for Point {
264    fn from(source: (i32, i32)) -> Self {
265        (source.0 as f32, source.1 as f32).into()
266    }
267}
268
269#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
270#[repr(transparent)]
271pub struct Weight(i32);
272
273#[allow(non_upper_case_globals)]
274impl Weight {
275    pub const INVISIBLE: Self = Self(0);
276    pub const THIN: Self = Self(100);
277    pub const EXTRA_LIGHT: Self = Self(200);
278    pub const LIGHT: Self = Self(300);
279    pub const NORMAL: Self = Self(400);
280    pub const MEDIUM: Self = Self(500);
281    pub const SEMI_BOLD: Self = Self(600);
282    pub const BOLD: Self = Self(700);
283    pub const EXTRA_BOLD: Self = Self(800);
284    pub const BLACK: Self = Self(900);
285    pub const EXTRA_BLACK: Self = Self(1000);
286}
287
288#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
289pub enum Slant {
290    Upright = 0,
291    Italic = 1,
292    Oblique = 2,
293}
294
295#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
296#[repr(transparent)]
297pub struct Width(i32);
298
299#[allow(non_upper_case_globals)]
300impl Width {
301    pub const ULTRA_CONDENSED: Self = Self(1);
302    pub const EXTRA_CONDENSED: Self = Self(2);
303    pub const CONDENSED: Self = Self(3);
304    pub const SEMI_CONDENSED: Self = Self(4);
305    pub const NORMAL: Self = Self(5);
306    pub const SEMI_EXPANDED: Self = Self(6);
307    pub const EXPANDED: Self = Self(7);
308    pub const EXTRA_EXPANDED: Self = Self(8);
309    pub const ULTRA_EXPANDED: Self = Self(9);
310}
311
312bitflags! {
313    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
314    pub struct TextDecoration: u32 {
315        const NO_DECORATION = 0;
316        const UNDERLINE = 1;
317        const OVERLINE = 2;
318        const LINE_THROUGH = 4;
319    }
320}
321
322impl Default for TextDecoration {
323    fn default() -> Self {
324        TextDecoration::NO_DECORATION
325    }
326}
327
328#[repr(C)]
329#[derive(Copy, Clone, PartialEq, Default, Debug)]
330pub struct Decoration {
331    pub ty: TextDecoration,
332    pub mode: TextDecorationMode,
333    pub color: Color,
334    pub style: TextDecorationStyle,
335    pub thickness_multiplier: f32,
336}
337
338#[repr(C)]
339#[derive(Copy, Clone, PartialEq, Debug, Default)]
340pub enum TextDecorationMode {
341    #[default]
342    Gaps = 0,
343    Through = 1,
344}
345
346#[repr(C)]
347#[derive(Copy, Clone, PartialEq, Debug, Default)]
348pub enum TextDecorationStyle {
349    #[default]
350    Solid = 0,
351    Double = 1,
352    Dotted = 2,
353    Dashed = 3,
354    Wavy = 4,
355}
356
357#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
358pub enum TextAlign {
359    #[default]
360    Left = 0,
361    Right = 1,
362    Center = 2,
363    Justify = 3,
364    Start = 4,
365    End = 5,
366}
367
368#[derive(Default)]
369pub struct TextStyle;
370
371impl TextStyle {
372    pub fn new() -> Self {
373        unimplemented!("This is mocked")
374    }
375
376    #[deprecated(since = "0.51.0", note = "Use clone_for_placeholder")]
377    #[must_use]
378    pub fn to_placeholder(&self) -> Self {
379        unimplemented!("This is mocked")
380    }
381
382    #[must_use]
383    pub fn clone_for_placeholder(&self) -> Self {
384        unimplemented!("This is mocked")
385    }
386
387    pub fn equals(&self, _other: &TextStyle) -> bool {
388        unimplemented!("This is mocked")
389    }
390
391    pub fn equals_by_fonts(&self, _that: &TextStyle) -> bool {
392        unimplemented!("This is mocked")
393    }
394
395    pub fn color(&self) -> Color {
396        unimplemented!("This is mocked")
397    }
398
399    pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self {
400        unimplemented!("This is mocked")
401    }
402
403    pub fn foreground(&self) -> Paint {
404        unimplemented!("This is mocked")
405    }
406
407    pub fn set_foreground_color(&mut self, _paint: &Paint) -> &mut Self {
408        unimplemented!("This is mocked")
409    }
410
411    pub fn clear_foreground_color(&mut self) -> &mut Self {
412        unimplemented!("This is mocked")
413    }
414
415    pub fn background(&self) -> Paint {
416        unimplemented!("This is mocked")
417    }
418
419    pub fn set_background_color(&mut self, _paint: &Paint) -> &mut Self {
420        unimplemented!("This is mocked")
421    }
422
423    pub fn clear_background_color(&mut self) -> &mut Self {
424        unimplemented!("This is mocked")
425    }
426
427    pub fn decoration(&self) -> &Decoration {
428        unimplemented!("This is mocked")
429    }
430
431    pub fn set_decoration(&mut self, decoration: &Decoration) {
432        unimplemented!("This is mocked")
433    }
434
435    pub fn font_style(&self) -> FontStyle {
436        unimplemented!("This is mocked")
437    }
438
439    pub fn set_font_style(&mut self, _font_style: FontStyle) -> &mut Self {
440        unimplemented!("This is mocked")
441    }
442
443    pub fn shadows(&self) -> &[TextShadow] {
444        unimplemented!("This is mocked")
445    }
446
447    pub fn add_shadow(&mut self, _shadow: TextShadow) -> &mut Self {
448        unimplemented!("This is mocked")
449    }
450
451    pub fn reset_shadows(&mut self) -> &mut Self {
452        unimplemented!("This is mocked")
453    }
454
455    pub fn font_features(&self) -> &[FontFeature] {
456        unimplemented!("This is mocked")
457    }
458
459    pub fn add_font_feature(&mut self, _font_feature: impl AsRef<str>, _value: i32) {
460        unimplemented!("This is mocked")
461    }
462
463    pub fn reset_font_features(&mut self) {
464        unimplemented!("This is mocked")
465    }
466
467    pub fn font_size(&self) -> f32 {
468        unimplemented!("This is mocked")
469    }
470
471    pub fn set_font_size(&mut self, _size: f32) -> &mut Self {
472        unimplemented!("This is mocked")
473    }
474
475    pub fn font_families(&self) -> FontFamilies {
476        unimplemented!("This is mocked")
477    }
478
479    pub fn set_font_families(&mut self, _families: &[impl AsRef<str>]) -> &mut Self {
480        unimplemented!("This is mocked")
481    }
482
483    pub fn baseline_shift(&self) -> f32 {
484        unimplemented!("This is mocked")
485    }
486
487    pub fn set_baseline_shift(&mut self, _baseline_shift: f32) -> &mut Self {
488        unimplemented!("This is mocked")
489    }
490
491    pub fn set_height(&mut self, _height: f32) -> &mut Self {
492        unimplemented!("This is mocked")
493    }
494
495    pub fn height(&self) -> f32 {
496        unimplemented!("This is mocked")
497    }
498
499    pub fn set_height_override(&mut self, _height_override: bool) -> &mut Self {
500        unimplemented!("This is mocked")
501    }
502
503    pub fn height_override(&self) -> bool {
504        unimplemented!("This is mocked")
505    }
506
507    pub fn set_half_leading(&mut self, _half_leading: bool) -> &mut Self {
508        unimplemented!("This is mocked")
509    }
510
511    pub fn half_leading(&self) -> bool {
512        unimplemented!("This is mocked")
513    }
514
515    pub fn set_letter_spacing(&mut self, _letter_spacing: f32) -> &mut Self {
516        unimplemented!("This is mocked")
517    }
518
519    pub fn letter_spacing(&self) -> f32 {
520        unimplemented!("This is mocked")
521    }
522
523    pub fn set_word_spacing(&mut self, _word_spacing: f32) -> &mut Self {
524        unimplemented!("This is mocked")
525    }
526
527    pub fn word_spacing(&self) -> f32 {
528        unimplemented!("This is mocked")
529    }
530
531    pub fn typeface(&self) -> Option<Typeface> {
532        unimplemented!("This is mocked")
533    }
534
535    pub fn set_typeface(&mut self, _typeface: impl Into<Option<Typeface>>) -> &mut Self {
536        unimplemented!("This is mocked")
537    }
538
539    pub fn locale(&self) -> &str {
540        unimplemented!("This is mocked")
541    }
542
543    pub fn set_locale(&mut self, _locale: impl AsRef<str>) -> &mut Self {
544        unimplemented!("This is mocked")
545    }
546
547    pub fn text_baseline(&self) -> TextBaseline {
548        unimplemented!("This is mocked")
549    }
550
551    pub fn set_text_baseline(&mut self, _baseline: TextBaseline) -> &mut Self {
552        unimplemented!("This is mocked")
553    }
554
555    pub fn font_metrics(&self) -> FontMetrics {
556        unimplemented!("This is mocked")
557    }
558
559    pub fn is_placeholder(&self) -> bool {
560        unimplemented!("This is mocked")
561    }
562
563    pub fn set_placeholder(&mut self) -> &mut Self {
564        unimplemented!("This is mocked")
565    }
566}
567
568pub struct Typeface;
569
570pub struct FontMetrics;
571
572#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
573pub enum TextBaseline {
574    Alphabetic = 0,
575    Ideographic = 1,
576}
577
578pub struct FontFamilies;
579
580#[derive(Default, Clone)]
581pub struct Paint;
582
583impl Paint {
584    pub fn set_anti_alias(&mut self, _anti_alias: bool) -> &mut Self {
585        unimplemented!("This is mocked")
586    }
587
588    pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self {
589        unimplemented!("This is mocked")
590    }
591
592    pub fn set_style(&mut self, _style: PaintStyle) -> &mut Self {
593        unimplemented!("This is mocked")
594    }
595
596    pub fn set_shader(&mut self, _shader: impl Into<Option<Shader>>) -> &mut Self {
597        unimplemented!("This is mocked")
598    }
599
600    pub fn set_stroke_width(&mut self, _width: f32) -> &mut Self {
601        unimplemented!("This is mocked")
602    }
603
604    pub fn set_mask_filter(&mut self, _mask_filter: impl Into<Option<MaskFilter>>) -> &mut Self {
605        unimplemented!("This is mocked")
606    }
607}
608
609pub enum PaintStyle {
610    Fill = 0,
611    Stroke = 1,
612    StrokeAndFill = 2,
613}
614
615pub struct FontStyle;
616
617impl FontStyle {
618    pub fn new(_weight: Weight, _width: Width, _slant: Slant) -> Self {
619        unimplemented!("This is mocked")
620    }
621}
622
623#[derive(Default, Clone)]
624pub struct FontMgr;
625
626impl FontMgr {
627    pub fn new_from_data(
628        &self,
629        _bytes: &[u8],
630        _ttc_index: impl Into<Option<usize>>,
631    ) -> Option<Typeface> {
632        unimplemented!("This is mocked")
633    }
634}
635
636pub struct FontFeature;
637
638pub struct TypefaceFontProvider;
639
640impl TypefaceFontProvider {
641    pub fn new() -> Self {
642        unimplemented!("This is mocked")
643    }
644
645    pub fn register_typeface(
646        &mut self,
647        _typeface: Typeface,
648        _alias: Option<impl AsRef<str>>,
649    ) -> usize {
650        unimplemented!("This is mocked")
651    }
652}
653
654impl From<TypefaceFontProvider> for FontMgr {
655    fn from(_provider: TypefaceFontProvider) -> Self {
656        unimplemented!("This is mocked")
657    }
658}
659
660#[derive(Clone)]
661pub struct FontCollection;
662
663impl FontCollection {
664    pub fn new() -> Self {
665        unimplemented!("This is mocked")
666    }
667
668    pub fn set_default_font_manager<'a>(
669        &mut self,
670        _font_manager: impl Into<Option<FontMgr>>,
671        _default_family_name: impl Into<Option<&'a str>>,
672    ) {
673        unimplemented!("This is mocked")
674    }
675
676    pub fn set_dynamic_font_manager(&mut self, _font_manager: impl Into<Option<FontMgr>>) {
677        unimplemented!("This is mocked")
678    }
679}
680
681pub struct Paragraph;
682
683impl Paragraph {
684    pub fn max_width(&self) -> f32 {
685        unimplemented!("This is mocked")
686    }
687
688    pub fn height(&self) -> f32 {
689        unimplemented!("This is mocked")
690    }
691
692    pub fn min_intrinsic_width(&self) -> f32 {
693        unimplemented!("This is mocked")
694    }
695
696    pub fn max_intrinsic_width(&self) -> f32 {
697        unimplemented!("This is mocked")
698    }
699
700    pub fn alphabetic_baseline(&self) -> f32 {
701        unimplemented!("This is mocked")
702    }
703
704    pub fn ideographic_baseline(&self) -> f32 {
705        unimplemented!("This is mocked")
706    }
707
708    pub fn longest_line(&self) -> f32 {
709        unimplemented!("This is mocked")
710    }
711
712    pub fn did_exceed_max_lines(&self) -> bool {
713        unimplemented!("This is mocked")
714    }
715
716    pub fn layout(&mut self, _width: f32) {
717        unimplemented!("This is mocked")
718    }
719
720    pub fn paint(&self, _canvas: &Canvas, _p: impl Into<Point>) {
721        unimplemented!("This is mocked")
722    }
723
724    /// Returns a vector of bounding boxes that enclose all text between
725    /// start and end glyph indexes, including start and excluding end
726    pub fn get_rects_for_range(
727        &self,
728        _range: Range<usize>,
729        _rect_height_style: RectHeightStyle,
730        _rect_width_style: RectWidthStyle,
731    ) -> Vec<TextBox> {
732        unimplemented!("This is mocked")
733    }
734
735    pub fn get_rects_for_placeholders(&self) -> Vec<TextBox> {
736        unimplemented!("This is mocked")
737    }
738
739    pub fn get_glyph_position_at_coordinate(&self, _p: impl Into<Point>) -> PositionWithAffinity {
740        unimplemented!("This is mocked")
741    }
742
743    pub fn get_word_boundary(&self, _offset: u32) -> Range<usize> {
744        unimplemented!("This is mocked")
745    }
746
747    pub fn get_line_metrics(&self) -> Vec<LineMetrics> {
748        unimplemented!("This is mocked")
749    }
750
751    pub fn line_number(&self) -> usize {
752        unimplemented!("This is mocked")
753    }
754
755    pub fn mark_dirty(&mut self) {
756        unimplemented!("This is mocked")
757    }
758
759    pub fn unresolved_glyphs(&mut self) -> Option<usize> {
760        unimplemented!("This is mocked")
761    }
762
763    pub fn get_line_number_at(&self, _code_unit_index: usize) -> Option<usize> {
764        unimplemented!("This is mocked")
765    }
766
767    pub fn get_line_metrics_at(&self, _line_number: usize) -> Option<LineMetrics> {
768        unimplemented!("This is mocked")
769    }
770
771    pub fn get_actual_text_range(
772        &self,
773        _line_number: usize,
774        _include_spaces: bool,
775    ) -> Range<usize> {
776        unimplemented!("This is mocked")
777    }
778
779    pub fn get_glyph_cluster_at(&self, _code_unit_index: usize) -> Option<GlyphClusterInfo> {
780        unimplemented!("This is mocked")
781    }
782
783    pub fn get_closest_glyph_cluster_at(&self, _d: impl Into<Point>) -> Option<GlyphClusterInfo> {
784        unimplemented!("This is mocked")
785    }
786
787    pub fn get_font_at(&self, _code_unit_index: usize) -> Font {
788        unimplemented!("This is mocked")
789    }
790
791    pub fn get_fonts(&self) -> Vec<FontInfo> {
792        unimplemented!("This is mocked")
793    }
794}
795
796#[derive(Default)]
797pub struct ParagraphStyle;
798
799impl ParagraphStyle {
800    pub fn new() -> Self {
801        unimplemented!("This is mocked")
802    }
803
804    pub fn strut_style(&self) -> &StrutStyle {
805        unimplemented!("This is mocked")
806    }
807
808    pub fn set_strut_style(&mut self, _strut_style: StrutStyle) -> &mut Self {
809        unimplemented!("This is mocked")
810    }
811
812    pub fn text_style(&self) -> &TextStyle {
813        unimplemented!("This is mocked")
814    }
815
816    pub fn set_text_style(&mut self, _text_style: &TextStyle) -> &mut Self {
817        unimplemented!("This is mocked")
818    }
819
820    pub fn text_direction(&self) -> TextDirection {
821        unimplemented!("This is mocked")
822    }
823
824    pub fn set_text_direction(&mut self, _direction: TextDirection) -> &mut Self {
825        unimplemented!("This is mocked")
826    }
827
828    pub fn text_align(&self) -> TextAlign {
829        unimplemented!("This is mocked")
830    }
831
832    pub fn set_text_align(&mut self, _align: TextAlign) -> &mut Self {
833        unimplemented!("This is mocked")
834    }
835
836    pub fn max_lines(&self) -> Option<usize> {
837        unimplemented!("This is mocked")
838    }
839
840    pub fn set_max_lines(&mut self, _lines: impl Into<Option<usize>>) -> &mut Self {
841        unimplemented!("This is mocked")
842    }
843
844    // TODO: Support u16 ellipsis, but why? Doesn't SkString support UTF-8?
845
846    pub fn ellipsis(&self) -> &str {
847        unimplemented!("This is mocked")
848    }
849
850    pub fn set_ellipsis(&mut self, _ellipsis: impl AsRef<str>) -> &mut Self {
851        unimplemented!("This is mocked")
852    }
853
854    pub fn height(&self) -> f32 {
855        unimplemented!("This is mocked")
856    }
857
858    pub fn set_height(&mut self, _height: f32) -> &mut Self {
859        unimplemented!("This is mocked")
860    }
861
862    pub fn text_height_behavior(&self) -> TextHeightBehavior {
863        unimplemented!("This is mocked")
864    }
865
866    pub fn set_text_height_behavior(&mut self, _v: TextHeightBehavior) -> &mut Self {
867        unimplemented!("This is mocked")
868    }
869
870    pub fn unlimited_lines(&self) -> bool {
871        unimplemented!("This is mocked")
872    }
873
874    pub fn ellipsized(&self) -> bool {
875        unimplemented!("This is mocked")
876    }
877
878    pub fn effective_align(&self) -> TextAlign {
879        unimplemented!("This is mocked")
880    }
881
882    pub fn hinting_is_on(&self) -> bool {
883        unimplemented!("This is mocked")
884    }
885
886    pub fn turn_hinting_off(&mut self) -> &mut Self {
887        unimplemented!("This is mocked")
888    }
889
890    pub fn replace_tab_characters(&self) -> bool {
891        unimplemented!("This is mocked")
892    }
893
894    pub fn set_replace_tab_characters(&mut self, _value: bool) -> &mut Self {
895        unimplemented!("This is mocked")
896    }
897}
898
899pub struct ParagraphBuilder;
900
901impl ParagraphBuilder {
902    pub fn push_style(&mut self, _style: &TextStyle) -> &mut Self {
903        unimplemented!("This is mocked")
904    }
905
906    pub fn pop(&mut self) -> &mut Self {
907        unimplemented!("This is mocked")
908    }
909
910    pub fn peek_style(&mut self) -> TextStyle {
911        unimplemented!("This is mocked")
912    }
913
914    pub fn add_text(&mut self, _str: impl AsRef<str>) -> &mut Self {
915        unimplemented!("This is mocked")
916    }
917
918    pub fn add_placeholder(&mut self, _placeholder_style: &PlaceholderStyle) -> &mut Self {
919        unimplemented!("This is mocked")
920    }
921
922    pub fn build(&mut self) -> Paragraph {
923        unimplemented!("This is mocked")
924    }
925
926    pub fn reset(&mut self) {
927        unimplemented!("This is mocked")
928    }
929
930    pub fn new(_style: &ParagraphStyle, _font_collection: impl Into<FontCollection>) -> Self {
931        unimplemented!("This is mocked")
932    }
933}
934
935impl From<&FontCollection> for FontCollection {
936    fn from(value: &FontCollection) -> Self {
937        value.clone()
938    }
939}
940
941pub struct StrutStyle;
942
943pub struct TextHeightBehavior;
944
945#[repr(i32)]
946#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
947pub enum TextDirection {
948    RTL = 0,
949    LTR = 1,
950}
951
952pub struct PlaceholderStyle;
953
954pub struct Canvas;
955
956impl Canvas {
957    pub fn save(&self) {
958        unimplemented!("This is mocked")
959    }
960
961    pub fn restore(&self) {
962        unimplemented!("This is mocked")
963    }
964
965    pub fn concat(&self, _matrix: &Matrix) {
966        unimplemented!("This is mocked")
967    }
968
969    pub fn clip_rect(&self, _rect: Rect, _clip: ClipOp, _: bool) {
970        unimplemented!("This is mocked")
971    }
972
973    pub fn draw_image_nine(
974        &self,
975        _image: Image,
976        _center: IRect,
977        _dst: Rect,
978        _filter_mode: FilterMode,
979        _paint: Option<&Paint>,
980    ) -> &Self {
981        unimplemented!("This is mocked")
982    }
983
984    pub fn draw_rect(&self, _rect: Rect, _paint: &Paint) -> &Self {
985        unimplemented!("This is mocked")
986    }
987
988    pub fn draw_path(&self, _path: &Path, _paint: &Paint) -> &Self {
989        unimplemented!("This is mocked")
990    }
991
992    pub fn clip_path(
993        &self,
994        _path: &Path,
995        _op: impl Into<Option<ClipOp>>,
996        _do_anti_alias: impl Into<Option<bool>>,
997    ) -> &Self {
998        unimplemented!("This is mocked")
999    }
1000
1001    pub fn translate(&self, _d: impl Into<Point>) -> &Self {
1002        unimplemented!("This is mocked")
1003    }
1004
1005    pub fn scale(&self, _: impl Into<Point>) {
1006        unimplemented!("This is mocked")
1007    }
1008
1009    pub fn clear(&self, _: Color) {
1010        unimplemented!("This is mocked")
1011    }
1012
1013    pub fn draw_line(&self, _p1: impl Into<Point>, _p2: impl Into<Point>, _paint: &Paint) -> &Self {
1014        unimplemented!("This is mocked")
1015    }
1016
1017    pub fn draw_circle(&self, _center: impl Into<Point>, _radius: f32, _paint: &Paint) -> &Self {
1018        unimplemented!("This is mocked")
1019    }
1020
1021    pub fn save_layer_alpha_f(&self, bounds: impl Into<Option<Rect>>, alpha: f32) -> usize {
1022        unimplemented!("This is mocked")
1023    }
1024}
1025
1026#[repr(i32)]
1027#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
1028pub enum RectHeightStyle {
1029    /// Provide tight bounding boxes that fit heights per run.
1030    #[default]
1031    Tight,
1032    // The height of the boxes will be the maximum height of all runs in the
1033    // line. All rects in the same line will be the same height.
1034    Max,
1035    // Extends the top and/or bottom edge of the bounds to fully cover any line
1036    // spacing. The top edge of each line should be the same as the bottom edge
1037    // of the line above. There should be no gaps in vertical coverage given any
1038    // ParagraphStyle line_height.
1039    //
1040    // The top and bottom of each rect will cover half of the
1041    // space above and half of the space below the line.
1042    IncludeLineSpacingMiddle,
1043    // The line spacing will be added to the top of the rect.
1044    IncludeLineSpacingTop,
1045    // The line spacing will be added to the bottom of the rect.
1046    IncludeLineSpacingBottom,
1047    Strut,
1048}
1049
1050#[repr(i32)]
1051#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
1052pub enum RectWidthStyle {
1053    /// Provide tight bounding boxes that fit widths to the runs of each line
1054    /// independently.
1055    #[default]
1056    Tight,
1057    /// Extends the width of the last rect of each line to match the position of
1058    /// the widest rect over all the lines.
1059    Max,
1060}
1061
1062pub struct LineMetrics;
1063
1064pub struct GlyphClusterInfo;
1065
1066pub struct TextBox {
1067    pub rect: Rect,
1068}
1069
1070pub struct Font;
1071
1072pub struct FontInfo;
1073
1074pub struct PositionWithAffinity {
1075    pub position: i32,
1076}
1077
1078pub struct RuntimeEffect;
1079
1080impl RuntimeEffect {
1081    pub fn uniforms(&self) -> &[Uniform] {
1082        unimplemented!("This is mocked")
1083    }
1084}
1085
1086#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1087pub enum Uniform {
1088    Float = 0,
1089    Float2 = 1,
1090    Float3 = 2,
1091    Float4 = 3,
1092    Float2x2 = 4,
1093    Float3x3 = 5,
1094    Float4x4 = 6,
1095    Int = 7,
1096    Int2 = 8,
1097    Int3 = 9,
1098    Int4 = 10,
1099}
1100
1101impl Uniform {
1102    pub fn name(&self) -> &str {
1103        unimplemented!("This is mocked")
1104    }
1105}
1106
1107#[repr(i32)]
1108#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1109pub enum ClipOp {
1110    Difference = 0,
1111    Intersect = 1,
1112}
1113
1114#[repr(C)]
1115#[derive(Copy, Clone, PartialEq, Default, Debug)]
1116pub struct Rect {
1117    /// The x coordinate of the rectangle's left edge.
1118    pub left: f32,
1119    /// The y coordinate of the rectangle's top edge.
1120    pub top: f32,
1121    /// The x coordinate of the rectangle's right edge.
1122    pub right: f32,
1123    /// The y coordinate of the rectangle's bottom edge.
1124    pub bottom: f32,
1125}
1126
1127impl Rect {
1128    pub fn new(_left: f32, _top: f32, _right: f32, _bottom: f32) -> Self {
1129        unimplemented!("This is mocked")
1130    }
1131}
1132
1133pub struct Image;
1134
1135impl Image {
1136    pub fn from_encoded(_data: Data) -> Option<Self> {
1137        unimplemented!("This is mocked")
1138    }
1139}
1140
1141pub struct Data;
1142
1143impl Data {
1144    pub fn new_copy(_bytes: &[u8]) -> Self {
1145        unimplemented!("This is mocked")
1146    }
1147
1148    pub unsafe fn new_bytes(_bytes: &[u8]) -> Self {
1149        unimplemented!("This is mocked")
1150    }
1151}
1152
1153#[repr(C)]
1154#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
1155pub struct IRect {
1156    /// The x coordinate of the rectangle's left edge.
1157    pub left: i32,
1158    /// The y coordinate of the rectangle's top edge.
1159    pub top: i32,
1160    /// The x coordinate of the rectangle's right edge.
1161    pub right: i32,
1162    /// The y coordinate of the rectangle's bottom edge.
1163    pub bottom: i32,
1164}
1165
1166impl IRect {
1167    pub fn new(_left: i32, _top: i32, _right: i32, _bottom: i32) -> Self {
1168        unimplemented!("This is mocked")
1169    }
1170}
1171
1172#[repr(i32)]
1173#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1174pub enum FilterMode {
1175    Nearest = 0,
1176    Linear = 1,
1177}
1178
1179impl FilterMode {
1180    pub const Last: FilterMode = FilterMode::Linear;
1181}
1182
1183pub struct Path;
1184
1185impl Path {
1186    pub fn new() -> Self {
1187        unimplemented!("This is mocked")
1188    }
1189
1190    pub fn add_path(
1191        &mut self,
1192        _src: &Path,
1193        _d: impl Into<Point>,
1194        _mode: Option<&PathAddPathMode>,
1195    ) -> &mut Self {
1196        unimplemented!("This is mocked")
1197    }
1198
1199    pub fn move_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1200        unimplemented!("This is mocked")
1201    }
1202
1203    pub fn line_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1204        unimplemented!("This is mocked")
1205    }
1206
1207    pub fn cubic_to(
1208        &mut self,
1209        _p1: impl Into<Point>,
1210        _p2: impl Into<Point>,
1211        _p3: impl Into<Point>,
1212    ) -> &mut Self {
1213        unimplemented!("This is mocked")
1214    }
1215
1216    pub fn r_arc_to_rotated(
1217        &mut self,
1218        _r: impl Into<Point>,
1219        _x_axis_rotate: f32,
1220        _large_arc: ArcSize,
1221        _sweep: PathDirection,
1222        _d: impl Into<Point>,
1223    ) -> &mut Self {
1224        unimplemented!("This is mocked")
1225    }
1226
1227    pub fn close(&self) {
1228        unimplemented!("This is mocked")
1229    }
1230
1231    pub fn add_rrect(
1232        &mut self,
1233        _rrect: impl AsRef<RRect>,
1234        _dir_start: Option<(PathDirection, usize)>,
1235    ) -> &mut Self {
1236        unimplemented!("This is mocked")
1237    }
1238
1239    pub fn offset(&mut self, _d: impl Into<Point>) -> &mut Self {
1240        unimplemented!("This is mocked")
1241    }
1242}
1243
1244#[repr(i32)]
1245#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1246pub enum PathAddPathMode {
1247    Append = 0,
1248    Extend = 1,
1249}
1250
1251#[derive(Copy, Clone)]
1252#[repr(transparent)]
1253pub struct RRect;
1254
1255impl AsRef<RRect> for RRect {
1256    fn as_ref(&self) -> &RRect {
1257        self
1258    }
1259}
1260
1261impl RRect {
1262    pub fn new_rect_radii(_rect: Rect, _radii: &[Point; 4]) -> Self {
1263        unimplemented!("This is mocked")
1264    }
1265
1266    pub fn width(&self) -> f32 {
1267        unimplemented!("This is mocked")
1268    }
1269
1270    pub fn height(&self) -> f32 {
1271        unimplemented!("This is mocked")
1272    }
1273
1274    pub fn radii(&self, _corner: Corner) -> Point {
1275        unimplemented!("This is mocked")
1276    }
1277
1278    pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1279        unimplemented!("This is mocked")
1280    }
1281}
1282
1283#[repr(i32)]
1284#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1285pub enum ArcSize {
1286    Small = 0,
1287    Large = 1,
1288}
1289
1290#[repr(i32)]
1291#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1292pub enum Corner {
1293    UpperLeft = 0,
1294    UpperRight = 1,
1295    LowerRight = 2,
1296    LowerLeft = 3,
1297}
1298
1299#[repr(i32)]
1300#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1301pub enum PathDirection {
1302    CW = 0,
1303    CCW = 1,
1304}
1305
1306pub struct MaskFilter;
1307
1308impl MaskFilter {
1309    pub fn blur(
1310        _style: BlurStyle,
1311        _sigma: f32,
1312        _respect_ctm: impl Into<Option<bool>>,
1313    ) -> Option<Self> {
1314        unimplemented!("This is mocked")
1315    }
1316}
1317
1318impl BlurStyle {
1319    pub const LastEnum: BlurStyle = BlurStyle::Inner;
1320}
1321#[repr(i32)]
1322#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1323pub enum BlurStyle {
1324    Normal = 0,
1325    Solid = 1,
1326    Outer = 2,
1327    Inner = 3,
1328}
1329
1330pub mod svg {
1331    use super::{Canvas, FontMgr, Size};
1332
1333    pub struct Dom;
1334
1335    impl Dom {
1336        pub fn from_bytes(_bytes: &[u8], font_mgr: &FontMgr) -> Result<Self, ()> {
1337            unimplemented!("This is mocked")
1338        }
1339
1340        pub fn set_container_size(&mut self, _size: impl Into<Size>) {
1341            unimplemented!("This is mocked")
1342        }
1343
1344        pub fn render(&self, _canvas: &Canvas) {
1345            unimplemented!("This is mocked")
1346        }
1347    }
1348}
1349
1350#[repr(C)]
1351#[derive(Copy, Clone, PartialEq, Default, Debug)]
1352pub struct Size;
1353
1354impl From<(f32, f32)> for Size {
1355    fn from(_source: (f32, f32)) -> Self {
1356        unimplemented!("This is mocked")
1357    }
1358}
1359
1360impl From<(i32, i32)> for Size {
1361    fn from(_source: (i32, i32)) -> Self {
1362        unimplemented!("This is mocked")
1363    }
1364}
1365
1366pub struct Surface;
1367
1368impl Surface {
1369    pub fn canvas(&mut self) -> &Canvas {
1370        unimplemented!("This is mocked")
1371    }
1372
1373    pub fn swap_buffers(&self, _: &PossiblyCurrentContext) {
1374        unimplemented!("This is mocked")
1375    }
1376
1377    pub fn from_backend_render_target(
1378        _context: &mut RecordingContext,
1379        _backend_render_target: &BackendRenderTarget,
1380        _origin: SurfaceOrigin,
1381        _color_type: ColorType,
1382        _color_space: impl Into<Option<ColorSpace>>,
1383        _surface_props: Option<&SurfaceProps>,
1384    ) -> Option<Self> {
1385        unimplemented!("This is mocked")
1386    }
1387}
1388
1389pub struct ColorSpace;
1390
1391#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
1392#[repr(i32)]
1393pub enum ColorType {
1394    RGBA8888 = 4,
1395}
1396
1397pub struct SurfaceProps;
1398
1399use std::ops::{Deref, DerefMut};
1400
1401pub struct RecordingContext;
1402
1403#[repr(i32)]
1404#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1405pub enum SurfaceOrigin {
1406    TopLeft = 0,
1407    BottomLeft = 1,
1408}
1409
1410#[repr(C)]
1411#[derive(Debug)]
1412pub struct ContextOptions;
1413
1414pub struct DirectContext;
1415
1416impl From<DirectContext> for RecordingContext {
1417    fn from(_direct_context: DirectContext) -> Self {
1418        unimplemented!("This is mocked")
1419    }
1420}
1421
1422impl Deref for DirectContext {
1423    type Target = RecordingContext;
1424
1425    fn deref(&self) -> &Self::Target {
1426        unimplemented!("This is mocked")
1427    }
1428}
1429
1430impl DerefMut for DirectContext {
1431    fn deref_mut(&mut self) -> &mut Self::Target {
1432        unimplemented!("This is mocked")
1433    }
1434}
1435
1436impl DirectContext {
1437    pub fn new_gl<'a>(
1438        _interface: impl Into<Option<Interface>>,
1439        _options: impl Into<Option<&'a ContextOptions>>,
1440    ) -> Option<DirectContext> {
1441        unimplemented!("This is mocked")
1442    }
1443
1444    pub fn flush_and_submit(&self) {
1445        unimplemented!("This is mocked")
1446    }
1447
1448    pub fn abandon(&self) {
1449        unimplemented!("This is mocked")
1450    }
1451}
1452
1453use std::ffi::c_void;
1454
1455#[repr(u8)]
1456#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1457pub enum Protected {
1458    No,
1459    Yes,
1460}
1461
1462#[derive(Copy, Clone, PartialEq, Eq, Debug)]
1463#[repr(C)]
1464pub struct FramebufferInfo {
1465    pub fboid: i32,
1466    pub format: Format,
1467    pub protected: Protected,
1468}
1469
1470impl Default for FramebufferInfo {
1471    fn default() -> Self {
1472        unimplemented!("This is mocked")
1473    }
1474}
1475
1476pub fn wrap_backend_render_target(
1477    context: &mut RecordingContext,
1478    backend_render_target: &BackendRenderTarget,
1479    origin: SurfaceOrigin,
1480    color_type: ColorType,
1481    color_space: impl Into<Option<ColorSpace>>,
1482    surface_props: Option<&SurfaceProps>,
1483) -> Option<Surface> {
1484    unimplemented!("This is mocked")
1485}
1486
1487pub struct Interface;
1488
1489impl Interface {
1490    pub fn new_load_with<F>(_load_fn: F) -> Option<Self>
1491    where
1492        F: FnMut(&str) -> *const c_void,
1493    {
1494        unimplemented!("This is mocked")
1495    }
1496}
1497
1498#[repr(i32)]
1499#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1500pub enum Format {
1501    Unknown = 0,
1502    RGBA8 = 1,
1503    R8 = 2,
1504    ALPHA8 = 3,
1505    LUMINANCE8 = 4,
1506    LUMINANCE8_ALPHA8 = 5,
1507    BGRA8 = 6,
1508    RGB565 = 7,
1509    RGBA16F = 8,
1510    R16F = 9,
1511    RGB8 = 10,
1512    RGBX8 = 11,
1513    RG8 = 12,
1514    RGB10_A2 = 13,
1515    RGBA4 = 14,
1516    SRGB8_ALPHA8 = 15,
1517    COMPRESSED_ETC1_RGB8 = 16,
1518    COMPRESSED_RGB8_ETC2 = 17,
1519    COMPRESSED_RGB8_BC1 = 18,
1520    COMPRESSED_RGBA8_BC1 = 19,
1521    R16 = 20,
1522    RG16 = 21,
1523    RGBA16 = 22,
1524    RG16F = 23,
1525    LUMINANCE16F = 24,
1526    STENCIL_INDEX8 = 25,
1527    STENCIL_INDEX16 = 26,
1528    DEPTH24_STENCIL8 = 27,
1529}
1530
1531pub struct BackendRenderTarget;
1532
1533impl BackendRenderTarget {
1534    pub fn new_gl(
1535        (_width, _height): (i32, i32),
1536        _sample_count: impl Into<Option<usize>>,
1537        _stencil_bits: usize,
1538        _info: FramebufferInfo,
1539    ) -> Self {
1540        unimplemented!("This is mocked")
1541    }
1542}
1543
1544pub mod backend_render_targets {
1545    use crate::prelude::*;
1546    pub fn make_gl(
1547        (width, height): (i32, i32),
1548        sample_count: impl Into<Option<usize>>,
1549        stencil_bits: usize,
1550        info: FramebufferInfo,
1551    ) -> BackendRenderTarget {
1552        unimplemented!("This is mocked")
1553    }
1554}
1555
1556pub fn set_resource_cache_total_bytes_limit(new_limit: usize) -> usize {
1557    unimplemented!("This is mocked")
1558}
1559
1560pub fn set_resource_cache_single_allocation_byte_limit(new_limit: Option<usize>) -> Option<usize> {
1561    unimplemented!("This is mocked")
1562}