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