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