1
1
#nullable disable
2
+ // ReSharper disable PartialMethodParameterNameMismatch
2
3
3
4
using System ;
4
5
@@ -30,24 +31,9 @@ namespace HarfBuzzSharp
30
31
31
32
internal static unsafe partial class DelegateProxies
32
33
{
33
- // references to the proxy implementations
34
- public static readonly FontGetFontExtentsProxyDelegate FontExtentsProxy = FontExtentsProxyImplementation ;
35
- public static readonly FontGetNominalGlyphProxyDelegate NominalGlyphProxy = NominalGlyphProxyImplementation ;
36
- public static readonly FontGetVariationGlyphProxyDelegate VariationGlyphProxy = VariationGlyphProxyImplementation ;
37
- public static readonly FontGetNominalGlyphsProxyDelegate NominalGlyphsProxy = NominalGlyphsProxyImplementation ;
38
- public static readonly FontGetGlyphAdvanceProxyDelegate GlyphAdvanceProxy = GlyphAdvanceProxyImplementation ;
39
- public static readonly FontGetGlyphAdvancesProxyDelegate GlyphAdvancesProxy = GlyphAdvancesProxyImplementation ;
40
- public static readonly FontGetGlyphOriginProxyDelegate GlyphOriginProxy = GlyphOriginProxyImplementation ;
41
- public static readonly FontGetGlyphKerningProxyDelegate GlyphKerningProxy = GlyphKerningProxyImplementation ;
42
- public static readonly FontGetGlyphExtentsProxyDelegate GlyphExtentsProxy = GlyphExtentsProxyImplementation ;
43
- public static readonly FontGetGlyphContourPointProxyDelegate GlyphContourPointProxy = GlyphContourPointProxyImplementation ;
44
- public static readonly FontGetGlyphNameProxyDelegate GlyphNameProxy = GlyphNameProxyImplementation ;
45
- public static readonly FontGetGlyphFromNameProxyDelegate GlyphFromNameProxy = GlyphFromNameProxyImplementation ;
46
-
47
34
// internal proxy implementations
48
35
49
- [ MonoPInvokeCallback ( typeof ( FontGetFontExtentsProxyDelegate ) ) ]
50
- private static bool FontExtentsProxyImplementation ( IntPtr font , void * fontData , FontExtents * extents , void * context )
36
+ private static partial bool FontGetFontExtentsProxyImplementation ( IntPtr font , void * fontData , FontExtents * extents , void * context )
51
37
{
52
38
var del = GetMulti < FontExtentsDelegate > ( ( IntPtr ) context , out _ ) ;
53
39
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -57,8 +43,7 @@ private static bool FontExtentsProxyImplementation (IntPtr font, void* fontData,
57
43
return result ;
58
44
}
59
45
60
- [ MonoPInvokeCallback ( typeof ( FontGetNominalGlyphProxyDelegate ) ) ]
61
- private static bool NominalGlyphProxyImplementation ( IntPtr font , void * fontData , uint unicode , uint * glyph , void * context )
46
+ private static partial bool FontGetNominalGlyphProxyImplementation ( IntPtr font , void * fontData , uint unicode , uint * glyph , void * context )
62
47
{
63
48
var del = GetMulti < NominalGlyphDelegate > ( ( IntPtr ) context , out _ ) ;
64
49
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -68,8 +53,7 @@ private static bool NominalGlyphProxyImplementation (IntPtr font, void* fontData
68
53
return result ;
69
54
}
70
55
71
- [ MonoPInvokeCallback ( typeof ( FontGetNominalGlyphsProxyDelegate ) ) ]
72
- private static uint NominalGlyphsProxyImplementation ( IntPtr font , void * fontData , uint count , uint * firstUnicode , uint unicodeStride , uint * firstGlyph , uint glyphStride , void * context )
56
+ private static partial uint FontGetNominalGlyphsProxyImplementation ( IntPtr font , void * fontData , uint count , uint * firstUnicode , uint unicodeStride , uint * firstGlyph , uint glyphStride , void * context )
73
57
{
74
58
var del = GetMulti < NominalGlyphsDelegate > ( ( IntPtr ) context , out _ ) ;
75
59
var unicodes = new ReadOnlySpan < uint > ( firstUnicode , ( int ) count ) ;
@@ -78,8 +62,7 @@ private static uint NominalGlyphsProxyImplementation (IntPtr font, void* fontDat
78
62
return del . Invoke ( userData . Font , userData . FontData , count , unicodes , glyphs ) ;
79
63
}
80
64
81
- [ MonoPInvokeCallback ( typeof ( FontGetVariationGlyphProxyDelegate ) ) ]
82
- private static bool VariationGlyphProxyImplementation ( IntPtr font , void * fontData , uint unicode , uint variationSelector , uint * glyph , void * context )
65
+ private static partial bool FontGetVariationGlyphProxyImplementation ( IntPtr font , void * fontData , uint unicode , uint variationSelector , uint * glyph , void * context )
83
66
{
84
67
var del = GetMulti < VariationGlyphDelegate > ( ( IntPtr ) context , out _ ) ;
85
68
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -89,16 +72,14 @@ private static bool VariationGlyphProxyImplementation (IntPtr font, void* fontDa
89
72
return result ;
90
73
}
91
74
92
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphAdvanceProxyDelegate ) ) ]
93
- private static int GlyphAdvanceProxyImplementation ( IntPtr font , void * fontData , uint glyph , void * context )
75
+ private static partial int FontGetGlyphAdvanceProxyImplementation ( IntPtr font , void * fontData , uint glyph , void * context )
94
76
{
95
77
var del = GetMulti < GlyphAdvanceDelegate > ( ( IntPtr ) context , out _ ) ;
96
78
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
97
79
return del . Invoke ( userData . Font , userData . FontData , glyph ) ;
98
80
}
99
81
100
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphAdvancesProxyDelegate ) ) ]
101
- private static void GlyphAdvancesProxyImplementation ( IntPtr font , void * fontData , uint count , uint * firstGlyph , uint glyphStride , int * firstAdvance , uint advanceStride , void * context )
82
+ private static partial void FontGetGlyphAdvancesProxyImplementation ( IntPtr font , void * fontData , uint count , uint * firstGlyph , uint glyphStride , int * firstAdvance , uint advanceStride , void * context )
102
83
{
103
84
var del = GetMulti < GlyphAdvancesDelegate > ( ( IntPtr ) context , out _ ) ;
104
85
var glyphs = new ReadOnlySpan < uint > ( firstGlyph , ( int ) count ) ;
@@ -107,8 +88,7 @@ private static void GlyphAdvancesProxyImplementation (IntPtr font, void* fontDat
107
88
del . Invoke ( userData . Font , userData . FontData , count , glyphs , advances ) ;
108
89
}
109
90
110
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphOriginProxyDelegate ) ) ]
111
- private static bool GlyphOriginProxyImplementation ( IntPtr font , void * fontData , uint glyph , int * x , int * y , void * context )
91
+ private static partial bool FontGetGlyphOriginProxyImplementation ( IntPtr font , void * fontData , uint glyph , int * x , int * y , void * context )
112
92
{
113
93
var del = GetMulti < GlyphOriginDelegate > ( ( IntPtr ) context , out _ ) ;
114
94
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -120,16 +100,14 @@ private static bool GlyphOriginProxyImplementation (IntPtr font, void* fontData,
120
100
return result ;
121
101
}
122
102
123
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphKerningProxyDelegate ) ) ]
124
- private static int GlyphKerningProxyImplementation ( IntPtr font , void * fontData , uint firstGlyph , uint secondGlyph , void * context )
103
+ private static partial int FontGetGlyphKerningProxyImplementation ( IntPtr font , void * fontData , uint firstGlyph , uint secondGlyph , void * context )
125
104
{
126
105
var del = GetMulti < GlyphKerningDelegate > ( ( IntPtr ) context , out _ ) ;
127
106
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
128
107
return del . Invoke ( userData . Font , userData . FontData , firstGlyph , secondGlyph ) ;
129
108
}
130
109
131
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphExtentsProxyDelegate ) ) ]
132
- private static bool GlyphExtentsProxyImplementation ( IntPtr font , void * fontData , uint glyph , GlyphExtents * extents , void * context )
110
+ private static partial bool FontGetGlyphExtentsProxyImplementation ( IntPtr font , void * fontData , uint glyph , GlyphExtents * extents , void * context )
133
111
{
134
112
var del = GetMulti < GlyphExtentsDelegate > ( ( IntPtr ) context , out _ ) ;
135
113
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -139,8 +117,7 @@ private static bool GlyphExtentsProxyImplementation (IntPtr font, void* fontData
139
117
return result ;
140
118
}
141
119
142
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphContourPointProxyDelegate ) ) ]
143
- private static bool GlyphContourPointProxyImplementation ( IntPtr font , void * fontData , uint glyph , uint pointIndex , int * x , int * y , void * context )
120
+ private static partial bool FontGetGlyphContourPointProxyImplementation ( IntPtr font , void * fontData , uint glyph , uint pointIndex , int * x , int * y , void * context )
144
121
{
145
122
var del = GetMulti < GlyphContourPointDelegate > ( ( IntPtr ) context , out _ ) ;
146
123
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -152,8 +129,7 @@ private static bool GlyphContourPointProxyImplementation (IntPtr font, void* fon
152
129
return result ;
153
130
}
154
131
155
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphNameProxyDelegate ) ) ]
156
- private static bool GlyphNameProxyImplementation ( IntPtr font , void * fontData , uint glyph , void * nameBuffer , uint size , void * context )
132
+ private static partial bool FontGetGlyphNameProxyImplementation ( IntPtr font , void * fontData , uint glyph , void * nameBuffer , uint size , void * context )
157
133
{
158
134
var del = GetMulti < GlyphNameDelegate > ( ( IntPtr ) context , out _ ) ;
159
135
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
@@ -166,8 +142,7 @@ private static bool GlyphNameProxyImplementation (IntPtr font, void* fontData, u
166
142
return result ;
167
143
}
168
144
169
- [ MonoPInvokeCallback ( typeof ( FontGetGlyphFromNameProxyDelegate ) ) ]
170
- private static bool GlyphFromNameProxyImplementation ( IntPtr font , void * fontData , void * name , int len , uint * glyph , void * context )
145
+ private static partial bool FontGetGlyphFromNameProxyImplementation ( IntPtr font , void * fontData , void * name , int len , uint * glyph , void * context )
171
146
{
172
147
var del = GetMulti < GlyphFromNameDelegate > ( ( IntPtr ) context , out _ ) ;
173
148
var userData = GetMultiUserData < FontUserData > ( ( IntPtr ) fontData , out _ ) ;
0 commit comments