gtk/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
5use crate::{
6 Adjustment, Align, Buildable, CellEditable, Container, DeleteType, Editable, EntryBuffer,
7 EntryCompletion, EntryIconPosition, ImageType, InputHints, InputPurpose, MovementStep,
8 TargetList, Widget, ffi,
9};
10use glib::{
11 object::ObjectType as _,
12 prelude::*,
13 signal::{SignalHandlerId, connect_raw},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 ///
20 /// entry[.read-only][.flat][.warning][.error]
21 /// ├── image.left
22 /// ├── image.right
23 /// ├── undershoot.left
24 /// ├── undershoot.right
25 /// ├── [selection]
26 /// ├── [progress[.pulse]]
27 /// ╰── [window.popup]
28 /// ]|
29 ///
30 /// GtkEntry has a main node with the name entry. Depending on the properties
31 /// of the entry, the style classes .read-only and .flat may appear. The style
32 /// classes .warning and .error may also be used with entries.
33 ///
34 /// When the entry shows icons, it adds subnodes with the name image and the
35 /// style class .left or .right, depending on where the icon appears.
36 ///
37 /// When the entry has a selection, it adds a subnode with the name selection.
38 ///
39 /// When the entry shows progress, it adds a subnode with the name progress.
40 /// The node has the style class .pulse when the shown progress is pulsing.
41 ///
42 /// The CSS node for a context menu is added as a subnode below entry as well.
43 ///
44 /// The undershoot nodes are used to draw the underflow indication when content
45 /// is scrolled out of view. These nodes get the .left and .right style classes
46 /// added depending on where the indication is drawn.
47 ///
48 /// When touch is used and touch selection handles are shown, they are using
49 /// CSS nodes with name cursor-handle. They get the .top or .bottom style class
50 /// depending on where they are shown in relation to the selection. If there is
51 /// just a single handle for the text cursor, it gets the style class
52 /// .insertion-cursor.
53 ///
54 /// ## Properties
55 ///
56 ///
57 /// #### `activates-default`
58 /// Readable | Writable
59 ///
60 ///
61 /// #### `attributes`
62 /// A list of Pango attributes to apply to the text of the entry.
63 ///
64 /// This is mainly useful to change the size or weight of the text.
65 ///
66 /// The `PangoAttribute`'s `start_index` and `end_index` must refer to the
67 /// [`EntryBuffer`][crate::EntryBuffer] text, i.e. without the preedit string.
68 ///
69 /// Readable | Writable
70 ///
71 ///
72 /// #### `buffer`
73 /// Readable | Writable | Construct
74 ///
75 ///
76 /// #### `caps-lock-warning`
77 /// Whether password entries will show a warning when Caps Lock is on.
78 ///
79 /// Note that the warning is shown using a secondary icon, and thus
80 /// does not work if you are using the secondary icon position for some
81 /// other purpose.
82 ///
83 /// Readable | Writable
84 ///
85 ///
86 /// #### `completion`
87 /// The auxiliary completion object to use with the entry.
88 ///
89 /// Readable | Writable
90 ///
91 ///
92 /// #### `cursor-position`
93 /// Readable
94 ///
95 ///
96 /// #### `editable`
97 /// Readable | Writable
98 ///
99 ///
100 /// #### `enable-emoji-completion`
101 /// Readable | Writable
102 ///
103 ///
104 /// #### `has-frame`
105 /// Readable | Writable
106 ///
107 ///
108 /// #### `im-module`
109 /// Which IM (input method) module should be used for this entry.
110 /// See [`IMContext`][crate::IMContext].
111 ///
112 /// Setting this to a non-[`None`] value overrides the
113 /// system-wide IM module setting. See the GtkSettings
114 /// [`gtk-im-module`][struct@crate::Settings#gtk-im-module] property.
115 ///
116 /// Readable | Writable
117 ///
118 ///
119 /// #### `inner-border`
120 /// Sets the text area's border between the text and the frame.
121 ///
122 /// Readable | Writable
123 ///
124 ///
125 /// #### `input-hints`
126 /// Additional hints (beyond [`input-purpose`][struct@crate::Entry#input-purpose]) that
127 /// allow input methods to fine-tune their behaviour.
128 ///
129 /// Readable | Writable
130 ///
131 ///
132 /// #### `input-purpose`
133 /// The purpose of this text field.
134 ///
135 /// This property can be used by on-screen keyboards and other input
136 /// methods to adjust their behaviour.
137 ///
138 /// Note that setting the purpose to [`InputPurpose::Password`][crate::InputPurpose::Password] or
139 /// [`InputPurpose::Pin`][crate::InputPurpose::Pin] is independent from setting
140 /// [`visibility`][struct@crate::Entry#visibility].
141 ///
142 /// Readable | Writable
143 ///
144 ///
145 /// #### `invisible-char`
146 /// The invisible character is used when masking entry contents (in
147 /// \"password mode\")"). When it is not explicitly set with the
148 /// [`invisible-char`][struct@crate::Entry#invisible-char] property, GTK+ determines the character
149 /// to use from a list of possible candidates, depending on availability
150 /// in the current font.
151 ///
152 /// This style property allows the theme to prepend a character
153 /// to the list of candidates.
154 ///
155 /// Readable | Writable
156 ///
157 ///
158 /// #### `invisible-char-set`
159 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
160 ///
161 /// Readable | Writable
162 ///
163 ///
164 /// #### `max-length`
165 /// Readable | Writable
166 ///
167 ///
168 /// #### `max-width-chars`
169 /// The desired maximum width of the entry, in characters.
170 /// If this property is set to -1, the width will be calculated
171 /// automatically.
172 ///
173 /// Readable | Writable
174 ///
175 ///
176 /// #### `overwrite-mode`
177 /// If text is overwritten when typing in the [`Entry`][crate::Entry].
178 ///
179 /// Readable | Writable
180 ///
181 ///
182 /// #### `placeholder-text`
183 /// The text that will be displayed in the [`Entry`][crate::Entry] when it is empty
184 /// and unfocused.
185 ///
186 /// Readable | Writable
187 ///
188 ///
189 /// #### `populate-all`
190 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::Entry#populate-popup]
191 /// signal is also emitted for touch popups.
192 ///
193 /// Readable | Writable
194 ///
195 ///
196 /// #### `primary-icon-activatable`
197 /// Whether the primary icon is activatable.
198 ///
199 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
200 /// signals only on sensitive, activatable icons.
201 ///
202 /// Sensitive, but non-activatable icons can be used for purely
203 /// informational purposes.
204 ///
205 /// Readable | Writable
206 ///
207 ///
208 /// #### `primary-icon-gicon`
209 /// The [`gio::Icon`][crate::gio::Icon] to use for the primary icon for the entry.
210 ///
211 /// Readable | Writable
212 ///
213 ///
214 /// #### `primary-icon-name`
215 /// The icon name to use for the primary icon for the entry.
216 ///
217 /// Readable | Writable
218 ///
219 ///
220 /// #### `primary-icon-pixbuf`
221 /// A pixbuf to use as the primary icon for the entry.
222 ///
223 /// Readable | Writable
224 ///
225 ///
226 /// #### `primary-icon-sensitive`
227 /// Whether the primary icon is sensitive.
228 ///
229 /// An insensitive icon appears grayed out. GTK+ does not emit the
230 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
231 /// does not allow DND from insensitive icons.
232 ///
233 /// An icon should be set insensitive if the action that would trigger
234 /// when clicked is currently not available.
235 ///
236 /// Readable | Writable
237 ///
238 ///
239 /// #### `primary-icon-stock`
240 /// The stock id to use for the primary icon for the entry.
241 ///
242 /// Readable | Writable
243 ///
244 ///
245 /// #### `primary-icon-storage-type`
246 /// The representation which is used for the primary icon of the entry.
247 ///
248 /// Readable
249 ///
250 ///
251 /// #### `primary-icon-tooltip-markup`
252 /// The contents of the tooltip on the primary icon, which is marked up
253 /// with the [Pango text markup language][PangoMarkupFormat].
254 ///
255 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
256 ///
257 /// Readable | Writable
258 ///
259 ///
260 /// #### `primary-icon-tooltip-text`
261 /// The contents of the tooltip on the primary icon.
262 ///
263 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
264 ///
265 /// Readable | Writable
266 ///
267 ///
268 /// #### `progress-fraction`
269 /// The current fraction of the task that's been completed.
270 ///
271 /// Readable | Writable
272 ///
273 ///
274 /// #### `progress-pulse-step`
275 /// The fraction of total entry width to move the progress
276 /// bouncing block for each call to [`EntryExt::progress_pulse()`][crate::prelude::EntryExt::progress_pulse()].
277 ///
278 /// Readable | Writable
279 ///
280 ///
281 /// #### `scroll-offset`
282 /// Readable
283 ///
284 ///
285 /// #### `secondary-icon-activatable`
286 /// Whether the secondary icon is activatable.
287 ///
288 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
289 /// signals only on sensitive, activatable icons.
290 ///
291 /// Sensitive, but non-activatable icons can be used for purely
292 /// informational purposes.
293 ///
294 /// Readable | Writable
295 ///
296 ///
297 /// #### `secondary-icon-gicon`
298 /// The [`gio::Icon`][crate::gio::Icon] to use for the secondary icon for the entry.
299 ///
300 /// Readable | Writable
301 ///
302 ///
303 /// #### `secondary-icon-name`
304 /// The icon name to use for the secondary icon for the entry.
305 ///
306 /// Readable | Writable
307 ///
308 ///
309 /// #### `secondary-icon-pixbuf`
310 /// An pixbuf to use as the secondary icon for the entry.
311 ///
312 /// Readable | Writable
313 ///
314 ///
315 /// #### `secondary-icon-sensitive`
316 /// Whether the secondary icon is sensitive.
317 ///
318 /// An insensitive icon appears grayed out. GTK+ does not emit the
319 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
320 /// does not allow DND from insensitive icons.
321 ///
322 /// An icon should be set insensitive if the action that would trigger
323 /// when clicked is currently not available.
324 ///
325 /// Readable | Writable
326 ///
327 ///
328 /// #### `secondary-icon-stock`
329 /// The stock id to use for the secondary icon for the entry.
330 ///
331 /// Readable | Writable
332 ///
333 ///
334 /// #### `secondary-icon-storage-type`
335 /// The representation which is used for the secondary icon of the entry.
336 ///
337 /// Readable
338 ///
339 ///
340 /// #### `secondary-icon-tooltip-markup`
341 /// The contents of the tooltip on the secondary icon, which is marked up
342 /// with the [Pango text markup language][PangoMarkupFormat].
343 ///
344 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
345 ///
346 /// Readable | Writable
347 ///
348 ///
349 /// #### `secondary-icon-tooltip-text`
350 /// The contents of the tooltip on the secondary icon.
351 ///
352 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
353 ///
354 /// Readable | Writable
355 ///
356 ///
357 /// #### `selection-bound`
358 /// Readable
359 ///
360 ///
361 /// #### `shadow-type`
362 /// Which kind of shadow to draw around the entry when
363 /// [`has-frame`][struct@crate::Entry#has-frame] is set to [`true`].
364 ///
365 /// Readable | Writable
366 ///
367 ///
368 /// #### `show-emoji-icon`
369 /// Readable | Writable
370 ///
371 ///
372 /// #### `tabs`
373 /// Readable | Writable
374 ///
375 ///
376 /// #### `text`
377 /// Readable | Writable
378 ///
379 ///
380 /// #### `text-length`
381 /// The length of the text in the [`Entry`][crate::Entry].
382 ///
383 /// Readable
384 ///
385 ///
386 /// #### `truncate-multiline`
387 /// When [`true`], pasted multi-line text is truncated to the first line.
388 ///
389 /// Readable | Writable
390 ///
391 ///
392 /// #### `visibility`
393 /// Readable | Writable
394 ///
395 ///
396 /// #### `width-chars`
397 /// Readable | Writable
398 ///
399 ///
400 /// #### `xalign`
401 /// The horizontal alignment, from 0 (left) to 1 (right).
402 /// Reversed for RTL layouts.
403 ///
404 /// Readable | Writable
405 /// <details><summary><h4>Widget</h4></summary>
406 ///
407 ///
408 /// #### `app-paintable`
409 /// Readable | Writable
410 ///
411 ///
412 /// #### `can-default`
413 /// Readable | Writable
414 ///
415 ///
416 /// #### `can-focus`
417 /// Readable | Writable
418 ///
419 ///
420 /// #### `composite-child`
421 /// Readable
422 ///
423 ///
424 /// #### `double-buffered`
425 /// Whether the widget is double buffered.
426 ///
427 /// Readable | Writable
428 ///
429 ///
430 /// #### `events`
431 /// Readable | Writable
432 ///
433 ///
434 /// #### `expand`
435 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
436 ///
437 /// Readable | Writable
438 ///
439 ///
440 /// #### `focus-on-click`
441 /// Whether the widget should grab focus when it is clicked with the mouse.
442 ///
443 /// This property is only relevant for widgets that can take focus.
444 ///
445 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
446 /// GtkComboBox) implemented this property individually.
447 ///
448 /// Readable | Writable
449 ///
450 ///
451 /// #### `halign`
452 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
453 ///
454 /// Readable | Writable
455 ///
456 ///
457 /// #### `has-default`
458 /// Readable | Writable
459 ///
460 ///
461 /// #### `has-focus`
462 /// Readable | Writable
463 ///
464 ///
465 /// #### `has-tooltip`
466 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
467 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
468 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
469 /// whether it will provide a tooltip or not.
470 ///
471 /// Note that setting this property to [`true`] for the first time will change
472 /// the event masks of the GdkWindows of this widget to include leave-notify
473 /// and motion-notify events. This cannot and will not be undone when the
474 /// property is set to [`false`] again.
475 ///
476 /// Readable | Writable
477 ///
478 ///
479 /// #### `height-request`
480 /// Readable | Writable
481 ///
482 ///
483 /// #### `hexpand`
484 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
485 ///
486 /// Readable | Writable
487 ///
488 ///
489 /// #### `hexpand-set`
490 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
491 ///
492 /// Readable | Writable
493 ///
494 ///
495 /// #### `is-focus`
496 /// Readable | Writable
497 ///
498 ///
499 /// #### `margin`
500 /// Sets all four sides' margin at once. If read, returns max
501 /// margin on any side.
502 ///
503 /// Readable | Writable
504 ///
505 ///
506 /// #### `margin-bottom`
507 /// Margin on bottom side of widget.
508 ///
509 /// This property adds margin outside of the widget's normal size
510 /// request, the margin will be added in addition to the size from
511 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
512 ///
513 /// Readable | Writable
514 ///
515 ///
516 /// #### `margin-end`
517 /// Margin on end of widget, horizontally. This property supports
518 /// left-to-right and right-to-left text directions.
519 ///
520 /// This property adds margin outside of the widget's normal size
521 /// request, the margin will be added in addition to the size from
522 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
523 ///
524 /// Readable | Writable
525 ///
526 ///
527 /// #### `margin-left`
528 /// Margin on left side of widget.
529 ///
530 /// This property adds margin outside of the widget's normal size
531 /// request, the margin will be added in addition to the size from
532 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
533 ///
534 /// Readable | Writable
535 ///
536 ///
537 /// #### `margin-right`
538 /// Margin on right side of widget.
539 ///
540 /// This property adds margin outside of the widget's normal size
541 /// request, the margin will be added in addition to the size from
542 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
543 ///
544 /// Readable | Writable
545 ///
546 ///
547 /// #### `margin-start`
548 /// Margin on start of widget, horizontally. This property supports
549 /// left-to-right and right-to-left text directions.
550 ///
551 /// This property adds margin outside of the widget's normal size
552 /// request, the margin will be added in addition to the size from
553 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
554 ///
555 /// Readable | Writable
556 ///
557 ///
558 /// #### `margin-top`
559 /// Margin on top side of widget.
560 ///
561 /// This property adds margin outside of the widget's normal size
562 /// request, the margin will be added in addition to the size from
563 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
564 ///
565 /// Readable | Writable
566 ///
567 ///
568 /// #### `name`
569 /// Readable | Writable
570 ///
571 ///
572 /// #### `no-show-all`
573 /// Readable | Writable
574 ///
575 ///
576 /// #### `opacity`
577 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
578 /// more details about window opacity.
579 ///
580 /// Before 3.8 this was only available in GtkWindow
581 ///
582 /// Readable | Writable
583 ///
584 ///
585 /// #### `parent`
586 /// Readable | Writable
587 ///
588 ///
589 /// #### `receives-default`
590 /// Readable | Writable
591 ///
592 ///
593 /// #### `scale-factor`
594 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
595 /// more details about widget scaling.
596 ///
597 /// Readable
598 ///
599 ///
600 /// #### `sensitive`
601 /// Readable | Writable
602 ///
603 ///
604 /// #### `style`
605 /// The style of the widget, which contains information about how it will look (colors, etc).
606 ///
607 /// Readable | Writable
608 ///
609 ///
610 /// #### `tooltip-markup`
611 /// Sets the text of tooltip to be the given string, which is marked up
612 /// with the [Pango text markup language][PangoMarkupFormat].
613 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
614 ///
615 /// This is a convenience property which will take care of getting the
616 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
617 /// will automatically be set to [`true`] and there will be taken care of
618 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
619 ///
620 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
621 /// are set, the last one wins.
622 ///
623 /// Readable | Writable
624 ///
625 ///
626 /// #### `tooltip-text`
627 /// Sets the text of tooltip to be the given string.
628 ///
629 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
630 ///
631 /// This is a convenience property which will take care of getting the
632 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
633 /// will automatically be set to [`true`] and there will be taken care of
634 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
635 ///
636 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
637 /// are set, the last one wins.
638 ///
639 /// Readable | Writable
640 ///
641 ///
642 /// #### `valign`
643 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
644 ///
645 /// Readable | Writable
646 ///
647 ///
648 /// #### `vexpand`
649 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
650 ///
651 /// Readable | Writable
652 ///
653 ///
654 /// #### `vexpand-set`
655 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
656 ///
657 /// Readable | Writable
658 ///
659 ///
660 /// #### `visible`
661 /// Readable | Writable
662 ///
663 ///
664 /// #### `width-request`
665 /// Readable | Writable
666 ///
667 ///
668 /// #### `window`
669 /// The widget's window if it is realized, [`None`] otherwise.
670 ///
671 /// Readable
672 /// </details>
673 /// <details><summary><h4>CellEditable</h4></summary>
674 ///
675 ///
676 /// #### `editing-canceled`
677 /// Indicates whether editing on the cell has been canceled.
678 ///
679 /// Readable | Writable
680 /// </details>
681 ///
682 /// ## Signals
683 ///
684 ///
685 /// #### `activate`
686 /// The ::activate signal is emitted when the user hits
687 /// the Enter key.
688 ///
689 /// While this signal is used as a
690 /// [keybinding signal][GtkBindingSignal],
691 /// it is also commonly used by applications to intercept
692 /// activation of entries.
693 ///
694 /// The default bindings for this signal are all forms of the Enter key.
695 ///
696 /// Action
697 ///
698 ///
699 /// #### `backspace`
700 /// The ::backspace signal is a
701 /// [keybinding signal][GtkBindingSignal]
702 /// which gets emitted when the user asks for it.
703 ///
704 /// The default bindings for this signal are
705 /// Backspace and Shift-Backspace.
706 ///
707 /// Action
708 ///
709 ///
710 /// #### `copy-clipboard`
711 /// The ::copy-clipboard signal is a
712 /// [keybinding signal][GtkBindingSignal]
713 /// which gets emitted to copy the selection to the clipboard.
714 ///
715 /// The default bindings for this signal are
716 /// Ctrl-c and Ctrl-Insert.
717 ///
718 /// Action
719 ///
720 ///
721 /// #### `cut-clipboard`
722 /// The ::cut-clipboard signal is a
723 /// [keybinding signal][GtkBindingSignal]
724 /// which gets emitted to cut the selection to the clipboard.
725 ///
726 /// The default bindings for this signal are
727 /// Ctrl-x and Shift-Delete.
728 ///
729 /// Action
730 ///
731 ///
732 /// #### `delete-from-cursor`
733 /// The ::delete-from-cursor signal is a
734 /// [keybinding signal][GtkBindingSignal]
735 /// which gets emitted when the user initiates a text deletion.
736 ///
737 /// If the `type_` is [`DeleteType::Chars`][crate::DeleteType::Chars], GTK+ deletes the selection
738 /// if there is one, otherwise it deletes the requested number
739 /// of characters.
740 ///
741 /// The default bindings for this signal are
742 /// Delete for deleting a character and Ctrl-Delete for
743 /// deleting a word.
744 ///
745 /// Action
746 ///
747 ///
748 /// #### `icon-press`
749 /// The ::icon-press signal is emitted when an activatable icon
750 /// is clicked.
751 ///
752 ///
753 ///
754 ///
755 /// #### `icon-release`
756 /// The ::icon-release signal is emitted on the button release from a
757 /// mouse click over an activatable icon.
758 ///
759 ///
760 ///
761 ///
762 /// #### `insert-at-cursor`
763 /// The ::insert-at-cursor signal is a
764 /// [keybinding signal][GtkBindingSignal]
765 /// which gets emitted when the user initiates the insertion of a
766 /// fixed string at the cursor.
767 ///
768 /// This signal has no default bindings.
769 ///
770 /// Action
771 ///
772 ///
773 /// #### `insert-emoji`
774 /// The ::insert-emoji signal is a
775 /// [keybinding signal][GtkBindingSignal]
776 /// which gets emitted to present the Emoji chooser for the `entry`.
777 ///
778 /// The default bindings for this signal are Ctrl-. and Ctrl-;
779 ///
780 /// Action
781 ///
782 ///
783 /// #### `move-cursor`
784 /// The ::move-cursor signal is a
785 /// [keybinding signal][GtkBindingSignal]
786 /// which gets emitted when the user initiates a cursor movement.
787 /// If the cursor is not visible in `entry`, this signal causes
788 /// the viewport to be moved instead.
789 ///
790 /// Applications should not connect to it, but may emit it with
791 /// `g_signal_emit_by_name()` if they need to control the cursor
792 /// programmatically.
793 ///
794 /// The default bindings for this signal come in two variants,
795 /// the variant with the Shift modifier extends the selection,
796 /// the variant without the Shift modifer does not.
797 /// There are too many key combinations to list them all here.
798 /// - Arrow keys move by individual characters/lines
799 /// - Ctrl-arrow key combinations move by words/paragraphs
800 /// - Home/End keys move to the ends of the buffer
801 ///
802 /// Action
803 ///
804 ///
805 /// #### `paste-clipboard`
806 /// The ::paste-clipboard signal is a
807 /// [keybinding signal][GtkBindingSignal]
808 /// which gets emitted to paste the contents of the clipboard
809 /// into the text view.
810 ///
811 /// The default bindings for this signal are
812 /// Ctrl-v and Shift-Insert.
813 ///
814 /// Action
815 ///
816 ///
817 /// #### `populate-popup`
818 /// The ::populate-popup signal gets emitted before showing the
819 /// context menu of the entry.
820 ///
821 /// If you need to add items to the context menu, connect
822 /// to this signal and append your items to the `widget`, which
823 /// will be a [`Menu`][crate::Menu] in this case.
824 ///
825 /// If [`populate-all`][struct@crate::Entry#populate-all] is [`true`], this signal will
826 /// also be emitted to populate touch popups. In this case,
827 /// `widget` will be a different container, e.g. a [`Toolbar`][crate::Toolbar].
828 /// The signal handler should not make assumptions about the
829 /// type of `widget`.
830 ///
831 ///
832 ///
833 ///
834 /// #### `preedit-changed`
835 /// If an input method is used, the typed text will not immediately
836 /// be committed to the buffer. So if you are interested in the text,
837 /// connect to this signal.
838 ///
839 /// Action
840 ///
841 ///
842 /// #### `toggle-direction`
843 /// Action
844 ///
845 ///
846 /// #### `toggle-overwrite`
847 /// The ::toggle-overwrite signal is a
848 /// [keybinding signal][GtkBindingSignal]
849 /// which gets emitted to toggle the overwrite mode of the entry.
850 ///
851 /// The default bindings for this signal is Insert.
852 ///
853 /// Action
854 /// <details><summary><h4>Widget</h4></summary>
855 ///
856 ///
857 /// #### `accel-closures-changed`
858 ///
859 ///
860 ///
861 /// #### `button-press-event`
862 /// The ::button-press-event signal will be emitted when a button
863 /// (typically from a mouse) is pressed.
864 ///
865 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
866 /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
867 ///
868 /// This signal will be sent to the grab widget if there is one.
869 ///
870 ///
871 ///
872 ///
873 /// #### `button-release-event`
874 /// The ::button-release-event signal will be emitted when a button
875 /// (typically from a mouse) is released.
876 ///
877 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
878 /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
879 ///
880 /// This signal will be sent to the grab widget if there is one.
881 ///
882 ///
883 ///
884 ///
885 /// #### `can-activate-accel`
886 /// Determines whether an accelerator that activates the signal
887 /// identified by `signal_id` can currently be activated.
888 /// This signal is present to allow applications and derived
889 /// widgets to override the default [`Widget`][crate::Widget] handling
890 /// for determining whether an accelerator can be activated.
891 ///
892 ///
893 ///
894 ///
895 /// #### `child-notify`
896 /// The ::child-notify signal is emitted for each
897 /// [child property][child-properties] that has
898 /// changed on an object. The signal's detail holds the property name.
899 ///
900 /// Detailed
901 ///
902 ///
903 /// #### `composited-changed`
904 /// The ::composited-changed signal is emitted when the composited
905 /// status of `widgets` screen changes.
906 /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
907 ///
908 /// Action
909 ///
910 ///
911 /// #### `configure-event`
912 /// The ::configure-event signal will be emitted when the size, position or
913 /// stacking of the `widget`'s window has changed.
914 ///
915 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
916 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
917 /// automatically for all new windows.
918 ///
919 ///
920 ///
921 ///
922 /// #### `damage-event`
923 /// Emitted when a redirected window belonging to `widget` gets drawn into.
924 /// The region/area members of the event shows what area of the redirected
925 /// drawable was drawn into.
926 ///
927 ///
928 ///
929 ///
930 /// #### `delete-event`
931 /// The ::delete-event signal is emitted if a user requests that
932 /// a toplevel window is closed. The default handler for this signal
933 /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
934 /// this signal will cause the window to be hidden instead, so that
935 /// it can later be shown again without reconstructing it.
936 ///
937 ///
938 ///
939 ///
940 /// #### `destroy`
941 /// Signals that all holders of a reference to the widget should release
942 /// the reference that they hold. May result in finalization of the widget
943 /// if all references are released.
944 ///
945 /// This signal is not suitable for saving widget state.
946 ///
947 ///
948 ///
949 ///
950 /// #### `destroy-event`
951 /// The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
952 /// You rarely get this signal, because most widgets disconnect themselves
953 /// from their window before they destroy it, so no widget owns the
954 /// window at destroy time.
955 ///
956 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
957 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
958 /// automatically for all new windows.
959 ///
960 ///
961 ///
962 ///
963 /// #### `direction-changed`
964 /// The ::direction-changed signal is emitted when the text direction
965 /// of a widget changes.
966 ///
967 ///
968 ///
969 ///
970 /// #### `drag-begin`
971 /// The ::drag-begin signal is emitted on the drag source when a drag is
972 /// started. A typical reason to connect to this signal is to set up a
973 /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
974 ///
975 /// Note that some widgets set up a drag icon in the default handler of
976 /// this signal, so you may have to use `g_signal_connect_after()` to
977 /// override what the default handler did.
978 ///
979 ///
980 ///
981 ///
982 /// #### `drag-data-delete`
983 /// The ::drag-data-delete signal is emitted on the drag source when a drag
984 /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
985 /// handler is responsible for deleting the data that has been dropped. What
986 /// "delete" means depends on the context of the drag operation.
987 ///
988 ///
989 ///
990 ///
991 /// #### `drag-data-get`
992 /// The ::drag-data-get signal is emitted on the drag source when the drop
993 /// site requests the data which is dragged. It is the responsibility of
994 /// the signal handler to fill `data` with the data in the format which
995 /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
996 /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
997 ///
998 ///
999 ///
1000 ///
1001 /// #### `drag-data-received`
1002 /// format == 8))
1003 /// {
1004 /// GdkDragAction action;
1005 ///
1006 /// // handle data here
1007 ///
1008 /// action = gdk_drag_context_get_selected_action (context);
1009 /// if (action == GDK_ACTION_ASK)
1010 /// {
1011 /// GtkWidget *dialog;
1012 /// gint response;
1013 ///
1014 /// dialog = gtk_message_dialog_new (NULL,
1015 /// GTK_DIALOG_MODAL |
1016 /// GTK_DIALOG_DESTROY_WITH_PARENT,
1017 /// GTK_MESSAGE_INFO,
1018 /// GTK_BUTTONS_YES_NO,
1019 /// "Move the data ?\n");
1020 /// response = gtk_dialog_run (GTK_DIALOG (dialog));
1021 /// gtk_widget_destroy (dialog);
1022 ///
1023 /// if (response == GTK_RESPONSE_YES)
1024 /// action = GDK_ACTION_MOVE;
1025 /// else
1026 /// action = GDK_ACTION_COPY;
1027 /// }
1028 ///
1029 /// gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
1030 /// }
1031 /// else
1032 /// gtk_drag_finish (context, FALSE, FALSE, time);
1033 /// }
1034 /// ]|
1035 ///
1036 ///
1037 ///
1038 ///
1039 /// #### `drag-drop`
1040 /// The ::drag-drop signal is emitted on the drop site when the user drops
1041 /// the data onto the widget. The signal handler must determine whether
1042 /// the cursor position is in a drop zone or not. If it is not in a drop
1043 /// zone, it returns [`false`] and no further processing is necessary.
1044 /// Otherwise, the handler returns [`true`]. In this case, the handler must
1045 /// ensure that `gtk_drag_finish()` is called to let the source know that
1046 /// the drop is done. The call to `gtk_drag_finish()` can be done either
1047 /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
1048 /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
1049 /// or more of the supported targets.
1050 ///
1051 ///
1052 ///
1053 ///
1054 /// #### `drag-end`
1055 /// The ::drag-end signal is emitted on the drag source when a drag is
1056 /// finished. A typical reason to connect to this signal is to undo
1057 /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
1058 ///
1059 ///
1060 ///
1061 ///
1062 /// #### `drag-failed`
1063 /// The ::drag-failed signal is emitted on the drag source when a drag has
1064 /// failed. The signal handler may hook custom code to handle a failed DnD
1065 /// operation based on the type of error, it returns [`true`] is the failure has
1066 /// been already handled (not showing the default "drag operation failed"
1067 /// animation), otherwise it returns [`false`].
1068 ///
1069 ///
1070 ///
1071 ///
1072 /// #### `drag-leave`
1073 /// The ::drag-leave signal is emitted on the drop site when the cursor
1074 /// leaves the widget. A typical reason to connect to this signal is to
1075 /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
1076 /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
1077 ///
1078 ///
1079 /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
1080 /// ::drag-drop signal, for instance to allow cleaning up of a preview item
1081 /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
1082 ///
1083 ///
1084 ///
1085 ///
1086 /// #### `drag-motion`
1087 /// suggested_action,
1088 /// time);
1089 /// }
1090 /// else
1091 /// {
1092 /// // accept the drop
1093 /// }
1094 /// }
1095 /// ]|
1096 ///
1097 ///
1098 ///
1099 ///
1100 /// #### `draw`
1101 /// This signal is emitted when a widget is supposed to render itself.
1102 /// The `widget`'s top left corner must be painted at the origin of
1103 /// the passed in context and be sized to the values returned by
1104 /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
1105 /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
1106 ///
1107 /// Signal handlers connected to this signal can modify the cairo
1108 /// context passed as `cr` in any way they like and don't need to
1109 /// restore it. The signal emission takes care of calling `cairo_save()`
1110 /// before and `cairo_restore()` after invoking the handler.
1111 ///
1112 /// The signal handler will get a `cr` with a clip region already set to the
1113 /// widget's dirty region, i.e. to the area that needs repainting. Complicated
1114 /// widgets that want to avoid redrawing themselves completely can get the full
1115 /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
1116 /// get a finer-grained representation of the dirty region with
1117 /// `cairo_copy_clip_rectangle_list()`.
1118 ///
1119 ///
1120 ///
1121 ///
1122 /// #### `enter-notify-event`
1123 /// The ::enter-notify-event will be emitted when the pointer enters
1124 /// the `widget`'s window.
1125 ///
1126 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1127 /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
1128 ///
1129 /// This signal will be sent to the grab widget if there is one.
1130 ///
1131 ///
1132 ///
1133 ///
1134 /// #### `event`
1135 /// The GTK+ main loop will emit three signals for each GDK event delivered
1136 /// to a widget: one generic ::event signal, another, more specific,
1137 /// signal that matches the type of event delivered (e.g.
1138 /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
1139 /// [`event-after`][struct@crate::Widget#event-after] signal.
1140 ///
1141 ///
1142 ///
1143 ///
1144 /// #### `event-after`
1145 /// After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
1146 /// the second more specific signal, ::event-after will be emitted
1147 /// regardless of the previous two signals handlers return values.
1148 ///
1149 ///
1150 ///
1151 ///
1152 /// #### `focus`
1153 ///
1154 ///
1155 ///
1156 /// #### `focus-in-event`
1157 /// The ::focus-in-event signal will be emitted when the keyboard focus
1158 /// enters the `widget`'s window.
1159 ///
1160 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1161 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
1162 ///
1163 ///
1164 ///
1165 ///
1166 /// #### `focus-out-event`
1167 /// The ::focus-out-event signal will be emitted when the keyboard focus
1168 /// leaves the `widget`'s window.
1169 ///
1170 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1171 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
1172 ///
1173 ///
1174 ///
1175 ///
1176 /// #### `grab-broken-event`
1177 /// Emitted when a pointer or keyboard grab on a window belonging
1178 /// to `widget` gets broken.
1179 ///
1180 /// On X11, this happens when the grab window becomes unviewable
1181 /// (i.e. it or one of its ancestors is unmapped), or if the same
1182 /// application grabs the pointer or keyboard again.
1183 ///
1184 ///
1185 ///
1186 ///
1187 /// #### `grab-focus`
1188 /// Action
1189 ///
1190 ///
1191 /// #### `grab-notify`
1192 /// The ::grab-notify signal is emitted when a widget becomes
1193 /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
1194 /// another widget, or when it becomes unshadowed due to a grab
1195 /// being removed.
1196 ///
1197 /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
1198 /// grab widget in the grab stack of its window group is not
1199 /// its ancestor.
1200 ///
1201 ///
1202 ///
1203 ///
1204 /// #### `hide`
1205 /// The ::hide signal is emitted when `widget` is hidden, for example with
1206 /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
1207 ///
1208 ///
1209 ///
1210 ///
1211 /// #### `hierarchy-changed`
1212 /// The ::hierarchy-changed signal is emitted when the
1213 /// anchored state of a widget changes. A widget is
1214 /// “anchored” when its toplevel
1215 /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
1216 /// a widget changes from un-anchored to anchored or vice-versa.
1217 ///
1218 ///
1219 ///
1220 ///
1221 /// #### `key-press-event`
1222 /// The ::key-press-event signal is emitted when a key is pressed. The signal
1223 /// emission will reoccur at the key-repeat rate when the key is kept pressed.
1224 ///
1225 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1226 /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
1227 ///
1228 /// This signal will be sent to the grab widget if there is one.
1229 ///
1230 ///
1231 ///
1232 ///
1233 /// #### `key-release-event`
1234 /// The ::key-release-event signal is emitted when a key is released.
1235 ///
1236 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1237 /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
1238 ///
1239 /// This signal will be sent to the grab widget if there is one.
1240 ///
1241 ///
1242 ///
1243 ///
1244 /// #### `keynav-failed`
1245 /// Gets emitted if keyboard navigation fails.
1246 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
1247 ///
1248 ///
1249 ///
1250 ///
1251 /// #### `leave-notify-event`
1252 /// The ::leave-notify-event will be emitted when the pointer leaves
1253 /// the `widget`'s window.
1254 ///
1255 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1256 /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
1257 ///
1258 /// This signal will be sent to the grab widget if there is one.
1259 ///
1260 ///
1261 ///
1262 ///
1263 /// #### `map`
1264 /// The ::map signal is emitted when `widget` is going to be mapped, that is
1265 /// when the widget is visible (which is controlled with
1266 /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
1267 /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
1268 /// be emitted.
1269 ///
1270 /// The ::map signal can be used to determine whether a widget will be drawn,
1271 /// for instance it can resume an animation that was stopped during the
1272 /// emission of [`unmap`][struct@crate::Widget#unmap].
1273 ///
1274 ///
1275 ///
1276 ///
1277 /// #### `map-event`
1278 /// The ::map-event signal will be emitted when the `widget`'s window is
1279 /// mapped. A window is mapped when it becomes visible on the screen.
1280 ///
1281 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1282 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1283 /// automatically for all new windows.
1284 ///
1285 ///
1286 ///
1287 ///
1288 /// #### `mnemonic-activate`
1289 /// The default handler for this signal activates `widget` if `group_cycling`
1290 /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
1291 ///
1292 ///
1293 ///
1294 ///
1295 /// #### `motion-notify-event`
1296 /// The ::motion-notify-event signal is emitted when the pointer moves
1297 /// over the widget's [`gdk::Window`][crate::gdk::Window].
1298 ///
1299 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
1300 /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
1301 ///
1302 /// This signal will be sent to the grab widget if there is one.
1303 ///
1304 ///
1305 ///
1306 ///
1307 /// #### `move-focus`
1308 /// Action
1309 ///
1310 ///
1311 /// #### `parent-set`
1312 /// The ::parent-set signal is emitted when a new parent
1313 /// has been set on a widget.
1314 ///
1315 ///
1316 ///
1317 ///
1318 /// #### `popup-menu`
1319 /// This signal gets emitted whenever a widget should pop up a context
1320 /// menu. This usually happens through the standard key binding mechanism;
1321 /// by pressing a certain key while a widget is focused, the user can cause
1322 /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
1323 /// a menu with clipboard commands. See the
1324 /// [Popup Menu Migration Checklist][checklist-popup-menu]
1325 /// for an example of how to use this signal.
1326 ///
1327 /// Action
1328 ///
1329 ///
1330 /// #### `property-notify-event`
1331 /// The ::property-notify-event signal will be emitted when a property on
1332 /// the `widget`'s window has been changed or deleted.
1333 ///
1334 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1335 /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
1336 ///
1337 ///
1338 ///
1339 ///
1340 /// #### `proximity-in-event`
1341 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1342 /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
1343 ///
1344 /// This signal will be sent to the grab widget if there is one.
1345 ///
1346 ///
1347 ///
1348 ///
1349 /// #### `proximity-out-event`
1350 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1351 /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
1352 ///
1353 /// This signal will be sent to the grab widget if there is one.
1354 ///
1355 ///
1356 ///
1357 ///
1358 /// #### `query-tooltip`
1359 /// Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
1360 /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
1361 /// focus in keyboard mode.
1362 ///
1363 /// Using the given coordinates, the signal handler should determine
1364 /// whether a tooltip should be shown for `widget`. If this is the case
1365 /// [`true`] should be returned, [`false`] otherwise. Note that if
1366 /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
1367 /// should not be used.
1368 ///
1369 /// The signal handler is free to manipulate `tooltip` with the therefore
1370 /// destined function calls.
1371 ///
1372 ///
1373 ///
1374 ///
1375 /// #### `realize`
1376 /// The ::realize signal is emitted when `widget` is associated with a
1377 /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
1378 /// widget has been mapped (that is, it is going to be drawn).
1379 ///
1380 ///
1381 ///
1382 ///
1383 /// #### `screen-changed`
1384 /// The ::screen-changed signal gets emitted when the
1385 /// screen of a widget has changed.
1386 ///
1387 ///
1388 ///
1389 ///
1390 /// #### `scroll-event`
1391 /// The ::scroll-event signal is emitted when a button in the 4 to 7
1392 /// range is pressed. Wheel mice are usually configured to generate
1393 /// button press events for buttons 4 and 5 when the wheel is turned.
1394 ///
1395 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1396 /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
1397 ///
1398 /// This signal will be sent to the grab widget if there is one.
1399 ///
1400 ///
1401 ///
1402 ///
1403 /// #### `selection-clear-event`
1404 /// The ::selection-clear-event signal will be emitted when the
1405 /// the `widget`'s window has lost ownership of a selection.
1406 ///
1407 ///
1408 ///
1409 ///
1410 /// #### `selection-get`
1411 ///
1412 ///
1413 ///
1414 /// #### `selection-notify-event`
1415 ///
1416 ///
1417 ///
1418 /// #### `selection-received`
1419 ///
1420 ///
1421 ///
1422 /// #### `selection-request-event`
1423 /// The ::selection-request-event signal will be emitted when
1424 /// another client requests ownership of the selection owned by
1425 /// the `widget`'s window.
1426 ///
1427 ///
1428 ///
1429 ///
1430 /// #### `show`
1431 /// The ::show signal is emitted when `widget` is shown, for example with
1432 /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
1433 ///
1434 ///
1435 ///
1436 ///
1437 /// #### `show-help`
1438 /// Action
1439 ///
1440 ///
1441 /// #### `size-allocate`
1442 ///
1443 ///
1444 ///
1445 /// #### `state-changed`
1446 /// The ::state-changed signal is emitted when the widget state changes.
1447 /// See `gtk_widget_get_state()`.
1448 ///
1449 ///
1450 ///
1451 ///
1452 /// #### `state-flags-changed`
1453 /// The ::state-flags-changed signal is emitted when the widget state
1454 /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
1455 ///
1456 ///
1457 ///
1458 ///
1459 /// #### `style-set`
1460 /// The ::style-set signal is emitted when a new style has been set
1461 /// on a widget. Note that style-modifying functions like
1462 /// `gtk_widget_modify_base()` also cause this signal to be emitted.
1463 ///
1464 /// Note that this signal is emitted for changes to the deprecated
1465 /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
1466 /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
1467 ///
1468 ///
1469 ///
1470 ///
1471 /// #### `style-updated`
1472 /// The ::style-updated signal is a convenience signal that is emitted when the
1473 /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
1474 /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
1475 ///
1476 /// Note that style-modifying functions like `gtk_widget_override_color()` also
1477 /// cause this signal to be emitted.
1478 ///
1479 ///
1480 ///
1481 ///
1482 /// #### `touch-event`
1483 ///
1484 ///
1485 ///
1486 /// #### `unmap`
1487 /// The ::unmap signal is emitted when `widget` is going to be unmapped, which
1488 /// means that either it or any of its parents up to the toplevel widget have
1489 /// been set as hidden.
1490 ///
1491 /// As ::unmap indicates that a widget will not be shown any longer, it can be
1492 /// used to, for example, stop an animation on the widget.
1493 ///
1494 ///
1495 ///
1496 ///
1497 /// #### `unmap-event`
1498 /// The ::unmap-event signal will be emitted when the `widget`'s window is
1499 /// unmapped. A window is unmapped when it becomes invisible on the screen.
1500 ///
1501 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1502 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1503 /// automatically for all new windows.
1504 ///
1505 ///
1506 ///
1507 ///
1508 /// #### `unrealize`
1509 /// The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
1510 /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
1511 /// called or the widget has been unmapped (that is, it is going to be
1512 /// hidden).
1513 ///
1514 ///
1515 ///
1516 ///
1517 /// #### `visibility-notify-event`
1518 /// The ::visibility-notify-event will be emitted when the `widget`'s
1519 /// window is obscured or unobscured.
1520 ///
1521 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1522 /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
1523 ///
1524 ///
1525 ///
1526 ///
1527 /// #### `window-state-event`
1528 /// The ::window-state-event will be emitted when the state of the
1529 /// toplevel window associated to the `widget` changes.
1530 ///
1531 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
1532 /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
1533 /// this mask automatically for all new windows.
1534 ///
1535 ///
1536 /// </details>
1537 /// <details><summary><h4>CellEditable</h4></summary>
1538 ///
1539 ///
1540 /// #### `editing-done`
1541 /// This signal is a sign for the cell renderer to update its
1542 /// value from the `cell_editable`.
1543 ///
1544 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
1545 /// emitting this signal when they are done editing, e.g.
1546 /// [`Entry`][crate::Entry] emits this signal when the user presses Enter. Typical things to
1547 /// do in a handler for ::editing-done are to capture the edited value,
1548 /// disconnect the `cell_editable` from signals on the [`CellRenderer`][crate::CellRenderer], etc.
1549 ///
1550 /// [`CellEditableExt::editing_done()`][crate::prelude::CellEditableExt::editing_done()] is a convenience method
1551 /// for emitting [`editing-done`][struct@crate::CellEditable#editing-done].
1552 ///
1553 ///
1554 ///
1555 ///
1556 /// #### `remove-widget`
1557 /// This signal is meant to indicate that the cell is finished
1558 /// editing, and the `cell_editable` widget is being removed and may
1559 /// subsequently be destroyed.
1560 ///
1561 /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
1562 /// emitting this signal when they are done editing. It must
1563 /// be emitted after the [`editing-done`][struct@crate::CellEditable#editing-done] signal,
1564 /// to give the cell renderer a chance to update the cell's value
1565 /// before the widget is removed.
1566 ///
1567 /// [`CellEditableExt::remove_widget()`][crate::prelude::CellEditableExt::remove_widget()] is a convenience method
1568 /// for emitting [`remove-widget`][struct@crate::CellEditable#remove-widget].
1569 ///
1570 ///
1571 /// </details>
1572 /// <details><summary><h4>Editable</h4></summary>
1573 ///
1574 ///
1575 /// #### `changed`
1576 /// The ::changed signal is emitted at the end of a single
1577 /// user-visible operation on the contents of the [`Editable`][crate::Editable].
1578 ///
1579 /// E.g., a paste operation that replaces the contents of the
1580 /// selection will cause only one signal emission (even though it
1581 /// is implemented by first deleting the selection, then inserting
1582 /// the new content, and may cause multiple ::notify::text signals
1583 /// to be emitted).
1584 ///
1585 ///
1586 ///
1587 ///
1588 /// #### `delete-text`
1589 /// This signal is emitted when text is deleted from
1590 /// the widget by the user. The default handler for
1591 /// this signal will normally be responsible for deleting
1592 /// the text, so by connecting to this signal and then
1593 /// stopping the signal with `g_signal_stop_emission()`, it
1594 /// is possible to modify the range of deleted text, or
1595 /// prevent it from being deleted entirely. The `start_pos`
1596 /// and `end_pos` parameters are interpreted as for
1597 /// [`EditableExt::delete_text()`][crate::prelude::EditableExt::delete_text()].
1598 ///
1599 ///
1600 ///
1601 ///
1602 /// #### `insert-text`
1603 /// This signal is emitted when text is inserted into
1604 /// the widget by the user. The default handler for
1605 /// this signal will normally be responsible for inserting
1606 /// the text, so by connecting to this signal and then
1607 /// stopping the signal with `g_signal_stop_emission()`, it
1608 /// is possible to modify the inserted text, or prevent
1609 /// it from being inserted entirely.
1610 ///
1611 ///
1612 /// </details>
1613 ///
1614 /// # Implements
1615 ///
1616 /// [`EntryExt`][trait@crate::prelude::EntryExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`CellEditableExt`][trait@crate::prelude::CellEditableExt], [`EditableExt`][trait@crate::prelude::EditableExt], [`EntryExtManual`][trait@crate::prelude::EntryExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual], [`EditableSignals`][trait@crate::prelude::EditableSignals]
1617 #[doc(alias = "GtkEntry")]
1618 pub struct Entry(Object<ffi::GtkEntry, ffi::GtkEntryClass>) @extends Widget, @implements Buildable, CellEditable, Editable;
1619
1620 match fn {
1621 type_ => || ffi::gtk_entry_get_type(),
1622 }
1623}
1624
1625impl Entry {
1626 pub const NONE: Option<&'static Entry> = None;
1627
1628 /// Creates a new entry.
1629 ///
1630 /// # Returns
1631 ///
1632 /// a new [`Entry`][crate::Entry].
1633 #[doc(alias = "gtk_entry_new")]
1634 pub fn new() -> Entry {
1635 assert_initialized_main_thread!();
1636 unsafe { Widget::from_glib_none(ffi::gtk_entry_new()).unsafe_cast() }
1637 }
1638
1639 /// Creates a new entry with the specified text buffer.
1640 /// ## `buffer`
1641 /// The buffer to use for the new [`Entry`][crate::Entry].
1642 ///
1643 /// # Returns
1644 ///
1645 /// a new [`Entry`][crate::Entry]
1646 #[doc(alias = "gtk_entry_new_with_buffer")]
1647 #[doc(alias = "new_with_buffer")]
1648 pub fn with_buffer(buffer: &impl IsA<EntryBuffer>) -> Entry {
1649 skip_assert_initialized!();
1650 unsafe {
1651 Widget::from_glib_none(ffi::gtk_entry_new_with_buffer(
1652 buffer.as_ref().to_glib_none().0,
1653 ))
1654 .unsafe_cast()
1655 }
1656 }
1657
1658 // rustdoc-stripper-ignore-next
1659 /// Creates a new builder-pattern struct instance to construct [`Entry`] objects.
1660 ///
1661 /// This method returns an instance of [`EntryBuilder`](crate::builders::EntryBuilder) which can be used to create [`Entry`] objects.
1662 pub fn builder() -> EntryBuilder {
1663 EntryBuilder::new()
1664 }
1665}
1666
1667impl Default for Entry {
1668 fn default() -> Self {
1669 Self::new()
1670 }
1671}
1672
1673// rustdoc-stripper-ignore-next
1674/// A [builder-pattern] type to construct [`Entry`] objects.
1675///
1676/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1677#[must_use = "The builder must be built to be used"]
1678pub struct EntryBuilder {
1679 builder: glib::object::ObjectBuilder<'static, Entry>,
1680}
1681
1682impl EntryBuilder {
1683 fn new() -> Self {
1684 Self {
1685 builder: glib::object::Object::builder(),
1686 }
1687 }
1688
1689 pub fn activates_default(self, activates_default: bool) -> Self {
1690 Self {
1691 builder: self
1692 .builder
1693 .property("activates-default", activates_default),
1694 }
1695 }
1696
1697 /// A list of Pango attributes to apply to the text of the entry.
1698 ///
1699 /// This is mainly useful to change the size or weight of the text.
1700 ///
1701 /// The `PangoAttribute`'s `start_index` and `end_index` must refer to the
1702 /// [`EntryBuffer`][crate::EntryBuffer] text, i.e. without the preedit string.
1703 pub fn attributes(self, attributes: &pango::AttrList) -> Self {
1704 Self {
1705 builder: self.builder.property("attributes", attributes.clone()),
1706 }
1707 }
1708
1709 pub fn buffer(self, buffer: &impl IsA<EntryBuffer>) -> Self {
1710 Self {
1711 builder: self.builder.property("buffer", buffer.clone().upcast()),
1712 }
1713 }
1714
1715 /// Whether password entries will show a warning when Caps Lock is on.
1716 ///
1717 /// Note that the warning is shown using a secondary icon, and thus
1718 /// does not work if you are using the secondary icon position for some
1719 /// other purpose.
1720 pub fn caps_lock_warning(self, caps_lock_warning: bool) -> Self {
1721 Self {
1722 builder: self
1723 .builder
1724 .property("caps-lock-warning", caps_lock_warning),
1725 }
1726 }
1727
1728 /// The auxiliary completion object to use with the entry.
1729 pub fn completion(self, completion: &impl IsA<EntryCompletion>) -> Self {
1730 Self {
1731 builder: self
1732 .builder
1733 .property("completion", completion.clone().upcast()),
1734 }
1735 }
1736
1737 pub fn editable(self, editable: bool) -> Self {
1738 Self {
1739 builder: self.builder.property("editable", editable),
1740 }
1741 }
1742
1743 pub fn enable_emoji_completion(self, enable_emoji_completion: bool) -> Self {
1744 Self {
1745 builder: self
1746 .builder
1747 .property("enable-emoji-completion", enable_emoji_completion),
1748 }
1749 }
1750
1751 pub fn has_frame(self, has_frame: bool) -> Self {
1752 Self {
1753 builder: self.builder.property("has-frame", has_frame),
1754 }
1755 }
1756
1757 /// Which IM (input method) module should be used for this entry.
1758 /// See [`IMContext`][crate::IMContext].
1759 ///
1760 /// Setting this to a non-[`None`] value overrides the
1761 /// system-wide IM module setting. See the GtkSettings
1762 /// [`gtk-im-module`][struct@crate::Settings#gtk-im-module] property.
1763 pub fn im_module(self, im_module: impl Into<glib::GString>) -> Self {
1764 Self {
1765 builder: self.builder.property("im-module", im_module.into()),
1766 }
1767 }
1768
1769 /// Additional hints (beyond [`input-purpose`][struct@crate::Entry#input-purpose]) that
1770 /// allow input methods to fine-tune their behaviour.
1771 pub fn input_hints(self, input_hints: InputHints) -> Self {
1772 Self {
1773 builder: self.builder.property("input-hints", input_hints),
1774 }
1775 }
1776
1777 /// The purpose of this text field.
1778 ///
1779 /// This property can be used by on-screen keyboards and other input
1780 /// methods to adjust their behaviour.
1781 ///
1782 /// Note that setting the purpose to [`InputPurpose::Password`][crate::InputPurpose::Password] or
1783 /// [`InputPurpose::Pin`][crate::InputPurpose::Pin] is independent from setting
1784 /// [`visibility`][struct@crate::Entry#visibility].
1785 pub fn input_purpose(self, input_purpose: InputPurpose) -> Self {
1786 Self {
1787 builder: self.builder.property("input-purpose", input_purpose),
1788 }
1789 }
1790
1791 /// The invisible character is used when masking entry contents (in
1792 /// \"password mode\")"). When it is not explicitly set with the
1793 /// [`invisible-char`][struct@crate::Entry#invisible-char] property, GTK+ determines the character
1794 /// to use from a list of possible candidates, depending on availability
1795 /// in the current font.
1796 ///
1797 /// This style property allows the theme to prepend a character
1798 /// to the list of candidates.
1799 pub fn invisible_char(self, invisible_char: u32) -> Self {
1800 Self {
1801 builder: self.builder.property("invisible-char", invisible_char),
1802 }
1803 }
1804
1805 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
1806 pub fn invisible_char_set(self, invisible_char_set: bool) -> Self {
1807 Self {
1808 builder: self
1809 .builder
1810 .property("invisible-char-set", invisible_char_set),
1811 }
1812 }
1813
1814 pub fn max_length(self, max_length: i32) -> Self {
1815 Self {
1816 builder: self.builder.property("max-length", max_length),
1817 }
1818 }
1819
1820 /// The desired maximum width of the entry, in characters.
1821 /// If this property is set to -1, the width will be calculated
1822 /// automatically.
1823 pub fn max_width_chars(self, max_width_chars: i32) -> Self {
1824 Self {
1825 builder: self.builder.property("max-width-chars", max_width_chars),
1826 }
1827 }
1828
1829 /// If text is overwritten when typing in the [`Entry`][crate::Entry].
1830 pub fn overwrite_mode(self, overwrite_mode: bool) -> Self {
1831 Self {
1832 builder: self.builder.property("overwrite-mode", overwrite_mode),
1833 }
1834 }
1835
1836 /// The text that will be displayed in the [`Entry`][crate::Entry] when it is empty
1837 /// and unfocused.
1838 pub fn placeholder_text(self, placeholder_text: impl Into<glib::GString>) -> Self {
1839 Self {
1840 builder: self
1841 .builder
1842 .property("placeholder-text", placeholder_text.into()),
1843 }
1844 }
1845
1846 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::Entry#populate-popup]
1847 /// signal is also emitted for touch popups.
1848 pub fn populate_all(self, populate_all: bool) -> Self {
1849 Self {
1850 builder: self.builder.property("populate-all", populate_all),
1851 }
1852 }
1853
1854 /// Whether the primary icon is activatable.
1855 ///
1856 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
1857 /// signals only on sensitive, activatable icons.
1858 ///
1859 /// Sensitive, but non-activatable icons can be used for purely
1860 /// informational purposes.
1861 pub fn primary_icon_activatable(self, primary_icon_activatable: bool) -> Self {
1862 Self {
1863 builder: self
1864 .builder
1865 .property("primary-icon-activatable", primary_icon_activatable),
1866 }
1867 }
1868
1869 /// The [`gio::Icon`][crate::gio::Icon] to use for the primary icon for the entry.
1870 pub fn primary_icon_gicon(self, primary_icon_gicon: &impl IsA<gio::Icon>) -> Self {
1871 Self {
1872 builder: self
1873 .builder
1874 .property("primary-icon-gicon", primary_icon_gicon.clone().upcast()),
1875 }
1876 }
1877
1878 /// The icon name to use for the primary icon for the entry.
1879 pub fn primary_icon_name(self, primary_icon_name: impl Into<glib::GString>) -> Self {
1880 Self {
1881 builder: self
1882 .builder
1883 .property("primary-icon-name", primary_icon_name.into()),
1884 }
1885 }
1886
1887 /// A pixbuf to use as the primary icon for the entry.
1888 pub fn primary_icon_pixbuf(self, primary_icon_pixbuf: &gdk_pixbuf::Pixbuf) -> Self {
1889 Self {
1890 builder: self
1891 .builder
1892 .property("primary-icon-pixbuf", primary_icon_pixbuf.clone()),
1893 }
1894 }
1895
1896 /// Whether the primary icon is sensitive.
1897 ///
1898 /// An insensitive icon appears grayed out. GTK+ does not emit the
1899 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
1900 /// does not allow DND from insensitive icons.
1901 ///
1902 /// An icon should be set insensitive if the action that would trigger
1903 /// when clicked is currently not available.
1904 pub fn primary_icon_sensitive(self, primary_icon_sensitive: bool) -> Self {
1905 Self {
1906 builder: self
1907 .builder
1908 .property("primary-icon-sensitive", primary_icon_sensitive),
1909 }
1910 }
1911
1912 /// The contents of the tooltip on the primary icon, which is marked up
1913 /// with the [Pango text markup language][PangoMarkupFormat].
1914 ///
1915 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
1916 pub fn primary_icon_tooltip_markup(
1917 self,
1918 primary_icon_tooltip_markup: impl Into<glib::GString>,
1919 ) -> Self {
1920 Self {
1921 builder: self.builder.property(
1922 "primary-icon-tooltip-markup",
1923 primary_icon_tooltip_markup.into(),
1924 ),
1925 }
1926 }
1927
1928 /// The contents of the tooltip on the primary icon.
1929 ///
1930 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
1931 pub fn primary_icon_tooltip_text(
1932 self,
1933 primary_icon_tooltip_text: impl Into<glib::GString>,
1934 ) -> Self {
1935 Self {
1936 builder: self.builder.property(
1937 "primary-icon-tooltip-text",
1938 primary_icon_tooltip_text.into(),
1939 ),
1940 }
1941 }
1942
1943 /// The current fraction of the task that's been completed.
1944 pub fn progress_fraction(self, progress_fraction: f64) -> Self {
1945 Self {
1946 builder: self
1947 .builder
1948 .property("progress-fraction", progress_fraction),
1949 }
1950 }
1951
1952 /// The fraction of total entry width to move the progress
1953 /// bouncing block for each call to [`EntryExt::progress_pulse()`][crate::prelude::EntryExt::progress_pulse()].
1954 pub fn progress_pulse_step(self, progress_pulse_step: f64) -> Self {
1955 Self {
1956 builder: self
1957 .builder
1958 .property("progress-pulse-step", progress_pulse_step),
1959 }
1960 }
1961
1962 /// Whether the secondary icon is activatable.
1963 ///
1964 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
1965 /// signals only on sensitive, activatable icons.
1966 ///
1967 /// Sensitive, but non-activatable icons can be used for purely
1968 /// informational purposes.
1969 pub fn secondary_icon_activatable(self, secondary_icon_activatable: bool) -> Self {
1970 Self {
1971 builder: self
1972 .builder
1973 .property("secondary-icon-activatable", secondary_icon_activatable),
1974 }
1975 }
1976
1977 /// The [`gio::Icon`][crate::gio::Icon] to use for the secondary icon for the entry.
1978 pub fn secondary_icon_gicon(self, secondary_icon_gicon: &impl IsA<gio::Icon>) -> Self {
1979 Self {
1980 builder: self.builder.property(
1981 "secondary-icon-gicon",
1982 secondary_icon_gicon.clone().upcast(),
1983 ),
1984 }
1985 }
1986
1987 /// The icon name to use for the secondary icon for the entry.
1988 pub fn secondary_icon_name(self, secondary_icon_name: impl Into<glib::GString>) -> Self {
1989 Self {
1990 builder: self
1991 .builder
1992 .property("secondary-icon-name", secondary_icon_name.into()),
1993 }
1994 }
1995
1996 /// An pixbuf to use as the secondary icon for the entry.
1997 pub fn secondary_icon_pixbuf(self, secondary_icon_pixbuf: &gdk_pixbuf::Pixbuf) -> Self {
1998 Self {
1999 builder: self
2000 .builder
2001 .property("secondary-icon-pixbuf", secondary_icon_pixbuf.clone()),
2002 }
2003 }
2004
2005 /// Whether the secondary icon is sensitive.
2006 ///
2007 /// An insensitive icon appears grayed out. GTK+ does not emit the
2008 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
2009 /// does not allow DND from insensitive icons.
2010 ///
2011 /// An icon should be set insensitive if the action that would trigger
2012 /// when clicked is currently not available.
2013 pub fn secondary_icon_sensitive(self, secondary_icon_sensitive: bool) -> Self {
2014 Self {
2015 builder: self
2016 .builder
2017 .property("secondary-icon-sensitive", secondary_icon_sensitive),
2018 }
2019 }
2020
2021 /// The contents of the tooltip on the secondary icon, which is marked up
2022 /// with the [Pango text markup language][PangoMarkupFormat].
2023 ///
2024 /// Also see [`EntryExt::set_icon_tooltip_markup()`][crate::prelude::EntryExt::set_icon_tooltip_markup()].
2025 pub fn secondary_icon_tooltip_markup(
2026 self,
2027 secondary_icon_tooltip_markup: impl Into<glib::GString>,
2028 ) -> Self {
2029 Self {
2030 builder: self.builder.property(
2031 "secondary-icon-tooltip-markup",
2032 secondary_icon_tooltip_markup.into(),
2033 ),
2034 }
2035 }
2036
2037 /// The contents of the tooltip on the secondary icon.
2038 ///
2039 /// Also see [`EntryExt::set_icon_tooltip_text()`][crate::prelude::EntryExt::set_icon_tooltip_text()].
2040 pub fn secondary_icon_tooltip_text(
2041 self,
2042 secondary_icon_tooltip_text: impl Into<glib::GString>,
2043 ) -> Self {
2044 Self {
2045 builder: self.builder.property(
2046 "secondary-icon-tooltip-text",
2047 secondary_icon_tooltip_text.into(),
2048 ),
2049 }
2050 }
2051
2052 pub fn show_emoji_icon(self, show_emoji_icon: bool) -> Self {
2053 Self {
2054 builder: self.builder.property("show-emoji-icon", show_emoji_icon),
2055 }
2056 }
2057
2058 pub fn tabs(self, tabs: &pango::TabArray) -> Self {
2059 Self {
2060 builder: self.builder.property("tabs", tabs),
2061 }
2062 }
2063
2064 pub fn text(self, text: impl Into<glib::GString>) -> Self {
2065 Self {
2066 builder: self.builder.property("text", text.into()),
2067 }
2068 }
2069
2070 /// When [`true`], pasted multi-line text is truncated to the first line.
2071 pub fn truncate_multiline(self, truncate_multiline: bool) -> Self {
2072 Self {
2073 builder: self
2074 .builder
2075 .property("truncate-multiline", truncate_multiline),
2076 }
2077 }
2078
2079 pub fn visibility(self, visibility: bool) -> Self {
2080 Self {
2081 builder: self.builder.property("visibility", visibility),
2082 }
2083 }
2084
2085 pub fn width_chars(self, width_chars: i32) -> Self {
2086 Self {
2087 builder: self.builder.property("width-chars", width_chars),
2088 }
2089 }
2090
2091 /// The horizontal alignment, from 0 (left) to 1 (right).
2092 /// Reversed for RTL layouts.
2093 pub fn xalign(self, xalign: f32) -> Self {
2094 Self {
2095 builder: self.builder.property("xalign", xalign),
2096 }
2097 }
2098
2099 pub fn app_paintable(self, app_paintable: bool) -> Self {
2100 Self {
2101 builder: self.builder.property("app-paintable", app_paintable),
2102 }
2103 }
2104
2105 pub fn can_default(self, can_default: bool) -> Self {
2106 Self {
2107 builder: self.builder.property("can-default", can_default),
2108 }
2109 }
2110
2111 pub fn can_focus(self, can_focus: bool) -> Self {
2112 Self {
2113 builder: self.builder.property("can-focus", can_focus),
2114 }
2115 }
2116
2117 pub fn events(self, events: gdk::EventMask) -> Self {
2118 Self {
2119 builder: self.builder.property("events", events),
2120 }
2121 }
2122
2123 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
2124 pub fn expand(self, expand: bool) -> Self {
2125 Self {
2126 builder: self.builder.property("expand", expand),
2127 }
2128 }
2129
2130 /// Whether the widget should grab focus when it is clicked with the mouse.
2131 ///
2132 /// This property is only relevant for widgets that can take focus.
2133 ///
2134 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
2135 /// GtkComboBox) implemented this property individually.
2136 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
2137 Self {
2138 builder: self.builder.property("focus-on-click", focus_on_click),
2139 }
2140 }
2141
2142 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
2143 pub fn halign(self, halign: Align) -> Self {
2144 Self {
2145 builder: self.builder.property("halign", halign),
2146 }
2147 }
2148
2149 pub fn has_default(self, has_default: bool) -> Self {
2150 Self {
2151 builder: self.builder.property("has-default", has_default),
2152 }
2153 }
2154
2155 pub fn has_focus(self, has_focus: bool) -> Self {
2156 Self {
2157 builder: self.builder.property("has-focus", has_focus),
2158 }
2159 }
2160
2161 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
2162 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
2163 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
2164 /// whether it will provide a tooltip or not.
2165 ///
2166 /// Note that setting this property to [`true`] for the first time will change
2167 /// the event masks of the GdkWindows of this widget to include leave-notify
2168 /// and motion-notify events. This cannot and will not be undone when the
2169 /// property is set to [`false`] again.
2170 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
2171 Self {
2172 builder: self.builder.property("has-tooltip", has_tooltip),
2173 }
2174 }
2175
2176 pub fn height_request(self, height_request: i32) -> Self {
2177 Self {
2178 builder: self.builder.property("height-request", height_request),
2179 }
2180 }
2181
2182 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
2183 pub fn hexpand(self, hexpand: bool) -> Self {
2184 Self {
2185 builder: self.builder.property("hexpand", hexpand),
2186 }
2187 }
2188
2189 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
2190 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
2191 Self {
2192 builder: self.builder.property("hexpand-set", hexpand_set),
2193 }
2194 }
2195
2196 pub fn is_focus(self, is_focus: bool) -> Self {
2197 Self {
2198 builder: self.builder.property("is-focus", is_focus),
2199 }
2200 }
2201
2202 /// Sets all four sides' margin at once. If read, returns max
2203 /// margin on any side.
2204 pub fn margin(self, margin: i32) -> Self {
2205 Self {
2206 builder: self.builder.property("margin", margin),
2207 }
2208 }
2209
2210 /// Margin on bottom side of widget.
2211 ///
2212 /// This property adds margin outside of the widget's normal size
2213 /// request, the margin will be added in addition to the size from
2214 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2215 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
2216 Self {
2217 builder: self.builder.property("margin-bottom", margin_bottom),
2218 }
2219 }
2220
2221 /// Margin on end of widget, horizontally. This property supports
2222 /// left-to-right and right-to-left text directions.
2223 ///
2224 /// This property adds margin outside of the widget's normal size
2225 /// request, the margin will be added in addition to the size from
2226 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2227 pub fn margin_end(self, margin_end: i32) -> Self {
2228 Self {
2229 builder: self.builder.property("margin-end", margin_end),
2230 }
2231 }
2232
2233 /// Margin on start of widget, horizontally. This property supports
2234 /// left-to-right and right-to-left text directions.
2235 ///
2236 /// This property adds margin outside of the widget's normal size
2237 /// request, the margin will be added in addition to the size from
2238 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2239 pub fn margin_start(self, margin_start: i32) -> Self {
2240 Self {
2241 builder: self.builder.property("margin-start", margin_start),
2242 }
2243 }
2244
2245 /// Margin on top side of widget.
2246 ///
2247 /// This property adds margin outside of the widget's normal size
2248 /// request, the margin will be added in addition to the size from
2249 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2250 pub fn margin_top(self, margin_top: i32) -> Self {
2251 Self {
2252 builder: self.builder.property("margin-top", margin_top),
2253 }
2254 }
2255
2256 pub fn name(self, name: impl Into<glib::GString>) -> Self {
2257 Self {
2258 builder: self.builder.property("name", name.into()),
2259 }
2260 }
2261
2262 pub fn no_show_all(self, no_show_all: bool) -> Self {
2263 Self {
2264 builder: self.builder.property("no-show-all", no_show_all),
2265 }
2266 }
2267
2268 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
2269 /// more details about window opacity.
2270 ///
2271 /// Before 3.8 this was only available in GtkWindow
2272 pub fn opacity(self, opacity: f64) -> Self {
2273 Self {
2274 builder: self.builder.property("opacity", opacity),
2275 }
2276 }
2277
2278 pub fn parent(self, parent: &impl IsA<Container>) -> Self {
2279 Self {
2280 builder: self.builder.property("parent", parent.clone().upcast()),
2281 }
2282 }
2283
2284 pub fn receives_default(self, receives_default: bool) -> Self {
2285 Self {
2286 builder: self.builder.property("receives-default", receives_default),
2287 }
2288 }
2289
2290 pub fn sensitive(self, sensitive: bool) -> Self {
2291 Self {
2292 builder: self.builder.property("sensitive", sensitive),
2293 }
2294 }
2295
2296 /// Sets the text of tooltip to be the given string, which is marked up
2297 /// with the [Pango text markup language][PangoMarkupFormat].
2298 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
2299 ///
2300 /// This is a convenience property which will take care of getting the
2301 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
2302 /// will automatically be set to [`true`] and there will be taken care of
2303 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
2304 ///
2305 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
2306 /// are set, the last one wins.
2307 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
2308 Self {
2309 builder: self
2310 .builder
2311 .property("tooltip-markup", tooltip_markup.into()),
2312 }
2313 }
2314
2315 /// Sets the text of tooltip to be the given string.
2316 ///
2317 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
2318 ///
2319 /// This is a convenience property which will take care of getting the
2320 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
2321 /// will automatically be set to [`true`] and there will be taken care of
2322 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
2323 ///
2324 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
2325 /// are set, the last one wins.
2326 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
2327 Self {
2328 builder: self.builder.property("tooltip-text", tooltip_text.into()),
2329 }
2330 }
2331
2332 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
2333 pub fn valign(self, valign: Align) -> Self {
2334 Self {
2335 builder: self.builder.property("valign", valign),
2336 }
2337 }
2338
2339 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
2340 pub fn vexpand(self, vexpand: bool) -> Self {
2341 Self {
2342 builder: self.builder.property("vexpand", vexpand),
2343 }
2344 }
2345
2346 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
2347 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
2348 Self {
2349 builder: self.builder.property("vexpand-set", vexpand_set),
2350 }
2351 }
2352
2353 pub fn visible(self, visible: bool) -> Self {
2354 Self {
2355 builder: self.builder.property("visible", visible),
2356 }
2357 }
2358
2359 pub fn width_request(self, width_request: i32) -> Self {
2360 Self {
2361 builder: self.builder.property("width-request", width_request),
2362 }
2363 }
2364
2365 /// Indicates whether editing on the cell has been canceled.
2366 pub fn editing_canceled(self, editing_canceled: bool) -> Self {
2367 Self {
2368 builder: self.builder.property("editing-canceled", editing_canceled),
2369 }
2370 }
2371
2372 // rustdoc-stripper-ignore-next
2373 /// Build the [`Entry`].
2374 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2375 pub fn build(self) -> Entry {
2376 assert_initialized_main_thread!();
2377 self.builder.build()
2378 }
2379}
2380
2381/// Trait containing all [`struct@Entry`] methods.
2382///
2383/// # Implementors
2384///
2385/// [`Entry`][struct@crate::Entry], [`SearchEntry`][struct@crate::SearchEntry], [`SpinButton`][struct@crate::SpinButton]
2386pub trait EntryExt: IsA<Entry> + 'static {
2387 /// Retrieves the value set by [`set_activates_default()`][Self::set_activates_default()].
2388 ///
2389 /// # Returns
2390 ///
2391 /// [`true`] if the entry will activate the default widget
2392 #[doc(alias = "gtk_entry_get_activates_default")]
2393 #[doc(alias = "get_activates_default")]
2394 #[doc(alias = "activates-default")]
2395 fn activates_default(&self) -> bool {
2396 unsafe {
2397 from_glib(ffi::gtk_entry_get_activates_default(
2398 self.as_ref().to_glib_none().0,
2399 ))
2400 }
2401 }
2402
2403 /// Gets the value set by [`set_alignment()`][Self::set_alignment()].
2404 ///
2405 /// # Returns
2406 ///
2407 /// the alignment
2408 #[doc(alias = "gtk_entry_get_alignment")]
2409 #[doc(alias = "get_alignment")]
2410 fn alignment(&self) -> f32 {
2411 unsafe { ffi::gtk_entry_get_alignment(self.as_ref().to_glib_none().0) }
2412 }
2413
2414 /// Gets the attribute list that was set on the entry using
2415 /// [`set_attributes()`][Self::set_attributes()], if any.
2416 ///
2417 /// # Returns
2418 ///
2419 /// the attribute list, or [`None`]
2420 /// if none was set.
2421 #[doc(alias = "gtk_entry_get_attributes")]
2422 #[doc(alias = "get_attributes")]
2423 fn attributes(&self) -> Option<pango::AttrList> {
2424 unsafe {
2425 from_glib_none(ffi::gtk_entry_get_attributes(
2426 self.as_ref().to_glib_none().0,
2427 ))
2428 }
2429 }
2430
2431 /// Get the [`EntryBuffer`][crate::EntryBuffer] object which holds the text for
2432 /// this widget.
2433 ///
2434 /// # Returns
2435 ///
2436 /// A [`EntryBuffer`][crate::EntryBuffer] object.
2437 #[doc(alias = "gtk_entry_get_buffer")]
2438 #[doc(alias = "get_buffer")]
2439 fn buffer(&self) -> EntryBuffer {
2440 unsafe { from_glib_none(ffi::gtk_entry_get_buffer(self.as_ref().to_glib_none().0)) }
2441 }
2442
2443 /// Returns the auxiliary completion object currently in use by `self`.
2444 ///
2445 /// # Returns
2446 ///
2447 /// The auxiliary completion object currently
2448 /// in use by `self`.
2449 #[doc(alias = "gtk_entry_get_completion")]
2450 #[doc(alias = "get_completion")]
2451 fn completion(&self) -> Option<EntryCompletion> {
2452 unsafe {
2453 from_glib_none(ffi::gtk_entry_get_completion(
2454 self.as_ref().to_glib_none().0,
2455 ))
2456 }
2457 }
2458
2459 /// Returns the index of the icon which is the source of the current
2460 /// DND operation, or -1.
2461 ///
2462 /// This function is meant to be used in a [`drag-data-get`][struct@crate::Widget#drag-data-get]
2463 /// callback.
2464 ///
2465 /// # Returns
2466 ///
2467 /// index of the icon which is the source of the current
2468 /// DND operation, or -1.
2469 #[doc(alias = "gtk_entry_get_current_icon_drag_source")]
2470 #[doc(alias = "get_current_icon_drag_source")]
2471 fn current_icon_drag_source(&self) -> i32 {
2472 unsafe { ffi::gtk_entry_get_current_icon_drag_source(self.as_ref().to_glib_none().0) }
2473 }
2474
2475 /// Retrieves the horizontal cursor adjustment for the entry.
2476 /// See [`set_cursor_hadjustment()`][Self::set_cursor_hadjustment()].
2477 ///
2478 /// # Returns
2479 ///
2480 /// the horizontal cursor adjustment, or [`None`]
2481 /// if none has been set.
2482 #[doc(alias = "gtk_entry_get_cursor_hadjustment")]
2483 #[doc(alias = "get_cursor_hadjustment")]
2484 fn cursor_hadjustment(&self) -> Option<Adjustment> {
2485 unsafe {
2486 from_glib_none(ffi::gtk_entry_get_cursor_hadjustment(
2487 self.as_ref().to_glib_none().0,
2488 ))
2489 }
2490 }
2491
2492 /// Gets the value set by [`set_has_frame()`][Self::set_has_frame()].
2493 ///
2494 /// # Returns
2495 ///
2496 /// whether the entry has a beveled frame
2497 #[doc(alias = "gtk_entry_get_has_frame")]
2498 #[doc(alias = "get_has_frame")]
2499 #[doc(alias = "has-frame")]
2500 fn has_frame(&self) -> bool {
2501 unsafe { from_glib(ffi::gtk_entry_get_has_frame(self.as_ref().to_glib_none().0)) }
2502 }
2503
2504 /// Returns whether the icon is activatable.
2505 /// ## `icon_pos`
2506 /// Icon position
2507 ///
2508 /// # Returns
2509 ///
2510 /// [`true`] if the icon is activatable.
2511 #[doc(alias = "gtk_entry_get_icon_activatable")]
2512 #[doc(alias = "get_icon_activatable")]
2513 fn icon_is_activatable(&self, icon_pos: EntryIconPosition) -> bool {
2514 unsafe {
2515 from_glib(ffi::gtk_entry_get_icon_activatable(
2516 self.as_ref().to_glib_none().0,
2517 icon_pos.into_glib(),
2518 ))
2519 }
2520 }
2521
2522 /// Gets the area where entry’s icon at `icon_pos` is drawn.
2523 /// This function is useful when drawing something to the
2524 /// entry in a draw callback.
2525 ///
2526 /// If the entry is not realized or has no icon at the given position,
2527 /// `icon_area` is filled with zeros. Otherwise, `icon_area` will be filled
2528 /// with the icon’s allocation, relative to `self`’s allocation.
2529 ///
2530 /// See also [`text_area()`][Self::text_area()]
2531 /// ## `icon_pos`
2532 /// Icon position
2533 ///
2534 /// # Returns
2535 ///
2536 ///
2537 /// ## `icon_area`
2538 /// Return location for the icon’s area
2539 #[doc(alias = "gtk_entry_get_icon_area")]
2540 #[doc(alias = "get_icon_area")]
2541 fn icon_area(&self, icon_pos: EntryIconPosition) -> gdk::Rectangle {
2542 unsafe {
2543 let mut icon_area = gdk::Rectangle::uninitialized();
2544 ffi::gtk_entry_get_icon_area(
2545 self.as_ref().to_glib_none().0,
2546 icon_pos.into_glib(),
2547 icon_area.to_glib_none_mut().0,
2548 );
2549 icon_area
2550 }
2551 }
2552
2553 /// Finds the icon at the given position and return its index. The
2554 /// position’s coordinates are relative to the `self`’s top left corner.
2555 /// If `x`, `y` doesn’t lie inside an icon, -1 is returned.
2556 /// This function is intended for use in a [`query-tooltip`][struct@crate::Widget#query-tooltip]
2557 /// signal handler.
2558 /// ## `x`
2559 /// the x coordinate of the position to find
2560 /// ## `y`
2561 /// the y coordinate of the position to find
2562 ///
2563 /// # Returns
2564 ///
2565 /// the index of the icon at the given position, or -1
2566 #[doc(alias = "gtk_entry_get_icon_at_pos")]
2567 #[doc(alias = "get_icon_at_pos")]
2568 fn icon_at_pos(&self, x: i32, y: i32) -> i32 {
2569 unsafe { ffi::gtk_entry_get_icon_at_pos(self.as_ref().to_glib_none().0, x, y) }
2570 }
2571
2572 /// Retrieves the [`gio::Icon`][crate::gio::Icon] used for the icon, or [`None`] if there is
2573 /// no icon or if the icon was set by some other method (e.g., by
2574 /// stock, pixbuf, or icon name).
2575 /// ## `icon_pos`
2576 /// Icon position
2577 ///
2578 /// # Returns
2579 ///
2580 /// A [`gio::Icon`][crate::gio::Icon], or [`None`] if no icon is set
2581 /// or if the icon is not a [`gio::Icon`][crate::gio::Icon]
2582 #[doc(alias = "gtk_entry_get_icon_gicon")]
2583 #[doc(alias = "get_icon_gicon")]
2584 fn icon_gicon(&self, icon_pos: EntryIconPosition) -> Option<gio::Icon> {
2585 unsafe {
2586 from_glib_none(ffi::gtk_entry_get_icon_gicon(
2587 self.as_ref().to_glib_none().0,
2588 icon_pos.into_glib(),
2589 ))
2590 }
2591 }
2592
2593 /// Retrieves the icon name used for the icon, or [`None`] if there is
2594 /// no icon or if the icon was set by some other method (e.g., by
2595 /// pixbuf, stock or gicon).
2596 /// ## `icon_pos`
2597 /// Icon position
2598 ///
2599 /// # Returns
2600 ///
2601 /// An icon name, or [`None`] if no icon is set or if the icon
2602 /// wasn’t set from an icon name
2603 #[doc(alias = "gtk_entry_get_icon_name")]
2604 #[doc(alias = "get_icon_name")]
2605 fn icon_name(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2606 unsafe {
2607 from_glib_none(ffi::gtk_entry_get_icon_name(
2608 self.as_ref().to_glib_none().0,
2609 icon_pos.into_glib(),
2610 ))
2611 }
2612 }
2613
2614 /// Retrieves the image used for the icon.
2615 ///
2616 /// Unlike the other methods of setting and getting icon data, this
2617 /// method will work regardless of whether the icon was set using a
2618 /// [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf], a [`gio::Icon`][crate::gio::Icon], a stock item, or an icon name.
2619 /// ## `icon_pos`
2620 /// Icon position
2621 ///
2622 /// # Returns
2623 ///
2624 /// A [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf], or [`None`] if no icon is
2625 /// set for this position.
2626 #[doc(alias = "gtk_entry_get_icon_pixbuf")]
2627 #[doc(alias = "get_icon_pixbuf")]
2628 fn icon_pixbuf(&self, icon_pos: EntryIconPosition) -> Option<gdk_pixbuf::Pixbuf> {
2629 unsafe {
2630 from_glib_none(ffi::gtk_entry_get_icon_pixbuf(
2631 self.as_ref().to_glib_none().0,
2632 icon_pos.into_glib(),
2633 ))
2634 }
2635 }
2636
2637 /// Returns whether the icon appears sensitive or insensitive.
2638 /// ## `icon_pos`
2639 /// Icon position
2640 ///
2641 /// # Returns
2642 ///
2643 /// [`true`] if the icon is sensitive.
2644 #[doc(alias = "gtk_entry_get_icon_sensitive")]
2645 #[doc(alias = "get_icon_sensitive")]
2646 fn icon_is_sensitive(&self, icon_pos: EntryIconPosition) -> bool {
2647 unsafe {
2648 from_glib(ffi::gtk_entry_get_icon_sensitive(
2649 self.as_ref().to_glib_none().0,
2650 icon_pos.into_glib(),
2651 ))
2652 }
2653 }
2654
2655 /// Gets the type of representation being used by the icon
2656 /// to store image data. If the icon has no image data,
2657 /// the return value will be [`ImageType::Empty`][crate::ImageType::Empty].
2658 /// ## `icon_pos`
2659 /// Icon position
2660 ///
2661 /// # Returns
2662 ///
2663 /// image representation being used
2664 #[doc(alias = "gtk_entry_get_icon_storage_type")]
2665 #[doc(alias = "get_icon_storage_type")]
2666 fn icon_storage_type(&self, icon_pos: EntryIconPosition) -> ImageType {
2667 unsafe {
2668 from_glib(ffi::gtk_entry_get_icon_storage_type(
2669 self.as_ref().to_glib_none().0,
2670 icon_pos.into_glib(),
2671 ))
2672 }
2673 }
2674
2675 /// Gets the contents of the tooltip on the icon at the specified
2676 /// position in `self`.
2677 /// ## `icon_pos`
2678 /// the icon position
2679 ///
2680 /// # Returns
2681 ///
2682 /// the tooltip text, or [`None`]. Free the returned
2683 /// string with `g_free()` when done.
2684 #[doc(alias = "gtk_entry_get_icon_tooltip_markup")]
2685 #[doc(alias = "get_icon_tooltip_markup")]
2686 fn icon_tooltip_markup(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2687 unsafe {
2688 from_glib_full(ffi::gtk_entry_get_icon_tooltip_markup(
2689 self.as_ref().to_glib_none().0,
2690 icon_pos.into_glib(),
2691 ))
2692 }
2693 }
2694
2695 /// Gets the contents of the tooltip on the icon at the specified
2696 /// position in `self`.
2697 /// ## `icon_pos`
2698 /// the icon position
2699 ///
2700 /// # Returns
2701 ///
2702 /// the tooltip text, or [`None`]. Free the returned
2703 /// string with `g_free()` when done.
2704 #[doc(alias = "gtk_entry_get_icon_tooltip_text")]
2705 #[doc(alias = "get_icon_tooltip_text")]
2706 fn icon_tooltip_text(&self, icon_pos: EntryIconPosition) -> Option<glib::GString> {
2707 unsafe {
2708 from_glib_full(ffi::gtk_entry_get_icon_tooltip_text(
2709 self.as_ref().to_glib_none().0,
2710 icon_pos.into_glib(),
2711 ))
2712 }
2713 }
2714
2715 /// Gets the value of the [`input-hints`][struct@crate::Entry#input-hints] property.
2716 #[doc(alias = "gtk_entry_get_input_hints")]
2717 #[doc(alias = "get_input_hints")]
2718 #[doc(alias = "input-hints")]
2719 fn input_hints(&self) -> InputHints {
2720 unsafe {
2721 from_glib(ffi::gtk_entry_get_input_hints(
2722 self.as_ref().to_glib_none().0,
2723 ))
2724 }
2725 }
2726
2727 /// Gets the value of the [`input-purpose`][struct@crate::Entry#input-purpose] property.
2728 #[doc(alias = "gtk_entry_get_input_purpose")]
2729 #[doc(alias = "get_input_purpose")]
2730 #[doc(alias = "input-purpose")]
2731 fn input_purpose(&self) -> InputPurpose {
2732 unsafe {
2733 from_glib(ffi::gtk_entry_get_input_purpose(
2734 self.as_ref().to_glib_none().0,
2735 ))
2736 }
2737 }
2738
2739 /// Gets the [`pango::Layout`][crate::pango::Layout] used to display the entry.
2740 /// The layout is useful to e.g. convert text positions to
2741 /// pixel positions, in combination with [`layout_offsets()`][Self::layout_offsets()].
2742 /// The returned layout is owned by the entry and must not be
2743 /// modified or freed by the caller.
2744 ///
2745 /// Keep in mind that the layout text may contain a preedit string, so
2746 /// [`layout_index_to_text_index()`][Self::layout_index_to_text_index()] and
2747 /// [`text_index_to_layout_index()`][Self::text_index_to_layout_index()] are needed to convert byte
2748 /// indices in the layout to byte indices in the entry contents.
2749 ///
2750 /// # Returns
2751 ///
2752 /// the [`pango::Layout`][crate::pango::Layout] for this entry
2753 #[doc(alias = "gtk_entry_get_layout")]
2754 #[doc(alias = "get_layout")]
2755 fn layout(&self) -> Option<pango::Layout> {
2756 unsafe { from_glib_none(ffi::gtk_entry_get_layout(self.as_ref().to_glib_none().0)) }
2757 }
2758
2759 /// Obtains the position of the [`pango::Layout`][crate::pango::Layout] used to render text
2760 /// in the entry, in widget coordinates. Useful if you want to line
2761 /// up the text in an entry with some other text, e.g. when using the
2762 /// entry to implement editable cells in a sheet widget.
2763 ///
2764 /// Also useful to convert mouse events into coordinates inside the
2765 /// [`pango::Layout`][crate::pango::Layout], e.g. to take some action if some part of the entry text
2766 /// is clicked.
2767 ///
2768 /// Note that as the user scrolls around in the entry the offsets will
2769 /// change; you’ll need to connect to the “notify::scroll-offset”
2770 /// signal to track this. Remember when using the [`pango::Layout`][crate::pango::Layout]
2771 /// functions you need to convert to and from pixels using
2772 /// PANGO_PIXELS() or `PANGO_SCALE`.
2773 ///
2774 /// Keep in mind that the layout text may contain a preedit string, so
2775 /// [`layout_index_to_text_index()`][Self::layout_index_to_text_index()] and
2776 /// [`text_index_to_layout_index()`][Self::text_index_to_layout_index()] are needed to convert byte
2777 /// indices in the layout to byte indices in the entry contents.
2778 ///
2779 /// # Returns
2780 ///
2781 ///
2782 /// ## `x`
2783 /// location to store X offset of layout, or [`None`]
2784 ///
2785 /// ## `y`
2786 /// location to store Y offset of layout, or [`None`]
2787 #[doc(alias = "gtk_entry_get_layout_offsets")]
2788 #[doc(alias = "get_layout_offsets")]
2789 fn layout_offsets(&self) -> (i32, i32) {
2790 unsafe {
2791 let mut x = std::mem::MaybeUninit::uninit();
2792 let mut y = std::mem::MaybeUninit::uninit();
2793 ffi::gtk_entry_get_layout_offsets(
2794 self.as_ref().to_glib_none().0,
2795 x.as_mut_ptr(),
2796 y.as_mut_ptr(),
2797 );
2798 (x.assume_init(), y.assume_init())
2799 }
2800 }
2801
2802 /// Retrieves the maximum allowed length of the text in
2803 /// `self`. See [`set_max_length()`][Self::set_max_length()].
2804 ///
2805 /// This is equivalent to getting `self`'s [`EntryBuffer`][crate::EntryBuffer] and
2806 /// calling [`EntryBufferExtManual::max_length()`][crate::prelude::EntryBufferExtManual::max_length()] on it.
2807 ///
2808 /// # Returns
2809 ///
2810 /// the maximum allowed number of characters
2811 /// in [`Entry`][crate::Entry], or 0 if there is no maximum.
2812 #[doc(alias = "gtk_entry_get_max_length")]
2813 #[doc(alias = "get_max_length")]
2814 #[doc(alias = "max-length")]
2815 fn max_length(&self) -> i32 {
2816 unsafe { ffi::gtk_entry_get_max_length(self.as_ref().to_glib_none().0) }
2817 }
2818
2819 /// Retrieves the desired maximum width of `self`, in characters.
2820 /// See [`set_max_width_chars()`][Self::set_max_width_chars()].
2821 ///
2822 /// # Returns
2823 ///
2824 /// the maximum width of the entry, in characters
2825 #[doc(alias = "gtk_entry_get_max_width_chars")]
2826 #[doc(alias = "get_max_width_chars")]
2827 #[doc(alias = "max-width-chars")]
2828 fn max_width_chars(&self) -> i32 {
2829 unsafe { ffi::gtk_entry_get_max_width_chars(self.as_ref().to_glib_none().0) }
2830 }
2831
2832 /// Gets the value set by [`set_overwrite_mode()`][Self::set_overwrite_mode()].
2833 ///
2834 /// # Returns
2835 ///
2836 /// whether the text is overwritten when typing.
2837 #[doc(alias = "gtk_entry_get_overwrite_mode")]
2838 #[doc(alias = "get_overwrite_mode")]
2839 #[doc(alias = "overwrite-mode")]
2840 fn is_overwrite_mode(&self) -> bool {
2841 unsafe {
2842 from_glib(ffi::gtk_entry_get_overwrite_mode(
2843 self.as_ref().to_glib_none().0,
2844 ))
2845 }
2846 }
2847
2848 /// Retrieves the text that will be displayed when `self` is empty and unfocused
2849 ///
2850 /// # Returns
2851 ///
2852 /// a pointer to the placeholder text as a string. This string points to internally allocated
2853 /// storage in the widget and must not be freed, modified or stored.
2854 #[doc(alias = "gtk_entry_get_placeholder_text")]
2855 #[doc(alias = "get_placeholder_text")]
2856 #[doc(alias = "placeholder-text")]
2857 fn placeholder_text(&self) -> Option<glib::GString> {
2858 unsafe {
2859 from_glib_none(ffi::gtk_entry_get_placeholder_text(
2860 self.as_ref().to_glib_none().0,
2861 ))
2862 }
2863 }
2864
2865 /// Returns the current fraction of the task that’s been completed.
2866 /// See [`set_progress_fraction()`][Self::set_progress_fraction()].
2867 ///
2868 /// # Returns
2869 ///
2870 /// a fraction from 0.0 to 1.0
2871 #[doc(alias = "gtk_entry_get_progress_fraction")]
2872 #[doc(alias = "get_progress_fraction")]
2873 #[doc(alias = "progress-fraction")]
2874 fn progress_fraction(&self) -> f64 {
2875 unsafe { ffi::gtk_entry_get_progress_fraction(self.as_ref().to_glib_none().0) }
2876 }
2877
2878 /// Retrieves the pulse step set with [`set_progress_pulse_step()`][Self::set_progress_pulse_step()].
2879 ///
2880 /// # Returns
2881 ///
2882 /// a fraction from 0.0 to 1.0
2883 #[doc(alias = "gtk_entry_get_progress_pulse_step")]
2884 #[doc(alias = "get_progress_pulse_step")]
2885 #[doc(alias = "progress-pulse-step")]
2886 fn progress_pulse_step(&self) -> f64 {
2887 unsafe { ffi::gtk_entry_get_progress_pulse_step(self.as_ref().to_glib_none().0) }
2888 }
2889
2890 /// Gets the tabstops that were set on the entry using [`set_tabs()`][Self::set_tabs()], if
2891 /// any.
2892 ///
2893 /// # Returns
2894 ///
2895 /// the tabstops, or [`None`] if none was set.
2896 #[doc(alias = "gtk_entry_get_tabs")]
2897 #[doc(alias = "get_tabs")]
2898 fn tabs(&self) -> Option<pango::TabArray> {
2899 unsafe { from_glib_none(ffi::gtk_entry_get_tabs(self.as_ref().to_glib_none().0)) }
2900 }
2901
2902 /// Retrieves the contents of the entry widget.
2903 /// See also [`EditableExt::chars()`][crate::prelude::EditableExt::chars()].
2904 ///
2905 /// This is equivalent to getting `self`'s [`EntryBuffer`][crate::EntryBuffer] and calling
2906 /// [`EntryBufferExtManual::text()`][crate::prelude::EntryBufferExtManual::text()] on it.
2907 ///
2908 /// # Returns
2909 ///
2910 /// a pointer to the contents of the widget as a
2911 /// string. This string points to internally allocated
2912 /// storage in the widget and must not be freed, modified or
2913 /// stored.
2914 #[doc(alias = "gtk_entry_get_text")]
2915 #[doc(alias = "get_text")]
2916 fn text(&self) -> glib::GString {
2917 unsafe { from_glib_none(ffi::gtk_entry_get_text(self.as_ref().to_glib_none().0)) }
2918 }
2919
2920 /// Gets the area where the entry’s text is drawn. This function is
2921 /// useful when drawing something to the entry in a draw callback.
2922 ///
2923 /// If the entry is not realized, `text_area` is filled with zeros.
2924 ///
2925 /// See also [`icon_area()`][Self::icon_area()].
2926 ///
2927 /// # Returns
2928 ///
2929 ///
2930 /// ## `text_area`
2931 /// Return location for the text area.
2932 #[doc(alias = "gtk_entry_get_text_area")]
2933 #[doc(alias = "get_text_area")]
2934 fn text_area(&self) -> gdk::Rectangle {
2935 unsafe {
2936 let mut text_area = gdk::Rectangle::uninitialized();
2937 ffi::gtk_entry_get_text_area(
2938 self.as_ref().to_glib_none().0,
2939 text_area.to_glib_none_mut().0,
2940 );
2941 text_area
2942 }
2943 }
2944
2945 /// Retrieves the current length of the text in
2946 /// `self`.
2947 ///
2948 /// This is equivalent to getting `self`'s [`EntryBuffer`][crate::EntryBuffer] and
2949 /// calling [`EntryBufferExtManual::length()`][crate::prelude::EntryBufferExtManual::length()] on it.
2950 ///
2951 /// # Returns
2952 ///
2953 /// the current number of characters
2954 /// in [`Entry`][crate::Entry], or 0 if there are none.
2955 #[doc(alias = "gtk_entry_get_text_length")]
2956 #[doc(alias = "get_text_length")]
2957 #[doc(alias = "text-length")]
2958 fn text_length(&self) -> u16 {
2959 unsafe { ffi::gtk_entry_get_text_length(self.as_ref().to_glib_none().0) }
2960 }
2961
2962 /// Retrieves whether the text in `self` is visible. See
2963 /// [`set_visibility()`][Self::set_visibility()].
2964 ///
2965 /// # Returns
2966 ///
2967 /// [`true`] if the text is currently visible
2968 #[doc(alias = "gtk_entry_get_visibility")]
2969 #[doc(alias = "get_visibility")]
2970 #[doc(alias = "visibility")]
2971 fn is_visible(&self) -> bool {
2972 unsafe {
2973 from_glib(ffi::gtk_entry_get_visibility(
2974 self.as_ref().to_glib_none().0,
2975 ))
2976 }
2977 }
2978
2979 /// Gets the value set by [`set_width_chars()`][Self::set_width_chars()].
2980 ///
2981 /// # Returns
2982 ///
2983 /// number of chars to request space for, or negative if unset
2984 #[doc(alias = "gtk_entry_get_width_chars")]
2985 #[doc(alias = "get_width_chars")]
2986 #[doc(alias = "width-chars")]
2987 fn width_chars(&self) -> i32 {
2988 unsafe { ffi::gtk_entry_get_width_chars(self.as_ref().to_glib_none().0) }
2989 }
2990
2991 /// Causes `self` to have keyboard focus.
2992 ///
2993 /// It behaves like [`WidgetExt::grab_focus()`][crate::prelude::WidgetExt::grab_focus()],
2994 /// except that it doesn't select the contents of the entry.
2995 /// You only want to call this on some special entries
2996 /// which the user usually doesn't want to replace all text in,
2997 /// such as search-as-you-type entries.
2998 #[doc(alias = "gtk_entry_grab_focus_without_selecting")]
2999 fn grab_focus_without_selecting(&self) {
3000 unsafe {
3001 ffi::gtk_entry_grab_focus_without_selecting(self.as_ref().to_glib_none().0);
3002 }
3003 }
3004
3005 /// Allow the [`Entry`][crate::Entry] input method to internally handle key press
3006 /// and release events. If this function returns [`true`], then no further
3007 /// processing should be done for this key event. See
3008 /// [`IMContextExt::filter_keypress()`][crate::prelude::IMContextExt::filter_keypress()].
3009 ///
3010 /// Note that you are expected to call this function from your handler
3011 /// when overriding key event handling. This is needed in the case when
3012 /// you need to insert your own key handling between the input method
3013 /// and the default key event handling of the [`Entry`][crate::Entry].
3014 /// See [`TextViewExt::reset_im_context()`][crate::prelude::TextViewExt::reset_im_context()] for an example of use.
3015 /// ## `event`
3016 /// the key event
3017 ///
3018 /// # Returns
3019 ///
3020 /// [`true`] if the input method handled the key event.
3021 #[doc(alias = "gtk_entry_im_context_filter_keypress")]
3022 fn im_context_filter_keypress(&self, event: &gdk::EventKey) -> bool {
3023 unsafe {
3024 from_glib(ffi::gtk_entry_im_context_filter_keypress(
3025 self.as_ref().to_glib_none().0,
3026 mut_override(event.to_glib_none().0),
3027 ))
3028 }
3029 }
3030
3031 /// Converts from a position in the entry’s [`pango::Layout`][crate::pango::Layout] (returned by
3032 /// [`layout()`][Self::layout()]) to a position in the entry contents
3033 /// (returned by [`text()`][Self::text()]).
3034 /// ## `layout_index`
3035 /// byte index into the entry layout text
3036 ///
3037 /// # Returns
3038 ///
3039 /// byte index into the entry contents
3040 #[doc(alias = "gtk_entry_layout_index_to_text_index")]
3041 fn layout_index_to_text_index(&self, layout_index: i32) -> i32 {
3042 unsafe {
3043 ffi::gtk_entry_layout_index_to_text_index(self.as_ref().to_glib_none().0, layout_index)
3044 }
3045 }
3046
3047 /// Indicates that some progress is made, but you don’t know how much.
3048 /// Causes the entry’s progress indicator to enter “activity mode,”
3049 /// where a block bounces back and forth. Each call to
3050 /// [`progress_pulse()`][Self::progress_pulse()] causes the block to move by a little bit
3051 /// (the amount of movement per pulse is determined by
3052 /// [`set_progress_pulse_step()`][Self::set_progress_pulse_step()]).
3053 #[doc(alias = "gtk_entry_progress_pulse")]
3054 fn progress_pulse(&self) {
3055 unsafe {
3056 ffi::gtk_entry_progress_pulse(self.as_ref().to_glib_none().0);
3057 }
3058 }
3059
3060 /// Reset the input method context of the entry if needed.
3061 ///
3062 /// This can be necessary in the case where modifying the buffer
3063 /// would confuse on-going input method behavior.
3064 #[doc(alias = "gtk_entry_reset_im_context")]
3065 fn reset_im_context(&self) {
3066 unsafe {
3067 ffi::gtk_entry_reset_im_context(self.as_ref().to_glib_none().0);
3068 }
3069 }
3070
3071 /// If `setting` is [`true`], pressing Enter in the `self` will activate the default
3072 /// widget for the window containing the entry. This usually means that
3073 /// the dialog box containing the entry will be closed, since the default
3074 /// widget is usually one of the dialog buttons.
3075 ///
3076 /// (For experts: if `setting` is [`true`], the entry calls
3077 /// [`GtkWindowExt::activate_default()`][crate::prelude::GtkWindowExt::activate_default()] on the window containing the entry, in
3078 /// the default handler for the [`activate`][struct@crate::Entry#activate] signal.)
3079 /// ## `setting`
3080 /// [`true`] to activate window’s default widget on Enter keypress
3081 #[doc(alias = "gtk_entry_set_activates_default")]
3082 #[doc(alias = "activates-default")]
3083 fn set_activates_default(&self, setting: bool) {
3084 unsafe {
3085 ffi::gtk_entry_set_activates_default(
3086 self.as_ref().to_glib_none().0,
3087 setting.into_glib(),
3088 );
3089 }
3090 }
3091
3092 /// Sets the alignment for the contents of the entry. This controls
3093 /// the horizontal positioning of the contents when the displayed
3094 /// text is shorter than the width of the entry.
3095 /// ## `xalign`
3096 /// The horizontal alignment, from 0 (left) to 1 (right).
3097 /// Reversed for RTL layouts
3098 #[doc(alias = "gtk_entry_set_alignment")]
3099 fn set_alignment(&self, xalign: f32) {
3100 unsafe {
3101 ffi::gtk_entry_set_alignment(self.as_ref().to_glib_none().0, xalign);
3102 }
3103 }
3104
3105 /// Sets a [`pango::AttrList`][crate::pango::AttrList]; the attributes in the list are applied to the
3106 /// entry text.
3107 /// ## `attrs`
3108 /// a [`pango::AttrList`][crate::pango::AttrList]
3109 #[doc(alias = "gtk_entry_set_attributes")]
3110 #[doc(alias = "attributes")]
3111 fn set_attributes(&self, attrs: &pango::AttrList) {
3112 unsafe {
3113 ffi::gtk_entry_set_attributes(self.as_ref().to_glib_none().0, attrs.to_glib_none().0);
3114 }
3115 }
3116
3117 /// Set the [`EntryBuffer`][crate::EntryBuffer] object which holds the text for
3118 /// this widget.
3119 /// ## `buffer`
3120 /// a [`EntryBuffer`][crate::EntryBuffer]
3121 #[doc(alias = "gtk_entry_set_buffer")]
3122 #[doc(alias = "buffer")]
3123 fn set_buffer(&self, buffer: &impl IsA<EntryBuffer>) {
3124 unsafe {
3125 ffi::gtk_entry_set_buffer(
3126 self.as_ref().to_glib_none().0,
3127 buffer.as_ref().to_glib_none().0,
3128 );
3129 }
3130 }
3131
3132 /// Sets `completion` to be the auxiliary completion object to use with `self`.
3133 /// All further configuration of the completion mechanism is done on
3134 /// `completion` using the [`EntryCompletion`][crate::EntryCompletion] API. Completion is disabled if
3135 /// `completion` is set to [`None`].
3136 /// ## `completion`
3137 /// The [`EntryCompletion`][crate::EntryCompletion] or [`None`]
3138 #[doc(alias = "gtk_entry_set_completion")]
3139 #[doc(alias = "completion")]
3140 fn set_completion(&self, completion: Option<&impl IsA<EntryCompletion>>) {
3141 unsafe {
3142 ffi::gtk_entry_set_completion(
3143 self.as_ref().to_glib_none().0,
3144 completion.map(|p| p.as_ref()).to_glib_none().0,
3145 );
3146 }
3147 }
3148
3149 /// Hooks up an adjustment to the cursor position in an entry, so that when
3150 /// the cursor is moved, the adjustment is scrolled to show that position.
3151 /// See [`ScrolledWindowExt::hadjustment()`][crate::prelude::ScrolledWindowExt::hadjustment()] for a typical way of obtaining
3152 /// the adjustment.
3153 ///
3154 /// The adjustment has to be in pixel units and in the same coordinate system
3155 /// as the entry.
3156 /// ## `adjustment`
3157 /// an adjustment which should be adjusted when the cursor
3158 /// is moved, or [`None`]
3159 #[doc(alias = "gtk_entry_set_cursor_hadjustment")]
3160 fn set_cursor_hadjustment(&self, adjustment: Option<&impl IsA<Adjustment>>) {
3161 unsafe {
3162 ffi::gtk_entry_set_cursor_hadjustment(
3163 self.as_ref().to_glib_none().0,
3164 adjustment.map(|p| p.as_ref()).to_glib_none().0,
3165 );
3166 }
3167 }
3168
3169 /// Sets whether the entry has a beveled frame around it.
3170 /// ## `setting`
3171 /// new value
3172 #[doc(alias = "gtk_entry_set_has_frame")]
3173 #[doc(alias = "has-frame")]
3174 fn set_has_frame(&self, setting: bool) {
3175 unsafe {
3176 ffi::gtk_entry_set_has_frame(self.as_ref().to_glib_none().0, setting.into_glib());
3177 }
3178 }
3179
3180 /// Sets whether the icon is activatable.
3181 /// ## `icon_pos`
3182 /// Icon position
3183 /// ## `activatable`
3184 /// [`true`] if the icon should be activatable
3185 #[doc(alias = "gtk_entry_set_icon_activatable")]
3186 fn set_icon_activatable(&self, icon_pos: EntryIconPosition, activatable: bool) {
3187 unsafe {
3188 ffi::gtk_entry_set_icon_activatable(
3189 self.as_ref().to_glib_none().0,
3190 icon_pos.into_glib(),
3191 activatable.into_glib(),
3192 );
3193 }
3194 }
3195
3196 /// Sets up the icon at the given position so that GTK+ will start a drag
3197 /// operation when the user clicks and drags the icon.
3198 ///
3199 /// To handle the drag operation, you need to connect to the usual
3200 /// [`drag-data-get`][struct@crate::Widget#drag-data-get] (or possibly [`drag-data-delete`][struct@crate::Widget#drag-data-delete])
3201 /// signal, and use [`current_icon_drag_source()`][Self::current_icon_drag_source()] in
3202 /// your signal handler to find out if the drag was started from
3203 /// an icon.
3204 ///
3205 /// By default, GTK+ uses the icon as the drag icon. You can use the
3206 /// [`drag-begin`][struct@crate::Widget#drag-begin] signal to set a different icon. Note that you
3207 /// have to use `g_signal_connect_after()` to ensure that your signal handler
3208 /// gets executed after the default handler.
3209 /// ## `icon_pos`
3210 /// icon position
3211 /// ## `target_list`
3212 /// the targets (data formats) in which the data can be provided
3213 /// ## `actions`
3214 /// a bitmask of the allowed drag actions
3215 #[doc(alias = "gtk_entry_set_icon_drag_source")]
3216 fn set_icon_drag_source(
3217 &self,
3218 icon_pos: EntryIconPosition,
3219 target_list: &TargetList,
3220 actions: gdk::DragAction,
3221 ) {
3222 unsafe {
3223 ffi::gtk_entry_set_icon_drag_source(
3224 self.as_ref().to_glib_none().0,
3225 icon_pos.into_glib(),
3226 target_list.to_glib_none().0,
3227 actions.into_glib(),
3228 );
3229 }
3230 }
3231
3232 /// Sets the icon shown in the entry at the specified position
3233 /// from the current icon theme.
3234 /// If the icon isn’t known, a “broken image” icon will be displayed
3235 /// instead.
3236 ///
3237 /// If `icon` is [`None`], no icon will be shown in the specified position.
3238 /// ## `icon_pos`
3239 /// The position at which to set the icon
3240 /// ## `icon`
3241 /// The icon to set, or [`None`]
3242 #[doc(alias = "gtk_entry_set_icon_from_gicon")]
3243 fn set_icon_from_gicon(&self, icon_pos: EntryIconPosition, icon: Option<&impl IsA<gio::Icon>>) {
3244 unsafe {
3245 ffi::gtk_entry_set_icon_from_gicon(
3246 self.as_ref().to_glib_none().0,
3247 icon_pos.into_glib(),
3248 icon.map(|p| p.as_ref()).to_glib_none().0,
3249 );
3250 }
3251 }
3252
3253 /// Sets the icon shown in the entry at the specified position
3254 /// from the current icon theme.
3255 ///
3256 /// If the icon name isn’t known, a “broken image” icon will be displayed
3257 /// instead.
3258 ///
3259 /// If `icon_name` is [`None`], no icon will be shown in the specified position.
3260 /// ## `icon_pos`
3261 /// The position at which to set the icon
3262 /// ## `icon_name`
3263 /// An icon name, or [`None`]
3264 #[doc(alias = "gtk_entry_set_icon_from_icon_name")]
3265 fn set_icon_from_icon_name(&self, icon_pos: EntryIconPosition, icon_name: Option<&str>) {
3266 unsafe {
3267 ffi::gtk_entry_set_icon_from_icon_name(
3268 self.as_ref().to_glib_none().0,
3269 icon_pos.into_glib(),
3270 icon_name.to_glib_none().0,
3271 );
3272 }
3273 }
3274
3275 /// Sets the icon shown in the specified position using a pixbuf.
3276 ///
3277 /// If `pixbuf` is [`None`], no icon will be shown in the specified position.
3278 /// ## `icon_pos`
3279 /// Icon position
3280 /// ## `pixbuf`
3281 /// A [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf], or [`None`]
3282 #[doc(alias = "gtk_entry_set_icon_from_pixbuf")]
3283 fn set_icon_from_pixbuf(
3284 &self,
3285 icon_pos: EntryIconPosition,
3286 pixbuf: Option<&gdk_pixbuf::Pixbuf>,
3287 ) {
3288 unsafe {
3289 ffi::gtk_entry_set_icon_from_pixbuf(
3290 self.as_ref().to_glib_none().0,
3291 icon_pos.into_glib(),
3292 pixbuf.to_glib_none().0,
3293 );
3294 }
3295 }
3296
3297 /// Sets the sensitivity for the specified icon.
3298 /// ## `icon_pos`
3299 /// Icon position
3300 /// ## `sensitive`
3301 /// Specifies whether the icon should appear
3302 /// sensitive or insensitive
3303 #[doc(alias = "gtk_entry_set_icon_sensitive")]
3304 fn set_icon_sensitive(&self, icon_pos: EntryIconPosition, sensitive: bool) {
3305 unsafe {
3306 ffi::gtk_entry_set_icon_sensitive(
3307 self.as_ref().to_glib_none().0,
3308 icon_pos.into_glib(),
3309 sensitive.into_glib(),
3310 );
3311 }
3312 }
3313
3314 /// Sets `tooltip` as the contents of the tooltip for the icon at
3315 /// the specified position. `tooltip` is assumed to be marked up with
3316 /// the [Pango text markup language][PangoMarkupFormat].
3317 ///
3318 /// Use [`None`] for `tooltip` to remove an existing tooltip.
3319 ///
3320 /// See also [`WidgetExt::set_tooltip_markup()`][crate::prelude::WidgetExt::set_tooltip_markup()] and
3321 /// [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3322 /// ## `icon_pos`
3323 /// the icon position
3324 /// ## `tooltip`
3325 /// the contents of the tooltip for the icon, or [`None`]
3326 #[doc(alias = "gtk_entry_set_icon_tooltip_markup")]
3327 fn set_icon_tooltip_markup(&self, icon_pos: EntryIconPosition, tooltip: Option<&str>) {
3328 unsafe {
3329 ffi::gtk_entry_set_icon_tooltip_markup(
3330 self.as_ref().to_glib_none().0,
3331 icon_pos.into_glib(),
3332 tooltip.to_glib_none().0,
3333 );
3334 }
3335 }
3336
3337 /// Sets `tooltip` as the contents of the tooltip for the icon
3338 /// at the specified position.
3339 ///
3340 /// Use [`None`] for `tooltip` to remove an existing tooltip.
3341 ///
3342 /// See also [`WidgetExt::set_tooltip_text()`][crate::prelude::WidgetExt::set_tooltip_text()] and
3343 /// [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3344 ///
3345 /// If you unset the widget tooltip via [`WidgetExt::set_tooltip_text()`][crate::prelude::WidgetExt::set_tooltip_text()] or
3346 /// [`WidgetExt::set_tooltip_markup()`][crate::prelude::WidgetExt::set_tooltip_markup()], this sets GtkWidget:has-tooltip to [`false`],
3347 /// which suppresses icon tooltips too. You can resolve this by then calling
3348 /// [`WidgetExt::set_has_tooltip()`][crate::prelude::WidgetExt::set_has_tooltip()] to set GtkWidget:has-tooltip back to [`true`], or
3349 /// setting at least one non-empty tooltip on any icon achieves the same result.
3350 /// ## `icon_pos`
3351 /// the icon position
3352 /// ## `tooltip`
3353 /// the contents of the tooltip for the icon, or [`None`]
3354 #[doc(alias = "gtk_entry_set_icon_tooltip_text")]
3355 fn set_icon_tooltip_text(&self, icon_pos: EntryIconPosition, tooltip: Option<&str>) {
3356 unsafe {
3357 ffi::gtk_entry_set_icon_tooltip_text(
3358 self.as_ref().to_glib_none().0,
3359 icon_pos.into_glib(),
3360 tooltip.to_glib_none().0,
3361 );
3362 }
3363 }
3364
3365 /// Sets the [`input-hints`][struct@crate::Entry#input-hints] property, which
3366 /// allows input methods to fine-tune their behaviour.
3367 /// ## `hints`
3368 /// the hints
3369 #[doc(alias = "gtk_entry_set_input_hints")]
3370 #[doc(alias = "input-hints")]
3371 fn set_input_hints(&self, hints: InputHints) {
3372 unsafe {
3373 ffi::gtk_entry_set_input_hints(self.as_ref().to_glib_none().0, hints.into_glib());
3374 }
3375 }
3376
3377 /// Sets the [`input-purpose`][struct@crate::Entry#input-purpose] property which
3378 /// can be used by on-screen keyboards and other input
3379 /// methods to adjust their behaviour.
3380 /// ## `purpose`
3381 /// the purpose
3382 #[doc(alias = "gtk_entry_set_input_purpose")]
3383 #[doc(alias = "input-purpose")]
3384 fn set_input_purpose(&self, purpose: InputPurpose) {
3385 unsafe {
3386 ffi::gtk_entry_set_input_purpose(self.as_ref().to_glib_none().0, purpose.into_glib());
3387 }
3388 }
3389
3390 /// Sets the character to use in place of the actual text when
3391 /// [`set_visibility()`][Self::set_visibility()] has been called to set text visibility
3392 /// to [`false`]. i.e. this is the character used in “password mode” to
3393 /// show the user how many characters have been typed. By default, GTK+
3394 /// picks the best invisible char available in the current font. If you
3395 /// set the invisible char to 0, then the user will get no feedback
3396 /// at all; there will be no text on the screen as they type.
3397 /// ## `ch`
3398 /// a Unicode character
3399 #[doc(alias = "gtk_entry_set_invisible_char")]
3400 #[doc(alias = "invisible-char")]
3401 fn set_invisible_char(&self, ch: Option<char>) {
3402 unsafe {
3403 ffi::gtk_entry_set_invisible_char(self.as_ref().to_glib_none().0, ch.into_glib());
3404 }
3405 }
3406
3407 /// Sets the maximum allowed length of the contents of the widget. If
3408 /// the current contents are longer than the given length, then they
3409 /// will be truncated to fit.
3410 ///
3411 /// This is equivalent to getting `self`'s [`EntryBuffer`][crate::EntryBuffer] and
3412 /// calling [`EntryBufferExtManual::set_max_length()`][crate::prelude::EntryBufferExtManual::set_max_length()] on it.
3413 /// ]|
3414 /// ## `max`
3415 /// the maximum length of the entry, or 0 for no maximum.
3416 /// (other than the maximum length of entries.) The value passed in will
3417 /// be clamped to the range 0-65536.
3418 #[doc(alias = "gtk_entry_set_max_length")]
3419 #[doc(alias = "max-length")]
3420 fn set_max_length(&self, max: i32) {
3421 unsafe {
3422 ffi::gtk_entry_set_max_length(self.as_ref().to_glib_none().0, max);
3423 }
3424 }
3425
3426 /// Sets the desired maximum width in characters of `self`.
3427 /// ## `n_chars`
3428 /// the new desired maximum width, in characters
3429 #[doc(alias = "gtk_entry_set_max_width_chars")]
3430 #[doc(alias = "max-width-chars")]
3431 fn set_max_width_chars(&self, n_chars: i32) {
3432 unsafe {
3433 ffi::gtk_entry_set_max_width_chars(self.as_ref().to_glib_none().0, n_chars);
3434 }
3435 }
3436
3437 /// Sets whether the text is overwritten when typing in the [`Entry`][crate::Entry].
3438 /// ## `overwrite`
3439 /// new value
3440 #[doc(alias = "gtk_entry_set_overwrite_mode")]
3441 #[doc(alias = "overwrite-mode")]
3442 fn set_overwrite_mode(&self, overwrite: bool) {
3443 unsafe {
3444 ffi::gtk_entry_set_overwrite_mode(
3445 self.as_ref().to_glib_none().0,
3446 overwrite.into_glib(),
3447 );
3448 }
3449 }
3450
3451 /// Sets text to be displayed in `self` when it is empty and unfocused.
3452 /// This can be used to give a visual hint of the expected contents of
3453 /// the [`Entry`][crate::Entry].
3454 ///
3455 /// Note that since the placeholder text gets removed when the entry
3456 /// received focus, using this feature is a bit problematic if the entry
3457 /// is given the initial focus in a window. Sometimes this can be
3458 /// worked around by delaying the initial focus setting until the
3459 /// first key event arrives.
3460 /// ## `text`
3461 /// a string to be displayed when `self` is empty and unfocused, or [`None`]
3462 #[doc(alias = "gtk_entry_set_placeholder_text")]
3463 #[doc(alias = "placeholder-text")]
3464 fn set_placeholder_text(&self, text: Option<&str>) {
3465 unsafe {
3466 ffi::gtk_entry_set_placeholder_text(
3467 self.as_ref().to_glib_none().0,
3468 text.to_glib_none().0,
3469 );
3470 }
3471 }
3472
3473 /// Causes the entry’s progress indicator to “fill in” the given
3474 /// fraction of the bar. The fraction should be between 0.0 and 1.0,
3475 /// inclusive.
3476 /// ## `fraction`
3477 /// fraction of the task that’s been completed
3478 #[doc(alias = "gtk_entry_set_progress_fraction")]
3479 #[doc(alias = "progress-fraction")]
3480 fn set_progress_fraction(&self, fraction: f64) {
3481 unsafe {
3482 ffi::gtk_entry_set_progress_fraction(self.as_ref().to_glib_none().0, fraction);
3483 }
3484 }
3485
3486 /// Sets the fraction of total entry width to move the progress
3487 /// bouncing block for each call to [`progress_pulse()`][Self::progress_pulse()].
3488 /// ## `fraction`
3489 /// fraction between 0.0 and 1.0
3490 #[doc(alias = "gtk_entry_set_progress_pulse_step")]
3491 #[doc(alias = "progress-pulse-step")]
3492 fn set_progress_pulse_step(&self, fraction: f64) {
3493 unsafe {
3494 ffi::gtk_entry_set_progress_pulse_step(self.as_ref().to_glib_none().0, fraction);
3495 }
3496 }
3497
3498 /// Sets a [`pango::TabArray`][crate::pango::TabArray]; the tabstops in the array are applied to the entry
3499 /// text.
3500 /// ## `tabs`
3501 /// a [`pango::TabArray`][crate::pango::TabArray]
3502 #[doc(alias = "gtk_entry_set_tabs")]
3503 #[doc(alias = "tabs")]
3504 fn set_tabs(&self, tabs: &pango::TabArray) {
3505 unsafe {
3506 ffi::gtk_entry_set_tabs(
3507 self.as_ref().to_glib_none().0,
3508 mut_override(tabs.to_glib_none().0),
3509 );
3510 }
3511 }
3512
3513 /// Sets the text in the widget to the given
3514 /// value, replacing the current contents.
3515 ///
3516 /// See [`EntryBufferExtManual::set_text()`][crate::prelude::EntryBufferExtManual::set_text()].
3517 /// ## `text`
3518 /// the new text
3519 #[doc(alias = "gtk_entry_set_text")]
3520 #[doc(alias = "text")]
3521 fn set_text(&self, text: &str) {
3522 unsafe {
3523 ffi::gtk_entry_set_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
3524 }
3525 }
3526
3527 /// Sets whether the contents of the entry are visible or not.
3528 /// When visibility is set to [`false`], characters are displayed
3529 /// as the invisible char, and will also appear that way when
3530 /// the text in the entry widget is copied elsewhere.
3531 ///
3532 /// By default, GTK+ picks the best invisible character available
3533 /// in the current font, but it can be changed with
3534 /// [`set_invisible_char()`][Self::set_invisible_char()].
3535 ///
3536 /// Note that you probably want to set [`input-purpose`][struct@crate::Entry#input-purpose]
3537 /// to [`InputPurpose::Password`][crate::InputPurpose::Password] or [`InputPurpose::Pin`][crate::InputPurpose::Pin] to
3538 /// inform input methods about the purpose of this entry,
3539 /// in addition to setting visibility to [`false`].
3540 /// ## `visible`
3541 /// [`true`] if the contents of the entry are displayed
3542 /// as plaintext
3543 #[doc(alias = "gtk_entry_set_visibility")]
3544 #[doc(alias = "visibility")]
3545 fn set_visibility(&self, visible: bool) {
3546 unsafe {
3547 ffi::gtk_entry_set_visibility(self.as_ref().to_glib_none().0, visible.into_glib());
3548 }
3549 }
3550
3551 /// Changes the size request of the entry to be about the right size
3552 /// for `n_chars` characters. Note that it changes the size
3553 /// request, the size can still be affected by
3554 /// how you pack the widget into containers. If `n_chars` is -1, the
3555 /// size reverts to the default entry size.
3556 /// ## `n_chars`
3557 /// width in chars
3558 #[doc(alias = "gtk_entry_set_width_chars")]
3559 #[doc(alias = "width-chars")]
3560 fn set_width_chars(&self, n_chars: i32) {
3561 unsafe {
3562 ffi::gtk_entry_set_width_chars(self.as_ref().to_glib_none().0, n_chars);
3563 }
3564 }
3565
3566 /// Converts from a position in the entry contents (returned
3567 /// by [`text()`][Self::text()]) to a position in the
3568 /// entry’s [`pango::Layout`][crate::pango::Layout] (returned by [`layout()`][Self::layout()],
3569 /// with text retrieved via [`Layout::text()`][crate::pango::Layout::text()]).
3570 /// ## `text_index`
3571 /// byte index into the entry contents
3572 ///
3573 /// # Returns
3574 ///
3575 /// byte index into the entry layout text
3576 #[doc(alias = "gtk_entry_text_index_to_layout_index")]
3577 fn text_index_to_layout_index(&self, text_index: i32) -> i32 {
3578 unsafe {
3579 ffi::gtk_entry_text_index_to_layout_index(self.as_ref().to_glib_none().0, text_index)
3580 }
3581 }
3582
3583 /// Unsets the invisible char previously set with
3584 /// [`set_invisible_char()`][Self::set_invisible_char()]. So that the
3585 /// default invisible char is used again.
3586 #[doc(alias = "gtk_entry_unset_invisible_char")]
3587 fn unset_invisible_char(&self) {
3588 unsafe {
3589 ffi::gtk_entry_unset_invisible_char(self.as_ref().to_glib_none().0);
3590 }
3591 }
3592
3593 /// Whether password entries will show a warning when Caps Lock is on.
3594 ///
3595 /// Note that the warning is shown using a secondary icon, and thus
3596 /// does not work if you are using the secondary icon position for some
3597 /// other purpose.
3598 #[doc(alias = "caps-lock-warning")]
3599 fn is_caps_lock_warning(&self) -> bool {
3600 ObjectExt::property(self.as_ref(), "caps-lock-warning")
3601 }
3602
3603 /// Whether password entries will show a warning when Caps Lock is on.
3604 ///
3605 /// Note that the warning is shown using a secondary icon, and thus
3606 /// does not work if you are using the secondary icon position for some
3607 /// other purpose.
3608 #[doc(alias = "caps-lock-warning")]
3609 fn set_caps_lock_warning(&self, caps_lock_warning: bool) {
3610 ObjectExt::set_property(self.as_ref(), "caps-lock-warning", caps_lock_warning)
3611 }
3612
3613 #[doc(alias = "cursor-position")]
3614 fn cursor_position(&self) -> i32 {
3615 ObjectExt::property(self.as_ref(), "cursor-position")
3616 }
3617
3618 #[doc(alias = "enable-emoji-completion")]
3619 fn enables_emoji_completion(&self) -> bool {
3620 ObjectExt::property(self.as_ref(), "enable-emoji-completion")
3621 }
3622
3623 #[doc(alias = "enable-emoji-completion")]
3624 fn set_enable_emoji_completion(&self, enable_emoji_completion: bool) {
3625 ObjectExt::set_property(
3626 self.as_ref(),
3627 "enable-emoji-completion",
3628 enable_emoji_completion,
3629 )
3630 }
3631
3632 /// Which IM (input method) module should be used for this entry.
3633 /// See [`IMContext`][crate::IMContext].
3634 ///
3635 /// Setting this to a non-[`None`] value overrides the
3636 /// system-wide IM module setting. See the GtkSettings
3637 /// [`gtk-im-module`][struct@crate::Settings#gtk-im-module] property.
3638 #[doc(alias = "im-module")]
3639 fn im_module(&self) -> Option<glib::GString> {
3640 ObjectExt::property(self.as_ref(), "im-module")
3641 }
3642
3643 /// Which IM (input method) module should be used for this entry.
3644 /// See [`IMContext`][crate::IMContext].
3645 ///
3646 /// Setting this to a non-[`None`] value overrides the
3647 /// system-wide IM module setting. See the GtkSettings
3648 /// [`gtk-im-module`][struct@crate::Settings#gtk-im-module] property.
3649 #[doc(alias = "im-module")]
3650 fn set_im_module(&self, im_module: Option<&str>) {
3651 ObjectExt::set_property(self.as_ref(), "im-module", im_module)
3652 }
3653
3654 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
3655 #[doc(alias = "invisible-char-set")]
3656 fn is_invisible_char_set(&self) -> bool {
3657 ObjectExt::property(self.as_ref(), "invisible-char-set")
3658 }
3659
3660 /// Whether the invisible char has been set for the [`Entry`][crate::Entry].
3661 #[doc(alias = "invisible-char-set")]
3662 fn set_invisible_char_set(&self, invisible_char_set: bool) {
3663 ObjectExt::set_property(self.as_ref(), "invisible-char-set", invisible_char_set)
3664 }
3665
3666 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::Entry#populate-popup]
3667 /// signal is also emitted for touch popups.
3668 #[doc(alias = "populate-all")]
3669 fn populates_all(&self) -> bool {
3670 ObjectExt::property(self.as_ref(), "populate-all")
3671 }
3672
3673 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::Entry#populate-popup]
3674 /// signal is also emitted for touch popups.
3675 #[doc(alias = "populate-all")]
3676 fn set_populate_all(&self, populate_all: bool) {
3677 ObjectExt::set_property(self.as_ref(), "populate-all", populate_all)
3678 }
3679
3680 /// Whether the primary icon is activatable.
3681 ///
3682 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
3683 /// signals only on sensitive, activatable icons.
3684 ///
3685 /// Sensitive, but non-activatable icons can be used for purely
3686 /// informational purposes.
3687 #[doc(alias = "primary-icon-activatable")]
3688 fn is_primary_icon_activatable(&self) -> bool {
3689 ObjectExt::property(self.as_ref(), "primary-icon-activatable")
3690 }
3691
3692 /// Whether the primary icon is activatable.
3693 ///
3694 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
3695 /// signals only on sensitive, activatable icons.
3696 ///
3697 /// Sensitive, but non-activatable icons can be used for purely
3698 /// informational purposes.
3699 #[doc(alias = "primary-icon-activatable")]
3700 fn set_primary_icon_activatable(&self, primary_icon_activatable: bool) {
3701 ObjectExt::set_property(
3702 self.as_ref(),
3703 "primary-icon-activatable",
3704 primary_icon_activatable,
3705 )
3706 }
3707
3708 /// The [`gio::Icon`][crate::gio::Icon] to use for the primary icon for the entry.
3709 #[doc(alias = "primary-icon-gicon")]
3710 fn primary_icon_gicon(&self) -> Option<gio::Icon> {
3711 ObjectExt::property(self.as_ref(), "primary-icon-gicon")
3712 }
3713
3714 /// The [`gio::Icon`][crate::gio::Icon] to use for the primary icon for the entry.
3715 #[doc(alias = "primary-icon-gicon")]
3716 fn set_primary_icon_gicon<P: IsA<gio::Icon>>(&self, primary_icon_gicon: Option<&P>) {
3717 ObjectExt::set_property(self.as_ref(), "primary-icon-gicon", primary_icon_gicon)
3718 }
3719
3720 /// The icon name to use for the primary icon for the entry.
3721 #[doc(alias = "primary-icon-name")]
3722 fn primary_icon_name(&self) -> Option<glib::GString> {
3723 ObjectExt::property(self.as_ref(), "primary-icon-name")
3724 }
3725
3726 /// The icon name to use for the primary icon for the entry.
3727 #[doc(alias = "primary-icon-name")]
3728 fn set_primary_icon_name(&self, primary_icon_name: Option<&str>) {
3729 ObjectExt::set_property(self.as_ref(), "primary-icon-name", primary_icon_name)
3730 }
3731
3732 /// A pixbuf to use as the primary icon for the entry.
3733 #[doc(alias = "primary-icon-pixbuf")]
3734 fn primary_icon_pixbuf(&self) -> Option<gdk_pixbuf::Pixbuf> {
3735 ObjectExt::property(self.as_ref(), "primary-icon-pixbuf")
3736 }
3737
3738 /// A pixbuf to use as the primary icon for the entry.
3739 #[doc(alias = "primary-icon-pixbuf")]
3740 fn set_primary_icon_pixbuf(&self, primary_icon_pixbuf: Option<&gdk_pixbuf::Pixbuf>) {
3741 ObjectExt::set_property(self.as_ref(), "primary-icon-pixbuf", primary_icon_pixbuf)
3742 }
3743
3744 /// Whether the primary icon is sensitive.
3745 ///
3746 /// An insensitive icon appears grayed out. GTK+ does not emit the
3747 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
3748 /// does not allow DND from insensitive icons.
3749 ///
3750 /// An icon should be set insensitive if the action that would trigger
3751 /// when clicked is currently not available.
3752 #[doc(alias = "primary-icon-sensitive")]
3753 fn is_primary_icon_sensitive(&self) -> bool {
3754 ObjectExt::property(self.as_ref(), "primary-icon-sensitive")
3755 }
3756
3757 /// Whether the primary icon is sensitive.
3758 ///
3759 /// An insensitive icon appears grayed out. GTK+ does not emit the
3760 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
3761 /// does not allow DND from insensitive icons.
3762 ///
3763 /// An icon should be set insensitive if the action that would trigger
3764 /// when clicked is currently not available.
3765 #[doc(alias = "primary-icon-sensitive")]
3766 fn set_primary_icon_sensitive(&self, primary_icon_sensitive: bool) {
3767 ObjectExt::set_property(
3768 self.as_ref(),
3769 "primary-icon-sensitive",
3770 primary_icon_sensitive,
3771 )
3772 }
3773
3774 /// The representation which is used for the primary icon of the entry.
3775 #[doc(alias = "primary-icon-storage-type")]
3776 fn primary_icon_storage_type(&self) -> ImageType {
3777 ObjectExt::property(self.as_ref(), "primary-icon-storage-type")
3778 }
3779
3780 /// The contents of the tooltip on the primary icon, which is marked up
3781 /// with the [Pango text markup language][PangoMarkupFormat].
3782 ///
3783 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3784 #[doc(alias = "primary-icon-tooltip-markup")]
3785 fn primary_icon_tooltip_markup(&self) -> Option<glib::GString> {
3786 ObjectExt::property(self.as_ref(), "primary-icon-tooltip-markup")
3787 }
3788
3789 /// The contents of the tooltip on the primary icon, which is marked up
3790 /// with the [Pango text markup language][PangoMarkupFormat].
3791 ///
3792 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3793 #[doc(alias = "primary-icon-tooltip-markup")]
3794 fn set_primary_icon_tooltip_markup(&self, primary_icon_tooltip_markup: Option<&str>) {
3795 ObjectExt::set_property(
3796 self.as_ref(),
3797 "primary-icon-tooltip-markup",
3798 primary_icon_tooltip_markup,
3799 )
3800 }
3801
3802 /// The contents of the tooltip on the primary icon.
3803 ///
3804 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3805 #[doc(alias = "primary-icon-tooltip-text")]
3806 fn primary_icon_tooltip_text(&self) -> Option<glib::GString> {
3807 ObjectExt::property(self.as_ref(), "primary-icon-tooltip-text")
3808 }
3809
3810 /// The contents of the tooltip on the primary icon.
3811 ///
3812 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3813 #[doc(alias = "primary-icon-tooltip-text")]
3814 fn set_primary_icon_tooltip_text(&self, primary_icon_tooltip_text: Option<&str>) {
3815 ObjectExt::set_property(
3816 self.as_ref(),
3817 "primary-icon-tooltip-text",
3818 primary_icon_tooltip_text,
3819 )
3820 }
3821
3822 #[doc(alias = "scroll-offset")]
3823 fn scroll_offset(&self) -> i32 {
3824 ObjectExt::property(self.as_ref(), "scroll-offset")
3825 }
3826
3827 /// Whether the secondary icon is activatable.
3828 ///
3829 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
3830 /// signals only on sensitive, activatable icons.
3831 ///
3832 /// Sensitive, but non-activatable icons can be used for purely
3833 /// informational purposes.
3834 #[doc(alias = "secondary-icon-activatable")]
3835 fn is_secondary_icon_activatable(&self) -> bool {
3836 ObjectExt::property(self.as_ref(), "secondary-icon-activatable")
3837 }
3838
3839 /// Whether the secondary icon is activatable.
3840 ///
3841 /// GTK+ emits the [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release]
3842 /// signals only on sensitive, activatable icons.
3843 ///
3844 /// Sensitive, but non-activatable icons can be used for purely
3845 /// informational purposes.
3846 #[doc(alias = "secondary-icon-activatable")]
3847 fn set_secondary_icon_activatable(&self, secondary_icon_activatable: bool) {
3848 ObjectExt::set_property(
3849 self.as_ref(),
3850 "secondary-icon-activatable",
3851 secondary_icon_activatable,
3852 )
3853 }
3854
3855 /// The [`gio::Icon`][crate::gio::Icon] to use for the secondary icon for the entry.
3856 #[doc(alias = "secondary-icon-gicon")]
3857 fn secondary_icon_gicon(&self) -> Option<gio::Icon> {
3858 ObjectExt::property(self.as_ref(), "secondary-icon-gicon")
3859 }
3860
3861 /// The [`gio::Icon`][crate::gio::Icon] to use for the secondary icon for the entry.
3862 #[doc(alias = "secondary-icon-gicon")]
3863 fn set_secondary_icon_gicon<P: IsA<gio::Icon>>(&self, secondary_icon_gicon: Option<&P>) {
3864 ObjectExt::set_property(self.as_ref(), "secondary-icon-gicon", secondary_icon_gicon)
3865 }
3866
3867 /// The icon name to use for the secondary icon for the entry.
3868 #[doc(alias = "secondary-icon-name")]
3869 fn secondary_icon_name(&self) -> Option<glib::GString> {
3870 ObjectExt::property(self.as_ref(), "secondary-icon-name")
3871 }
3872
3873 /// The icon name to use for the secondary icon for the entry.
3874 #[doc(alias = "secondary-icon-name")]
3875 fn set_secondary_icon_name(&self, secondary_icon_name: Option<&str>) {
3876 ObjectExt::set_property(self.as_ref(), "secondary-icon-name", secondary_icon_name)
3877 }
3878
3879 /// An pixbuf to use as the secondary icon for the entry.
3880 #[doc(alias = "secondary-icon-pixbuf")]
3881 fn secondary_icon_pixbuf(&self) -> Option<gdk_pixbuf::Pixbuf> {
3882 ObjectExt::property(self.as_ref(), "secondary-icon-pixbuf")
3883 }
3884
3885 /// An pixbuf to use as the secondary icon for the entry.
3886 #[doc(alias = "secondary-icon-pixbuf")]
3887 fn set_secondary_icon_pixbuf(&self, secondary_icon_pixbuf: Option<&gdk_pixbuf::Pixbuf>) {
3888 ObjectExt::set_property(
3889 self.as_ref(),
3890 "secondary-icon-pixbuf",
3891 secondary_icon_pixbuf,
3892 )
3893 }
3894
3895 /// Whether the secondary icon is sensitive.
3896 ///
3897 /// An insensitive icon appears grayed out. GTK+ does not emit the
3898 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
3899 /// does not allow DND from insensitive icons.
3900 ///
3901 /// An icon should be set insensitive if the action that would trigger
3902 /// when clicked is currently not available.
3903 #[doc(alias = "secondary-icon-sensitive")]
3904 fn is_secondary_icon_sensitive(&self) -> bool {
3905 ObjectExt::property(self.as_ref(), "secondary-icon-sensitive")
3906 }
3907
3908 /// Whether the secondary icon is sensitive.
3909 ///
3910 /// An insensitive icon appears grayed out. GTK+ does not emit the
3911 /// [`icon-press`][struct@crate::Entry#icon-press] and [`icon-release`][struct@crate::Entry#icon-release] signals and
3912 /// does not allow DND from insensitive icons.
3913 ///
3914 /// An icon should be set insensitive if the action that would trigger
3915 /// when clicked is currently not available.
3916 #[doc(alias = "secondary-icon-sensitive")]
3917 fn set_secondary_icon_sensitive(&self, secondary_icon_sensitive: bool) {
3918 ObjectExt::set_property(
3919 self.as_ref(),
3920 "secondary-icon-sensitive",
3921 secondary_icon_sensitive,
3922 )
3923 }
3924
3925 /// The representation which is used for the secondary icon of the entry.
3926 #[doc(alias = "secondary-icon-storage-type")]
3927 fn secondary_icon_storage_type(&self) -> ImageType {
3928 ObjectExt::property(self.as_ref(), "secondary-icon-storage-type")
3929 }
3930
3931 /// The contents of the tooltip on the secondary icon, which is marked up
3932 /// with the [Pango text markup language][PangoMarkupFormat].
3933 ///
3934 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3935 #[doc(alias = "secondary-icon-tooltip-markup")]
3936 fn secondary_icon_tooltip_markup(&self) -> Option<glib::GString> {
3937 ObjectExt::property(self.as_ref(), "secondary-icon-tooltip-markup")
3938 }
3939
3940 /// The contents of the tooltip on the secondary icon, which is marked up
3941 /// with the [Pango text markup language][PangoMarkupFormat].
3942 ///
3943 /// Also see [`set_icon_tooltip_markup()`][Self::set_icon_tooltip_markup()].
3944 #[doc(alias = "secondary-icon-tooltip-markup")]
3945 fn set_secondary_icon_tooltip_markup(&self, secondary_icon_tooltip_markup: Option<&str>) {
3946 ObjectExt::set_property(
3947 self.as_ref(),
3948 "secondary-icon-tooltip-markup",
3949 secondary_icon_tooltip_markup,
3950 )
3951 }
3952
3953 /// The contents of the tooltip on the secondary icon.
3954 ///
3955 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3956 #[doc(alias = "secondary-icon-tooltip-text")]
3957 fn secondary_icon_tooltip_text(&self) -> Option<glib::GString> {
3958 ObjectExt::property(self.as_ref(), "secondary-icon-tooltip-text")
3959 }
3960
3961 /// The contents of the tooltip on the secondary icon.
3962 ///
3963 /// Also see [`set_icon_tooltip_text()`][Self::set_icon_tooltip_text()].
3964 #[doc(alias = "secondary-icon-tooltip-text")]
3965 fn set_secondary_icon_tooltip_text(&self, secondary_icon_tooltip_text: Option<&str>) {
3966 ObjectExt::set_property(
3967 self.as_ref(),
3968 "secondary-icon-tooltip-text",
3969 secondary_icon_tooltip_text,
3970 )
3971 }
3972
3973 #[doc(alias = "selection-bound")]
3974 fn selection_bound(&self) -> i32 {
3975 ObjectExt::property(self.as_ref(), "selection-bound")
3976 }
3977
3978 #[doc(alias = "show-emoji-icon")]
3979 fn shows_emoji_icon(&self) -> bool {
3980 ObjectExt::property(self.as_ref(), "show-emoji-icon")
3981 }
3982
3983 #[doc(alias = "show-emoji-icon")]
3984 fn set_show_emoji_icon(&self, show_emoji_icon: bool) {
3985 ObjectExt::set_property(self.as_ref(), "show-emoji-icon", show_emoji_icon)
3986 }
3987
3988 /// When [`true`], pasted multi-line text is truncated to the first line.
3989 #[doc(alias = "truncate-multiline")]
3990 fn must_truncate_multiline(&self) -> bool {
3991 ObjectExt::property(self.as_ref(), "truncate-multiline")
3992 }
3993
3994 /// When [`true`], pasted multi-line text is truncated to the first line.
3995 #[doc(alias = "truncate-multiline")]
3996 fn set_truncate_multiline(&self, truncate_multiline: bool) {
3997 ObjectExt::set_property(self.as_ref(), "truncate-multiline", truncate_multiline)
3998 }
3999
4000 /// The horizontal alignment, from 0 (left) to 1 (right).
4001 /// Reversed for RTL layouts.
4002 fn xalign(&self) -> f32 {
4003 ObjectExt::property(self.as_ref(), "xalign")
4004 }
4005
4006 /// The horizontal alignment, from 0 (left) to 1 (right).
4007 /// Reversed for RTL layouts.
4008 fn set_xalign(&self, xalign: f32) {
4009 ObjectExt::set_property(self.as_ref(), "xalign", xalign)
4010 }
4011
4012 /// The ::activate signal is emitted when the user hits
4013 /// the Enter key.
4014 ///
4015 /// While this signal is used as a
4016 /// [keybinding signal][GtkBindingSignal],
4017 /// it is also commonly used by applications to intercept
4018 /// activation of entries.
4019 ///
4020 /// The default bindings for this signal are all forms of the Enter key.
4021 #[doc(alias = "activate")]
4022 fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4023 unsafe extern "C" fn activate_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4024 this: *mut ffi::GtkEntry,
4025 f: glib::ffi::gpointer,
4026 ) {
4027 unsafe {
4028 let f: &F = &*(f as *const F);
4029 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4030 }
4031 }
4032 unsafe {
4033 let f: Box_<F> = Box_::new(f);
4034 connect_raw(
4035 self.as_ptr() as *mut _,
4036 c"activate".as_ptr(),
4037 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4038 activate_trampoline::<Self, F> as *const (),
4039 )),
4040 Box_::into_raw(f),
4041 )
4042 }
4043 }
4044
4045 fn emit_activate(&self) {
4046 self.emit_by_name::<()>("activate", &[]);
4047 }
4048
4049 /// The ::backspace signal is a
4050 /// [keybinding signal][GtkBindingSignal]
4051 /// which gets emitted when the user asks for it.
4052 ///
4053 /// The default bindings for this signal are
4054 /// Backspace and Shift-Backspace.
4055 #[doc(alias = "backspace")]
4056 fn connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4057 unsafe extern "C" fn backspace_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4058 this: *mut ffi::GtkEntry,
4059 f: glib::ffi::gpointer,
4060 ) {
4061 unsafe {
4062 let f: &F = &*(f as *const F);
4063 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4064 }
4065 }
4066 unsafe {
4067 let f: Box_<F> = Box_::new(f);
4068 connect_raw(
4069 self.as_ptr() as *mut _,
4070 c"backspace".as_ptr(),
4071 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4072 backspace_trampoline::<Self, F> as *const (),
4073 )),
4074 Box_::into_raw(f),
4075 )
4076 }
4077 }
4078
4079 fn emit_backspace(&self) {
4080 self.emit_by_name::<()>("backspace", &[]);
4081 }
4082
4083 /// The ::copy-clipboard signal is a
4084 /// [keybinding signal][GtkBindingSignal]
4085 /// which gets emitted to copy the selection to the clipboard.
4086 ///
4087 /// The default bindings for this signal are
4088 /// Ctrl-c and Ctrl-Insert.
4089 #[doc(alias = "copy-clipboard")]
4090 fn connect_copy_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4091 unsafe extern "C" fn copy_clipboard_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4092 this: *mut ffi::GtkEntry,
4093 f: glib::ffi::gpointer,
4094 ) {
4095 unsafe {
4096 let f: &F = &*(f as *const F);
4097 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4098 }
4099 }
4100 unsafe {
4101 let f: Box_<F> = Box_::new(f);
4102 connect_raw(
4103 self.as_ptr() as *mut _,
4104 c"copy-clipboard".as_ptr(),
4105 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4106 copy_clipboard_trampoline::<Self, F> as *const (),
4107 )),
4108 Box_::into_raw(f),
4109 )
4110 }
4111 }
4112
4113 fn emit_copy_clipboard(&self) {
4114 self.emit_by_name::<()>("copy-clipboard", &[]);
4115 }
4116
4117 /// The ::cut-clipboard signal is a
4118 /// [keybinding signal][GtkBindingSignal]
4119 /// which gets emitted to cut the selection to the clipboard.
4120 ///
4121 /// The default bindings for this signal are
4122 /// Ctrl-x and Shift-Delete.
4123 #[doc(alias = "cut-clipboard")]
4124 fn connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4125 unsafe extern "C" fn cut_clipboard_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4126 this: *mut ffi::GtkEntry,
4127 f: glib::ffi::gpointer,
4128 ) {
4129 unsafe {
4130 let f: &F = &*(f as *const F);
4131 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4132 }
4133 }
4134 unsafe {
4135 let f: Box_<F> = Box_::new(f);
4136 connect_raw(
4137 self.as_ptr() as *mut _,
4138 c"cut-clipboard".as_ptr(),
4139 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4140 cut_clipboard_trampoline::<Self, F> as *const (),
4141 )),
4142 Box_::into_raw(f),
4143 )
4144 }
4145 }
4146
4147 fn emit_cut_clipboard(&self) {
4148 self.emit_by_name::<()>("cut-clipboard", &[]);
4149 }
4150
4151 /// The ::delete-from-cursor signal is a
4152 /// [keybinding signal][GtkBindingSignal]
4153 /// which gets emitted when the user initiates a text deletion.
4154 ///
4155 /// If the `type_` is [`DeleteType::Chars`][crate::DeleteType::Chars], GTK+ deletes the selection
4156 /// if there is one, otherwise it deletes the requested number
4157 /// of characters.
4158 ///
4159 /// The default bindings for this signal are
4160 /// Delete for deleting a character and Ctrl-Delete for
4161 /// deleting a word.
4162 /// ## `type_`
4163 /// the granularity of the deletion, as a [`DeleteType`][crate::DeleteType]
4164 /// ## `count`
4165 /// the number of `type_` units to delete
4166 #[doc(alias = "delete-from-cursor")]
4167 fn connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>(
4168 &self,
4169 f: F,
4170 ) -> SignalHandlerId {
4171 unsafe extern "C" fn delete_from_cursor_trampoline<
4172 P: IsA<Entry>,
4173 F: Fn(&P, DeleteType, i32) + 'static,
4174 >(
4175 this: *mut ffi::GtkEntry,
4176 type_: ffi::GtkDeleteType,
4177 count: std::ffi::c_int,
4178 f: glib::ffi::gpointer,
4179 ) {
4180 unsafe {
4181 let f: &F = &*(f as *const F);
4182 f(
4183 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4184 from_glib(type_),
4185 count,
4186 )
4187 }
4188 }
4189 unsafe {
4190 let f: Box_<F> = Box_::new(f);
4191 connect_raw(
4192 self.as_ptr() as *mut _,
4193 c"delete-from-cursor".as_ptr(),
4194 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4195 delete_from_cursor_trampoline::<Self, F> as *const (),
4196 )),
4197 Box_::into_raw(f),
4198 )
4199 }
4200 }
4201
4202 fn emit_delete_from_cursor(&self, type_: DeleteType, count: i32) {
4203 self.emit_by_name::<()>("delete-from-cursor", &[&type_, &count]);
4204 }
4205
4206 /// The ::icon-press signal is emitted when an activatable icon
4207 /// is clicked.
4208 /// ## `icon_pos`
4209 /// The position of the clicked icon
4210 /// ## `event`
4211 /// the button press event
4212 #[doc(alias = "icon-press")]
4213 fn connect_icon_press<F: Fn(&Self, EntryIconPosition, &gdk::Event) + 'static>(
4214 &self,
4215 f: F,
4216 ) -> SignalHandlerId {
4217 unsafe extern "C" fn icon_press_trampoline<
4218 P: IsA<Entry>,
4219 F: Fn(&P, EntryIconPosition, &gdk::Event) + 'static,
4220 >(
4221 this: *mut ffi::GtkEntry,
4222 icon_pos: ffi::GtkEntryIconPosition,
4223 event: *mut gdk::ffi::GdkEvent,
4224 f: glib::ffi::gpointer,
4225 ) {
4226 unsafe {
4227 let f: &F = &*(f as *const F);
4228 f(
4229 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4230 from_glib(icon_pos),
4231 &from_glib_none(event),
4232 )
4233 }
4234 }
4235 unsafe {
4236 let f: Box_<F> = Box_::new(f);
4237 connect_raw(
4238 self.as_ptr() as *mut _,
4239 c"icon-press".as_ptr(),
4240 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4241 icon_press_trampoline::<Self, F> as *const (),
4242 )),
4243 Box_::into_raw(f),
4244 )
4245 }
4246 }
4247
4248 /// The ::icon-release signal is emitted on the button release from a
4249 /// mouse click over an activatable icon.
4250 /// ## `icon_pos`
4251 /// The position of the clicked icon
4252 /// ## `event`
4253 /// the button release event
4254 #[doc(alias = "icon-release")]
4255 fn connect_icon_release<F: Fn(&Self, EntryIconPosition, &gdk::Event) + 'static>(
4256 &self,
4257 f: F,
4258 ) -> SignalHandlerId {
4259 unsafe extern "C" fn icon_release_trampoline<
4260 P: IsA<Entry>,
4261 F: Fn(&P, EntryIconPosition, &gdk::Event) + 'static,
4262 >(
4263 this: *mut ffi::GtkEntry,
4264 icon_pos: ffi::GtkEntryIconPosition,
4265 event: *mut gdk::ffi::GdkEvent,
4266 f: glib::ffi::gpointer,
4267 ) {
4268 unsafe {
4269 let f: &F = &*(f as *const F);
4270 f(
4271 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4272 from_glib(icon_pos),
4273 &from_glib_none(event),
4274 )
4275 }
4276 }
4277 unsafe {
4278 let f: Box_<F> = Box_::new(f);
4279 connect_raw(
4280 self.as_ptr() as *mut _,
4281 c"icon-release".as_ptr(),
4282 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4283 icon_release_trampoline::<Self, F> as *const (),
4284 )),
4285 Box_::into_raw(f),
4286 )
4287 }
4288 }
4289
4290 /// The ::insert-at-cursor signal is a
4291 /// [keybinding signal][GtkBindingSignal]
4292 /// which gets emitted when the user initiates the insertion of a
4293 /// fixed string at the cursor.
4294 ///
4295 /// This signal has no default bindings.
4296 /// ## `string`
4297 /// the string to insert
4298 #[doc(alias = "insert-at-cursor")]
4299 fn connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
4300 unsafe extern "C" fn insert_at_cursor_trampoline<
4301 P: IsA<Entry>,
4302 F: Fn(&P, &str) + 'static,
4303 >(
4304 this: *mut ffi::GtkEntry,
4305 string: *mut std::ffi::c_char,
4306 f: glib::ffi::gpointer,
4307 ) {
4308 unsafe {
4309 let f: &F = &*(f as *const F);
4310 f(
4311 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4312 &glib::GString::from_glib_borrow(string),
4313 )
4314 }
4315 }
4316 unsafe {
4317 let f: Box_<F> = Box_::new(f);
4318 connect_raw(
4319 self.as_ptr() as *mut _,
4320 c"insert-at-cursor".as_ptr(),
4321 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4322 insert_at_cursor_trampoline::<Self, F> as *const (),
4323 )),
4324 Box_::into_raw(f),
4325 )
4326 }
4327 }
4328
4329 fn emit_insert_at_cursor(&self, string: &str) {
4330 self.emit_by_name::<()>("insert-at-cursor", &[&string]);
4331 }
4332
4333 /// The ::insert-emoji signal is a
4334 /// [keybinding signal][GtkBindingSignal]
4335 /// which gets emitted to present the Emoji chooser for the `entry`.
4336 ///
4337 /// The default bindings for this signal are Ctrl-. and Ctrl-;
4338 #[doc(alias = "insert-emoji")]
4339 fn connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4340 unsafe extern "C" fn insert_emoji_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4341 this: *mut ffi::GtkEntry,
4342 f: glib::ffi::gpointer,
4343 ) {
4344 unsafe {
4345 let f: &F = &*(f as *const F);
4346 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4347 }
4348 }
4349 unsafe {
4350 let f: Box_<F> = Box_::new(f);
4351 connect_raw(
4352 self.as_ptr() as *mut _,
4353 c"insert-emoji".as_ptr(),
4354 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4355 insert_emoji_trampoline::<Self, F> as *const (),
4356 )),
4357 Box_::into_raw(f),
4358 )
4359 }
4360 }
4361
4362 fn emit_insert_emoji(&self) {
4363 self.emit_by_name::<()>("insert-emoji", &[]);
4364 }
4365
4366 /// The ::move-cursor signal is a
4367 /// [keybinding signal][GtkBindingSignal]
4368 /// which gets emitted when the user initiates a cursor movement.
4369 /// If the cursor is not visible in `entry`, this signal causes
4370 /// the viewport to be moved instead.
4371 ///
4372 /// Applications should not connect to it, but may emit it with
4373 /// `g_signal_emit_by_name()` if they need to control the cursor
4374 /// programmatically.
4375 ///
4376 /// The default bindings for this signal come in two variants,
4377 /// the variant with the Shift modifier extends the selection,
4378 /// the variant without the Shift modifer does not.
4379 /// There are too many key combinations to list them all here.
4380 /// - Arrow keys move by individual characters/lines
4381 /// - Ctrl-arrow key combinations move by words/paragraphs
4382 /// - Home/End keys move to the ends of the buffer
4383 /// ## `step`
4384 /// the granularity of the move, as a [`MovementStep`][crate::MovementStep]
4385 /// ## `count`
4386 /// the number of `step` units to move
4387 /// ## `extend_selection`
4388 /// [`true`] if the move should extend the selection
4389 #[doc(alias = "move-cursor")]
4390 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>(
4391 &self,
4392 f: F,
4393 ) -> SignalHandlerId {
4394 unsafe extern "C" fn move_cursor_trampoline<
4395 P: IsA<Entry>,
4396 F: Fn(&P, MovementStep, i32, bool) + 'static,
4397 >(
4398 this: *mut ffi::GtkEntry,
4399 step: ffi::GtkMovementStep,
4400 count: std::ffi::c_int,
4401 extend_selection: glib::ffi::gboolean,
4402 f: glib::ffi::gpointer,
4403 ) {
4404 unsafe {
4405 let f: &F = &*(f as *const F);
4406 f(
4407 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4408 from_glib(step),
4409 count,
4410 from_glib(extend_selection),
4411 )
4412 }
4413 }
4414 unsafe {
4415 let f: Box_<F> = Box_::new(f);
4416 connect_raw(
4417 self.as_ptr() as *mut _,
4418 c"move-cursor".as_ptr(),
4419 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4420 move_cursor_trampoline::<Self, F> as *const (),
4421 )),
4422 Box_::into_raw(f),
4423 )
4424 }
4425 }
4426
4427 fn emit_move_cursor(&self, step: MovementStep, count: i32, extend_selection: bool) {
4428 self.emit_by_name::<()>("move-cursor", &[&step, &count, &extend_selection]);
4429 }
4430
4431 /// The ::paste-clipboard signal is a
4432 /// [keybinding signal][GtkBindingSignal]
4433 /// which gets emitted to paste the contents of the clipboard
4434 /// into the text view.
4435 ///
4436 /// The default bindings for this signal are
4437 /// Ctrl-v and Shift-Insert.
4438 #[doc(alias = "paste-clipboard")]
4439 fn connect_paste_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4440 unsafe extern "C" fn paste_clipboard_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4441 this: *mut ffi::GtkEntry,
4442 f: glib::ffi::gpointer,
4443 ) {
4444 unsafe {
4445 let f: &F = &*(f as *const F);
4446 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4447 }
4448 }
4449 unsafe {
4450 let f: Box_<F> = Box_::new(f);
4451 connect_raw(
4452 self.as_ptr() as *mut _,
4453 c"paste-clipboard".as_ptr(),
4454 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4455 paste_clipboard_trampoline::<Self, F> as *const (),
4456 )),
4457 Box_::into_raw(f),
4458 )
4459 }
4460 }
4461
4462 fn emit_paste_clipboard(&self) {
4463 self.emit_by_name::<()>("paste-clipboard", &[]);
4464 }
4465
4466 /// The ::populate-popup signal gets emitted before showing the
4467 /// context menu of the entry.
4468 ///
4469 /// If you need to add items to the context menu, connect
4470 /// to this signal and append your items to the `widget`, which
4471 /// will be a [`Menu`][crate::Menu] in this case.
4472 ///
4473 /// If [`populate-all`][struct@crate::Entry#populate-all] is [`true`], this signal will
4474 /// also be emitted to populate touch popups. In this case,
4475 /// `widget` will be a different container, e.g. a [`Toolbar`][crate::Toolbar].
4476 /// The signal handler should not make assumptions about the
4477 /// type of `widget`.
4478 /// ## `widget`
4479 /// the container that is being populated
4480 #[doc(alias = "populate-popup")]
4481 fn connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
4482 unsafe extern "C" fn populate_popup_trampoline<
4483 P: IsA<Entry>,
4484 F: Fn(&P, &Widget) + 'static,
4485 >(
4486 this: *mut ffi::GtkEntry,
4487 widget: *mut ffi::GtkWidget,
4488 f: glib::ffi::gpointer,
4489 ) {
4490 unsafe {
4491 let f: &F = &*(f as *const F);
4492 f(
4493 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4494 &from_glib_borrow(widget),
4495 )
4496 }
4497 }
4498 unsafe {
4499 let f: Box_<F> = Box_::new(f);
4500 connect_raw(
4501 self.as_ptr() as *mut _,
4502 c"populate-popup".as_ptr(),
4503 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4504 populate_popup_trampoline::<Self, F> as *const (),
4505 )),
4506 Box_::into_raw(f),
4507 )
4508 }
4509 }
4510
4511 /// If an input method is used, the typed text will not immediately
4512 /// be committed to the buffer. So if you are interested in the text,
4513 /// connect to this signal.
4514 /// ## `preedit`
4515 /// the current preedit string
4516 #[doc(alias = "preedit-changed")]
4517 fn connect_preedit_changed<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
4518 unsafe extern "C" fn preedit_changed_trampoline<
4519 P: IsA<Entry>,
4520 F: Fn(&P, &str) + 'static,
4521 >(
4522 this: *mut ffi::GtkEntry,
4523 preedit: *mut std::ffi::c_char,
4524 f: glib::ffi::gpointer,
4525 ) {
4526 unsafe {
4527 let f: &F = &*(f as *const F);
4528 f(
4529 Entry::from_glib_borrow(this).unsafe_cast_ref(),
4530 &glib::GString::from_glib_borrow(preedit),
4531 )
4532 }
4533 }
4534 unsafe {
4535 let f: Box_<F> = Box_::new(f);
4536 connect_raw(
4537 self.as_ptr() as *mut _,
4538 c"preedit-changed".as_ptr(),
4539 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4540 preedit_changed_trampoline::<Self, F> as *const (),
4541 )),
4542 Box_::into_raw(f),
4543 )
4544 }
4545 }
4546
4547 fn emit_preedit_changed(&self, preedit: &str) {
4548 self.emit_by_name::<()>("preedit-changed", &[&preedit]);
4549 }
4550
4551 #[doc(alias = "toggle-direction")]
4552 fn connect_toggle_direction<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4553 unsafe extern "C" fn toggle_direction_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4554 this: *mut ffi::GtkEntry,
4555 f: glib::ffi::gpointer,
4556 ) {
4557 unsafe {
4558 let f: &F = &*(f as *const F);
4559 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4560 }
4561 }
4562 unsafe {
4563 let f: Box_<F> = Box_::new(f);
4564 connect_raw(
4565 self.as_ptr() as *mut _,
4566 c"toggle-direction".as_ptr(),
4567 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4568 toggle_direction_trampoline::<Self, F> as *const (),
4569 )),
4570 Box_::into_raw(f),
4571 )
4572 }
4573 }
4574
4575 fn emit_toggle_direction(&self) {
4576 self.emit_by_name::<()>("toggle-direction", &[]);
4577 }
4578
4579 /// The ::toggle-overwrite signal is a
4580 /// [keybinding signal][GtkBindingSignal]
4581 /// which gets emitted to toggle the overwrite mode of the entry.
4582 ///
4583 /// The default bindings for this signal is Insert.
4584 #[doc(alias = "toggle-overwrite")]
4585 fn connect_toggle_overwrite<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4586 unsafe extern "C" fn toggle_overwrite_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4587 this: *mut ffi::GtkEntry,
4588 f: glib::ffi::gpointer,
4589 ) {
4590 unsafe {
4591 let f: &F = &*(f as *const F);
4592 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4593 }
4594 }
4595 unsafe {
4596 let f: Box_<F> = Box_::new(f);
4597 connect_raw(
4598 self.as_ptr() as *mut _,
4599 c"toggle-overwrite".as_ptr(),
4600 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4601 toggle_overwrite_trampoline::<Self, F> as *const (),
4602 )),
4603 Box_::into_raw(f),
4604 )
4605 }
4606 }
4607
4608 fn emit_toggle_overwrite(&self) {
4609 self.emit_by_name::<()>("toggle-overwrite", &[]);
4610 }
4611
4612 #[doc(alias = "activates-default")]
4613 fn connect_activates_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4614 unsafe extern "C" fn notify_activates_default_trampoline<
4615 P: IsA<Entry>,
4616 F: Fn(&P) + 'static,
4617 >(
4618 this: *mut ffi::GtkEntry,
4619 _param_spec: glib::ffi::gpointer,
4620 f: glib::ffi::gpointer,
4621 ) {
4622 unsafe {
4623 let f: &F = &*(f as *const F);
4624 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4625 }
4626 }
4627 unsafe {
4628 let f: Box_<F> = Box_::new(f);
4629 connect_raw(
4630 self.as_ptr() as *mut _,
4631 c"notify::activates-default".as_ptr(),
4632 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4633 notify_activates_default_trampoline::<Self, F> as *const (),
4634 )),
4635 Box_::into_raw(f),
4636 )
4637 }
4638 }
4639
4640 #[doc(alias = "attributes")]
4641 fn connect_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4642 unsafe extern "C" fn notify_attributes_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4643 this: *mut ffi::GtkEntry,
4644 _param_spec: glib::ffi::gpointer,
4645 f: glib::ffi::gpointer,
4646 ) {
4647 unsafe {
4648 let f: &F = &*(f as *const F);
4649 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4650 }
4651 }
4652 unsafe {
4653 let f: Box_<F> = Box_::new(f);
4654 connect_raw(
4655 self.as_ptr() as *mut _,
4656 c"notify::attributes".as_ptr(),
4657 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4658 notify_attributes_trampoline::<Self, F> as *const (),
4659 )),
4660 Box_::into_raw(f),
4661 )
4662 }
4663 }
4664
4665 #[doc(alias = "buffer")]
4666 fn connect_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4667 unsafe extern "C" fn notify_buffer_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4668 this: *mut ffi::GtkEntry,
4669 _param_spec: glib::ffi::gpointer,
4670 f: glib::ffi::gpointer,
4671 ) {
4672 unsafe {
4673 let f: &F = &*(f as *const F);
4674 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4675 }
4676 }
4677 unsafe {
4678 let f: Box_<F> = Box_::new(f);
4679 connect_raw(
4680 self.as_ptr() as *mut _,
4681 c"notify::buffer".as_ptr(),
4682 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4683 notify_buffer_trampoline::<Self, F> as *const (),
4684 )),
4685 Box_::into_raw(f),
4686 )
4687 }
4688 }
4689
4690 #[doc(alias = "caps-lock-warning")]
4691 fn connect_caps_lock_warning_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4692 unsafe extern "C" fn notify_caps_lock_warning_trampoline<
4693 P: IsA<Entry>,
4694 F: Fn(&P) + 'static,
4695 >(
4696 this: *mut ffi::GtkEntry,
4697 _param_spec: glib::ffi::gpointer,
4698 f: glib::ffi::gpointer,
4699 ) {
4700 unsafe {
4701 let f: &F = &*(f as *const F);
4702 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4703 }
4704 }
4705 unsafe {
4706 let f: Box_<F> = Box_::new(f);
4707 connect_raw(
4708 self.as_ptr() as *mut _,
4709 c"notify::caps-lock-warning".as_ptr(),
4710 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4711 notify_caps_lock_warning_trampoline::<Self, F> as *const (),
4712 )),
4713 Box_::into_raw(f),
4714 )
4715 }
4716 }
4717
4718 #[doc(alias = "completion")]
4719 fn connect_completion_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4720 unsafe extern "C" fn notify_completion_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4721 this: *mut ffi::GtkEntry,
4722 _param_spec: glib::ffi::gpointer,
4723 f: glib::ffi::gpointer,
4724 ) {
4725 unsafe {
4726 let f: &F = &*(f as *const F);
4727 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4728 }
4729 }
4730 unsafe {
4731 let f: Box_<F> = Box_::new(f);
4732 connect_raw(
4733 self.as_ptr() as *mut _,
4734 c"notify::completion".as_ptr(),
4735 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4736 notify_completion_trampoline::<Self, F> as *const (),
4737 )),
4738 Box_::into_raw(f),
4739 )
4740 }
4741 }
4742
4743 #[doc(alias = "cursor-position")]
4744 fn connect_cursor_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4745 unsafe extern "C" fn notify_cursor_position_trampoline<
4746 P: IsA<Entry>,
4747 F: Fn(&P) + 'static,
4748 >(
4749 this: *mut ffi::GtkEntry,
4750 _param_spec: glib::ffi::gpointer,
4751 f: glib::ffi::gpointer,
4752 ) {
4753 unsafe {
4754 let f: &F = &*(f as *const F);
4755 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4756 }
4757 }
4758 unsafe {
4759 let f: Box_<F> = Box_::new(f);
4760 connect_raw(
4761 self.as_ptr() as *mut _,
4762 c"notify::cursor-position".as_ptr(),
4763 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4764 notify_cursor_position_trampoline::<Self, F> as *const (),
4765 )),
4766 Box_::into_raw(f),
4767 )
4768 }
4769 }
4770
4771 #[doc(alias = "editable")]
4772 fn connect_editable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4773 unsafe extern "C" fn notify_editable_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4774 this: *mut ffi::GtkEntry,
4775 _param_spec: glib::ffi::gpointer,
4776 f: glib::ffi::gpointer,
4777 ) {
4778 unsafe {
4779 let f: &F = &*(f as *const F);
4780 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4781 }
4782 }
4783 unsafe {
4784 let f: Box_<F> = Box_::new(f);
4785 connect_raw(
4786 self.as_ptr() as *mut _,
4787 c"notify::editable".as_ptr(),
4788 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4789 notify_editable_trampoline::<Self, F> as *const (),
4790 )),
4791 Box_::into_raw(f),
4792 )
4793 }
4794 }
4795
4796 #[doc(alias = "enable-emoji-completion")]
4797 fn connect_enable_emoji_completion_notify<F: Fn(&Self) + 'static>(
4798 &self,
4799 f: F,
4800 ) -> SignalHandlerId {
4801 unsafe extern "C" fn notify_enable_emoji_completion_trampoline<
4802 P: IsA<Entry>,
4803 F: Fn(&P) + 'static,
4804 >(
4805 this: *mut ffi::GtkEntry,
4806 _param_spec: glib::ffi::gpointer,
4807 f: glib::ffi::gpointer,
4808 ) {
4809 unsafe {
4810 let f: &F = &*(f as *const F);
4811 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4812 }
4813 }
4814 unsafe {
4815 let f: Box_<F> = Box_::new(f);
4816 connect_raw(
4817 self.as_ptr() as *mut _,
4818 c"notify::enable-emoji-completion".as_ptr(),
4819 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4820 notify_enable_emoji_completion_trampoline::<Self, F> as *const (),
4821 )),
4822 Box_::into_raw(f),
4823 )
4824 }
4825 }
4826
4827 #[doc(alias = "has-frame")]
4828 fn connect_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4829 unsafe extern "C" fn notify_has_frame_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4830 this: *mut ffi::GtkEntry,
4831 _param_spec: glib::ffi::gpointer,
4832 f: glib::ffi::gpointer,
4833 ) {
4834 unsafe {
4835 let f: &F = &*(f as *const F);
4836 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4837 }
4838 }
4839 unsafe {
4840 let f: Box_<F> = Box_::new(f);
4841 connect_raw(
4842 self.as_ptr() as *mut _,
4843 c"notify::has-frame".as_ptr(),
4844 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4845 notify_has_frame_trampoline::<Self, F> as *const (),
4846 )),
4847 Box_::into_raw(f),
4848 )
4849 }
4850 }
4851
4852 #[doc(alias = "im-module")]
4853 fn connect_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4854 unsafe extern "C" fn notify_im_module_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4855 this: *mut ffi::GtkEntry,
4856 _param_spec: glib::ffi::gpointer,
4857 f: glib::ffi::gpointer,
4858 ) {
4859 unsafe {
4860 let f: &F = &*(f as *const F);
4861 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4862 }
4863 }
4864 unsafe {
4865 let f: Box_<F> = Box_::new(f);
4866 connect_raw(
4867 self.as_ptr() as *mut _,
4868 c"notify::im-module".as_ptr(),
4869 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4870 notify_im_module_trampoline::<Self, F> as *const (),
4871 )),
4872 Box_::into_raw(f),
4873 )
4874 }
4875 }
4876
4877 #[doc(alias = "input-hints")]
4878 fn connect_input_hints_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4879 unsafe extern "C" fn notify_input_hints_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4880 this: *mut ffi::GtkEntry,
4881 _param_spec: glib::ffi::gpointer,
4882 f: glib::ffi::gpointer,
4883 ) {
4884 unsafe {
4885 let f: &F = &*(f as *const F);
4886 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4887 }
4888 }
4889 unsafe {
4890 let f: Box_<F> = Box_::new(f);
4891 connect_raw(
4892 self.as_ptr() as *mut _,
4893 c"notify::input-hints".as_ptr(),
4894 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4895 notify_input_hints_trampoline::<Self, F> as *const (),
4896 )),
4897 Box_::into_raw(f),
4898 )
4899 }
4900 }
4901
4902 #[doc(alias = "input-purpose")]
4903 fn connect_input_purpose_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4904 unsafe extern "C" fn notify_input_purpose_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4905 this: *mut ffi::GtkEntry,
4906 _param_spec: glib::ffi::gpointer,
4907 f: glib::ffi::gpointer,
4908 ) {
4909 unsafe {
4910 let f: &F = &*(f as *const F);
4911 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4912 }
4913 }
4914 unsafe {
4915 let f: Box_<F> = Box_::new(f);
4916 connect_raw(
4917 self.as_ptr() as *mut _,
4918 c"notify::input-purpose".as_ptr(),
4919 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4920 notify_input_purpose_trampoline::<Self, F> as *const (),
4921 )),
4922 Box_::into_raw(f),
4923 )
4924 }
4925 }
4926
4927 #[doc(alias = "invisible-char")]
4928 fn connect_invisible_char_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4929 unsafe extern "C" fn notify_invisible_char_trampoline<
4930 P: IsA<Entry>,
4931 F: Fn(&P) + 'static,
4932 >(
4933 this: *mut ffi::GtkEntry,
4934 _param_spec: glib::ffi::gpointer,
4935 f: glib::ffi::gpointer,
4936 ) {
4937 unsafe {
4938 let f: &F = &*(f as *const F);
4939 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4940 }
4941 }
4942 unsafe {
4943 let f: Box_<F> = Box_::new(f);
4944 connect_raw(
4945 self.as_ptr() as *mut _,
4946 c"notify::invisible-char".as_ptr(),
4947 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4948 notify_invisible_char_trampoline::<Self, F> as *const (),
4949 )),
4950 Box_::into_raw(f),
4951 )
4952 }
4953 }
4954
4955 #[doc(alias = "invisible-char-set")]
4956 fn connect_invisible_char_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4957 unsafe extern "C" fn notify_invisible_char_set_trampoline<
4958 P: IsA<Entry>,
4959 F: Fn(&P) + 'static,
4960 >(
4961 this: *mut ffi::GtkEntry,
4962 _param_spec: glib::ffi::gpointer,
4963 f: glib::ffi::gpointer,
4964 ) {
4965 unsafe {
4966 let f: &F = &*(f as *const F);
4967 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4968 }
4969 }
4970 unsafe {
4971 let f: Box_<F> = Box_::new(f);
4972 connect_raw(
4973 self.as_ptr() as *mut _,
4974 c"notify::invisible-char-set".as_ptr(),
4975 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4976 notify_invisible_char_set_trampoline::<Self, F> as *const (),
4977 )),
4978 Box_::into_raw(f),
4979 )
4980 }
4981 }
4982
4983 #[doc(alias = "max-length")]
4984 fn connect_max_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4985 unsafe extern "C" fn notify_max_length_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
4986 this: *mut ffi::GtkEntry,
4987 _param_spec: glib::ffi::gpointer,
4988 f: glib::ffi::gpointer,
4989 ) {
4990 unsafe {
4991 let f: &F = &*(f as *const F);
4992 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
4993 }
4994 }
4995 unsafe {
4996 let f: Box_<F> = Box_::new(f);
4997 connect_raw(
4998 self.as_ptr() as *mut _,
4999 c"notify::max-length".as_ptr(),
5000 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5001 notify_max_length_trampoline::<Self, F> as *const (),
5002 )),
5003 Box_::into_raw(f),
5004 )
5005 }
5006 }
5007
5008 #[doc(alias = "max-width-chars")]
5009 fn connect_max_width_chars_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5010 unsafe extern "C" fn notify_max_width_chars_trampoline<
5011 P: IsA<Entry>,
5012 F: Fn(&P) + 'static,
5013 >(
5014 this: *mut ffi::GtkEntry,
5015 _param_spec: glib::ffi::gpointer,
5016 f: glib::ffi::gpointer,
5017 ) {
5018 unsafe {
5019 let f: &F = &*(f as *const F);
5020 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5021 }
5022 }
5023 unsafe {
5024 let f: Box_<F> = Box_::new(f);
5025 connect_raw(
5026 self.as_ptr() as *mut _,
5027 c"notify::max-width-chars".as_ptr(),
5028 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5029 notify_max_width_chars_trampoline::<Self, F> as *const (),
5030 )),
5031 Box_::into_raw(f),
5032 )
5033 }
5034 }
5035
5036 #[doc(alias = "overwrite-mode")]
5037 fn connect_overwrite_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5038 unsafe extern "C" fn notify_overwrite_mode_trampoline<
5039 P: IsA<Entry>,
5040 F: Fn(&P) + 'static,
5041 >(
5042 this: *mut ffi::GtkEntry,
5043 _param_spec: glib::ffi::gpointer,
5044 f: glib::ffi::gpointer,
5045 ) {
5046 unsafe {
5047 let f: &F = &*(f as *const F);
5048 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5049 }
5050 }
5051 unsafe {
5052 let f: Box_<F> = Box_::new(f);
5053 connect_raw(
5054 self.as_ptr() as *mut _,
5055 c"notify::overwrite-mode".as_ptr(),
5056 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5057 notify_overwrite_mode_trampoline::<Self, F> as *const (),
5058 )),
5059 Box_::into_raw(f),
5060 )
5061 }
5062 }
5063
5064 #[doc(alias = "placeholder-text")]
5065 fn connect_placeholder_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5066 unsafe extern "C" fn notify_placeholder_text_trampoline<
5067 P: IsA<Entry>,
5068 F: Fn(&P) + 'static,
5069 >(
5070 this: *mut ffi::GtkEntry,
5071 _param_spec: glib::ffi::gpointer,
5072 f: glib::ffi::gpointer,
5073 ) {
5074 unsafe {
5075 let f: &F = &*(f as *const F);
5076 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5077 }
5078 }
5079 unsafe {
5080 let f: Box_<F> = Box_::new(f);
5081 connect_raw(
5082 self.as_ptr() as *mut _,
5083 c"notify::placeholder-text".as_ptr(),
5084 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5085 notify_placeholder_text_trampoline::<Self, F> as *const (),
5086 )),
5087 Box_::into_raw(f),
5088 )
5089 }
5090 }
5091
5092 #[doc(alias = "populate-all")]
5093 fn connect_populate_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5094 unsafe extern "C" fn notify_populate_all_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5095 this: *mut ffi::GtkEntry,
5096 _param_spec: glib::ffi::gpointer,
5097 f: glib::ffi::gpointer,
5098 ) {
5099 unsafe {
5100 let f: &F = &*(f as *const F);
5101 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5102 }
5103 }
5104 unsafe {
5105 let f: Box_<F> = Box_::new(f);
5106 connect_raw(
5107 self.as_ptr() as *mut _,
5108 c"notify::populate-all".as_ptr(),
5109 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5110 notify_populate_all_trampoline::<Self, F> as *const (),
5111 )),
5112 Box_::into_raw(f),
5113 )
5114 }
5115 }
5116
5117 #[doc(alias = "primary-icon-activatable")]
5118 fn connect_primary_icon_activatable_notify<F: Fn(&Self) + 'static>(
5119 &self,
5120 f: F,
5121 ) -> SignalHandlerId {
5122 unsafe extern "C" fn notify_primary_icon_activatable_trampoline<
5123 P: IsA<Entry>,
5124 F: Fn(&P) + 'static,
5125 >(
5126 this: *mut ffi::GtkEntry,
5127 _param_spec: glib::ffi::gpointer,
5128 f: glib::ffi::gpointer,
5129 ) {
5130 unsafe {
5131 let f: &F = &*(f as *const F);
5132 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5133 }
5134 }
5135 unsafe {
5136 let f: Box_<F> = Box_::new(f);
5137 connect_raw(
5138 self.as_ptr() as *mut _,
5139 c"notify::primary-icon-activatable".as_ptr(),
5140 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5141 notify_primary_icon_activatable_trampoline::<Self, F> as *const (),
5142 )),
5143 Box_::into_raw(f),
5144 )
5145 }
5146 }
5147
5148 #[doc(alias = "primary-icon-gicon")]
5149 fn connect_primary_icon_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5150 unsafe extern "C" fn notify_primary_icon_gicon_trampoline<
5151 P: IsA<Entry>,
5152 F: Fn(&P) + 'static,
5153 >(
5154 this: *mut ffi::GtkEntry,
5155 _param_spec: glib::ffi::gpointer,
5156 f: glib::ffi::gpointer,
5157 ) {
5158 unsafe {
5159 let f: &F = &*(f as *const F);
5160 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5161 }
5162 }
5163 unsafe {
5164 let f: Box_<F> = Box_::new(f);
5165 connect_raw(
5166 self.as_ptr() as *mut _,
5167 c"notify::primary-icon-gicon".as_ptr(),
5168 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5169 notify_primary_icon_gicon_trampoline::<Self, F> as *const (),
5170 )),
5171 Box_::into_raw(f),
5172 )
5173 }
5174 }
5175
5176 #[doc(alias = "primary-icon-name")]
5177 fn connect_primary_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5178 unsafe extern "C" fn notify_primary_icon_name_trampoline<
5179 P: IsA<Entry>,
5180 F: Fn(&P) + 'static,
5181 >(
5182 this: *mut ffi::GtkEntry,
5183 _param_spec: glib::ffi::gpointer,
5184 f: glib::ffi::gpointer,
5185 ) {
5186 unsafe {
5187 let f: &F = &*(f as *const F);
5188 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5189 }
5190 }
5191 unsafe {
5192 let f: Box_<F> = Box_::new(f);
5193 connect_raw(
5194 self.as_ptr() as *mut _,
5195 c"notify::primary-icon-name".as_ptr(),
5196 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5197 notify_primary_icon_name_trampoline::<Self, F> as *const (),
5198 )),
5199 Box_::into_raw(f),
5200 )
5201 }
5202 }
5203
5204 #[doc(alias = "primary-icon-pixbuf")]
5205 fn connect_primary_icon_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5206 unsafe extern "C" fn notify_primary_icon_pixbuf_trampoline<
5207 P: IsA<Entry>,
5208 F: Fn(&P) + 'static,
5209 >(
5210 this: *mut ffi::GtkEntry,
5211 _param_spec: glib::ffi::gpointer,
5212 f: glib::ffi::gpointer,
5213 ) {
5214 unsafe {
5215 let f: &F = &*(f as *const F);
5216 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5217 }
5218 }
5219 unsafe {
5220 let f: Box_<F> = Box_::new(f);
5221 connect_raw(
5222 self.as_ptr() as *mut _,
5223 c"notify::primary-icon-pixbuf".as_ptr(),
5224 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5225 notify_primary_icon_pixbuf_trampoline::<Self, F> as *const (),
5226 )),
5227 Box_::into_raw(f),
5228 )
5229 }
5230 }
5231
5232 #[doc(alias = "primary-icon-sensitive")]
5233 fn connect_primary_icon_sensitive_notify<F: Fn(&Self) + 'static>(
5234 &self,
5235 f: F,
5236 ) -> SignalHandlerId {
5237 unsafe extern "C" fn notify_primary_icon_sensitive_trampoline<
5238 P: IsA<Entry>,
5239 F: Fn(&P) + 'static,
5240 >(
5241 this: *mut ffi::GtkEntry,
5242 _param_spec: glib::ffi::gpointer,
5243 f: glib::ffi::gpointer,
5244 ) {
5245 unsafe {
5246 let f: &F = &*(f as *const F);
5247 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5248 }
5249 }
5250 unsafe {
5251 let f: Box_<F> = Box_::new(f);
5252 connect_raw(
5253 self.as_ptr() as *mut _,
5254 c"notify::primary-icon-sensitive".as_ptr(),
5255 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5256 notify_primary_icon_sensitive_trampoline::<Self, F> as *const (),
5257 )),
5258 Box_::into_raw(f),
5259 )
5260 }
5261 }
5262
5263 #[doc(alias = "primary-icon-storage-type")]
5264 fn connect_primary_icon_storage_type_notify<F: Fn(&Self) + 'static>(
5265 &self,
5266 f: F,
5267 ) -> SignalHandlerId {
5268 unsafe extern "C" fn notify_primary_icon_storage_type_trampoline<
5269 P: IsA<Entry>,
5270 F: Fn(&P) + 'static,
5271 >(
5272 this: *mut ffi::GtkEntry,
5273 _param_spec: glib::ffi::gpointer,
5274 f: glib::ffi::gpointer,
5275 ) {
5276 unsafe {
5277 let f: &F = &*(f as *const F);
5278 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5279 }
5280 }
5281 unsafe {
5282 let f: Box_<F> = Box_::new(f);
5283 connect_raw(
5284 self.as_ptr() as *mut _,
5285 c"notify::primary-icon-storage-type".as_ptr(),
5286 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5287 notify_primary_icon_storage_type_trampoline::<Self, F> as *const (),
5288 )),
5289 Box_::into_raw(f),
5290 )
5291 }
5292 }
5293
5294 #[doc(alias = "primary-icon-tooltip-markup")]
5295 fn connect_primary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>(
5296 &self,
5297 f: F,
5298 ) -> SignalHandlerId {
5299 unsafe extern "C" fn notify_primary_icon_tooltip_markup_trampoline<
5300 P: IsA<Entry>,
5301 F: Fn(&P) + 'static,
5302 >(
5303 this: *mut ffi::GtkEntry,
5304 _param_spec: glib::ffi::gpointer,
5305 f: glib::ffi::gpointer,
5306 ) {
5307 unsafe {
5308 let f: &F = &*(f as *const F);
5309 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5310 }
5311 }
5312 unsafe {
5313 let f: Box_<F> = Box_::new(f);
5314 connect_raw(
5315 self.as_ptr() as *mut _,
5316 c"notify::primary-icon-tooltip-markup".as_ptr(),
5317 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5318 notify_primary_icon_tooltip_markup_trampoline::<Self, F> as *const (),
5319 )),
5320 Box_::into_raw(f),
5321 )
5322 }
5323 }
5324
5325 #[doc(alias = "primary-icon-tooltip-text")]
5326 fn connect_primary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>(
5327 &self,
5328 f: F,
5329 ) -> SignalHandlerId {
5330 unsafe extern "C" fn notify_primary_icon_tooltip_text_trampoline<
5331 P: IsA<Entry>,
5332 F: Fn(&P) + 'static,
5333 >(
5334 this: *mut ffi::GtkEntry,
5335 _param_spec: glib::ffi::gpointer,
5336 f: glib::ffi::gpointer,
5337 ) {
5338 unsafe {
5339 let f: &F = &*(f as *const F);
5340 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5341 }
5342 }
5343 unsafe {
5344 let f: Box_<F> = Box_::new(f);
5345 connect_raw(
5346 self.as_ptr() as *mut _,
5347 c"notify::primary-icon-tooltip-text".as_ptr(),
5348 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5349 notify_primary_icon_tooltip_text_trampoline::<Self, F> as *const (),
5350 )),
5351 Box_::into_raw(f),
5352 )
5353 }
5354 }
5355
5356 #[doc(alias = "progress-fraction")]
5357 fn connect_progress_fraction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5358 unsafe extern "C" fn notify_progress_fraction_trampoline<
5359 P: IsA<Entry>,
5360 F: Fn(&P) + 'static,
5361 >(
5362 this: *mut ffi::GtkEntry,
5363 _param_spec: glib::ffi::gpointer,
5364 f: glib::ffi::gpointer,
5365 ) {
5366 unsafe {
5367 let f: &F = &*(f as *const F);
5368 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5369 }
5370 }
5371 unsafe {
5372 let f: Box_<F> = Box_::new(f);
5373 connect_raw(
5374 self.as_ptr() as *mut _,
5375 c"notify::progress-fraction".as_ptr(),
5376 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5377 notify_progress_fraction_trampoline::<Self, F> as *const (),
5378 )),
5379 Box_::into_raw(f),
5380 )
5381 }
5382 }
5383
5384 #[doc(alias = "progress-pulse-step")]
5385 fn connect_progress_pulse_step_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5386 unsafe extern "C" fn notify_progress_pulse_step_trampoline<
5387 P: IsA<Entry>,
5388 F: Fn(&P) + 'static,
5389 >(
5390 this: *mut ffi::GtkEntry,
5391 _param_spec: glib::ffi::gpointer,
5392 f: glib::ffi::gpointer,
5393 ) {
5394 unsafe {
5395 let f: &F = &*(f as *const F);
5396 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5397 }
5398 }
5399 unsafe {
5400 let f: Box_<F> = Box_::new(f);
5401 connect_raw(
5402 self.as_ptr() as *mut _,
5403 c"notify::progress-pulse-step".as_ptr(),
5404 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5405 notify_progress_pulse_step_trampoline::<Self, F> as *const (),
5406 )),
5407 Box_::into_raw(f),
5408 )
5409 }
5410 }
5411
5412 #[doc(alias = "scroll-offset")]
5413 fn connect_scroll_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5414 unsafe extern "C" fn notify_scroll_offset_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5415 this: *mut ffi::GtkEntry,
5416 _param_spec: glib::ffi::gpointer,
5417 f: glib::ffi::gpointer,
5418 ) {
5419 unsafe {
5420 let f: &F = &*(f as *const F);
5421 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5422 }
5423 }
5424 unsafe {
5425 let f: Box_<F> = Box_::new(f);
5426 connect_raw(
5427 self.as_ptr() as *mut _,
5428 c"notify::scroll-offset".as_ptr(),
5429 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5430 notify_scroll_offset_trampoline::<Self, F> as *const (),
5431 )),
5432 Box_::into_raw(f),
5433 )
5434 }
5435 }
5436
5437 #[doc(alias = "secondary-icon-activatable")]
5438 fn connect_secondary_icon_activatable_notify<F: Fn(&Self) + 'static>(
5439 &self,
5440 f: F,
5441 ) -> SignalHandlerId {
5442 unsafe extern "C" fn notify_secondary_icon_activatable_trampoline<
5443 P: IsA<Entry>,
5444 F: Fn(&P) + 'static,
5445 >(
5446 this: *mut ffi::GtkEntry,
5447 _param_spec: glib::ffi::gpointer,
5448 f: glib::ffi::gpointer,
5449 ) {
5450 unsafe {
5451 let f: &F = &*(f as *const F);
5452 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5453 }
5454 }
5455 unsafe {
5456 let f: Box_<F> = Box_::new(f);
5457 connect_raw(
5458 self.as_ptr() as *mut _,
5459 c"notify::secondary-icon-activatable".as_ptr(),
5460 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5461 notify_secondary_icon_activatable_trampoline::<Self, F> as *const (),
5462 )),
5463 Box_::into_raw(f),
5464 )
5465 }
5466 }
5467
5468 #[doc(alias = "secondary-icon-gicon")]
5469 fn connect_secondary_icon_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5470 unsafe extern "C" fn notify_secondary_icon_gicon_trampoline<
5471 P: IsA<Entry>,
5472 F: Fn(&P) + 'static,
5473 >(
5474 this: *mut ffi::GtkEntry,
5475 _param_spec: glib::ffi::gpointer,
5476 f: glib::ffi::gpointer,
5477 ) {
5478 unsafe {
5479 let f: &F = &*(f as *const F);
5480 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5481 }
5482 }
5483 unsafe {
5484 let f: Box_<F> = Box_::new(f);
5485 connect_raw(
5486 self.as_ptr() as *mut _,
5487 c"notify::secondary-icon-gicon".as_ptr(),
5488 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5489 notify_secondary_icon_gicon_trampoline::<Self, F> as *const (),
5490 )),
5491 Box_::into_raw(f),
5492 )
5493 }
5494 }
5495
5496 #[doc(alias = "secondary-icon-name")]
5497 fn connect_secondary_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5498 unsafe extern "C" fn notify_secondary_icon_name_trampoline<
5499 P: IsA<Entry>,
5500 F: Fn(&P) + 'static,
5501 >(
5502 this: *mut ffi::GtkEntry,
5503 _param_spec: glib::ffi::gpointer,
5504 f: glib::ffi::gpointer,
5505 ) {
5506 unsafe {
5507 let f: &F = &*(f as *const F);
5508 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5509 }
5510 }
5511 unsafe {
5512 let f: Box_<F> = Box_::new(f);
5513 connect_raw(
5514 self.as_ptr() as *mut _,
5515 c"notify::secondary-icon-name".as_ptr(),
5516 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5517 notify_secondary_icon_name_trampoline::<Self, F> as *const (),
5518 )),
5519 Box_::into_raw(f),
5520 )
5521 }
5522 }
5523
5524 #[doc(alias = "secondary-icon-pixbuf")]
5525 fn connect_secondary_icon_pixbuf_notify<F: Fn(&Self) + 'static>(
5526 &self,
5527 f: F,
5528 ) -> SignalHandlerId {
5529 unsafe extern "C" fn notify_secondary_icon_pixbuf_trampoline<
5530 P: IsA<Entry>,
5531 F: Fn(&P) + 'static,
5532 >(
5533 this: *mut ffi::GtkEntry,
5534 _param_spec: glib::ffi::gpointer,
5535 f: glib::ffi::gpointer,
5536 ) {
5537 unsafe {
5538 let f: &F = &*(f as *const F);
5539 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5540 }
5541 }
5542 unsafe {
5543 let f: Box_<F> = Box_::new(f);
5544 connect_raw(
5545 self.as_ptr() as *mut _,
5546 c"notify::secondary-icon-pixbuf".as_ptr(),
5547 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5548 notify_secondary_icon_pixbuf_trampoline::<Self, F> as *const (),
5549 )),
5550 Box_::into_raw(f),
5551 )
5552 }
5553 }
5554
5555 #[doc(alias = "secondary-icon-sensitive")]
5556 fn connect_secondary_icon_sensitive_notify<F: Fn(&Self) + 'static>(
5557 &self,
5558 f: F,
5559 ) -> SignalHandlerId {
5560 unsafe extern "C" fn notify_secondary_icon_sensitive_trampoline<
5561 P: IsA<Entry>,
5562 F: Fn(&P) + 'static,
5563 >(
5564 this: *mut ffi::GtkEntry,
5565 _param_spec: glib::ffi::gpointer,
5566 f: glib::ffi::gpointer,
5567 ) {
5568 unsafe {
5569 let f: &F = &*(f as *const F);
5570 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5571 }
5572 }
5573 unsafe {
5574 let f: Box_<F> = Box_::new(f);
5575 connect_raw(
5576 self.as_ptr() as *mut _,
5577 c"notify::secondary-icon-sensitive".as_ptr(),
5578 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5579 notify_secondary_icon_sensitive_trampoline::<Self, F> as *const (),
5580 )),
5581 Box_::into_raw(f),
5582 )
5583 }
5584 }
5585
5586 #[doc(alias = "secondary-icon-storage-type")]
5587 fn connect_secondary_icon_storage_type_notify<F: Fn(&Self) + 'static>(
5588 &self,
5589 f: F,
5590 ) -> SignalHandlerId {
5591 unsafe extern "C" fn notify_secondary_icon_storage_type_trampoline<
5592 P: IsA<Entry>,
5593 F: Fn(&P) + 'static,
5594 >(
5595 this: *mut ffi::GtkEntry,
5596 _param_spec: glib::ffi::gpointer,
5597 f: glib::ffi::gpointer,
5598 ) {
5599 unsafe {
5600 let f: &F = &*(f as *const F);
5601 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5602 }
5603 }
5604 unsafe {
5605 let f: Box_<F> = Box_::new(f);
5606 connect_raw(
5607 self.as_ptr() as *mut _,
5608 c"notify::secondary-icon-storage-type".as_ptr(),
5609 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5610 notify_secondary_icon_storage_type_trampoline::<Self, F> as *const (),
5611 )),
5612 Box_::into_raw(f),
5613 )
5614 }
5615 }
5616
5617 #[doc(alias = "secondary-icon-tooltip-markup")]
5618 fn connect_secondary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>(
5619 &self,
5620 f: F,
5621 ) -> SignalHandlerId {
5622 unsafe extern "C" fn notify_secondary_icon_tooltip_markup_trampoline<
5623 P: IsA<Entry>,
5624 F: Fn(&P) + 'static,
5625 >(
5626 this: *mut ffi::GtkEntry,
5627 _param_spec: glib::ffi::gpointer,
5628 f: glib::ffi::gpointer,
5629 ) {
5630 unsafe {
5631 let f: &F = &*(f as *const F);
5632 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5633 }
5634 }
5635 unsafe {
5636 let f: Box_<F> = Box_::new(f);
5637 connect_raw(
5638 self.as_ptr() as *mut _,
5639 c"notify::secondary-icon-tooltip-markup".as_ptr(),
5640 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5641 notify_secondary_icon_tooltip_markup_trampoline::<Self, F> as *const (),
5642 )),
5643 Box_::into_raw(f),
5644 )
5645 }
5646 }
5647
5648 #[doc(alias = "secondary-icon-tooltip-text")]
5649 fn connect_secondary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>(
5650 &self,
5651 f: F,
5652 ) -> SignalHandlerId {
5653 unsafe extern "C" fn notify_secondary_icon_tooltip_text_trampoline<
5654 P: IsA<Entry>,
5655 F: Fn(&P) + 'static,
5656 >(
5657 this: *mut ffi::GtkEntry,
5658 _param_spec: glib::ffi::gpointer,
5659 f: glib::ffi::gpointer,
5660 ) {
5661 unsafe {
5662 let f: &F = &*(f as *const F);
5663 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5664 }
5665 }
5666 unsafe {
5667 let f: Box_<F> = Box_::new(f);
5668 connect_raw(
5669 self.as_ptr() as *mut _,
5670 c"notify::secondary-icon-tooltip-text".as_ptr(),
5671 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5672 notify_secondary_icon_tooltip_text_trampoline::<Self, F> as *const (),
5673 )),
5674 Box_::into_raw(f),
5675 )
5676 }
5677 }
5678
5679 #[doc(alias = "selection-bound")]
5680 fn connect_selection_bound_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5681 unsafe extern "C" fn notify_selection_bound_trampoline<
5682 P: IsA<Entry>,
5683 F: Fn(&P) + 'static,
5684 >(
5685 this: *mut ffi::GtkEntry,
5686 _param_spec: glib::ffi::gpointer,
5687 f: glib::ffi::gpointer,
5688 ) {
5689 unsafe {
5690 let f: &F = &*(f as *const F);
5691 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5692 }
5693 }
5694 unsafe {
5695 let f: Box_<F> = Box_::new(f);
5696 connect_raw(
5697 self.as_ptr() as *mut _,
5698 c"notify::selection-bound".as_ptr(),
5699 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5700 notify_selection_bound_trampoline::<Self, F> as *const (),
5701 )),
5702 Box_::into_raw(f),
5703 )
5704 }
5705 }
5706
5707 #[doc(alias = "show-emoji-icon")]
5708 fn connect_show_emoji_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5709 unsafe extern "C" fn notify_show_emoji_icon_trampoline<
5710 P: IsA<Entry>,
5711 F: Fn(&P) + 'static,
5712 >(
5713 this: *mut ffi::GtkEntry,
5714 _param_spec: glib::ffi::gpointer,
5715 f: glib::ffi::gpointer,
5716 ) {
5717 unsafe {
5718 let f: &F = &*(f as *const F);
5719 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5720 }
5721 }
5722 unsafe {
5723 let f: Box_<F> = Box_::new(f);
5724 connect_raw(
5725 self.as_ptr() as *mut _,
5726 c"notify::show-emoji-icon".as_ptr(),
5727 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5728 notify_show_emoji_icon_trampoline::<Self, F> as *const (),
5729 )),
5730 Box_::into_raw(f),
5731 )
5732 }
5733 }
5734
5735 #[doc(alias = "tabs")]
5736 fn connect_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5737 unsafe extern "C" fn notify_tabs_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5738 this: *mut ffi::GtkEntry,
5739 _param_spec: glib::ffi::gpointer,
5740 f: glib::ffi::gpointer,
5741 ) {
5742 unsafe {
5743 let f: &F = &*(f as *const F);
5744 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5745 }
5746 }
5747 unsafe {
5748 let f: Box_<F> = Box_::new(f);
5749 connect_raw(
5750 self.as_ptr() as *mut _,
5751 c"notify::tabs".as_ptr(),
5752 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5753 notify_tabs_trampoline::<Self, F> as *const (),
5754 )),
5755 Box_::into_raw(f),
5756 )
5757 }
5758 }
5759
5760 #[doc(alias = "text")]
5761 fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5762 unsafe extern "C" fn notify_text_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5763 this: *mut ffi::GtkEntry,
5764 _param_spec: glib::ffi::gpointer,
5765 f: glib::ffi::gpointer,
5766 ) {
5767 unsafe {
5768 let f: &F = &*(f as *const F);
5769 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5770 }
5771 }
5772 unsafe {
5773 let f: Box_<F> = Box_::new(f);
5774 connect_raw(
5775 self.as_ptr() as *mut _,
5776 c"notify::text".as_ptr(),
5777 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5778 notify_text_trampoline::<Self, F> as *const (),
5779 )),
5780 Box_::into_raw(f),
5781 )
5782 }
5783 }
5784
5785 #[doc(alias = "text-length")]
5786 fn connect_text_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5787 unsafe extern "C" fn notify_text_length_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5788 this: *mut ffi::GtkEntry,
5789 _param_spec: glib::ffi::gpointer,
5790 f: glib::ffi::gpointer,
5791 ) {
5792 unsafe {
5793 let f: &F = &*(f as *const F);
5794 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5795 }
5796 }
5797 unsafe {
5798 let f: Box_<F> = Box_::new(f);
5799 connect_raw(
5800 self.as_ptr() as *mut _,
5801 c"notify::text-length".as_ptr(),
5802 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5803 notify_text_length_trampoline::<Self, F> as *const (),
5804 )),
5805 Box_::into_raw(f),
5806 )
5807 }
5808 }
5809
5810 #[doc(alias = "truncate-multiline")]
5811 fn connect_truncate_multiline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5812 unsafe extern "C" fn notify_truncate_multiline_trampoline<
5813 P: IsA<Entry>,
5814 F: Fn(&P) + 'static,
5815 >(
5816 this: *mut ffi::GtkEntry,
5817 _param_spec: glib::ffi::gpointer,
5818 f: glib::ffi::gpointer,
5819 ) {
5820 unsafe {
5821 let f: &F = &*(f as *const F);
5822 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5823 }
5824 }
5825 unsafe {
5826 let f: Box_<F> = Box_::new(f);
5827 connect_raw(
5828 self.as_ptr() as *mut _,
5829 c"notify::truncate-multiline".as_ptr(),
5830 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5831 notify_truncate_multiline_trampoline::<Self, F> as *const (),
5832 )),
5833 Box_::into_raw(f),
5834 )
5835 }
5836 }
5837
5838 #[doc(alias = "visibility")]
5839 fn connect_visibility_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5840 unsafe extern "C" fn notify_visibility_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5841 this: *mut ffi::GtkEntry,
5842 _param_spec: glib::ffi::gpointer,
5843 f: glib::ffi::gpointer,
5844 ) {
5845 unsafe {
5846 let f: &F = &*(f as *const F);
5847 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5848 }
5849 }
5850 unsafe {
5851 let f: Box_<F> = Box_::new(f);
5852 connect_raw(
5853 self.as_ptr() as *mut _,
5854 c"notify::visibility".as_ptr(),
5855 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5856 notify_visibility_trampoline::<Self, F> as *const (),
5857 )),
5858 Box_::into_raw(f),
5859 )
5860 }
5861 }
5862
5863 #[doc(alias = "width-chars")]
5864 fn connect_width_chars_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5865 unsafe extern "C" fn notify_width_chars_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5866 this: *mut ffi::GtkEntry,
5867 _param_spec: glib::ffi::gpointer,
5868 f: glib::ffi::gpointer,
5869 ) {
5870 unsafe {
5871 let f: &F = &*(f as *const F);
5872 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5873 }
5874 }
5875 unsafe {
5876 let f: Box_<F> = Box_::new(f);
5877 connect_raw(
5878 self.as_ptr() as *mut _,
5879 c"notify::width-chars".as_ptr(),
5880 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5881 notify_width_chars_trampoline::<Self, F> as *const (),
5882 )),
5883 Box_::into_raw(f),
5884 )
5885 }
5886 }
5887
5888 #[doc(alias = "xalign")]
5889 fn connect_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5890 unsafe extern "C" fn notify_xalign_trampoline<P: IsA<Entry>, F: Fn(&P) + 'static>(
5891 this: *mut ffi::GtkEntry,
5892 _param_spec: glib::ffi::gpointer,
5893 f: glib::ffi::gpointer,
5894 ) {
5895 unsafe {
5896 let f: &F = &*(f as *const F);
5897 f(Entry::from_glib_borrow(this).unsafe_cast_ref())
5898 }
5899 }
5900 unsafe {
5901 let f: Box_<F> = Box_::new(f);
5902 connect_raw(
5903 self.as_ptr() as *mut _,
5904 c"notify::xalign".as_ptr(),
5905 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5906 notify_xalign_trampoline::<Self, F> as *const (),
5907 )),
5908 Box_::into_raw(f),
5909 )
5910 }
5911 }
5912}
5913
5914impl<O: IsA<Entry>> EntryExt for O {}