@@ -134,6 +134,7 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
134
134
unsafe {
135
135
let data = T :: type_data ( ) ;
136
136
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
137
+ // columns-changed is a signal
137
138
if let Some ( f) = ( * parent_class) . columns_changed {
138
139
f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 )
139
140
}
@@ -144,6 +145,7 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
144
145
unsafe {
145
146
let data = T :: type_data ( ) ;
146
147
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
148
+ // cursor-changed is a sigal
147
149
if let Some ( f) = ( * parent_class) . cursor_changed {
148
150
f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 )
149
151
}
@@ -160,17 +162,17 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
160
162
unsafe {
161
163
let data = T :: type_data ( ) ;
162
164
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
163
-
164
- let f = ( * parent_class)
165
- . expand_collapse_cursor_row
166
- . expect ( "No parent class impl for \" collapse_cursor_row \" " ) ;
167
-
168
- from_glib ( f (
169
- tree_view . unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
170
- logical . into_glib ( ) ,
171
- expand . into_glib ( ) ,
172
- open_all . into_glib ( ) ,
173
- ) )
165
+ // expand-collapse-cursor-row is a signal
166
+ if let Some ( f ) = ( * parent_class) . expand_collapse_cursor_row {
167
+ from_glib ( f (
168
+ tree_view . unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
169
+ logical . into_glib ( ) ,
170
+ expand . into_glib ( ) ,
171
+ open_all . into_glib ( ) ,
172
+ ) )
173
+ } else {
174
+ false
175
+ }
174
176
}
175
177
}
176
178
@@ -185,17 +187,19 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
185
187
unsafe {
186
188
let data = T :: type_data ( ) ;
187
189
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
188
- let f = ( * parent_class)
189
- . move_cursor
190
- . expect ( "No parent class impl for \" move_cursor\" " ) ;
191
-
192
- from_glib ( f (
193
- tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
194
- step. into_glib ( ) ,
195
- count,
196
- extend. into_glib ( ) ,
197
- modify. into_glib ( ) ,
198
- ) )
190
+ // move-cursor is a signal
191
+ if let Some ( f) = ( * parent_class) . move_cursor {
192
+ from_glib ( f (
193
+ tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
194
+ step. into_glib ( ) ,
195
+ count,
196
+ extend. into_glib ( ) ,
197
+ modify. into_glib ( ) ,
198
+ ) )
199
+ } else {
200
+ // return false if step is not supported
201
+ false
202
+ }
199
203
}
200
204
}
201
205
@@ -208,6 +212,7 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
208
212
unsafe {
209
213
let data = T :: type_data ( ) ;
210
214
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
215
+ // row-activated is a signal
211
216
if let Some ( f) = ( * parent_class) . row_activated {
212
217
f (
213
218
tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
@@ -222,6 +227,7 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
222
227
unsafe {
223
228
let data = T :: type_data ( ) ;
224
229
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
230
+ // row-collapsed is a signal
225
231
if let Some ( f) = ( * parent_class) . row_collapsed {
226
232
f (
227
233
tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
@@ -236,6 +242,7 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
236
242
unsafe {
237
243
let data = T :: type_data ( ) ;
238
244
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
245
+ // row-expanded is a signal
239
246
if let Some ( f) = ( * parent_class) . row_expanded {
240
247
f (
241
248
tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
@@ -250,50 +257,54 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
250
257
unsafe {
251
258
let data = T :: type_data ( ) ;
252
259
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
253
- let f = ( * parent_class)
254
- . select_all
255
- . expect ( "No parent class impl for \" select_all\" " ) ;
256
-
257
- from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
260
+ // select-all is a signal
261
+ if let Some ( f) = ( * parent_class) . select_all {
262
+ from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
263
+ } else {
264
+ false
265
+ }
258
266
}
259
267
}
260
268
261
269
fn parent_select_cursor_parent ( & self , tree_view : & Self :: Type ) -> bool {
262
270
unsafe {
263
271
let data = T :: type_data ( ) ;
264
272
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
265
- let f = ( * parent_class)
266
- . select_cursor_parent
267
- . expect ( "No parent class impl for \" select_cursor_parent\" " ) ;
268
-
269
- from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
273
+ // select-cursor-parent is a signal
274
+ if let Some ( f) = ( * parent_class) . select_cursor_parent {
275
+ from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
276
+ } else {
277
+ false
278
+ }
270
279
}
271
280
}
272
281
273
282
fn parent_select_cursor_row ( & self , tree_view : & Self :: Type , start_editing : bool ) -> bool {
274
283
unsafe {
275
284
let data = T :: type_data ( ) ;
276
285
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
277
- let f = ( * parent_class)
278
- . select_cursor_row
279
- . expect ( "No parent class impl for \" select_cursor_row\" " ) ;
280
-
281
- from_glib ( f (
282
- tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
283
- start_editing. into_glib ( ) ,
284
- ) )
286
+ // select-cursor-row is a signal
287
+ if let Some ( f) = ( * parent_class) . select_cursor_row {
288
+ from_glib ( f (
289
+ tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
290
+ start_editing. into_glib ( ) ,
291
+ ) )
292
+ } else {
293
+ false
294
+ }
285
295
}
286
296
}
287
297
288
298
fn parent_start_interactive_search ( & self , tree_view : & Self :: Type ) -> bool {
289
299
unsafe {
290
300
let data = T :: type_data ( ) ;
291
301
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
292
- let f = ( * parent_class)
293
- . start_interactive_search
294
- . expect ( "No parent class impl for \" start_interactive_search\" " ) ;
295
-
296
- from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
302
+ // start-interactive-search is a signal
303
+ if let Some ( f) = ( * parent_class) . start_interactive_search {
304
+ from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
305
+ } else {
306
+ false
307
+ }
297
308
}
298
309
}
299
310
@@ -306,15 +317,17 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
306
317
unsafe {
307
318
let data = T :: type_data ( ) ;
308
319
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
309
- let f = ( * parent_class)
310
- . test_collapse_row
311
- . expect ( "No parent class impl for \" test_collapse_row\" " ) ;
312
-
313
- from_glib ( f (
314
- tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
315
- iter. to_glib_none ( ) . 0 as * mut _ ,
316
- path. to_glib_none ( ) . 0 as * mut _ ,
317
- ) )
320
+ // test-collapse-row is a signal
321
+ if let Some ( f) = ( * parent_class) . test_collapse_row {
322
+ from_glib ( f (
323
+ tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
324
+ iter. to_glib_none ( ) . 0 as * mut _ ,
325
+ path. to_glib_none ( ) . 0 as * mut _ ,
326
+ ) )
327
+ } else {
328
+ // false to allow collapsing, true to reject it
329
+ false
330
+ }
318
331
}
319
332
}
320
333
@@ -327,39 +340,43 @@ impl<T: TreeViewImpl> TreeViewImplExt for T {
327
340
unsafe {
328
341
let data = T :: type_data ( ) ;
329
342
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
330
- let f = ( * parent_class)
331
- . test_expand_row
332
- . expect ( "No parent class impl for \" test_expand_row\" " ) ;
333
-
334
- from_glib ( f (
335
- tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
336
- iter. to_glib_none ( ) . 0 as * mut _ ,
337
- path. to_glib_none ( ) . 0 as * mut _ ,
338
- ) )
343
+ // test-expand-row is a signal
344
+ if let Some ( f) = ( * parent_class) . test_expand_row {
345
+ from_glib ( f (
346
+ tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ,
347
+ iter. to_glib_none ( ) . 0 as * mut _ ,
348
+ path. to_glib_none ( ) . 0 as * mut _ ,
349
+ ) )
350
+ } else {
351
+ // false to allow expanding, true to reject it
352
+ false
353
+ }
339
354
}
340
355
}
341
356
342
357
fn parent_toggle_cursor_row ( & self , tree_view : & Self :: Type ) -> bool {
343
358
unsafe {
344
359
let data = T :: type_data ( ) ;
345
360
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
346
- let f = ( * parent_class)
347
- . toggle_cursor_row
348
- . expect ( "No parent class impl for \" toggle_cursor_row\" " ) ;
349
-
350
- from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
361
+ // toggle-cursor-row is a signal
362
+ if let Some ( f) = ( * parent_class) . toggle_cursor_row {
363
+ from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
364
+ } else {
365
+ false
366
+ }
351
367
}
352
368
}
353
369
354
370
fn parent_unselect_all ( & self , tree_view : & Self :: Type ) -> bool {
355
371
unsafe {
356
372
let data = T :: type_data ( ) ;
357
373
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkTreeViewClass ;
358
- let f = ( * parent_class)
359
- . unselect_all
360
- . expect ( "No parent class impl for \" unselect_all\" " ) ;
361
-
362
- from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
374
+ // unselect-all is a signal
375
+ if let Some ( f) = ( * parent_class) . unselect_all {
376
+ from_glib ( f ( tree_view. unsafe_cast_ref :: < TreeView > ( ) . to_glib_none ( ) . 0 ) )
377
+ } else {
378
+ false
379
+ }
363
380
}
364
381
}
365
382
}
0 commit comments