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