gtk4/auto/entry.rs
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#![allow(deprecated)]
5
6#[cfg(feature = "v4_10")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
8use crate::Accessible;
9use crate::{
10 AccessibleRole, Align, Buildable, CellEditable, ConstraintTarget, Editable, EntryBuffer,
11 EntryCompletion, EntryIconPosition, ImageType, InputHints, InputPurpose, LayoutManager,
12 Overflow, Widget, ffi,
13};
14use glib::{
15 object::ObjectType as _,
16 prelude::*,
17 signal::{SignalHandlerId, connect_raw},
18 translate::*,
19};
20use std::boxed::Box as Box_;
21
22#[cfg(feature = "v4_10")]
23#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
24glib::wrapper! {
25 /// A single-line text entry widget.
26 ///
27 /// <picture>
28 /// <source srcset="entry-dark.png" media="(prefers-color-scheme: dark)">
29 /// <img alt="An example GtkEntry" src="entry.png">
30 /// </picture>
31 ///
32 /// A fairly large set of key bindings are supported by default. If the
33 /// entered text is longer than the allocation of the widget, the widget
34 /// will scroll so that the cursor position is visible.
35 ///
36 /// When using an entry for passwords and other sensitive information, it
37 /// can be put into “password mode” using [`EntryExt::set_visibility()`][crate::prelude::EntryExt::set_visibility()].
38 /// In this mode, entered text is displayed using a “invisible” character.
39 /// By default, GTK picks the best invisible character that is available
40 /// in the current font, but it can be changed with
41 /// [`EntryExt::set_invisible_char()`][crate::prelude::EntryExt::set_invisible_char()].
42 ///
43 /// [`Entry`][crate::Entry] has the ability to display progress or activity
44 /// information behind the text. To make an entry display such information,
45 /// use [`EntryExt::set_progress_fraction()`][crate::prelude::EntryExt::set_progress_fraction()] or
46 /// [`EntryExt::set_progress_pulse_step()`][crate::prelude::EntryExt::set_progress_pulse_step()].
47 ///
48 /// Additionally, [`Entry`][crate::Entry] can show icons at either side of the entry.
49 /// These icons can be activatable by clicking, can be set up as drag source
50 /// and can have tooltips. To add an icon, use
51 /// [`EntryExt::set_icon_from_gicon()`][crate::prelude::EntryExt::set_icon_from_gicon()] or one of the various other functions
52 /// that set an icon from an icon name or a paintable. To trigger an action when
53 /// the user clicks an icon, connect to the [`icon-press`][struct@crate::Entry#icon-press] signal.
54 /// To allow DND operations from an icon, use
55 /// [`EntryExt::set_icon_drag_source()`][crate::prelude::EntryExt::set_icon_drag_source()]. To set a tooltip on an icon, use
56 /// [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()] or the corresponding function
57 /// for markup.
58 ///
59 /// Note that functionality or information that is only available by clicking
60 /// on an icon in an entry may not be accessible at all to users which are not
61 /// able to use a mouse or other pointing device. It is therefore recommended
62 /// that any such functionality should also be available by other means, e.g.
63 /// via the context menu of the entry.
64 ///
65 /// # CSS nodes
66 ///
67 /// ```text
68 /// entry[.flat][.warning][.error]
69 /// ├── text[.readonly]
70 /// ├── image.left
71 /// ├── image.right
72 /// ╰── [progress[.pulse]]
73 /// ```
74 ///
75 /// [`Entry`][crate::Entry] has a main node with the name entry. Depending on the properties
76 /// of the entry, the style classes .read-only and .flat may appear. The style
77 /// classes .warning and .error may also be used with entries.
78 ///
79 /// When the entry shows icons, it adds subnodes with the name image and the
80 /// style class .left or .right, depending on where the icon appears.
81 ///
82 /// When the entry shows progress, it adds a subnode with the name progress.
83 /// The node has the style class .pulse when the shown progress is pulsing.
84 ///
85 /// For all the subnodes added to the text node in various situations,
86 /// see [`Text`][crate::Text].
87 ///
88 /// # GtkEntry as GtkBuildable
89 ///
90 /// The [`Entry`][crate::Entry] implementation of the [`Buildable`][crate::Buildable] interface supports a
91 /// custom `<attributes>` element, which supports any number of `<attribute>`
92 /// elements. The `<attribute>` element has attributes named “name“, “value“,
93 /// “start“ and “end“ and allows you to specify `PangoAttribute` values for
94 /// this label.
95 ///
96 /// An example of a UI definition fragment specifying Pango attributes:
97 /// ```xml
98 /// <object class="GtkEntry">
99 /// <attributes>
100 /// <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
101 /// <attribute name="background" value="red" start="5" end="10"/>
102 /// </attributes>
103 /// </object>
104 /// ```
105 ///
106 /// The start and end attributes specify the range of characters to which the
107 /// Pango attribute applies. If start and end are not specified, the attribute
108 /// is applied to the whole text. Note that specifying ranges does not make much
109 /// sense with translatable attributes. Use markup embedded in the translatable
110 /// content instead.
111 ///
112 /// # Accessibility
113 ///
114 /// [`Entry`][crate::Entry] uses the [enum@Gtk.AccessibleRole.text_box] role.
115 ///
116 /// ## Properties
117 ///
118 ///
119 /// #### `activates-default`
120 /// Whether to activate the default widget when Enter is pressed.
121 ///
122 /// Readable | Writable
123 ///
124 ///
125 /// #### `attributes`
126 /// A list of Pango attributes to apply to the text of the entry.
127 ///
128 /// This is mainly useful to change the size or weight of the text.
129 ///
130 /// The `PangoAttribute`'s @start_index and @end_index must refer to the
131 /// [`EntryBuffer`][crate::EntryBuffer] text, i.e. without the preedit string.
132 ///
133 /// Readable | Writable
134 ///
135 ///
136 /// #### `buffer`
137 /// The buffer object which actually stores the text.
138 ///
139 /// Readable | Writable | Construct
140 ///
141 ///
142 /// #### `completion`
143 /// The auxiliary completion object to use with the entry.
144 ///
145 /// Readable | Writable
146 ///
147 ///
148 /// #### `enable-emoji-completion`
149 /// Whether to suggest Emoji replacements for :-delimited names
150 /// like `:heart:`.
151 ///
152 /// Readable | Writable
153 ///
154 ///
155 /// #### `extra-menu`
156 /// A menu model whose contents will be appended to the context menu.
157 ///
158 /// Readable | Writable
159 ///
160 ///
161 /// #### `has-frame`
162 /// Whether the entry should draw a frame.
163 ///
164 /// Readable | Writable
165 ///
166 ///
167 /// #### `im-module`
168 /// Which IM (input method) module should be used for this entry.
169 ///
170 /// See [`IMContext`][crate::IMContext].
171 ///
172 /// Setting this to a non-[`None`] value overrides the system-wide IM
173 /// module setting. See the GtkSettings [`gtk-im-module`][struct@crate::Settings#gtk-im-module]
174 /// property.
175 ///
176 /// Readable | Writable
177 ///
178 ///
179 /// #### `input-hints`
180 /// Additional hints that allow input methods to fine-tune their behavior.
181 ///
182 /// Also see [`input-purpose`][struct@crate::Entry#input-purpose]
183 ///
184 /// Readable | Writable
185 ///
186 ///
187 /// #### `input-purpose`
188 /// The purpose of this text field.
189 ///
190 /// This property can be used by on-screen keyboards and other input
191 /// methods to adjust their behaviour.
192 ///
193 /// Note that setting the purpose to [`InputPurpose::Password`][crate::InputPurpose::Password] or
194 /// [`InputPurpose::Pin`][crate::InputPurpose::Pin] is independent from setting
195 /// [`visibility`][struct@crate::Entry#visibility].
196 ///
197 /// Readable | Writable
198 ///
199 ///
200 /// #### `invisible-char`
201 /// The character to use when masking entry contents (“password mode”).
202 ///
203 /// Readable | Writable
204 ///
205 ///
206 /// #### `invisible-char-set`
207 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
208 ///
209 /// Readable | Writable
210 ///
211 ///
212 /// #### `max-length`
213 /// Maximum number of characters for this entry.
214 ///
215 /// Readable | Writable
216 ///
217 ///
218 /// #### `menu-entry-icon-primary-text`
219 /// Text for an item in the context menu to activate the primary icon action.
220 ///
221 /// When the primary icon is activatable and this property has been set, a new entry
222 /// in the context menu of this GtkEntry will appear with this text. Selecting that
223 /// menu entry will result in the primary icon being activated, exactly in the same way
224 /// as it would be activated from a mouse click.
225 ///
226 /// This simplifies adding accessibility support to applications using activatable
227 /// icons. The activatable icons aren't focusable when navigating the interface with
228 /// the keyboard This is why Gtk recommends to also add those actions in the context
229 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
230 /// enabled, calls the same callback than clicking on the icon.
231 ///
232 /// Readable | Writable
233 ///
234 ///
235 /// #### `menu-entry-icon-secondary-text`
236 /// Text for an item in the context menu to activate the secondary icon action.
237 ///
238 /// When the primary icon is activatable and this property has been set, a new entry
239 /// in the context menu of this GtkEntry will appear with this text. Selecting that
240 /// menu entry will result in the primary icon being activated, exactly in the same way
241 /// as it would be activated from a mouse click.
242 ///
243 /// This simplifies adding accessibility support to applications using activatable
244 /// icons. The activatable icons aren't focusable when navigating the interface with
245 /// the keyboard This is why Gtk recommends to also add those actions in the context
246 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
247 /// enabled, calls the same callback than clicking on the icon.
248 ///
249 /// Readable | Writable
250 ///
251 ///
252 /// #### `overwrite-mode`
253 /// If text is overwritten when typing in the [`Entry`][crate::Entry].
254 ///
255 /// Readable | Writable
256 ///
257 ///
258 /// #### `placeholder-text`
259 /// The text that will be displayed in the [`Entry`][crate::Entry] when it is empty
260 /// and unfocused.
261 ///
262 /// Readable | Writable
263 ///
264 ///
265 /// #### `primary-icon-activatable`
266 /// Whether the primary icon is activatable.
267 ///
268 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
269 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
270 /// activatable icons.
271 ///
272 /// Sensitive, but non-activatable icons can be used for purely
273 /// informational purposes.
274 ///
275 /// Readable | Writable
276 ///
277 ///
278 /// #### `primary-icon-gicon`
279 /// The `GIcon` to use for the primary icon for the entry.
280 ///
281 /// Readable | Writable
282 ///
283 ///
284 /// #### `primary-icon-name`
285 /// The icon name to use for the primary icon for the entry.
286 ///
287 /// Readable | Writable
288 ///
289 ///
290 /// #### `primary-icon-paintable`
291 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the primary icon for the entry.
292 ///
293 /// Readable | Writable
294 ///
295 ///
296 /// #### `primary-icon-sensitive`
297 /// Whether the primary icon is sensitive.
298 ///
299 /// An insensitive icon appears grayed out. GTK does not emit the
300 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
301 /// signals and does not allow DND from insensitive icons.
302 ///
303 /// An icon should be set insensitive if the action that would trigger
304 /// when clicked is currently not available.
305 ///
306 /// Readable | Writable
307 ///
308 ///
309 /// #### `primary-icon-storage-type`
310 /// The representation which is used for the primary icon of the entry.
311 ///
312 /// Readable
313 ///
314 ///
315 /// #### `primary-icon-tooltip-markup`
316 /// The contents of the tooltip on the primary icon, with markup.
317 ///
318 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
319 ///
320 /// Readable | Writable
321 ///
322 ///
323 /// #### `primary-icon-tooltip-text`
324 /// The contents of the tooltip on the primary icon.
325 ///
326 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
327 ///
328 /// Readable | Writable
329 ///
330 ///
331 /// #### `progress-fraction`
332 /// The current fraction of the task that's been completed.
333 ///
334 /// Readable | Writable
335 ///
336 ///
337 /// #### `progress-pulse-step`
338 /// The fraction of total entry width to move the progress
339 /// bouncing block for each pulse.
340 ///
341 /// See [`EntryExt::progress_pulse()`][crate::prelude::EntryExt::progress_pulse()].
342 ///
343 /// Readable | Writable
344 ///
345 ///
346 /// #### `scroll-offset`
347 /// Number of pixels of the entry scrolled off the screen to the left.
348 ///
349 /// Readable
350 ///
351 ///
352 /// #### `secondary-icon-activatable`
353 /// Whether the secondary icon is activatable.
354 ///
355 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
356 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
357 /// activatable icons.
358 ///
359 /// Sensitive, but non-activatable icons can be used for purely
360 /// informational purposes.
361 ///
362 /// Readable | Writable
363 ///
364 ///
365 /// #### `secondary-icon-gicon`
366 /// The `GIcon` to use for the secondary icon for the entry.
367 ///
368 /// Readable | Writable
369 ///
370 ///
371 /// #### `secondary-icon-name`
372 /// The icon name to use for the secondary icon for the entry.
373 ///
374 /// Readable | Writable
375 ///
376 ///
377 /// #### `secondary-icon-paintable`
378 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the secondary icon for the entry.
379 ///
380 /// Readable | Writable
381 ///
382 ///
383 /// #### `secondary-icon-sensitive`
384 /// Whether the secondary icon is sensitive.
385 ///
386 /// An insensitive icon appears grayed out. GTK does not emit the
387 /// [`icon-press`][struct@crate::Entry#icon-press][ and [`icon-release`][struct@crate::Entry#icon-release]
388 /// signals and does not allow DND from insensitive icons.
389 ///
390 /// An icon should be set insensitive if the action that would trigger
391 /// when clicked is currently not available.
392 ///
393 /// Readable | Writable
394 ///
395 ///
396 /// #### `secondary-icon-storage-type`
397 /// The representation which is used for the secondary icon of the entry.
398 ///
399 /// Readable
400 ///
401 ///
402 /// #### `secondary-icon-tooltip-markup`
403 /// The contents of the tooltip on the secondary icon, with markup.
404 ///
405 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
406 ///
407 /// Readable | Writable
408 ///
409 ///
410 /// #### `secondary-icon-tooltip-text`
411 /// The contents of the tooltip on the secondary icon.
412 ///
413 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
414 ///
415 /// Readable | Writable
416 ///
417 ///
418 /// #### `show-emoji-icon`
419 /// Whether the entry will show an Emoji icon in the secondary icon position
420 /// to open the Emoji chooser.
421 ///
422 /// Readable | Writable
423 ///
424 ///
425 /// #### `tabs`
426 /// A list of tabstops to apply to the text of the entry.
427 ///
428 /// Readable | Writable
429 ///
430 ///
431 /// #### `text-length`
432 /// The length of the text in the [`Entry`][crate::Entry].
433 ///
434 /// Readable
435 ///
436 ///
437 /// #### `truncate-multiline`
438 /// When [`true`], pasted multi-line text is truncated to the first line.
439 ///
440 /// Readable | Writable
441 ///
442 ///
443 /// #### `visibility`
444 /// Whether the entry should show the “invisible char” instead of the
445 /// actual text (“password mode”).
446 ///
447 /// Readable | Writable
448 /// <details><summary><h4>Widget</h4></summary>
449 ///
450 ///
451 /// #### `can-focus`
452 /// Whether the widget or any of its descendents can accept
453 /// the input focus.
454 ///
455 /// This property is meant to be set by widget implementations,
456 /// typically in their instance init function.
457 ///
458 /// Readable | Writable
459 ///
460 ///
461 /// #### `can-target`
462 /// Whether the widget can receive pointer events.
463 ///
464 /// Readable | Writable
465 ///
466 ///
467 /// #### `css-classes`
468 /// A list of css classes applied to this widget.
469 ///
470 /// Readable | Writable
471 ///
472 ///
473 /// #### `css-name`
474 /// The name of this widget in the CSS tree.
475 ///
476 /// This property is meant to be set by widget implementations,
477 /// typically in their instance init function.
478 ///
479 /// Readable | Writable | Construct Only
480 ///
481 ///
482 /// #### `cursor`
483 /// The cursor used by @widget.
484 ///
485 /// Readable | Writable
486 ///
487 ///
488 /// #### `focus-on-click`
489 /// Whether the widget should grab focus when it is clicked with the mouse.
490 ///
491 /// This property is only relevant for widgets that can take focus.
492 ///
493 /// Readable | Writable
494 ///
495 ///
496 /// #### `focusable`
497 /// Whether this widget itself will accept the input focus.
498 ///
499 /// Readable | Writable
500 ///
501 ///
502 /// #### `halign`
503 /// How to distribute horizontal space if widget gets extra space.
504 ///
505 /// Readable | Writable
506 ///
507 ///
508 /// #### `has-default`
509 /// Whether the widget is the default widget.
510 ///
511 /// Readable
512 ///
513 ///
514 /// #### `has-focus`
515 /// Whether the widget has the input focus.
516 ///
517 /// Readable
518 ///
519 ///
520 /// #### `has-tooltip`
521 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
522 /// signal on @widget.
523 ///
524 /// A true value indicates that @widget can have a tooltip, in this case
525 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
526 /// determine whether it will provide a tooltip or not.
527 ///
528 /// Readable | Writable
529 ///
530 ///
531 /// #### `height-request`
532 /// Overrides for height request of the widget.
533 ///
534 /// If this is -1, the natural request will be used.
535 ///
536 /// Readable | Writable
537 ///
538 ///
539 /// #### `hexpand`
540 /// Whether to expand horizontally.
541 ///
542 /// Readable | Writable
543 ///
544 ///
545 /// #### `hexpand-set`
546 /// Whether to use the `hexpand` property.
547 ///
548 /// Readable | Writable
549 ///
550 ///
551 /// #### `layout-manager`
552 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
553 /// the preferred size of the widget, and allocate its children.
554 ///
555 /// This property is meant to be set by widget implementations,
556 /// typically in their instance init function.
557 ///
558 /// Readable | Writable
559 ///
560 ///
561 /// #### `limit-events`
562 /// Makes this widget act like a modal dialog, with respect to
563 /// event delivery.
564 ///
565 /// Global event controllers will not handle events with targets
566 /// inside the widget, unless they are set up to ignore propagation
567 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
568 ///
569 /// Readable | Writable
570 ///
571 ///
572 /// #### `margin-bottom`
573 /// Margin on bottom side of widget.
574 ///
575 /// This property adds margin outside of the widget's normal size
576 /// request, the margin will be added in addition to the size from
577 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
578 ///
579 /// Readable | Writable
580 ///
581 ///
582 /// #### `margin-end`
583 /// Margin on end of widget, horizontally.
584 ///
585 /// This property supports left-to-right and right-to-left text
586 /// directions.
587 ///
588 /// This property adds margin outside of the widget's normal size
589 /// request, the margin will be added in addition to the size from
590 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
591 ///
592 /// Readable | Writable
593 ///
594 ///
595 /// #### `margin-start`
596 /// Margin on start of widget, horizontally.
597 ///
598 /// This property supports left-to-right and right-to-left text
599 /// directions.
600 ///
601 /// This property adds margin outside of the widget's normal size
602 /// request, the margin will be added in addition to the size from
603 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
604 ///
605 /// Readable | Writable
606 ///
607 ///
608 /// #### `margin-top`
609 /// Margin on top side of widget.
610 ///
611 /// This property adds margin outside of the widget's normal size
612 /// request, the margin will be added in addition to the size from
613 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
614 ///
615 /// Readable | Writable
616 ///
617 ///
618 /// #### `name`
619 /// The name of the widget.
620 ///
621 /// Readable | Writable
622 ///
623 ///
624 /// #### `opacity`
625 /// The requested opacity of the widget.
626 ///
627 /// Readable | Writable
628 ///
629 ///
630 /// #### `overflow`
631 /// How content outside the widget's content area is treated.
632 ///
633 /// This property is meant to be set by widget implementations,
634 /// typically in their instance init function.
635 ///
636 /// Readable | Writable
637 ///
638 ///
639 /// #### `parent`
640 /// The parent widget of this widget.
641 ///
642 /// Readable
643 ///
644 ///
645 /// #### `receives-default`
646 /// Whether the widget will receive the default action when it is focused.
647 ///
648 /// Readable | Writable
649 ///
650 ///
651 /// #### `root`
652 /// The [`Root`][crate::Root] widget of the widget tree containing this widget.
653 ///
654 /// This will be `NULL` if the widget is not contained in a root widget.
655 ///
656 /// Readable
657 ///
658 ///
659 /// #### `scale-factor`
660 /// The scale factor of the widget.
661 ///
662 /// Readable
663 ///
664 ///
665 /// #### `sensitive`
666 /// Whether the widget responds to input.
667 ///
668 /// Readable | Writable
669 ///
670 ///
671 /// #### `tooltip-markup`
672 /// Sets the text of tooltip to be the given string, which is marked up
673 /// with Pango markup.
674 ///
675 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
676 ///
677 /// This is a convenience property which will take care of getting the
678 /// tooltip shown if the given string is not `NULL`:
679 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
680 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
681 /// the default signal handler.
682 ///
683 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
684 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
685 ///
686 /// Readable | Writable
687 ///
688 ///
689 /// #### `tooltip-text`
690 /// Sets the text of tooltip to be the given string.
691 ///
692 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
693 ///
694 /// This is a convenience property which will take care of getting the
695 /// tooltip shown if the given string is not `NULL`:
696 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
697 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
698 /// the default signal handler.
699 ///
700 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
701 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
702 ///
703 /// Readable | Writable
704 ///
705 ///
706 /// #### `valign`
707 /// How to distribute vertical space if widget gets extra space.
708 ///
709 /// Readable | Writable
710 ///
711 ///
712 /// #### `vexpand`
713 /// Whether to expand vertically.
714 ///
715 /// Readable | Writable
716 ///
717 ///
718 /// #### `vexpand-set`
719 /// Whether to use the `vexpand` property.
720 ///
721 /// Readable | Writable
722 ///
723 ///
724 /// #### `visible`
725 /// Whether the widget is visible.
726 ///
727 /// Readable | Writable
728 ///
729 ///
730 /// #### `width-request`
731 /// Overrides for width request of the widget.
732 ///
733 /// If this is -1, the natural request will be used.
734 ///
735 /// Readable | Writable
736 /// </details>
737 /// <details><summary><h4>Accessible</h4></summary>
738 ///
739 ///
740 /// #### `accessible-role`
741 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
742 ///
743 /// The accessible role cannot be changed once set.
744 ///
745 /// Readable | Writable
746 /// </details>
747 /// <details><summary><h4>CellEditable</h4></summary>
748 ///
749 ///
750 /// #### `editing-canceled`
751 /// Indicates whether editing on the cell has been canceled.
752 ///
753 /// Readable | Writable
754 /// </details>
755 /// <details><summary><h4>Editable</h4></summary>
756 ///
757 ///
758 /// #### `complete-text`
759 /// The contents of the entry, including uncommited content such as the
760 /// preedit.
761 ///
762 /// Readable
763 ///
764 ///
765 /// #### `cursor-position`
766 /// The current position of the insertion cursor in chars.
767 ///
768 /// Readable
769 ///
770 ///
771 /// #### `editable`
772 /// Whether the entry contents can be edited.
773 ///
774 /// Readable | Writable
775 ///
776 ///
777 /// #### `enable-undo`
778 /// If undo/redo should be enabled for the editable.
779 ///
780 /// Readable | Writable
781 ///
782 ///
783 /// #### `max-width-chars`
784 /// The desired maximum width of the entry, in characters.
785 ///
786 /// Readable | Writable
787 ///
788 ///
789 /// #### `selection-bound`
790 /// The position of the opposite end of the selection from the cursor in chars.
791 ///
792 /// Readable
793 ///
794 ///
795 /// #### `text`
796 /// The contents of the entry.
797 ///
798 /// Readable | Writable
799 ///
800 ///
801 /// #### `width-chars`
802 /// Number of characters to leave space for in the entry.
803 ///
804 /// Readable | Writable
805 ///
806 ///
807 /// #### `xalign`
808 /// The horizontal alignment, from 0 (left) to 1 (right).
809 ///
810 /// Reversed for RTL layouts.
811 ///
812 /// Readable | Writable
813 /// </details>
814 ///
815 /// ## Signals
816 ///
817 ///
818 /// #### `activate`
819 /// Emitted when the entry is activated.
820 ///
821 /// The keybindings for this signal are all forms of the Enter key.
822 ///
823 /// Action
824 ///
825 ///
826 /// #### `icon-press`
827 /// Emitted when an activatable icon is clicked.
828 ///
829 ///
830 ///
831 ///
832 /// #### `icon-release`
833 /// Emitted on the button release from a mouse click
834 /// over an activatable icon.
835 ///
836 ///
837 /// <details><summary><h4>Widget</h4></summary>
838 ///
839 ///
840 /// #### `destroy`
841 /// Signals that all holders of a reference to the widget should release
842 /// the reference that they hold.
843 ///
844 /// May result in finalization of the widget if all references are released.
845 ///
846 /// This signal is not suitable for saving widget state.
847 ///
848 ///
849 ///
850 ///
851 /// #### `direction-changed`
852 /// Emitted when the text direction of a widget changes.
853 ///
854 ///
855 ///
856 ///
857 /// #### `hide`
858 /// Emitted when @widget is hidden.
859 ///
860 ///
861 ///
862 ///
863 /// #### `keynav-failed`
864 /// Emitted if keyboard navigation fails.
865 ///
866 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
867 ///
868 ///
869 ///
870 ///
871 /// #### `map`
872 /// Emitted when @widget is going to be mapped.
873 ///
874 /// A widget is mapped when the widget is visible (which is controlled with
875 /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
876 /// are also visible.
877 ///
878 /// The `::map` signal can be used to determine whether a widget will be drawn,
879 /// for instance it can resume an animation that was stopped during the
880 /// emission of [`unmap`][struct@crate::Widget#unmap].
881 ///
882 ///
883 ///
884 ///
885 /// #### `mnemonic-activate`
886 /// Emitted when a widget is activated via a mnemonic.
887 ///
888 /// The default handler for this signal activates @widget if @group_cycling
889 /// is false, or just makes @widget grab focus if @group_cycling is true.
890 ///
891 ///
892 ///
893 ///
894 /// #### `move-focus`
895 /// Emitted when the focus is moved.
896 ///
897 /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
898 ///
899 /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
900 /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
901 ///
902 /// Action
903 ///
904 ///
905 /// #### `query-tooltip`
906 /// Emitted when the widget’s tooltip is about to be shown.
907 ///
908 /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
909 /// is true and the hover timeout has expired with the cursor hovering
910 /// above @widget; or emitted when @widget got focus in keyboard mode.
911 ///
912 /// Using the given coordinates, the signal handler should determine
913 /// whether a tooltip should be shown for @widget. If this is the case
914 /// true should be returned, false otherwise. Note that if @keyboard_mode
915 /// is true, the values of @x and @y are undefined and should not be used.
916 ///
917 /// The signal handler is free to manipulate @tooltip with the therefore
918 /// destined function calls.
919 ///
920 ///
921 ///
922 ///
923 /// #### `realize`
924 /// Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
925 ///
926 /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
927 /// or the widget has been mapped (that is, it is going to be drawn).
928 ///
929 ///
930 ///
931 ///
932 /// #### `show`
933 /// Emitted when @widget is shown.
934 ///
935 ///
936 ///
937 ///
938 /// #### `state-flags-changed`
939 /// Emitted when the widget state changes.
940 ///
941 /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
942 ///
943 ///
944 ///
945 ///
946 /// #### `unmap`
947 /// Emitted when @widget is going to be unmapped.
948 ///
949 /// A widget is unmapped when either it or any of its parents up to the
950 /// toplevel widget have been set as hidden.
951 ///
952 /// As `::unmap` indicates that a widget will not be shown any longer,
953 /// it can be used to, for example, stop an animation on the widget.
954 ///
955 ///
956 ///
957 ///
958 /// #### `unrealize`
959 /// Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
960 ///
961 /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
962 /// or the widget has been unmapped (that is, it is going to be hidden).
963 ///
964 ///
965 /// </details>
966 /// <details><summary><h4>CellEditable</h4></summary>
967 ///
968 ///
969 /// #### `editing-done`
970 /// This signal is a sign for the cell renderer to update its
971 /// value from the @cell_editable.
972 ///
973 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
974 /// emitting this signal when they are done editing, e.g.
975 /// [`Entry`][crate::Entry] emits this signal when the user presses Enter. Typical things to
976 /// do in a handler for ::editing-done are to capture the edited value,
977 /// disconnect the @cell_editable from signals on the [`CellRenderer`][crate::CellRenderer], etc.
978 ///
979 /// gtk_cell_editable_editing_done() is a convenience method
980 /// for emitting `GtkCellEditable::editing-done`.
981 ///
982 ///
983 ///
984 ///
985 /// #### `remove-widget`
986 /// This signal is meant to indicate that the cell is finished
987 /// editing, and the @cell_editable widget is being removed and may
988 /// subsequently be destroyed.
989 ///
990 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
991 /// emitting this signal when they are done editing. It must
992 /// be emitted after the `GtkCellEditable::editing-done` signal,
993 /// to give the cell renderer a chance to update the cell's value
994 /// before the widget is removed.
995 ///
996 /// gtk_cell_editable_remove_widget() is a convenience method
997 /// for emitting `GtkCellEditable::remove-widget`.
998 ///
999 ///
1000 /// </details>
1001 /// <details><summary><h4>Editable</h4></summary>
1002 ///
1003 ///
1004 /// #### `changed`
1005 /// Emitted at the end of a single user-visible operation on the
1006 /// contents.
1007 ///
1008 /// E.g., a paste operation that replaces the contents of the
1009 /// selection will cause only one signal emission (even though it
1010 /// is implemented by first deleting the selection, then inserting
1011 /// the new content, and may cause multiple ::notify::text signals
1012 /// to be emitted).
1013 ///
1014 ///
1015 ///
1016 ///
1017 /// #### `delete-text`
1018 /// Emitted when text is deleted from the widget by the user.
1019 ///
1020 /// The default handler for this signal will normally be responsible for
1021 /// deleting the text, so by connecting to this signal and then stopping
1022 /// the signal with g_signal_stop_emission(), it is possible to modify the
1023 /// range of deleted text, or prevent it from being deleted entirely.
1024 ///
1025 /// The @start_pos and @end_pos parameters are interpreted as for
1026 /// [`EditableExt::delete_text()`][crate::prelude::EditableExt::delete_text()].
1027 ///
1028 ///
1029 ///
1030 ///
1031 /// #### `insert-text`
1032 /// Emitted when text is inserted into the widget by the user.
1033 ///
1034 /// The default handler for this signal will normally be responsible
1035 /// for inserting the text, so by connecting to this signal and then
1036 /// stopping the signal with g_signal_stop_emission(), it is possible
1037 /// to modify the inserted text, or prevent it from being inserted entirely.
1038 ///
1039 ///
1040 /// </details>
1041 ///
1042 /// # Implements
1043 ///
1044 /// [`EntryExt`][trait@crate::prelude::EntryExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`CellEditableExt`][trait@crate::prelude::CellEditableExt], [`EditableExt`][trait@crate::prelude::EditableExt], [`EntryExtManual`][trait@crate::prelude::EntryExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual], [`EditableExtManual`][trait@crate::prelude::EditableExtManual]
1045 #[doc(alias = "GtkEntry")]
1046 pub struct Entry(Object<ffi::GtkEntry, ffi::GtkEntryClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, CellEditable, Editable;
1047
1048 match fn {
1049 type_ => || ffi::gtk_entry_get_type(),
1050 }
1051}
1052
1053#[cfg(not(feature = "v4_10"))]
1054glib::wrapper! {
1055 #[doc(alias = "GtkEntry")]
1056 pub struct Entry(Object<ffi::GtkEntry, ffi::GtkEntryClass>) @extends Widget, @implements Buildable, ConstraintTarget, CellEditable, Editable;
1057
1058 match fn {
1059 type_ => || ffi::gtk_entry_get_type(),
1060 }
1061}
1062
1063impl Entry {
1064 pub const NONE: Option<&'static Entry> = None;
1065
1066 /// Creates a new entry.
1067 ///
1068 /// # Returns
1069 ///
1070 /// a new [`Entry`][crate::Entry].
1071 #[doc(alias = "gtk_entry_new")]
1072 pub fn new() -> Entry {
1073 assert_initialized_main_thread!();
1074 unsafe { Widget::from_glib_none(ffi::gtk_entry_new()).unsafe_cast() }
1075 }
1076
1077 /// Creates a new entry with the specified text buffer.
1078 /// ## `buffer`
1079 /// The buffer to use for the new [`Entry`][crate::Entry].
1080 ///
1081 /// # Returns
1082 ///
1083 /// a new [`Entry`][crate::Entry]
1084 #[doc(alias = "gtk_entry_new_with_buffer")]
1085 #[doc(alias = "new_with_buffer")]
1086 pub fn with_buffer(buffer: &impl IsA<EntryBuffer>) -> Entry {
1087 skip_assert_initialized!();
1088 unsafe {
1089 Widget::from_glib_none(ffi::gtk_entry_new_with_buffer(
1090 buffer.as_ref().to_glib_none().0,
1091 ))
1092 .unsafe_cast()
1093 }
1094 }
1095
1096 // rustdoc-stripper-ignore-next
1097 /// Creates a new builder-pattern struct instance to construct [`Entry`] objects.
1098 ///
1099 /// This method returns an instance of [`EntryBuilder`](crate::builders::EntryBuilder) which can be used to create [`Entry`] objects.
1100 pub fn builder() -> EntryBuilder {
1101 EntryBuilder::new()
1102 }
1103}
1104
1105impl Default for Entry {
1106 fn default() -> Self {
1107 Self::new()
1108 }
1109}
1110
1111// rustdoc-stripper-ignore-next
1112/// A [builder-pattern] type to construct [`Entry`] objects.
1113///
1114/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1115#[must_use = "The builder must be built to be used"]
1116pub struct EntryBuilder {
1117 builder: glib::object::ObjectBuilder<'static, Entry>,
1118}
1119
1120impl EntryBuilder {
1121 fn new() -> Self {
1122 Self {
1123 builder: glib::object::Object::builder(),
1124 }
1125 }
1126
1127 /// Whether to activate the default widget when Enter is pressed.
1128 pub fn activates_default(self, activates_default: bool) -> Self {
1129 Self {
1130 builder: self
1131 .builder
1132 .property("activates-default", activates_default),
1133 }
1134 }
1135
1136 /// A list of Pango attributes to apply to the text of the entry.
1137 ///
1138 /// This is mainly useful to change the size or weight of the text.
1139 ///
1140 /// The `PangoAttribute`'s @start_index and @end_index must refer to the
1141 /// [`EntryBuffer`][crate::EntryBuffer] text, i.e. without the preedit string.
1142 pub fn attributes(self, attributes: &pango::AttrList) -> Self {
1143 Self {
1144 builder: self.builder.property("attributes", attributes.clone()),
1145 }
1146 }
1147
1148 /// The buffer object which actually stores the text.
1149 pub fn buffer(self, buffer: &impl IsA<EntryBuffer>) -> Self {
1150 Self {
1151 builder: self.builder.property("buffer", buffer.clone().upcast()),
1152 }
1153 }
1154
1155 /// The auxiliary completion object to use with the entry.
1156 /// GtkEntryCompletion will be removed in GTK 5.
1157 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1158 pub fn completion(self, completion: &EntryCompletion) -> Self {
1159 Self {
1160 builder: self.builder.property("completion", completion.clone()),
1161 }
1162 }
1163
1164 /// Whether to suggest Emoji replacements for :-delimited names
1165 /// like `:heart:`.
1166 pub fn enable_emoji_completion(self, enable_emoji_completion: bool) -> Self {
1167 Self {
1168 builder: self
1169 .builder
1170 .property("enable-emoji-completion", enable_emoji_completion),
1171 }
1172 }
1173
1174 /// A menu model whose contents will be appended to the context menu.
1175 pub fn extra_menu(self, extra_menu: &impl IsA<gio::MenuModel>) -> Self {
1176 Self {
1177 builder: self
1178 .builder
1179 .property("extra-menu", extra_menu.clone().upcast()),
1180 }
1181 }
1182
1183 /// Whether the entry should draw a frame.
1184 pub fn has_frame(self, has_frame: bool) -> Self {
1185 Self {
1186 builder: self.builder.property("has-frame", has_frame),
1187 }
1188 }
1189
1190 /// Which IM (input method) module should be used for this entry.
1191 ///
1192 /// See [`IMContext`][crate::IMContext].
1193 ///
1194 /// Setting this to a non-[`None`] value overrides the system-wide IM
1195 /// module setting. See the GtkSettings [`gtk-im-module`][struct@crate::Settings#gtk-im-module]
1196 /// property.
1197 pub fn im_module(self, im_module: impl Into<glib::GString>) -> Self {
1198 Self {
1199 builder: self.builder.property("im-module", im_module.into()),
1200 }
1201 }
1202
1203 /// Additional hints that allow input methods to fine-tune their behavior.
1204 ///
1205 /// Also see [`input-purpose`][struct@crate::Entry#input-purpose]
1206 pub fn input_hints(self, input_hints: InputHints) -> Self {
1207 Self {
1208 builder: self.builder.property("input-hints", input_hints),
1209 }
1210 }
1211
1212 /// The purpose of this text field.
1213 ///
1214 /// This property can be used by on-screen keyboards and other input
1215 /// methods to adjust their behaviour.
1216 ///
1217 /// Note that setting the purpose to [`InputPurpose::Password`][crate::InputPurpose::Password] or
1218 /// [`InputPurpose::Pin`][crate::InputPurpose::Pin] is independent from setting
1219 /// [`visibility`][struct@crate::Entry#visibility].
1220 pub fn input_purpose(self, input_purpose: InputPurpose) -> Self {
1221 Self {
1222 builder: self.builder.property("input-purpose", input_purpose),
1223 }
1224 }
1225
1226 /// The character to use when masking entry contents (“password mode”).
1227 pub fn invisible_char(self, invisible_char: u32) -> Self {
1228 Self {
1229 builder: self.builder.property("invisible-char", invisible_char),
1230 }
1231 }
1232
1233 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
1234 pub fn invisible_char_set(self, invisible_char_set: bool) -> Self {
1235 Self {
1236 builder: self
1237 .builder
1238 .property("invisible-char-set", invisible_char_set),
1239 }
1240 }
1241
1242 /// Maximum number of characters for this entry.
1243 pub fn max_length(self, max_length: i32) -> Self {
1244 Self {
1245 builder: self.builder.property("max-length", max_length),
1246 }
1247 }
1248
1249 /// Text for an item in the context menu to activate the primary icon action.
1250 ///
1251 /// When the primary icon is activatable and this property has been set, a new entry
1252 /// in the context menu of this GtkEntry will appear with this text. Selecting that
1253 /// menu entry will result in the primary icon being activated, exactly in the same way
1254 /// as it would be activated from a mouse click.
1255 ///
1256 /// This simplifies adding accessibility support to applications using activatable
1257 /// icons. The activatable icons aren't focusable when navigating the interface with
1258 /// the keyboard This is why Gtk recommends to also add those actions in the context
1259 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
1260 /// enabled, calls the same callback than clicking on the icon.
1261 #[cfg(feature = "v4_20")]
1262 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1263 pub fn menu_entry_icon_primary_text(
1264 self,
1265 menu_entry_icon_primary_text: impl Into<glib::GString>,
1266 ) -> Self {
1267 Self {
1268 builder: self.builder.property(
1269 "menu-entry-icon-primary-text",
1270 menu_entry_icon_primary_text.into(),
1271 ),
1272 }
1273 }
1274
1275 /// Text for an item in the context menu to activate the secondary icon action.
1276 ///
1277 /// When the primary icon is activatable and this property has been set, a new entry
1278 /// in the context menu of this GtkEntry will appear with this text. Selecting that
1279 /// menu entry will result in the primary icon being activated, exactly in the same way
1280 /// as it would be activated from a mouse click.
1281 ///
1282 /// This simplifies adding accessibility support to applications using activatable
1283 /// icons. The activatable icons aren't focusable when navigating the interface with
1284 /// the keyboard This is why Gtk recommends to also add those actions in the context
1285 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
1286 /// enabled, calls the same callback than clicking on the icon.
1287 #[cfg(feature = "v4_20")]
1288 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1289 pub fn menu_entry_icon_secondary_text(
1290 self,
1291 menu_entry_icon_secondary_text: impl Into<glib::GString>,
1292 ) -> Self {
1293 Self {
1294 builder: self.builder.property(
1295 "menu-entry-icon-secondary-text",
1296 menu_entry_icon_secondary_text.into(),
1297 ),
1298 }
1299 }
1300
1301 /// If text is overwritten when typing in the [`Entry`][crate::Entry].
1302 pub fn overwrite_mode(self, overwrite_mode: bool) -> Self {
1303 Self {
1304 builder: self.builder.property("overwrite-mode", overwrite_mode),
1305 }
1306 }
1307
1308 /// The text that will be displayed in the [`Entry`][crate::Entry] when it is empty
1309 /// and unfocused.
1310 pub fn placeholder_text(self, placeholder_text: impl Into<glib::GString>) -> Self {
1311 Self {
1312 builder: self
1313 .builder
1314 .property("placeholder-text", placeholder_text.into()),
1315 }
1316 }
1317
1318 /// Whether the primary icon is activatable.
1319 ///
1320 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
1321 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
1322 /// activatable icons.
1323 ///
1324 /// Sensitive, but non-activatable icons can be used for purely
1325 /// informational purposes.
1326 pub fn primary_icon_activatable(self, primary_icon_activatable: bool) -> Self {
1327 Self {
1328 builder: self
1329 .builder
1330 .property("primary-icon-activatable", primary_icon_activatable),
1331 }
1332 }
1333
1334 /// The `GIcon` to use for the primary icon for the entry.
1335 pub fn primary_icon_gicon(self, primary_icon_gicon: &impl IsA<gio::Icon>) -> Self {
1336 Self {
1337 builder: self
1338 .builder
1339 .property("primary-icon-gicon", primary_icon_gicon.clone().upcast()),
1340 }
1341 }
1342
1343 /// The icon name to use for the primary icon for the entry.
1344 pub fn primary_icon_name(self, primary_icon_name: impl Into<glib::GString>) -> Self {
1345 Self {
1346 builder: self
1347 .builder
1348 .property("primary-icon-name", primary_icon_name.into()),
1349 }
1350 }
1351
1352 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the primary icon for the entry.
1353 pub fn primary_icon_paintable(self, primary_icon_paintable: &impl IsA<gdk::Paintable>) -> Self {
1354 Self {
1355 builder: self.builder.property(
1356 "primary-icon-paintable",
1357 primary_icon_paintable.clone().upcast(),
1358 ),
1359 }
1360 }
1361
1362 /// Whether the primary icon is sensitive.
1363 ///
1364 /// An insensitive icon appears grayed out. GTK does not emit the
1365 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
1366 /// signals and does not allow DND from insensitive icons.
1367 ///
1368 /// An icon should be set insensitive if the action that would trigger
1369 /// when clicked is currently not available.
1370 pub fn primary_icon_sensitive(self, primary_icon_sensitive: bool) -> Self {
1371 Self {
1372 builder: self
1373 .builder
1374 .property("primary-icon-sensitive", primary_icon_sensitive),
1375 }
1376 }
1377
1378 /// The contents of the tooltip on the primary icon, with markup.
1379 ///
1380 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
1381 pub fn primary_icon_tooltip_markup(
1382 self,
1383 primary_icon_tooltip_markup: impl Into<glib::GString>,
1384 ) -> Self {
1385 Self {
1386 builder: self.builder.property(
1387 "primary-icon-tooltip-markup",
1388 primary_icon_tooltip_markup.into(),
1389 ),
1390 }
1391 }
1392
1393 /// The contents of the tooltip on the primary icon.
1394 ///
1395 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
1396 pub fn primary_icon_tooltip_text(
1397 self,
1398 primary_icon_tooltip_text: impl Into<glib::GString>,
1399 ) -> Self {
1400 Self {
1401 builder: self.builder.property(
1402 "primary-icon-tooltip-text",
1403 primary_icon_tooltip_text.into(),
1404 ),
1405 }
1406 }
1407
1408 /// The current fraction of the task that's been completed.
1409 pub fn progress_fraction(self, progress_fraction: f64) -> Self {
1410 Self {
1411 builder: self
1412 .builder
1413 .property("progress-fraction", progress_fraction),
1414 }
1415 }
1416
1417 /// The fraction of total entry width to move the progress
1418 /// bouncing block for each pulse.
1419 ///
1420 /// See [`EntryExt::progress_pulse()`][crate::prelude::EntryExt::progress_pulse()].
1421 pub fn progress_pulse_step(self, progress_pulse_step: f64) -> Self {
1422 Self {
1423 builder: self
1424 .builder
1425 .property("progress-pulse-step", progress_pulse_step),
1426 }
1427 }
1428
1429 /// Whether the secondary icon is activatable.
1430 ///
1431 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
1432 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
1433 /// activatable icons.
1434 ///
1435 /// Sensitive, but non-activatable icons can be used for purely
1436 /// informational purposes.
1437 pub fn secondary_icon_activatable(self, secondary_icon_activatable: bool) -> Self {
1438 Self {
1439 builder: self
1440 .builder
1441 .property("secondary-icon-activatable", secondary_icon_activatable),
1442 }
1443 }
1444
1445 /// The `GIcon` to use for the secondary icon for the entry.
1446 pub fn secondary_icon_gicon(self, secondary_icon_gicon: &impl IsA<gio::Icon>) -> Self {
1447 Self {
1448 builder: self.builder.property(
1449 "secondary-icon-gicon",
1450 secondary_icon_gicon.clone().upcast(),
1451 ),
1452 }
1453 }
1454
1455 /// The icon name to use for the secondary icon for the entry.
1456 pub fn secondary_icon_name(self, secondary_icon_name: impl Into<glib::GString>) -> Self {
1457 Self {
1458 builder: self
1459 .builder
1460 .property("secondary-icon-name", secondary_icon_name.into()),
1461 }
1462 }
1463
1464 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the secondary icon for the entry.
1465 pub fn secondary_icon_paintable(
1466 self,
1467 secondary_icon_paintable: &impl IsA<gdk::Paintable>,
1468 ) -> Self {
1469 Self {
1470 builder: self.builder.property(
1471 "secondary-icon-paintable",
1472 secondary_icon_paintable.clone().upcast(),
1473 ),
1474 }
1475 }
1476
1477 /// Whether the secondary icon is sensitive.
1478 ///
1479 /// An insensitive icon appears grayed out. GTK does not emit the
1480 /// [`icon-press`][struct@crate::Entry#icon-press][ and [`icon-release`][struct@crate::Entry#icon-release]
1481 /// signals and does not allow DND from insensitive icons.
1482 ///
1483 /// An icon should be set insensitive if the action that would trigger
1484 /// when clicked is currently not available.
1485 pub fn secondary_icon_sensitive(self, secondary_icon_sensitive: bool) -> Self {
1486 Self {
1487 builder: self
1488 .builder
1489 .property("secondary-icon-sensitive", secondary_icon_sensitive),
1490 }
1491 }
1492
1493 /// The contents of the tooltip on the secondary icon, with markup.
1494 ///
1495 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
1496 pub fn secondary_icon_tooltip_markup(
1497 self,
1498 secondary_icon_tooltip_markup: impl Into<glib::GString>,
1499 ) -> Self {
1500 Self {
1501 builder: self.builder.property(
1502 "secondary-icon-tooltip-markup",
1503 secondary_icon_tooltip_markup.into(),
1504 ),
1505 }
1506 }
1507
1508 /// The contents of the tooltip on the secondary icon.
1509 ///
1510 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
1511 pub fn secondary_icon_tooltip_text(
1512 self,
1513 secondary_icon_tooltip_text: impl Into<glib::GString>,
1514 ) -> Self {
1515 Self {
1516 builder: self.builder.property(
1517 "secondary-icon-tooltip-text",
1518 secondary_icon_tooltip_text.into(),
1519 ),
1520 }
1521 }
1522
1523 /// Whether the entry will show an Emoji icon in the secondary icon position
1524 /// to open the Emoji chooser.
1525 pub fn show_emoji_icon(self, show_emoji_icon: bool) -> Self {
1526 Self {
1527 builder: self.builder.property("show-emoji-icon", show_emoji_icon),
1528 }
1529 }
1530
1531 /// A list of tabstops to apply to the text of the entry.
1532 pub fn tabs(self, tabs: &pango::TabArray) -> Self {
1533 Self {
1534 builder: self.builder.property("tabs", tabs),
1535 }
1536 }
1537
1538 /// When [`true`], pasted multi-line text is truncated to the first line.
1539 pub fn truncate_multiline(self, truncate_multiline: bool) -> Self {
1540 Self {
1541 builder: self
1542 .builder
1543 .property("truncate-multiline", truncate_multiline),
1544 }
1545 }
1546
1547 /// Whether the entry should show the “invisible char” instead of the
1548 /// actual text (“password mode”).
1549 pub fn visibility(self, visibility: bool) -> Self {
1550 Self {
1551 builder: self.builder.property("visibility", visibility),
1552 }
1553 }
1554
1555 /// Whether the widget or any of its descendents can accept
1556 /// the input focus.
1557 ///
1558 /// This property is meant to be set by widget implementations,
1559 /// typically in their instance init function.
1560 pub fn can_focus(self, can_focus: bool) -> Self {
1561 Self {
1562 builder: self.builder.property("can-focus", can_focus),
1563 }
1564 }
1565
1566 /// Whether the widget can receive pointer events.
1567 pub fn can_target(self, can_target: bool) -> Self {
1568 Self {
1569 builder: self.builder.property("can-target", can_target),
1570 }
1571 }
1572
1573 /// A list of css classes applied to this widget.
1574 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1575 Self {
1576 builder: self.builder.property("css-classes", css_classes.into()),
1577 }
1578 }
1579
1580 /// The name of this widget in the CSS tree.
1581 ///
1582 /// This property is meant to be set by widget implementations,
1583 /// typically in their instance init function.
1584 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1585 Self {
1586 builder: self.builder.property("css-name", css_name.into()),
1587 }
1588 }
1589
1590 /// The cursor used by @widget.
1591 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1592 Self {
1593 builder: self.builder.property("cursor", cursor.clone()),
1594 }
1595 }
1596
1597 /// Whether the widget should grab focus when it is clicked with the mouse.
1598 ///
1599 /// This property is only relevant for widgets that can take focus.
1600 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1601 Self {
1602 builder: self.builder.property("focus-on-click", focus_on_click),
1603 }
1604 }
1605
1606 /// Whether this widget itself will accept the input focus.
1607 pub fn focusable(self, focusable: bool) -> Self {
1608 Self {
1609 builder: self.builder.property("focusable", focusable),
1610 }
1611 }
1612
1613 /// How to distribute horizontal space if widget gets extra space.
1614 pub fn halign(self, halign: Align) -> Self {
1615 Self {
1616 builder: self.builder.property("halign", halign),
1617 }
1618 }
1619
1620 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
1621 /// signal on @widget.
1622 ///
1623 /// A true value indicates that @widget can have a tooltip, in this case
1624 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
1625 /// determine whether it will provide a tooltip or not.
1626 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1627 Self {
1628 builder: self.builder.property("has-tooltip", has_tooltip),
1629 }
1630 }
1631
1632 /// Overrides for height request of the widget.
1633 ///
1634 /// If this is -1, the natural request will be used.
1635 pub fn height_request(self, height_request: i32) -> Self {
1636 Self {
1637 builder: self.builder.property("height-request", height_request),
1638 }
1639 }
1640
1641 /// Whether to expand horizontally.
1642 pub fn hexpand(self, hexpand: bool) -> Self {
1643 Self {
1644 builder: self.builder.property("hexpand", hexpand),
1645 }
1646 }
1647
1648 /// Whether to use the `hexpand` property.
1649 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1650 Self {
1651 builder: self.builder.property("hexpand-set", hexpand_set),
1652 }
1653 }
1654
1655 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
1656 /// the preferred size of the widget, and allocate its children.
1657 ///
1658 /// This property is meant to be set by widget implementations,
1659 /// typically in their instance init function.
1660 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1661 Self {
1662 builder: self
1663 .builder
1664 .property("layout-manager", layout_manager.clone().upcast()),
1665 }
1666 }
1667
1668 /// Makes this widget act like a modal dialog, with respect to
1669 /// event delivery.
1670 ///
1671 /// Global event controllers will not handle events with targets
1672 /// inside the widget, unless they are set up to ignore propagation
1673 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
1674 #[cfg(feature = "v4_18")]
1675 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1676 pub fn limit_events(self, limit_events: bool) -> Self {
1677 Self {
1678 builder: self.builder.property("limit-events", limit_events),
1679 }
1680 }
1681
1682 /// Margin on bottom side of widget.
1683 ///
1684 /// This property adds margin outside of the widget's normal size
1685 /// request, the margin will be added in addition to the size from
1686 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1687 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1688 Self {
1689 builder: self.builder.property("margin-bottom", margin_bottom),
1690 }
1691 }
1692
1693 /// Margin on end of widget, horizontally.
1694 ///
1695 /// This property supports left-to-right and right-to-left text
1696 /// directions.
1697 ///
1698 /// This property adds margin outside of the widget's normal size
1699 /// request, the margin will be added in addition to the size from
1700 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1701 pub fn margin_end(self, margin_end: i32) -> Self {
1702 Self {
1703 builder: self.builder.property("margin-end", margin_end),
1704 }
1705 }
1706
1707 /// Margin on start of widget, horizontally.
1708 ///
1709 /// This property supports left-to-right and right-to-left text
1710 /// directions.
1711 ///
1712 /// This property adds margin outside of the widget's normal size
1713 /// request, the margin will be added in addition to the size from
1714 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1715 pub fn margin_start(self, margin_start: i32) -> Self {
1716 Self {
1717 builder: self.builder.property("margin-start", margin_start),
1718 }
1719 }
1720
1721 /// Margin on top side of widget.
1722 ///
1723 /// This property adds margin outside of the widget's normal size
1724 /// request, the margin will be added in addition to the size from
1725 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1726 pub fn margin_top(self, margin_top: i32) -> Self {
1727 Self {
1728 builder: self.builder.property("margin-top", margin_top),
1729 }
1730 }
1731
1732 /// The name of the widget.
1733 pub fn name(self, name: impl Into<glib::GString>) -> Self {
1734 Self {
1735 builder: self.builder.property("name", name.into()),
1736 }
1737 }
1738
1739 /// The requested opacity of the widget.
1740 pub fn opacity(self, opacity: f64) -> Self {
1741 Self {
1742 builder: self.builder.property("opacity", opacity),
1743 }
1744 }
1745
1746 /// How content outside the widget's content area is treated.
1747 ///
1748 /// This property is meant to be set by widget implementations,
1749 /// typically in their instance init function.
1750 pub fn overflow(self, overflow: Overflow) -> Self {
1751 Self {
1752 builder: self.builder.property("overflow", overflow),
1753 }
1754 }
1755
1756 /// Whether the widget will receive the default action when it is focused.
1757 pub fn receives_default(self, receives_default: bool) -> Self {
1758 Self {
1759 builder: self.builder.property("receives-default", receives_default),
1760 }
1761 }
1762
1763 /// Whether the widget responds to input.
1764 pub fn sensitive(self, sensitive: bool) -> Self {
1765 Self {
1766 builder: self.builder.property("sensitive", sensitive),
1767 }
1768 }
1769
1770 /// Sets the text of tooltip to be the given string, which is marked up
1771 /// with Pango markup.
1772 ///
1773 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1774 ///
1775 /// This is a convenience property which will take care of getting the
1776 /// tooltip shown if the given string is not `NULL`:
1777 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1778 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1779 /// the default signal handler.
1780 ///
1781 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1782 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1783 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1784 Self {
1785 builder: self
1786 .builder
1787 .property("tooltip-markup", tooltip_markup.into()),
1788 }
1789 }
1790
1791 /// Sets the text of tooltip to be the given string.
1792 ///
1793 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1794 ///
1795 /// This is a convenience property which will take care of getting the
1796 /// tooltip shown if the given string is not `NULL`:
1797 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1798 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1799 /// the default signal handler.
1800 ///
1801 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1802 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1803 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1804 Self {
1805 builder: self.builder.property("tooltip-text", tooltip_text.into()),
1806 }
1807 }
1808
1809 /// How to distribute vertical space if widget gets extra space.
1810 pub fn valign(self, valign: Align) -> Self {
1811 Self {
1812 builder: self.builder.property("valign", valign),
1813 }
1814 }
1815
1816 /// Whether to expand vertically.
1817 pub fn vexpand(self, vexpand: bool) -> Self {
1818 Self {
1819 builder: self.builder.property("vexpand", vexpand),
1820 }
1821 }
1822
1823 /// Whether to use the `vexpand` property.
1824 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1825 Self {
1826 builder: self.builder.property("vexpand-set", vexpand_set),
1827 }
1828 }
1829
1830 /// Whether the widget is visible.
1831 pub fn visible(self, visible: bool) -> Self {
1832 Self {
1833 builder: self.builder.property("visible", visible),
1834 }
1835 }
1836
1837 /// Overrides for width request of the widget.
1838 ///
1839 /// If this is -1, the natural request will be used.
1840 pub fn width_request(self, width_request: i32) -> Self {
1841 Self {
1842 builder: self.builder.property("width-request", width_request),
1843 }
1844 }
1845
1846 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
1847 ///
1848 /// The accessible role cannot be changed once set.
1849 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
1850 Self {
1851 builder: self.builder.property("accessible-role", accessible_role),
1852 }
1853 }
1854
1855 /// Indicates whether editing on the cell has been canceled.
1856 pub fn editing_canceled(self, editing_canceled: bool) -> Self {
1857 Self {
1858 builder: self.builder.property("editing-canceled", editing_canceled),
1859 }
1860 }
1861
1862 /// Whether the entry contents can be edited.
1863 pub fn editable(self, editable: bool) -> Self {
1864 Self {
1865 builder: self.builder.property("editable", editable),
1866 }
1867 }
1868
1869 /// If undo/redo should be enabled for the editable.
1870 pub fn enable_undo(self, enable_undo: bool) -> Self {
1871 Self {
1872 builder: self.builder.property("enable-undo", enable_undo),
1873 }
1874 }
1875
1876 /// The desired maximum width of the entry, in characters.
1877 pub fn max_width_chars(self, max_width_chars: i32) -> Self {
1878 Self {
1879 builder: self.builder.property("max-width-chars", max_width_chars),
1880 }
1881 }
1882
1883 /// The contents of the entry.
1884 pub fn text(self, text: impl Into<glib::GString>) -> Self {
1885 Self {
1886 builder: self.builder.property("text", text.into()),
1887 }
1888 }
1889
1890 /// Number of characters to leave space for in the entry.
1891 pub fn width_chars(self, width_chars: i32) -> Self {
1892 Self {
1893 builder: self.builder.property("width-chars", width_chars),
1894 }
1895 }
1896
1897 /// The horizontal alignment, from 0 (left) to 1 (right).
1898 ///
1899 /// Reversed for RTL layouts.
1900 pub fn xalign(self, xalign: f32) -> Self {
1901 Self {
1902 builder: self.builder.property("xalign", xalign),
1903 }
1904 }
1905
1906 // rustdoc-stripper-ignore-next
1907 /// Build the [`Entry`].
1908 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1909 pub fn build(self) -> Entry {
1910 assert_initialized_main_thread!();
1911 self.builder.build()
1912 }
1913}
1914
1915/// Trait containing all [`struct@Entry`] methods.
1916///
1917/// # Implementors
1918///
1919/// [`Entry`][struct@crate::Entry]
1920pub trait EntryExt: IsA<Entry> + 'static {
1921 /// Retrieves the value set by gtk_entry_set_activates_default().
1922 ///
1923 /// # Returns
1924 ///
1925 /// [`true`] if the entry will activate the default widget
1926 #[doc(alias = "gtk_entry_get_activates_default")]
1927 #[doc(alias = "get_activates_default")]
1928 #[doc(alias = "activates-default")]
1929 fn activates_default(&self) -> bool {
1930 unsafe {
1931 from_glib(ffi::gtk_entry_get_activates_default(
1932 self.as_ref().to_glib_none().0,
1933 ))
1934 }
1935 }
1936
1937 /// Gets the value set by gtk_entry_set_alignment().
1938 ///
1939 /// See also: [`xalign`][struct@crate::Editable#xalign]
1940 ///
1941 /// # Returns
1942 ///
1943 /// the alignment
1944 #[doc(alias = "gtk_entry_get_alignment")]
1945 #[doc(alias = "get_alignment")]
1946 fn alignment(&self) -> f32 {
1947 unsafe { ffi::gtk_entry_get_alignment(self.as_ref().to_glib_none().0) }
1948 }
1949
1950 /// Gets the attribute list of the [`Entry`][crate::Entry].
1951 ///
1952 /// See [`set_attributes()`][Self::set_attributes()].
1953 ///
1954 /// # Returns
1955 ///
1956 /// the attribute list
1957 #[doc(alias = "gtk_entry_get_attributes")]
1958 #[doc(alias = "get_attributes")]
1959 fn attributes(&self) -> Option<pango::AttrList> {
1960 unsafe {
1961 from_glib_none(ffi::gtk_entry_get_attributes(
1962 self.as_ref().to_glib_none().0,
1963 ))
1964 }
1965 }
1966
1967 /// Get the [`EntryBuffer`][crate::EntryBuffer] object which holds the text for
1968 /// this widget.
1969 ///
1970 /// # Returns
1971 ///
1972 /// A [`EntryBuffer`][crate::EntryBuffer] object.
1973 #[doc(alias = "gtk_entry_get_buffer")]
1974 #[doc(alias = "get_buffer")]
1975 fn buffer(&self) -> EntryBuffer {
1976 unsafe { from_glib_none(ffi::gtk_entry_get_buffer(self.as_ref().to_glib_none().0)) }
1977 }
1978
1979 /// Returns the auxiliary completion object currently
1980 /// in use by @self.
1981 ///
1982 /// # Deprecated since 4.10
1983 ///
1984 /// GtkEntryCompletion will be removed in GTK 5.
1985 ///
1986 /// # Returns
1987 ///
1988 /// The auxiliary
1989 /// completion object currently in use by @self
1990 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1991 #[allow(deprecated)]
1992 #[doc(alias = "gtk_entry_get_completion")]
1993 #[doc(alias = "get_completion")]
1994 fn completion(&self) -> Option<EntryCompletion> {
1995 unsafe {
1996 from_glib_none(ffi::gtk_entry_get_completion(
1997 self.as_ref().to_glib_none().0,
1998 ))
1999 }
2000 }
2001
2002 /// Returns the index of the icon which is the source of the
2003 /// current DND operation, or -1.
2004 ///
2005 /// # Returns
2006 ///
2007 /// index of the icon which is the source of the
2008 /// current DND operation, or -1.
2009 #[doc(alias = "gtk_entry_get_current_icon_drag_source")]
2010 #[doc(alias = "get_current_icon_drag_source")]
2011 fn current_icon_drag_source(&self) -> i32 {
2012 unsafe { ffi::gtk_entry_get_current_icon_drag_source(self.as_ref().to_glib_none().0) }
2013 }
2014
2015 /// Gets the menu model set with gtk_entry_set_extra_menu().
2016 ///
2017 /// # Returns
2018 ///
2019 /// the menu model
2020 #[doc(alias = "gtk_entry_get_extra_menu")]
2021 #[doc(alias = "get_extra_menu")]
2022 #[doc(alias = "extra-menu")]
2023 fn extra_menu(&self) -> Option<gio::MenuModel> {
2024 unsafe {
2025 from_glib_none(ffi::gtk_entry_get_extra_menu(
2026 self.as_ref().to_glib_none().0,
2027 ))
2028 }
2029 }
2030
2031 /// Gets the value set by gtk_entry_set_has_frame().
2032 ///
2033 /// # Returns
2034 ///
2035 /// whether the entry has a beveled frame
2036 #[doc(alias = "gtk_entry_get_has_frame")]
2037 #[doc(alias = "get_has_frame")]
2038 #[doc(alias = "has-frame")]
2039 fn has_frame(&self) -> bool {
2040 unsafe { from_glib(ffi::gtk_entry_get_has_frame(self.as_ref().to_glib_none().0)) }
2041 }
2042
2043 /// Returns whether the icon is activatable.
2044 /// ## `icon_pos`
2045 /// Icon position
2046 ///
2047 /// # Returns
2048 ///
2049 /// [`true`] if the icon is activatable.
2050 #[doc(alias = "gtk_entry_get_icon_activatable")]
2051 #[doc(alias = "get_icon_activatable")]
2052 fn icon_is_activatable(&self, icon_pos: EntryIconPosition) -> bool {
2053 unsafe {
2054 from_glib(ffi::gtk_entry_get_icon_activatable(
2055 self.as_ref().to_glib_none().0,
2056 icon_pos.into_glib(),
2057 ))
2058 }
2059 }
2060
2061 /// Gets the area where entry’s icon at @icon_pos is drawn.
2062 ///
2063 /// This function is useful when drawing something to the
2064 /// entry in a draw callback.
2065 ///
2066 /// If the entry is not realized or has no icon at the given
2067 /// position, @icon_area is filled with zeros. Otherwise,
2068 /// @icon_area will be filled with the icon's allocation,
2069 /// relative to @self's allocation.
2070 /// ## `icon_pos`
2071 /// Icon position
2072 ///
2073 /// # Returns
2074 ///
2075 ///
2076 /// ## `icon_area`
2077 /// Return location for the icon’s area
2078 #[doc(alias = "gtk_entry_get_icon_area")]
2079 #[doc(alias = "get_icon_area")]
2080 fn icon_area(&self, icon_pos: EntryIconPosition) -> gdk::Rectangle {
2081 unsafe {
2082 let mut icon_area = gdk::Rectangle::uninitialized();
2083 ffi::gtk_entry_get_icon_area(
2084 self.as_ref().to_glib_none().0,
2085 icon_pos.into_glib(),
2086 icon_area.to_glib_none_mut().0,
2087 );
2088 icon_area
2089 }
2090 }
2091
2092 /// Finds the icon at the given position and return its index.
2093 ///
2094 /// The position’s coordinates are relative to the @self’s
2095 /// top left corner. If @x, @y doesn’t lie inside an icon,
2096 /// -1 is returned. This function is intended for use in a
2097 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] signal handler.
2098 /// ## `x`
2099 /// the x coordinate of the position to find, relative to @self
2100 /// ## `y`
2101 /// the y coordinate of the position to find, relative to @self
2102 ///
2103 /// # Returns
2104 ///
2105 /// the index of the icon at the given position, or -1
2106 #[doc(alias = "gtk_entry_get_icon_at_pos")]
2107 #[doc(alias = "get_icon_at_pos")]
2108 fn icon_at_pos(&self, x: i32, y: i32) -> i32 {
2109 unsafe { ffi::gtk_entry_get_icon_at_pos(self.as_ref().to_glib_none().0, x, y) }
2110 }
2111
2112 /// Retrieves the `GIcon` used for the icon.
2113 ///
2114 /// [`None`] will be returned if there is no icon or if the icon was
2115 /// set by some other method (e.g., by [`gdk::Paintable`][crate::gdk::Paintable] or icon name).
2116 /// ## `icon_pos`
2117 /// Icon position
2118 ///
2119 /// # Returns
2120 ///
2121 /// A `GIcon`
2122 #[doc(alias = "gtk_entry_get_icon_gicon")]
2123 #[doc(alias = "get_icon_gicon")]
2124 fn icon_gicon(&self, icon_pos: EntryIconPosition) -> Option<gio::Icon> {
2125 unsafe {
2126 from_glib_none(ffi::gtk_entry_get_icon_gicon(
2127 self.as_ref().to_glib_none().0,
2128 icon_pos.into_glib(),
2129 ))
2130 }
2131 }
2132
2133 /// Retrieves the icon name used for the icon.
2134 ///
2135 /// [`None`] is returned if there is no icon or if the icon was set
2136 /// by some other method (e.g., by [`gdk::Paintable`][crate::gdk::Paintable] or gicon).
2137 /// ## `icon_pos`
2138 /// Icon position
2139 ///
2140 /// # Returns
2141 ///
2142 /// An icon name
2143 #[doc(alias = "gtk_entry_get_icon_name")]
2144 #[doc(alias = "get_icon_name")]
2145 fn icon_name(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2146 unsafe {
2147 from_glib_none(ffi::gtk_entry_get_icon_name(
2148 self.as_ref().to_glib_none().0,
2149 icon_pos.into_glib(),
2150 ))
2151 }
2152 }
2153
2154 /// Retrieves the [`gdk::Paintable`][crate::gdk::Paintable] used for the icon.
2155 ///
2156 /// If no [`gdk::Paintable`][crate::gdk::Paintable] was used for the icon, [`None`] is returned.
2157 /// ## `icon_pos`
2158 /// Icon position
2159 ///
2160 /// # Returns
2161 ///
2162 /// A [`gdk::Paintable`][crate::gdk::Paintable]
2163 /// if no icon is set for this position or the icon set is not
2164 /// a [`gdk::Paintable`][crate::gdk::Paintable].
2165 #[doc(alias = "gtk_entry_get_icon_paintable")]
2166 #[doc(alias = "get_icon_paintable")]
2167 fn icon_paintable(&self, icon_pos: EntryIconPosition) -> Option<gdk::Paintable> {
2168 unsafe {
2169 from_glib_none(ffi::gtk_entry_get_icon_paintable(
2170 self.as_ref().to_glib_none().0,
2171 icon_pos.into_glib(),
2172 ))
2173 }
2174 }
2175
2176 /// Returns whether the icon appears sensitive or insensitive.
2177 /// ## `icon_pos`
2178 /// Icon position
2179 ///
2180 /// # Returns
2181 ///
2182 /// [`true`] if the icon is sensitive.
2183 #[doc(alias = "gtk_entry_get_icon_sensitive")]
2184 #[doc(alias = "get_icon_sensitive")]
2185 fn icon_is_sensitive(&self, icon_pos: EntryIconPosition) -> bool {
2186 unsafe {
2187 from_glib(ffi::gtk_entry_get_icon_sensitive(
2188 self.as_ref().to_glib_none().0,
2189 icon_pos.into_glib(),
2190 ))
2191 }
2192 }
2193
2194 /// Gets the type of representation being used by the icon
2195 /// to store image data.
2196 ///
2197 /// If the icon has no image data, the return value will
2198 /// be [`ImageType::Empty`][crate::ImageType::Empty].
2199 /// ## `icon_pos`
2200 /// Icon position
2201 ///
2202 /// # Returns
2203 ///
2204 /// image representation being used
2205 #[doc(alias = "gtk_entry_get_icon_storage_type")]
2206 #[doc(alias = "get_icon_storage_type")]
2207 fn icon_storage_type(&self, icon_pos: EntryIconPosition) -> ImageType {
2208 unsafe {
2209 from_glib(ffi::gtk_entry_get_icon_storage_type(
2210 self.as_ref().to_glib_none().0,
2211 icon_pos.into_glib(),
2212 ))
2213 }
2214 }
2215
2216 /// Gets the contents of the tooltip on the icon at the specified
2217 /// position in @self.
2218 /// ## `icon_pos`
2219 /// the icon position
2220 ///
2221 /// # Returns
2222 ///
2223 /// the tooltip text
2224 #[doc(alias = "gtk_entry_get_icon_tooltip_markup")]
2225 #[doc(alias = "get_icon_tooltip_markup")]
2226 fn icon_tooltip_markup(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2227 unsafe {
2228 from_glib_full(ffi::gtk_entry_get_icon_tooltip_markup(
2229 self.as_ref().to_glib_none().0,
2230 icon_pos.into_glib(),
2231 ))
2232 }
2233 }
2234
2235 /// Gets the contents of the tooltip on the icon at the specified
2236 /// position in @self.
2237 /// ## `icon_pos`
2238 /// the icon position
2239 ///
2240 /// # Returns
2241 ///
2242 /// the tooltip text
2243 #[doc(alias = "gtk_entry_get_icon_tooltip_text")]
2244 #[doc(alias = "get_icon_tooltip_text")]
2245 fn icon_tooltip_text(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2246 unsafe {
2247 from_glib_full(ffi::gtk_entry_get_icon_tooltip_text(
2248 self.as_ref().to_glib_none().0,
2249 icon_pos.into_glib(),
2250 ))
2251 }
2252 }
2253
2254 /// Gets the input hints of this [`Entry`][crate::Entry].
2255 ///
2256 /// # Returns
2257 ///
2258 /// the input hints
2259 #[doc(alias = "gtk_entry_get_input_hints")]
2260 #[doc(alias = "get_input_hints")]
2261 #[doc(alias = "input-hints")]
2262 fn input_hints(&self) -> InputHints {
2263 unsafe {
2264 from_glib(ffi::gtk_entry_get_input_hints(
2265 self.as_ref().to_glib_none().0,
2266 ))
2267 }
2268 }
2269
2270 /// Gets the input purpose of the [`Entry`][crate::Entry].
2271 ///
2272 /// # Returns
2273 ///
2274 /// the input purpose
2275 #[doc(alias = "gtk_entry_get_input_purpose")]
2276 #[doc(alias = "get_input_purpose")]
2277 #[doc(alias = "input-purpose")]
2278 fn input_purpose(&self) -> InputPurpose {
2279 unsafe {
2280 from_glib(ffi::gtk_entry_get_input_purpose(
2281 self.as_ref().to_glib_none().0,
2282 ))
2283 }
2284 }
2285
2286 /// Retrieves the maximum allowed length of the text in @self.
2287 ///
2288 /// See [`set_max_length()`][Self::set_max_length()].
2289 ///
2290 /// # Returns
2291 ///
2292 /// the maximum allowed number of characters
2293 /// in [`Entry`][crate::Entry], or 0 if there is no maximum.
2294 #[doc(alias = "gtk_entry_get_max_length")]
2295 #[doc(alias = "get_max_length")]
2296 #[doc(alias = "max-length")]
2297 fn max_length(&self) -> i32 {
2298 unsafe { ffi::gtk_entry_get_max_length(self.as_ref().to_glib_none().0) }
2299 }
2300
2301 /// Gets the text that will be used in the context menu of the [`Entry`][crate::Entry]
2302 /// when the specified icon is activatable. Selecting this item in the menu
2303 /// results, from all aspects, the same than clicking on the specified icon.
2304 /// This greatly simplifies making accessible applications, because the icons
2305 /// aren't focusable when using keyboard navigation. This is why Gtk recommends
2306 /// to add the same action to the context menu.
2307 /// ## `icon_pos`
2308 /// either @GTK_ENTRY_ICON_PRIMARY or @GTK_ENTRY_ICON_SECONDARY
2309 ///
2310 /// # Returns
2311 ///
2312 /// the text that will be used in the menu item,
2313 /// or NULL if no menu item is desired.
2314 #[cfg(feature = "v4_20")]
2315 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2316 #[doc(alias = "gtk_entry_get_menu_entry_icon_text")]
2317 #[doc(alias = "get_menu_entry_icon_text")]
2318 fn menu_entry_icon_text(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2319 unsafe {
2320 from_glib_none(ffi::gtk_entry_get_menu_entry_icon_text(
2321 self.as_ref().to_glib_none().0,
2322 icon_pos.into_glib(),
2323 ))
2324 }
2325 }
2326
2327 /// Gets whether the [`Entry`][crate::Entry] is in overwrite mode.
2328 ///
2329 /// # Returns
2330 ///
2331 /// whether the text is overwritten when typing.
2332 #[doc(alias = "gtk_entry_get_overwrite_mode")]
2333 #[doc(alias = "get_overwrite_mode")]
2334 #[doc(alias = "overwrite-mode")]
2335 fn is_overwrite_mode(&self) -> bool {
2336 unsafe {
2337 from_glib(ffi::gtk_entry_get_overwrite_mode(
2338 self.as_ref().to_glib_none().0,
2339 ))
2340 }
2341 }
2342
2343 /// Retrieves the text that will be displayed when @self
2344 /// is empty and unfocused
2345 ///
2346 /// # Returns
2347 ///
2348 /// a pointer to the
2349 /// placeholder text as a string. This string points to
2350 /// internally allocated storage in the widget and must
2351 /// not be freed, modified or stored. If no placeholder
2352 /// text has been set, [`None`] will be returned.
2353 #[doc(alias = "gtk_entry_get_placeholder_text")]
2354 #[doc(alias = "get_placeholder_text")]
2355 #[doc(alias = "placeholder-text")]
2356 fn placeholder_text(&self) -> Option<glib::GString> {
2357 unsafe {
2358 from_glib_none(ffi::gtk_entry_get_placeholder_text(
2359 self.as_ref().to_glib_none().0,
2360 ))
2361 }
2362 }
2363
2364 /// Returns the current fraction of the task that’s been completed.
2365 ///
2366 /// See [`set_progress_fraction()`][Self::set_progress_fraction()].
2367 ///
2368 /// # Returns
2369 ///
2370 /// a fraction from 0.0 to 1.0
2371 #[doc(alias = "gtk_entry_get_progress_fraction")]
2372 #[doc(alias = "get_progress_fraction")]
2373 #[doc(alias = "progress-fraction")]
2374 fn progress_fraction(&self) -> f64 {
2375 unsafe { ffi::gtk_entry_get_progress_fraction(self.as_ref().to_glib_none().0) }
2376 }
2377
2378 /// Retrieves the pulse step set with
2379 /// gtk_entry_set_progress_pulse_step().
2380 ///
2381 /// # Returns
2382 ///
2383 /// a fraction from 0.0 to 1.0
2384 #[doc(alias = "gtk_entry_get_progress_pulse_step")]
2385 #[doc(alias = "get_progress_pulse_step")]
2386 #[doc(alias = "progress-pulse-step")]
2387 fn progress_pulse_step(&self) -> f64 {
2388 unsafe { ffi::gtk_entry_get_progress_pulse_step(self.as_ref().to_glib_none().0) }
2389 }
2390
2391 /// Gets the tabstops of the [`Entry`][crate::Entry].
2392 ///
2393 /// See [`set_tabs()`][Self::set_tabs()].
2394 ///
2395 /// # Returns
2396 ///
2397 /// the tabstops
2398 #[doc(alias = "gtk_entry_get_tabs")]
2399 #[doc(alias = "get_tabs")]
2400 fn tabs(&self) -> Option<pango::TabArray> {
2401 unsafe { from_glib_none(ffi::gtk_entry_get_tabs(self.as_ref().to_glib_none().0)) }
2402 }
2403
2404 /// Retrieves the current length of the text in @self.
2405 ///
2406 /// This is equivalent to getting @self's [`EntryBuffer`][crate::EntryBuffer]
2407 /// and calling [`EntryBufferExtManual::length()`][crate::prelude::EntryBufferExtManual::length()] on it.
2408 ///
2409 /// # Returns
2410 ///
2411 /// the current number of characters
2412 /// in [`Entry`][crate::Entry], or 0 if there are none.
2413 #[doc(alias = "gtk_entry_get_text_length")]
2414 #[doc(alias = "get_text_length")]
2415 #[doc(alias = "text-length")]
2416 fn text_length(&self) -> u16 {
2417 unsafe { ffi::gtk_entry_get_text_length(self.as_ref().to_glib_none().0) }
2418 }
2419
2420 /// Retrieves whether the text in @self is visible.
2421 ///
2422 /// See [`set_visibility()`][Self::set_visibility()].
2423 ///
2424 /// # Returns
2425 ///
2426 /// [`true`] if the text is currently visible
2427 #[doc(alias = "gtk_entry_get_visibility")]
2428 #[doc(alias = "get_visibility")]
2429 #[doc(alias = "visibility")]
2430 fn is_visible(&self) -> bool {
2431 unsafe {
2432 from_glib(ffi::gtk_entry_get_visibility(
2433 self.as_ref().to_glib_none().0,
2434 ))
2435 }
2436 }
2437
2438 /// Causes @self to have keyboard focus.
2439 ///
2440 /// It behaves like [`WidgetExt::grab_focus()`][crate::prelude::WidgetExt::grab_focus()], except that it doesn't
2441 /// select the contents of the entry. You only want to call this on some
2442 /// special entries which the user usually doesn't want to replace all text
2443 /// in, such as search-as-you-type entries.
2444 ///
2445 /// # Returns
2446 ///
2447 /// [`true`] if focus is now inside @self_
2448 #[doc(alias = "gtk_entry_grab_focus_without_selecting")]
2449 fn grab_focus_without_selecting(&self) -> bool {
2450 unsafe {
2451 from_glib(ffi::gtk_entry_grab_focus_without_selecting(
2452 self.as_ref().to_glib_none().0,
2453 ))
2454 }
2455 }
2456
2457 /// Indicates that some progress is made, but you don’t
2458 /// know how much.
2459 ///
2460 /// Causes the entry’s progress indicator to enter “activity
2461 /// mode”, where a block bounces back and forth. Each call to
2462 /// gtk_entry_progress_pulse() causes the block to move by a
2463 /// little bit (the amount of movement per pulse is determined
2464 /// by [`set_progress_pulse_step()`][Self::set_progress_pulse_step()]).
2465 #[doc(alias = "gtk_entry_progress_pulse")]
2466 fn progress_pulse(&self) {
2467 unsafe {
2468 ffi::gtk_entry_progress_pulse(self.as_ref().to_glib_none().0);
2469 }
2470 }
2471
2472 /// Reset the input method context of the entry if needed.
2473 ///
2474 /// This can be necessary in the case where modifying the buffer
2475 /// would confuse on-going input method behavior.
2476 #[doc(alias = "gtk_entry_reset_im_context")]
2477 fn reset_im_context(&self) {
2478 unsafe {
2479 ffi::gtk_entry_reset_im_context(self.as_ref().to_glib_none().0);
2480 }
2481 }
2482
2483 /// Sets whether pressing Enter in the @self will activate the default
2484 /// widget for the window containing the entry.
2485 ///
2486 /// This usually means that the dialog containing the entry will be closed,
2487 /// since the default widget is usually one of the dialog buttons.
2488 /// ## `setting`
2489 /// [`true`] to activate window’s default widget on Enter keypress
2490 #[doc(alias = "gtk_entry_set_activates_default")]
2491 #[doc(alias = "activates-default")]
2492 fn set_activates_default(&self, setting: bool) {
2493 unsafe {
2494 ffi::gtk_entry_set_activates_default(
2495 self.as_ref().to_glib_none().0,
2496 setting.into_glib(),
2497 );
2498 }
2499 }
2500
2501 /// Sets the alignment for the contents of the entry.
2502 ///
2503 /// This controls the horizontal positioning of the contents when
2504 /// the displayed text is shorter than the width of the entry.
2505 ///
2506 /// See also: [`xalign`][struct@crate::Editable#xalign]
2507 /// ## `xalign`
2508 /// The horizontal alignment, from 0 (left) to 1 (right).
2509 /// Reversed for RTL layouts
2510 #[doc(alias = "gtk_entry_set_alignment")]
2511 fn set_alignment(&self, xalign: f32) {
2512 unsafe {
2513 ffi::gtk_entry_set_alignment(self.as_ref().to_glib_none().0, xalign);
2514 }
2515 }
2516
2517 /// Sets a [`pango::AttrList`][crate::pango::AttrList].
2518 ///
2519 /// The attributes in the list are applied to the entry text.
2520 ///
2521 /// Since the attributes will be applied to text that changes
2522 /// as the user types, it makes most sense to use attributes
2523 /// with unlimited extent.
2524 /// ## `attrs`
2525 /// a [`pango::AttrList`][crate::pango::AttrList]
2526 #[doc(alias = "gtk_entry_set_attributes")]
2527 #[doc(alias = "attributes")]
2528 fn set_attributes(&self, attrs: &pango::AttrList) {
2529 unsafe {
2530 ffi::gtk_entry_set_attributes(self.as_ref().to_glib_none().0, attrs.to_glib_none().0);
2531 }
2532 }
2533
2534 /// Set the [`EntryBuffer`][crate::EntryBuffer] object which holds the text for
2535 /// this widget.
2536 /// ## `buffer`
2537 /// a [`EntryBuffer`][crate::EntryBuffer]
2538 #[doc(alias = "gtk_entry_set_buffer")]
2539 #[doc(alias = "buffer")]
2540 fn set_buffer(&self, buffer: &impl IsA<EntryBuffer>) {
2541 unsafe {
2542 ffi::gtk_entry_set_buffer(
2543 self.as_ref().to_glib_none().0,
2544 buffer.as_ref().to_glib_none().0,
2545 );
2546 }
2547 }
2548
2549 /// Sets @completion to be the auxiliary completion object
2550 /// to use with @self.
2551 ///
2552 /// All further configuration of the completion mechanism is
2553 /// done on @completion using the [`EntryCompletion`][crate::EntryCompletion] API.
2554 /// Completion is disabled if @completion is set to [`None`].
2555 ///
2556 /// # Deprecated since 4.10
2557 ///
2558 /// GtkEntryCompletion will be removed in GTK 5.
2559 /// ## `completion`
2560 /// The [`EntryCompletion`][crate::EntryCompletion]
2561 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2562 #[allow(deprecated)]
2563 #[doc(alias = "gtk_entry_set_completion")]
2564 #[doc(alias = "completion")]
2565 fn set_completion(&self, completion: Option<&EntryCompletion>) {
2566 unsafe {
2567 ffi::gtk_entry_set_completion(
2568 self.as_ref().to_glib_none().0,
2569 completion.to_glib_none().0,
2570 );
2571 }
2572 }
2573
2574 /// Sets a menu model to add when constructing
2575 /// the context menu for @self.
2576 /// ## `model`
2577 /// a `GMenuModel`
2578 #[doc(alias = "gtk_entry_set_extra_menu")]
2579 #[doc(alias = "extra-menu")]
2580 fn set_extra_menu(&self, model: Option<&impl IsA<gio::MenuModel>>) {
2581 unsafe {
2582 ffi::gtk_entry_set_extra_menu(
2583 self.as_ref().to_glib_none().0,
2584 model.map(|p| p.as_ref()).to_glib_none().0,
2585 );
2586 }
2587 }
2588
2589 /// Sets whether the entry has a beveled frame around it.
2590 /// ## `setting`
2591 /// new value
2592 #[doc(alias = "gtk_entry_set_has_frame")]
2593 #[doc(alias = "has-frame")]
2594 fn set_has_frame(&self, setting: bool) {
2595 unsafe {
2596 ffi::gtk_entry_set_has_frame(self.as_ref().to_glib_none().0, setting.into_glib());
2597 }
2598 }
2599
2600 /// Sets whether the icon is activatable.
2601 /// ## `icon_pos`
2602 /// Icon position
2603 /// ## `activatable`
2604 /// [`true`] if the icon should be activatable
2605 #[doc(alias = "gtk_entry_set_icon_activatable")]
2606 fn set_icon_activatable(&self, icon_pos: EntryIconPosition, activatable: bool) {
2607 unsafe {
2608 ffi::gtk_entry_set_icon_activatable(
2609 self.as_ref().to_glib_none().0,
2610 icon_pos.into_glib(),
2611 activatable.into_glib(),
2612 );
2613 }
2614 }
2615
2616 /// Sets up the icon at the given position as drag source.
2617 ///
2618 /// This makes it so that GTK will start a drag
2619 /// operation when the user clicks and drags the icon.
2620 /// ## `icon_pos`
2621 /// icon position
2622 /// ## `provider`
2623 /// a [`gdk::ContentProvider`][crate::gdk::ContentProvider]
2624 /// ## `actions`
2625 /// a bitmask of the allowed drag actions
2626 #[doc(alias = "gtk_entry_set_icon_drag_source")]
2627 fn set_icon_drag_source(
2628 &self,
2629 icon_pos: EntryIconPosition,
2630 provider: &impl IsA<gdk::ContentProvider>,
2631 actions: gdk::DragAction,
2632 ) {
2633 unsafe {
2634 ffi::gtk_entry_set_icon_drag_source(
2635 self.as_ref().to_glib_none().0,
2636 icon_pos.into_glib(),
2637 provider.as_ref().to_glib_none().0,
2638 actions.into_glib(),
2639 );
2640 }
2641 }
2642
2643 /// Sets the icon shown in the entry at the specified position
2644 /// from the current icon theme.
2645 ///
2646 /// If the icon isn’t known, a “broken image” icon will be
2647 /// displayed instead.
2648 ///
2649 /// If @icon is [`None`], no icon will be shown in the
2650 /// specified position.
2651 /// ## `icon_pos`
2652 /// The position at which to set the icon
2653 /// ## `icon`
2654 /// The icon to set
2655 #[doc(alias = "gtk_entry_set_icon_from_gicon")]
2656 fn set_icon_from_gicon(&self, icon_pos: EntryIconPosition, icon: Option<&impl IsA<gio::Icon>>) {
2657 unsafe {
2658 ffi::gtk_entry_set_icon_from_gicon(
2659 self.as_ref().to_glib_none().0,
2660 icon_pos.into_glib(),
2661 icon.map(|p| p.as_ref()).to_glib_none().0,
2662 );
2663 }
2664 }
2665
2666 /// Sets the icon shown in the entry at the specified position
2667 /// from the current icon theme.
2668 ///
2669 /// If the icon name isn’t known, a “broken image” icon will be
2670 /// displayed instead.
2671 ///
2672 /// If @icon_name is [`None`], no icon will be shown in the
2673 /// specified position.
2674 /// ## `icon_pos`
2675 /// The position at which to set the icon
2676 /// ## `icon_name`
2677 /// An icon name
2678 #[doc(alias = "gtk_entry_set_icon_from_icon_name")]
2679 fn set_icon_from_icon_name(&self, icon_pos: EntryIconPosition, icon_name: Option<&str>) {
2680 unsafe {
2681 ffi::gtk_entry_set_icon_from_icon_name(
2682 self.as_ref().to_glib_none().0,
2683 icon_pos.into_glib(),
2684 icon_name.to_glib_none().0,
2685 );
2686 }
2687 }
2688
2689 /// Sets the icon shown in the specified position using a [`gdk::Paintable`][crate::gdk::Paintable].
2690 ///
2691 /// If @paintable is [`None`], no icon will be shown in the specified position.
2692 /// ## `icon_pos`
2693 /// Icon position
2694 /// ## `paintable`
2695 /// A [`gdk::Paintable`][crate::gdk::Paintable]
2696 #[doc(alias = "gtk_entry_set_icon_from_paintable")]
2697 fn set_icon_from_paintable(
2698 &self,
2699 icon_pos: EntryIconPosition,
2700 paintable: Option<&impl IsA<gdk::Paintable>>,
2701 ) {
2702 unsafe {
2703 ffi::gtk_entry_set_icon_from_paintable(
2704 self.as_ref().to_glib_none().0,
2705 icon_pos.into_glib(),
2706 paintable.map(|p| p.as_ref()).to_glib_none().0,
2707 );
2708 }
2709 }
2710
2711 /// Sets the sensitivity for the specified icon.
2712 /// ## `icon_pos`
2713 /// Icon position
2714 /// ## `sensitive`
2715 /// Specifies whether the icon should appear
2716 /// sensitive or insensitive
2717 #[doc(alias = "gtk_entry_set_icon_sensitive")]
2718 fn set_icon_sensitive(&self, icon_pos: EntryIconPosition, sensitive: bool) {
2719 unsafe {
2720 ffi::gtk_entry_set_icon_sensitive(
2721 self.as_ref().to_glib_none().0,
2722 icon_pos.into_glib(),
2723 sensitive.into_glib(),
2724 );
2725 }
2726 }
2727
2728 /// Sets @tooltip as the contents of the tooltip for the icon at
2729 /// the specified position.
2730 ///
2731 /// @tooltip is assumed to be marked up with Pango Markup.
2732 ///
2733 /// Use [`None`] for @tooltip to remove an existing tooltip.
2734 ///
2735 /// See also [`WidgetExt::set_tooltip_markup()`][crate::prelude::WidgetExt::set_tooltip_markup()] and
2736 /// [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
2737 /// ## `icon_pos`
2738 /// the icon position
2739 /// ## `tooltip`
2740 /// the contents of the tooltip for the icon
2741 #[doc(alias = "gtk_entry_set_icon_tooltip_markup")]
2742 fn set_icon_tooltip_markup(&self, icon_pos: EntryIconPosition, tooltip: Option<&str>) {
2743 unsafe {
2744 ffi::gtk_entry_set_icon_tooltip_markup(
2745 self.as_ref().to_glib_none().0,
2746 icon_pos.into_glib(),
2747 tooltip.to_glib_none().0,
2748 );
2749 }
2750 }
2751
2752 /// Sets @tooltip as the contents of the tooltip for the icon
2753 /// at the specified position.
2754 ///
2755 /// Use [`None`] for @tooltip to remove an existing tooltip.
2756 ///
2757 /// See also [`WidgetExt::set_tooltip_text()`][crate::prelude::WidgetExt::set_tooltip_text()] and
2758 /// [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
2759 ///
2760 /// If you unset the widget tooltip via
2761 /// [`WidgetExt::set_tooltip_text()`][crate::prelude::WidgetExt::set_tooltip_text()] or
2762 /// [`WidgetExt::set_tooltip_markup()`][crate::prelude::WidgetExt::set_tooltip_markup()], this sets
2763 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] to [`false`], which suppresses
2764 /// icon tooltips too. You can resolve this by then calling
2765 /// [`WidgetExt::set_has_tooltip()`][crate::prelude::WidgetExt::set_has_tooltip()] to set
2766 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] back to [`true`], or
2767 /// setting at least one non-empty tooltip on any icon
2768 /// achieves the same result.
2769 /// ## `icon_pos`
2770 /// the icon position
2771 /// ## `tooltip`
2772 /// the contents of the tooltip for the icon
2773 #[doc(alias = "gtk_entry_set_icon_tooltip_text")]
2774 fn set_icon_tooltip_text(&self, icon_pos: EntryIconPosition, tooltip: Option<&str>) {
2775 unsafe {
2776 ffi::gtk_entry_set_icon_tooltip_text(
2777 self.as_ref().to_glib_none().0,
2778 icon_pos.into_glib(),
2779 tooltip.to_glib_none().0,
2780 );
2781 }
2782 }
2783
2784 /// Set additional hints which allow input methods to
2785 /// fine-tune their behavior.
2786 /// ## `hints`
2787 /// the hints
2788 #[doc(alias = "gtk_entry_set_input_hints")]
2789 #[doc(alias = "input-hints")]
2790 fn set_input_hints(&self, hints: InputHints) {
2791 unsafe {
2792 ffi::gtk_entry_set_input_hints(self.as_ref().to_glib_none().0, hints.into_glib());
2793 }
2794 }
2795
2796 /// Sets the input purpose which can be used by input methods
2797 /// to adjust their behavior.
2798 /// ## `purpose`
2799 /// the purpose
2800 #[doc(alias = "gtk_entry_set_input_purpose")]
2801 #[doc(alias = "input-purpose")]
2802 fn set_input_purpose(&self, purpose: InputPurpose) {
2803 unsafe {
2804 ffi::gtk_entry_set_input_purpose(self.as_ref().to_glib_none().0, purpose.into_glib());
2805 }
2806 }
2807
2808 /// Sets the character to use in place of the actual text
2809 /// in “password mode”.
2810 ///
2811 /// See [`set_visibility()`][Self::set_visibility()] for how to enable
2812 /// “password mode”.
2813 ///
2814 /// By default, GTK picks the best invisible char available in
2815 /// the current font. If you set the invisible char to 0, then
2816 /// the user will get no feedback at all; there will be no text
2817 /// on the screen as they type.
2818 /// ## `ch`
2819 /// a Unicode character
2820 #[doc(alias = "gtk_entry_set_invisible_char")]
2821 #[doc(alias = "invisible-char")]
2822 fn set_invisible_char(&self, ch: Option<char>) {
2823 unsafe {
2824 ffi::gtk_entry_set_invisible_char(self.as_ref().to_glib_none().0, ch.into_glib());
2825 }
2826 }
2827
2828 /// Sets the maximum allowed length of the contents of the widget.
2829 ///
2830 /// If the current contents are longer than the given length, then
2831 /// they will be truncated to fit. The length is in characters.
2832 ///
2833 /// This is equivalent to getting @self's [`EntryBuffer`][crate::EntryBuffer] and
2834 /// calling [`EntryBufferExtManual::set_max_length()`][crate::prelude::EntryBufferExtManual::set_max_length()] on it.
2835 /// ## `max`
2836 /// the maximum length of the entry, or 0 for no maximum.
2837 /// (other than the maximum length of entries.) The value passed in will
2838 /// be clamped to the range 0-65536.
2839 #[doc(alias = "gtk_entry_set_max_length")]
2840 #[doc(alias = "max-length")]
2841 fn set_max_length(&self, max: i32) {
2842 unsafe {
2843 ffi::gtk_entry_set_max_length(self.as_ref().to_glib_none().0, max);
2844 }
2845 }
2846
2847 /// Sets the text that will be used in the context menu of the [`Entry`][crate::Entry]
2848 /// when the specified icon is activatable. Selecting this item in the menu
2849 /// results, from all aspects, the same than clicking on the specified icon.
2850 /// This greatly simplifies making accessible applications, because the icons
2851 /// aren't focusable when using keyboard navigation. This is why Gtk recommends
2852 /// to add the same action to the context menu.
2853 /// ## `icon_pos`
2854 /// either @GTK_ENTRY_ICON_PRIMARY or @GTK_ENTRY_ICON_SECONDARY
2855 /// ## `text`
2856 /// the text used for the menu item in the context menu, or NULL to not add a menu item.
2857 #[cfg(feature = "v4_20")]
2858 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2859 #[doc(alias = "gtk_entry_set_menu_entry_icon_text")]
2860 fn set_menu_entry_icon_text(&self, icon_pos: EntryIconPosition, text: &str) {
2861 unsafe {
2862 ffi::gtk_entry_set_menu_entry_icon_text(
2863 self.as_ref().to_glib_none().0,
2864 icon_pos.into_glib(),
2865 text.to_glib_none().0,
2866 );
2867 }
2868 }
2869
2870 /// Sets whether the text is overwritten when typing in the [`Entry`][crate::Entry].
2871 /// ## `overwrite`
2872 /// new value
2873 #[doc(alias = "gtk_entry_set_overwrite_mode")]
2874 #[doc(alias = "overwrite-mode")]
2875 fn set_overwrite_mode(&self, overwrite: bool) {
2876 unsafe {
2877 ffi::gtk_entry_set_overwrite_mode(
2878 self.as_ref().to_glib_none().0,
2879 overwrite.into_glib(),
2880 );
2881 }
2882 }
2883
2884 /// Sets text to be displayed in @self when it is empty.
2885 ///
2886 /// This can be used to give a visual hint of the expected
2887 /// contents of the [`Entry`][crate::Entry].
2888 /// ## `text`
2889 /// a string to be displayed when @self is empty and unfocused
2890 #[doc(alias = "gtk_entry_set_placeholder_text")]
2891 #[doc(alias = "placeholder-text")]
2892 fn set_placeholder_text(&self, text: Option<&str>) {
2893 unsafe {
2894 ffi::gtk_entry_set_placeholder_text(
2895 self.as_ref().to_glib_none().0,
2896 text.to_glib_none().0,
2897 );
2898 }
2899 }
2900
2901 /// Causes the entry’s progress indicator to “fill in” the given
2902 /// fraction of the bar.
2903 ///
2904 /// The fraction should be between 0.0 and 1.0, inclusive.
2905 /// ## `fraction`
2906 /// fraction of the task that’s been completed
2907 #[doc(alias = "gtk_entry_set_progress_fraction")]
2908 #[doc(alias = "progress-fraction")]
2909 fn set_progress_fraction(&self, fraction: f64) {
2910 unsafe {
2911 ffi::gtk_entry_set_progress_fraction(self.as_ref().to_glib_none().0, fraction);
2912 }
2913 }
2914
2915 /// Sets the fraction of total entry width to move the progress
2916 /// bouncing block for each pulse.
2917 ///
2918 /// Use [`progress_pulse()`][Self::progress_pulse()] to pulse
2919 /// the progress.
2920 /// ## `fraction`
2921 /// fraction between 0.0 and 1.0
2922 #[doc(alias = "gtk_entry_set_progress_pulse_step")]
2923 #[doc(alias = "progress-pulse-step")]
2924 fn set_progress_pulse_step(&self, fraction: f64) {
2925 unsafe {
2926 ffi::gtk_entry_set_progress_pulse_step(self.as_ref().to_glib_none().0, fraction);
2927 }
2928 }
2929
2930 /// Sets a [`pango::TabArray`][crate::pango::TabArray].
2931 ///
2932 /// The tabstops in the array are applied to the entry text.
2933 /// ## `tabs`
2934 /// a [`pango::TabArray`][crate::pango::TabArray]
2935 #[doc(alias = "gtk_entry_set_tabs")]
2936 #[doc(alias = "tabs")]
2937 fn set_tabs(&self, tabs: Option<&pango::TabArray>) {
2938 unsafe {
2939 ffi::gtk_entry_set_tabs(
2940 self.as_ref().to_glib_none().0,
2941 mut_override(tabs.to_glib_none().0),
2942 );
2943 }
2944 }
2945
2946 /// Sets whether the contents of the entry are visible or not.
2947 ///
2948 /// When visibility is set to [`false`], characters are displayed
2949 /// as the invisible char, and will also appear that way when
2950 /// the text in the entry widget is copied elsewhere.
2951 ///
2952 /// By default, GTK picks the best invisible character available
2953 /// in the current font, but it can be changed with
2954 /// [`set_invisible_char()`][Self::set_invisible_char()].
2955 ///
2956 /// Note that you probably want to set [`input-purpose`][struct@crate::Entry#input-purpose]
2957 /// to [`InputPurpose::Password`][crate::InputPurpose::Password] or [`InputPurpose::Pin`][crate::InputPurpose::Pin] to
2958 /// inform input methods about the purpose of this entry,
2959 /// in addition to setting visibility to [`false`].
2960 /// ## `visible`
2961 /// [`true`] if the contents of the entry are displayed as plaintext
2962 #[doc(alias = "gtk_entry_set_visibility")]
2963 #[doc(alias = "visibility")]
2964 fn set_visibility(&self, visible: bool) {
2965 unsafe {
2966 ffi::gtk_entry_set_visibility(self.as_ref().to_glib_none().0, visible.into_glib());
2967 }
2968 }
2969
2970 /// Unsets the invisible char, so that the default invisible char
2971 /// is used again. See [`set_invisible_char()`][Self::set_invisible_char()].
2972 #[doc(alias = "gtk_entry_unset_invisible_char")]
2973 fn unset_invisible_char(&self) {
2974 unsafe {
2975 ffi::gtk_entry_unset_invisible_char(self.as_ref().to_glib_none().0);
2976 }
2977 }
2978
2979 /// Whether to suggest Emoji replacements for :-delimited names
2980 /// like `:heart:`.
2981 #[doc(alias = "enable-emoji-completion")]
2982 fn enables_emoji_completion(&self) -> bool {
2983 ObjectExt::property(self.as_ref(), "enable-emoji-completion")
2984 }
2985
2986 /// Whether to suggest Emoji replacements for :-delimited names
2987 /// like `:heart:`.
2988 #[doc(alias = "enable-emoji-completion")]
2989 fn set_enable_emoji_completion(&self, enable_emoji_completion: bool) {
2990 ObjectExt::set_property(
2991 self.as_ref(),
2992 "enable-emoji-completion",
2993 enable_emoji_completion,
2994 )
2995 }
2996
2997 /// Which IM (input method) module should be used for this entry.
2998 ///
2999 /// See [`IMContext`][crate::IMContext].
3000 ///
3001 /// Setting this to a non-[`None`] value overrides the system-wide IM
3002 /// module setting. See the GtkSettings [`gtk-im-module`][struct@crate::Settings#gtk-im-module]
3003 /// property.
3004 #[doc(alias = "im-module")]
3005 fn im_module(&self) -> Option<glib::GString> {
3006 ObjectExt::property(self.as_ref(), "im-module")
3007 }
3008
3009 /// Which IM (input method) module should be used for this entry.
3010 ///
3011 /// See [`IMContext`][crate::IMContext].
3012 ///
3013 /// Setting this to a non-[`None`] value overrides the system-wide IM
3014 /// module setting. See the GtkSettings [`gtk-im-module`][struct@crate::Settings#gtk-im-module]
3015 /// property.
3016 #[doc(alias = "im-module")]
3017 fn set_im_module(&self, im_module: Option<&str>) {
3018 ObjectExt::set_property(self.as_ref(), "im-module", im_module)
3019 }
3020
3021 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
3022 #[doc(alias = "invisible-char-set")]
3023 fn is_invisible_char_set(&self) -> bool {
3024 ObjectExt::property(self.as_ref(), "invisible-char-set")
3025 }
3026
3027 /// Text for an item in the context menu to activate the primary icon action.
3028 ///
3029 /// When the primary icon is activatable and this property has been set, a new entry
3030 /// in the context menu of this GtkEntry will appear with this text. Selecting that
3031 /// menu entry will result in the primary icon being activated, exactly in the same way
3032 /// as it would be activated from a mouse click.
3033 ///
3034 /// This simplifies adding accessibility support to applications using activatable
3035 /// icons. The activatable icons aren't focusable when navigating the interface with
3036 /// the keyboard This is why Gtk recommends to also add those actions in the context
3037 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
3038 /// enabled, calls the same callback than clicking on the icon.
3039 #[cfg(feature = "v4_20")]
3040 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3041 #[doc(alias = "menu-entry-icon-primary-text")]
3042 fn menu_entry_icon_primary_text(&self) -> Option<glib::GString> {
3043 ObjectExt::property(self.as_ref(), "menu-entry-icon-primary-text")
3044 }
3045
3046 /// Text for an item in the context menu to activate the primary icon action.
3047 ///
3048 /// When the primary icon is activatable and this property has been set, a new entry
3049 /// in the context menu of this GtkEntry will appear with this text. Selecting that
3050 /// menu entry will result in the primary icon being activated, exactly in the same way
3051 /// as it would be activated from a mouse click.
3052 ///
3053 /// This simplifies adding accessibility support to applications using activatable
3054 /// icons. The activatable icons aren't focusable when navigating the interface with
3055 /// the keyboard This is why Gtk recommends to also add those actions in the context
3056 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
3057 /// enabled, calls the same callback than clicking on the icon.
3058 #[cfg(feature = "v4_20")]
3059 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3060 #[doc(alias = "menu-entry-icon-primary-text")]
3061 fn set_menu_entry_icon_primary_text(&self, menu_entry_icon_primary_text: Option<&str>) {
3062 ObjectExt::set_property(
3063 self.as_ref(),
3064 "menu-entry-icon-primary-text",
3065 menu_entry_icon_primary_text,
3066 )
3067 }
3068
3069 /// Text for an item in the context menu to activate the secondary icon action.
3070 ///
3071 /// When the primary icon is activatable and this property has been set, a new entry
3072 /// in the context menu of this GtkEntry will appear with this text. Selecting that
3073 /// menu entry will result in the primary icon being activated, exactly in the same way
3074 /// as it would be activated from a mouse click.
3075 ///
3076 /// This simplifies adding accessibility support to applications using activatable
3077 /// icons. The activatable icons aren't focusable when navigating the interface with
3078 /// the keyboard This is why Gtk recommends to also add those actions in the context
3079 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
3080 /// enabled, calls the same callback than clicking on the icon.
3081 #[cfg(feature = "v4_20")]
3082 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3083 #[doc(alias = "menu-entry-icon-secondary-text")]
3084 fn menu_entry_icon_secondary_text(&self) -> Option<glib::GString> {
3085 ObjectExt::property(self.as_ref(), "menu-entry-icon-secondary-text")
3086 }
3087
3088 /// Text for an item in the context menu to activate the secondary icon action.
3089 ///
3090 /// When the primary icon is activatable and this property has been set, a new entry
3091 /// in the context menu of this GtkEntry will appear with this text. Selecting that
3092 /// menu entry will result in the primary icon being activated, exactly in the same way
3093 /// as it would be activated from a mouse click.
3094 ///
3095 /// This simplifies adding accessibility support to applications using activatable
3096 /// icons. The activatable icons aren't focusable when navigating the interface with
3097 /// the keyboard This is why Gtk recommends to also add those actions in the context
3098 /// menu. This set of methods greatly simplifies this, by adding a menu item that, when
3099 /// enabled, calls the same callback than clicking on the icon.
3100 #[cfg(feature = "v4_20")]
3101 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3102 #[doc(alias = "menu-entry-icon-secondary-text")]
3103 fn set_menu_entry_icon_secondary_text(&self, menu_entry_icon_secondary_text: Option<&str>) {
3104 ObjectExt::set_property(
3105 self.as_ref(),
3106 "menu-entry-icon-secondary-text",
3107 menu_entry_icon_secondary_text,
3108 )
3109 }
3110
3111 /// Whether the primary icon is activatable.
3112 ///
3113 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
3114 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
3115 /// activatable icons.
3116 ///
3117 /// Sensitive, but non-activatable icons can be used for purely
3118 /// informational purposes.
3119 #[doc(alias = "primary-icon-activatable")]
3120 fn is_primary_icon_activatable(&self) -> bool {
3121 ObjectExt::property(self.as_ref(), "primary-icon-activatable")
3122 }
3123
3124 /// Whether the primary icon is activatable.
3125 ///
3126 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
3127 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
3128 /// activatable icons.
3129 ///
3130 /// Sensitive, but non-activatable icons can be used for purely
3131 /// informational purposes.
3132 #[doc(alias = "primary-icon-activatable")]
3133 fn set_primary_icon_activatable(&self, primary_icon_activatable: bool) {
3134 ObjectExt::set_property(
3135 self.as_ref(),
3136 "primary-icon-activatable",
3137 primary_icon_activatable,
3138 )
3139 }
3140
3141 /// The `GIcon` to use for the primary icon for the entry.
3142 #[doc(alias = "primary-icon-gicon")]
3143 fn primary_icon_gicon(&self) -> Option<gio::Icon> {
3144 ObjectExt::property(self.as_ref(), "primary-icon-gicon")
3145 }
3146
3147 /// The `GIcon` to use for the primary icon for the entry.
3148 #[doc(alias = "primary-icon-gicon")]
3149 fn set_primary_icon_gicon<P: IsA<gio::Icon>>(&self, primary_icon_gicon: Option<&P>) {
3150 ObjectExt::set_property(self.as_ref(), "primary-icon-gicon", primary_icon_gicon)
3151 }
3152
3153 /// The icon name to use for the primary icon for the entry.
3154 #[doc(alias = "primary-icon-name")]
3155 fn primary_icon_name(&self) -> Option<glib::GString> {
3156 ObjectExt::property(self.as_ref(), "primary-icon-name")
3157 }
3158
3159 /// The icon name to use for the primary icon for the entry.
3160 #[doc(alias = "primary-icon-name")]
3161 fn set_primary_icon_name(&self, primary_icon_name: Option<&str>) {
3162 ObjectExt::set_property(self.as_ref(), "primary-icon-name", primary_icon_name)
3163 }
3164
3165 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the primary icon for the entry.
3166 #[doc(alias = "primary-icon-paintable")]
3167 fn primary_icon_paintable(&self) -> Option<gdk::Paintable> {
3168 ObjectExt::property(self.as_ref(), "primary-icon-paintable")
3169 }
3170
3171 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the primary icon for the entry.
3172 #[doc(alias = "primary-icon-paintable")]
3173 fn set_primary_icon_paintable<P: IsA<gdk::Paintable>>(
3174 &self,
3175 primary_icon_paintable: Option<&P>,
3176 ) {
3177 ObjectExt::set_property(
3178 self.as_ref(),
3179 "primary-icon-paintable",
3180 primary_icon_paintable,
3181 )
3182 }
3183
3184 /// Whether the primary icon is sensitive.
3185 ///
3186 /// An insensitive icon appears grayed out. GTK does not emit the
3187 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
3188 /// signals and does not allow DND from insensitive icons.
3189 ///
3190 /// An icon should be set insensitive if the action that would trigger
3191 /// when clicked is currently not available.
3192 #[doc(alias = "primary-icon-sensitive")]
3193 fn is_primary_icon_sensitive(&self) -> bool {
3194 ObjectExt::property(self.as_ref(), "primary-icon-sensitive")
3195 }
3196
3197 /// Whether the primary icon is sensitive.
3198 ///
3199 /// An insensitive icon appears grayed out. GTK does not emit the
3200 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
3201 /// signals and does not allow DND from insensitive icons.
3202 ///
3203 /// An icon should be set insensitive if the action that would trigger
3204 /// when clicked is currently not available.
3205 #[doc(alias = "primary-icon-sensitive")]
3206 fn set_primary_icon_sensitive(&self, primary_icon_sensitive: bool) {
3207 ObjectExt::set_property(
3208 self.as_ref(),
3209 "primary-icon-sensitive",
3210 primary_icon_sensitive,
3211 )
3212 }
3213
3214 /// The representation which is used for the primary icon of the entry.
3215 #[doc(alias = "primary-icon-storage-type")]
3216 fn primary_icon_storage_type(&self) -> ImageType {
3217 ObjectExt::property(self.as_ref(), "primary-icon-storage-type")
3218 }
3219
3220 /// The contents of the tooltip on the primary icon, with markup.
3221 ///
3222 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3223 #[doc(alias = "primary-icon-tooltip-markup")]
3224 fn primary_icon_tooltip_markup(&self) -> Option<glib::GString> {
3225 ObjectExt::property(self.as_ref(), "primary-icon-tooltip-markup")
3226 }
3227
3228 /// The contents of the tooltip on the primary icon, with markup.
3229 ///
3230 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3231 #[doc(alias = "primary-icon-tooltip-markup")]
3232 fn set_primary_icon_tooltip_markup(&self, primary_icon_tooltip_markup: Option<&str>) {
3233 ObjectExt::set_property(
3234 self.as_ref(),
3235 "primary-icon-tooltip-markup",
3236 primary_icon_tooltip_markup,
3237 )
3238 }
3239
3240 /// The contents of the tooltip on the primary icon.
3241 ///
3242 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3243 #[doc(alias = "primary-icon-tooltip-text")]
3244 fn primary_icon_tooltip_text(&self) -> Option<glib::GString> {
3245 ObjectExt::property(self.as_ref(), "primary-icon-tooltip-text")
3246 }
3247
3248 /// The contents of the tooltip on the primary icon.
3249 ///
3250 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3251 #[doc(alias = "primary-icon-tooltip-text")]
3252 fn set_primary_icon_tooltip_text(&self, primary_icon_tooltip_text: Option<&str>) {
3253 ObjectExt::set_property(
3254 self.as_ref(),
3255 "primary-icon-tooltip-text",
3256 primary_icon_tooltip_text,
3257 )
3258 }
3259
3260 /// Number of pixels of the entry scrolled off the screen to the left.
3261 #[doc(alias = "scroll-offset")]
3262 fn scroll_offset(&self) -> i32 {
3263 ObjectExt::property(self.as_ref(), "scroll-offset")
3264 }
3265
3266 /// Whether the secondary icon is activatable.
3267 ///
3268 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
3269 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
3270 /// activatable icons.
3271 ///
3272 /// Sensitive, but non-activatable icons can be used for purely
3273 /// informational purposes.
3274 #[doc(alias = "secondary-icon-activatable")]
3275 fn is_secondary_icon_activatable(&self) -> bool {
3276 ObjectExt::property(self.as_ref(), "secondary-icon-activatable")
3277 }
3278
3279 /// Whether the secondary icon is activatable.
3280 ///
3281 /// GTK emits the [`icon-press`][struct@crate::Entry#icon-press] and
3282 /// [`icon-release`][struct@crate::Entry#icon-release] signals only on sensitive,
3283 /// activatable icons.
3284 ///
3285 /// Sensitive, but non-activatable icons can be used for purely
3286 /// informational purposes.
3287 #[doc(alias = "secondary-icon-activatable")]
3288 fn set_secondary_icon_activatable(&self, secondary_icon_activatable: bool) {
3289 ObjectExt::set_property(
3290 self.as_ref(),
3291 "secondary-icon-activatable",
3292 secondary_icon_activatable,
3293 )
3294 }
3295
3296 /// The `GIcon` to use for the secondary icon for the entry.
3297 #[doc(alias = "secondary-icon-gicon")]
3298 fn secondary_icon_gicon(&self) -> Option<gio::Icon> {
3299 ObjectExt::property(self.as_ref(), "secondary-icon-gicon")
3300 }
3301
3302 /// The `GIcon` to use for the secondary icon for the entry.
3303 #[doc(alias = "secondary-icon-gicon")]
3304 fn set_secondary_icon_gicon<P: IsA<gio::Icon>>(&self, secondary_icon_gicon: Option<&P>) {
3305 ObjectExt::set_property(self.as_ref(), "secondary-icon-gicon", secondary_icon_gicon)
3306 }
3307
3308 /// The icon name to use for the secondary icon for the entry.
3309 #[doc(alias = "secondary-icon-name")]
3310 fn secondary_icon_name(&self) -> Option<glib::GString> {
3311 ObjectExt::property(self.as_ref(), "secondary-icon-name")
3312 }
3313
3314 /// The icon name to use for the secondary icon for the entry.
3315 #[doc(alias = "secondary-icon-name")]
3316 fn set_secondary_icon_name(&self, secondary_icon_name: Option<&str>) {
3317 ObjectExt::set_property(self.as_ref(), "secondary-icon-name", secondary_icon_name)
3318 }
3319
3320 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the secondary icon for the entry.
3321 #[doc(alias = "secondary-icon-paintable")]
3322 fn secondary_icon_paintable(&self) -> Option<gdk::Paintable> {
3323 ObjectExt::property(self.as_ref(), "secondary-icon-paintable")
3324 }
3325
3326 /// A [`gdk::Paintable`][crate::gdk::Paintable] to use as the secondary icon for the entry.
3327 #[doc(alias = "secondary-icon-paintable")]
3328 fn set_secondary_icon_paintable<P: IsA<gdk::Paintable>>(
3329 &self,
3330 secondary_icon_paintable: Option<&P>,
3331 ) {
3332 ObjectExt::set_property(
3333 self.as_ref(),
3334 "secondary-icon-paintable",
3335 secondary_icon_paintable,
3336 )
3337 }
3338
3339 /// Whether the secondary icon is sensitive.
3340 ///
3341 /// An insensitive icon appears grayed out. GTK does not emit the
3342 /// [`icon-press`][struct@crate::Entry#icon-press][ and [`icon-release`][struct@crate::Entry#icon-release]
3343 /// signals and does not allow DND from insensitive icons.
3344 ///
3345 /// An icon should be set insensitive if the action that would trigger
3346 /// when clicked is currently not available.
3347 #[doc(alias = "secondary-icon-sensitive")]
3348 fn is_secondary_icon_sensitive(&self) -> bool {
3349 ObjectExt::property(self.as_ref(), "secondary-icon-sensitive")
3350 }
3351
3352 /// Whether the secondary icon is sensitive.
3353 ///
3354 /// An insensitive icon appears grayed out. GTK does not emit the
3355 /// [`icon-press`][struct@crate::Entry#icon-press][ and [`icon-release`][struct@crate::Entry#icon-release]
3356 /// signals and does not allow DND from insensitive icons.
3357 ///
3358 /// An icon should be set insensitive if the action that would trigger
3359 /// when clicked is currently not available.
3360 #[doc(alias = "secondary-icon-sensitive")]
3361 fn set_secondary_icon_sensitive(&self, secondary_icon_sensitive: bool) {
3362 ObjectExt::set_property(
3363 self.as_ref(),
3364 "secondary-icon-sensitive",
3365 secondary_icon_sensitive,
3366 )
3367 }
3368
3369 /// The representation which is used for the secondary icon of the entry.
3370 #[doc(alias = "secondary-icon-storage-type")]
3371 fn secondary_icon_storage_type(&self) -> ImageType {
3372 ObjectExt::property(self.as_ref(), "secondary-icon-storage-type")
3373 }
3374
3375 /// The contents of the tooltip on the secondary icon, with markup.
3376 ///
3377 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3378 #[doc(alias = "secondary-icon-tooltip-markup")]
3379 fn secondary_icon_tooltip_markup(&self) -> Option<glib::GString> {
3380 ObjectExt::property(self.as_ref(), "secondary-icon-tooltip-markup")
3381 }
3382
3383 /// The contents of the tooltip on the secondary icon, with markup.
3384 ///
3385 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3386 #[doc(alias = "secondary-icon-tooltip-markup")]
3387 fn set_secondary_icon_tooltip_markup(&self, secondary_icon_tooltip_markup: Option<&str>) {
3388 ObjectExt::set_property(
3389 self.as_ref(),
3390 "secondary-icon-tooltip-markup",
3391 secondary_icon_tooltip_markup,
3392 )
3393 }
3394
3395 /// The contents of the tooltip on the secondary icon.
3396 ///
3397 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3398 #[doc(alias = "secondary-icon-tooltip-text")]
3399 fn secondary_icon_tooltip_text(&self) -> Option<glib::GString> {
3400 ObjectExt::property(self.as_ref(), "secondary-icon-tooltip-text")
3401 }
3402
3403 /// The contents of the tooltip on the secondary icon.
3404 ///
3405 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3406 #[doc(alias = "secondary-icon-tooltip-text")]
3407 fn set_secondary_icon_tooltip_text(&self, secondary_icon_tooltip_text: Option<&str>) {
3408 ObjectExt::set_property(
3409 self.as_ref(),
3410 "secondary-icon-tooltip-text",
3411 secondary_icon_tooltip_text,
3412 )
3413 }
3414
3415 /// Whether the entry will show an Emoji icon in the secondary icon position
3416 /// to open the Emoji chooser.
3417 #[doc(alias = "show-emoji-icon")]
3418 fn shows_emoji_icon(&self) -> bool {
3419 ObjectExt::property(self.as_ref(), "show-emoji-icon")
3420 }
3421
3422 /// Whether the entry will show an Emoji icon in the secondary icon position
3423 /// to open the Emoji chooser.
3424 #[doc(alias = "show-emoji-icon")]
3425 fn set_show_emoji_icon(&self, show_emoji_icon: bool) {
3426 ObjectExt::set_property(self.as_ref(), "show-emoji-icon", show_emoji_icon)
3427 }
3428
3429 /// When [`true`], pasted multi-line text is truncated to the first line.
3430 #[doc(alias = "truncate-multiline")]
3431 fn must_truncate_multiline(&self) -> bool {
3432 ObjectExt::property(self.as_ref(), "truncate-multiline")
3433 }
3434
3435 /// When [`true`], pasted multi-line text is truncated to the first line.
3436 #[doc(alias = "truncate-multiline")]
3437 fn set_truncate_multiline(&self, truncate_multiline: bool) {
3438 ObjectExt::set_property(self.as_ref(), "truncate-multiline", truncate_multiline)
3439 }
3440
3441 /// Emitted when the entry is activated.
3442 ///
3443 /// The keybindings for this signal are all forms of the Enter key.
3444 #[doc(alias = "activate")]
3445 fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3446 unsafe extern "C" fn activate_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3447 this: *mut ffi::GtkEntry,
3448 f: glib::ffi::gpointer,
3449 ) {
3450 unsafe {
3451 let f: &F = &*(f as *const F);
3452 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3453 }
3454 }
3455 unsafe {
3456 let f: Box_<F> = Box_::new(f);
3457 connect_raw(
3458 self.as_ptr() as *mut _,
3459 c"activate".as_ptr(),
3460 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3461 activate_trampoline::<Self, F> as *const (),
3462 )),
3463 Box_::into_raw(f),
3464 )
3465 }
3466 }
3467
3468 fn emit_activate(&self) {
3469 self.emit_by_name::<()>("activate", &[]);
3470 }
3471
3472 /// Emitted when an activatable icon is clicked.
3473 /// ## `icon_pos`
3474 /// The position of the clicked icon
3475 #[doc(alias = "icon-press")]
3476 fn connect_icon_press<F: Fn(&Self, EntryIconPosition) + 'static>(
3477 &self,
3478 f: F,
3479 ) -> SignalHandlerId {
3480 unsafe extern "C" fn icon_press_trampoline<
3481 P: IsA<Entry>,
3482 F: Fn(&P, EntryIconPosition) + 'static,
3483 >(
3484 this: *mut ffi::GtkEntry,
3485 icon_pos: ffi::GtkEntryIconPosition,
3486 f: glib::ffi::gpointer,
3487 ) {
3488 unsafe {
3489 let f: &F = &*(f as *const F);
3490 f(
3491 Entry::from_glib_borrow(this).unsafe_cast_ref(),
3492 from_glib(icon_pos),
3493 )
3494 }
3495 }
3496 unsafe {
3497 let f: Box_<F> = Box_::new(f);
3498 connect_raw(
3499 self.as_ptr() as *mut _,
3500 c"icon-press".as_ptr(),
3501 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3502 icon_press_trampoline::<Self, F> as *const (),
3503 )),
3504 Box_::into_raw(f),
3505 )
3506 }
3507 }
3508
3509 /// Emitted on the button release from a mouse click
3510 /// over an activatable icon.
3511 /// ## `icon_pos`
3512 /// The position of the clicked icon
3513 #[doc(alias = "icon-release")]
3514 fn connect_icon_release<F: Fn(&Self, EntryIconPosition) + 'static>(
3515 &self,
3516 f: F,
3517 ) -> SignalHandlerId {
3518 unsafe extern "C" fn icon_release_trampoline<
3519 P: IsA<Entry>,
3520 F: Fn(&P, EntryIconPosition) + 'static,
3521 >(
3522 this: *mut ffi::GtkEntry,
3523 icon_pos: ffi::GtkEntryIconPosition,
3524 f: glib::ffi::gpointer,
3525 ) {
3526 unsafe {
3527 let f: &F = &*(f as *const F);
3528 f(
3529 Entry::from_glib_borrow(this).unsafe_cast_ref(),
3530 from_glib(icon_pos),
3531 )
3532 }
3533 }
3534 unsafe {
3535 let f: Box_<F> = Box_::new(f);
3536 connect_raw(
3537 self.as_ptr() as *mut _,
3538 c"icon-release".as_ptr(),
3539 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3540 icon_release_trampoline::<Self, F> as *const (),
3541 )),
3542 Box_::into_raw(f),
3543 )
3544 }
3545 }
3546
3547 #[doc(alias = "activates-default")]
3548 fn connect_activates_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3549 unsafe extern "C" fn notify_activates_default_trampoline<
3550 P: IsA<Entry>,
3551 F: Fn(&P) + 'static,
3552 >(
3553 this: *mut ffi::GtkEntry,
3554 _param_spec: glib::ffi::gpointer,
3555 f: glib::ffi::gpointer,
3556 ) {
3557 unsafe {
3558 let f: &F = &*(f as *const F);
3559 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3560 }
3561 }
3562 unsafe {
3563 let f: Box_<F> = Box_::new(f);
3564 connect_raw(
3565 self.as_ptr() as *mut _,
3566 c"notify::activates-default".as_ptr(),
3567 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3568 notify_activates_default_trampoline::<Self, F> as *const (),
3569 )),
3570 Box_::into_raw(f),
3571 )
3572 }
3573 }
3574
3575 #[doc(alias = "attributes")]
3576 fn connect_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3577 unsafe extern "C" fn notify_attributes_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3578 this: *mut ffi::GtkEntry,
3579 _param_spec: glib::ffi::gpointer,
3580 f: glib::ffi::gpointer,
3581 ) {
3582 unsafe {
3583 let f: &F = &*(f as *const F);
3584 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3585 }
3586 }
3587 unsafe {
3588 let f: Box_<F> = Box_::new(f);
3589 connect_raw(
3590 self.as_ptr() as *mut _,
3591 c"notify::attributes".as_ptr(),
3592 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3593 notify_attributes_trampoline::<Self, F> as *const (),
3594 )),
3595 Box_::into_raw(f),
3596 )
3597 }
3598 }
3599
3600 #[doc(alias = "buffer")]
3601 fn connect_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3602 unsafe extern "C" fn notify_buffer_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3603 this: *mut ffi::GtkEntry,
3604 _param_spec: glib::ffi::gpointer,
3605 f: glib::ffi::gpointer,
3606 ) {
3607 unsafe {
3608 let f: &F = &*(f as *const F);
3609 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3610 }
3611 }
3612 unsafe {
3613 let f: Box_<F> = Box_::new(f);
3614 connect_raw(
3615 self.as_ptr() as *mut _,
3616 c"notify::buffer".as_ptr(),
3617 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3618 notify_buffer_trampoline::<Self, F> as *const (),
3619 )),
3620 Box_::into_raw(f),
3621 )
3622 }
3623 }
3624
3625 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3626 #[doc(alias = "completion")]
3627 fn connect_completion_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3628 unsafe extern "C" fn notify_completion_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3629 this: *mut ffi::GtkEntry,
3630 _param_spec: glib::ffi::gpointer,
3631 f: glib::ffi::gpointer,
3632 ) {
3633 unsafe {
3634 let f: &F = &*(f as *const F);
3635 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3636 }
3637 }
3638 unsafe {
3639 let f: Box_<F> = Box_::new(f);
3640 connect_raw(
3641 self.as_ptr() as *mut _,
3642 c"notify::completion".as_ptr(),
3643 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3644 notify_completion_trampoline::<Self, F> as *const (),
3645 )),
3646 Box_::into_raw(f),
3647 )
3648 }
3649 }
3650
3651 #[doc(alias = "enable-emoji-completion")]
3652 fn connect_enable_emoji_completion_notify<F: Fn(&Self) + 'static>(
3653 &self,
3654 f: F,
3655 ) -> SignalHandlerId {
3656 unsafe extern "C" fn notify_enable_emoji_completion_trampoline<
3657 P: IsA<Entry>,
3658 F: Fn(&P) + 'static,
3659 >(
3660 this: *mut ffi::GtkEntry,
3661 _param_spec: glib::ffi::gpointer,
3662 f: glib::ffi::gpointer,
3663 ) {
3664 unsafe {
3665 let f: &F = &*(f as *const F);
3666 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3667 }
3668 }
3669 unsafe {
3670 let f: Box_<F> = Box_::new(f);
3671 connect_raw(
3672 self.as_ptr() as *mut _,
3673 c"notify::enable-emoji-completion".as_ptr(),
3674 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3675 notify_enable_emoji_completion_trampoline::<Self, F> as *const (),
3676 )),
3677 Box_::into_raw(f),
3678 )
3679 }
3680 }
3681
3682 #[doc(alias = "extra-menu")]
3683 fn connect_extra_menu_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3684 unsafe extern "C" fn notify_extra_menu_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3685 this: *mut ffi::GtkEntry,
3686 _param_spec: glib::ffi::gpointer,
3687 f: glib::ffi::gpointer,
3688 ) {
3689 unsafe {
3690 let f: &F = &*(f as *const F);
3691 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3692 }
3693 }
3694 unsafe {
3695 let f: Box_<F> = Box_::new(f);
3696 connect_raw(
3697 self.as_ptr() as *mut _,
3698 c"notify::extra-menu".as_ptr(),
3699 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3700 notify_extra_menu_trampoline::<Self, F> as *const (),
3701 )),
3702 Box_::into_raw(f),
3703 )
3704 }
3705 }
3706
3707 #[doc(alias = "has-frame")]
3708 fn connect_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3709 unsafe extern "C" fn notify_has_frame_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3710 this: *mut ffi::GtkEntry,
3711 _param_spec: glib::ffi::gpointer,
3712 f: glib::ffi::gpointer,
3713 ) {
3714 unsafe {
3715 let f: &F = &*(f as *const F);
3716 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3717 }
3718 }
3719 unsafe {
3720 let f: Box_<F> = Box_::new(f);
3721 connect_raw(
3722 self.as_ptr() as *mut _,
3723 c"notify::has-frame".as_ptr(),
3724 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3725 notify_has_frame_trampoline::<Self, F> as *const (),
3726 )),
3727 Box_::into_raw(f),
3728 )
3729 }
3730 }
3731
3732 #[doc(alias = "im-module")]
3733 fn connect_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3734 unsafe extern "C" fn notify_im_module_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3735 this: *mut ffi::GtkEntry,
3736 _param_spec: glib::ffi::gpointer,
3737 f: glib::ffi::gpointer,
3738 ) {
3739 unsafe {
3740 let f: &F = &*(f as *const F);
3741 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3742 }
3743 }
3744 unsafe {
3745 let f: Box_<F> = Box_::new(f);
3746 connect_raw(
3747 self.as_ptr() as *mut _,
3748 c"notify::im-module".as_ptr(),
3749 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3750 notify_im_module_trampoline::<Self, F> as *const (),
3751 )),
3752 Box_::into_raw(f),
3753 )
3754 }
3755 }
3756
3757 #[doc(alias = "input-hints")]
3758 fn connect_input_hints_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3759 unsafe extern "C" fn notify_input_hints_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3760 this: *mut ffi::GtkEntry,
3761 _param_spec: glib::ffi::gpointer,
3762 f: glib::ffi::gpointer,
3763 ) {
3764 unsafe {
3765 let f: &F = &*(f as *const F);
3766 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3767 }
3768 }
3769 unsafe {
3770 let f: Box_<F> = Box_::new(f);
3771 connect_raw(
3772 self.as_ptr() as *mut _,
3773 c"notify::input-hints".as_ptr(),
3774 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3775 notify_input_hints_trampoline::<Self, F> as *const (),
3776 )),
3777 Box_::into_raw(f),
3778 )
3779 }
3780 }
3781
3782 #[doc(alias = "input-purpose")]
3783 fn connect_input_purpose_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3784 unsafe extern "C" fn notify_input_purpose_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3785 this: *mut ffi::GtkEntry,
3786 _param_spec: glib::ffi::gpointer,
3787 f: glib::ffi::gpointer,
3788 ) {
3789 unsafe {
3790 let f: &F = &*(f as *const F);
3791 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3792 }
3793 }
3794 unsafe {
3795 let f: Box_<F> = Box_::new(f);
3796 connect_raw(
3797 self.as_ptr() as *mut _,
3798 c"notify::input-purpose".as_ptr(),
3799 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3800 notify_input_purpose_trampoline::<Self, F> as *const (),
3801 )),
3802 Box_::into_raw(f),
3803 )
3804 }
3805 }
3806
3807 #[doc(alias = "invisible-char")]
3808 fn connect_invisible_char_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3809 unsafe extern "C" fn notify_invisible_char_trampoline<
3810 P: IsA<Entry>,
3811 F: Fn(&P) + 'static,
3812 >(
3813 this: *mut ffi::GtkEntry,
3814 _param_spec: glib::ffi::gpointer,
3815 f: glib::ffi::gpointer,
3816 ) {
3817 unsafe {
3818 let f: &F = &*(f as *const F);
3819 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3820 }
3821 }
3822 unsafe {
3823 let f: Box_<F> = Box_::new(f);
3824 connect_raw(
3825 self.as_ptr() as *mut _,
3826 c"notify::invisible-char".as_ptr(),
3827 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3828 notify_invisible_char_trampoline::<Self, F> as *const (),
3829 )),
3830 Box_::into_raw(f),
3831 )
3832 }
3833 }
3834
3835 #[doc(alias = "invisible-char-set")]
3836 fn connect_invisible_char_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3837 unsafe extern "C" fn notify_invisible_char_set_trampoline<
3838 P: IsA<Entry>,
3839 F: Fn(&P) + 'static,
3840 >(
3841 this: *mut ffi::GtkEntry,
3842 _param_spec: glib::ffi::gpointer,
3843 f: glib::ffi::gpointer,
3844 ) {
3845 unsafe {
3846 let f: &F = &*(f as *const F);
3847 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3848 }
3849 }
3850 unsafe {
3851 let f: Box_<F> = Box_::new(f);
3852 connect_raw(
3853 self.as_ptr() as *mut _,
3854 c"notify::invisible-char-set".as_ptr(),
3855 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3856 notify_invisible_char_set_trampoline::<Self, F> as *const (),
3857 )),
3858 Box_::into_raw(f),
3859 )
3860 }
3861 }
3862
3863 #[doc(alias = "max-length")]
3864 fn connect_max_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3865 unsafe extern "C" fn notify_max_length_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
3866 this: *mut ffi::GtkEntry,
3867 _param_spec: glib::ffi::gpointer,
3868 f: glib::ffi::gpointer,
3869 ) {
3870 unsafe {
3871 let f: &F = &*(f as *const F);
3872 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3873 }
3874 }
3875 unsafe {
3876 let f: Box_<F> = Box_::new(f);
3877 connect_raw(
3878 self.as_ptr() as *mut _,
3879 c"notify::max-length".as_ptr(),
3880 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3881 notify_max_length_trampoline::<Self, F> as *const (),
3882 )),
3883 Box_::into_raw(f),
3884 )
3885 }
3886 }
3887
3888 #[cfg(feature = "v4_20")]
3889 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3890 #[doc(alias = "menu-entry-icon-primary-text")]
3891 fn connect_menu_entry_icon_primary_text_notify<F: Fn(&Self) + 'static>(
3892 &self,
3893 f: F,
3894 ) -> SignalHandlerId {
3895 unsafe extern "C" fn notify_menu_entry_icon_primary_text_trampoline<
3896 P: IsA<Entry>,
3897 F: Fn(&P) + 'static,
3898 >(
3899 this: *mut ffi::GtkEntry,
3900 _param_spec: glib::ffi::gpointer,
3901 f: glib::ffi::gpointer,
3902 ) {
3903 unsafe {
3904 let f: &F = &*(f as *const F);
3905 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3906 }
3907 }
3908 unsafe {
3909 let f: Box_<F> = Box_::new(f);
3910 connect_raw(
3911 self.as_ptr() as *mut _,
3912 c"notify::menu-entry-icon-primary-text".as_ptr(),
3913 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3914 notify_menu_entry_icon_primary_text_trampoline::<Self, F> as *const (),
3915 )),
3916 Box_::into_raw(f),
3917 )
3918 }
3919 }
3920
3921 #[cfg(feature = "v4_20")]
3922 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3923 #[doc(alias = "menu-entry-icon-secondary-text")]
3924 fn connect_menu_entry_icon_secondary_text_notify<F: Fn(&Self) + 'static>(
3925 &self,
3926 f: F,
3927 ) -> SignalHandlerId {
3928 unsafe extern "C" fn notify_menu_entry_icon_secondary_text_trampoline<
3929 P: IsA<Entry>,
3930 F: Fn(&P) + 'static,
3931 >(
3932 this: *mut ffi::GtkEntry,
3933 _param_spec: glib::ffi::gpointer,
3934 f: glib::ffi::gpointer,
3935 ) {
3936 unsafe {
3937 let f: &F = &*(f as *const F);
3938 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3939 }
3940 }
3941 unsafe {
3942 let f: Box_<F> = Box_::new(f);
3943 connect_raw(
3944 self.as_ptr() as *mut _,
3945 c"notify::menu-entry-icon-secondary-text".as_ptr(),
3946 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3947 notify_menu_entry_icon_secondary_text_trampoline::<Self, F> as *const (),
3948 )),
3949 Box_::into_raw(f),
3950 )
3951 }
3952 }
3953
3954 #[doc(alias = "overwrite-mode")]
3955 fn connect_overwrite_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3956 unsafe extern "C" fn notify_overwrite_mode_trampoline<
3957 P: IsA<Entry>,
3958 F: Fn(&P) + 'static,
3959 >(
3960 this: *mut ffi::GtkEntry,
3961 _param_spec: glib::ffi::gpointer,
3962 f: glib::ffi::gpointer,
3963 ) {
3964 unsafe {
3965 let f: &F = &*(f as *const F);
3966 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3967 }
3968 }
3969 unsafe {
3970 let f: Box_<F> = Box_::new(f);
3971 connect_raw(
3972 self.as_ptr() as *mut _,
3973 c"notify::overwrite-mode".as_ptr(),
3974 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3975 notify_overwrite_mode_trampoline::<Self, F> as *const (),
3976 )),
3977 Box_::into_raw(f),
3978 )
3979 }
3980 }
3981
3982 #[doc(alias = "placeholder-text")]
3983 fn connect_placeholder_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3984 unsafe extern "C" fn notify_placeholder_text_trampoline<
3985 P: IsA<Entry>,
3986 F: Fn(&P) + 'static,
3987 >(
3988 this: *mut ffi::GtkEntry,
3989 _param_spec: glib::ffi::gpointer,
3990 f: glib::ffi::gpointer,
3991 ) {
3992 unsafe {
3993 let f: &F = &*(f as *const F);
3994 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
3995 }
3996 }
3997 unsafe {
3998 let f: Box_<F> = Box_::new(f);
3999 connect_raw(
4000 self.as_ptr() as *mut _,
4001 c"notify::placeholder-text".as_ptr(),
4002 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4003 notify_placeholder_text_trampoline::<Self, F> as *const (),
4004 )),
4005 Box_::into_raw(f),
4006 )
4007 }
4008 }
4009
4010 #[doc(alias = "primary-icon-activatable")]
4011 fn connect_primary_icon_activatable_notify<F: Fn(&Self) + 'static>(
4012 &self,
4013 f: F,
4014 ) -> SignalHandlerId {
4015 unsafe extern "C" fn notify_primary_icon_activatable_trampoline<
4016 P: IsA<Entry>,
4017 F: Fn(&P) + 'static,
4018 >(
4019 this: *mut ffi::GtkEntry,
4020 _param_spec: glib::ffi::gpointer,
4021 f: glib::ffi::gpointer,
4022 ) {
4023 unsafe {
4024 let f: &F = &*(f as *const F);
4025 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4026 }
4027 }
4028 unsafe {
4029 let f: Box_<F> = Box_::new(f);
4030 connect_raw(
4031 self.as_ptr() as *mut _,
4032 c"notify::primary-icon-activatable".as_ptr(),
4033 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4034 notify_primary_icon_activatable_trampoline::<Self, F> as *const (),
4035 )),
4036 Box_::into_raw(f),
4037 )
4038 }
4039 }
4040
4041 #[doc(alias = "primary-icon-gicon")]
4042 fn connect_primary_icon_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4043 unsafe extern "C" fn notify_primary_icon_gicon_trampoline<
4044 P: IsA<Entry>,
4045 F: Fn(&P) + 'static,
4046 >(
4047 this: *mut ffi::GtkEntry,
4048 _param_spec: glib::ffi::gpointer,
4049 f: glib::ffi::gpointer,
4050 ) {
4051 unsafe {
4052 let f: &F = &*(f as *const F);
4053 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4054 }
4055 }
4056 unsafe {
4057 let f: Box_<F> = Box_::new(f);
4058 connect_raw(
4059 self.as_ptr() as *mut _,
4060 c"notify::primary-icon-gicon".as_ptr(),
4061 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4062 notify_primary_icon_gicon_trampoline::<Self, F> as *const (),
4063 )),
4064 Box_::into_raw(f),
4065 )
4066 }
4067 }
4068
4069 #[doc(alias = "primary-icon-name")]
4070 fn connect_primary_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4071 unsafe extern "C" fn notify_primary_icon_name_trampoline<
4072 P: IsA<Entry>,
4073 F: Fn(&P) + 'static,
4074 >(
4075 this: *mut ffi::GtkEntry,
4076 _param_spec: glib::ffi::gpointer,
4077 f: glib::ffi::gpointer,
4078 ) {
4079 unsafe {
4080 let f: &F = &*(f as *const F);
4081 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4082 }
4083 }
4084 unsafe {
4085 let f: Box_<F> = Box_::new(f);
4086 connect_raw(
4087 self.as_ptr() as *mut _,
4088 c"notify::primary-icon-name".as_ptr(),
4089 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4090 notify_primary_icon_name_trampoline::<Self, F> as *const (),
4091 )),
4092 Box_::into_raw(f),
4093 )
4094 }
4095 }
4096
4097 #[doc(alias = "primary-icon-paintable")]
4098 fn connect_primary_icon_paintable_notify<F: Fn(&Self) + 'static>(
4099 &self,
4100 f: F,
4101 ) -> SignalHandlerId {
4102 unsafe extern "C" fn notify_primary_icon_paintable_trampoline<
4103 P: IsA<Entry>,
4104 F: Fn(&P) + 'static,
4105 >(
4106 this: *mut ffi::GtkEntry,
4107 _param_spec: glib::ffi::gpointer,
4108 f: glib::ffi::gpointer,
4109 ) {
4110 unsafe {
4111 let f: &F = &*(f as *const F);
4112 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4113 }
4114 }
4115 unsafe {
4116 let f: Box_<F> = Box_::new(f);
4117 connect_raw(
4118 self.as_ptr() as *mut _,
4119 c"notify::primary-icon-paintable".as_ptr(),
4120 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4121 notify_primary_icon_paintable_trampoline::<Self, F> as *const (),
4122 )),
4123 Box_::into_raw(f),
4124 )
4125 }
4126 }
4127
4128 #[doc(alias = "primary-icon-sensitive")]
4129 fn connect_primary_icon_sensitive_notify<F: Fn(&Self) + 'static>(
4130 &self,
4131 f: F,
4132 ) -> SignalHandlerId {
4133 unsafe extern "C" fn notify_primary_icon_sensitive_trampoline<
4134 P: IsA<Entry>,
4135 F: Fn(&P) + 'static,
4136 >(
4137 this: *mut ffi::GtkEntry,
4138 _param_spec: glib::ffi::gpointer,
4139 f: glib::ffi::gpointer,
4140 ) {
4141 unsafe {
4142 let f: &F = &*(f as *const F);
4143 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4144 }
4145 }
4146 unsafe {
4147 let f: Box_<F> = Box_::new(f);
4148 connect_raw(
4149 self.as_ptr() as *mut _,
4150 c"notify::primary-icon-sensitive".as_ptr(),
4151 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4152 notify_primary_icon_sensitive_trampoline::<Self, F> as *const (),
4153 )),
4154 Box_::into_raw(f),
4155 )
4156 }
4157 }
4158
4159 #[doc(alias = "primary-icon-storage-type")]
4160 fn connect_primary_icon_storage_type_notify<F: Fn(&Self) + 'static>(
4161 &self,
4162 f: F,
4163 ) -> SignalHandlerId {
4164 unsafe extern "C" fn notify_primary_icon_storage_type_trampoline<
4165 P: IsA<Entry>,
4166 F: Fn(&P) + 'static,
4167 >(
4168 this: *mut ffi::GtkEntry,
4169 _param_spec: glib::ffi::gpointer,
4170 f: glib::ffi::gpointer,
4171 ) {
4172 unsafe {
4173 let f: &F = &*(f as *const F);
4174 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4175 }
4176 }
4177 unsafe {
4178 let f: Box_<F> = Box_::new(f);
4179 connect_raw(
4180 self.as_ptr() as *mut _,
4181 c"notify::primary-icon-storage-type".as_ptr(),
4182 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4183 notify_primary_icon_storage_type_trampoline::<Self, F> as *const (),
4184 )),
4185 Box_::into_raw(f),
4186 )
4187 }
4188 }
4189
4190 #[doc(alias = "primary-icon-tooltip-markup")]
4191 fn connect_primary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>(
4192 &self,
4193 f: F,
4194 ) -> SignalHandlerId {
4195 unsafe extern "C" fn notify_primary_icon_tooltip_markup_trampoline<
4196 P: IsA<Entry>,
4197 F: Fn(&P) + 'static,
4198 >(
4199 this: *mut ffi::GtkEntry,
4200 _param_spec: glib::ffi::gpointer,
4201 f: glib::ffi::gpointer,
4202 ) {
4203 unsafe {
4204 let f: &F = &*(f as *const F);
4205 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4206 }
4207 }
4208 unsafe {
4209 let f: Box_<F> = Box_::new(f);
4210 connect_raw(
4211 self.as_ptr() as *mut _,
4212 c"notify::primary-icon-tooltip-markup".as_ptr(),
4213 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4214 notify_primary_icon_tooltip_markup_trampoline::<Self, F> as *const (),
4215 )),
4216 Box_::into_raw(f),
4217 )
4218 }
4219 }
4220
4221 #[doc(alias = "primary-icon-tooltip-text")]
4222 fn connect_primary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>(
4223 &self,
4224 f: F,
4225 ) -> SignalHandlerId {
4226 unsafe extern "C" fn notify_primary_icon_tooltip_text_trampoline<
4227 P: IsA<Entry>,
4228 F: Fn(&P) + 'static,
4229 >(
4230 this: *mut ffi::GtkEntry,
4231 _param_spec: glib::ffi::gpointer,
4232 f: glib::ffi::gpointer,
4233 ) {
4234 unsafe {
4235 let f: &F = &*(f as *const F);
4236 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4237 }
4238 }
4239 unsafe {
4240 let f: Box_<F> = Box_::new(f);
4241 connect_raw(
4242 self.as_ptr() as *mut _,
4243 c"notify::primary-icon-tooltip-text".as_ptr(),
4244 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4245 notify_primary_icon_tooltip_text_trampoline::<Self, F> as *const (),
4246 )),
4247 Box_::into_raw(f),
4248 )
4249 }
4250 }
4251
4252 #[doc(alias = "progress-fraction")]
4253 fn connect_progress_fraction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4254 unsafe extern "C" fn notify_progress_fraction_trampoline<
4255 P: IsA<Entry>,
4256 F: Fn(&P) + 'static,
4257 >(
4258 this: *mut ffi::GtkEntry,
4259 _param_spec: glib::ffi::gpointer,
4260 f: glib::ffi::gpointer,
4261 ) {
4262 unsafe {
4263 let f: &F = &*(f as *const F);
4264 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4265 }
4266 }
4267 unsafe {
4268 let f: Box_<F> = Box_::new(f);
4269 connect_raw(
4270 self.as_ptr() as *mut _,
4271 c"notify::progress-fraction".as_ptr(),
4272 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4273 notify_progress_fraction_trampoline::<Self, F> as *const (),
4274 )),
4275 Box_::into_raw(f),
4276 )
4277 }
4278 }
4279
4280 #[doc(alias = "progress-pulse-step")]
4281 fn connect_progress_pulse_step_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4282 unsafe extern "C" fn notify_progress_pulse_step_trampoline<
4283 P: IsA<Entry>,
4284 F: Fn(&P) + 'static,
4285 >(
4286 this: *mut ffi::GtkEntry,
4287 _param_spec: glib::ffi::gpointer,
4288 f: glib::ffi::gpointer,
4289 ) {
4290 unsafe {
4291 let f: &F = &*(f as *const F);
4292 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4293 }
4294 }
4295 unsafe {
4296 let f: Box_<F> = Box_::new(f);
4297 connect_raw(
4298 self.as_ptr() as *mut _,
4299 c"notify::progress-pulse-step".as_ptr(),
4300 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4301 notify_progress_pulse_step_trampoline::<Self, F> as *const (),
4302 )),
4303 Box_::into_raw(f),
4304 )
4305 }
4306 }
4307
4308 #[doc(alias = "scroll-offset")]
4309 fn connect_scroll_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4310 unsafe extern "C" fn notify_scroll_offset_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4311 this: *mut ffi::GtkEntry,
4312 _param_spec: glib::ffi::gpointer,
4313 f: glib::ffi::gpointer,
4314 ) {
4315 unsafe {
4316 let f: &F = &*(f as *const F);
4317 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4318 }
4319 }
4320 unsafe {
4321 let f: Box_<F> = Box_::new(f);
4322 connect_raw(
4323 self.as_ptr() as *mut _,
4324 c"notify::scroll-offset".as_ptr(),
4325 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4326 notify_scroll_offset_trampoline::<Self, F> as *const (),
4327 )),
4328 Box_::into_raw(f),
4329 )
4330 }
4331 }
4332
4333 #[doc(alias = "secondary-icon-activatable")]
4334 fn connect_secondary_icon_activatable_notify<F: Fn(&Self) + 'static>(
4335 &self,
4336 f: F,
4337 ) -> SignalHandlerId {
4338 unsafe extern "C" fn notify_secondary_icon_activatable_trampoline<
4339 P: IsA<Entry>,
4340 F: Fn(&P) + 'static,
4341 >(
4342 this: *mut ffi::GtkEntry,
4343 _param_spec: glib::ffi::gpointer,
4344 f: glib::ffi::gpointer,
4345 ) {
4346 unsafe {
4347 let f: &F = &*(f as *const F);
4348 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4349 }
4350 }
4351 unsafe {
4352 let f: Box_<F> = Box_::new(f);
4353 connect_raw(
4354 self.as_ptr() as *mut _,
4355 c"notify::secondary-icon-activatable".as_ptr(),
4356 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4357 notify_secondary_icon_activatable_trampoline::<Self, F> as *const (),
4358 )),
4359 Box_::into_raw(f),
4360 )
4361 }
4362 }
4363
4364 #[doc(alias = "secondary-icon-gicon")]
4365 fn connect_secondary_icon_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4366 unsafe extern "C" fn notify_secondary_icon_gicon_trampoline<
4367 P: IsA<Entry>,
4368 F: Fn(&P) + 'static,
4369 >(
4370 this: *mut ffi::GtkEntry,
4371 _param_spec: glib::ffi::gpointer,
4372 f: glib::ffi::gpointer,
4373 ) {
4374 unsafe {
4375 let f: &F = &*(f as *const F);
4376 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4377 }
4378 }
4379 unsafe {
4380 let f: Box_<F> = Box_::new(f);
4381 connect_raw(
4382 self.as_ptr() as *mut _,
4383 c"notify::secondary-icon-gicon".as_ptr(),
4384 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4385 notify_secondary_icon_gicon_trampoline::<Self, F> as *const (),
4386 )),
4387 Box_::into_raw(f),
4388 )
4389 }
4390 }
4391
4392 #[doc(alias = "secondary-icon-name")]
4393 fn connect_secondary_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4394 unsafe extern "C" fn notify_secondary_icon_name_trampoline<
4395 P: IsA<Entry>,
4396 F: Fn(&P) + 'static,
4397 >(
4398 this: *mut ffi::GtkEntry,
4399 _param_spec: glib::ffi::gpointer,
4400 f: glib::ffi::gpointer,
4401 ) {
4402 unsafe {
4403 let f: &F = &*(f as *const F);
4404 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4405 }
4406 }
4407 unsafe {
4408 let f: Box_<F> = Box_::new(f);
4409 connect_raw(
4410 self.as_ptr() as *mut _,
4411 c"notify::secondary-icon-name".as_ptr(),
4412 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4413 notify_secondary_icon_name_trampoline::<Self, F> as *const (),
4414 )),
4415 Box_::into_raw(f),
4416 )
4417 }
4418 }
4419
4420 #[doc(alias = "secondary-icon-paintable")]
4421 fn connect_secondary_icon_paintable_notify<F: Fn(&Self) + 'static>(
4422 &self,
4423 f: F,
4424 ) -> SignalHandlerId {
4425 unsafe extern "C" fn notify_secondary_icon_paintable_trampoline<
4426 P: IsA<Entry>,
4427 F: Fn(&P) + 'static,
4428 >(
4429 this: *mut ffi::GtkEntry,
4430 _param_spec: glib::ffi::gpointer,
4431 f: glib::ffi::gpointer,
4432 ) {
4433 unsafe {
4434 let f: &F = &*(f as *const F);
4435 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4436 }
4437 }
4438 unsafe {
4439 let f: Box_<F> = Box_::new(f);
4440 connect_raw(
4441 self.as_ptr() as *mut _,
4442 c"notify::secondary-icon-paintable".as_ptr(),
4443 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4444 notify_secondary_icon_paintable_trampoline::<Self, F> as *const (),
4445 )),
4446 Box_::into_raw(f),
4447 )
4448 }
4449 }
4450
4451 #[doc(alias = "secondary-icon-sensitive")]
4452 fn connect_secondary_icon_sensitive_notify<F: Fn(&Self) + 'static>(
4453 &self,
4454 f: F,
4455 ) -> SignalHandlerId {
4456 unsafe extern "C" fn notify_secondary_icon_sensitive_trampoline<
4457 P: IsA<Entry>,
4458 F: Fn(&P) + 'static,
4459 >(
4460 this: *mut ffi::GtkEntry,
4461 _param_spec: glib::ffi::gpointer,
4462 f: glib::ffi::gpointer,
4463 ) {
4464 unsafe {
4465 let f: &F = &*(f as *const F);
4466 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4467 }
4468 }
4469 unsafe {
4470 let f: Box_<F> = Box_::new(f);
4471 connect_raw(
4472 self.as_ptr() as *mut _,
4473 c"notify::secondary-icon-sensitive".as_ptr(),
4474 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4475 notify_secondary_icon_sensitive_trampoline::<Self, F> as *const (),
4476 )),
4477 Box_::into_raw(f),
4478 )
4479 }
4480 }
4481
4482 #[doc(alias = "secondary-icon-storage-type")]
4483 fn connect_secondary_icon_storage_type_notify<F: Fn(&Self) + 'static>(
4484 &self,
4485 f: F,
4486 ) -> SignalHandlerId {
4487 unsafe extern "C" fn notify_secondary_icon_storage_type_trampoline<
4488 P: IsA<Entry>,
4489 F: Fn(&P) + 'static,
4490 >(
4491 this: *mut ffi::GtkEntry,
4492 _param_spec: glib::ffi::gpointer,
4493 f: glib::ffi::gpointer,
4494 ) {
4495 unsafe {
4496 let f: &F = &*(f as *const F);
4497 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4498 }
4499 }
4500 unsafe {
4501 let f: Box_<F> = Box_::new(f);
4502 connect_raw(
4503 self.as_ptr() as *mut _,
4504 c"notify::secondary-icon-storage-type".as_ptr(),
4505 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4506 notify_secondary_icon_storage_type_trampoline::<Self, F> as *const (),
4507 )),
4508 Box_::into_raw(f),
4509 )
4510 }
4511 }
4512
4513 #[doc(alias = "secondary-icon-tooltip-markup")]
4514 fn connect_secondary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>(
4515 &self,
4516 f: F,
4517 ) -> SignalHandlerId {
4518 unsafe extern "C" fn notify_secondary_icon_tooltip_markup_trampoline<
4519 P: IsA<Entry>,
4520 F: Fn(&P) + 'static,
4521 >(
4522 this: *mut ffi::GtkEntry,
4523 _param_spec: glib::ffi::gpointer,
4524 f: glib::ffi::gpointer,
4525 ) {
4526 unsafe {
4527 let f: &F = &*(f as *const F);
4528 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4529 }
4530 }
4531 unsafe {
4532 let f: Box_<F> = Box_::new(f);
4533 connect_raw(
4534 self.as_ptr() as *mut _,
4535 c"notify::secondary-icon-tooltip-markup".as_ptr(),
4536 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4537 notify_secondary_icon_tooltip_markup_trampoline::<Self, F> as *const (),
4538 )),
4539 Box_::into_raw(f),
4540 )
4541 }
4542 }
4543
4544 #[doc(alias = "secondary-icon-tooltip-text")]
4545 fn connect_secondary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>(
4546 &self,
4547 f: F,
4548 ) -> SignalHandlerId {
4549 unsafe extern "C" fn notify_secondary_icon_tooltip_text_trampoline<
4550 P: IsA<Entry>,
4551 F: Fn(&P) + 'static,
4552 >(
4553 this: *mut ffi::GtkEntry,
4554 _param_spec: glib::ffi::gpointer,
4555 f: glib::ffi::gpointer,
4556 ) {
4557 unsafe {
4558 let f: &F = &*(f as *const F);
4559 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4560 }
4561 }
4562 unsafe {
4563 let f: Box_<F> = Box_::new(f);
4564 connect_raw(
4565 self.as_ptr() as *mut _,
4566 c"notify::secondary-icon-tooltip-text".as_ptr(),
4567 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4568 notify_secondary_icon_tooltip_text_trampoline::<Self, F> as *const (),
4569 )),
4570 Box_::into_raw(f),
4571 )
4572 }
4573 }
4574
4575 #[doc(alias = "show-emoji-icon")]
4576 fn connect_show_emoji_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4577 unsafe extern "C" fn notify_show_emoji_icon_trampoline<
4578 P: IsA<Entry>,
4579 F: Fn(&P) + 'static,
4580 >(
4581 this: *mut ffi::GtkEntry,
4582 _param_spec: glib::ffi::gpointer,
4583 f: glib::ffi::gpointer,
4584 ) {
4585 unsafe {
4586 let f: &F = &*(f as *const F);
4587 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4588 }
4589 }
4590 unsafe {
4591 let f: Box_<F> = Box_::new(f);
4592 connect_raw(
4593 self.as_ptr() as *mut _,
4594 c"notify::show-emoji-icon".as_ptr(),
4595 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4596 notify_show_emoji_icon_trampoline::<Self, F> as *const (),
4597 )),
4598 Box_::into_raw(f),
4599 )
4600 }
4601 }
4602
4603 #[doc(alias = "tabs")]
4604 fn connect_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4605 unsafe extern "C" fn notify_tabs_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4606 this: *mut ffi::GtkEntry,
4607 _param_spec: glib::ffi::gpointer,
4608 f: glib::ffi::gpointer,
4609 ) {
4610 unsafe {
4611 let f: &F = &*(f as *const F);
4612 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4613 }
4614 }
4615 unsafe {
4616 let f: Box_<F> = Box_::new(f);
4617 connect_raw(
4618 self.as_ptr() as *mut _,
4619 c"notify::tabs".as_ptr(),
4620 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4621 notify_tabs_trampoline::<Self, F> as *const (),
4622 )),
4623 Box_::into_raw(f),
4624 )
4625 }
4626 }
4627
4628 #[doc(alias = "text-length")]
4629 fn connect_text_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4630 unsafe extern "C" fn notify_text_length_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4631 this: *mut ffi::GtkEntry,
4632 _param_spec: glib::ffi::gpointer,
4633 f: glib::ffi::gpointer,
4634 ) {
4635 unsafe {
4636 let f: &F = &*(f as *const F);
4637 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4638 }
4639 }
4640 unsafe {
4641 let f: Box_<F> = Box_::new(f);
4642 connect_raw(
4643 self.as_ptr() as *mut _,
4644 c"notify::text-length".as_ptr(),
4645 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4646 notify_text_length_trampoline::<Self, F> as *const (),
4647 )),
4648 Box_::into_raw(f),
4649 )
4650 }
4651 }
4652
4653 #[doc(alias = "truncate-multiline")]
4654 fn connect_truncate_multiline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4655 unsafe extern "C" fn notify_truncate_multiline_trampoline<
4656 P: IsA<Entry>,
4657 F: Fn(&P) + 'static,
4658 >(
4659 this: *mut ffi::GtkEntry,
4660 _param_spec: glib::ffi::gpointer,
4661 f: glib::ffi::gpointer,
4662 ) {
4663 unsafe {
4664 let f: &F = &*(f as *const F);
4665 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4666 }
4667 }
4668 unsafe {
4669 let f: Box_<F> = Box_::new(f);
4670 connect_raw(
4671 self.as_ptr() as *mut _,
4672 c"notify::truncate-multiline".as_ptr(),
4673 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4674 notify_truncate_multiline_trampoline::<Self, F> as *const (),
4675 )),
4676 Box_::into_raw(f),
4677 )
4678 }
4679 }
4680
4681 #[doc(alias = "visibility")]
4682 fn connect_visibility_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4683 unsafe extern "C" fn notify_visibility_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4684 this: *mut ffi::GtkEntry,
4685 _param_spec: glib::ffi::gpointer,
4686 f: glib::ffi::gpointer,
4687 ) {
4688 unsafe {
4689 let f: &F = &*(f as *const F);
4690 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4691 }
4692 }
4693 unsafe {
4694 let f: Box_<F> = Box_::new(f);
4695 connect_raw(
4696 self.as_ptr() as *mut _,
4697 c"notify::visibility".as_ptr(),
4698 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4699 notify_visibility_trampoline::<Self, F> as *const (),
4700 )),
4701 Box_::into_raw(f),
4702 )
4703 }
4704 }
4705}
4706
4707impl<O: IsA<Entry>> EntryExt for O {}