|
2 | 2 | // from gir-files (https://github.com/gtk-rs/gir-files) |
3 | 3 | // DO NOT EDIT |
4 | 4 |
|
5 | | -#[cfg(feature = "v4_16")] |
6 | | -#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
7 | | -use crate::TextBufferNotifyFlags; |
8 | 5 | use crate::{ffi, TextChildAnchor, TextIter, TextMark, TextTag, TextTagTable}; |
9 | 6 | use glib::{ |
10 | 7 | prelude::*, |
@@ -89,50 +86,6 @@ impl TextBufferBuilder { |
89 | 86 | } |
90 | 87 |
|
91 | 88 | pub trait TextBufferExt: IsA<TextBuffer> + 'static { |
92 | | - #[cfg(feature = "v4_16")] |
93 | | - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
94 | | - #[doc(alias = "gtk_text_buffer_add_commit_notify")] |
95 | | - fn add_commit_notify<P: Fn(&TextBuffer, &TextBufferNotifyFlags, u32, u32) + 'static>( |
96 | | - &self, |
97 | | - flags: TextBufferNotifyFlags, |
98 | | - commit_notify: P, |
99 | | - ) -> u32 { |
100 | | - let commit_notify_data: Box_<P> = Box_::new(commit_notify); |
101 | | - unsafe extern "C" fn commit_notify_func< |
102 | | - P: Fn(&TextBuffer, &TextBufferNotifyFlags, u32, u32) + 'static, |
103 | | - >( |
104 | | - buffer: *mut ffi::GtkTextBuffer, |
105 | | - flags: ffi::GtkTextBufferNotifyFlags, |
106 | | - position: std::ffi::c_uint, |
107 | | - length: std::ffi::c_uint, |
108 | | - user_data: glib::ffi::gpointer, |
109 | | - ) { |
110 | | - let buffer = from_glib_borrow(buffer); |
111 | | - let flags = from_glib_borrow(flags); |
112 | | - let callback = &*(user_data as *mut P); |
113 | | - (*callback)(&buffer, &flags, position, length) |
114 | | - } |
115 | | - let commit_notify = Some(commit_notify_func::<P> as _); |
116 | | - unsafe extern "C" fn destroy_func< |
117 | | - P: Fn(&TextBuffer, &TextBufferNotifyFlags, u32, u32) + 'static, |
118 | | - >( |
119 | | - data: glib::ffi::gpointer, |
120 | | - ) { |
121 | | - let _callback = Box_::from_raw(data as *mut P); |
122 | | - } |
123 | | - let destroy_call4 = Some(destroy_func::<P> as _); |
124 | | - let super_callback0: Box_<P> = commit_notify_data; |
125 | | - unsafe { |
126 | | - ffi::gtk_text_buffer_add_commit_notify( |
127 | | - self.as_ref().to_glib_none().0, |
128 | | - flags.into_glib(), |
129 | | - commit_notify, |
130 | | - Box_::into_raw(super_callback0) as *mut _, |
131 | | - destroy_call4, |
132 | | - ) |
133 | | - } |
134 | | - } |
135 | | - |
136 | 89 | #[doc(alias = "gtk_text_buffer_add_mark")] |
137 | 90 | fn add_mark(&self, mark: &impl IsA<TextMark>, where_: &TextIter) { |
138 | 91 | unsafe { |
|
0 commit comments