1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use gdk;
6 use glib;
7 use glib::object::Cast;
8 use glib::object::IsA;
9 use glib::object::ObjectExt;
10 use glib::signal::connect_raw;
11 use glib::signal::SignalHandlerId;
12 use glib::translate::*;
13 use glib::GString;
14 use glib::StaticType;
15 use glib::ToValue;
16 use glib::Value;
17 use glib_sys;
18 use gobject_sys;
19 use gtk_sys;
20 use libc;
21 use pango;
22 use std::boxed::Box as Box_;
23 use std::fmt;
24 use std::mem;
25 use std::mem::transmute;
26 use Adjustment;
27 use Align;
28 use Buildable;
29 use Container;
30 use DeleteType;
31 use InputHints;
32 use InputPurpose;
33 use Justification;
34 use MovementStep;
35 use ResizeMode;
36 use ScrollStep;
37 use Scrollable;
38 use ScrollablePolicy;
39 use TextAttributes;
40 use TextBuffer;
41 use TextChildAnchor;
42 #[cfg(any(feature = "v3_16", feature = "dox"))]
43 use TextExtendSelection;
44 use TextIter;
45 use TextMark;
46 use TextWindowType;
47 use Widget;
48 use WrapMode;
49 
50 glib_wrapper! {
51     pub struct TextView(Object<gtk_sys::GtkTextView, gtk_sys::GtkTextViewClass, TextViewClass>) @extends Container, Widget, @implements Buildable, Scrollable;
52 
53     match fn {
54         get_type => || gtk_sys::gtk_text_view_get_type(),
55     }
56 }
57 
58 impl TextView {
new() -> TextView59     pub fn new() -> TextView {
60         assert_initialized_main_thread!();
61         unsafe { Widget::from_glib_none(gtk_sys::gtk_text_view_new()).unsafe_cast() }
62     }
63 
new_with_buffer<P: IsA<TextBuffer>>(buffer: &P) -> TextView64     pub fn new_with_buffer<P: IsA<TextBuffer>>(buffer: &P) -> TextView {
65         skip_assert_initialized!();
66         unsafe {
67             Widget::from_glib_none(gtk_sys::gtk_text_view_new_with_buffer(
68                 buffer.as_ref().to_glib_none().0,
69             ))
70             .unsafe_cast()
71         }
72     }
73 }
74 
75 impl Default for TextView {
default() -> Self76     fn default() -> Self {
77         Self::new()
78     }
79 }
80 
81 #[derive(Clone, Default)]
82 pub struct TextViewBuilder {
83     accepts_tab: Option<bool>,
84     #[cfg(any(feature = "v3_18", feature = "dox"))]
85     bottom_margin: Option<i32>,
86     buffer: Option<TextBuffer>,
87     cursor_visible: Option<bool>,
88     editable: Option<bool>,
89     im_module: Option<String>,
90     indent: Option<i32>,
91     input_hints: Option<InputHints>,
92     input_purpose: Option<InputPurpose>,
93     justification: Option<Justification>,
94     left_margin: Option<i32>,
95     monospace: Option<bool>,
96     overwrite: Option<bool>,
97     pixels_above_lines: Option<i32>,
98     pixels_below_lines: Option<i32>,
99     pixels_inside_wrap: Option<i32>,
100     populate_all: Option<bool>,
101     right_margin: Option<i32>,
102     tabs: Option<pango::TabArray>,
103     #[cfg(any(feature = "v3_18", feature = "dox"))]
104     top_margin: Option<i32>,
105     wrap_mode: Option<WrapMode>,
106     border_width: Option<u32>,
107     child: Option<Widget>,
108     resize_mode: Option<ResizeMode>,
109     app_paintable: Option<bool>,
110     can_default: Option<bool>,
111     can_focus: Option<bool>,
112     events: Option<gdk::EventMask>,
113     expand: Option<bool>,
114     #[cfg(any(feature = "v3_20", feature = "dox"))]
115     focus_on_click: Option<bool>,
116     halign: Option<Align>,
117     has_default: Option<bool>,
118     has_focus: Option<bool>,
119     has_tooltip: Option<bool>,
120     height_request: Option<i32>,
121     hexpand: Option<bool>,
122     hexpand_set: Option<bool>,
123     is_focus: Option<bool>,
124     margin: Option<i32>,
125     margin_bottom: Option<i32>,
126     margin_end: Option<i32>,
127     margin_start: Option<i32>,
128     margin_top: Option<i32>,
129     name: Option<String>,
130     no_show_all: Option<bool>,
131     opacity: Option<f64>,
132     parent: Option<Container>,
133     receives_default: Option<bool>,
134     sensitive: Option<bool>,
135     tooltip_markup: Option<String>,
136     tooltip_text: Option<String>,
137     valign: Option<Align>,
138     vexpand: Option<bool>,
139     vexpand_set: Option<bool>,
140     visible: Option<bool>,
141     width_request: Option<i32>,
142     hadjustment: Option<Adjustment>,
143     hscroll_policy: Option<ScrollablePolicy>,
144     vadjustment: Option<Adjustment>,
145     vscroll_policy: Option<ScrollablePolicy>,
146 }
147 
148 impl TextViewBuilder {
new() -> Self149     pub fn new() -> Self {
150         Self::default()
151     }
152 
build(self) -> TextView153     pub fn build(self) -> TextView {
154         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
155         if let Some(ref accepts_tab) = self.accepts_tab {
156             properties.push(("accepts-tab", accepts_tab));
157         }
158         #[cfg(any(feature = "v3_18", feature = "dox"))]
159         {
160             if let Some(ref bottom_margin) = self.bottom_margin {
161                 properties.push(("bottom-margin", bottom_margin));
162             }
163         }
164         if let Some(ref buffer) = self.buffer {
165             properties.push(("buffer", buffer));
166         }
167         if let Some(ref cursor_visible) = self.cursor_visible {
168             properties.push(("cursor-visible", cursor_visible));
169         }
170         if let Some(ref editable) = self.editable {
171             properties.push(("editable", editable));
172         }
173         if let Some(ref im_module) = self.im_module {
174             properties.push(("im-module", im_module));
175         }
176         if let Some(ref indent) = self.indent {
177             properties.push(("indent", indent));
178         }
179         if let Some(ref input_hints) = self.input_hints {
180             properties.push(("input-hints", input_hints));
181         }
182         if let Some(ref input_purpose) = self.input_purpose {
183             properties.push(("input-purpose", input_purpose));
184         }
185         if let Some(ref justification) = self.justification {
186             properties.push(("justification", justification));
187         }
188         if let Some(ref left_margin) = self.left_margin {
189             properties.push(("left-margin", left_margin));
190         }
191         if let Some(ref monospace) = self.monospace {
192             properties.push(("monospace", monospace));
193         }
194         if let Some(ref overwrite) = self.overwrite {
195             properties.push(("overwrite", overwrite));
196         }
197         if let Some(ref pixels_above_lines) = self.pixels_above_lines {
198             properties.push(("pixels-above-lines", pixels_above_lines));
199         }
200         if let Some(ref pixels_below_lines) = self.pixels_below_lines {
201             properties.push(("pixels-below-lines", pixels_below_lines));
202         }
203         if let Some(ref pixels_inside_wrap) = self.pixels_inside_wrap {
204             properties.push(("pixels-inside-wrap", pixels_inside_wrap));
205         }
206         if let Some(ref populate_all) = self.populate_all {
207             properties.push(("populate-all", populate_all));
208         }
209         if let Some(ref right_margin) = self.right_margin {
210             properties.push(("right-margin", right_margin));
211         }
212         if let Some(ref tabs) = self.tabs {
213             properties.push(("tabs", tabs));
214         }
215         #[cfg(any(feature = "v3_18", feature = "dox"))]
216         {
217             if let Some(ref top_margin) = self.top_margin {
218                 properties.push(("top-margin", top_margin));
219             }
220         }
221         if let Some(ref wrap_mode) = self.wrap_mode {
222             properties.push(("wrap-mode", wrap_mode));
223         }
224         if let Some(ref border_width) = self.border_width {
225             properties.push(("border-width", border_width));
226         }
227         if let Some(ref child) = self.child {
228             properties.push(("child", child));
229         }
230         if let Some(ref resize_mode) = self.resize_mode {
231             properties.push(("resize-mode", resize_mode));
232         }
233         if let Some(ref app_paintable) = self.app_paintable {
234             properties.push(("app-paintable", app_paintable));
235         }
236         if let Some(ref can_default) = self.can_default {
237             properties.push(("can-default", can_default));
238         }
239         if let Some(ref can_focus) = self.can_focus {
240             properties.push(("can-focus", can_focus));
241         }
242         if let Some(ref events) = self.events {
243             properties.push(("events", events));
244         }
245         if let Some(ref expand) = self.expand {
246             properties.push(("expand", expand));
247         }
248         #[cfg(any(feature = "v3_20", feature = "dox"))]
249         {
250             if let Some(ref focus_on_click) = self.focus_on_click {
251                 properties.push(("focus-on-click", focus_on_click));
252             }
253         }
254         if let Some(ref halign) = self.halign {
255             properties.push(("halign", halign));
256         }
257         if let Some(ref has_default) = self.has_default {
258             properties.push(("has-default", has_default));
259         }
260         if let Some(ref has_focus) = self.has_focus {
261             properties.push(("has-focus", has_focus));
262         }
263         if let Some(ref has_tooltip) = self.has_tooltip {
264             properties.push(("has-tooltip", has_tooltip));
265         }
266         if let Some(ref height_request) = self.height_request {
267             properties.push(("height-request", height_request));
268         }
269         if let Some(ref hexpand) = self.hexpand {
270             properties.push(("hexpand", hexpand));
271         }
272         if let Some(ref hexpand_set) = self.hexpand_set {
273             properties.push(("hexpand-set", hexpand_set));
274         }
275         if let Some(ref is_focus) = self.is_focus {
276             properties.push(("is-focus", is_focus));
277         }
278         if let Some(ref margin) = self.margin {
279             properties.push(("margin", margin));
280         }
281         if let Some(ref margin_bottom) = self.margin_bottom {
282             properties.push(("margin-bottom", margin_bottom));
283         }
284         if let Some(ref margin_end) = self.margin_end {
285             properties.push(("margin-end", margin_end));
286         }
287         if let Some(ref margin_start) = self.margin_start {
288             properties.push(("margin-start", margin_start));
289         }
290         if let Some(ref margin_top) = self.margin_top {
291             properties.push(("margin-top", margin_top));
292         }
293         if let Some(ref name) = self.name {
294             properties.push(("name", name));
295         }
296         if let Some(ref no_show_all) = self.no_show_all {
297             properties.push(("no-show-all", no_show_all));
298         }
299         if let Some(ref opacity) = self.opacity {
300             properties.push(("opacity", opacity));
301         }
302         if let Some(ref parent) = self.parent {
303             properties.push(("parent", parent));
304         }
305         if let Some(ref receives_default) = self.receives_default {
306             properties.push(("receives-default", receives_default));
307         }
308         if let Some(ref sensitive) = self.sensitive {
309             properties.push(("sensitive", sensitive));
310         }
311         if let Some(ref tooltip_markup) = self.tooltip_markup {
312             properties.push(("tooltip-markup", tooltip_markup));
313         }
314         if let Some(ref tooltip_text) = self.tooltip_text {
315             properties.push(("tooltip-text", tooltip_text));
316         }
317         if let Some(ref valign) = self.valign {
318             properties.push(("valign", valign));
319         }
320         if let Some(ref vexpand) = self.vexpand {
321             properties.push(("vexpand", vexpand));
322         }
323         if let Some(ref vexpand_set) = self.vexpand_set {
324             properties.push(("vexpand-set", vexpand_set));
325         }
326         if let Some(ref visible) = self.visible {
327             properties.push(("visible", visible));
328         }
329         if let Some(ref width_request) = self.width_request {
330             properties.push(("width-request", width_request));
331         }
332         if let Some(ref hadjustment) = self.hadjustment {
333             properties.push(("hadjustment", hadjustment));
334         }
335         if let Some(ref hscroll_policy) = self.hscroll_policy {
336             properties.push(("hscroll-policy", hscroll_policy));
337         }
338         if let Some(ref vadjustment) = self.vadjustment {
339             properties.push(("vadjustment", vadjustment));
340         }
341         if let Some(ref vscroll_policy) = self.vscroll_policy {
342             properties.push(("vscroll-policy", vscroll_policy));
343         }
344         glib::Object::new(TextView::static_type(), &properties)
345             .expect("object new")
346             .downcast()
347             .expect("downcast")
348     }
349 
accepts_tab(mut self, accepts_tab: bool) -> Self350     pub fn accepts_tab(mut self, accepts_tab: bool) -> Self {
351         self.accepts_tab = Some(accepts_tab);
352         self
353     }
354 
355     #[cfg(any(feature = "v3_18", feature = "dox"))]
bottom_margin(mut self, bottom_margin: i32) -> Self356     pub fn bottom_margin(mut self, bottom_margin: i32) -> Self {
357         self.bottom_margin = Some(bottom_margin);
358         self
359     }
360 
buffer<P: IsA<TextBuffer>>(mut self, buffer: &P) -> Self361     pub fn buffer<P: IsA<TextBuffer>>(mut self, buffer: &P) -> Self {
362         self.buffer = Some(buffer.clone().upcast());
363         self
364     }
365 
cursor_visible(mut self, cursor_visible: bool) -> Self366     pub fn cursor_visible(mut self, cursor_visible: bool) -> Self {
367         self.cursor_visible = Some(cursor_visible);
368         self
369     }
370 
editable(mut self, editable: bool) -> Self371     pub fn editable(mut self, editable: bool) -> Self {
372         self.editable = Some(editable);
373         self
374     }
375 
im_module(mut self, im_module: &str) -> Self376     pub fn im_module(mut self, im_module: &str) -> Self {
377         self.im_module = Some(im_module.to_string());
378         self
379     }
380 
indent(mut self, indent: i32) -> Self381     pub fn indent(mut self, indent: i32) -> Self {
382         self.indent = Some(indent);
383         self
384     }
385 
input_hints(mut self, input_hints: InputHints) -> Self386     pub fn input_hints(mut self, input_hints: InputHints) -> Self {
387         self.input_hints = Some(input_hints);
388         self
389     }
390 
input_purpose(mut self, input_purpose: InputPurpose) -> Self391     pub fn input_purpose(mut self, input_purpose: InputPurpose) -> Self {
392         self.input_purpose = Some(input_purpose);
393         self
394     }
395 
justification(mut self, justification: Justification) -> Self396     pub fn justification(mut self, justification: Justification) -> Self {
397         self.justification = Some(justification);
398         self
399     }
400 
left_margin(mut self, left_margin: i32) -> Self401     pub fn left_margin(mut self, left_margin: i32) -> Self {
402         self.left_margin = Some(left_margin);
403         self
404     }
405 
monospace(mut self, monospace: bool) -> Self406     pub fn monospace(mut self, monospace: bool) -> Self {
407         self.monospace = Some(monospace);
408         self
409     }
410 
overwrite(mut self, overwrite: bool) -> Self411     pub fn overwrite(mut self, overwrite: bool) -> Self {
412         self.overwrite = Some(overwrite);
413         self
414     }
415 
pixels_above_lines(mut self, pixels_above_lines: i32) -> Self416     pub fn pixels_above_lines(mut self, pixels_above_lines: i32) -> Self {
417         self.pixels_above_lines = Some(pixels_above_lines);
418         self
419     }
420 
pixels_below_lines(mut self, pixels_below_lines: i32) -> Self421     pub fn pixels_below_lines(mut self, pixels_below_lines: i32) -> Self {
422         self.pixels_below_lines = Some(pixels_below_lines);
423         self
424     }
425 
pixels_inside_wrap(mut self, pixels_inside_wrap: i32) -> Self426     pub fn pixels_inside_wrap(mut self, pixels_inside_wrap: i32) -> Self {
427         self.pixels_inside_wrap = Some(pixels_inside_wrap);
428         self
429     }
430 
populate_all(mut self, populate_all: bool) -> Self431     pub fn populate_all(mut self, populate_all: bool) -> Self {
432         self.populate_all = Some(populate_all);
433         self
434     }
435 
right_margin(mut self, right_margin: i32) -> Self436     pub fn right_margin(mut self, right_margin: i32) -> Self {
437         self.right_margin = Some(right_margin);
438         self
439     }
440 
tabs(mut self, tabs: &pango::TabArray) -> Self441     pub fn tabs(mut self, tabs: &pango::TabArray) -> Self {
442         self.tabs = Some(tabs.clone());
443         self
444     }
445 
446     #[cfg(any(feature = "v3_18", feature = "dox"))]
top_margin(mut self, top_margin: i32) -> Self447     pub fn top_margin(mut self, top_margin: i32) -> Self {
448         self.top_margin = Some(top_margin);
449         self
450     }
451 
wrap_mode(mut self, wrap_mode: WrapMode) -> Self452     pub fn wrap_mode(mut self, wrap_mode: WrapMode) -> Self {
453         self.wrap_mode = Some(wrap_mode);
454         self
455     }
456 
border_width(mut self, border_width: u32) -> Self457     pub fn border_width(mut self, border_width: u32) -> Self {
458         self.border_width = Some(border_width);
459         self
460     }
461 
child<P: IsA<Widget>>(mut self, child: &P) -> Self462     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
463         self.child = Some(child.clone().upcast());
464         self
465     }
466 
resize_mode(mut self, resize_mode: ResizeMode) -> Self467     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
468         self.resize_mode = Some(resize_mode);
469         self
470     }
471 
app_paintable(mut self, app_paintable: bool) -> Self472     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
473         self.app_paintable = Some(app_paintable);
474         self
475     }
476 
can_default(mut self, can_default: bool) -> Self477     pub fn can_default(mut self, can_default: bool) -> Self {
478         self.can_default = Some(can_default);
479         self
480     }
481 
can_focus(mut self, can_focus: bool) -> Self482     pub fn can_focus(mut self, can_focus: bool) -> Self {
483         self.can_focus = Some(can_focus);
484         self
485     }
486 
events(mut self, events: gdk::EventMask) -> Self487     pub fn events(mut self, events: gdk::EventMask) -> Self {
488         self.events = Some(events);
489         self
490     }
491 
expand(mut self, expand: bool) -> Self492     pub fn expand(mut self, expand: bool) -> Self {
493         self.expand = Some(expand);
494         self
495     }
496 
497     #[cfg(any(feature = "v3_20", feature = "dox"))]
focus_on_click(mut self, focus_on_click: bool) -> Self498     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
499         self.focus_on_click = Some(focus_on_click);
500         self
501     }
502 
halign(mut self, halign: Align) -> Self503     pub fn halign(mut self, halign: Align) -> Self {
504         self.halign = Some(halign);
505         self
506     }
507 
has_default(mut self, has_default: bool) -> Self508     pub fn has_default(mut self, has_default: bool) -> Self {
509         self.has_default = Some(has_default);
510         self
511     }
512 
has_focus(mut self, has_focus: bool) -> Self513     pub fn has_focus(mut self, has_focus: bool) -> Self {
514         self.has_focus = Some(has_focus);
515         self
516     }
517 
has_tooltip(mut self, has_tooltip: bool) -> Self518     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
519         self.has_tooltip = Some(has_tooltip);
520         self
521     }
522 
height_request(mut self, height_request: i32) -> Self523     pub fn height_request(mut self, height_request: i32) -> Self {
524         self.height_request = Some(height_request);
525         self
526     }
527 
hexpand(mut self, hexpand: bool) -> Self528     pub fn hexpand(mut self, hexpand: bool) -> Self {
529         self.hexpand = Some(hexpand);
530         self
531     }
532 
hexpand_set(mut self, hexpand_set: bool) -> Self533     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
534         self.hexpand_set = Some(hexpand_set);
535         self
536     }
537 
is_focus(mut self, is_focus: bool) -> Self538     pub fn is_focus(mut self, is_focus: bool) -> Self {
539         self.is_focus = Some(is_focus);
540         self
541     }
542 
margin(mut self, margin: i32) -> Self543     pub fn margin(mut self, margin: i32) -> Self {
544         self.margin = Some(margin);
545         self
546     }
547 
margin_bottom(mut self, margin_bottom: i32) -> Self548     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
549         self.margin_bottom = Some(margin_bottom);
550         self
551     }
552 
margin_end(mut self, margin_end: i32) -> Self553     pub fn margin_end(mut self, margin_end: i32) -> Self {
554         self.margin_end = Some(margin_end);
555         self
556     }
557 
margin_start(mut self, margin_start: i32) -> Self558     pub fn margin_start(mut self, margin_start: i32) -> Self {
559         self.margin_start = Some(margin_start);
560         self
561     }
562 
margin_top(mut self, margin_top: i32) -> Self563     pub fn margin_top(mut self, margin_top: i32) -> Self {
564         self.margin_top = Some(margin_top);
565         self
566     }
567 
name(mut self, name: &str) -> Self568     pub fn name(mut self, name: &str) -> Self {
569         self.name = Some(name.to_string());
570         self
571     }
572 
no_show_all(mut self, no_show_all: bool) -> Self573     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
574         self.no_show_all = Some(no_show_all);
575         self
576     }
577 
opacity(mut self, opacity: f64) -> Self578     pub fn opacity(mut self, opacity: f64) -> Self {
579         self.opacity = Some(opacity);
580         self
581     }
582 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self583     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
584         self.parent = Some(parent.clone().upcast());
585         self
586     }
587 
receives_default(mut self, receives_default: bool) -> Self588     pub fn receives_default(mut self, receives_default: bool) -> Self {
589         self.receives_default = Some(receives_default);
590         self
591     }
592 
sensitive(mut self, sensitive: bool) -> Self593     pub fn sensitive(mut self, sensitive: bool) -> Self {
594         self.sensitive = Some(sensitive);
595         self
596     }
597 
tooltip_markup(mut self, tooltip_markup: &str) -> Self598     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
599         self.tooltip_markup = Some(tooltip_markup.to_string());
600         self
601     }
602 
tooltip_text(mut self, tooltip_text: &str) -> Self603     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
604         self.tooltip_text = Some(tooltip_text.to_string());
605         self
606     }
607 
valign(mut self, valign: Align) -> Self608     pub fn valign(mut self, valign: Align) -> Self {
609         self.valign = Some(valign);
610         self
611     }
612 
vexpand(mut self, vexpand: bool) -> Self613     pub fn vexpand(mut self, vexpand: bool) -> Self {
614         self.vexpand = Some(vexpand);
615         self
616     }
617 
vexpand_set(mut self, vexpand_set: bool) -> Self618     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
619         self.vexpand_set = Some(vexpand_set);
620         self
621     }
622 
visible(mut self, visible: bool) -> Self623     pub fn visible(mut self, visible: bool) -> Self {
624         self.visible = Some(visible);
625         self
626     }
627 
width_request(mut self, width_request: i32) -> Self628     pub fn width_request(mut self, width_request: i32) -> Self {
629         self.width_request = Some(width_request);
630         self
631     }
632 
hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self633     pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self {
634         self.hadjustment = Some(hadjustment.clone().upcast());
635         self
636     }
637 
hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self638     pub fn hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self {
639         self.hscroll_policy = Some(hscroll_policy);
640         self
641     }
642 
vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self643     pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self {
644         self.vadjustment = Some(vadjustment.clone().upcast());
645         self
646     }
647 
vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self648     pub fn vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self {
649         self.vscroll_policy = Some(vscroll_policy);
650         self
651     }
652 }
653 
654 pub const NONE_TEXT_VIEW: Option<&TextView> = None;
655 
656 pub trait TextViewExt: 'static {
add_child_at_anchor<P: IsA<Widget>, Q: IsA<TextChildAnchor>>(&self, child: &P, anchor: &Q)657     fn add_child_at_anchor<P: IsA<Widget>, Q: IsA<TextChildAnchor>>(&self, child: &P, anchor: &Q);
658 
add_child_in_window<P: IsA<Widget>>( &self, child: &P, which_window: TextWindowType, xpos: i32, ypos: i32, )659     fn add_child_in_window<P: IsA<Widget>>(
660         &self,
661         child: &P,
662         which_window: TextWindowType,
663         xpos: i32,
664         ypos: i32,
665     );
666 
backward_display_line(&self, iter: &mut TextIter) -> bool667     fn backward_display_line(&self, iter: &mut TextIter) -> bool;
668 
backward_display_line_start(&self, iter: &mut TextIter) -> bool669     fn backward_display_line_start(&self, iter: &mut TextIter) -> bool;
670 
buffer_to_window_coords( &self, win: TextWindowType, buffer_x: i32, buffer_y: i32, ) -> (i32, i32)671     fn buffer_to_window_coords(
672         &self,
673         win: TextWindowType,
674         buffer_x: i32,
675         buffer_y: i32,
676     ) -> (i32, i32);
677 
forward_display_line(&self, iter: &mut TextIter) -> bool678     fn forward_display_line(&self, iter: &mut TextIter) -> bool;
679 
forward_display_line_end(&self, iter: &mut TextIter) -> bool680     fn forward_display_line_end(&self, iter: &mut TextIter) -> bool;
681 
get_accepts_tab(&self) -> bool682     fn get_accepts_tab(&self) -> bool;
683 
get_border_window_size(&self, type_: TextWindowType) -> i32684     fn get_border_window_size(&self, type_: TextWindowType) -> i32;
685 
686     #[cfg(any(feature = "v3_18", feature = "dox"))]
get_bottom_margin(&self) -> i32687     fn get_bottom_margin(&self) -> i32;
688 
get_buffer(&self) -> Option<TextBuffer>689     fn get_buffer(&self) -> Option<TextBuffer>;
690 
get_cursor_locations(&self, iter: Option<&TextIter>) -> (gdk::Rectangle, gdk::Rectangle)691     fn get_cursor_locations(&self, iter: Option<&TextIter>) -> (gdk::Rectangle, gdk::Rectangle);
692 
get_cursor_visible(&self) -> bool693     fn get_cursor_visible(&self) -> bool;
694 
get_default_attributes(&self) -> TextAttributes695     fn get_default_attributes(&self) -> TextAttributes;
696 
get_editable(&self) -> bool697     fn get_editable(&self) -> bool;
698 
get_indent(&self) -> i32699     fn get_indent(&self) -> i32;
700 
get_input_hints(&self) -> InputHints701     fn get_input_hints(&self) -> InputHints;
702 
get_input_purpose(&self) -> InputPurpose703     fn get_input_purpose(&self) -> InputPurpose;
704 
get_iter_at_location(&self, x: i32, y: i32) -> Option<TextIter>705     fn get_iter_at_location(&self, x: i32, y: i32) -> Option<TextIter>;
706 
get_iter_at_position(&self, x: i32, y: i32) -> Option<(TextIter, i32)>707     fn get_iter_at_position(&self, x: i32, y: i32) -> Option<(TextIter, i32)>;
708 
get_iter_location(&self, iter: &TextIter) -> gdk::Rectangle709     fn get_iter_location(&self, iter: &TextIter) -> gdk::Rectangle;
710 
get_justification(&self) -> Justification711     fn get_justification(&self) -> Justification;
712 
get_left_margin(&self) -> i32713     fn get_left_margin(&self) -> i32;
714 
get_line_at_y(&self, y: i32) -> (TextIter, i32)715     fn get_line_at_y(&self, y: i32) -> (TextIter, i32);
716 
get_line_yrange(&self, iter: &TextIter) -> (i32, i32)717     fn get_line_yrange(&self, iter: &TextIter) -> (i32, i32);
718 
719     #[cfg(any(feature = "v3_16", feature = "dox"))]
get_monospace(&self) -> bool720     fn get_monospace(&self) -> bool;
721 
get_overwrite(&self) -> bool722     fn get_overwrite(&self) -> bool;
723 
get_pixels_above_lines(&self) -> i32724     fn get_pixels_above_lines(&self) -> i32;
725 
get_pixels_below_lines(&self) -> i32726     fn get_pixels_below_lines(&self) -> i32;
727 
get_pixels_inside_wrap(&self) -> i32728     fn get_pixels_inside_wrap(&self) -> i32;
729 
get_right_margin(&self) -> i32730     fn get_right_margin(&self) -> i32;
731 
get_tabs(&self) -> Option<pango::TabArray>732     fn get_tabs(&self) -> Option<pango::TabArray>;
733 
734     #[cfg(any(feature = "v3_18", feature = "dox"))]
get_top_margin(&self) -> i32735     fn get_top_margin(&self) -> i32;
736 
get_visible_rect(&self) -> gdk::Rectangle737     fn get_visible_rect(&self) -> gdk::Rectangle;
738 
get_window(&self, win: TextWindowType) -> Option<gdk::Window>739     fn get_window(&self, win: TextWindowType) -> Option<gdk::Window>;
740 
get_window_type<P: IsA<gdk::Window>>(&self, window: &P) -> TextWindowType741     fn get_window_type<P: IsA<gdk::Window>>(&self, window: &P) -> TextWindowType;
742 
get_wrap_mode(&self) -> WrapMode743     fn get_wrap_mode(&self) -> WrapMode;
744 
im_context_filter_keypress(&self, event: &gdk::EventKey) -> bool745     fn im_context_filter_keypress(&self, event: &gdk::EventKey) -> bool;
746 
move_child<P: IsA<Widget>>(&self, child: &P, xpos: i32, ypos: i32)747     fn move_child<P: IsA<Widget>>(&self, child: &P, xpos: i32, ypos: i32);
748 
move_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P) -> bool749     fn move_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P) -> bool;
750 
move_visually(&self, iter: &mut TextIter, count: i32) -> bool751     fn move_visually(&self, iter: &mut TextIter, count: i32) -> bool;
752 
place_cursor_onscreen(&self) -> bool753     fn place_cursor_onscreen(&self) -> bool;
754 
755     #[cfg(any(feature = "v3_20", feature = "dox"))]
reset_cursor_blink(&self)756     fn reset_cursor_blink(&self);
757 
reset_im_context(&self)758     fn reset_im_context(&self);
759 
scroll_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P)760     fn scroll_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P);
761 
scroll_to_iter( &self, iter: &mut TextIter, within_margin: f64, use_align: bool, xalign: f64, yalign: f64, ) -> bool762     fn scroll_to_iter(
763         &self,
764         iter: &mut TextIter,
765         within_margin: f64,
766         use_align: bool,
767         xalign: f64,
768         yalign: f64,
769     ) -> bool;
770 
scroll_to_mark<P: IsA<TextMark>>( &self, mark: &P, within_margin: f64, use_align: bool, xalign: f64, yalign: f64, )771     fn scroll_to_mark<P: IsA<TextMark>>(
772         &self,
773         mark: &P,
774         within_margin: f64,
775         use_align: bool,
776         xalign: f64,
777         yalign: f64,
778     );
779 
set_accepts_tab(&self, accepts_tab: bool)780     fn set_accepts_tab(&self, accepts_tab: bool);
781 
set_border_window_size(&self, type_: TextWindowType, size: i32)782     fn set_border_window_size(&self, type_: TextWindowType, size: i32);
783 
784     #[cfg(any(feature = "v3_18", feature = "dox"))]
set_bottom_margin(&self, bottom_margin: i32)785     fn set_bottom_margin(&self, bottom_margin: i32);
786 
set_buffer<P: IsA<TextBuffer>>(&self, buffer: Option<&P>)787     fn set_buffer<P: IsA<TextBuffer>>(&self, buffer: Option<&P>);
788 
set_cursor_visible(&self, setting: bool)789     fn set_cursor_visible(&self, setting: bool);
790 
set_editable(&self, setting: bool)791     fn set_editable(&self, setting: bool);
792 
set_indent(&self, indent: i32)793     fn set_indent(&self, indent: i32);
794 
set_input_hints(&self, hints: InputHints)795     fn set_input_hints(&self, hints: InputHints);
796 
set_input_purpose(&self, purpose: InputPurpose)797     fn set_input_purpose(&self, purpose: InputPurpose);
798 
set_justification(&self, justification: Justification)799     fn set_justification(&self, justification: Justification);
800 
set_left_margin(&self, left_margin: i32)801     fn set_left_margin(&self, left_margin: i32);
802 
803     #[cfg(any(feature = "v3_16", feature = "dox"))]
set_monospace(&self, monospace: bool)804     fn set_monospace(&self, monospace: bool);
805 
set_overwrite(&self, overwrite: bool)806     fn set_overwrite(&self, overwrite: bool);
807 
set_pixels_above_lines(&self, pixels_above_lines: i32)808     fn set_pixels_above_lines(&self, pixels_above_lines: i32);
809 
set_pixels_below_lines(&self, pixels_below_lines: i32)810     fn set_pixels_below_lines(&self, pixels_below_lines: i32);
811 
set_pixels_inside_wrap(&self, pixels_inside_wrap: i32)812     fn set_pixels_inside_wrap(&self, pixels_inside_wrap: i32);
813 
set_right_margin(&self, right_margin: i32)814     fn set_right_margin(&self, right_margin: i32);
815 
set_tabs(&self, tabs: &pango::TabArray)816     fn set_tabs(&self, tabs: &pango::TabArray);
817 
818     #[cfg(any(feature = "v3_18", feature = "dox"))]
set_top_margin(&self, top_margin: i32)819     fn set_top_margin(&self, top_margin: i32);
820 
set_wrap_mode(&self, wrap_mode: WrapMode)821     fn set_wrap_mode(&self, wrap_mode: WrapMode);
822 
starts_display_line(&self, iter: &TextIter) -> bool823     fn starts_display_line(&self, iter: &TextIter) -> bool;
824 
window_to_buffer_coords( &self, win: TextWindowType, window_x: i32, window_y: i32, ) -> (i32, i32)825     fn window_to_buffer_coords(
826         &self,
827         win: TextWindowType,
828         window_x: i32,
829         window_y: i32,
830     ) -> (i32, i32);
831 
get_property_im_module(&self) -> Option<GString>832     fn get_property_im_module(&self) -> Option<GString>;
833 
set_property_im_module(&self, im_module: Option<&str>)834     fn set_property_im_module(&self, im_module: Option<&str>);
835 
get_property_monospace(&self) -> bool836     fn get_property_monospace(&self) -> bool;
837 
set_property_monospace(&self, monospace: bool)838     fn set_property_monospace(&self, monospace: bool);
839 
get_property_populate_all(&self) -> bool840     fn get_property_populate_all(&self) -> bool;
841 
set_property_populate_all(&self, populate_all: bool)842     fn set_property_populate_all(&self, populate_all: bool);
843 
connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId844     fn connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
845 
emit_backspace(&self)846     fn emit_backspace(&self);
847 
connect_copy_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId848     fn connect_copy_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
849 
emit_copy_clipboard(&self)850     fn emit_copy_clipboard(&self);
851 
connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId852     fn connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
853 
emit_cut_clipboard(&self)854     fn emit_cut_clipboard(&self);
855 
connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>( &self, f: F, ) -> SignalHandlerId856     fn connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>(
857         &self,
858         f: F,
859     ) -> SignalHandlerId;
860 
emit_delete_from_cursor(&self, type_: DeleteType, count: i32)861     fn emit_delete_from_cursor(&self, type_: DeleteType, count: i32);
862 
863     #[cfg(any(feature = "v3_16", feature = "dox"))]
connect_extend_selection< F: Fn(&Self, TextExtendSelection, &TextIter, &TextIter, &TextIter) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId864     fn connect_extend_selection<
865         F: Fn(&Self, TextExtendSelection, &TextIter, &TextIter, &TextIter) -> glib::signal::Inhibit
866             + 'static,
867     >(
868         &self,
869         f: F,
870     ) -> SignalHandlerId;
871 
connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId872     fn connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId;
873 
emit_insert_at_cursor(&self, string: &str)874     fn emit_insert_at_cursor(&self, string: &str);
875 
876     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId877     fn connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
878 
879     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
emit_insert_emoji(&self)880     fn emit_insert_emoji(&self);
881 
connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>( &self, f: F, ) -> SignalHandlerId882     fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>(
883         &self,
884         f: F,
885     ) -> SignalHandlerId;
886 
emit_move_cursor(&self, step: MovementStep, count: i32, extend_selection: bool)887     fn emit_move_cursor(&self, step: MovementStep, count: i32, extend_selection: bool);
888 
connect_move_viewport<F: Fn(&Self, ScrollStep, i32) + 'static>( &self, f: F, ) -> SignalHandlerId889     fn connect_move_viewport<F: Fn(&Self, ScrollStep, i32) + 'static>(
890         &self,
891         f: F,
892     ) -> SignalHandlerId;
893 
emit_move_viewport(&self, step: ScrollStep, count: i32)894     fn emit_move_viewport(&self, step: ScrollStep, count: i32);
895 
connect_paste_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId896     fn connect_paste_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
897 
emit_paste_clipboard(&self)898     fn emit_paste_clipboard(&self);
899 
connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId900     fn connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId;
901 
connect_preedit_changed<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId902     fn connect_preedit_changed<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId;
903 
emit_preedit_changed(&self, preedit: &str)904     fn emit_preedit_changed(&self, preedit: &str);
905 
connect_select_all<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId906     fn connect_select_all<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId;
907 
emit_select_all(&self, select: bool)908     fn emit_select_all(&self, select: bool);
909 
connect_set_anchor<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId910     fn connect_set_anchor<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
911 
emit_set_anchor(&self)912     fn emit_set_anchor(&self);
913 
connect_toggle_cursor_visible<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId914     fn connect_toggle_cursor_visible<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
915 
emit_toggle_cursor_visible(&self)916     fn emit_toggle_cursor_visible(&self);
917 
connect_toggle_overwrite<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId918     fn connect_toggle_overwrite<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
919 
emit_toggle_overwrite(&self)920     fn emit_toggle_overwrite(&self);
921 
connect_property_accepts_tab_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId922     fn connect_property_accepts_tab_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
923 
924     #[cfg(any(feature = "v3_18", feature = "dox"))]
connect_property_bottom_margin_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId925     fn connect_property_bottom_margin_notify<F: Fn(&Self) + 'static>(
926         &self,
927         f: F,
928     ) -> SignalHandlerId;
929 
connect_property_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId930     fn connect_property_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
931 
connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId932     fn connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>(
933         &self,
934         f: F,
935     ) -> SignalHandlerId;
936 
connect_property_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId937     fn connect_property_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
938 
connect_property_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId939     fn connect_property_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
940 
connect_property_indent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId941     fn connect_property_indent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
942 
connect_property_input_hints_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId943     fn connect_property_input_hints_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
944 
connect_property_input_purpose_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId945     fn connect_property_input_purpose_notify<F: Fn(&Self) + 'static>(
946         &self,
947         f: F,
948     ) -> SignalHandlerId;
949 
connect_property_justification_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId950     fn connect_property_justification_notify<F: Fn(&Self) + 'static>(
951         &self,
952         f: F,
953     ) -> SignalHandlerId;
954 
connect_property_left_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId955     fn connect_property_left_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
956 
connect_property_monospace_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId957     fn connect_property_monospace_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
958 
connect_property_overwrite_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId959     fn connect_property_overwrite_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
960 
connect_property_pixels_above_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId961     fn connect_property_pixels_above_lines_notify<F: Fn(&Self) + 'static>(
962         &self,
963         f: F,
964     ) -> SignalHandlerId;
965 
connect_property_pixels_below_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId966     fn connect_property_pixels_below_lines_notify<F: Fn(&Self) + 'static>(
967         &self,
968         f: F,
969     ) -> SignalHandlerId;
970 
connect_property_pixels_inside_wrap_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId971     fn connect_property_pixels_inside_wrap_notify<F: Fn(&Self) + 'static>(
972         &self,
973         f: F,
974     ) -> SignalHandlerId;
975 
connect_property_populate_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId976     fn connect_property_populate_all_notify<F: Fn(&Self) + 'static>(&self, f: F)
977         -> SignalHandlerId;
978 
connect_property_right_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId979     fn connect_property_right_margin_notify<F: Fn(&Self) + 'static>(&self, f: F)
980         -> SignalHandlerId;
981 
connect_property_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId982     fn connect_property_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
983 
984     #[cfg(any(feature = "v3_18", feature = "dox"))]
connect_property_top_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId985     fn connect_property_top_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
986 
connect_property_wrap_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId987     fn connect_property_wrap_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
988 }
989 
990 impl<O: IsA<TextView>> TextViewExt for O {
add_child_at_anchor<P: IsA<Widget>, Q: IsA<TextChildAnchor>>(&self, child: &P, anchor: &Q)991     fn add_child_at_anchor<P: IsA<Widget>, Q: IsA<TextChildAnchor>>(&self, child: &P, anchor: &Q) {
992         unsafe {
993             gtk_sys::gtk_text_view_add_child_at_anchor(
994                 self.as_ref().to_glib_none().0,
995                 child.as_ref().to_glib_none().0,
996                 anchor.as_ref().to_glib_none().0,
997             );
998         }
999     }
1000 
add_child_in_window<P: IsA<Widget>>( &self, child: &P, which_window: TextWindowType, xpos: i32, ypos: i32, )1001     fn add_child_in_window<P: IsA<Widget>>(
1002         &self,
1003         child: &P,
1004         which_window: TextWindowType,
1005         xpos: i32,
1006         ypos: i32,
1007     ) {
1008         unsafe {
1009             gtk_sys::gtk_text_view_add_child_in_window(
1010                 self.as_ref().to_glib_none().0,
1011                 child.as_ref().to_glib_none().0,
1012                 which_window.to_glib(),
1013                 xpos,
1014                 ypos,
1015             );
1016         }
1017     }
1018 
backward_display_line(&self, iter: &mut TextIter) -> bool1019     fn backward_display_line(&self, iter: &mut TextIter) -> bool {
1020         unsafe {
1021             from_glib(gtk_sys::gtk_text_view_backward_display_line(
1022                 self.as_ref().to_glib_none().0,
1023                 iter.to_glib_none_mut().0,
1024             ))
1025         }
1026     }
1027 
backward_display_line_start(&self, iter: &mut TextIter) -> bool1028     fn backward_display_line_start(&self, iter: &mut TextIter) -> bool {
1029         unsafe {
1030             from_glib(gtk_sys::gtk_text_view_backward_display_line_start(
1031                 self.as_ref().to_glib_none().0,
1032                 iter.to_glib_none_mut().0,
1033             ))
1034         }
1035     }
1036 
buffer_to_window_coords( &self, win: TextWindowType, buffer_x: i32, buffer_y: i32, ) -> (i32, i32)1037     fn buffer_to_window_coords(
1038         &self,
1039         win: TextWindowType,
1040         buffer_x: i32,
1041         buffer_y: i32,
1042     ) -> (i32, i32) {
1043         unsafe {
1044             let mut window_x = mem::MaybeUninit::uninit();
1045             let mut window_y = mem::MaybeUninit::uninit();
1046             gtk_sys::gtk_text_view_buffer_to_window_coords(
1047                 self.as_ref().to_glib_none().0,
1048                 win.to_glib(),
1049                 buffer_x,
1050                 buffer_y,
1051                 window_x.as_mut_ptr(),
1052                 window_y.as_mut_ptr(),
1053             );
1054             let window_x = window_x.assume_init();
1055             let window_y = window_y.assume_init();
1056             (window_x, window_y)
1057         }
1058     }
1059 
forward_display_line(&self, iter: &mut TextIter) -> bool1060     fn forward_display_line(&self, iter: &mut TextIter) -> bool {
1061         unsafe {
1062             from_glib(gtk_sys::gtk_text_view_forward_display_line(
1063                 self.as_ref().to_glib_none().0,
1064                 iter.to_glib_none_mut().0,
1065             ))
1066         }
1067     }
1068 
forward_display_line_end(&self, iter: &mut TextIter) -> bool1069     fn forward_display_line_end(&self, iter: &mut TextIter) -> bool {
1070         unsafe {
1071             from_glib(gtk_sys::gtk_text_view_forward_display_line_end(
1072                 self.as_ref().to_glib_none().0,
1073                 iter.to_glib_none_mut().0,
1074             ))
1075         }
1076     }
1077 
get_accepts_tab(&self) -> bool1078     fn get_accepts_tab(&self) -> bool {
1079         unsafe {
1080             from_glib(gtk_sys::gtk_text_view_get_accepts_tab(
1081                 self.as_ref().to_glib_none().0,
1082             ))
1083         }
1084     }
1085 
get_border_window_size(&self, type_: TextWindowType) -> i321086     fn get_border_window_size(&self, type_: TextWindowType) -> i32 {
1087         unsafe {
1088             gtk_sys::gtk_text_view_get_border_window_size(
1089                 self.as_ref().to_glib_none().0,
1090                 type_.to_glib(),
1091             )
1092         }
1093     }
1094 
1095     #[cfg(any(feature = "v3_18", feature = "dox"))]
get_bottom_margin(&self) -> i321096     fn get_bottom_margin(&self) -> i32 {
1097         unsafe { gtk_sys::gtk_text_view_get_bottom_margin(self.as_ref().to_glib_none().0) }
1098     }
1099 
get_buffer(&self) -> Option<TextBuffer>1100     fn get_buffer(&self) -> Option<TextBuffer> {
1101         unsafe {
1102             from_glib_none(gtk_sys::gtk_text_view_get_buffer(
1103                 self.as_ref().to_glib_none().0,
1104             ))
1105         }
1106     }
1107 
get_cursor_locations(&self, iter: Option<&TextIter>) -> (gdk::Rectangle, gdk::Rectangle)1108     fn get_cursor_locations(&self, iter: Option<&TextIter>) -> (gdk::Rectangle, gdk::Rectangle) {
1109         unsafe {
1110             let mut strong = gdk::Rectangle::uninitialized();
1111             let mut weak = gdk::Rectangle::uninitialized();
1112             gtk_sys::gtk_text_view_get_cursor_locations(
1113                 self.as_ref().to_glib_none().0,
1114                 iter.to_glib_none().0,
1115                 strong.to_glib_none_mut().0,
1116                 weak.to_glib_none_mut().0,
1117             );
1118             (strong, weak)
1119         }
1120     }
1121 
get_cursor_visible(&self) -> bool1122     fn get_cursor_visible(&self) -> bool {
1123         unsafe {
1124             from_glib(gtk_sys::gtk_text_view_get_cursor_visible(
1125                 self.as_ref().to_glib_none().0,
1126             ))
1127         }
1128     }
1129 
get_default_attributes(&self) -> TextAttributes1130     fn get_default_attributes(&self) -> TextAttributes {
1131         unsafe {
1132             from_glib_full(gtk_sys::gtk_text_view_get_default_attributes(
1133                 self.as_ref().to_glib_none().0,
1134             ))
1135         }
1136     }
1137 
get_editable(&self) -> bool1138     fn get_editable(&self) -> bool {
1139         unsafe {
1140             from_glib(gtk_sys::gtk_text_view_get_editable(
1141                 self.as_ref().to_glib_none().0,
1142             ))
1143         }
1144     }
1145 
get_indent(&self) -> i321146     fn get_indent(&self) -> i32 {
1147         unsafe { gtk_sys::gtk_text_view_get_indent(self.as_ref().to_glib_none().0) }
1148     }
1149 
get_input_hints(&self) -> InputHints1150     fn get_input_hints(&self) -> InputHints {
1151         unsafe {
1152             from_glib(gtk_sys::gtk_text_view_get_input_hints(
1153                 self.as_ref().to_glib_none().0,
1154             ))
1155         }
1156     }
1157 
get_input_purpose(&self) -> InputPurpose1158     fn get_input_purpose(&self) -> InputPurpose {
1159         unsafe {
1160             from_glib(gtk_sys::gtk_text_view_get_input_purpose(
1161                 self.as_ref().to_glib_none().0,
1162             ))
1163         }
1164     }
1165 
get_iter_at_location(&self, x: i32, y: i32) -> Option<TextIter>1166     fn get_iter_at_location(&self, x: i32, y: i32) -> Option<TextIter> {
1167         unsafe {
1168             let mut iter = TextIter::uninitialized();
1169             let ret = from_glib(gtk_sys::gtk_text_view_get_iter_at_location(
1170                 self.as_ref().to_glib_none().0,
1171                 iter.to_glib_none_mut().0,
1172                 x,
1173                 y,
1174             ));
1175             if ret {
1176                 Some(iter)
1177             } else {
1178                 None
1179             }
1180         }
1181     }
1182 
get_iter_at_position(&self, x: i32, y: i32) -> Option<(TextIter, i32)>1183     fn get_iter_at_position(&self, x: i32, y: i32) -> Option<(TextIter, i32)> {
1184         unsafe {
1185             let mut iter = TextIter::uninitialized();
1186             let mut trailing = mem::MaybeUninit::uninit();
1187             let ret = from_glib(gtk_sys::gtk_text_view_get_iter_at_position(
1188                 self.as_ref().to_glib_none().0,
1189                 iter.to_glib_none_mut().0,
1190                 trailing.as_mut_ptr(),
1191                 x,
1192                 y,
1193             ));
1194             let trailing = trailing.assume_init();
1195             if ret {
1196                 Some((iter, trailing))
1197             } else {
1198                 None
1199             }
1200         }
1201     }
1202 
get_iter_location(&self, iter: &TextIter) -> gdk::Rectangle1203     fn get_iter_location(&self, iter: &TextIter) -> gdk::Rectangle {
1204         unsafe {
1205             let mut location = gdk::Rectangle::uninitialized();
1206             gtk_sys::gtk_text_view_get_iter_location(
1207                 self.as_ref().to_glib_none().0,
1208                 iter.to_glib_none().0,
1209                 location.to_glib_none_mut().0,
1210             );
1211             location
1212         }
1213     }
1214 
get_justification(&self) -> Justification1215     fn get_justification(&self) -> Justification {
1216         unsafe {
1217             from_glib(gtk_sys::gtk_text_view_get_justification(
1218                 self.as_ref().to_glib_none().0,
1219             ))
1220         }
1221     }
1222 
get_left_margin(&self) -> i321223     fn get_left_margin(&self) -> i32 {
1224         unsafe { gtk_sys::gtk_text_view_get_left_margin(self.as_ref().to_glib_none().0) }
1225     }
1226 
get_line_at_y(&self, y: i32) -> (TextIter, i32)1227     fn get_line_at_y(&self, y: i32) -> (TextIter, i32) {
1228         unsafe {
1229             let mut target_iter = TextIter::uninitialized();
1230             let mut line_top = mem::MaybeUninit::uninit();
1231             gtk_sys::gtk_text_view_get_line_at_y(
1232                 self.as_ref().to_glib_none().0,
1233                 target_iter.to_glib_none_mut().0,
1234                 y,
1235                 line_top.as_mut_ptr(),
1236             );
1237             let line_top = line_top.assume_init();
1238             (target_iter, line_top)
1239         }
1240     }
1241 
get_line_yrange(&self, iter: &TextIter) -> (i32, i32)1242     fn get_line_yrange(&self, iter: &TextIter) -> (i32, i32) {
1243         unsafe {
1244             let mut y = mem::MaybeUninit::uninit();
1245             let mut height = mem::MaybeUninit::uninit();
1246             gtk_sys::gtk_text_view_get_line_yrange(
1247                 self.as_ref().to_glib_none().0,
1248                 iter.to_glib_none().0,
1249                 y.as_mut_ptr(),
1250                 height.as_mut_ptr(),
1251             );
1252             let y = y.assume_init();
1253             let height = height.assume_init();
1254             (y, height)
1255         }
1256     }
1257 
1258     #[cfg(any(feature = "v3_16", feature = "dox"))]
get_monospace(&self) -> bool1259     fn get_monospace(&self) -> bool {
1260         unsafe {
1261             from_glib(gtk_sys::gtk_text_view_get_monospace(
1262                 self.as_ref().to_glib_none().0,
1263             ))
1264         }
1265     }
1266 
get_overwrite(&self) -> bool1267     fn get_overwrite(&self) -> bool {
1268         unsafe {
1269             from_glib(gtk_sys::gtk_text_view_get_overwrite(
1270                 self.as_ref().to_glib_none().0,
1271             ))
1272         }
1273     }
1274 
get_pixels_above_lines(&self) -> i321275     fn get_pixels_above_lines(&self) -> i32 {
1276         unsafe { gtk_sys::gtk_text_view_get_pixels_above_lines(self.as_ref().to_glib_none().0) }
1277     }
1278 
get_pixels_below_lines(&self) -> i321279     fn get_pixels_below_lines(&self) -> i32 {
1280         unsafe { gtk_sys::gtk_text_view_get_pixels_below_lines(self.as_ref().to_glib_none().0) }
1281     }
1282 
get_pixels_inside_wrap(&self) -> i321283     fn get_pixels_inside_wrap(&self) -> i32 {
1284         unsafe { gtk_sys::gtk_text_view_get_pixels_inside_wrap(self.as_ref().to_glib_none().0) }
1285     }
1286 
get_right_margin(&self) -> i321287     fn get_right_margin(&self) -> i32 {
1288         unsafe { gtk_sys::gtk_text_view_get_right_margin(self.as_ref().to_glib_none().0) }
1289     }
1290 
get_tabs(&self) -> Option<pango::TabArray>1291     fn get_tabs(&self) -> Option<pango::TabArray> {
1292         unsafe {
1293             from_glib_full(gtk_sys::gtk_text_view_get_tabs(
1294                 self.as_ref().to_glib_none().0,
1295             ))
1296         }
1297     }
1298 
1299     #[cfg(any(feature = "v3_18", feature = "dox"))]
get_top_margin(&self) -> i321300     fn get_top_margin(&self) -> i32 {
1301         unsafe { gtk_sys::gtk_text_view_get_top_margin(self.as_ref().to_glib_none().0) }
1302     }
1303 
get_visible_rect(&self) -> gdk::Rectangle1304     fn get_visible_rect(&self) -> gdk::Rectangle {
1305         unsafe {
1306             let mut visible_rect = gdk::Rectangle::uninitialized();
1307             gtk_sys::gtk_text_view_get_visible_rect(
1308                 self.as_ref().to_glib_none().0,
1309                 visible_rect.to_glib_none_mut().0,
1310             );
1311             visible_rect
1312         }
1313     }
1314 
get_window(&self, win: TextWindowType) -> Option<gdk::Window>1315     fn get_window(&self, win: TextWindowType) -> Option<gdk::Window> {
1316         unsafe {
1317             from_glib_none(gtk_sys::gtk_text_view_get_window(
1318                 self.as_ref().to_glib_none().0,
1319                 win.to_glib(),
1320             ))
1321         }
1322     }
1323 
get_window_type<P: IsA<gdk::Window>>(&self, window: &P) -> TextWindowType1324     fn get_window_type<P: IsA<gdk::Window>>(&self, window: &P) -> TextWindowType {
1325         unsafe {
1326             from_glib(gtk_sys::gtk_text_view_get_window_type(
1327                 self.as_ref().to_glib_none().0,
1328                 window.as_ref().to_glib_none().0,
1329             ))
1330         }
1331     }
1332 
get_wrap_mode(&self) -> WrapMode1333     fn get_wrap_mode(&self) -> WrapMode {
1334         unsafe {
1335             from_glib(gtk_sys::gtk_text_view_get_wrap_mode(
1336                 self.as_ref().to_glib_none().0,
1337             ))
1338         }
1339     }
1340 
im_context_filter_keypress(&self, event: &gdk::EventKey) -> bool1341     fn im_context_filter_keypress(&self, event: &gdk::EventKey) -> bool {
1342         unsafe {
1343             from_glib(gtk_sys::gtk_text_view_im_context_filter_keypress(
1344                 self.as_ref().to_glib_none().0,
1345                 mut_override(event.to_glib_none().0),
1346             ))
1347         }
1348     }
1349 
move_child<P: IsA<Widget>>(&self, child: &P, xpos: i32, ypos: i32)1350     fn move_child<P: IsA<Widget>>(&self, child: &P, xpos: i32, ypos: i32) {
1351         unsafe {
1352             gtk_sys::gtk_text_view_move_child(
1353                 self.as_ref().to_glib_none().0,
1354                 child.as_ref().to_glib_none().0,
1355                 xpos,
1356                 ypos,
1357             );
1358         }
1359     }
1360 
move_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P) -> bool1361     fn move_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P) -> bool {
1362         unsafe {
1363             from_glib(gtk_sys::gtk_text_view_move_mark_onscreen(
1364                 self.as_ref().to_glib_none().0,
1365                 mark.as_ref().to_glib_none().0,
1366             ))
1367         }
1368     }
1369 
move_visually(&self, iter: &mut TextIter, count: i32) -> bool1370     fn move_visually(&self, iter: &mut TextIter, count: i32) -> bool {
1371         unsafe {
1372             from_glib(gtk_sys::gtk_text_view_move_visually(
1373                 self.as_ref().to_glib_none().0,
1374                 iter.to_glib_none_mut().0,
1375                 count,
1376             ))
1377         }
1378     }
1379 
place_cursor_onscreen(&self) -> bool1380     fn place_cursor_onscreen(&self) -> bool {
1381         unsafe {
1382             from_glib(gtk_sys::gtk_text_view_place_cursor_onscreen(
1383                 self.as_ref().to_glib_none().0,
1384             ))
1385         }
1386     }
1387 
1388     #[cfg(any(feature = "v3_20", feature = "dox"))]
reset_cursor_blink(&self)1389     fn reset_cursor_blink(&self) {
1390         unsafe {
1391             gtk_sys::gtk_text_view_reset_cursor_blink(self.as_ref().to_glib_none().0);
1392         }
1393     }
1394 
reset_im_context(&self)1395     fn reset_im_context(&self) {
1396         unsafe {
1397             gtk_sys::gtk_text_view_reset_im_context(self.as_ref().to_glib_none().0);
1398         }
1399     }
1400 
scroll_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P)1401     fn scroll_mark_onscreen<P: IsA<TextMark>>(&self, mark: &P) {
1402         unsafe {
1403             gtk_sys::gtk_text_view_scroll_mark_onscreen(
1404                 self.as_ref().to_glib_none().0,
1405                 mark.as_ref().to_glib_none().0,
1406             );
1407         }
1408     }
1409 
scroll_to_iter( &self, iter: &mut TextIter, within_margin: f64, use_align: bool, xalign: f64, yalign: f64, ) -> bool1410     fn scroll_to_iter(
1411         &self,
1412         iter: &mut TextIter,
1413         within_margin: f64,
1414         use_align: bool,
1415         xalign: f64,
1416         yalign: f64,
1417     ) -> bool {
1418         unsafe {
1419             from_glib(gtk_sys::gtk_text_view_scroll_to_iter(
1420                 self.as_ref().to_glib_none().0,
1421                 iter.to_glib_none_mut().0,
1422                 within_margin,
1423                 use_align.to_glib(),
1424                 xalign,
1425                 yalign,
1426             ))
1427         }
1428     }
1429 
scroll_to_mark<P: IsA<TextMark>>( &self, mark: &P, within_margin: f64, use_align: bool, xalign: f64, yalign: f64, )1430     fn scroll_to_mark<P: IsA<TextMark>>(
1431         &self,
1432         mark: &P,
1433         within_margin: f64,
1434         use_align: bool,
1435         xalign: f64,
1436         yalign: f64,
1437     ) {
1438         unsafe {
1439             gtk_sys::gtk_text_view_scroll_to_mark(
1440                 self.as_ref().to_glib_none().0,
1441                 mark.as_ref().to_glib_none().0,
1442                 within_margin,
1443                 use_align.to_glib(),
1444                 xalign,
1445                 yalign,
1446             );
1447         }
1448     }
1449 
set_accepts_tab(&self, accepts_tab: bool)1450     fn set_accepts_tab(&self, accepts_tab: bool) {
1451         unsafe {
1452             gtk_sys::gtk_text_view_set_accepts_tab(
1453                 self.as_ref().to_glib_none().0,
1454                 accepts_tab.to_glib(),
1455             );
1456         }
1457     }
1458 
set_border_window_size(&self, type_: TextWindowType, size: i32)1459     fn set_border_window_size(&self, type_: TextWindowType, size: i32) {
1460         unsafe {
1461             gtk_sys::gtk_text_view_set_border_window_size(
1462                 self.as_ref().to_glib_none().0,
1463                 type_.to_glib(),
1464                 size,
1465             );
1466         }
1467     }
1468 
1469     #[cfg(any(feature = "v3_18", feature = "dox"))]
set_bottom_margin(&self, bottom_margin: i32)1470     fn set_bottom_margin(&self, bottom_margin: i32) {
1471         unsafe {
1472             gtk_sys::gtk_text_view_set_bottom_margin(self.as_ref().to_glib_none().0, bottom_margin);
1473         }
1474     }
1475 
set_buffer<P: IsA<TextBuffer>>(&self, buffer: Option<&P>)1476     fn set_buffer<P: IsA<TextBuffer>>(&self, buffer: Option<&P>) {
1477         unsafe {
1478             gtk_sys::gtk_text_view_set_buffer(
1479                 self.as_ref().to_glib_none().0,
1480                 buffer.map(|p| p.as_ref()).to_glib_none().0,
1481             );
1482         }
1483     }
1484 
set_cursor_visible(&self, setting: bool)1485     fn set_cursor_visible(&self, setting: bool) {
1486         unsafe {
1487             gtk_sys::gtk_text_view_set_cursor_visible(
1488                 self.as_ref().to_glib_none().0,
1489                 setting.to_glib(),
1490             );
1491         }
1492     }
1493 
set_editable(&self, setting: bool)1494     fn set_editable(&self, setting: bool) {
1495         unsafe {
1496             gtk_sys::gtk_text_view_set_editable(self.as_ref().to_glib_none().0, setting.to_glib());
1497         }
1498     }
1499 
set_indent(&self, indent: i32)1500     fn set_indent(&self, indent: i32) {
1501         unsafe {
1502             gtk_sys::gtk_text_view_set_indent(self.as_ref().to_glib_none().0, indent);
1503         }
1504     }
1505 
set_input_hints(&self, hints: InputHints)1506     fn set_input_hints(&self, hints: InputHints) {
1507         unsafe {
1508             gtk_sys::gtk_text_view_set_input_hints(self.as_ref().to_glib_none().0, hints.to_glib());
1509         }
1510     }
1511 
set_input_purpose(&self, purpose: InputPurpose)1512     fn set_input_purpose(&self, purpose: InputPurpose) {
1513         unsafe {
1514             gtk_sys::gtk_text_view_set_input_purpose(
1515                 self.as_ref().to_glib_none().0,
1516                 purpose.to_glib(),
1517             );
1518         }
1519     }
1520 
set_justification(&self, justification: Justification)1521     fn set_justification(&self, justification: Justification) {
1522         unsafe {
1523             gtk_sys::gtk_text_view_set_justification(
1524                 self.as_ref().to_glib_none().0,
1525                 justification.to_glib(),
1526             );
1527         }
1528     }
1529 
set_left_margin(&self, left_margin: i32)1530     fn set_left_margin(&self, left_margin: i32) {
1531         unsafe {
1532             gtk_sys::gtk_text_view_set_left_margin(self.as_ref().to_glib_none().0, left_margin);
1533         }
1534     }
1535 
1536     #[cfg(any(feature = "v3_16", feature = "dox"))]
set_monospace(&self, monospace: bool)1537     fn set_monospace(&self, monospace: bool) {
1538         unsafe {
1539             gtk_sys::gtk_text_view_set_monospace(
1540                 self.as_ref().to_glib_none().0,
1541                 monospace.to_glib(),
1542             );
1543         }
1544     }
1545 
set_overwrite(&self, overwrite: bool)1546     fn set_overwrite(&self, overwrite: bool) {
1547         unsafe {
1548             gtk_sys::gtk_text_view_set_overwrite(
1549                 self.as_ref().to_glib_none().0,
1550                 overwrite.to_glib(),
1551             );
1552         }
1553     }
1554 
set_pixels_above_lines(&self, pixels_above_lines: i32)1555     fn set_pixels_above_lines(&self, pixels_above_lines: i32) {
1556         unsafe {
1557             gtk_sys::gtk_text_view_set_pixels_above_lines(
1558                 self.as_ref().to_glib_none().0,
1559                 pixels_above_lines,
1560             );
1561         }
1562     }
1563 
set_pixels_below_lines(&self, pixels_below_lines: i32)1564     fn set_pixels_below_lines(&self, pixels_below_lines: i32) {
1565         unsafe {
1566             gtk_sys::gtk_text_view_set_pixels_below_lines(
1567                 self.as_ref().to_glib_none().0,
1568                 pixels_below_lines,
1569             );
1570         }
1571     }
1572 
set_pixels_inside_wrap(&self, pixels_inside_wrap: i32)1573     fn set_pixels_inside_wrap(&self, pixels_inside_wrap: i32) {
1574         unsafe {
1575             gtk_sys::gtk_text_view_set_pixels_inside_wrap(
1576                 self.as_ref().to_glib_none().0,
1577                 pixels_inside_wrap,
1578             );
1579         }
1580     }
1581 
set_right_margin(&self, right_margin: i32)1582     fn set_right_margin(&self, right_margin: i32) {
1583         unsafe {
1584             gtk_sys::gtk_text_view_set_right_margin(self.as_ref().to_glib_none().0, right_margin);
1585         }
1586     }
1587 
set_tabs(&self, tabs: &pango::TabArray)1588     fn set_tabs(&self, tabs: &pango::TabArray) {
1589         unsafe {
1590             gtk_sys::gtk_text_view_set_tabs(
1591                 self.as_ref().to_glib_none().0,
1592                 mut_override(tabs.to_glib_none().0),
1593             );
1594         }
1595     }
1596 
1597     #[cfg(any(feature = "v3_18", feature = "dox"))]
set_top_margin(&self, top_margin: i32)1598     fn set_top_margin(&self, top_margin: i32) {
1599         unsafe {
1600             gtk_sys::gtk_text_view_set_top_margin(self.as_ref().to_glib_none().0, top_margin);
1601         }
1602     }
1603 
set_wrap_mode(&self, wrap_mode: WrapMode)1604     fn set_wrap_mode(&self, wrap_mode: WrapMode) {
1605         unsafe {
1606             gtk_sys::gtk_text_view_set_wrap_mode(
1607                 self.as_ref().to_glib_none().0,
1608                 wrap_mode.to_glib(),
1609             );
1610         }
1611     }
1612 
starts_display_line(&self, iter: &TextIter) -> bool1613     fn starts_display_line(&self, iter: &TextIter) -> bool {
1614         unsafe {
1615             from_glib(gtk_sys::gtk_text_view_starts_display_line(
1616                 self.as_ref().to_glib_none().0,
1617                 iter.to_glib_none().0,
1618             ))
1619         }
1620     }
1621 
window_to_buffer_coords( &self, win: TextWindowType, window_x: i32, window_y: i32, ) -> (i32, i32)1622     fn window_to_buffer_coords(
1623         &self,
1624         win: TextWindowType,
1625         window_x: i32,
1626         window_y: i32,
1627     ) -> (i32, i32) {
1628         unsafe {
1629             let mut buffer_x = mem::MaybeUninit::uninit();
1630             let mut buffer_y = mem::MaybeUninit::uninit();
1631             gtk_sys::gtk_text_view_window_to_buffer_coords(
1632                 self.as_ref().to_glib_none().0,
1633                 win.to_glib(),
1634                 window_x,
1635                 window_y,
1636                 buffer_x.as_mut_ptr(),
1637                 buffer_y.as_mut_ptr(),
1638             );
1639             let buffer_x = buffer_x.assume_init();
1640             let buffer_y = buffer_y.assume_init();
1641             (buffer_x, buffer_y)
1642         }
1643     }
1644 
get_property_im_module(&self) -> Option<GString>1645     fn get_property_im_module(&self) -> Option<GString> {
1646         unsafe {
1647             let mut value = Value::from_type(<GString as StaticType>::static_type());
1648             gobject_sys::g_object_get_property(
1649                 self.to_glib_none().0 as *mut gobject_sys::GObject,
1650                 b"im-module\0".as_ptr() as *const _,
1651                 value.to_glib_none_mut().0,
1652             );
1653             value
1654                 .get()
1655                 .expect("Return Value for property `im-module` getter")
1656         }
1657     }
1658 
set_property_im_module(&self, im_module: Option<&str>)1659     fn set_property_im_module(&self, im_module: Option<&str>) {
1660         unsafe {
1661             gobject_sys::g_object_set_property(
1662                 self.to_glib_none().0 as *mut gobject_sys::GObject,
1663                 b"im-module\0".as_ptr() as *const _,
1664                 Value::from(im_module).to_glib_none().0,
1665             );
1666         }
1667     }
1668 
get_property_monospace(&self) -> bool1669     fn get_property_monospace(&self) -> bool {
1670         unsafe {
1671             let mut value = Value::from_type(<bool as StaticType>::static_type());
1672             gobject_sys::g_object_get_property(
1673                 self.to_glib_none().0 as *mut gobject_sys::GObject,
1674                 b"monospace\0".as_ptr() as *const _,
1675                 value.to_glib_none_mut().0,
1676             );
1677             value
1678                 .get()
1679                 .expect("Return Value for property `monospace` getter")
1680                 .unwrap()
1681         }
1682     }
1683 
set_property_monospace(&self, monospace: bool)1684     fn set_property_monospace(&self, monospace: bool) {
1685         unsafe {
1686             gobject_sys::g_object_set_property(
1687                 self.to_glib_none().0 as *mut gobject_sys::GObject,
1688                 b"monospace\0".as_ptr() as *const _,
1689                 Value::from(&monospace).to_glib_none().0,
1690             );
1691         }
1692     }
1693 
get_property_populate_all(&self) -> bool1694     fn get_property_populate_all(&self) -> bool {
1695         unsafe {
1696             let mut value = Value::from_type(<bool as StaticType>::static_type());
1697             gobject_sys::g_object_get_property(
1698                 self.to_glib_none().0 as *mut gobject_sys::GObject,
1699                 b"populate-all\0".as_ptr() as *const _,
1700                 value.to_glib_none_mut().0,
1701             );
1702             value
1703                 .get()
1704                 .expect("Return Value for property `populate-all` getter")
1705                 .unwrap()
1706         }
1707     }
1708 
set_property_populate_all(&self, populate_all: bool)1709     fn set_property_populate_all(&self, populate_all: bool) {
1710         unsafe {
1711             gobject_sys::g_object_set_property(
1712                 self.to_glib_none().0 as *mut gobject_sys::GObject,
1713                 b"populate-all\0".as_ptr() as *const _,
1714                 Value::from(&populate_all).to_glib_none().0,
1715             );
1716         }
1717     }
1718 
connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1719     fn connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1720         unsafe extern "C" fn backspace_trampoline<P, F: Fn(&P) + 'static>(
1721             this: *mut gtk_sys::GtkTextView,
1722             f: glib_sys::gpointer,
1723         ) where
1724             P: IsA<TextView>,
1725         {
1726             let f: &F = &*(f as *const F);
1727             f(&TextView::from_glib_borrow(this).unsafe_cast())
1728         }
1729         unsafe {
1730             let f: Box_<F> = Box_::new(f);
1731             connect_raw(
1732                 self.as_ptr() as *mut _,
1733                 b"backspace\0".as_ptr() as *const _,
1734                 Some(transmute(backspace_trampoline::<Self, F> as usize)),
1735                 Box_::into_raw(f),
1736             )
1737         }
1738     }
1739 
emit_backspace(&self)1740     fn emit_backspace(&self) {
1741         let _ = unsafe {
1742             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1743                 .emit("backspace", &[])
1744                 .unwrap()
1745         };
1746     }
1747 
connect_copy_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1748     fn connect_copy_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1749         unsafe extern "C" fn copy_clipboard_trampoline<P, F: Fn(&P) + 'static>(
1750             this: *mut gtk_sys::GtkTextView,
1751             f: glib_sys::gpointer,
1752         ) where
1753             P: IsA<TextView>,
1754         {
1755             let f: &F = &*(f as *const F);
1756             f(&TextView::from_glib_borrow(this).unsafe_cast())
1757         }
1758         unsafe {
1759             let f: Box_<F> = Box_::new(f);
1760             connect_raw(
1761                 self.as_ptr() as *mut _,
1762                 b"copy-clipboard\0".as_ptr() as *const _,
1763                 Some(transmute(copy_clipboard_trampoline::<Self, F> as usize)),
1764                 Box_::into_raw(f),
1765             )
1766         }
1767     }
1768 
emit_copy_clipboard(&self)1769     fn emit_copy_clipboard(&self) {
1770         let _ = unsafe {
1771             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1772                 .emit("copy-clipboard", &[])
1773                 .unwrap()
1774         };
1775     }
1776 
connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1777     fn connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1778         unsafe extern "C" fn cut_clipboard_trampoline<P, F: Fn(&P) + 'static>(
1779             this: *mut gtk_sys::GtkTextView,
1780             f: glib_sys::gpointer,
1781         ) where
1782             P: IsA<TextView>,
1783         {
1784             let f: &F = &*(f as *const F);
1785             f(&TextView::from_glib_borrow(this).unsafe_cast())
1786         }
1787         unsafe {
1788             let f: Box_<F> = Box_::new(f);
1789             connect_raw(
1790                 self.as_ptr() as *mut _,
1791                 b"cut-clipboard\0".as_ptr() as *const _,
1792                 Some(transmute(cut_clipboard_trampoline::<Self, F> as usize)),
1793                 Box_::into_raw(f),
1794             )
1795         }
1796     }
1797 
emit_cut_clipboard(&self)1798     fn emit_cut_clipboard(&self) {
1799         let _ = unsafe {
1800             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1801                 .emit("cut-clipboard", &[])
1802                 .unwrap()
1803         };
1804     }
1805 
connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>( &self, f: F, ) -> SignalHandlerId1806     fn connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>(
1807         &self,
1808         f: F,
1809     ) -> SignalHandlerId {
1810         unsafe extern "C" fn delete_from_cursor_trampoline<
1811             P,
1812             F: Fn(&P, DeleteType, i32) + 'static,
1813         >(
1814             this: *mut gtk_sys::GtkTextView,
1815             type_: gtk_sys::GtkDeleteType,
1816             count: libc::c_int,
1817             f: glib_sys::gpointer,
1818         ) where
1819             P: IsA<TextView>,
1820         {
1821             let f: &F = &*(f as *const F);
1822             f(
1823                 &TextView::from_glib_borrow(this).unsafe_cast(),
1824                 from_glib(type_),
1825                 count,
1826             )
1827         }
1828         unsafe {
1829             let f: Box_<F> = Box_::new(f);
1830             connect_raw(
1831                 self.as_ptr() as *mut _,
1832                 b"delete-from-cursor\0".as_ptr() as *const _,
1833                 Some(transmute(delete_from_cursor_trampoline::<Self, F> as usize)),
1834                 Box_::into_raw(f),
1835             )
1836         }
1837     }
1838 
emit_delete_from_cursor(&self, type_: DeleteType, count: i32)1839     fn emit_delete_from_cursor(&self, type_: DeleteType, count: i32) {
1840         let _ = unsafe {
1841             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1842                 .emit("delete-from-cursor", &[&type_, &count])
1843                 .unwrap()
1844         };
1845     }
1846 
1847     #[cfg(any(feature = "v3_16", feature = "dox"))]
connect_extend_selection< F: Fn(&Self, TextExtendSelection, &TextIter, &TextIter, &TextIter) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId1848     fn connect_extend_selection<
1849         F: Fn(&Self, TextExtendSelection, &TextIter, &TextIter, &TextIter) -> glib::signal::Inhibit
1850             + 'static,
1851     >(
1852         &self,
1853         f: F,
1854     ) -> SignalHandlerId {
1855         unsafe extern "C" fn extend_selection_trampoline<
1856             P,
1857             F: Fn(
1858                     &P,
1859                     TextExtendSelection,
1860                     &TextIter,
1861                     &TextIter,
1862                     &TextIter,
1863                 ) -> glib::signal::Inhibit
1864                 + 'static,
1865         >(
1866             this: *mut gtk_sys::GtkTextView,
1867             granularity: gtk_sys::GtkTextExtendSelection,
1868             location: *mut gtk_sys::GtkTextIter,
1869             start: *mut gtk_sys::GtkTextIter,
1870             end: *mut gtk_sys::GtkTextIter,
1871             f: glib_sys::gpointer,
1872         ) -> glib_sys::gboolean
1873         where
1874             P: IsA<TextView>,
1875         {
1876             let f: &F = &*(f as *const F);
1877             f(
1878                 &TextView::from_glib_borrow(this).unsafe_cast(),
1879                 from_glib(granularity),
1880                 &from_glib_borrow(location),
1881                 &from_glib_borrow(start),
1882                 &from_glib_borrow(end),
1883             )
1884             .to_glib()
1885         }
1886         unsafe {
1887             let f: Box_<F> = Box_::new(f);
1888             connect_raw(
1889                 self.as_ptr() as *mut _,
1890                 b"extend-selection\0".as_ptr() as *const _,
1891                 Some(transmute(extend_selection_trampoline::<Self, F> as usize)),
1892                 Box_::into_raw(f),
1893             )
1894         }
1895     }
1896 
connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId1897     fn connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
1898         unsafe extern "C" fn insert_at_cursor_trampoline<P, F: Fn(&P, &str) + 'static>(
1899             this: *mut gtk_sys::GtkTextView,
1900             string: *mut libc::c_char,
1901             f: glib_sys::gpointer,
1902         ) where
1903             P: IsA<TextView>,
1904         {
1905             let f: &F = &*(f as *const F);
1906             f(
1907                 &TextView::from_glib_borrow(this).unsafe_cast(),
1908                 &GString::from_glib_borrow(string),
1909             )
1910         }
1911         unsafe {
1912             let f: Box_<F> = Box_::new(f);
1913             connect_raw(
1914                 self.as_ptr() as *mut _,
1915                 b"insert-at-cursor\0".as_ptr() as *const _,
1916                 Some(transmute(insert_at_cursor_trampoline::<Self, F> as usize)),
1917                 Box_::into_raw(f),
1918             )
1919         }
1920     }
1921 
emit_insert_at_cursor(&self, string: &str)1922     fn emit_insert_at_cursor(&self, string: &str) {
1923         let _ = unsafe {
1924             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1925                 .emit("insert-at-cursor", &[&string])
1926                 .unwrap()
1927         };
1928     }
1929 
1930     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1931     fn connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1932         unsafe extern "C" fn insert_emoji_trampoline<P, F: Fn(&P) + 'static>(
1933             this: *mut gtk_sys::GtkTextView,
1934             f: glib_sys::gpointer,
1935         ) where
1936             P: IsA<TextView>,
1937         {
1938             let f: &F = &*(f as *const F);
1939             f(&TextView::from_glib_borrow(this).unsafe_cast())
1940         }
1941         unsafe {
1942             let f: Box_<F> = Box_::new(f);
1943             connect_raw(
1944                 self.as_ptr() as *mut _,
1945                 b"insert-emoji\0".as_ptr() as *const _,
1946                 Some(transmute(insert_emoji_trampoline::<Self, F> as usize)),
1947                 Box_::into_raw(f),
1948             )
1949         }
1950     }
1951 
1952     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
emit_insert_emoji(&self)1953     fn emit_insert_emoji(&self) {
1954         let _ = unsafe {
1955             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1956                 .emit("insert-emoji", &[])
1957                 .unwrap()
1958         };
1959     }
1960 
connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>( &self, f: F, ) -> SignalHandlerId1961     fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>(
1962         &self,
1963         f: F,
1964     ) -> SignalHandlerId {
1965         unsafe extern "C" fn move_cursor_trampoline<
1966             P,
1967             F: Fn(&P, MovementStep, i32, bool) + 'static,
1968         >(
1969             this: *mut gtk_sys::GtkTextView,
1970             step: gtk_sys::GtkMovementStep,
1971             count: libc::c_int,
1972             extend_selection: glib_sys::gboolean,
1973             f: glib_sys::gpointer,
1974         ) where
1975             P: IsA<TextView>,
1976         {
1977             let f: &F = &*(f as *const F);
1978             f(
1979                 &TextView::from_glib_borrow(this).unsafe_cast(),
1980                 from_glib(step),
1981                 count,
1982                 from_glib(extend_selection),
1983             )
1984         }
1985         unsafe {
1986             let f: Box_<F> = Box_::new(f);
1987             connect_raw(
1988                 self.as_ptr() as *mut _,
1989                 b"move-cursor\0".as_ptr() as *const _,
1990                 Some(transmute(move_cursor_trampoline::<Self, F> as usize)),
1991                 Box_::into_raw(f),
1992             )
1993         }
1994     }
1995 
emit_move_cursor(&self, step: MovementStep, count: i32, extend_selection: bool)1996     fn emit_move_cursor(&self, step: MovementStep, count: i32, extend_selection: bool) {
1997         let _ = unsafe {
1998             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
1999                 .emit("move-cursor", &[&step, &count, &extend_selection])
2000                 .unwrap()
2001         };
2002     }
2003 
connect_move_viewport<F: Fn(&Self, ScrollStep, i32) + 'static>( &self, f: F, ) -> SignalHandlerId2004     fn connect_move_viewport<F: Fn(&Self, ScrollStep, i32) + 'static>(
2005         &self,
2006         f: F,
2007     ) -> SignalHandlerId {
2008         unsafe extern "C" fn move_viewport_trampoline<P, F: Fn(&P, ScrollStep, i32) + 'static>(
2009             this: *mut gtk_sys::GtkTextView,
2010             step: gtk_sys::GtkScrollStep,
2011             count: libc::c_int,
2012             f: glib_sys::gpointer,
2013         ) where
2014             P: IsA<TextView>,
2015         {
2016             let f: &F = &*(f as *const F);
2017             f(
2018                 &TextView::from_glib_borrow(this).unsafe_cast(),
2019                 from_glib(step),
2020                 count,
2021             )
2022         }
2023         unsafe {
2024             let f: Box_<F> = Box_::new(f);
2025             connect_raw(
2026                 self.as_ptr() as *mut _,
2027                 b"move-viewport\0".as_ptr() as *const _,
2028                 Some(transmute(move_viewport_trampoline::<Self, F> as usize)),
2029                 Box_::into_raw(f),
2030             )
2031         }
2032     }
2033 
emit_move_viewport(&self, step: ScrollStep, count: i32)2034     fn emit_move_viewport(&self, step: ScrollStep, count: i32) {
2035         let _ = unsafe {
2036             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2037                 .emit("move-viewport", &[&step, &count])
2038                 .unwrap()
2039         };
2040     }
2041 
connect_paste_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2042     fn connect_paste_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2043         unsafe extern "C" fn paste_clipboard_trampoline<P, F: Fn(&P) + 'static>(
2044             this: *mut gtk_sys::GtkTextView,
2045             f: glib_sys::gpointer,
2046         ) where
2047             P: IsA<TextView>,
2048         {
2049             let f: &F = &*(f as *const F);
2050             f(&TextView::from_glib_borrow(this).unsafe_cast())
2051         }
2052         unsafe {
2053             let f: Box_<F> = Box_::new(f);
2054             connect_raw(
2055                 self.as_ptr() as *mut _,
2056                 b"paste-clipboard\0".as_ptr() as *const _,
2057                 Some(transmute(paste_clipboard_trampoline::<Self, F> as usize)),
2058                 Box_::into_raw(f),
2059             )
2060         }
2061     }
2062 
emit_paste_clipboard(&self)2063     fn emit_paste_clipboard(&self) {
2064         let _ = unsafe {
2065             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2066                 .emit("paste-clipboard", &[])
2067                 .unwrap()
2068         };
2069     }
2070 
connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId2071     fn connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
2072         unsafe extern "C" fn populate_popup_trampoline<P, F: Fn(&P, &Widget) + 'static>(
2073             this: *mut gtk_sys::GtkTextView,
2074             popup: *mut gtk_sys::GtkWidget,
2075             f: glib_sys::gpointer,
2076         ) where
2077             P: IsA<TextView>,
2078         {
2079             let f: &F = &*(f as *const F);
2080             f(
2081                 &TextView::from_glib_borrow(this).unsafe_cast(),
2082                 &from_glib_borrow(popup),
2083             )
2084         }
2085         unsafe {
2086             let f: Box_<F> = Box_::new(f);
2087             connect_raw(
2088                 self.as_ptr() as *mut _,
2089                 b"populate-popup\0".as_ptr() as *const _,
2090                 Some(transmute(populate_popup_trampoline::<Self, F> as usize)),
2091                 Box_::into_raw(f),
2092             )
2093         }
2094     }
2095 
connect_preedit_changed<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId2096     fn connect_preedit_changed<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
2097         unsafe extern "C" fn preedit_changed_trampoline<P, F: Fn(&P, &str) + 'static>(
2098             this: *mut gtk_sys::GtkTextView,
2099             preedit: *mut libc::c_char,
2100             f: glib_sys::gpointer,
2101         ) where
2102             P: IsA<TextView>,
2103         {
2104             let f: &F = &*(f as *const F);
2105             f(
2106                 &TextView::from_glib_borrow(this).unsafe_cast(),
2107                 &GString::from_glib_borrow(preedit),
2108             )
2109         }
2110         unsafe {
2111             let f: Box_<F> = Box_::new(f);
2112             connect_raw(
2113                 self.as_ptr() as *mut _,
2114                 b"preedit-changed\0".as_ptr() as *const _,
2115                 Some(transmute(preedit_changed_trampoline::<Self, F> as usize)),
2116                 Box_::into_raw(f),
2117             )
2118         }
2119     }
2120 
emit_preedit_changed(&self, preedit: &str)2121     fn emit_preedit_changed(&self, preedit: &str) {
2122         let _ = unsafe {
2123             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2124                 .emit("preedit-changed", &[&preedit])
2125                 .unwrap()
2126         };
2127     }
2128 
connect_select_all<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId2129     fn connect_select_all<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId {
2130         unsafe extern "C" fn select_all_trampoline<P, F: Fn(&P, bool) + 'static>(
2131             this: *mut gtk_sys::GtkTextView,
2132             select: glib_sys::gboolean,
2133             f: glib_sys::gpointer,
2134         ) where
2135             P: IsA<TextView>,
2136         {
2137             let f: &F = &*(f as *const F);
2138             f(
2139                 &TextView::from_glib_borrow(this).unsafe_cast(),
2140                 from_glib(select),
2141             )
2142         }
2143         unsafe {
2144             let f: Box_<F> = Box_::new(f);
2145             connect_raw(
2146                 self.as_ptr() as *mut _,
2147                 b"select-all\0".as_ptr() as *const _,
2148                 Some(transmute(select_all_trampoline::<Self, F> as usize)),
2149                 Box_::into_raw(f),
2150             )
2151         }
2152     }
2153 
emit_select_all(&self, select: bool)2154     fn emit_select_all(&self, select: bool) {
2155         let _ = unsafe {
2156             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2157                 .emit("select-all", &[&select])
2158                 .unwrap()
2159         };
2160     }
2161 
connect_set_anchor<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2162     fn connect_set_anchor<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2163         unsafe extern "C" fn set_anchor_trampoline<P, F: Fn(&P) + 'static>(
2164             this: *mut gtk_sys::GtkTextView,
2165             f: glib_sys::gpointer,
2166         ) where
2167             P: IsA<TextView>,
2168         {
2169             let f: &F = &*(f as *const F);
2170             f(&TextView::from_glib_borrow(this).unsafe_cast())
2171         }
2172         unsafe {
2173             let f: Box_<F> = Box_::new(f);
2174             connect_raw(
2175                 self.as_ptr() as *mut _,
2176                 b"set-anchor\0".as_ptr() as *const _,
2177                 Some(transmute(set_anchor_trampoline::<Self, F> as usize)),
2178                 Box_::into_raw(f),
2179             )
2180         }
2181     }
2182 
emit_set_anchor(&self)2183     fn emit_set_anchor(&self) {
2184         let _ = unsafe {
2185             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2186                 .emit("set-anchor", &[])
2187                 .unwrap()
2188         };
2189     }
2190 
connect_toggle_cursor_visible<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2191     fn connect_toggle_cursor_visible<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2192         unsafe extern "C" fn toggle_cursor_visible_trampoline<P, F: Fn(&P) + 'static>(
2193             this: *mut gtk_sys::GtkTextView,
2194             f: glib_sys::gpointer,
2195         ) where
2196             P: IsA<TextView>,
2197         {
2198             let f: &F = &*(f as *const F);
2199             f(&TextView::from_glib_borrow(this).unsafe_cast())
2200         }
2201         unsafe {
2202             let f: Box_<F> = Box_::new(f);
2203             connect_raw(
2204                 self.as_ptr() as *mut _,
2205                 b"toggle-cursor-visible\0".as_ptr() as *const _,
2206                 Some(transmute(
2207                     toggle_cursor_visible_trampoline::<Self, F> as usize,
2208                 )),
2209                 Box_::into_raw(f),
2210             )
2211         }
2212     }
2213 
emit_toggle_cursor_visible(&self)2214     fn emit_toggle_cursor_visible(&self) {
2215         let _ = unsafe {
2216             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2217                 .emit("toggle-cursor-visible", &[])
2218                 .unwrap()
2219         };
2220     }
2221 
connect_toggle_overwrite<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2222     fn connect_toggle_overwrite<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2223         unsafe extern "C" fn toggle_overwrite_trampoline<P, F: Fn(&P) + 'static>(
2224             this: *mut gtk_sys::GtkTextView,
2225             f: glib_sys::gpointer,
2226         ) where
2227             P: IsA<TextView>,
2228         {
2229             let f: &F = &*(f as *const F);
2230             f(&TextView::from_glib_borrow(this).unsafe_cast())
2231         }
2232         unsafe {
2233             let f: Box_<F> = Box_::new(f);
2234             connect_raw(
2235                 self.as_ptr() as *mut _,
2236                 b"toggle-overwrite\0".as_ptr() as *const _,
2237                 Some(transmute(toggle_overwrite_trampoline::<Self, F> as usize)),
2238                 Box_::into_raw(f),
2239             )
2240         }
2241     }
2242 
emit_toggle_overwrite(&self)2243     fn emit_toggle_overwrite(&self) {
2244         let _ = unsafe {
2245             glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2246                 .emit("toggle-overwrite", &[])
2247                 .unwrap()
2248         };
2249     }
2250 
connect_property_accepts_tab_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2251     fn connect_property_accepts_tab_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2252         unsafe extern "C" fn notify_accepts_tab_trampoline<P, F: Fn(&P) + 'static>(
2253             this: *mut gtk_sys::GtkTextView,
2254             _param_spec: glib_sys::gpointer,
2255             f: glib_sys::gpointer,
2256         ) where
2257             P: IsA<TextView>,
2258         {
2259             let f: &F = &*(f as *const F);
2260             f(&TextView::from_glib_borrow(this).unsafe_cast())
2261         }
2262         unsafe {
2263             let f: Box_<F> = Box_::new(f);
2264             connect_raw(
2265                 self.as_ptr() as *mut _,
2266                 b"notify::accepts-tab\0".as_ptr() as *const _,
2267                 Some(transmute(notify_accepts_tab_trampoline::<Self, F> as usize)),
2268                 Box_::into_raw(f),
2269             )
2270         }
2271     }
2272 
2273     #[cfg(any(feature = "v3_18", feature = "dox"))]
connect_property_bottom_margin_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2274     fn connect_property_bottom_margin_notify<F: Fn(&Self) + 'static>(
2275         &self,
2276         f: F,
2277     ) -> SignalHandlerId {
2278         unsafe extern "C" fn notify_bottom_margin_trampoline<P, F: Fn(&P) + 'static>(
2279             this: *mut gtk_sys::GtkTextView,
2280             _param_spec: glib_sys::gpointer,
2281             f: glib_sys::gpointer,
2282         ) where
2283             P: IsA<TextView>,
2284         {
2285             let f: &F = &*(f as *const F);
2286             f(&TextView::from_glib_borrow(this).unsafe_cast())
2287         }
2288         unsafe {
2289             let f: Box_<F> = Box_::new(f);
2290             connect_raw(
2291                 self.as_ptr() as *mut _,
2292                 b"notify::bottom-margin\0".as_ptr() as *const _,
2293                 Some(transmute(
2294                     notify_bottom_margin_trampoline::<Self, F> as usize,
2295                 )),
2296                 Box_::into_raw(f),
2297             )
2298         }
2299     }
2300 
connect_property_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2301     fn connect_property_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2302         unsafe extern "C" fn notify_buffer_trampoline<P, F: Fn(&P) + 'static>(
2303             this: *mut gtk_sys::GtkTextView,
2304             _param_spec: glib_sys::gpointer,
2305             f: glib_sys::gpointer,
2306         ) where
2307             P: IsA<TextView>,
2308         {
2309             let f: &F = &*(f as *const F);
2310             f(&TextView::from_glib_borrow(this).unsafe_cast())
2311         }
2312         unsafe {
2313             let f: Box_<F> = Box_::new(f);
2314             connect_raw(
2315                 self.as_ptr() as *mut _,
2316                 b"notify::buffer\0".as_ptr() as *const _,
2317                 Some(transmute(notify_buffer_trampoline::<Self, F> as usize)),
2318                 Box_::into_raw(f),
2319             )
2320         }
2321     }
2322 
connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2323     fn connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>(
2324         &self,
2325         f: F,
2326     ) -> SignalHandlerId {
2327         unsafe extern "C" fn notify_cursor_visible_trampoline<P, F: Fn(&P) + 'static>(
2328             this: *mut gtk_sys::GtkTextView,
2329             _param_spec: glib_sys::gpointer,
2330             f: glib_sys::gpointer,
2331         ) where
2332             P: IsA<TextView>,
2333         {
2334             let f: &F = &*(f as *const F);
2335             f(&TextView::from_glib_borrow(this).unsafe_cast())
2336         }
2337         unsafe {
2338             let f: Box_<F> = Box_::new(f);
2339             connect_raw(
2340                 self.as_ptr() as *mut _,
2341                 b"notify::cursor-visible\0".as_ptr() as *const _,
2342                 Some(transmute(
2343                     notify_cursor_visible_trampoline::<Self, F> as usize,
2344                 )),
2345                 Box_::into_raw(f),
2346             )
2347         }
2348     }
2349 
connect_property_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2350     fn connect_property_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2351         unsafe extern "C" fn notify_editable_trampoline<P, F: Fn(&P) + 'static>(
2352             this: *mut gtk_sys::GtkTextView,
2353             _param_spec: glib_sys::gpointer,
2354             f: glib_sys::gpointer,
2355         ) where
2356             P: IsA<TextView>,
2357         {
2358             let f: &F = &*(f as *const F);
2359             f(&TextView::from_glib_borrow(this).unsafe_cast())
2360         }
2361         unsafe {
2362             let f: Box_<F> = Box_::new(f);
2363             connect_raw(
2364                 self.as_ptr() as *mut _,
2365                 b"notify::editable\0".as_ptr() as *const _,
2366                 Some(transmute(notify_editable_trampoline::<Self, F> as usize)),
2367                 Box_::into_raw(f),
2368             )
2369         }
2370     }
2371 
connect_property_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2372     fn connect_property_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2373         unsafe extern "C" fn notify_im_module_trampoline<P, F: Fn(&P) + 'static>(
2374             this: *mut gtk_sys::GtkTextView,
2375             _param_spec: glib_sys::gpointer,
2376             f: glib_sys::gpointer,
2377         ) where
2378             P: IsA<TextView>,
2379         {
2380             let f: &F = &*(f as *const F);
2381             f(&TextView::from_glib_borrow(this).unsafe_cast())
2382         }
2383         unsafe {
2384             let f: Box_<F> = Box_::new(f);
2385             connect_raw(
2386                 self.as_ptr() as *mut _,
2387                 b"notify::im-module\0".as_ptr() as *const _,
2388                 Some(transmute(notify_im_module_trampoline::<Self, F> as usize)),
2389                 Box_::into_raw(f),
2390             )
2391         }
2392     }
2393 
connect_property_indent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2394     fn connect_property_indent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2395         unsafe extern "C" fn notify_indent_trampoline<P, F: Fn(&P) + 'static>(
2396             this: *mut gtk_sys::GtkTextView,
2397             _param_spec: glib_sys::gpointer,
2398             f: glib_sys::gpointer,
2399         ) where
2400             P: IsA<TextView>,
2401         {
2402             let f: &F = &*(f as *const F);
2403             f(&TextView::from_glib_borrow(this).unsafe_cast())
2404         }
2405         unsafe {
2406             let f: Box_<F> = Box_::new(f);
2407             connect_raw(
2408                 self.as_ptr() as *mut _,
2409                 b"notify::indent\0".as_ptr() as *const _,
2410                 Some(transmute(notify_indent_trampoline::<Self, F> as usize)),
2411                 Box_::into_raw(f),
2412             )
2413         }
2414     }
2415 
connect_property_input_hints_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2416     fn connect_property_input_hints_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2417         unsafe extern "C" fn notify_input_hints_trampoline<P, F: Fn(&P) + 'static>(
2418             this: *mut gtk_sys::GtkTextView,
2419             _param_spec: glib_sys::gpointer,
2420             f: glib_sys::gpointer,
2421         ) where
2422             P: IsA<TextView>,
2423         {
2424             let f: &F = &*(f as *const F);
2425             f(&TextView::from_glib_borrow(this).unsafe_cast())
2426         }
2427         unsafe {
2428             let f: Box_<F> = Box_::new(f);
2429             connect_raw(
2430                 self.as_ptr() as *mut _,
2431                 b"notify::input-hints\0".as_ptr() as *const _,
2432                 Some(transmute(notify_input_hints_trampoline::<Self, F> as usize)),
2433                 Box_::into_raw(f),
2434             )
2435         }
2436     }
2437 
connect_property_input_purpose_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2438     fn connect_property_input_purpose_notify<F: Fn(&Self) + 'static>(
2439         &self,
2440         f: F,
2441     ) -> SignalHandlerId {
2442         unsafe extern "C" fn notify_input_purpose_trampoline<P, F: Fn(&P) + 'static>(
2443             this: *mut gtk_sys::GtkTextView,
2444             _param_spec: glib_sys::gpointer,
2445             f: glib_sys::gpointer,
2446         ) where
2447             P: IsA<TextView>,
2448         {
2449             let f: &F = &*(f as *const F);
2450             f(&TextView::from_glib_borrow(this).unsafe_cast())
2451         }
2452         unsafe {
2453             let f: Box_<F> = Box_::new(f);
2454             connect_raw(
2455                 self.as_ptr() as *mut _,
2456                 b"notify::input-purpose\0".as_ptr() as *const _,
2457                 Some(transmute(
2458                     notify_input_purpose_trampoline::<Self, F> as usize,
2459                 )),
2460                 Box_::into_raw(f),
2461             )
2462         }
2463     }
2464 
connect_property_justification_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2465     fn connect_property_justification_notify<F: Fn(&Self) + 'static>(
2466         &self,
2467         f: F,
2468     ) -> SignalHandlerId {
2469         unsafe extern "C" fn notify_justification_trampoline<P, F: Fn(&P) + 'static>(
2470             this: *mut gtk_sys::GtkTextView,
2471             _param_spec: glib_sys::gpointer,
2472             f: glib_sys::gpointer,
2473         ) where
2474             P: IsA<TextView>,
2475         {
2476             let f: &F = &*(f as *const F);
2477             f(&TextView::from_glib_borrow(this).unsafe_cast())
2478         }
2479         unsafe {
2480             let f: Box_<F> = Box_::new(f);
2481             connect_raw(
2482                 self.as_ptr() as *mut _,
2483                 b"notify::justification\0".as_ptr() as *const _,
2484                 Some(transmute(
2485                     notify_justification_trampoline::<Self, F> as usize,
2486                 )),
2487                 Box_::into_raw(f),
2488             )
2489         }
2490     }
2491 
connect_property_left_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2492     fn connect_property_left_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2493         unsafe extern "C" fn notify_left_margin_trampoline<P, F: Fn(&P) + 'static>(
2494             this: *mut gtk_sys::GtkTextView,
2495             _param_spec: glib_sys::gpointer,
2496             f: glib_sys::gpointer,
2497         ) where
2498             P: IsA<TextView>,
2499         {
2500             let f: &F = &*(f as *const F);
2501             f(&TextView::from_glib_borrow(this).unsafe_cast())
2502         }
2503         unsafe {
2504             let f: Box_<F> = Box_::new(f);
2505             connect_raw(
2506                 self.as_ptr() as *mut _,
2507                 b"notify::left-margin\0".as_ptr() as *const _,
2508                 Some(transmute(notify_left_margin_trampoline::<Self, F> as usize)),
2509                 Box_::into_raw(f),
2510             )
2511         }
2512     }
2513 
connect_property_monospace_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2514     fn connect_property_monospace_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2515         unsafe extern "C" fn notify_monospace_trampoline<P, F: Fn(&P) + 'static>(
2516             this: *mut gtk_sys::GtkTextView,
2517             _param_spec: glib_sys::gpointer,
2518             f: glib_sys::gpointer,
2519         ) where
2520             P: IsA<TextView>,
2521         {
2522             let f: &F = &*(f as *const F);
2523             f(&TextView::from_glib_borrow(this).unsafe_cast())
2524         }
2525         unsafe {
2526             let f: Box_<F> = Box_::new(f);
2527             connect_raw(
2528                 self.as_ptr() as *mut _,
2529                 b"notify::monospace\0".as_ptr() as *const _,
2530                 Some(transmute(notify_monospace_trampoline::<Self, F> as usize)),
2531                 Box_::into_raw(f),
2532             )
2533         }
2534     }
2535 
connect_property_overwrite_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2536     fn connect_property_overwrite_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2537         unsafe extern "C" fn notify_overwrite_trampoline<P, F: Fn(&P) + 'static>(
2538             this: *mut gtk_sys::GtkTextView,
2539             _param_spec: glib_sys::gpointer,
2540             f: glib_sys::gpointer,
2541         ) where
2542             P: IsA<TextView>,
2543         {
2544             let f: &F = &*(f as *const F);
2545             f(&TextView::from_glib_borrow(this).unsafe_cast())
2546         }
2547         unsafe {
2548             let f: Box_<F> = Box_::new(f);
2549             connect_raw(
2550                 self.as_ptr() as *mut _,
2551                 b"notify::overwrite\0".as_ptr() as *const _,
2552                 Some(transmute(notify_overwrite_trampoline::<Self, F> as usize)),
2553                 Box_::into_raw(f),
2554             )
2555         }
2556     }
2557 
connect_property_pixels_above_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2558     fn connect_property_pixels_above_lines_notify<F: Fn(&Self) + 'static>(
2559         &self,
2560         f: F,
2561     ) -> SignalHandlerId {
2562         unsafe extern "C" fn notify_pixels_above_lines_trampoline<P, F: Fn(&P) + 'static>(
2563             this: *mut gtk_sys::GtkTextView,
2564             _param_spec: glib_sys::gpointer,
2565             f: glib_sys::gpointer,
2566         ) where
2567             P: IsA<TextView>,
2568         {
2569             let f: &F = &*(f as *const F);
2570             f(&TextView::from_glib_borrow(this).unsafe_cast())
2571         }
2572         unsafe {
2573             let f: Box_<F> = Box_::new(f);
2574             connect_raw(
2575                 self.as_ptr() as *mut _,
2576                 b"notify::pixels-above-lines\0".as_ptr() as *const _,
2577                 Some(transmute(
2578                     notify_pixels_above_lines_trampoline::<Self, F> as usize,
2579                 )),
2580                 Box_::into_raw(f),
2581             )
2582         }
2583     }
2584 
connect_property_pixels_below_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2585     fn connect_property_pixels_below_lines_notify<F: Fn(&Self) + 'static>(
2586         &self,
2587         f: F,
2588     ) -> SignalHandlerId {
2589         unsafe extern "C" fn notify_pixels_below_lines_trampoline<P, F: Fn(&P) + 'static>(
2590             this: *mut gtk_sys::GtkTextView,
2591             _param_spec: glib_sys::gpointer,
2592             f: glib_sys::gpointer,
2593         ) where
2594             P: IsA<TextView>,
2595         {
2596             let f: &F = &*(f as *const F);
2597             f(&TextView::from_glib_borrow(this).unsafe_cast())
2598         }
2599         unsafe {
2600             let f: Box_<F> = Box_::new(f);
2601             connect_raw(
2602                 self.as_ptr() as *mut _,
2603                 b"notify::pixels-below-lines\0".as_ptr() as *const _,
2604                 Some(transmute(
2605                     notify_pixels_below_lines_trampoline::<Self, F> as usize,
2606                 )),
2607                 Box_::into_raw(f),
2608             )
2609         }
2610     }
2611 
connect_property_pixels_inside_wrap_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2612     fn connect_property_pixels_inside_wrap_notify<F: Fn(&Self) + 'static>(
2613         &self,
2614         f: F,
2615     ) -> SignalHandlerId {
2616         unsafe extern "C" fn notify_pixels_inside_wrap_trampoline<P, F: Fn(&P) + 'static>(
2617             this: *mut gtk_sys::GtkTextView,
2618             _param_spec: glib_sys::gpointer,
2619             f: glib_sys::gpointer,
2620         ) where
2621             P: IsA<TextView>,
2622         {
2623             let f: &F = &*(f as *const F);
2624             f(&TextView::from_glib_borrow(this).unsafe_cast())
2625         }
2626         unsafe {
2627             let f: Box_<F> = Box_::new(f);
2628             connect_raw(
2629                 self.as_ptr() as *mut _,
2630                 b"notify::pixels-inside-wrap\0".as_ptr() as *const _,
2631                 Some(transmute(
2632                     notify_pixels_inside_wrap_trampoline::<Self, F> as usize,
2633                 )),
2634                 Box_::into_raw(f),
2635             )
2636         }
2637     }
2638 
connect_property_populate_all_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2639     fn connect_property_populate_all_notify<F: Fn(&Self) + 'static>(
2640         &self,
2641         f: F,
2642     ) -> SignalHandlerId {
2643         unsafe extern "C" fn notify_populate_all_trampoline<P, F: Fn(&P) + 'static>(
2644             this: *mut gtk_sys::GtkTextView,
2645             _param_spec: glib_sys::gpointer,
2646             f: glib_sys::gpointer,
2647         ) where
2648             P: IsA<TextView>,
2649         {
2650             let f: &F = &*(f as *const F);
2651             f(&TextView::from_glib_borrow(this).unsafe_cast())
2652         }
2653         unsafe {
2654             let f: Box_<F> = Box_::new(f);
2655             connect_raw(
2656                 self.as_ptr() as *mut _,
2657                 b"notify::populate-all\0".as_ptr() as *const _,
2658                 Some(transmute(
2659                     notify_populate_all_trampoline::<Self, F> as usize,
2660                 )),
2661                 Box_::into_raw(f),
2662             )
2663         }
2664     }
2665 
connect_property_right_margin_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2666     fn connect_property_right_margin_notify<F: Fn(&Self) + 'static>(
2667         &self,
2668         f: F,
2669     ) -> SignalHandlerId {
2670         unsafe extern "C" fn notify_right_margin_trampoline<P, F: Fn(&P) + 'static>(
2671             this: *mut gtk_sys::GtkTextView,
2672             _param_spec: glib_sys::gpointer,
2673             f: glib_sys::gpointer,
2674         ) where
2675             P: IsA<TextView>,
2676         {
2677             let f: &F = &*(f as *const F);
2678             f(&TextView::from_glib_borrow(this).unsafe_cast())
2679         }
2680         unsafe {
2681             let f: Box_<F> = Box_::new(f);
2682             connect_raw(
2683                 self.as_ptr() as *mut _,
2684                 b"notify::right-margin\0".as_ptr() as *const _,
2685                 Some(transmute(
2686                     notify_right_margin_trampoline::<Self, F> as usize,
2687                 )),
2688                 Box_::into_raw(f),
2689             )
2690         }
2691     }
2692 
connect_property_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2693     fn connect_property_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2694         unsafe extern "C" fn notify_tabs_trampoline<P, F: Fn(&P) + 'static>(
2695             this: *mut gtk_sys::GtkTextView,
2696             _param_spec: glib_sys::gpointer,
2697             f: glib_sys::gpointer,
2698         ) where
2699             P: IsA<TextView>,
2700         {
2701             let f: &F = &*(f as *const F);
2702             f(&TextView::from_glib_borrow(this).unsafe_cast())
2703         }
2704         unsafe {
2705             let f: Box_<F> = Box_::new(f);
2706             connect_raw(
2707                 self.as_ptr() as *mut _,
2708                 b"notify::tabs\0".as_ptr() as *const _,
2709                 Some(transmute(notify_tabs_trampoline::<Self, F> as usize)),
2710                 Box_::into_raw(f),
2711             )
2712         }
2713     }
2714 
2715     #[cfg(any(feature = "v3_18", feature = "dox"))]
connect_property_top_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2716     fn connect_property_top_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2717         unsafe extern "C" fn notify_top_margin_trampoline<P, F: Fn(&P) + 'static>(
2718             this: *mut gtk_sys::GtkTextView,
2719             _param_spec: glib_sys::gpointer,
2720             f: glib_sys::gpointer,
2721         ) where
2722             P: IsA<TextView>,
2723         {
2724             let f: &F = &*(f as *const F);
2725             f(&TextView::from_glib_borrow(this).unsafe_cast())
2726         }
2727         unsafe {
2728             let f: Box_<F> = Box_::new(f);
2729             connect_raw(
2730                 self.as_ptr() as *mut _,
2731                 b"notify::top-margin\0".as_ptr() as *const _,
2732                 Some(transmute(notify_top_margin_trampoline::<Self, F> as usize)),
2733                 Box_::into_raw(f),
2734             )
2735         }
2736     }
2737 
connect_property_wrap_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2738     fn connect_property_wrap_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2739         unsafe extern "C" fn notify_wrap_mode_trampoline<P, F: Fn(&P) + 'static>(
2740             this: *mut gtk_sys::GtkTextView,
2741             _param_spec: glib_sys::gpointer,
2742             f: glib_sys::gpointer,
2743         ) where
2744             P: IsA<TextView>,
2745         {
2746             let f: &F = &*(f as *const F);
2747             f(&TextView::from_glib_borrow(this).unsafe_cast())
2748         }
2749         unsafe {
2750             let f: Box_<F> = Box_::new(f);
2751             connect_raw(
2752                 self.as_ptr() as *mut _,
2753                 b"notify::wrap-mode\0".as_ptr() as *const _,
2754                 Some(transmute(notify_wrap_mode_trampoline::<Self, F> as usize)),
2755                 Box_::into_raw(f),
2756             )
2757         }
2758     }
2759 }
2760 
2761 impl fmt::Display for TextView {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2762     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2763         write!(f, "TextView")
2764     }
2765 }
2766