@@ -43,42 +43,9 @@ pub trait ContentProviderImpl: ContentProviderImplExt + ObjectImpl {
43
43
}
44
44
45
45
pub trait ContentProviderImplExt : ObjectSubclass {
46
- fn parent_content_changed ( & self ) ;
47
-
48
- fn parent_attach_clipboard ( & self , clipboard : & Clipboard ) ;
49
-
50
- fn parent_detach_clipboard ( & self , clipboard : & Clipboard ) ;
51
-
52
- fn parent_formats ( & self ) -> ContentFormats ;
53
-
54
- fn parent_storable_formats ( & self ) -> ContentFormats ;
55
-
56
- fn parent_write_mime_type_async <
57
- Q : IsA < gio:: Cancellable > ,
58
- R : FnOnce ( Result < ( ) , glib:: Error > ) + ' static ,
59
- > (
60
- & self ,
61
- mime_type : & str ,
62
- stream : & gio:: OutputStream ,
63
- io_priority : glib:: Priority ,
64
- cancellable : Option < & Q > ,
65
- callback : R ,
66
- ) ;
67
-
68
- fn parent_write_mime_type_future (
69
- & self ,
70
- mime_type : & str ,
71
- stream : & gio:: OutputStream ,
72
- io_priority : glib:: Priority ,
73
- ) -> Pin < Box < dyn Future < Output = Result < ( ) , glib:: Error > > + ' static > > ;
74
-
75
- fn parent_value ( & self , type_ : glib:: Type ) -> Result < Value , glib:: Error > ;
76
- }
77
-
78
- impl < T : ContentProviderImpl > ContentProviderImplExt for T {
79
46
fn parent_content_changed ( & self ) {
80
47
unsafe {
81
- let data = T :: type_data ( ) ;
48
+ let data = Self :: type_data ( ) ;
82
49
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
83
50
if let Some ( f) = ( * parent_class) . content_changed {
84
51
f ( self
@@ -92,7 +59,7 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
92
59
93
60
fn parent_attach_clipboard ( & self , clipboard : & Clipboard ) {
94
61
unsafe {
95
- let data = T :: type_data ( ) ;
62
+ let data = Self :: type_data ( ) ;
96
63
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
97
64
if let Some ( f) = ( * parent_class) . attach_clipboard {
98
65
f (
@@ -108,7 +75,7 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
108
75
109
76
fn parent_detach_clipboard ( & self , clipboard : & Clipboard ) {
110
77
unsafe {
111
- let data = T :: type_data ( ) ;
78
+ let data = Self :: type_data ( ) ;
112
79
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
113
80
if let Some ( f) = ( * parent_class) . detach_clipboard {
114
81
f (
@@ -124,7 +91,7 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
124
91
125
92
fn parent_formats ( & self ) -> ContentFormats {
126
93
unsafe {
127
- let data = T :: type_data ( ) ;
94
+ let data = Self :: type_data ( ) ;
128
95
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
129
96
let f = ( * parent_class)
130
97
. ref_formats
@@ -141,7 +108,7 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
141
108
142
109
fn parent_storable_formats ( & self ) -> ContentFormats {
143
110
unsafe {
144
- let data = T :: type_data ( ) ;
111
+ let data = Self :: type_data ( ) ;
145
112
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
146
113
let f = ( * parent_class)
147
114
. ref_storable_formats
@@ -179,7 +146,7 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
179
146
"Async operations only allowed if the thread is owning the MainContext"
180
147
) ;
181
148
182
- let data = T :: type_data ( ) ;
149
+ let data = Self :: type_data ( ) ;
183
150
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
184
151
let f = ( * parent_class)
185
152
. write_mime_type_async
@@ -260,7 +227,7 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
260
227
261
228
fn parent_value ( & self , type_ : glib:: Type ) -> Result < Value , glib:: Error > {
262
229
unsafe {
263
- let data = T :: type_data ( ) ;
230
+ let data = Self :: type_data ( ) ;
264
231
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GdkContentProviderClass ;
265
232
let f = ( * parent_class)
266
233
. get_value
@@ -286,6 +253,8 @@ impl<T: ContentProviderImpl> ContentProviderImplExt for T {
286
253
}
287
254
}
288
255
256
+ impl < T : ContentProviderImpl > ContentProviderImplExt for T { }
257
+
289
258
unsafe impl < T : ContentProviderImpl > IsSubclassable < T > for ContentProvider {
290
259
fn class_init ( class : & mut glib:: Class < Self > ) {
291
260
Self :: parent_class_init :: < T > ( class) ;
0 commit comments