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 crate::Adjustment;
6 use crate::Align;
7 use crate::Buildable;
8 use crate::CellArea;
9 use crate::CellLayout;
10 use crate::CellRenderer;
11 use crate::Container;
12 use crate::IconViewDropPosition;
13 use crate::MovementStep;
14 use crate::Orientation;
15 use crate::ResizeMode;
16 use crate::Scrollable;
17 use crate::ScrollablePolicy;
18 use crate::SelectionMode;
19 use crate::Tooltip;
20 use crate::TreeIter;
21 use crate::TreeModel;
22 use crate::TreePath;
23 use crate::Widget;
24 use glib::object::Cast;
25 use glib::object::IsA;
26 use glib::object::ObjectExt;
27 use glib::signal::connect_raw;
28 use glib::signal::SignalHandlerId;
29 use glib::translate::*;
30 use glib::StaticType;
31 use glib::ToValue;
32 use std::boxed::Box as Box_;
33 use std::fmt;
34 use std::mem;
35 use std::mem::transmute;
36 use std::ptr;
37 
38 glib::wrapper! {
39     #[doc(alias = "GtkIconView")]
40     pub struct IconView(Object<ffi::GtkIconView, ffi::GtkIconViewClass>) @extends Container, Widget, @implements Buildable, CellLayout, Scrollable;
41 
42     match fn {
43         type_ => || ffi::gtk_icon_view_get_type(),
44     }
45 }
46 
47 impl IconView {
48     #[doc(alias = "gtk_icon_view_new")]
new() -> IconView49     pub fn new() -> IconView {
50         assert_initialized_main_thread!();
51         unsafe { Widget::from_glib_none(ffi::gtk_icon_view_new()).unsafe_cast() }
52     }
53 
54     #[doc(alias = "gtk_icon_view_new_with_area")]
55     #[doc(alias = "new_with_area")]
with_area<P: IsA<CellArea>>(area: &P) -> IconView56     pub fn with_area<P: IsA<CellArea>>(area: &P) -> IconView {
57         skip_assert_initialized!();
58         unsafe {
59             Widget::from_glib_none(ffi::gtk_icon_view_new_with_area(
60                 area.as_ref().to_glib_none().0,
61             ))
62             .unsafe_cast()
63         }
64     }
65 
66     #[doc(alias = "gtk_icon_view_new_with_model")]
67     #[doc(alias = "new_with_model")]
with_model<P: IsA<TreeModel>>(model: &P) -> IconView68     pub fn with_model<P: IsA<TreeModel>>(model: &P) -> IconView {
69         skip_assert_initialized!();
70         unsafe {
71             Widget::from_glib_none(ffi::gtk_icon_view_new_with_model(
72                 model.as_ref().to_glib_none().0,
73             ))
74             .unsafe_cast()
75         }
76     }
77 
78     // rustdoc-stripper-ignore-next
79     /// Creates a new builder-pattern struct instance to construct [`IconView`] objects.
80     ///
81     /// This method returns an instance of [`IconViewBuilder`] which can be used to create [`IconView`] objects.
builder() -> IconViewBuilder82     pub fn builder() -> IconViewBuilder {
83         IconViewBuilder::default()
84     }
85 }
86 
87 impl Default for IconView {
default() -> Self88     fn default() -> Self {
89         Self::new()
90     }
91 }
92 
93 #[derive(Clone, Default)]
94 // rustdoc-stripper-ignore-next
95 /// A [builder-pattern] type to construct [`IconView`] objects.
96 ///
97 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
98 pub struct IconViewBuilder {
99     activate_on_single_click: Option<bool>,
100     cell_area: Option<CellArea>,
101     column_spacing: Option<i32>,
102     columns: Option<i32>,
103     item_orientation: Option<Orientation>,
104     item_padding: Option<i32>,
105     item_width: Option<i32>,
106     margin: Option<i32>,
107     markup_column: Option<i32>,
108     model: Option<TreeModel>,
109     pixbuf_column: Option<i32>,
110     reorderable: Option<bool>,
111     row_spacing: Option<i32>,
112     selection_mode: Option<SelectionMode>,
113     spacing: Option<i32>,
114     text_column: Option<i32>,
115     tooltip_column: Option<i32>,
116     border_width: Option<u32>,
117     child: Option<Widget>,
118     resize_mode: Option<ResizeMode>,
119     app_paintable: Option<bool>,
120     can_default: Option<bool>,
121     can_focus: Option<bool>,
122     events: Option<gdk::EventMask>,
123     expand: Option<bool>,
124     #[cfg(any(feature = "v3_20", feature = "dox"))]
125     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
126     focus_on_click: Option<bool>,
127     halign: Option<Align>,
128     has_default: Option<bool>,
129     has_focus: Option<bool>,
130     has_tooltip: Option<bool>,
131     height_request: Option<i32>,
132     hexpand: Option<bool>,
133     hexpand_set: Option<bool>,
134     is_focus: Option<bool>,
135     margin_bottom: Option<i32>,
136     margin_end: Option<i32>,
137     margin_start: Option<i32>,
138     margin_top: Option<i32>,
139     name: Option<String>,
140     no_show_all: Option<bool>,
141     opacity: Option<f64>,
142     parent: Option<Container>,
143     receives_default: Option<bool>,
144     sensitive: Option<bool>,
145     tooltip_markup: Option<String>,
146     tooltip_text: Option<String>,
147     valign: Option<Align>,
148     vexpand: Option<bool>,
149     vexpand_set: Option<bool>,
150     visible: Option<bool>,
151     width_request: Option<i32>,
152     hadjustment: Option<Adjustment>,
153     hscroll_policy: Option<ScrollablePolicy>,
154     vadjustment: Option<Adjustment>,
155     vscroll_policy: Option<ScrollablePolicy>,
156 }
157 
158 impl IconViewBuilder {
159     // rustdoc-stripper-ignore-next
160     /// Create a new [`IconViewBuilder`].
new() -> Self161     pub fn new() -> Self {
162         Self::default()
163     }
164 
165     // rustdoc-stripper-ignore-next
166     /// Build the [`IconView`].
build(self) -> IconView167     pub fn build(self) -> IconView {
168         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
169         if let Some(ref activate_on_single_click) = self.activate_on_single_click {
170             properties.push(("activate-on-single-click", activate_on_single_click));
171         }
172         if let Some(ref cell_area) = self.cell_area {
173             properties.push(("cell-area", cell_area));
174         }
175         if let Some(ref column_spacing) = self.column_spacing {
176             properties.push(("column-spacing", column_spacing));
177         }
178         if let Some(ref columns) = self.columns {
179             properties.push(("columns", columns));
180         }
181         if let Some(ref item_orientation) = self.item_orientation {
182             properties.push(("item-orientation", item_orientation));
183         }
184         if let Some(ref item_padding) = self.item_padding {
185             properties.push(("item-padding", item_padding));
186         }
187         if let Some(ref item_width) = self.item_width {
188             properties.push(("item-width", item_width));
189         }
190         if let Some(ref margin) = self.margin {
191             properties.push(("margin", margin));
192         }
193         if let Some(ref markup_column) = self.markup_column {
194             properties.push(("markup-column", markup_column));
195         }
196         if let Some(ref model) = self.model {
197             properties.push(("model", model));
198         }
199         if let Some(ref pixbuf_column) = self.pixbuf_column {
200             properties.push(("pixbuf-column", pixbuf_column));
201         }
202         if let Some(ref reorderable) = self.reorderable {
203             properties.push(("reorderable", reorderable));
204         }
205         if let Some(ref row_spacing) = self.row_spacing {
206             properties.push(("row-spacing", row_spacing));
207         }
208         if let Some(ref selection_mode) = self.selection_mode {
209             properties.push(("selection-mode", selection_mode));
210         }
211         if let Some(ref spacing) = self.spacing {
212             properties.push(("spacing", spacing));
213         }
214         if let Some(ref text_column) = self.text_column {
215             properties.push(("text-column", text_column));
216         }
217         if let Some(ref tooltip_column) = self.tooltip_column {
218             properties.push(("tooltip-column", tooltip_column));
219         }
220         if let Some(ref border_width) = self.border_width {
221             properties.push(("border-width", border_width));
222         }
223         if let Some(ref child) = self.child {
224             properties.push(("child", child));
225         }
226         if let Some(ref resize_mode) = self.resize_mode {
227             properties.push(("resize-mode", resize_mode));
228         }
229         if let Some(ref app_paintable) = self.app_paintable {
230             properties.push(("app-paintable", app_paintable));
231         }
232         if let Some(ref can_default) = self.can_default {
233             properties.push(("can-default", can_default));
234         }
235         if let Some(ref can_focus) = self.can_focus {
236             properties.push(("can-focus", can_focus));
237         }
238         if let Some(ref events) = self.events {
239             properties.push(("events", events));
240         }
241         if let Some(ref expand) = self.expand {
242             properties.push(("expand", expand));
243         }
244         #[cfg(any(feature = "v3_20", feature = "dox"))]
245         if let Some(ref focus_on_click) = self.focus_on_click {
246             properties.push(("focus-on-click", focus_on_click));
247         }
248         if let Some(ref halign) = self.halign {
249             properties.push(("halign", halign));
250         }
251         if let Some(ref has_default) = self.has_default {
252             properties.push(("has-default", has_default));
253         }
254         if let Some(ref has_focus) = self.has_focus {
255             properties.push(("has-focus", has_focus));
256         }
257         if let Some(ref has_tooltip) = self.has_tooltip {
258             properties.push(("has-tooltip", has_tooltip));
259         }
260         if let Some(ref height_request) = self.height_request {
261             properties.push(("height-request", height_request));
262         }
263         if let Some(ref hexpand) = self.hexpand {
264             properties.push(("hexpand", hexpand));
265         }
266         if let Some(ref hexpand_set) = self.hexpand_set {
267             properties.push(("hexpand-set", hexpand_set));
268         }
269         if let Some(ref is_focus) = self.is_focus {
270             properties.push(("is-focus", is_focus));
271         }
272         if let Some(ref margin_bottom) = self.margin_bottom {
273             properties.push(("margin-bottom", margin_bottom));
274         }
275         if let Some(ref margin_end) = self.margin_end {
276             properties.push(("margin-end", margin_end));
277         }
278         if let Some(ref margin_start) = self.margin_start {
279             properties.push(("margin-start", margin_start));
280         }
281         if let Some(ref margin_top) = self.margin_top {
282             properties.push(("margin-top", margin_top));
283         }
284         if let Some(ref name) = self.name {
285             properties.push(("name", name));
286         }
287         if let Some(ref no_show_all) = self.no_show_all {
288             properties.push(("no-show-all", no_show_all));
289         }
290         if let Some(ref opacity) = self.opacity {
291             properties.push(("opacity", opacity));
292         }
293         if let Some(ref parent) = self.parent {
294             properties.push(("parent", parent));
295         }
296         if let Some(ref receives_default) = self.receives_default {
297             properties.push(("receives-default", receives_default));
298         }
299         if let Some(ref sensitive) = self.sensitive {
300             properties.push(("sensitive", sensitive));
301         }
302         if let Some(ref tooltip_markup) = self.tooltip_markup {
303             properties.push(("tooltip-markup", tooltip_markup));
304         }
305         if let Some(ref tooltip_text) = self.tooltip_text {
306             properties.push(("tooltip-text", tooltip_text));
307         }
308         if let Some(ref valign) = self.valign {
309             properties.push(("valign", valign));
310         }
311         if let Some(ref vexpand) = self.vexpand {
312             properties.push(("vexpand", vexpand));
313         }
314         if let Some(ref vexpand_set) = self.vexpand_set {
315             properties.push(("vexpand-set", vexpand_set));
316         }
317         if let Some(ref visible) = self.visible {
318             properties.push(("visible", visible));
319         }
320         if let Some(ref width_request) = self.width_request {
321             properties.push(("width-request", width_request));
322         }
323         if let Some(ref hadjustment) = self.hadjustment {
324             properties.push(("hadjustment", hadjustment));
325         }
326         if let Some(ref hscroll_policy) = self.hscroll_policy {
327             properties.push(("hscroll-policy", hscroll_policy));
328         }
329         if let Some(ref vadjustment) = self.vadjustment {
330             properties.push(("vadjustment", vadjustment));
331         }
332         if let Some(ref vscroll_policy) = self.vscroll_policy {
333             properties.push(("vscroll-policy", vscroll_policy));
334         }
335         glib::Object::new::<IconView>(&properties)
336             .expect("Failed to create an instance of IconView")
337     }
338 
activate_on_single_click(mut self, activate_on_single_click: bool) -> Self339     pub fn activate_on_single_click(mut self, activate_on_single_click: bool) -> Self {
340         self.activate_on_single_click = Some(activate_on_single_click);
341         self
342     }
343 
cell_area<P: IsA<CellArea>>(mut self, cell_area: &P) -> Self344     pub fn cell_area<P: IsA<CellArea>>(mut self, cell_area: &P) -> Self {
345         self.cell_area = Some(cell_area.clone().upcast());
346         self
347     }
348 
column_spacing(mut self, column_spacing: i32) -> Self349     pub fn column_spacing(mut self, column_spacing: i32) -> Self {
350         self.column_spacing = Some(column_spacing);
351         self
352     }
353 
columns(mut self, columns: i32) -> Self354     pub fn columns(mut self, columns: i32) -> Self {
355         self.columns = Some(columns);
356         self
357     }
358 
item_orientation(mut self, item_orientation: Orientation) -> Self359     pub fn item_orientation(mut self, item_orientation: Orientation) -> Self {
360         self.item_orientation = Some(item_orientation);
361         self
362     }
363 
item_padding(mut self, item_padding: i32) -> Self364     pub fn item_padding(mut self, item_padding: i32) -> Self {
365         self.item_padding = Some(item_padding);
366         self
367     }
368 
item_width(mut self, item_width: i32) -> Self369     pub fn item_width(mut self, item_width: i32) -> Self {
370         self.item_width = Some(item_width);
371         self
372     }
373 
margin(mut self, margin: i32) -> Self374     pub fn margin(mut self, margin: i32) -> Self {
375         self.margin = Some(margin);
376         self
377     }
378 
markup_column(mut self, markup_column: i32) -> Self379     pub fn markup_column(mut self, markup_column: i32) -> Self {
380         self.markup_column = Some(markup_column);
381         self
382     }
383 
model<P: IsA<TreeModel>>(mut self, model: &P) -> Self384     pub fn model<P: IsA<TreeModel>>(mut self, model: &P) -> Self {
385         self.model = Some(model.clone().upcast());
386         self
387     }
388 
pixbuf_column(mut self, pixbuf_column: i32) -> Self389     pub fn pixbuf_column(mut self, pixbuf_column: i32) -> Self {
390         self.pixbuf_column = Some(pixbuf_column);
391         self
392     }
393 
reorderable(mut self, reorderable: bool) -> Self394     pub fn reorderable(mut self, reorderable: bool) -> Self {
395         self.reorderable = Some(reorderable);
396         self
397     }
398 
row_spacing(mut self, row_spacing: i32) -> Self399     pub fn row_spacing(mut self, row_spacing: i32) -> Self {
400         self.row_spacing = Some(row_spacing);
401         self
402     }
403 
selection_mode(mut self, selection_mode: SelectionMode) -> Self404     pub fn selection_mode(mut self, selection_mode: SelectionMode) -> Self {
405         self.selection_mode = Some(selection_mode);
406         self
407     }
408 
spacing(mut self, spacing: i32) -> Self409     pub fn spacing(mut self, spacing: i32) -> Self {
410         self.spacing = Some(spacing);
411         self
412     }
413 
text_column(mut self, text_column: i32) -> Self414     pub fn text_column(mut self, text_column: i32) -> Self {
415         self.text_column = Some(text_column);
416         self
417     }
418 
tooltip_column(mut self, tooltip_column: i32) -> Self419     pub fn tooltip_column(mut self, tooltip_column: i32) -> Self {
420         self.tooltip_column = Some(tooltip_column);
421         self
422     }
423 
border_width(mut self, border_width: u32) -> Self424     pub fn border_width(mut self, border_width: u32) -> Self {
425         self.border_width = Some(border_width);
426         self
427     }
428 
child<P: IsA<Widget>>(mut self, child: &P) -> Self429     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
430         self.child = Some(child.clone().upcast());
431         self
432     }
433 
resize_mode(mut self, resize_mode: ResizeMode) -> Self434     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
435         self.resize_mode = Some(resize_mode);
436         self
437     }
438 
app_paintable(mut self, app_paintable: bool) -> Self439     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
440         self.app_paintable = Some(app_paintable);
441         self
442     }
443 
can_default(mut self, can_default: bool) -> Self444     pub fn can_default(mut self, can_default: bool) -> Self {
445         self.can_default = Some(can_default);
446         self
447     }
448 
can_focus(mut self, can_focus: bool) -> Self449     pub fn can_focus(mut self, can_focus: bool) -> Self {
450         self.can_focus = Some(can_focus);
451         self
452     }
453 
events(mut self, events: gdk::EventMask) -> Self454     pub fn events(mut self, events: gdk::EventMask) -> Self {
455         self.events = Some(events);
456         self
457     }
458 
expand(mut self, expand: bool) -> Self459     pub fn expand(mut self, expand: bool) -> Self {
460         self.expand = Some(expand);
461         self
462     }
463 
464     #[cfg(any(feature = "v3_20", feature = "dox"))]
465     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
focus_on_click(mut self, focus_on_click: bool) -> Self466     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
467         self.focus_on_click = Some(focus_on_click);
468         self
469     }
470 
halign(mut self, halign: Align) -> Self471     pub fn halign(mut self, halign: Align) -> Self {
472         self.halign = Some(halign);
473         self
474     }
475 
has_default(mut self, has_default: bool) -> Self476     pub fn has_default(mut self, has_default: bool) -> Self {
477         self.has_default = Some(has_default);
478         self
479     }
480 
has_focus(mut self, has_focus: bool) -> Self481     pub fn has_focus(mut self, has_focus: bool) -> Self {
482         self.has_focus = Some(has_focus);
483         self
484     }
485 
has_tooltip(mut self, has_tooltip: bool) -> Self486     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
487         self.has_tooltip = Some(has_tooltip);
488         self
489     }
490 
height_request(mut self, height_request: i32) -> Self491     pub fn height_request(mut self, height_request: i32) -> Self {
492         self.height_request = Some(height_request);
493         self
494     }
495 
hexpand(mut self, hexpand: bool) -> Self496     pub fn hexpand(mut self, hexpand: bool) -> Self {
497         self.hexpand = Some(hexpand);
498         self
499     }
500 
hexpand_set(mut self, hexpand_set: bool) -> Self501     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
502         self.hexpand_set = Some(hexpand_set);
503         self
504     }
505 
is_focus(mut self, is_focus: bool) -> Self506     pub fn is_focus(mut self, is_focus: bool) -> Self {
507         self.is_focus = Some(is_focus);
508         self
509     }
510 
margin_bottom(mut self, margin_bottom: i32) -> Self511     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
512         self.margin_bottom = Some(margin_bottom);
513         self
514     }
515 
margin_end(mut self, margin_end: i32) -> Self516     pub fn margin_end(mut self, margin_end: i32) -> Self {
517         self.margin_end = Some(margin_end);
518         self
519     }
520 
margin_start(mut self, margin_start: i32) -> Self521     pub fn margin_start(mut self, margin_start: i32) -> Self {
522         self.margin_start = Some(margin_start);
523         self
524     }
525 
margin_top(mut self, margin_top: i32) -> Self526     pub fn margin_top(mut self, margin_top: i32) -> Self {
527         self.margin_top = Some(margin_top);
528         self
529     }
530 
name(mut self, name: &str) -> Self531     pub fn name(mut self, name: &str) -> Self {
532         self.name = Some(name.to_string());
533         self
534     }
535 
no_show_all(mut self, no_show_all: bool) -> Self536     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
537         self.no_show_all = Some(no_show_all);
538         self
539     }
540 
opacity(mut self, opacity: f64) -> Self541     pub fn opacity(mut self, opacity: f64) -> Self {
542         self.opacity = Some(opacity);
543         self
544     }
545 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self546     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
547         self.parent = Some(parent.clone().upcast());
548         self
549     }
550 
receives_default(mut self, receives_default: bool) -> Self551     pub fn receives_default(mut self, receives_default: bool) -> Self {
552         self.receives_default = Some(receives_default);
553         self
554     }
555 
sensitive(mut self, sensitive: bool) -> Self556     pub fn sensitive(mut self, sensitive: bool) -> Self {
557         self.sensitive = Some(sensitive);
558         self
559     }
560 
tooltip_markup(mut self, tooltip_markup: &str) -> Self561     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
562         self.tooltip_markup = Some(tooltip_markup.to_string());
563         self
564     }
565 
tooltip_text(mut self, tooltip_text: &str) -> Self566     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
567         self.tooltip_text = Some(tooltip_text.to_string());
568         self
569     }
570 
valign(mut self, valign: Align) -> Self571     pub fn valign(mut self, valign: Align) -> Self {
572         self.valign = Some(valign);
573         self
574     }
575 
vexpand(mut self, vexpand: bool) -> Self576     pub fn vexpand(mut self, vexpand: bool) -> Self {
577         self.vexpand = Some(vexpand);
578         self
579     }
580 
vexpand_set(mut self, vexpand_set: bool) -> Self581     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
582         self.vexpand_set = Some(vexpand_set);
583         self
584     }
585 
visible(mut self, visible: bool) -> Self586     pub fn visible(mut self, visible: bool) -> Self {
587         self.visible = Some(visible);
588         self
589     }
590 
width_request(mut self, width_request: i32) -> Self591     pub fn width_request(mut self, width_request: i32) -> Self {
592         self.width_request = Some(width_request);
593         self
594     }
595 
hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self596     pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self {
597         self.hadjustment = Some(hadjustment.clone().upcast());
598         self
599     }
600 
hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self601     pub fn hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self {
602         self.hscroll_policy = Some(hscroll_policy);
603         self
604     }
605 
vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self606     pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self {
607         self.vadjustment = Some(vadjustment.clone().upcast());
608         self
609     }
610 
vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self611     pub fn vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self {
612         self.vscroll_policy = Some(vscroll_policy);
613         self
614     }
615 }
616 
617 pub const NONE_ICON_VIEW: Option<&IconView> = None;
618 
619 pub trait IconViewExt: 'static {
620     #[doc(alias = "gtk_icon_view_convert_widget_to_bin_window_coords")]
convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)621     fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32);
622 
623     #[doc(alias = "gtk_icon_view_create_drag_icon")]
create_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>624     fn create_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>;
625 
626     #[doc(alias = "gtk_icon_view_get_activate_on_single_click")]
627     #[doc(alias = "get_activate_on_single_click")]
activates_on_single_click(&self) -> bool628     fn activates_on_single_click(&self) -> bool;
629 
630     #[doc(alias = "gtk_icon_view_get_cell_rect")]
631     #[doc(alias = "get_cell_rect")]
cell_rect<P: IsA<CellRenderer>>( &self, path: &TreePath, cell: Option<&P>, ) -> Option<gdk::Rectangle>632     fn cell_rect<P: IsA<CellRenderer>>(
633         &self,
634         path: &TreePath,
635         cell: Option<&P>,
636     ) -> Option<gdk::Rectangle>;
637 
638     #[doc(alias = "gtk_icon_view_get_column_spacing")]
639     #[doc(alias = "get_column_spacing")]
column_spacing(&self) -> i32640     fn column_spacing(&self) -> i32;
641 
642     #[doc(alias = "gtk_icon_view_get_columns")]
643     #[doc(alias = "get_columns")]
columns(&self) -> i32644     fn columns(&self) -> i32;
645 
646     #[doc(alias = "gtk_icon_view_get_cursor")]
647     #[doc(alias = "get_cursor")]
cursor(&self) -> Option<(TreePath, CellRenderer)>648     fn cursor(&self) -> Option<(TreePath, CellRenderer)>;
649 
650     #[doc(alias = "gtk_icon_view_get_dest_item_at_pos")]
651     #[doc(alias = "get_dest_item_at_pos")]
dest_item_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(TreePath, IconViewDropPosition)>652     fn dest_item_at_pos(
653         &self,
654         drag_x: i32,
655         drag_y: i32,
656     ) -> Option<(TreePath, IconViewDropPosition)>;
657 
658     #[doc(alias = "gtk_icon_view_get_drag_dest_item")]
659     #[doc(alias = "get_drag_dest_item")]
drag_dest_item(&self) -> (TreePath, IconViewDropPosition)660     fn drag_dest_item(&self) -> (TreePath, IconViewDropPosition);
661 
662     #[doc(alias = "gtk_icon_view_get_item_at_pos")]
663     #[doc(alias = "get_item_at_pos")]
item_at_pos(&self, x: i32, y: i32) -> Option<(TreePath, CellRenderer)>664     fn item_at_pos(&self, x: i32, y: i32) -> Option<(TreePath, CellRenderer)>;
665 
666     #[doc(alias = "gtk_icon_view_get_item_column")]
667     #[doc(alias = "get_item_column")]
item_column(&self, path: &TreePath) -> i32668     fn item_column(&self, path: &TreePath) -> i32;
669 
670     #[doc(alias = "gtk_icon_view_get_item_orientation")]
671     #[doc(alias = "get_item_orientation")]
item_orientation(&self) -> Orientation672     fn item_orientation(&self) -> Orientation;
673 
674     #[doc(alias = "gtk_icon_view_get_item_padding")]
675     #[doc(alias = "get_item_padding")]
item_padding(&self) -> i32676     fn item_padding(&self) -> i32;
677 
678     #[doc(alias = "gtk_icon_view_get_item_row")]
679     #[doc(alias = "get_item_row")]
item_row(&self, path: &TreePath) -> i32680     fn item_row(&self, path: &TreePath) -> i32;
681 
682     #[doc(alias = "gtk_icon_view_get_item_width")]
683     #[doc(alias = "get_item_width")]
item_width(&self) -> i32684     fn item_width(&self) -> i32;
685 
686     #[doc(alias = "gtk_icon_view_get_margin")]
687     #[doc(alias = "get_margin")]
margin(&self) -> i32688     fn margin(&self) -> i32;
689 
690     #[doc(alias = "gtk_icon_view_get_markup_column")]
691     #[doc(alias = "get_markup_column")]
markup_column(&self) -> i32692     fn markup_column(&self) -> i32;
693 
694     #[doc(alias = "gtk_icon_view_get_model")]
695     #[doc(alias = "get_model")]
model(&self) -> Option<TreeModel>696     fn model(&self) -> Option<TreeModel>;
697 
698     #[doc(alias = "gtk_icon_view_get_path_at_pos")]
699     #[doc(alias = "get_path_at_pos")]
path_at_pos(&self, x: i32, y: i32) -> Option<TreePath>700     fn path_at_pos(&self, x: i32, y: i32) -> Option<TreePath>;
701 
702     #[doc(alias = "gtk_icon_view_get_pixbuf_column")]
703     #[doc(alias = "get_pixbuf_column")]
pixbuf_column(&self) -> i32704     fn pixbuf_column(&self) -> i32;
705 
706     #[doc(alias = "gtk_icon_view_get_reorderable")]
707     #[doc(alias = "get_reorderable")]
is_reorderable(&self) -> bool708     fn is_reorderable(&self) -> bool;
709 
710     #[doc(alias = "gtk_icon_view_get_row_spacing")]
711     #[doc(alias = "get_row_spacing")]
row_spacing(&self) -> i32712     fn row_spacing(&self) -> i32;
713 
714     #[doc(alias = "gtk_icon_view_get_selected_items")]
715     #[doc(alias = "get_selected_items")]
selected_items(&self) -> Vec<TreePath>716     fn selected_items(&self) -> Vec<TreePath>;
717 
718     #[doc(alias = "gtk_icon_view_get_selection_mode")]
719     #[doc(alias = "get_selection_mode")]
selection_mode(&self) -> SelectionMode720     fn selection_mode(&self) -> SelectionMode;
721 
722     #[doc(alias = "gtk_icon_view_get_spacing")]
723     #[doc(alias = "get_spacing")]
spacing(&self) -> i32724     fn spacing(&self) -> i32;
725 
726     #[doc(alias = "gtk_icon_view_get_text_column")]
727     #[doc(alias = "get_text_column")]
text_column(&self) -> i32728     fn text_column(&self) -> i32;
729 
730     #[doc(alias = "gtk_icon_view_get_tooltip_column")]
731     #[doc(alias = "get_tooltip_column")]
tooltip_column(&self) -> i32732     fn tooltip_column(&self) -> i32;
733 
734     #[doc(alias = "gtk_icon_view_get_tooltip_context")]
735     #[doc(alias = "get_tooltip_context")]
tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(TreeModel, TreePath, TreeIter)>736     fn tooltip_context(
737         &self,
738         x: &mut i32,
739         y: &mut i32,
740         keyboard_tip: bool,
741     ) -> Option<(TreeModel, TreePath, TreeIter)>;
742 
743     #[doc(alias = "gtk_icon_view_get_visible_range")]
744     #[doc(alias = "get_visible_range")]
visible_range(&self) -> Option<(TreePath, TreePath)>745     fn visible_range(&self) -> Option<(TreePath, TreePath)>;
746 
747     #[doc(alias = "gtk_icon_view_item_activated")]
item_activated(&self, path: &TreePath)748     fn item_activated(&self, path: &TreePath);
749 
750     #[doc(alias = "gtk_icon_view_path_is_selected")]
path_is_selected(&self, path: &TreePath) -> bool751     fn path_is_selected(&self, path: &TreePath) -> bool;
752 
753     #[doc(alias = "gtk_icon_view_scroll_to_path")]
scroll_to_path(&self, path: &TreePath, use_align: bool, row_align: f32, col_align: f32)754     fn scroll_to_path(&self, path: &TreePath, use_align: bool, row_align: f32, col_align: f32);
755 
756     #[doc(alias = "gtk_icon_view_select_all")]
select_all(&self)757     fn select_all(&self);
758 
759     #[doc(alias = "gtk_icon_view_select_path")]
select_path(&self, path: &TreePath)760     fn select_path(&self, path: &TreePath);
761 
762     #[doc(alias = "gtk_icon_view_selected_foreach")]
selected_foreach<P: FnMut(&IconView, &TreePath)>(&self, func: P)763     fn selected_foreach<P: FnMut(&IconView, &TreePath)>(&self, func: P);
764 
765     #[doc(alias = "gtk_icon_view_set_activate_on_single_click")]
set_activate_on_single_click(&self, single: bool)766     fn set_activate_on_single_click(&self, single: bool);
767 
768     #[doc(alias = "gtk_icon_view_set_column_spacing")]
set_column_spacing(&self, column_spacing: i32)769     fn set_column_spacing(&self, column_spacing: i32);
770 
771     #[doc(alias = "gtk_icon_view_set_columns")]
set_columns(&self, columns: i32)772     fn set_columns(&self, columns: i32);
773 
774     #[doc(alias = "gtk_icon_view_set_cursor")]
set_cursor<P: IsA<CellRenderer>>( &self, path: &TreePath, cell: Option<&P>, start_editing: bool, )775     fn set_cursor<P: IsA<CellRenderer>>(
776         &self,
777         path: &TreePath,
778         cell: Option<&P>,
779         start_editing: bool,
780     );
781 
782     #[doc(alias = "gtk_icon_view_set_drag_dest_item")]
set_drag_dest_item(&self, path: Option<&TreePath>, pos: IconViewDropPosition)783     fn set_drag_dest_item(&self, path: Option<&TreePath>, pos: IconViewDropPosition);
784 
785     #[doc(alias = "gtk_icon_view_set_item_orientation")]
set_item_orientation(&self, orientation: Orientation)786     fn set_item_orientation(&self, orientation: Orientation);
787 
788     #[doc(alias = "gtk_icon_view_set_item_padding")]
set_item_padding(&self, item_padding: i32)789     fn set_item_padding(&self, item_padding: i32);
790 
791     #[doc(alias = "gtk_icon_view_set_item_width")]
set_item_width(&self, item_width: i32)792     fn set_item_width(&self, item_width: i32);
793 
794     #[doc(alias = "gtk_icon_view_set_margin")]
set_margin(&self, margin: i32)795     fn set_margin(&self, margin: i32);
796 
797     #[doc(alias = "gtk_icon_view_set_markup_column")]
set_markup_column(&self, column: i32)798     fn set_markup_column(&self, column: i32);
799 
800     #[doc(alias = "gtk_icon_view_set_model")]
set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)801     fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>);
802 
803     #[doc(alias = "gtk_icon_view_set_pixbuf_column")]
set_pixbuf_column(&self, column: i32)804     fn set_pixbuf_column(&self, column: i32);
805 
806     #[doc(alias = "gtk_icon_view_set_reorderable")]
set_reorderable(&self, reorderable: bool)807     fn set_reorderable(&self, reorderable: bool);
808 
809     #[doc(alias = "gtk_icon_view_set_row_spacing")]
set_row_spacing(&self, row_spacing: i32)810     fn set_row_spacing(&self, row_spacing: i32);
811 
812     #[doc(alias = "gtk_icon_view_set_selection_mode")]
set_selection_mode(&self, mode: SelectionMode)813     fn set_selection_mode(&self, mode: SelectionMode);
814 
815     #[doc(alias = "gtk_icon_view_set_spacing")]
set_spacing(&self, spacing: i32)816     fn set_spacing(&self, spacing: i32);
817 
818     #[doc(alias = "gtk_icon_view_set_text_column")]
set_text_column(&self, column: i32)819     fn set_text_column(&self, column: i32);
820 
821     #[doc(alias = "gtk_icon_view_set_tooltip_cell")]
set_tooltip_cell<P: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: &TreePath, cell: Option<&P>, )822     fn set_tooltip_cell<P: IsA<CellRenderer>>(
823         &self,
824         tooltip: &Tooltip,
825         path: &TreePath,
826         cell: Option<&P>,
827     );
828 
829     #[doc(alias = "gtk_icon_view_set_tooltip_column")]
set_tooltip_column(&self, column: i32)830     fn set_tooltip_column(&self, column: i32);
831 
832     #[doc(alias = "gtk_icon_view_set_tooltip_item")]
set_tooltip_item(&self, tooltip: &Tooltip, path: &TreePath)833     fn set_tooltip_item(&self, tooltip: &Tooltip, path: &TreePath);
834 
835     #[doc(alias = "gtk_icon_view_unselect_all")]
unselect_all(&self)836     fn unselect_all(&self);
837 
838     #[doc(alias = "gtk_icon_view_unselect_path")]
unselect_path(&self, path: &TreePath)839     fn unselect_path(&self, path: &TreePath);
840 
841     #[doc(alias = "gtk_icon_view_unset_model_drag_dest")]
unset_model_drag_dest(&self)842     fn unset_model_drag_dest(&self);
843 
844     #[doc(alias = "gtk_icon_view_unset_model_drag_source")]
unset_model_drag_source(&self)845     fn unset_model_drag_source(&self);
846 
847     #[doc(alias = "cell-area")]
cell_area(&self) -> Option<CellArea>848     fn cell_area(&self) -> Option<CellArea>;
849 
850     #[doc(alias = "activate-cursor-item")]
connect_activate_cursor_item<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId851     fn connect_activate_cursor_item<F: Fn(&Self) -> bool + 'static>(&self, f: F)
852         -> SignalHandlerId;
853 
emit_activate_cursor_item(&self) -> bool854     fn emit_activate_cursor_item(&self) -> bool;
855 
856     #[doc(alias = "item-activated")]
connect_item_activated<F: Fn(&Self, &TreePath) + 'static>(&self, f: F) -> SignalHandlerId857     fn connect_item_activated<F: Fn(&Self, &TreePath) + 'static>(&self, f: F) -> SignalHandlerId;
858 
859     #[doc(alias = "move-cursor")]
connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId860     fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>(
861         &self,
862         f: F,
863     ) -> SignalHandlerId;
864 
emit_move_cursor(&self, step: MovementStep, count: i32) -> bool865     fn emit_move_cursor(&self, step: MovementStep, count: i32) -> bool;
866 
867     #[doc(alias = "select-all")]
connect_select_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId868     fn connect_select_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
869 
emit_select_all(&self)870     fn emit_select_all(&self);
871 
872     #[doc(alias = "select-cursor-item")]
connect_select_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId873     fn connect_select_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
874 
emit_select_cursor_item(&self)875     fn emit_select_cursor_item(&self);
876 
877     #[doc(alias = "selection-changed")]
connect_selection_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId878     fn connect_selection_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
879 
880     #[doc(alias = "toggle-cursor-item")]
connect_toggle_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId881     fn connect_toggle_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
882 
emit_toggle_cursor_item(&self)883     fn emit_toggle_cursor_item(&self);
884 
885     #[doc(alias = "unselect-all")]
connect_unselect_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId886     fn connect_unselect_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
887 
emit_unselect_all(&self)888     fn emit_unselect_all(&self);
889 
890     #[doc(alias = "activate-on-single-click")]
connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId891     fn connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>(
892         &self,
893         f: F,
894     ) -> SignalHandlerId;
895 
896     #[doc(alias = "column-spacing")]
connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId897     fn connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
898 
899     #[doc(alias = "columns")]
connect_columns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId900     fn connect_columns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
901 
902     #[doc(alias = "item-orientation")]
connect_item_orientation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId903     fn connect_item_orientation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
904 
905     #[doc(alias = "item-padding")]
connect_item_padding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId906     fn connect_item_padding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
907 
908     #[doc(alias = "item-width")]
connect_item_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId909     fn connect_item_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
910 
911     #[doc(alias = "margin")]
connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId912     fn connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
913 
914     #[doc(alias = "markup-column")]
connect_markup_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId915     fn connect_markup_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
916 
917     #[doc(alias = "model")]
connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId918     fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
919 
920     #[doc(alias = "pixbuf-column")]
connect_pixbuf_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId921     fn connect_pixbuf_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
922 
923     #[doc(alias = "reorderable")]
connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId924     fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
925 
926     #[doc(alias = "row-spacing")]
connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId927     fn connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
928 
929     #[doc(alias = "selection-mode")]
connect_selection_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId930     fn connect_selection_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
931 
932     #[doc(alias = "spacing")]
connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId933     fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
934 
935     #[doc(alias = "text-column")]
connect_text_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId936     fn connect_text_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
937 
938     #[doc(alias = "tooltip-column")]
connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId939     fn connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
940 }
941 
942 impl<O: IsA<IconView>> IconViewExt for O {
convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)943     fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32) {
944         unsafe {
945             let mut bx = mem::MaybeUninit::uninit();
946             let mut by = mem::MaybeUninit::uninit();
947             ffi::gtk_icon_view_convert_widget_to_bin_window_coords(
948                 self.as_ref().to_glib_none().0,
949                 wx,
950                 wy,
951                 bx.as_mut_ptr(),
952                 by.as_mut_ptr(),
953             );
954             let bx = bx.assume_init();
955             let by = by.assume_init();
956             (bx, by)
957         }
958     }
959 
create_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>960     fn create_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface> {
961         unsafe {
962             from_glib_full(ffi::gtk_icon_view_create_drag_icon(
963                 self.as_ref().to_glib_none().0,
964                 mut_override(path.to_glib_none().0),
965             ))
966         }
967     }
968 
activates_on_single_click(&self) -> bool969     fn activates_on_single_click(&self) -> bool {
970         unsafe {
971             from_glib(ffi::gtk_icon_view_get_activate_on_single_click(
972                 self.as_ref().to_glib_none().0,
973             ))
974         }
975     }
976 
cell_rect<P: IsA<CellRenderer>>( &self, path: &TreePath, cell: Option<&P>, ) -> Option<gdk::Rectangle>977     fn cell_rect<P: IsA<CellRenderer>>(
978         &self,
979         path: &TreePath,
980         cell: Option<&P>,
981     ) -> Option<gdk::Rectangle> {
982         unsafe {
983             let mut rect = gdk::Rectangle::uninitialized();
984             let ret = from_glib(ffi::gtk_icon_view_get_cell_rect(
985                 self.as_ref().to_glib_none().0,
986                 mut_override(path.to_glib_none().0),
987                 cell.map(|p| p.as_ref()).to_glib_none().0,
988                 rect.to_glib_none_mut().0,
989             ));
990             if ret {
991                 Some(rect)
992             } else {
993                 None
994             }
995         }
996     }
997 
column_spacing(&self) -> i32998     fn column_spacing(&self) -> i32 {
999         unsafe { ffi::gtk_icon_view_get_column_spacing(self.as_ref().to_glib_none().0) }
1000     }
1001 
columns(&self) -> i321002     fn columns(&self) -> i32 {
1003         unsafe { ffi::gtk_icon_view_get_columns(self.as_ref().to_glib_none().0) }
1004     }
1005 
cursor(&self) -> Option<(TreePath, CellRenderer)>1006     fn cursor(&self) -> Option<(TreePath, CellRenderer)> {
1007         unsafe {
1008             let mut path = ptr::null_mut();
1009             let mut cell = ptr::null_mut();
1010             let ret = from_glib(ffi::gtk_icon_view_get_cursor(
1011                 self.as_ref().to_glib_none().0,
1012                 &mut path,
1013                 &mut cell,
1014             ));
1015             if ret {
1016                 Some((from_glib_full(path), from_glib_none(cell)))
1017             } else {
1018                 None
1019             }
1020         }
1021     }
1022 
dest_item_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(TreePath, IconViewDropPosition)>1023     fn dest_item_at_pos(
1024         &self,
1025         drag_x: i32,
1026         drag_y: i32,
1027     ) -> Option<(TreePath, IconViewDropPosition)> {
1028         unsafe {
1029             let mut path = ptr::null_mut();
1030             let mut pos = mem::MaybeUninit::uninit();
1031             let ret = from_glib(ffi::gtk_icon_view_get_dest_item_at_pos(
1032                 self.as_ref().to_glib_none().0,
1033                 drag_x,
1034                 drag_y,
1035                 &mut path,
1036                 pos.as_mut_ptr(),
1037             ));
1038             let pos = pos.assume_init();
1039             if ret {
1040                 Some((from_glib_full(path), from_glib(pos)))
1041             } else {
1042                 None
1043             }
1044         }
1045     }
1046 
drag_dest_item(&self) -> (TreePath, IconViewDropPosition)1047     fn drag_dest_item(&self) -> (TreePath, IconViewDropPosition) {
1048         unsafe {
1049             let mut path = ptr::null_mut();
1050             let mut pos = mem::MaybeUninit::uninit();
1051             ffi::gtk_icon_view_get_drag_dest_item(
1052                 self.as_ref().to_glib_none().0,
1053                 &mut path,
1054                 pos.as_mut_ptr(),
1055             );
1056             let pos = pos.assume_init();
1057             (from_glib_full(path), from_glib(pos))
1058         }
1059     }
1060 
item_at_pos(&self, x: i32, y: i32) -> Option<(TreePath, CellRenderer)>1061     fn item_at_pos(&self, x: i32, y: i32) -> Option<(TreePath, CellRenderer)> {
1062         unsafe {
1063             let mut path = ptr::null_mut();
1064             let mut cell = ptr::null_mut();
1065             let ret = from_glib(ffi::gtk_icon_view_get_item_at_pos(
1066                 self.as_ref().to_glib_none().0,
1067                 x,
1068                 y,
1069                 &mut path,
1070                 &mut cell,
1071             ));
1072             if ret {
1073                 Some((from_glib_full(path), from_glib_none(cell)))
1074             } else {
1075                 None
1076             }
1077         }
1078     }
1079 
item_column(&self, path: &TreePath) -> i321080     fn item_column(&self, path: &TreePath) -> i32 {
1081         unsafe {
1082             ffi::gtk_icon_view_get_item_column(
1083                 self.as_ref().to_glib_none().0,
1084                 mut_override(path.to_glib_none().0),
1085             )
1086         }
1087     }
1088 
item_orientation(&self) -> Orientation1089     fn item_orientation(&self) -> Orientation {
1090         unsafe {
1091             from_glib(ffi::gtk_icon_view_get_item_orientation(
1092                 self.as_ref().to_glib_none().0,
1093             ))
1094         }
1095     }
1096 
item_padding(&self) -> i321097     fn item_padding(&self) -> i32 {
1098         unsafe { ffi::gtk_icon_view_get_item_padding(self.as_ref().to_glib_none().0) }
1099     }
1100 
item_row(&self, path: &TreePath) -> i321101     fn item_row(&self, path: &TreePath) -> i32 {
1102         unsafe {
1103             ffi::gtk_icon_view_get_item_row(
1104                 self.as_ref().to_glib_none().0,
1105                 mut_override(path.to_glib_none().0),
1106             )
1107         }
1108     }
1109 
item_width(&self) -> i321110     fn item_width(&self) -> i32 {
1111         unsafe { ffi::gtk_icon_view_get_item_width(self.as_ref().to_glib_none().0) }
1112     }
1113 
margin(&self) -> i321114     fn margin(&self) -> i32 {
1115         unsafe { ffi::gtk_icon_view_get_margin(self.as_ref().to_glib_none().0) }
1116     }
1117 
markup_column(&self) -> i321118     fn markup_column(&self) -> i32 {
1119         unsafe { ffi::gtk_icon_view_get_markup_column(self.as_ref().to_glib_none().0) }
1120     }
1121 
model(&self) -> Option<TreeModel>1122     fn model(&self) -> Option<TreeModel> {
1123         unsafe { from_glib_none(ffi::gtk_icon_view_get_model(self.as_ref().to_glib_none().0)) }
1124     }
1125 
path_at_pos(&self, x: i32, y: i32) -> Option<TreePath>1126     fn path_at_pos(&self, x: i32, y: i32) -> Option<TreePath> {
1127         unsafe {
1128             from_glib_full(ffi::gtk_icon_view_get_path_at_pos(
1129                 self.as_ref().to_glib_none().0,
1130                 x,
1131                 y,
1132             ))
1133         }
1134     }
1135 
pixbuf_column(&self) -> i321136     fn pixbuf_column(&self) -> i32 {
1137         unsafe { ffi::gtk_icon_view_get_pixbuf_column(self.as_ref().to_glib_none().0) }
1138     }
1139 
is_reorderable(&self) -> bool1140     fn is_reorderable(&self) -> bool {
1141         unsafe {
1142             from_glib(ffi::gtk_icon_view_get_reorderable(
1143                 self.as_ref().to_glib_none().0,
1144             ))
1145         }
1146     }
1147 
row_spacing(&self) -> i321148     fn row_spacing(&self) -> i32 {
1149         unsafe { ffi::gtk_icon_view_get_row_spacing(self.as_ref().to_glib_none().0) }
1150     }
1151 
selected_items(&self) -> Vec<TreePath>1152     fn selected_items(&self) -> Vec<TreePath> {
1153         unsafe {
1154             FromGlibPtrContainer::from_glib_full(ffi::gtk_icon_view_get_selected_items(
1155                 self.as_ref().to_glib_none().0,
1156             ))
1157         }
1158     }
1159 
selection_mode(&self) -> SelectionMode1160     fn selection_mode(&self) -> SelectionMode {
1161         unsafe {
1162             from_glib(ffi::gtk_icon_view_get_selection_mode(
1163                 self.as_ref().to_glib_none().0,
1164             ))
1165         }
1166     }
1167 
spacing(&self) -> i321168     fn spacing(&self) -> i32 {
1169         unsafe { ffi::gtk_icon_view_get_spacing(self.as_ref().to_glib_none().0) }
1170     }
1171 
text_column(&self) -> i321172     fn text_column(&self) -> i32 {
1173         unsafe { ffi::gtk_icon_view_get_text_column(self.as_ref().to_glib_none().0) }
1174     }
1175 
tooltip_column(&self) -> i321176     fn tooltip_column(&self) -> i32 {
1177         unsafe { ffi::gtk_icon_view_get_tooltip_column(self.as_ref().to_glib_none().0) }
1178     }
1179 
tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(TreeModel, TreePath, TreeIter)>1180     fn tooltip_context(
1181         &self,
1182         x: &mut i32,
1183         y: &mut i32,
1184         keyboard_tip: bool,
1185     ) -> Option<(TreeModel, TreePath, TreeIter)> {
1186         unsafe {
1187             let mut model = ptr::null_mut();
1188             let mut path = ptr::null_mut();
1189             let mut iter = TreeIter::uninitialized();
1190             let ret = from_glib(ffi::gtk_icon_view_get_tooltip_context(
1191                 self.as_ref().to_glib_none().0,
1192                 x,
1193                 y,
1194                 keyboard_tip.into_glib(),
1195                 &mut model,
1196                 &mut path,
1197                 iter.to_glib_none_mut().0,
1198             ));
1199             if ret {
1200                 Some((from_glib_none(model), from_glib_full(path), iter))
1201             } else {
1202                 None
1203             }
1204         }
1205     }
1206 
visible_range(&self) -> Option<(TreePath, TreePath)>1207     fn visible_range(&self) -> Option<(TreePath, TreePath)> {
1208         unsafe {
1209             let mut start_path = ptr::null_mut();
1210             let mut end_path = ptr::null_mut();
1211             let ret = from_glib(ffi::gtk_icon_view_get_visible_range(
1212                 self.as_ref().to_glib_none().0,
1213                 &mut start_path,
1214                 &mut end_path,
1215             ));
1216             if ret {
1217                 Some((from_glib_full(start_path), from_glib_full(end_path)))
1218             } else {
1219                 None
1220             }
1221         }
1222     }
1223 
item_activated(&self, path: &TreePath)1224     fn item_activated(&self, path: &TreePath) {
1225         unsafe {
1226             ffi::gtk_icon_view_item_activated(
1227                 self.as_ref().to_glib_none().0,
1228                 mut_override(path.to_glib_none().0),
1229             );
1230         }
1231     }
1232 
path_is_selected(&self, path: &TreePath) -> bool1233     fn path_is_selected(&self, path: &TreePath) -> bool {
1234         unsafe {
1235             from_glib(ffi::gtk_icon_view_path_is_selected(
1236                 self.as_ref().to_glib_none().0,
1237                 mut_override(path.to_glib_none().0),
1238             ))
1239         }
1240     }
1241 
scroll_to_path(&self, path: &TreePath, use_align: bool, row_align: f32, col_align: f32)1242     fn scroll_to_path(&self, path: &TreePath, use_align: bool, row_align: f32, col_align: f32) {
1243         unsafe {
1244             ffi::gtk_icon_view_scroll_to_path(
1245                 self.as_ref().to_glib_none().0,
1246                 mut_override(path.to_glib_none().0),
1247                 use_align.into_glib(),
1248                 row_align,
1249                 col_align,
1250             );
1251         }
1252     }
1253 
select_all(&self)1254     fn select_all(&self) {
1255         unsafe {
1256             ffi::gtk_icon_view_select_all(self.as_ref().to_glib_none().0);
1257         }
1258     }
1259 
select_path(&self, path: &TreePath)1260     fn select_path(&self, path: &TreePath) {
1261         unsafe {
1262             ffi::gtk_icon_view_select_path(
1263                 self.as_ref().to_glib_none().0,
1264                 mut_override(path.to_glib_none().0),
1265             );
1266         }
1267     }
1268 
selected_foreach<P: FnMut(&IconView, &TreePath)>(&self, func: P)1269     fn selected_foreach<P: FnMut(&IconView, &TreePath)>(&self, func: P) {
1270         let func_data: P = func;
1271         unsafe extern "C" fn func_func<P: FnMut(&IconView, &TreePath)>(
1272             icon_view: *mut ffi::GtkIconView,
1273             path: *mut ffi::GtkTreePath,
1274             data: glib::ffi::gpointer,
1275         ) {
1276             let icon_view = from_glib_borrow(icon_view);
1277             let path = from_glib_borrow(path);
1278             let callback: *mut P = data as *const _ as usize as *mut P;
1279             (*callback)(&icon_view, &path);
1280         }
1281         let func = Some(func_func::<P> as _);
1282         let super_callback0: &P = &func_data;
1283         unsafe {
1284             ffi::gtk_icon_view_selected_foreach(
1285                 self.as_ref().to_glib_none().0,
1286                 func,
1287                 super_callback0 as *const _ as usize as *mut _,
1288             );
1289         }
1290     }
1291 
set_activate_on_single_click(&self, single: bool)1292     fn set_activate_on_single_click(&self, single: bool) {
1293         unsafe {
1294             ffi::gtk_icon_view_set_activate_on_single_click(
1295                 self.as_ref().to_glib_none().0,
1296                 single.into_glib(),
1297             );
1298         }
1299     }
1300 
set_column_spacing(&self, column_spacing: i32)1301     fn set_column_spacing(&self, column_spacing: i32) {
1302         unsafe {
1303             ffi::gtk_icon_view_set_column_spacing(self.as_ref().to_glib_none().0, column_spacing);
1304         }
1305     }
1306 
set_columns(&self, columns: i32)1307     fn set_columns(&self, columns: i32) {
1308         unsafe {
1309             ffi::gtk_icon_view_set_columns(self.as_ref().to_glib_none().0, columns);
1310         }
1311     }
1312 
set_cursor<P: IsA<CellRenderer>>( &self, path: &TreePath, cell: Option<&P>, start_editing: bool, )1313     fn set_cursor<P: IsA<CellRenderer>>(
1314         &self,
1315         path: &TreePath,
1316         cell: Option<&P>,
1317         start_editing: bool,
1318     ) {
1319         unsafe {
1320             ffi::gtk_icon_view_set_cursor(
1321                 self.as_ref().to_glib_none().0,
1322                 mut_override(path.to_glib_none().0),
1323                 cell.map(|p| p.as_ref()).to_glib_none().0,
1324                 start_editing.into_glib(),
1325             );
1326         }
1327     }
1328 
set_drag_dest_item(&self, path: Option<&TreePath>, pos: IconViewDropPosition)1329     fn set_drag_dest_item(&self, path: Option<&TreePath>, pos: IconViewDropPosition) {
1330         unsafe {
1331             ffi::gtk_icon_view_set_drag_dest_item(
1332                 self.as_ref().to_glib_none().0,
1333                 mut_override(path.to_glib_none().0),
1334                 pos.into_glib(),
1335             );
1336         }
1337     }
1338 
set_item_orientation(&self, orientation: Orientation)1339     fn set_item_orientation(&self, orientation: Orientation) {
1340         unsafe {
1341             ffi::gtk_icon_view_set_item_orientation(
1342                 self.as_ref().to_glib_none().0,
1343                 orientation.into_glib(),
1344             );
1345         }
1346     }
1347 
set_item_padding(&self, item_padding: i32)1348     fn set_item_padding(&self, item_padding: i32) {
1349         unsafe {
1350             ffi::gtk_icon_view_set_item_padding(self.as_ref().to_glib_none().0, item_padding);
1351         }
1352     }
1353 
set_item_width(&self, item_width: i32)1354     fn set_item_width(&self, item_width: i32) {
1355         unsafe {
1356             ffi::gtk_icon_view_set_item_width(self.as_ref().to_glib_none().0, item_width);
1357         }
1358     }
1359 
set_margin(&self, margin: i32)1360     fn set_margin(&self, margin: i32) {
1361         unsafe {
1362             ffi::gtk_icon_view_set_margin(self.as_ref().to_glib_none().0, margin);
1363         }
1364     }
1365 
set_markup_column(&self, column: i32)1366     fn set_markup_column(&self, column: i32) {
1367         unsafe {
1368             ffi::gtk_icon_view_set_markup_column(self.as_ref().to_glib_none().0, column);
1369         }
1370     }
1371 
set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)1372     fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>) {
1373         unsafe {
1374             ffi::gtk_icon_view_set_model(
1375                 self.as_ref().to_glib_none().0,
1376                 model.map(|p| p.as_ref()).to_glib_none().0,
1377             );
1378         }
1379     }
1380 
set_pixbuf_column(&self, column: i32)1381     fn set_pixbuf_column(&self, column: i32) {
1382         unsafe {
1383             ffi::gtk_icon_view_set_pixbuf_column(self.as_ref().to_glib_none().0, column);
1384         }
1385     }
1386 
set_reorderable(&self, reorderable: bool)1387     fn set_reorderable(&self, reorderable: bool) {
1388         unsafe {
1389             ffi::gtk_icon_view_set_reorderable(
1390                 self.as_ref().to_glib_none().0,
1391                 reorderable.into_glib(),
1392             );
1393         }
1394     }
1395 
set_row_spacing(&self, row_spacing: i32)1396     fn set_row_spacing(&self, row_spacing: i32) {
1397         unsafe {
1398             ffi::gtk_icon_view_set_row_spacing(self.as_ref().to_glib_none().0, row_spacing);
1399         }
1400     }
1401 
set_selection_mode(&self, mode: SelectionMode)1402     fn set_selection_mode(&self, mode: SelectionMode) {
1403         unsafe {
1404             ffi::gtk_icon_view_set_selection_mode(self.as_ref().to_glib_none().0, mode.into_glib());
1405         }
1406     }
1407 
set_spacing(&self, spacing: i32)1408     fn set_spacing(&self, spacing: i32) {
1409         unsafe {
1410             ffi::gtk_icon_view_set_spacing(self.as_ref().to_glib_none().0, spacing);
1411         }
1412     }
1413 
set_text_column(&self, column: i32)1414     fn set_text_column(&self, column: i32) {
1415         unsafe {
1416             ffi::gtk_icon_view_set_text_column(self.as_ref().to_glib_none().0, column);
1417         }
1418     }
1419 
set_tooltip_cell<P: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: &TreePath, cell: Option<&P>, )1420     fn set_tooltip_cell<P: IsA<CellRenderer>>(
1421         &self,
1422         tooltip: &Tooltip,
1423         path: &TreePath,
1424         cell: Option<&P>,
1425     ) {
1426         unsafe {
1427             ffi::gtk_icon_view_set_tooltip_cell(
1428                 self.as_ref().to_glib_none().0,
1429                 tooltip.to_glib_none().0,
1430                 mut_override(path.to_glib_none().0),
1431                 cell.map(|p| p.as_ref()).to_glib_none().0,
1432             );
1433         }
1434     }
1435 
set_tooltip_column(&self, column: i32)1436     fn set_tooltip_column(&self, column: i32) {
1437         unsafe {
1438             ffi::gtk_icon_view_set_tooltip_column(self.as_ref().to_glib_none().0, column);
1439         }
1440     }
1441 
set_tooltip_item(&self, tooltip: &Tooltip, path: &TreePath)1442     fn set_tooltip_item(&self, tooltip: &Tooltip, path: &TreePath) {
1443         unsafe {
1444             ffi::gtk_icon_view_set_tooltip_item(
1445                 self.as_ref().to_glib_none().0,
1446                 tooltip.to_glib_none().0,
1447                 mut_override(path.to_glib_none().0),
1448             );
1449         }
1450     }
1451 
unselect_all(&self)1452     fn unselect_all(&self) {
1453         unsafe {
1454             ffi::gtk_icon_view_unselect_all(self.as_ref().to_glib_none().0);
1455         }
1456     }
1457 
unselect_path(&self, path: &TreePath)1458     fn unselect_path(&self, path: &TreePath) {
1459         unsafe {
1460             ffi::gtk_icon_view_unselect_path(
1461                 self.as_ref().to_glib_none().0,
1462                 mut_override(path.to_glib_none().0),
1463             );
1464         }
1465     }
1466 
unset_model_drag_dest(&self)1467     fn unset_model_drag_dest(&self) {
1468         unsafe {
1469             ffi::gtk_icon_view_unset_model_drag_dest(self.as_ref().to_glib_none().0);
1470         }
1471     }
1472 
unset_model_drag_source(&self)1473     fn unset_model_drag_source(&self) {
1474         unsafe {
1475             ffi::gtk_icon_view_unset_model_drag_source(self.as_ref().to_glib_none().0);
1476         }
1477     }
1478 
cell_area(&self) -> Option<CellArea>1479     fn cell_area(&self) -> Option<CellArea> {
1480         unsafe {
1481             let mut value = glib::Value::from_type(<CellArea as StaticType>::static_type());
1482             glib::gobject_ffi::g_object_get_property(
1483                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1484                 b"cell-area\0".as_ptr() as *const _,
1485                 value.to_glib_none_mut().0,
1486             );
1487             value
1488                 .get()
1489                 .expect("Return Value for property `cell-area` getter")
1490         }
1491     }
1492 
connect_activate_cursor_item<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1493     fn connect_activate_cursor_item<F: Fn(&Self) -> bool + 'static>(
1494         &self,
1495         f: F,
1496     ) -> SignalHandlerId {
1497         unsafe extern "C" fn activate_cursor_item_trampoline<
1498             P: IsA<IconView>,
1499             F: Fn(&P) -> bool + 'static,
1500         >(
1501             this: *mut ffi::GtkIconView,
1502             f: glib::ffi::gpointer,
1503         ) -> glib::ffi::gboolean {
1504             let f: &F = &*(f as *const F);
1505             f(IconView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
1506         }
1507         unsafe {
1508             let f: Box_<F> = Box_::new(f);
1509             connect_raw(
1510                 self.as_ptr() as *mut _,
1511                 b"activate-cursor-item\0".as_ptr() as *const _,
1512                 Some(transmute::<_, unsafe extern "C" fn()>(
1513                     activate_cursor_item_trampoline::<Self, F> as *const (),
1514                 )),
1515                 Box_::into_raw(f),
1516             )
1517         }
1518     }
1519 
emit_activate_cursor_item(&self) -> bool1520     fn emit_activate_cursor_item(&self) -> bool {
1521         let res = unsafe {
1522             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1523                 .emit_by_name("activate-cursor-item", &[])
1524                 .unwrap()
1525         };
1526         res.unwrap()
1527             .get()
1528             .expect("Return Value for `emit_activate_cursor_item`")
1529     }
1530 
connect_item_activated<F: Fn(&Self, &TreePath) + 'static>(&self, f: F) -> SignalHandlerId1531     fn connect_item_activated<F: Fn(&Self, &TreePath) + 'static>(&self, f: F) -> SignalHandlerId {
1532         unsafe extern "C" fn item_activated_trampoline<
1533             P: IsA<IconView>,
1534             F: Fn(&P, &TreePath) + 'static,
1535         >(
1536             this: *mut ffi::GtkIconView,
1537             path: *mut ffi::GtkTreePath,
1538             f: glib::ffi::gpointer,
1539         ) {
1540             let f: &F = &*(f as *const F);
1541             f(
1542                 IconView::from_glib_borrow(this).unsafe_cast_ref(),
1543                 &from_glib_borrow(path),
1544             )
1545         }
1546         unsafe {
1547             let f: Box_<F> = Box_::new(f);
1548             connect_raw(
1549                 self.as_ptr() as *mut _,
1550                 b"item-activated\0".as_ptr() as *const _,
1551                 Some(transmute::<_, unsafe extern "C" fn()>(
1552                     item_activated_trampoline::<Self, F> as *const (),
1553                 )),
1554                 Box_::into_raw(f),
1555             )
1556         }
1557     }
1558 
connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1559     fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>(
1560         &self,
1561         f: F,
1562     ) -> SignalHandlerId {
1563         unsafe extern "C" fn move_cursor_trampoline<
1564             P: IsA<IconView>,
1565             F: Fn(&P, MovementStep, i32) -> bool + 'static,
1566         >(
1567             this: *mut ffi::GtkIconView,
1568             step: ffi::GtkMovementStep,
1569             count: libc::c_int,
1570             f: glib::ffi::gpointer,
1571         ) -> glib::ffi::gboolean {
1572             let f: &F = &*(f as *const F);
1573             f(
1574                 IconView::from_glib_borrow(this).unsafe_cast_ref(),
1575                 from_glib(step),
1576                 count,
1577             )
1578             .into_glib()
1579         }
1580         unsafe {
1581             let f: Box_<F> = Box_::new(f);
1582             connect_raw(
1583                 self.as_ptr() as *mut _,
1584                 b"move-cursor\0".as_ptr() as *const _,
1585                 Some(transmute::<_, unsafe extern "C" fn()>(
1586                     move_cursor_trampoline::<Self, F> as *const (),
1587                 )),
1588                 Box_::into_raw(f),
1589             )
1590         }
1591     }
1592 
emit_move_cursor(&self, step: MovementStep, count: i32) -> bool1593     fn emit_move_cursor(&self, step: MovementStep, count: i32) -> bool {
1594         let res = unsafe {
1595             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1596                 .emit_by_name("move-cursor", &[&step, &count])
1597                 .unwrap()
1598         };
1599         res.unwrap()
1600             .get()
1601             .expect("Return Value for `emit_move_cursor`")
1602     }
1603 
connect_select_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1604     fn connect_select_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1605         unsafe extern "C" fn select_all_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1606             this: *mut ffi::GtkIconView,
1607             f: glib::ffi::gpointer,
1608         ) {
1609             let f: &F = &*(f as *const F);
1610             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1611         }
1612         unsafe {
1613             let f: Box_<F> = Box_::new(f);
1614             connect_raw(
1615                 self.as_ptr() as *mut _,
1616                 b"select-all\0".as_ptr() as *const _,
1617                 Some(transmute::<_, unsafe extern "C" fn()>(
1618                     select_all_trampoline::<Self, F> as *const (),
1619                 )),
1620                 Box_::into_raw(f),
1621             )
1622         }
1623     }
1624 
emit_select_all(&self)1625     fn emit_select_all(&self) {
1626         let _ = unsafe {
1627             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1628                 .emit_by_name("select-all", &[])
1629                 .unwrap()
1630         };
1631     }
1632 
connect_select_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1633     fn connect_select_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1634         unsafe extern "C" fn select_cursor_item_trampoline<
1635             P: IsA<IconView>,
1636             F: Fn(&P) + 'static,
1637         >(
1638             this: *mut ffi::GtkIconView,
1639             f: glib::ffi::gpointer,
1640         ) {
1641             let f: &F = &*(f as *const F);
1642             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1643         }
1644         unsafe {
1645             let f: Box_<F> = Box_::new(f);
1646             connect_raw(
1647                 self.as_ptr() as *mut _,
1648                 b"select-cursor-item\0".as_ptr() as *const _,
1649                 Some(transmute::<_, unsafe extern "C" fn()>(
1650                     select_cursor_item_trampoline::<Self, F> as *const (),
1651                 )),
1652                 Box_::into_raw(f),
1653             )
1654         }
1655     }
1656 
emit_select_cursor_item(&self)1657     fn emit_select_cursor_item(&self) {
1658         let _ = unsafe {
1659             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1660                 .emit_by_name("select-cursor-item", &[])
1661                 .unwrap()
1662         };
1663     }
1664 
connect_selection_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1665     fn connect_selection_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1666         unsafe extern "C" fn selection_changed_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1667             this: *mut ffi::GtkIconView,
1668             f: glib::ffi::gpointer,
1669         ) {
1670             let f: &F = &*(f as *const F);
1671             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1672         }
1673         unsafe {
1674             let f: Box_<F> = Box_::new(f);
1675             connect_raw(
1676                 self.as_ptr() as *mut _,
1677                 b"selection-changed\0".as_ptr() as *const _,
1678                 Some(transmute::<_, unsafe extern "C" fn()>(
1679                     selection_changed_trampoline::<Self, F> as *const (),
1680                 )),
1681                 Box_::into_raw(f),
1682             )
1683         }
1684     }
1685 
connect_toggle_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1686     fn connect_toggle_cursor_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1687         unsafe extern "C" fn toggle_cursor_item_trampoline<
1688             P: IsA<IconView>,
1689             F: Fn(&P) + 'static,
1690         >(
1691             this: *mut ffi::GtkIconView,
1692             f: glib::ffi::gpointer,
1693         ) {
1694             let f: &F = &*(f as *const F);
1695             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1696         }
1697         unsafe {
1698             let f: Box_<F> = Box_::new(f);
1699             connect_raw(
1700                 self.as_ptr() as *mut _,
1701                 b"toggle-cursor-item\0".as_ptr() as *const _,
1702                 Some(transmute::<_, unsafe extern "C" fn()>(
1703                     toggle_cursor_item_trampoline::<Self, F> as *const (),
1704                 )),
1705                 Box_::into_raw(f),
1706             )
1707         }
1708     }
1709 
emit_toggle_cursor_item(&self)1710     fn emit_toggle_cursor_item(&self) {
1711         let _ = unsafe {
1712             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1713                 .emit_by_name("toggle-cursor-item", &[])
1714                 .unwrap()
1715         };
1716     }
1717 
connect_unselect_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1718     fn connect_unselect_all<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1719         unsafe extern "C" fn unselect_all_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1720             this: *mut ffi::GtkIconView,
1721             f: glib::ffi::gpointer,
1722         ) {
1723             let f: &F = &*(f as *const F);
1724             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1725         }
1726         unsafe {
1727             let f: Box_<F> = Box_::new(f);
1728             connect_raw(
1729                 self.as_ptr() as *mut _,
1730                 b"unselect-all\0".as_ptr() as *const _,
1731                 Some(transmute::<_, unsafe extern "C" fn()>(
1732                     unselect_all_trampoline::<Self, F> as *const (),
1733                 )),
1734                 Box_::into_raw(f),
1735             )
1736         }
1737     }
1738 
emit_unselect_all(&self)1739     fn emit_unselect_all(&self) {
1740         let _ = unsafe {
1741             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1742                 .emit_by_name("unselect-all", &[])
1743                 .unwrap()
1744         };
1745     }
1746 
connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1747     fn connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>(
1748         &self,
1749         f: F,
1750     ) -> SignalHandlerId {
1751         unsafe extern "C" fn notify_activate_on_single_click_trampoline<
1752             P: IsA<IconView>,
1753             F: Fn(&P) + 'static,
1754         >(
1755             this: *mut ffi::GtkIconView,
1756             _param_spec: glib::ffi::gpointer,
1757             f: glib::ffi::gpointer,
1758         ) {
1759             let f: &F = &*(f as *const F);
1760             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1761         }
1762         unsafe {
1763             let f: Box_<F> = Box_::new(f);
1764             connect_raw(
1765                 self.as_ptr() as *mut _,
1766                 b"notify::activate-on-single-click\0".as_ptr() as *const _,
1767                 Some(transmute::<_, unsafe extern "C" fn()>(
1768                     notify_activate_on_single_click_trampoline::<Self, F> as *const (),
1769                 )),
1770                 Box_::into_raw(f),
1771             )
1772         }
1773     }
1774 
connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1775     fn connect_column_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1776         unsafe extern "C" fn notify_column_spacing_trampoline<
1777             P: IsA<IconView>,
1778             F: Fn(&P) + 'static,
1779         >(
1780             this: *mut ffi::GtkIconView,
1781             _param_spec: glib::ffi::gpointer,
1782             f: glib::ffi::gpointer,
1783         ) {
1784             let f: &F = &*(f as *const F);
1785             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1786         }
1787         unsafe {
1788             let f: Box_<F> = Box_::new(f);
1789             connect_raw(
1790                 self.as_ptr() as *mut _,
1791                 b"notify::column-spacing\0".as_ptr() as *const _,
1792                 Some(transmute::<_, unsafe extern "C" fn()>(
1793                     notify_column_spacing_trampoline::<Self, F> as *const (),
1794                 )),
1795                 Box_::into_raw(f),
1796             )
1797         }
1798     }
1799 
connect_columns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1800     fn connect_columns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1801         unsafe extern "C" fn notify_columns_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1802             this: *mut ffi::GtkIconView,
1803             _param_spec: glib::ffi::gpointer,
1804             f: glib::ffi::gpointer,
1805         ) {
1806             let f: &F = &*(f as *const F);
1807             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1808         }
1809         unsafe {
1810             let f: Box_<F> = Box_::new(f);
1811             connect_raw(
1812                 self.as_ptr() as *mut _,
1813                 b"notify::columns\0".as_ptr() as *const _,
1814                 Some(transmute::<_, unsafe extern "C" fn()>(
1815                     notify_columns_trampoline::<Self, F> as *const (),
1816                 )),
1817                 Box_::into_raw(f),
1818             )
1819         }
1820     }
1821 
connect_item_orientation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1822     fn connect_item_orientation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1823         unsafe extern "C" fn notify_item_orientation_trampoline<
1824             P: IsA<IconView>,
1825             F: Fn(&P) + 'static,
1826         >(
1827             this: *mut ffi::GtkIconView,
1828             _param_spec: glib::ffi::gpointer,
1829             f: glib::ffi::gpointer,
1830         ) {
1831             let f: &F = &*(f as *const F);
1832             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1833         }
1834         unsafe {
1835             let f: Box_<F> = Box_::new(f);
1836             connect_raw(
1837                 self.as_ptr() as *mut _,
1838                 b"notify::item-orientation\0".as_ptr() as *const _,
1839                 Some(transmute::<_, unsafe extern "C" fn()>(
1840                     notify_item_orientation_trampoline::<Self, F> as *const (),
1841                 )),
1842                 Box_::into_raw(f),
1843             )
1844         }
1845     }
1846 
connect_item_padding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1847     fn connect_item_padding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1848         unsafe extern "C" fn notify_item_padding_trampoline<
1849             P: IsA<IconView>,
1850             F: Fn(&P) + 'static,
1851         >(
1852             this: *mut ffi::GtkIconView,
1853             _param_spec: glib::ffi::gpointer,
1854             f: glib::ffi::gpointer,
1855         ) {
1856             let f: &F = &*(f as *const F);
1857             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1858         }
1859         unsafe {
1860             let f: Box_<F> = Box_::new(f);
1861             connect_raw(
1862                 self.as_ptr() as *mut _,
1863                 b"notify::item-padding\0".as_ptr() as *const _,
1864                 Some(transmute::<_, unsafe extern "C" fn()>(
1865                     notify_item_padding_trampoline::<Self, F> as *const (),
1866                 )),
1867                 Box_::into_raw(f),
1868             )
1869         }
1870     }
1871 
connect_item_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1872     fn connect_item_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1873         unsafe extern "C" fn notify_item_width_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1874             this: *mut ffi::GtkIconView,
1875             _param_spec: glib::ffi::gpointer,
1876             f: glib::ffi::gpointer,
1877         ) {
1878             let f: &F = &*(f as *const F);
1879             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1880         }
1881         unsafe {
1882             let f: Box_<F> = Box_::new(f);
1883             connect_raw(
1884                 self.as_ptr() as *mut _,
1885                 b"notify::item-width\0".as_ptr() as *const _,
1886                 Some(transmute::<_, unsafe extern "C" fn()>(
1887                     notify_item_width_trampoline::<Self, F> as *const (),
1888                 )),
1889                 Box_::into_raw(f),
1890             )
1891         }
1892     }
1893 
connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1894     fn connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1895         unsafe extern "C" fn notify_margin_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1896             this: *mut ffi::GtkIconView,
1897             _param_spec: glib::ffi::gpointer,
1898             f: glib::ffi::gpointer,
1899         ) {
1900             let f: &F = &*(f as *const F);
1901             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1902         }
1903         unsafe {
1904             let f: Box_<F> = Box_::new(f);
1905             connect_raw(
1906                 self.as_ptr() as *mut _,
1907                 b"notify::margin\0".as_ptr() as *const _,
1908                 Some(transmute::<_, unsafe extern "C" fn()>(
1909                     notify_margin_trampoline::<Self, F> as *const (),
1910                 )),
1911                 Box_::into_raw(f),
1912             )
1913         }
1914     }
1915 
connect_markup_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1916     fn connect_markup_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1917         unsafe extern "C" fn notify_markup_column_trampoline<
1918             P: IsA<IconView>,
1919             F: Fn(&P) + 'static,
1920         >(
1921             this: *mut ffi::GtkIconView,
1922             _param_spec: glib::ffi::gpointer,
1923             f: glib::ffi::gpointer,
1924         ) {
1925             let f: &F = &*(f as *const F);
1926             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1927         }
1928         unsafe {
1929             let f: Box_<F> = Box_::new(f);
1930             connect_raw(
1931                 self.as_ptr() as *mut _,
1932                 b"notify::markup-column\0".as_ptr() as *const _,
1933                 Some(transmute::<_, unsafe extern "C" fn()>(
1934                     notify_markup_column_trampoline::<Self, F> as *const (),
1935                 )),
1936                 Box_::into_raw(f),
1937             )
1938         }
1939     }
1940 
connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1941     fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1942         unsafe extern "C" fn notify_model_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
1943             this: *mut ffi::GtkIconView,
1944             _param_spec: glib::ffi::gpointer,
1945             f: glib::ffi::gpointer,
1946         ) {
1947             let f: &F = &*(f as *const F);
1948             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1949         }
1950         unsafe {
1951             let f: Box_<F> = Box_::new(f);
1952             connect_raw(
1953                 self.as_ptr() as *mut _,
1954                 b"notify::model\0".as_ptr() as *const _,
1955                 Some(transmute::<_, unsafe extern "C" fn()>(
1956                     notify_model_trampoline::<Self, F> as *const (),
1957                 )),
1958                 Box_::into_raw(f),
1959             )
1960         }
1961     }
1962 
connect_pixbuf_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1963     fn connect_pixbuf_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1964         unsafe extern "C" fn notify_pixbuf_column_trampoline<
1965             P: IsA<IconView>,
1966             F: Fn(&P) + 'static,
1967         >(
1968             this: *mut ffi::GtkIconView,
1969             _param_spec: glib::ffi::gpointer,
1970             f: glib::ffi::gpointer,
1971         ) {
1972             let f: &F = &*(f as *const F);
1973             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1974         }
1975         unsafe {
1976             let f: Box_<F> = Box_::new(f);
1977             connect_raw(
1978                 self.as_ptr() as *mut _,
1979                 b"notify::pixbuf-column\0".as_ptr() as *const _,
1980                 Some(transmute::<_, unsafe extern "C" fn()>(
1981                     notify_pixbuf_column_trampoline::<Self, F> as *const (),
1982                 )),
1983                 Box_::into_raw(f),
1984             )
1985         }
1986     }
1987 
connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1988     fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1989         unsafe extern "C" fn notify_reorderable_trampoline<
1990             P: IsA<IconView>,
1991             F: Fn(&P) + 'static,
1992         >(
1993             this: *mut ffi::GtkIconView,
1994             _param_spec: glib::ffi::gpointer,
1995             f: glib::ffi::gpointer,
1996         ) {
1997             let f: &F = &*(f as *const F);
1998             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
1999         }
2000         unsafe {
2001             let f: Box_<F> = Box_::new(f);
2002             connect_raw(
2003                 self.as_ptr() as *mut _,
2004                 b"notify::reorderable\0".as_ptr() as *const _,
2005                 Some(transmute::<_, unsafe extern "C" fn()>(
2006                     notify_reorderable_trampoline::<Self, F> as *const (),
2007                 )),
2008                 Box_::into_raw(f),
2009             )
2010         }
2011     }
2012 
connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2013     fn connect_row_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2014         unsafe extern "C" fn notify_row_spacing_trampoline<
2015             P: IsA<IconView>,
2016             F: Fn(&P) + 'static,
2017         >(
2018             this: *mut ffi::GtkIconView,
2019             _param_spec: glib::ffi::gpointer,
2020             f: glib::ffi::gpointer,
2021         ) {
2022             let f: &F = &*(f as *const F);
2023             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
2024         }
2025         unsafe {
2026             let f: Box_<F> = Box_::new(f);
2027             connect_raw(
2028                 self.as_ptr() as *mut _,
2029                 b"notify::row-spacing\0".as_ptr() as *const _,
2030                 Some(transmute::<_, unsafe extern "C" fn()>(
2031                     notify_row_spacing_trampoline::<Self, F> as *const (),
2032                 )),
2033                 Box_::into_raw(f),
2034             )
2035         }
2036     }
2037 
connect_selection_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2038     fn connect_selection_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2039         unsafe extern "C" fn notify_selection_mode_trampoline<
2040             P: IsA<IconView>,
2041             F: Fn(&P) + 'static,
2042         >(
2043             this: *mut ffi::GtkIconView,
2044             _param_spec: glib::ffi::gpointer,
2045             f: glib::ffi::gpointer,
2046         ) {
2047             let f: &F = &*(f as *const F);
2048             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
2049         }
2050         unsafe {
2051             let f: Box_<F> = Box_::new(f);
2052             connect_raw(
2053                 self.as_ptr() as *mut _,
2054                 b"notify::selection-mode\0".as_ptr() as *const _,
2055                 Some(transmute::<_, unsafe extern "C" fn()>(
2056                     notify_selection_mode_trampoline::<Self, F> as *const (),
2057                 )),
2058                 Box_::into_raw(f),
2059             )
2060         }
2061     }
2062 
connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2063     fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2064         unsafe extern "C" fn notify_spacing_trampoline<P: IsA<IconView>, F: Fn(&P) + 'static>(
2065             this: *mut ffi::GtkIconView,
2066             _param_spec: glib::ffi::gpointer,
2067             f: glib::ffi::gpointer,
2068         ) {
2069             let f: &F = &*(f as *const F);
2070             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
2071         }
2072         unsafe {
2073             let f: Box_<F> = Box_::new(f);
2074             connect_raw(
2075                 self.as_ptr() as *mut _,
2076                 b"notify::spacing\0".as_ptr() as *const _,
2077                 Some(transmute::<_, unsafe extern "C" fn()>(
2078                     notify_spacing_trampoline::<Self, F> as *const (),
2079                 )),
2080                 Box_::into_raw(f),
2081             )
2082         }
2083     }
2084 
connect_text_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2085     fn connect_text_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2086         unsafe extern "C" fn notify_text_column_trampoline<
2087             P: IsA<IconView>,
2088             F: Fn(&P) + 'static,
2089         >(
2090             this: *mut ffi::GtkIconView,
2091             _param_spec: glib::ffi::gpointer,
2092             f: glib::ffi::gpointer,
2093         ) {
2094             let f: &F = &*(f as *const F);
2095             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
2096         }
2097         unsafe {
2098             let f: Box_<F> = Box_::new(f);
2099             connect_raw(
2100                 self.as_ptr() as *mut _,
2101                 b"notify::text-column\0".as_ptr() as *const _,
2102                 Some(transmute::<_, unsafe extern "C" fn()>(
2103                     notify_text_column_trampoline::<Self, F> as *const (),
2104                 )),
2105                 Box_::into_raw(f),
2106             )
2107         }
2108     }
2109 
connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2110     fn connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2111         unsafe extern "C" fn notify_tooltip_column_trampoline<
2112             P: IsA<IconView>,
2113             F: Fn(&P) + 'static,
2114         >(
2115             this: *mut ffi::GtkIconView,
2116             _param_spec: glib::ffi::gpointer,
2117             f: glib::ffi::gpointer,
2118         ) {
2119             let f: &F = &*(f as *const F);
2120             f(IconView::from_glib_borrow(this).unsafe_cast_ref())
2121         }
2122         unsafe {
2123             let f: Box_<F> = Box_::new(f);
2124             connect_raw(
2125                 self.as_ptr() as *mut _,
2126                 b"notify::tooltip-column\0".as_ptr() as *const _,
2127                 Some(transmute::<_, unsafe extern "C" fn()>(
2128                     notify_tooltip_column_trampoline::<Self, F> as *const (),
2129                 )),
2130                 Box_::into_raw(f),
2131             )
2132         }
2133     }
2134 }
2135 
2136 impl fmt::Display for IconView {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2137     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2138         f.write_str("IconView")
2139     }
2140 }
2141