Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 7502497

Browse files
Merge pull request #631 from EPashkin/restore_callback_guard
Restore callback guard
2 parents b3af342 + a3307d0 commit 7502497

File tree

218 files changed

+2749
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+2749
-229
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ git = "https://github.com/gtk-rs/lgpl-docs"
4646
[dependencies]
4747
libc = "0.2"
4848
bitflags = "1.0"
49+
lazy_static = "1.0"
4950

5051
[dependencies.cairo-sys-rs]
5152
version = "0.5.0"

src/assistant.rs

+2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ impl<O: IsA<Assistant>> AssistantExtManual for O {
2121
}
2222

2323
unsafe extern "C" fn forward_page_trampoline(current_page: i32, f: glib_ffi::gpointer) -> i32 {
24+
callback_guard!();
2425
let f: &&(Fn(i32) -> i32 + 'static) = transmute(f);
2526
f(current_page)
2627
}
2728

2829
unsafe extern "C" fn destroy_closure(ptr: glib_ffi::gpointer) {
30+
callback_guard!();
2931
Box_::<Box_<Fn(i32) -> i32 + 'static>>::from_raw(ptr as *mut _);
3032
}

src/auto/about_dialog.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -481,96 +481,112 @@ impl<O: IsA<AboutDialog> + IsA<glib::object::Object>> AboutDialogExt for O {
481481

482482
unsafe extern "C" fn activate_link_trampoline<P>(this: *mut ffi::GtkAboutDialog, uri: *mut libc::c_char, f: glib_ffi::gpointer) -> glib_ffi::gboolean
483483
where P: IsA<AboutDialog> {
484+
callback_guard!();
484485
let f: &&(Fn(&P, &str) -> Inhibit + 'static) = transmute(f);
485486
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(uri)).to_glib()
486487
}
487488

488489
unsafe extern "C" fn notify_artists_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
489490
where P: IsA<AboutDialog> {
491+
callback_guard!();
490492
let f: &&(Fn(&P) + 'static) = transmute(f);
491493
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
492494
}
493495

494496
unsafe extern "C" fn notify_authors_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
495497
where P: IsA<AboutDialog> {
498+
callback_guard!();
496499
let f: &&(Fn(&P) + 'static) = transmute(f);
497500
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
498501
}
499502

500503
unsafe extern "C" fn notify_comments_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
501504
where P: IsA<AboutDialog> {
505+
callback_guard!();
502506
let f: &&(Fn(&P) + 'static) = transmute(f);
503507
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
504508
}
505509

506510
unsafe extern "C" fn notify_copyright_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
507511
where P: IsA<AboutDialog> {
512+
callback_guard!();
508513
let f: &&(Fn(&P) + 'static) = transmute(f);
509514
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
510515
}
511516

512517
unsafe extern "C" fn notify_documenters_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
513518
where P: IsA<AboutDialog> {
519+
callback_guard!();
514520
let f: &&(Fn(&P) + 'static) = transmute(f);
515521
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
516522
}
517523

518524
unsafe extern "C" fn notify_license_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
519525
where P: IsA<AboutDialog> {
526+
callback_guard!();
520527
let f: &&(Fn(&P) + 'static) = transmute(f);
521528
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
522529
}
523530

524531
unsafe extern "C" fn notify_license_type_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
525532
where P: IsA<AboutDialog> {
533+
callback_guard!();
526534
let f: &&(Fn(&P) + 'static) = transmute(f);
527535
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
528536
}
529537

530538
unsafe extern "C" fn notify_logo_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
531539
where P: IsA<AboutDialog> {
540+
callback_guard!();
532541
let f: &&(Fn(&P) + 'static) = transmute(f);
533542
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
534543
}
535544

536545
unsafe extern "C" fn notify_logo_icon_name_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
537546
where P: IsA<AboutDialog> {
547+
callback_guard!();
538548
let f: &&(Fn(&P) + 'static) = transmute(f);
539549
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
540550
}
541551

542552
unsafe extern "C" fn notify_program_name_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
543553
where P: IsA<AboutDialog> {
554+
callback_guard!();
544555
let f: &&(Fn(&P) + 'static) = transmute(f);
545556
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
546557
}
547558

548559
unsafe extern "C" fn notify_translator_credits_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
549560
where P: IsA<AboutDialog> {
561+
callback_guard!();
550562
let f: &&(Fn(&P) + 'static) = transmute(f);
551563
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
552564
}
553565

554566
unsafe extern "C" fn notify_version_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
555567
where P: IsA<AboutDialog> {
568+
callback_guard!();
556569
let f: &&(Fn(&P) + 'static) = transmute(f);
557570
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
558571
}
559572

560573
unsafe extern "C" fn notify_website_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
561574
where P: IsA<AboutDialog> {
575+
callback_guard!();
562576
let f: &&(Fn(&P) + 'static) = transmute(f);
563577
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
564578
}
565579

566580
unsafe extern "C" fn notify_website_label_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
567581
where P: IsA<AboutDialog> {
582+
callback_guard!();
568583
let f: &&(Fn(&P) + 'static) = transmute(f);
569584
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
570585
}
571586

572587
unsafe extern "C" fn notify_wrap_license_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
573588
where P: IsA<AboutDialog> {
589+
callback_guard!();
574590
let f: &&(Fn(&P) + 'static) = transmute(f);
575591
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
576592
}

src/auto/accel_group.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -158,18 +158,21 @@ impl<O: IsA<AccelGroup> + IsA<glib::object::Object>> AccelGroupExt for O {
158158

159159
unsafe extern "C" fn accel_activate_trampoline<P>(this: *mut ffi::GtkAccelGroup, acceleratable: *mut gobject_ffi::GObject, keyval: libc::c_uint, modifier: gdk_ffi::GdkModifierType, f: glib_ffi::gpointer) -> glib_ffi::gboolean
160160
where P: IsA<AccelGroup> {
161+
callback_guard!();
161162
let f: &&(Fn(&P, &glib::Object, u32, gdk::ModifierType) -> bool + 'static) = transmute(f);
162163
f(&AccelGroup::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(acceleratable), keyval, from_glib(modifier)).to_glib()
163164
}
164165

165166
unsafe extern "C" fn notify_is_locked_trampoline<P>(this: *mut ffi::GtkAccelGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
166167
where P: IsA<AccelGroup> {
168+
callback_guard!();
167169
let f: &&(Fn(&P) + 'static) = transmute(f);
168170
f(&AccelGroup::from_glib_borrow(this).downcast_unchecked())
169171
}
170172

171173
unsafe extern "C" fn notify_modifier_mask_trampoline<P>(this: *mut ffi::GtkAccelGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
172174
where P: IsA<AccelGroup> {
175+
callback_guard!();
173176
let f: &&(Fn(&P) + 'static) = transmute(f);
174177
f(&AccelGroup::from_glib_borrow(this).downcast_unchecked())
175178
}

src/auto/action_bar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

src/auto/actionable.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -90,6 +90,7 @@ impl<O: IsA<Actionable> + IsA<glib::object::Object>> ActionableExt for O {
9090

9191
unsafe extern "C" fn notify_action_name_trampoline<P>(this: *mut ffi::GtkActionable, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
9292
where P: IsA<Actionable> {
93+
callback_guard!();
9394
let f: &&(Fn(&P) + 'static) = transmute(f);
9495
f(&Actionable::from_glib_borrow(this).downcast_unchecked())
9596
}

src/auto/adjustment.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -257,48 +257,56 @@ impl<O: IsA<Adjustment> + IsA<glib::object::Object>> AdjustmentExt for O {
257257

258258
unsafe extern "C" fn changed_trampoline<P>(this: *mut ffi::GtkAdjustment, f: glib_ffi::gpointer)
259259
where P: IsA<Adjustment> {
260+
callback_guard!();
260261
let f: &&(Fn(&P) + 'static) = transmute(f);
261262
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
262263
}
263264

264265
unsafe extern "C" fn value_changed_trampoline<P>(this: *mut ffi::GtkAdjustment, f: glib_ffi::gpointer)
265266
where P: IsA<Adjustment> {
267+
callback_guard!();
266268
let f: &&(Fn(&P) + 'static) = transmute(f);
267269
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
268270
}
269271

270272
unsafe extern "C" fn notify_lower_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
271273
where P: IsA<Adjustment> {
274+
callback_guard!();
272275
let f: &&(Fn(&P) + 'static) = transmute(f);
273276
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
274277
}
275278

276279
unsafe extern "C" fn notify_page_increment_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
277280
where P: IsA<Adjustment> {
281+
callback_guard!();
278282
let f: &&(Fn(&P) + 'static) = transmute(f);
279283
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
280284
}
281285

282286
unsafe extern "C" fn notify_page_size_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
283287
where P: IsA<Adjustment> {
288+
callback_guard!();
284289
let f: &&(Fn(&P) + 'static) = transmute(f);
285290
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
286291
}
287292

288293
unsafe extern "C" fn notify_step_increment_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
289294
where P: IsA<Adjustment> {
295+
callback_guard!();
290296
let f: &&(Fn(&P) + 'static) = transmute(f);
291297
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
292298
}
293299

294300
unsafe extern "C" fn notify_upper_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
295301
where P: IsA<Adjustment> {
302+
callback_guard!();
296303
let f: &&(Fn(&P) + 'static) = transmute(f);
297304
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
298305
}
299306

300307
unsafe extern "C" fn notify_value_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
301308
where P: IsA<Adjustment> {
309+
callback_guard!();
302310
let f: &&(Fn(&P) + 'static) = transmute(f);
303311
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
304312
}

src/auto/alignment.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -326,48 +326,56 @@ impl<O: IsA<Alignment> + IsA<glib::object::Object>> AlignmentExt for O {
326326

327327
unsafe extern "C" fn notify_bottom_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
328328
where P: IsA<Alignment> {
329+
callback_guard!();
329330
let f: &&(Fn(&P) + 'static) = transmute(f);
330331
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
331332
}
332333

333334
unsafe extern "C" fn notify_left_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
334335
where P: IsA<Alignment> {
336+
callback_guard!();
335337
let f: &&(Fn(&P) + 'static) = transmute(f);
336338
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
337339
}
338340

339341
unsafe extern "C" fn notify_right_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
340342
where P: IsA<Alignment> {
343+
callback_guard!();
341344
let f: &&(Fn(&P) + 'static) = transmute(f);
342345
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
343346
}
344347

345348
unsafe extern "C" fn notify_top_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
346349
where P: IsA<Alignment> {
350+
callback_guard!();
347351
let f: &&(Fn(&P) + 'static) = transmute(f);
348352
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
349353
}
350354

351355
unsafe extern "C" fn notify_xalign_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
352356
where P: IsA<Alignment> {
357+
callback_guard!();
353358
let f: &&(Fn(&P) + 'static) = transmute(f);
354359
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
355360
}
356361

357362
unsafe extern "C" fn notify_xscale_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
358363
where P: IsA<Alignment> {
364+
callback_guard!();
359365
let f: &&(Fn(&P) + 'static) = transmute(f);
360366
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
361367
}
362368

363369
unsafe extern "C" fn notify_yalign_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
364370
where P: IsA<Alignment> {
371+
callback_guard!();
365372
let f: &&(Fn(&P) + 'static) = transmute(f);
366373
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
367374
}
368375

369376
unsafe extern "C" fn notify_yscale_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
370377
where P: IsA<Alignment> {
378+
callback_guard!();
371379
let f: &&(Fn(&P) + 'static) = transmute(f);
372380
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
373381
}

src/auto/app_chooser_button.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -161,24 +161,28 @@ impl<O: IsA<AppChooserButton> + IsA<glib::object::Object>> AppChooserButtonExt f
161161

162162
unsafe extern "C" fn custom_item_activated_trampoline<P>(this: *mut ffi::GtkAppChooserButton, item_name: *mut libc::c_char, f: glib_ffi::gpointer)
163163
where P: IsA<AppChooserButton> {
164+
callback_guard!();
164165
let f: &&(Fn(&P, &str) + 'static) = transmute(f);
165166
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(item_name))
166167
}
167168

168169
unsafe extern "C" fn notify_heading_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
169170
where P: IsA<AppChooserButton> {
171+
callback_guard!();
170172
let f: &&(Fn(&P) + 'static) = transmute(f);
171173
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
172174
}
173175

174176
unsafe extern "C" fn notify_show_default_item_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
175177
where P: IsA<AppChooserButton> {
178+
callback_guard!();
176179
let f: &&(Fn(&P) + 'static) = transmute(f);
177180
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
178181
}
179182

180183
unsafe extern "C" fn notify_show_dialog_item_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
181184
where P: IsA<AppChooserButton> {
185+
callback_guard!();
182186
let f: &&(Fn(&P) + 'static) = transmute(f);
183187
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
184188
}

src/auto/app_chooser_dialog.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
1+
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
22
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
33
// DO NOT EDIT
44

@@ -115,12 +115,14 @@ impl<O: IsA<AppChooserDialog> + IsA<glib::object::Object>> AppChooserDialogExt f
115115

116116
unsafe extern "C" fn notify_gfile_trampoline<P>(this: *mut ffi::GtkAppChooserDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
117117
where P: IsA<AppChooserDialog> {
118+
callback_guard!();
118119
let f: &&(Fn(&P) + 'static) = transmute(f);
119120
f(&AppChooserDialog::from_glib_borrow(this).downcast_unchecked())
120121
}
121122

122123
unsafe extern "C" fn notify_heading_trampoline<P>(this: *mut ffi::GtkAppChooserDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
123124
where P: IsA<AppChooserDialog> {
125+
callback_guard!();
124126
let f: &&(Fn(&P) + 'static) = transmute(f);
125127
f(&AppChooserDialog::from_glib_borrow(this).downcast_unchecked())
126128
}

0 commit comments

Comments
 (0)