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