@@ -58,52 +58,16 @@ impl ContentProvider {
58
58
}
59
59
}
60
60
61
- pub trait ContentProviderExt : ' static {
61
+ pub trait ContentProviderExt : IsA < ContentProvider > + ' static {
62
62
#[ doc( alias = "gdk_content_provider_content_changed" ) ]
63
- fn content_changed ( & self ) ;
64
-
65
- #[ doc( alias = "gdk_content_provider_ref_formats" ) ]
66
- #[ doc( alias = "ref_formats" ) ]
67
- fn formats ( & self ) -> ContentFormats ;
68
-
69
- #[ doc( alias = "gdk_content_provider_ref_storable_formats" ) ]
70
- #[ doc( alias = "ref_storable_formats" ) ]
71
- fn storable_formats ( & self ) -> ContentFormats ;
72
-
73
- #[ doc( alias = "gdk_content_provider_write_mime_type_async" ) ]
74
- fn write_mime_type_async < P : FnOnce ( Result < ( ) , glib:: Error > ) + ' static > (
75
- & self ,
76
- mime_type : & str ,
77
- stream : & impl IsA < gio:: OutputStream > ,
78
- io_priority : glib:: Priority ,
79
- cancellable : Option < & impl IsA < gio:: Cancellable > > ,
80
- callback : P ,
81
- ) ;
82
-
83
- fn write_mime_type_future (
84
- & self ,
85
- mime_type : & str ,
86
- stream : & ( impl IsA < gio:: OutputStream > + Clone + ' static ) ,
87
- io_priority : glib:: Priority ,
88
- ) -> Pin < Box_ < dyn std:: future:: Future < Output = Result < ( ) , glib:: Error > > + ' static > > ;
89
-
90
- #[ doc( alias = "content-changed" ) ]
91
- fn connect_content_changed < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId ;
92
-
93
- #[ doc( alias = "formats" ) ]
94
- fn connect_formats_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId ;
95
-
96
- #[ doc( alias = "storable-formats" ) ]
97
- fn connect_storable_formats_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId ;
98
- }
99
-
100
- impl < O : IsA < ContentProvider > > ContentProviderExt for O {
101
63
fn content_changed ( & self ) {
102
64
unsafe {
103
65
ffi:: gdk_content_provider_content_changed ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ;
104
66
}
105
67
}
106
68
69
+ #[ doc( alias = "gdk_content_provider_ref_formats" ) ]
70
+ #[ doc( alias = "ref_formats" ) ]
107
71
fn formats ( & self ) -> ContentFormats {
108
72
unsafe {
109
73
from_glib_full ( ffi:: gdk_content_provider_ref_formats (
@@ -112,6 +76,8 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
112
76
}
113
77
}
114
78
79
+ #[ doc( alias = "gdk_content_provider_ref_storable_formats" ) ]
80
+ #[ doc( alias = "ref_storable_formats" ) ]
115
81
fn storable_formats ( & self ) -> ContentFormats {
116
82
unsafe {
117
83
from_glib_full ( ffi:: gdk_content_provider_ref_storable_formats (
@@ -120,6 +86,7 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
120
86
}
121
87
}
122
88
89
+ #[ doc( alias = "gdk_content_provider_write_mime_type_async" ) ]
123
90
fn write_mime_type_async < P : FnOnce ( Result < ( ) , glib:: Error > ) + ' static > (
124
91
& self ,
125
92
mime_type : & str ,
@@ -198,6 +165,7 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
198
165
} ) )
199
166
}
200
167
168
+ #[ doc( alias = "content-changed" ) ]
201
169
fn connect_content_changed < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
202
170
unsafe extern "C" fn content_changed_trampoline <
203
171
P : IsA < ContentProvider > ,
@@ -222,6 +190,7 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
222
190
}
223
191
}
224
192
193
+ #[ doc( alias = "formats" ) ]
225
194
fn connect_formats_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
226
195
unsafe extern "C" fn notify_formats_trampoline <
227
196
P : IsA < ContentProvider > ,
@@ -247,6 +216,7 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
247
216
}
248
217
}
249
218
219
+ #[ doc( alias = "storable-formats" ) ]
250
220
fn connect_storable_formats_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
251
221
unsafe extern "C" fn notify_storable_formats_trampoline <
252
222
P : IsA < ContentProvider > ,
@@ -273,6 +243,8 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
273
243
}
274
244
}
275
245
246
+ impl < O : IsA < ContentProvider > > ContentProviderExt for O { }
247
+
276
248
impl fmt:: Display for ContentProvider {
277
249
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
278
250
f. write_str ( "ContentProvider" )
0 commit comments