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(Default, Debug)]
13pub struct SaveLayerRec;
14
15#[derive(Clone, Debug, PartialEq, Copy, Eq)]
16pub struct Color(u32);
17
18impl From<u32> for Color {
19 fn from(argb: u32) -> Self {
20 Color(argb)
21 }
22}
23
24impl Default for Color {
25 fn default() -> Self {
26 unimplemented!("This is mocked")
27 }
28}
29
30impl Color {
31 pub const TRANSPARENT: Self = Color(0);
32 pub const BLACK: Self = Color(4278190080);
33 pub const DARK_GRAY: Self = Color(4282664004);
34 pub const GRAY: Self = Color(4287137928);
35 pub const LIGHT_GRAY: Self = Color(4291611852);
36 pub const WHITE: Self = Color(4294967295);
37 pub const RED: Self = Color(4294901760);
38 pub const GREEN: Self = Color(4278255360);
39 pub const BLUE: Self = Color(4278190335);
40 pub const YELLOW: Self = Color(4294967040);
41 pub const CYAN: Self = Color(4278255615);
42 pub const MAGENTA: Self = Color(4294902015);
43
44 #[inline]
45 pub fn new(_argb: u32) -> Self {
46 unimplemented!("This is mocked")
47 }
48
49 #[inline]
50 pub fn from_argb(_a: u8, _r: u8, _g: u8, _b: u8) -> Color {
51 unimplemented!("This is mocked")
52 }
53
54 #[inline]
55 pub fn from_rgb(_r: u8, _g: u8, _b: u8) -> Color {
56 unimplemented!("This is mocked")
57 }
58
59 #[inline]
60 pub fn a(self) -> u8 {
61 unimplemented!("This is mocked")
62 }
63
64 #[inline]
65 pub fn r(self) -> u8 {
66 unimplemented!("This is mocked")
67 }
68
69 #[inline]
70 pub fn g(self) -> u8 {
71 unimplemented!("This is mocked")
72 }
73
74 #[inline]
75 pub fn b(self) -> u8 {
76 unimplemented!("This is mocked")
77 }
78
79 #[inline]
80 #[must_use]
81 pub fn with_a(self, _a: u8) -> Self {
82 unimplemented!("This is mocked")
83 }
84
85 #[inline]
86 pub fn to_rgb(self) -> RGB {
87 unimplemented!("This is mocked")
88 }
89
90 #[inline]
91 pub fn to_hsv(self) -> HSV {
92 unimplemented!("This is mocked")
93 }
94}
95
96#[derive(Copy, Clone, PartialEq, Eq, Debug)]
97pub struct RGB {
98 pub r: u8,
99 pub g: u8,
100 pub b: u8,
101}
102
103impl From<(u8, u8, u8)> for RGB {
104 fn from(_rgb: (u8, u8, u8)) -> Self {
105 unimplemented!("This is mocked")
106 }
107}
108
109#[derive(Copy, Clone, PartialEq, Debug)]
110pub struct HSV {
111 pub h: f32,
112 pub s: f32,
113 pub v: f32,
114}
115
116impl From<(f32, f32, f32)> for HSV {
117 fn from(_hsv: (f32, f32, f32)) -> Self {
118 unimplemented!("This is mocked")
119 }
120}
121
122impl HSV {
123 pub fn to_color(self, _alpha: u8) -> Color {
124 unimplemented!("This is mocked")
125 }
126}
127
128pub enum GradientShaderColors<'a> {
129 Colors(&'a [Color]),
130 }
132
133pub struct Shader;
134
135impl Shader {
136 pub fn linear_gradient<'a>(
137 _points: (impl Into<Point>, impl Into<Point>),
138 _colors: impl Into<GradientShaderColors<'a>>,
139 _pos: impl Into<Option<&'a [f32]>>,
140 _mode: TileMode,
141 _flags: impl Into<Option<GradientFlags>>,
142 _local_matrix: impl Into<Option<&'a Matrix>>,
143 ) -> Option<Self> {
144 unimplemented!("This is mocked")
145 }
146
147 pub fn radial_gradient<'a>(
148 _center: impl Into<Point>,
149 _radius: f32,
150 _colors: impl Into<GradientShaderColors<'a>>,
151 _pos: impl Into<Option<&'a [f32]>>,
152 _mode: TileMode,
153 _flags: impl Into<Option<GradientFlags>>,
154 _local_matrix: impl Into<Option<&'a Matrix>>,
155 ) -> Option<Self> {
156 unimplemented!("This is mocked")
157 }
158
159 pub fn sweep_gradient<'a>(
160 _center: impl Into<Point>,
161 _colors: impl Into<GradientShaderColors<'a>>,
162 _pos: impl Into<Option<&'a [f32]>>,
163 _mode: TileMode,
164 _angles: impl Into<Option<(f32, f32)>>,
165 _flags: impl Into<Option<GradientFlags>>,
166 _local_matrix: impl Into<Option<&'a Matrix>>,
167 ) -> Option<Self> {
168 unimplemented!("This is mocked")
169 }
170}
171
172pub enum TileMode {
173 Clamp = 0,
174 Repeat = 1,
175 Mirror = 2,
176 Decal = 3,
177}
178
179bitflags! {
180 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
181 pub struct GradientFlags: u32 {
182 const INTERPOLATE_COLORS_IN_PREMUL = 1;
183 }
184}
185
186#[repr(C)]
187#[derive(Copy, Clone, Debug)]
188pub struct Matrix {
189 mat: [f32; 9usize],
190 type_mask: u32,
191}
192
193impl Matrix {
194 pub fn new_identity() -> Self {
195 unimplemented!("This is mocked")
196 }
197
198 pub fn set_rotate(&mut self, _degrees: f32, _pivot: impl Into<Option<Point>>) -> &mut Self {
199 unimplemented!("This is mocked")
200 }
201
202 pub fn rotate_deg_pivot(_degrees: f32, _pivot: impl Into<Point>) -> Self {
203 unimplemented!("This is mocked")
204 }
205}
206
207#[repr(C)]
208#[derive(Copy, Clone, PartialEq, Default, Debug)]
209pub struct Point {
210 pub x: f32,
211 pub y: f32,
212}
213
214impl Point {
215 pub fn new(_: f32, _: f32) -> Self {
216 unimplemented!("This is mocked")
217 }
218}
219
220impl Neg for Point {
221 type Output = Point;
222 fn neg(self) -> Self::Output {
223 Point::new(-self.x, -self.y)
224 }
225}
226
227impl Add for Point {
228 type Output = Point;
229 fn add(self, rhs: Self) -> Self {
230 Point::new(self.x + rhs.x, self.y + rhs.y)
231 }
232}
233
234impl Sub for Point {
235 type Output = Point;
236 fn sub(self, rhs: Self) -> Self {
237 Point::new(self.x - rhs.x, self.y - rhs.y)
238 }
239}
240impl Mul<f32> for Point {
241 type Output = Self;
242 fn mul(self, rhs: f32) -> Self {
243 Self::new(self.x * rhs, self.y * rhs)
244 }
245}
246
247impl MulAssign<f32> for Point {
248 fn mul_assign(&mut self, rhs: f32) {
249 self.x *= rhs;
250 self.y *= rhs;
251 }
252}
253
254impl Div<f32> for Point {
255 type Output = Self;
256 fn div(self, rhs: f32) -> Self {
257 Self::new(self.x / rhs, self.y / rhs)
258 }
259}
260
261impl DivAssign<f32> for Point {
262 fn div_assign(&mut self, rhs: f32) {
263 self.x /= rhs;
264 self.y /= rhs;
265 }
266}
267
268#[repr(C)]
269#[derive(Copy, Clone, Debug, PartialEq)]
270pub struct TextShadow {
271 pub color: Color,
272 pub offset: Point,
273 pub blur_sigma: f64,
274}
275
276impl Default for TextShadow {
277 fn default() -> Self {
278 unimplemented!("This is mocked")
279 }
280}
281
282impl TextShadow {
283 pub fn new(color: Color, _: (f32, f32), _: f32) -> Self {
284 unimplemented!("This is mocked")
285 }
286}
287
288impl From<(f32, f32)> for Point {
289 fn from(source: (f32, f32)) -> Self {
290 Point::new(source.0, source.1)
291 }
292}
293
294impl From<(i32, i32)> for Point {
295 fn from(source: (i32, i32)) -> Self {
296 (source.0 as f32, source.1 as f32).into()
297 }
298}
299
300#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
301#[repr(transparent)]
302pub struct Weight(i32);
303
304impl From<i32> for Weight {
305 fn from(weight: i32) -> Self {
306 Self(weight)
307 }
308}
309
310#[allow(non_upper_case_globals)]
311impl Weight {
312 pub const INVISIBLE: Self = Self(0);
313 pub const THIN: Self = Self(100);
314 pub const EXTRA_LIGHT: Self = Self(200);
315 pub const LIGHT: Self = Self(300);
316 pub const NORMAL: Self = Self(400);
317 pub const MEDIUM: Self = Self(500);
318 pub const SEMI_BOLD: Self = Self(600);
319 pub const BOLD: Self = Self(700);
320 pub const EXTRA_BOLD: Self = Self(800);
321 pub const BLACK: Self = Self(900);
322 pub const EXTRA_BLACK: Self = Self(1000);
323}
324
325#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
326pub enum Slant {
327 Upright = 0,
328 Italic = 1,
329 Oblique = 2,
330}
331
332#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
333#[repr(transparent)]
334pub struct Width(i32);
335
336#[allow(non_upper_case_globals)]
337impl Width {
338 pub const ULTRA_CONDENSED: Self = Self(1);
339 pub const EXTRA_CONDENSED: Self = Self(2);
340 pub const CONDENSED: Self = Self(3);
341 pub const SEMI_CONDENSED: Self = Self(4);
342 pub const NORMAL: Self = Self(5);
343 pub const SEMI_EXPANDED: Self = Self(6);
344 pub const EXPANDED: Self = Self(7);
345 pub const EXTRA_EXPANDED: Self = Self(8);
346 pub const ULTRA_EXPANDED: Self = Self(9);
347}
348
349bitflags! {
350 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
351 pub struct TextDecoration: u32 {
352 const NO_DECORATION = 0;
353 const UNDERLINE = 1;
354 const OVERLINE = 2;
355 const LINE_THROUGH = 4;
356 }
357}
358
359impl Default for TextDecoration {
360 fn default() -> Self {
361 TextDecoration::NO_DECORATION
362 }
363}
364
365#[repr(C)]
366#[derive(Copy, Clone, PartialEq, Default, Debug)]
367pub struct Decoration {
368 pub ty: TextDecoration,
369 pub mode: TextDecorationMode,
370 pub color: Color,
371 pub style: TextDecorationStyle,
372 pub thickness_multiplier: f32,
373}
374
375#[repr(C)]
376#[derive(Copy, Clone, PartialEq, Debug, Default)]
377pub enum TextDecorationMode {
378 #[default]
379 Gaps = 0,
380 Through = 1,
381}
382
383#[repr(C)]
384#[derive(Copy, Clone, PartialEq, Debug, Default)]
385pub enum TextDecorationStyle {
386 #[default]
387 Solid = 0,
388 Double = 1,
389 Dotted = 2,
390 Dashed = 3,
391 Wavy = 4,
392}
393
394#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
395pub enum TextAlign {
396 #[default]
397 Left = 0,
398 Right = 1,
399 Center = 2,
400 Justify = 3,
401 Start = 4,
402 End = 5,
403}
404
405#[derive(Default)]
406pub struct TextStyle;
407
408impl TextStyle {
409 pub fn new() -> Self {
410 unimplemented!("This is mocked")
411 }
412
413 #[deprecated(since = "0.51.0", note = "Use clone_for_placeholder")]
414 #[must_use]
415 pub fn to_placeholder(&self) -> Self {
416 unimplemented!("This is mocked")
417 }
418
419 #[must_use]
420 pub fn clone_for_placeholder(&self) -> Self {
421 unimplemented!("This is mocked")
422 }
423
424 pub fn equals(&self, _other: &TextStyle) -> bool {
425 unimplemented!("This is mocked")
426 }
427
428 pub fn equals_by_fonts(&self, _that: &TextStyle) -> bool {
429 unimplemented!("This is mocked")
430 }
431
432 pub fn color(&self) -> Color {
433 unimplemented!("This is mocked")
434 }
435
436 pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self {
437 unimplemented!("This is mocked")
438 }
439
440 pub fn foreground(&self) -> Paint {
441 unimplemented!("This is mocked")
442 }
443
444 pub fn set_foreground_color(&mut self, _paint: &Paint) -> &mut Self {
445 unimplemented!("This is mocked")
446 }
447
448 pub fn clear_foreground_color(&mut self) -> &mut Self {
449 unimplemented!("This is mocked")
450 }
451
452 pub fn background(&self) -> Paint {
453 unimplemented!("This is mocked")
454 }
455
456 pub fn set_background_color(&mut self, _paint: &Paint) -> &mut Self {
457 unimplemented!("This is mocked")
458 }
459
460 pub fn clear_background_color(&mut self) -> &mut Self {
461 unimplemented!("This is mocked")
462 }
463
464 pub fn decoration(&self) -> &Decoration {
465 unimplemented!("This is mocked")
466 }
467
468 pub fn set_decoration(&mut self, decoration: &Decoration) {
469 unimplemented!("This is mocked")
470 }
471
472 pub fn set_decoration_type(&mut self, decoration: TextDecoration) {
473 unimplemented!("This is mocked")
474 }
475
476 pub fn set_decoration_mode(&mut self, mode: TextDecorationMode) {
477 unimplemented!("This is mocked")
478 }
479
480 pub fn set_decoration_style(&mut self, style: TextDecorationStyle) {
481 unimplemented!("This is mocked")
482 }
483
484 pub fn set_decoration_color(&mut self, color: impl Into<Color>) {
485 unimplemented!("This is mocked")
486 }
487
488 pub fn font_style(&self) -> FontStyle {
489 unimplemented!("This is mocked")
490 }
491
492 pub fn set_font_style(&mut self, _font_style: FontStyle) -> &mut Self {
493 unimplemented!("This is mocked")
494 }
495
496 pub fn shadows(&self) -> &[TextShadow] {
497 unimplemented!("This is mocked")
498 }
499
500 pub fn add_shadow(&mut self, _shadow: TextShadow) -> &mut Self {
501 unimplemented!("This is mocked")
502 }
503
504 pub fn reset_shadows(&mut self) -> &mut Self {
505 unimplemented!("This is mocked")
506 }
507
508 pub fn font_features(&self) -> &[FontFeature] {
509 unimplemented!("This is mocked")
510 }
511
512 pub fn add_font_feature(&mut self, _font_feature: impl AsRef<str>, _value: i32) {
513 unimplemented!("This is mocked")
514 }
515
516 pub fn reset_font_features(&mut self) {
517 unimplemented!("This is mocked")
518 }
519
520 pub fn font_size(&self) -> f32 {
521 unimplemented!("This is mocked")
522 }
523
524 pub fn set_font_size(&mut self, _size: f32) -> &mut Self {
525 unimplemented!("This is mocked")
526 }
527
528 pub fn font_families(&self) -> FontFamilies {
529 unimplemented!("This is mocked")
530 }
531
532 pub fn set_font_families(&mut self, _families: &[impl AsRef<str>]) -> &mut Self {
533 unimplemented!("This is mocked")
534 }
535
536 pub fn baseline_shift(&self) -> f32 {
537 unimplemented!("This is mocked")
538 }
539
540 pub fn set_baseline_shift(&mut self, _baseline_shift: f32) -> &mut Self {
541 unimplemented!("This is mocked")
542 }
543
544 pub fn set_height(&mut self, _height: f32) -> &mut Self {
545 unimplemented!("This is mocked")
546 }
547
548 pub fn height(&self) -> f32 {
549 unimplemented!("This is mocked")
550 }
551
552 pub fn set_height_override(&mut self, _height_override: bool) -> &mut Self {
553 unimplemented!("This is mocked")
554 }
555
556 pub fn height_override(&self) -> bool {
557 unimplemented!("This is mocked")
558 }
559
560 pub fn set_half_leading(&mut self, _half_leading: bool) -> &mut Self {
561 unimplemented!("This is mocked")
562 }
563
564 pub fn half_leading(&self) -> bool {
565 unimplemented!("This is mocked")
566 }
567
568 pub fn set_letter_spacing(&mut self, _letter_spacing: f32) -> &mut Self {
569 unimplemented!("This is mocked")
570 }
571
572 pub fn letter_spacing(&self) -> f32 {
573 unimplemented!("This is mocked")
574 }
575
576 pub fn set_word_spacing(&mut self, _word_spacing: f32) -> &mut Self {
577 unimplemented!("This is mocked")
578 }
579
580 pub fn word_spacing(&self) -> f32 {
581 unimplemented!("This is mocked")
582 }
583
584 pub fn typeface(&self) -> Option<Typeface> {
585 unimplemented!("This is mocked")
586 }
587
588 pub fn set_typeface(&mut self, _typeface: impl Into<Option<Typeface>>) -> &mut Self {
589 unimplemented!("This is mocked")
590 }
591
592 pub fn locale(&self) -> &str {
593 unimplemented!("This is mocked")
594 }
595
596 pub fn set_locale(&mut self, _locale: impl AsRef<str>) -> &mut Self {
597 unimplemented!("This is mocked")
598 }
599
600 pub fn text_baseline(&self) -> TextBaseline {
601 unimplemented!("This is mocked")
602 }
603
604 pub fn set_text_baseline(&mut self, _baseline: TextBaseline) -> &mut Self {
605 unimplemented!("This is mocked")
606 }
607
608 pub fn font_metrics(&self) -> FontMetrics {
609 unimplemented!("This is mocked")
610 }
611
612 pub fn is_placeholder(&self) -> bool {
613 unimplemented!("This is mocked")
614 }
615
616 pub fn set_placeholder(&mut self) -> &mut Self {
617 unimplemented!("This is mocked")
618 }
619
620 pub fn set_height_behavior(&mut self, behavior: TextHeightBehavior) {
621 unimplemented!("This is mocked")
622 }
623}
624
625#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
626pub enum TextHeightBehavior {
627 All = 0,
628 DisableFirstAscent = 1,
629 DisableLastDescent = 2,
630 DisableAll = 3,
631}
632
633pub struct Typeface;
634
635#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
636pub enum TextBaseline {
637 Alphabetic = 0,
638 Ideographic = 1,
639}
640
641pub struct FontFamilies;
642
643#[derive(Default, Clone)]
644pub struct Paint;
645
646impl Paint {
647 pub fn set_anti_alias(&mut self, _anti_alias: bool) -> &mut Self {
648 unimplemented!("This is mocked")
649 }
650
651 pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self {
652 unimplemented!("This is mocked")
653 }
654
655 pub fn set_blend_mode(&mut self, _mode: BlendMode) -> &mut Self {
656 unimplemented!("This is mocked")
657 }
658
659 pub fn set_style(&mut self, _style: PaintStyle) -> &mut Self {
660 unimplemented!("This is mocked")
661 }
662
663 pub fn set_shader(&mut self, _shader: impl Into<Option<Shader>>) -> &mut Self {
664 unimplemented!("This is mocked")
665 }
666
667 pub fn set_stroke_width(&mut self, _width: f32) -> &mut Self {
668 unimplemented!("This is mocked")
669 }
670
671 pub fn set_mask_filter(&mut self, _mask_filter: impl Into<Option<MaskFilter>>) -> &mut Self {
672 unimplemented!("This is mocked")
673 }
674}
675
676pub enum PaintStyle {
677 Fill = 0,
678 Stroke = 1,
679 StrokeAndFill = 2,
680}
681
682pub struct FontStyle;
683
684impl FontStyle {
685 pub fn new(_weight: Weight, _width: Width, _slant: Slant) -> Self {
686 unimplemented!("This is mocked")
687 }
688}
689
690#[derive(Default, Clone)]
691pub struct FontMgr;
692
693impl FontMgr {
694 pub fn new_from_data(
695 &self,
696 _bytes: &[u8],
697 _ttc_index: impl Into<Option<usize>>,
698 ) -> Option<Typeface> {
699 unimplemented!("This is mocked")
700 }
701}
702
703pub struct FontFeature;
704
705pub struct TypefaceFontProvider;
706
707impl TypefaceFontProvider {
708 pub fn new() -> Self {
709 unimplemented!("This is mocked")
710 }
711
712 pub fn register_typeface(
713 &mut self,
714 _typeface: Typeface,
715 _alias: Option<impl AsRef<str>>,
716 ) -> usize {
717 unimplemented!("This is mocked")
718 }
719}
720
721impl From<TypefaceFontProvider> for FontMgr {
722 fn from(_provider: TypefaceFontProvider) -> Self {
723 unimplemented!("This is mocked")
724 }
725}
726
727#[derive(Clone)]
728pub struct FontCollection;
729
730impl FontCollection {
731 pub fn new() -> Self {
732 unimplemented!("This is mocked")
733 }
734
735 pub fn set_default_font_manager<'a>(
736 &mut self,
737 _font_manager: impl Into<Option<FontMgr>>,
738 _default_family_name: impl Into<Option<&'a str>>,
739 ) {
740 unimplemented!("This is mocked")
741 }
742
743 pub fn set_dynamic_font_manager(&mut self, _font_manager: impl Into<Option<FontMgr>>) {
744 unimplemented!("This is mocked")
745 }
746}
747
748pub struct Paragraph;
749
750impl Paragraph {
751 pub fn max_width(&self) -> f32 {
752 unimplemented!("This is mocked")
753 }
754
755 pub fn height(&self) -> f32 {
756 unimplemented!("This is mocked")
757 }
758
759 pub fn min_intrinsic_width(&self) -> f32 {
760 unimplemented!("This is mocked")
761 }
762
763 pub fn max_intrinsic_width(&self) -> f32 {
764 unimplemented!("This is mocked")
765 }
766
767 pub fn alphabetic_baseline(&self) -> f32 {
768 unimplemented!("This is mocked")
769 }
770
771 pub fn ideographic_baseline(&self) -> f32 {
772 unimplemented!("This is mocked")
773 }
774
775 pub fn longest_line(&self) -> f32 {
776 unimplemented!("This is mocked")
777 }
778
779 pub fn did_exceed_max_lines(&self) -> bool {
780 unimplemented!("This is mocked")
781 }
782
783 pub fn layout(&mut self, _width: f32) {
784 unimplemented!("This is mocked")
785 }
786
787 pub fn paint(&self, _canvas: &Canvas, _p: impl Into<Point>) {
788 unimplemented!("This is mocked")
789 }
790
791 pub fn get_rects_for_range(
794 &self,
795 _range: Range<usize>,
796 _rect_height_style: RectHeightStyle,
797 _rect_width_style: RectWidthStyle,
798 ) -> Vec<TextBox> {
799 unimplemented!("This is mocked")
800 }
801
802 pub fn get_rects_for_placeholders(&self) -> Vec<TextBox> {
803 unimplemented!("This is mocked")
804 }
805
806 pub fn get_glyph_position_at_coordinate(&self, _p: impl Into<Point>) -> PositionWithAffinity {
807 unimplemented!("This is mocked")
808 }
809
810 pub fn get_word_boundary(&self, _offset: u32) -> Range<usize> {
811 unimplemented!("This is mocked")
812 }
813
814 pub fn get_line_metrics(&self) -> Vec<LineMetrics> {
815 unimplemented!("This is mocked")
816 }
817
818 pub fn line_number(&self) -> usize {
819 unimplemented!("This is mocked")
820 }
821
822 pub fn mark_dirty(&mut self) {
823 unimplemented!("This is mocked")
824 }
825
826 pub fn unresolved_glyphs(&mut self) -> Option<usize> {
827 unimplemented!("This is mocked")
828 }
829
830 pub fn get_line_number_at(&self, _code_unit_index: usize) -> Option<usize> {
831 unimplemented!("This is mocked")
832 }
833
834 pub fn get_line_metrics_at(&self, _line_number: usize) -> Option<LineMetrics> {
835 unimplemented!("This is mocked")
836 }
837
838 pub fn get_actual_text_range(
839 &self,
840 _line_number: usize,
841 _include_spaces: bool,
842 ) -> Range<usize> {
843 unimplemented!("This is mocked")
844 }
845
846 pub fn get_glyph_cluster_at(&self, _code_unit_index: usize) -> Option<GlyphClusterInfo> {
847 unimplemented!("This is mocked")
848 }
849
850 pub fn get_closest_glyph_cluster_at(&self, _d: impl Into<Point>) -> Option<GlyphClusterInfo> {
851 unimplemented!("This is mocked")
852 }
853
854 pub fn get_font_at(&self, _code_unit_index: usize) -> Font {
855 unimplemented!("This is mocked")
856 }
857
858 pub fn get_fonts(&self) -> Vec<FontInfo> {
859 unimplemented!("This is mocked")
860 }
861}
862
863#[derive(Default)]
864pub struct ParagraphStyle;
865
866impl ParagraphStyle {
867 pub fn new() -> Self {
868 unimplemented!("This is mocked")
869 }
870
871 pub fn strut_style(&self) -> &StrutStyle {
872 unimplemented!("This is mocked")
873 }
874
875 pub fn set_strut_style(&mut self, _strut_style: StrutStyle) -> &mut Self {
876 unimplemented!("This is mocked")
877 }
878
879 pub fn text_style(&self) -> &TextStyle {
880 unimplemented!("This is mocked")
881 }
882
883 pub fn set_text_style(&mut self, _text_style: &TextStyle) -> &mut Self {
884 unimplemented!("This is mocked")
885 }
886
887 pub fn text_direction(&self) -> TextDirection {
888 unimplemented!("This is mocked")
889 }
890
891 pub fn set_text_direction(&mut self, _direction: TextDirection) -> &mut Self {
892 unimplemented!("This is mocked")
893 }
894
895 pub fn text_align(&self) -> TextAlign {
896 unimplemented!("This is mocked")
897 }
898
899 pub fn set_text_align(&mut self, _align: TextAlign) -> &mut Self {
900 unimplemented!("This is mocked")
901 }
902
903 pub fn max_lines(&self) -> Option<usize> {
904 unimplemented!("This is mocked")
905 }
906
907 pub fn set_max_lines(&mut self, _lines: impl Into<Option<usize>>) -> &mut Self {
908 unimplemented!("This is mocked")
909 }
910
911 pub fn ellipsis(&self) -> &str {
914 unimplemented!("This is mocked")
915 }
916
917 pub fn set_ellipsis(&mut self, _ellipsis: impl AsRef<str>) -> &mut Self {
918 unimplemented!("This is mocked")
919 }
920
921 pub fn height(&self) -> f32 {
922 unimplemented!("This is mocked")
923 }
924
925 pub fn set_height(&mut self, _height: f32) -> &mut Self {
926 unimplemented!("This is mocked")
927 }
928
929 pub fn text_height_behavior(&self) -> TextHeightBehavior {
930 unimplemented!("This is mocked")
931 }
932
933 pub fn set_text_height_behavior(&mut self, _v: TextHeightBehavior) -> &mut Self {
934 unimplemented!("This is mocked")
935 }
936
937 pub fn unlimited_lines(&self) -> bool {
938 unimplemented!("This is mocked")
939 }
940
941 pub fn ellipsized(&self) -> bool {
942 unimplemented!("This is mocked")
943 }
944
945 pub fn effective_align(&self) -> TextAlign {
946 unimplemented!("This is mocked")
947 }
948
949 pub fn hinting_is_on(&self) -> bool {
950 unimplemented!("This is mocked")
951 }
952
953 pub fn turn_hinting_off(&mut self) -> &mut Self {
954 unimplemented!("This is mocked")
955 }
956
957 pub fn replace_tab_characters(&self) -> bool {
958 unimplemented!("This is mocked")
959 }
960
961 pub fn set_replace_tab_characters(&mut self, _value: bool) -> &mut Self {
962 unimplemented!("This is mocked")
963 }
964}
965
966pub struct ParagraphBuilder;
967
968impl ParagraphBuilder {
969 pub fn push_style(&mut self, _style: &TextStyle) -> &mut Self {
970 unimplemented!("This is mocked")
971 }
972
973 pub fn pop(&mut self) -> &mut Self {
974 unimplemented!("This is mocked")
975 }
976
977 pub fn peek_style(&mut self) -> TextStyle {
978 unimplemented!("This is mocked")
979 }
980
981 pub fn add_text(&mut self, _str: impl AsRef<str>) -> &mut Self {
982 unimplemented!("This is mocked")
983 }
984
985 pub fn add_placeholder(&mut self, _placeholder_style: &PlaceholderStyle) -> &mut Self {
986 unimplemented!("This is mocked")
987 }
988
989 pub fn build(&mut self) -> Paragraph {
990 unimplemented!("This is mocked")
991 }
992
993 pub fn reset(&mut self) {
994 unimplemented!("This is mocked")
995 }
996
997 pub fn new(_style: &ParagraphStyle, _font_collection: impl Into<FontCollection>) -> Self {
998 unimplemented!("This is mocked")
999 }
1000}
1001
1002impl From<&FontCollection> for FontCollection {
1003 fn from(value: &FontCollection) -> Self {
1004 value.clone()
1005 }
1006}
1007
1008pub struct StrutStyle;
1009
1010#[repr(i32)]
1011#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1012pub enum TextDirection {
1013 RTL = 0,
1014 LTR = 1,
1015}
1016
1017pub struct PlaceholderStyle;
1018
1019pub struct Canvas;
1020
1021impl Canvas {
1022 pub fn save(&self) -> usize {
1023 unimplemented!("This is mocked")
1024 }
1025
1026 pub fn restore(&self) {
1027 unimplemented!("This is mocked")
1028 }
1029
1030 pub fn restore_to_count(&self, layer: usize) {
1031 unimplemented!("This is mocked")
1032 }
1033
1034 pub fn concat(&self, _matrix: &Matrix) {
1035 unimplemented!("This is mocked")
1036 }
1037
1038 pub fn clip_rect(&self, _rect: Rect, _clip: ClipOp, _: bool) {
1039 unimplemented!("This is mocked")
1040 }
1041
1042 pub fn clip_rrect(&self, _rect: RRect, _clip: ClipOp, _: bool) {
1043 unimplemented!("This is mocked")
1044 }
1045
1046 pub fn draw_image_nine(
1047 &self,
1048 _image: Image,
1049 _center: IRect,
1050 _dst: Rect,
1051 _filter_mode: FilterMode,
1052 _paint: Option<&Paint>,
1053 ) -> &Self {
1054 unimplemented!("This is mocked")
1055 }
1056
1057 pub fn draw_image_rect(
1058 &self,
1059 image: impl AsRef<Image>,
1060 src: Option<(&Rect, SrcRectConstraint)>,
1061 dst: impl AsRef<Rect>,
1062 paint: &Paint,
1063 ) -> &Self {
1064 unimplemented!("This is mocked")
1065 }
1066
1067 pub fn draw_image_rect_with_sampling_options(
1068 &self,
1069 image: impl AsRef<Image>,
1070 src: Option<(&Rect, SrcRectConstraint)>,
1071 dst: impl AsRef<Rect>,
1072 sampling_options: impl Into<SamplingOptions>,
1073 paint: &Paint,
1074 ) -> &Self {
1075 unimplemented!("This is mocked")
1076 }
1077
1078 pub fn draw_rect(&self, _rect: Rect, _paint: &Paint) -> &Self {
1079 unimplemented!("This is mocked")
1080 }
1081
1082 pub fn draw_drrect(
1083 &self,
1084 outer: impl AsRef<RRect>,
1085 inner: impl AsRef<RRect>,
1086 paint: &Paint,
1087 ) -> &Self {
1088 unimplemented!("This is mocked")
1089 }
1090
1091 pub fn draw_path(&self, _path: &Path, _paint: &Paint) -> &Self {
1092 unimplemented!("This is mocked")
1093 }
1094
1095 pub fn clip_path(
1096 &self,
1097 _path: &Path,
1098 _op: impl Into<Option<ClipOp>>,
1099 _do_anti_alias: impl Into<Option<bool>>,
1100 ) -> &Self {
1101 unimplemented!("This is mocked")
1102 }
1103
1104 pub fn translate(&self, _d: impl Into<Point>) -> &Self {
1105 unimplemented!("This is mocked")
1106 }
1107
1108 pub fn scale(&self, _: impl Into<Point>) {
1109 unimplemented!("This is mocked")
1110 }
1111
1112 pub fn clear(&self, _: Color) {
1113 unimplemented!("This is mocked")
1114 }
1115
1116 pub fn draw_paint(&self, _: &Paint) -> &Self {
1117 unimplemented!("This is mocked")
1118 }
1119
1120 pub fn draw_line(&self, _p1: impl Into<Point>, _p2: impl Into<Point>, _paint: &Paint) -> &Self {
1121 unimplemented!("This is mocked")
1122 }
1123
1124 pub fn draw_circle(&self, _center: impl Into<Point>, _radius: f32, _paint: &Paint) -> &Self {
1125 unimplemented!("This is mocked")
1126 }
1127
1128 pub fn save_layer(&self, layer_rec: &SaveLayerRec) -> usize {
1129 unimplemented!("This is mocked")
1130 }
1131
1132 pub fn save_layer_alpha_f(&self, bounds: impl Into<Option<Rect>>, alpha: f32) -> usize {
1133 unimplemented!("This is mocked")
1134 }
1135}
1136
1137pub enum SrcRectConstraint {
1138 Strict = 0,
1139 Fast = 1,
1140}
1141
1142#[derive(Default)]
1143pub struct SamplingOptions;
1144
1145impl SamplingOptions {
1146 pub fn new(filter_mode: FilterMode, mm: MipmapMode) -> Self {
1147 unimplemented!("This is mocked")
1148 }
1149}
1150
1151pub struct CubicResampler;
1152
1153impl CubicResampler {
1154 pub fn mitchell() -> Self {
1155 unimplemented!("This is mocked")
1156 }
1157
1158 pub fn catmull_rom() -> Self {
1159 unimplemented!("This is mocked")
1160 }
1161}
1162
1163impl From<CubicResampler> for SamplingOptions {
1164 fn from(_: CubicResampler) -> Self {
1165 unimplemented!("This is mocked")
1166 }
1167}
1168
1169#[repr(i32)]
1170#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
1171pub enum RectHeightStyle {
1172 #[default]
1174 Tight,
1175 Max,
1178 IncludeLineSpacingMiddle,
1186 IncludeLineSpacingTop,
1188 IncludeLineSpacingBottom,
1190 Strut,
1191}
1192
1193#[repr(i32)]
1194#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
1195pub enum RectWidthStyle {
1196 #[default]
1199 Tight,
1200 Max,
1203}
1204
1205pub struct LineMetrics;
1206
1207impl LineMetrics {
1208 pub fn get_style_metrics(&self, range: Range<usize>) -> Vec<(usize, &StyleMetrics)> {
1209 unimplemented!("This is mocked")
1210 }
1211}
1212
1213pub struct StyleMetrics {
1214 pub font_metrics: FontMetrics,
1215}
1216
1217pub struct FontMetrics {
1218 pub ascent: f32,
1219 pub descent: f32,
1220}
1221
1222pub struct GlyphClusterInfo;
1223
1224pub struct TextBox {
1225 pub rect: Rect,
1226}
1227
1228pub struct Font;
1229
1230pub struct FontInfo;
1231
1232pub struct PositionWithAffinity {
1233 pub position: i32,
1234}
1235
1236pub struct RuntimeEffect;
1237
1238impl RuntimeEffect {
1239 pub fn uniforms(&self) -> &[Uniform] {
1240 unimplemented!("This is mocked")
1241 }
1242}
1243
1244#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1245pub enum Uniform {
1246 Float = 0,
1247 Float2 = 1,
1248 Float3 = 2,
1249 Float4 = 3,
1250 Float2x2 = 4,
1251 Float3x3 = 5,
1252 Float4x4 = 6,
1253 Int = 7,
1254 Int2 = 8,
1255 Int3 = 9,
1256 Int4 = 10,
1257}
1258
1259impl Uniform {
1260 pub fn name(&self) -> &str {
1261 unimplemented!("This is mocked")
1262 }
1263}
1264
1265#[repr(i32)]
1266#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1267pub enum ClipOp {
1268 Difference = 0,
1269 Intersect = 1,
1270}
1271
1272#[repr(C)]
1273#[derive(Copy, Clone, PartialEq, Default, Debug)]
1274pub struct Rect {
1275 pub left: f32,
1277 pub top: f32,
1279 pub right: f32,
1281 pub bottom: f32,
1283}
1284
1285impl AsRef<Rect> for Rect {
1286 fn as_ref(&self) -> &Rect {
1287 self
1288 }
1289}
1290
1291impl Rect {
1292 pub fn new(_left: f32, _top: f32, _right: f32, _bottom: f32) -> Self {
1293 unimplemented!("This is mocked")
1294 }
1295
1296 pub fn x(&self) -> f32 {
1297 unimplemented!("This is mocked")
1298 }
1299
1300 pub fn y(&self) -> f32 {
1301 unimplemented!("This is mocked")
1302 }
1303
1304 pub fn width(&self) -> f32 {
1305 unimplemented!("This is mocked")
1306 }
1307
1308 pub fn height(&self) -> f32 {
1309 unimplemented!("This is mocked")
1310 }
1311
1312 pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1313 unimplemented!("This is mocked")
1314 }
1315
1316 pub fn round_in(&self) -> IRect {
1317 unimplemented!("This is mocked")
1318 }
1319}
1320
1321#[derive(Clone, Debug)]
1322pub struct Image;
1323
1324impl AsRef<Image> for Image {
1325 fn as_ref(&self) -> &Image {
1326 self
1327 }
1328}
1329
1330impl Image {
1331 pub fn from_encoded(_data: Data) -> Option<Self> {
1332 unimplemented!("This is mocked")
1333 }
1334
1335 pub fn width(&self) -> i32 {
1336 unimplemented!("This is mocked")
1337 }
1338
1339 pub fn height(&self) -> i32 {
1340 unimplemented!("This is mocked")
1341 }
1342
1343 pub fn encode<'a>(
1344 &self,
1345 context: impl Into<Option<&'a mut DirectContext>>,
1346 format: EncodedImageFormat,
1347 quality: impl Into<Option<u32>>,
1348 ) -> Option<Data> {
1349 unimplemented!("This is mocked")
1350 }
1351}
1352
1353pub struct Data;
1354
1355impl Data {
1356 pub fn new_copy(_bytes: &[u8]) -> Self {
1357 unimplemented!("This is mocked")
1358 }
1359
1360 pub unsafe fn new_bytes(_bytes: &[u8]) -> Self {
1361 unimplemented!("This is mocked")
1362 }
1363}
1364
1365impl Deref for Data {
1366 type Target = [u8];
1367 fn deref(&self) -> &Self::Target {
1368 unimplemented!("This is mocked")
1369 }
1370}
1371
1372#[repr(C)]
1373#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
1374pub struct IRect {
1375 pub left: i32,
1377 pub top: i32,
1379 pub right: i32,
1381 pub bottom: i32,
1383}
1384
1385impl IRect {
1386 pub fn new(_left: i32, _top: i32, _right: i32, _bottom: i32) -> Self {
1387 unimplemented!("This is mocked")
1388 }
1389}
1390
1391impl From<IRect> for Rect {
1392 fn from(irect: IRect) -> Self {
1393 unimplemented!("This is mocked")
1394 }
1395}
1396
1397#[repr(i32)]
1398#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1399pub enum FilterMode {
1400 Nearest = 0,
1401 Linear = 1,
1402}
1403
1404impl FilterMode {
1405 pub const Last: FilterMode = FilterMode::Linear;
1406}
1407
1408#[repr(i32)]
1409#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1410pub enum MipmapMode {
1411 None = 0,
1412 Nearest = 1,
1413 Linear = 2,
1414}
1415
1416impl MipmapMode {
1417 pub const Last: MipmapMode = MipmapMode::Linear;
1418}
1419
1420pub struct Path;
1421
1422impl Path {
1423 pub fn new() -> Self {
1424 unimplemented!("This is mocked")
1425 }
1426
1427 pub fn bounds(&self) -> &Rect {
1428 unimplemented!("This is mocked")
1429 }
1430
1431 pub fn add_path(
1432 &mut self,
1433 _src: &Path,
1434 _d: impl Into<Point>,
1435 _mode: Option<&PathAddPathMode>,
1436 ) -> &mut Self {
1437 unimplemented!("This is mocked")
1438 }
1439
1440 pub fn move_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1441 unimplemented!("This is mocked")
1442 }
1443
1444 pub fn line_to(&mut self, _p: impl Into<Point>) -> &mut Self {
1445 unimplemented!("This is mocked")
1446 }
1447
1448 pub fn cubic_to(
1449 &mut self,
1450 _p1: impl Into<Point>,
1451 _p2: impl Into<Point>,
1452 _p3: impl Into<Point>,
1453 ) -> &mut Self {
1454 unimplemented!("This is mocked")
1455 }
1456
1457 pub fn r_arc_to_rotated(
1458 &mut self,
1459 _r: impl Into<Point>,
1460 _x_axis_rotate: f32,
1461 _large_arc: ArcSize,
1462 _sweep: PathDirection,
1463 _d: impl Into<Point>,
1464 ) -> &mut Self {
1465 unimplemented!("This is mocked")
1466 }
1467
1468 pub fn close(&self) {
1469 unimplemented!("This is mocked")
1470 }
1471
1472 pub fn add_rrect(
1473 &mut self,
1474 _rrect: impl AsRef<RRect>,
1475 _dir_start: Option<(PathDirection, usize)>,
1476 ) -> &mut Self {
1477 unimplemented!("This is mocked")
1478 }
1479
1480 pub fn offset(&mut self, _d: impl Into<Point>) -> &mut Self {
1481 unimplemented!("This is mocked")
1482 }
1483
1484 pub fn set_fill_type(&mut self, _ft: PathFillType) -> &mut Self {
1485 unimplemented!("This is mocked")
1486 }
1487}
1488
1489#[repr(i32)]
1490#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1491pub enum PathAddPathMode {
1492 Append = 0,
1493 Extend = 1,
1494}
1495
1496#[derive(Copy, Clone)]
1497#[repr(transparent)]
1498pub struct RRect;
1499
1500impl AsRef<RRect> for RRect {
1501 fn as_ref(&self) -> &RRect {
1502 self
1503 }
1504}
1505
1506impl RRect {
1507 pub fn new_rect_radii(_rect: Rect, _radii: &[Point; 4]) -> Self {
1508 unimplemented!("This is mocked")
1509 }
1510
1511 pub fn rect(&self) -> &Rect {
1512 unimplemented!("This is mocked")
1513 }
1514
1515 pub fn bounds(&self) -> &Rect {
1516 unimplemented!("This is mocked")
1517 }
1518
1519 pub fn width(&self) -> f32 {
1520 unimplemented!("This is mocked")
1521 }
1522
1523 pub fn height(&self) -> f32 {
1524 unimplemented!("This is mocked")
1525 }
1526
1527 pub fn radii(&self, _corner: Corner) -> Point {
1528 unimplemented!("This is mocked")
1529 }
1530
1531 pub fn with_outset(&self, _delta: impl Into<Point>) -> Self {
1532 unimplemented!("This is mocked")
1533 }
1534
1535 pub fn contains(&self, other: Rect) -> bool {
1536 unimplemented!("This is mocked")
1537 }
1538}
1539
1540#[repr(i32)]
1541#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1542pub enum ArcSize {
1543 Small = 0,
1544 Large = 1,
1545}
1546
1547#[repr(i32)]
1548#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1549pub enum Corner {
1550 UpperLeft = 0,
1551 UpperRight = 1,
1552 LowerRight = 2,
1553 LowerLeft = 3,
1554}
1555
1556#[repr(i32)]
1557#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1558pub enum PathFillType {
1559 Winding = 0,
1560 EvenOdd = 1,
1561 InverseWinding = 2,
1562 InverseEvenOdd = 3,
1563}
1564
1565#[repr(i32)]
1566#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1567pub enum PathDirection {
1568 CW = 0,
1569 CCW = 1,
1570}
1571
1572pub struct MaskFilter;
1573
1574impl MaskFilter {
1575 pub fn blur(
1576 _style: BlurStyle,
1577 _sigma: f32,
1578 _respect_ctm: impl Into<Option<bool>>,
1579 ) -> Option<Self> {
1580 unimplemented!("This is mocked")
1581 }
1582}
1583
1584#[repr(i32)]
1585#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1586pub enum BlendMode {
1587 Clear = 0,
1588 Src = 1,
1589 Dst = 2,
1590 SrcOver = 3,
1591 DstOver = 4,
1592 SrcIn = 5,
1593 DstIn = 6,
1594 SrcOut = 7,
1595 DstOut = 8,
1596 SrcATop = 9,
1597 DstATop = 10,
1598 Xor = 11,
1599 Plus = 12,
1600 Modulate = 13,
1601 Screen = 14,
1602 Overlay = 15,
1603 Darken = 16,
1604 Lighten = 17,
1605 ColorDodge = 18,
1606 ColorBurn = 19,
1607 HardLight = 20,
1608 SoftLight = 21,
1609 Difference = 22,
1610 Exclusion = 23,
1611 Multiply = 24,
1612 Hue = 25,
1613 Saturation = 26,
1614 Color = 27,
1615 Luminosity = 28,
1616}
1617
1618impl BlurStyle {
1619 pub const LastEnum: BlurStyle = BlurStyle::Inner;
1620}
1621#[repr(i32)]
1622#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1623pub enum BlurStyle {
1624 Normal = 0,
1625 Solid = 1,
1626 Outer = 2,
1627 Inner = 3,
1628}
1629
1630pub mod svg {
1631 use super::{
1632 Canvas,
1633 Color,
1634 LocalResourceProvider,
1635 Size,
1636 };
1637
1638 pub enum LengthUnit {
1639 Percentage,
1640 }
1641
1642 pub struct Length;
1643
1644 impl Length {
1645 pub fn new(value: f32, unit: LengthUnit) -> Self {
1646 unimplemented!("This is mocked")
1647 }
1648 }
1649
1650 pub struct Paint;
1651
1652 impl Paint {
1653 pub fn none() -> Self {
1654 unimplemented!("This is mocked")
1655 }
1656
1657 pub fn current_color() -> Self {
1658 unimplemented!("This is mocked")
1659 }
1660
1661 pub fn from_color(_color: Color) -> Self {
1662 unimplemented!("This is mocked")
1663 }
1664 }
1665
1666 pub struct SvgNode;
1667
1668 impl SvgNode {
1669 pub fn set_width(&mut self, _width: Length) {
1670 unimplemented!("This is mocked")
1671 }
1672
1673 pub fn set_height(&mut self, _height: Length) {
1674 unimplemented!("This is mocked")
1675 }
1676
1677 pub fn set_color(&mut self, _value: Color) {
1678 unimplemented!("This is mocked")
1679 }
1680
1681 pub fn set_fill(&mut self, _value: Paint) {
1682 unimplemented!("This is mocked")
1683 }
1684
1685 pub fn set_stroke(&mut self, _value: Paint) {
1686 unimplemented!("This is mocked")
1687 }
1688 }
1689
1690 pub struct Dom;
1691
1692 impl Dom {
1693 pub fn from_bytes(_bytes: &[u8], provider: LocalResourceProvider) -> Result<Self, ()> {
1694 unimplemented!("This is mocked")
1695 }
1696
1697 pub fn set_container_size(&mut self, _size: impl Into<Size>) {
1698 unimplemented!("This is mocked")
1699 }
1700
1701 pub fn render(&self, _canvas: &Canvas) {
1702 unimplemented!("This is mocked")
1703 }
1704
1705 pub fn root(&self) -> SvgNode {
1706 unimplemented!("This is mocked")
1707 }
1708 }
1709}
1710
1711#[repr(C)]
1712#[derive(Copy, Clone, PartialEq, Default, Debug)]
1713pub struct Size;
1714
1715impl From<(f32, f32)> for Size {
1716 fn from(_source: (f32, f32)) -> Self {
1717 unimplemented!("This is mocked")
1718 }
1719}
1720
1721impl From<(i32, i32)> for Size {
1722 fn from(_source: (i32, i32)) -> Self {
1723 unimplemented!("This is mocked")
1724 }
1725}
1726
1727pub struct Surface;
1728
1729impl Surface {
1730 pub fn canvas(&mut self) -> &Canvas {
1731 unimplemented!("This is mocked")
1732 }
1733
1734 pub fn image_snapshot(&mut self) -> Image {
1735 unimplemented!("This is mocked")
1736 }
1737
1738 pub fn direct_context(&self) -> Option<DirectContext> {
1739 unimplemented!("This is mocked")
1740 }
1741
1742 pub fn swap_buffers(&self, _: &PossiblyCurrentContext) {
1743 unimplemented!("This is mocked")
1744 }
1745
1746 pub fn from_backend_render_target(
1747 _context: &mut RecordingContext,
1748 _backend_render_target: &BackendRenderTarget,
1749 _origin: SurfaceOrigin,
1750 _color_type: ColorType,
1751 _color_space: impl Into<Option<ColorSpace>>,
1752 _surface_props: Option<&SurfaceProps>,
1753 ) -> Option<Self> {
1754 unimplemented!("This is mocked")
1755 }
1756
1757 pub fn draw(
1758 &self,
1759 canvas: &Canvas,
1760 offset: impl Into<Point>,
1761 sampling: impl Into<SamplingOptions>,
1762 paint: Option<&Paint>,
1763 ) {
1764 unimplemented!("This is mocked")
1765 }
1766
1767 pub fn new_surface_with_dimensions(&mut self, dim: impl Into<ISize>) -> Option<Self> {
1768 unimplemented!("This is mocked")
1769 }
1770}
1771
1772pub struct ISize;
1773
1774impl From<(i32, i32)> for ISize {
1775 fn from(source: (i32, i32)) -> Self {
1776 unimplemented!("This is mocked")
1777 }
1778}
1779
1780pub struct ColorSpace;
1781
1782#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
1783#[repr(i32)]
1784pub enum ColorType {
1785 RGBA8888 = 4,
1786}
1787
1788pub struct SurfaceProps;
1789
1790use std::ops::{
1791 Deref,
1792 DerefMut,
1793};
1794
1795pub struct RecordingContext;
1796
1797#[repr(i32)]
1798#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1799pub enum SurfaceOrigin {
1800 TopLeft = 0,
1801 BottomLeft = 1,
1802}
1803
1804#[repr(C)]
1805#[derive(Debug)]
1806pub struct ContextOptions;
1807
1808pub mod direct_contexts {
1809 use super::{
1810 ContextOptions,
1811 DirectContext,
1812 Interface,
1813 };
1814 pub fn make_gl<'a>(
1815 _interface: impl Into<Option<Interface>>,
1816 _options: impl Into<Option<&'a ContextOptions>>,
1817 ) -> Option<DirectContext> {
1818 unimplemented!("This is mocked")
1819 }
1820}
1821
1822pub struct DirectContext;
1823
1824impl From<DirectContext> for RecordingContext {
1825 fn from(_direct_context: DirectContext) -> Self {
1826 unimplemented!("This is mocked")
1827 }
1828}
1829
1830impl Deref for DirectContext {
1831 type Target = RecordingContext;
1832
1833 fn deref(&self) -> &Self::Target {
1834 unimplemented!("This is mocked")
1835 }
1836}
1837
1838impl DerefMut for DirectContext {
1839 fn deref_mut(&mut self) -> &mut Self::Target {
1840 unimplemented!("This is mocked")
1841 }
1842}
1843
1844impl DirectContext {
1845 pub fn flush_and_submit(&self) {
1846 unimplemented!("This is mocked")
1847 }
1848
1849 pub fn abandon(&self) {
1850 unimplemented!("This is mocked")
1851 }
1852}
1853
1854use std::ffi::c_void;
1855
1856#[repr(u8)]
1857#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1858pub enum Protected {
1859 No,
1860 Yes,
1861}
1862
1863#[derive(Copy, Clone, PartialEq, Eq, Debug)]
1864#[repr(C)]
1865pub struct FramebufferInfo {
1866 pub fboid: i32,
1867 pub format: Format,
1868 pub protected: Protected,
1869}
1870
1871impl Default for FramebufferInfo {
1872 fn default() -> Self {
1873 unimplemented!("This is mocked")
1874 }
1875}
1876
1877pub fn wrap_backend_render_target(
1878 context: &mut RecordingContext,
1879 backend_render_target: &BackendRenderTarget,
1880 origin: SurfaceOrigin,
1881 color_type: ColorType,
1882 color_space: impl Into<Option<ColorSpace>>,
1883 surface_props: Option<&SurfaceProps>,
1884) -> Option<Surface> {
1885 unimplemented!("This is mocked")
1886}
1887
1888pub struct Interface;
1889
1890impl Interface {
1891 pub fn new_load_with<F>(_load_fn: F) -> Option<Self>
1892 where
1893 F: FnMut(&str) -> *const c_void,
1894 {
1895 unimplemented!("This is mocked")
1896 }
1897}
1898
1899#[repr(i32)]
1900#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1901pub enum Format {
1902 Unknown = 0,
1903 RGBA8 = 1,
1904 R8 = 2,
1905 ALPHA8 = 3,
1906 LUMINANCE8 = 4,
1907 LUMINANCE8_ALPHA8 = 5,
1908 BGRA8 = 6,
1909 RGB565 = 7,
1910 RGBA16F = 8,
1911 R16F = 9,
1912 RGB8 = 10,
1913 RGBX8 = 11,
1914 RG8 = 12,
1915 RGB10_A2 = 13,
1916 RGBA4 = 14,
1917 SRGB8_ALPHA8 = 15,
1918 COMPRESSED_ETC1_RGB8 = 16,
1919 COMPRESSED_RGB8_ETC2 = 17,
1920 COMPRESSED_RGB8_BC1 = 18,
1921 COMPRESSED_RGBA8_BC1 = 19,
1922 R16 = 20,
1923 RG16 = 21,
1924 RGBA16 = 22,
1925 RG16F = 23,
1926 LUMINANCE16F = 24,
1927 STENCIL_INDEX8 = 25,
1928 STENCIL_INDEX16 = 26,
1929 DEPTH24_STENCIL8 = 27,
1930}
1931
1932pub struct BackendRenderTarget;
1933
1934impl BackendRenderTarget {
1935 pub fn new_gl(
1936 (_width, _height): (i32, i32),
1937 _sample_count: impl Into<Option<usize>>,
1938 _stencil_bits: usize,
1939 _info: FramebufferInfo,
1940 ) -> Self {
1941 unimplemented!("This is mocked")
1942 }
1943}
1944
1945pub mod backend_render_targets {
1946 use crate::prelude::*;
1947 pub fn make_gl(
1948 (width, height): (i32, i32),
1949 sample_count: impl Into<Option<usize>>,
1950 stencil_bits: usize,
1951 info: FramebufferInfo,
1952 ) -> BackendRenderTarget {
1953 unimplemented!("This is mocked")
1954 }
1955}
1956
1957pub fn set_resource_cache_total_bytes_limit(new_limit: usize) -> usize {
1958 unimplemented!("This is mocked")
1959}
1960
1961pub fn set_resource_cache_single_allocation_byte_limit(new_limit: Option<usize>) -> Option<usize> {
1962 unimplemented!("This is mocked")
1963}
1964
1965pub enum EncodedImageFormat {
1966 BMP = 0,
1967 GIF = 1,
1968 ICO = 2,
1969 JPEG = 3,
1970 PNG = 4,
1971 WBMP = 5,
1972 WEBP = 6,
1973 PKM = 7,
1974 KTX = 8,
1975 ASTC = 9,
1976 DNG = 10,
1977 HEIF = 11,
1978 AVIF = 12,
1979 JPEGXL = 13,
1980}
1981
1982pub struct LocalResourceProvider;
1983
1984impl LocalResourceProvider {
1985 pub fn new(font_mgr: &FontMgr) -> Self {
1986 unimplemented!("This is mocked")
1987 }
1988}
1989
1990pub fn raster_n32_premul(size: impl Into<ISize>) -> Option<Surface> {
1991 unimplemented!("This is mocked")
1992}