vte4/auto/terminal.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5#![allow(deprecated)]
6
7#[cfg(feature = "v0_76")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
9use crate::Align;
10use crate::{
11 ffi, CursorBlinkMode, CursorShape, EraseBinding, Format, Pty, PtyFlags, Regex, TextBlinkMode,
12 WriteFlags,
13};
14use glib::{
15 prelude::*,
16 signal::{connect_raw, SignalHandlerId},
17 translate::*,
18};
19use std::boxed::Box as Box_;
20
21glib::wrapper! {
22 ///
23 ///
24 /// ## Properties
25 ///
26 ///
27 /// #### `allow-bold`
28 /// Controls whether or not the terminal will attempt to draw bold text,
29 /// by using a bold font variant.
30 ///
31 /// Readable | Writeable
32 ///
33 ///
34 /// #### `allow-hyperlink`
35 /// Controls whether or not hyperlinks (OSC 8 escape sequence) are recognized and displayed.
36 ///
37 /// Readable | Writeable
38 ///
39 ///
40 /// #### `audible-bell`
41 /// Controls whether or not the terminal will beep when the child outputs the
42 /// "bl" sequence.
43 ///
44 /// Readable | Writeable
45 ///
46 ///
47 /// #### `backspace-binding`
48 /// Controls what string or control sequence the terminal sends to its child
49 /// when the user presses the backspace key.
50 ///
51 /// Readable | Writeable
52 ///
53 ///
54 /// #### `bold-is-bright`
55 /// Whether the SGR 1 attribute also switches to the bright counterpart
56 /// of the first 8 palette colors, in addition to making them bold (legacy behavior)
57 /// or if SGR 1 only enables bold and leaves the color intact.
58 ///
59 /// Readable | Writeable
60 ///
61 ///
62 /// #### `cell-height-scale`
63 /// Scale factor for the cell height, to increase line spacing. (The font's height is not affected.)
64 ///
65 /// Readable | Writeable
66 ///
67 ///
68 /// #### `cell-width-scale`
69 /// Scale factor for the cell width, to increase letter spacing. (The font's width is not affected.)
70 ///
71 /// Readable | Writeable
72 ///
73 ///
74 /// #### `cjk-ambiguous-width`
75 /// This setting controls whether ambiguous-width characters are narrow or wide.
76 /// (Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
77 /// the width of ambiguous-width characters is fixed and determined by the encoding
78 /// itself.)
79 ///
80 /// This setting only takes effect the next time the terminal is reset, either
81 /// via escape sequence or with vte_terminal_reset().
82 ///
83 /// Readable | Writeable
84 ///
85 ///
86 /// #### `context-menu`
87 /// The menu used for context menus. Note that context menu model set with the
88 /// #VteTerminal::context-menu-model property or vte_terminal_set_context_menu_model()
89 /// takes precedence over this.
90 ///
91 /// Readable | Writeable
92 ///
93 ///
94 /// #### `context-menu-model`
95 /// The menu model used for context menus. If non-[`None`], the context menu is
96 /// generated from this model, and overrides a context menu set with the
97 /// #VteTerminal::context-menu property or vte_terminal_set_context_menu().
98 ///
99 /// Readable | Writeable
100 ///
101 ///
102 /// #### `current-container-name`
103 /// The name of the current container, or [`None`] if unset.
104 ///
105 /// Readable
106 ///
107 ///
108 /// #### `current-container-runtime`
109 /// The name of the runtime toolset used to set up the current
110 /// container, or [`None`] if unset.
111 ///
112 /// Readable
113 ///
114 ///
115 /// #### `current-directory-uri`
116 /// The current directory URI, or [`None`] if unset.
117 ///
118 /// Readable
119 ///
120 ///
121 /// #### `current-file-uri`
122 /// The current file URI, or [`None`] if unset.
123 ///
124 /// Readable
125 ///
126 ///
127 /// #### `cursor-blink-mode`
128 /// Sets whether or not the cursor will blink. Using [`CursorBlinkMode::System`][crate::CursorBlinkMode::System]
129 /// will use the #GtkSettings:gtk-cursor-blink setting.
130 ///
131 /// Readable | Writeable
132 ///
133 ///
134 /// #### `cursor-shape`
135 /// Controls the shape of the cursor.
136 ///
137 /// Readable | Writeable
138 ///
139 ///
140 /// #### `delete-binding`
141 /// Controls what string or control sequence the terminal sends to its child
142 /// when the user presses the delete key.
143 ///
144 /// Readable | Writeable
145 ///
146 ///
147 /// #### `enable-a11y`
148 /// Controls whether or not a11y is enabled for the widget.
149 ///
150 /// Readable | Writeable
151 ///
152 ///
153 /// #### `enable-bidi`
154 /// Controls whether or not the terminal will perform bidirectional text rendering.
155 ///
156 /// Readable | Writeable
157 ///
158 ///
159 /// #### `enable-fallback-scrolling`
160 /// Readable | Writeable
161 ///
162 ///
163 /// #### `enable-shaping`
164 /// Controls whether or not the terminal will shape Arabic text.
165 ///
166 /// Readable | Writeable
167 ///
168 ///
169 /// #### `enable-sixel`
170 /// Controls whether SIXEL image support is enabled.
171 ///
172 /// Readable | Writeable
173 ///
174 ///
175 /// #### `encoding`
176 /// Controls the encoding the terminal will expect data from the child to
177 /// be encoded with. For certain terminal types, applications executing in the
178 /// terminal can change the encoding. The default is defined by the
179 /// application's locale settings.
180 ///
181 /// Readable | Writeable
182 ///
183 ///
184 /// #### `font-desc`
185 /// Specifies the font used for rendering all text displayed by the terminal,
186 /// overriding any fonts set using gtk_widget_modify_font(). The terminal
187 /// will immediately attempt to load the desired font, retrieve its
188 /// metrics, and attempt to resize itself to keep the same number of rows
189 /// and columns.
190 ///
191 /// Readable | Writeable
192 ///
193 ///
194 /// #### `font-options`
195 /// The terminal's font options, or [`None`] to use the default font options.
196 ///
197 /// Note that on GTK4, the terminal by default uses font options
198 /// with `CAIRO_HINT_METRICS_ON` set; to override that, use this
199 /// function to set a #cairo_font_options_t that has
200 /// `CAIRO_HINT_METRICS_OFF` set.
201 ///
202 /// Readable | Writeable
203 ///
204 ///
205 /// #### `font-scale`
206 /// The terminal's font scale.
207 ///
208 /// Readable | Writeable
209 ///
210 ///
211 /// #### `hyperlink-hover-uri`
212 /// The currently hovered hyperlink URI, or [`None`] if unset.
213 ///
214 /// Readable
215 ///
216 ///
217 /// #### `icon-title`
218 /// Readable
219 ///
220 ///
221 /// #### `input-enabled`
222 /// Controls whether the terminal allows user input. When user input is disabled,
223 /// key press and mouse button press and motion events are not sent to the
224 /// terminal's child.
225 ///
226 /// Readable | Writeable
227 ///
228 ///
229 /// #### `pointer-autohide`
230 /// Controls the value of the terminal's mouse autohide setting. When autohiding
231 /// is enabled, the mouse cursor will be hidden when the user presses a key and
232 /// shown when the user moves the mouse.
233 ///
234 /// Readable | Writeable
235 ///
236 ///
237 /// #### `pty`
238 /// The PTY object for the terminal.
239 ///
240 /// Readable | Writeable
241 ///
242 ///
243 /// #### `rewrap-on-resize`
244 /// Controls whether or not the terminal will rewrap its contents, including
245 /// the scrollback buffer, whenever the terminal's width changes.
246 ///
247 /// Readable | Writeable
248 ///
249 ///
250 /// #### `scroll-on-insert`
251 /// Controls whether or not the terminal will forcibly scroll to the bottom of
252 /// the viewable history when the text is inserted (e.g. by a paste).
253 ///
254 /// Readable | Writeable
255 ///
256 ///
257 /// #### `scroll-on-keystroke`
258 /// Controls whether or not the terminal will forcibly scroll to the bottom of
259 /// the viewable history when the user presses a key. Modifier keys do not
260 /// trigger this behavior.
261 ///
262 /// Readable | Writeable
263 ///
264 ///
265 /// #### `scroll-on-output`
266 /// Controls whether or not the terminal will forcibly scroll to the bottom of
267 /// the viewable history when the new data is received from the child.
268 ///
269 /// Readable | Writeable
270 ///
271 ///
272 /// #### `scroll-unit-is-pixels`
273 /// Controls whether the terminal's GtkAdjustment values unit is lines
274 /// or pixels. This can be enabled when the terminal is the child of a
275 /// GtkScrolledWindow to fix some bugs with its kinetic scrolling.
276 ///
277 /// Readable | Writeable
278 ///
279 ///
280 /// #### `scrollback-lines`
281 /// The length of the scrollback buffer used by the terminal. The size of
282 /// the scrollback buffer will be set to the larger of this value and the number
283 /// of visible rows the widget can display, so 0 can safely be used to disable
284 /// scrollback. Note that this setting only affects the normal screen buffer.
285 /// For terminal types which have an alternate screen buffer, no scrollback is
286 /// allowed on the alternate screen buffer.
287 ///
288 /// Readable | Writeable
289 ///
290 ///
291 /// #### `text-blink-mode`
292 /// Controls whether or not the terminal will allow blinking text.
293 ///
294 /// Readable | Writeable
295 ///
296 ///
297 /// #### `window-title`
298 /// The terminal's title.
299 ///
300 /// Readable
301 ///
302 ///
303 /// #### `word-char-exceptions`
304 /// The set of characters which will be considered parts of a word
305 /// when doing word-wise selection, in addition to the default which only
306 /// considers alphanumeric characters part of a word.
307 ///
308 /// If [`None`], a built-in set is used.
309 ///
310 /// Readable
311 ///
312 ///
313 /// #### `xalign`
314 /// The horizontal alignment of @terminal within its allocation.
315 ///
316 /// Readable | Writeable
317 ///
318 ///
319 /// #### `xfill`
320 /// The horizontal fillment of @terminal within its allocation.
321 ///
322 /// Readable | Writeable
323 ///
324 ///
325 /// #### `yalign`
326 /// The vertical alignment of @terminal within its allocation
327 ///
328 /// Readable | Writeable
329 ///
330 ///
331 /// #### `yfill`
332 /// The vertical fillment of @terminal within its allocation.
333 /// Note that #VteTerminal:yfill=[`true`] is only supported with
334 /// #VteTerminal:yalign=[`Align::Start`][crate::Align::Start], and is ignored for
335 /// all other yalign values.
336 ///
337 /// Readable | Writeable
338 /// <details><summary><h4>Widget</h4></summary>
339 ///
340 ///
341 /// #### `can-focus`
342 /// Whether the widget or any of its descendents can accept
343 /// the input focus.
344 ///
345 /// This property is meant to be set by widget implementations,
346 /// typically in their instance init function.
347 ///
348 /// Readable | Writeable
349 ///
350 ///
351 /// #### `can-target`
352 /// Whether the widget can receive pointer events.
353 ///
354 /// Readable | Writeable
355 ///
356 ///
357 /// #### `css-classes`
358 /// A list of css classes applied to this widget.
359 ///
360 /// Readable | Writeable
361 ///
362 ///
363 /// #### `css-name`
364 /// The name of this widget in the CSS tree.
365 ///
366 /// This property is meant to be set by widget implementations,
367 /// typically in their instance init function.
368 ///
369 /// Readable | Writeable | Construct Only
370 ///
371 ///
372 /// #### `cursor`
373 /// The cursor used by @widget.
374 ///
375 /// Readable | Writeable
376 ///
377 ///
378 /// #### `focus-on-click`
379 /// Whether the widget should grab focus when it is clicked with the mouse.
380 ///
381 /// This property is only relevant for widgets that can take focus.
382 ///
383 /// Readable | Writeable
384 ///
385 ///
386 /// #### `focusable`
387 /// Whether this widget itself will accept the input focus.
388 ///
389 /// Readable | Writeable
390 ///
391 ///
392 /// #### `halign`
393 /// How to distribute horizontal space if widget gets extra space.
394 ///
395 /// Readable | Writeable
396 ///
397 ///
398 /// #### `has-default`
399 /// Whether the widget is the default widget.
400 ///
401 /// Readable
402 ///
403 ///
404 /// #### `has-focus`
405 /// Whether the widget has the input focus.
406 ///
407 /// Readable
408 ///
409 ///
410 /// #### `has-tooltip`
411 /// Enables or disables the emission of the ::query-tooltip signal on @widget.
412 ///
413 /// A value of [`true`] indicates that @widget can have a tooltip, in this case
414 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
415 /// determine whether it will provide a tooltip or not.
416 ///
417 /// Readable | Writeable
418 ///
419 ///
420 /// #### `height-request`
421 /// Override for height request of the widget.
422 ///
423 /// If this is -1, the natural request will be used.
424 ///
425 /// Readable | Writeable
426 ///
427 ///
428 /// #### `hexpand`
429 /// Whether to expand horizontally.
430 ///
431 /// Readable | Writeable
432 ///
433 ///
434 /// #### `hexpand-set`
435 /// Whether to use the `hexpand` property.
436 ///
437 /// Readable | Writeable
438 ///
439 ///
440 /// #### `layout-manager`
441 /// The `GtkLayoutManager` instance to use to compute the preferred size
442 /// of the widget, and allocate its children.
443 ///
444 /// This property is meant to be set by widget implementations,
445 /// typically in their instance init function.
446 ///
447 /// Readable | Writeable
448 ///
449 ///
450 /// #### `margin-bottom`
451 /// Margin on bottom side of widget.
452 ///
453 /// This property adds margin outside of the widget's normal size
454 /// request, the margin will be added in addition to the size from
455 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
456 ///
457 /// Readable | Writeable
458 ///
459 ///
460 /// #### `margin-end`
461 /// Margin on end of widget, horizontally.
462 ///
463 /// This property supports left-to-right and right-to-left text
464 /// directions.
465 ///
466 /// This property adds margin outside of the widget's normal size
467 /// request, the margin will be added in addition to the size from
468 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
469 ///
470 /// Readable | Writeable
471 ///
472 ///
473 /// #### `margin-start`
474 /// Margin on start of widget, horizontally.
475 ///
476 /// This property supports left-to-right and right-to-left text
477 /// directions.
478 ///
479 /// This property adds margin outside of the widget's normal size
480 /// request, the margin will be added in addition to the size from
481 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
482 ///
483 /// Readable | Writeable
484 ///
485 ///
486 /// #### `margin-top`
487 /// Margin on top side of widget.
488 ///
489 /// This property adds margin outside of the widget's normal size
490 /// request, the margin will be added in addition to the size from
491 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
492 ///
493 /// Readable | Writeable
494 ///
495 ///
496 /// #### `name`
497 /// The name of the widget.
498 ///
499 /// Readable | Writeable
500 ///
501 ///
502 /// #### `opacity`
503 /// The requested opacity of the widget.
504 ///
505 /// Readable | Writeable
506 ///
507 ///
508 /// #### `overflow`
509 /// How content outside the widget's content area is treated.
510 ///
511 /// This property is meant to be set by widget implementations,
512 /// typically in their instance init function.
513 ///
514 /// Readable | Writeable
515 ///
516 ///
517 /// #### `parent`
518 /// The parent widget of this widget.
519 ///
520 /// Readable
521 ///
522 ///
523 /// #### `receives-default`
524 /// Whether the widget will receive the default action when it is focused.
525 ///
526 /// Readable | Writeable
527 ///
528 ///
529 /// #### `root`
530 /// The `GtkRoot` widget of the widget tree containing this widget.
531 ///
532 /// This will be [`None`] if the widget is not contained in a root widget.
533 ///
534 /// Readable
535 ///
536 ///
537 /// #### `scale-factor`
538 /// The scale factor of the widget.
539 ///
540 /// Readable
541 ///
542 ///
543 /// #### `sensitive`
544 /// Whether the widget responds to input.
545 ///
546 /// Readable | Writeable
547 ///
548 ///
549 /// #### `tooltip-markup`
550 /// Sets the text of tooltip to be the given string, which is marked up
551 /// with Pango markup.
552 ///
553 /// Also see `Gtk::Tooltip::set_markup()`.
554 ///
555 /// This is a convenience property which will take care of getting the
556 /// tooltip shown if the given string is not [`None`]:
557 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to [`true`]
558 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
559 /// the default signal handler.
560 ///
561 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
562 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
563 ///
564 /// Readable | Writeable
565 ///
566 ///
567 /// #### `tooltip-text`
568 /// Sets the text of tooltip to be the given string.
569 ///
570 /// Also see `Gtk::Tooltip::set_text()`.
571 ///
572 /// This is a convenience property which will take care of getting the
573 /// tooltip shown if the given string is not [`None`]:
574 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to [`true`]
575 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
576 /// the default signal handler.
577 ///
578 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
579 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
580 ///
581 /// Readable | Writeable
582 ///
583 ///
584 /// #### `valign`
585 /// How to distribute vertical space if widget gets extra space.
586 ///
587 /// Readable | Writeable
588 ///
589 ///
590 /// #### `vexpand`
591 /// Whether to expand vertically.
592 ///
593 /// Readable | Writeable
594 ///
595 ///
596 /// #### `vexpand-set`
597 /// Whether to use the `vexpand` property.
598 ///
599 /// Readable | Writeable
600 ///
601 ///
602 /// #### `visible`
603 /// Whether the widget is visible.
604 ///
605 /// Readable | Writeable
606 ///
607 ///
608 /// #### `width-request`
609 /// Override for width request of the widget.
610 ///
611 /// If this is -1, the natural request will be used.
612 ///
613 /// Readable | Writeable
614 /// </details>
615 /// <details><summary><h4>Accessible</h4></summary>
616 ///
617 ///
618 /// #### `accessible-role`
619 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
620 ///
621 /// The accessible role cannot be changed once set.
622 ///
623 /// Readable | Writeable
624 /// </details>
625 /// <details><summary><h4>Scrollable</h4></summary>
626 ///
627 ///
628 /// #### `hadjustment`
629 /// Horizontal `GtkAdjustment` of the scrollable widget.
630 ///
631 /// This adjustment is shared between the scrollable widget and its parent.
632 ///
633 /// Readable | Writeable | Construct
634 ///
635 ///
636 /// #### `hscroll-policy`
637 /// Determines when horizontal scrolling should start.
638 ///
639 /// Readable | Writeable
640 ///
641 ///
642 /// #### `vadjustment`
643 /// Vertical `GtkAdjustment` of the scrollable widget.
644 ///
645 /// This adjustment is shared between the scrollable widget and its parent.
646 ///
647 /// Readable | Writeable | Construct
648 ///
649 ///
650 /// #### `vscroll-policy`
651 /// Determines when vertical scrolling should start.
652 ///
653 /// Readable | Writeable
654 /// </details>
655 ///
656 /// ## Signals
657 ///
658 ///
659 /// #### `bell`
660 /// This signal is emitted when the a child sends a bell request to the
661 /// terminal.
662 ///
663 ///
664 ///
665 ///
666 /// #### `char-size-changed`
667 /// Emitted whenever the cell size changes, e.g. due to a change in
668 /// font, font-scale or cell-width/height-scale.
669 ///
670 /// Note that this signal should rather be called "cell-size-changed".
671 ///
672 ///
673 ///
674 ///
675 /// #### `child-exited`
676 /// This signal is emitted when the terminal detects that a child
677 /// watched using vte_terminal_watch_child() has exited.
678 ///
679 ///
680 ///
681 ///
682 /// #### `commit`
683 /// Emitted whenever the terminal receives input from the user and
684 /// prepares to send it to the child process.
685 ///
686 ///
687 ///
688 ///
689 /// #### `contents-changed`
690 /// Emitted whenever the visible appearance of the terminal has changed.
691 /// Used primarily by #VteTerminalAccessible.
692 ///
693 ///
694 ///
695 ///
696 /// #### `copy-clipboard`
697 /// Emitted whenever vte_terminal_copy_clipboard() is called.
698 ///
699 /// Action
700 ///
701 ///
702 /// #### `current-directory-uri-changed`
703 /// Emitted when the current directory URI is modified.
704 ///
705 ///
706 ///
707 ///
708 /// #### `current-file-uri-changed`
709 /// Emitted when the current file URI is modified.
710 ///
711 ///
712 ///
713 ///
714 /// #### `cursor-moved`
715 /// Emitted whenever the cursor moves to a new character cell. Used
716 /// primarily by #VteTerminalAccessible.
717 ///
718 ///
719 ///
720 ///
721 /// #### `decrease-font-size`
722 /// Emitted when the user hits the '-' key while holding the Control key.
723 ///
724 ///
725 ///
726 ///
727 /// #### `deiconify-window`
728 /// Never emitted.
729 ///
730 ///
731 ///
732 ///
733 /// #### `encoding-changed`
734 /// Emitted whenever the terminal's current encoding has changed.
735 ///
736 /// Note: support for non-UTF-8 is deprecated.
737 ///
738 ///
739 ///
740 ///
741 /// #### `eof`
742 /// Emitted when the terminal receives an end-of-file from a child which
743 /// is running in the terminal. This signal is frequently (but not
744 /// always) emitted with a #VteTerminal::child-exited signal.
745 ///
746 ///
747 ///
748 ///
749 /// #### `hyperlink-hover-uri-changed`
750 /// Emitted when the hovered hyperlink changes.
751 ///
752 /// @uri and @bbox are owned by VTE, must not be modified, and might
753 /// change after the signal handlers returns.
754 ///
755 /// The signal is not re-emitted when the bounding box changes for the
756 /// same hyperlink. This might change in a future VTE version without notice.
757 ///
758 ///
759 ///
760 ///
761 /// #### `icon-title-changed`
762 ///
763 ///
764 ///
765 /// #### `iconify-window`
766 /// Never emitted.
767 ///
768 ///
769 ///
770 ///
771 /// #### `increase-font-size`
772 /// Emitted when the user hits the '+' key while holding the Control key.
773 ///
774 ///
775 ///
776 ///
777 /// #### `lower-window`
778 /// Never emitted.
779 ///
780 ///
781 ///
782 ///
783 /// #### `maximize-window`
784 /// Never emitted.
785 ///
786 ///
787 ///
788 ///
789 /// #### `move-window`
790 /// Never emitted.
791 ///
792 ///
793 ///
794 ///
795 /// #### `notification-received`
796 /// Emitted when a process running in the terminal wants to
797 /// send a notification to the desktop environment.
798 ///
799 ///
800 ///
801 ///
802 /// #### `paste-clipboard`
803 /// Emitted whenever vte_terminal_paste_clipboard() is called.
804 ///
805 /// Action
806 ///
807 ///
808 /// #### `raise-window`
809 /// Never emitted.
810 ///
811 ///
812 ///
813 ///
814 /// #### `refresh-window`
815 /// Never emitted.
816 ///
817 ///
818 ///
819 ///
820 /// #### `resize-window`
821 /// Emitted at the child application's request.
822 ///
823 ///
824 ///
825 ///
826 /// #### `restore-window`
827 /// Never emitted.
828 ///
829 ///
830 ///
831 ///
832 /// #### `selection-changed`
833 /// Emitted whenever the contents of terminal's selection changes.
834 ///
835 ///
836 ///
837 ///
838 /// #### `setup-context-menu`
839 /// Emitted with non-[`None`] context before @terminal shows a context menu.
840 /// The handler may set either a menu model using
841 /// vte_terminal_set_context_menu_model(), or a menu using
842 /// vte_terminal_set_context_menu(), which will then be used as context
843 /// menu.
844 /// If neither a menu model nor a menu are set, a context menu
845 /// will not be shown.
846 ///
847 /// Note that @context is only valid during the signal emission; you may
848 /// not retain it to call methods on it afterwards.
849 ///
850 /// Also emitted with [`None`] context after the context menu has been dismissed.
851 ///
852 ///
853 ///
854 ///
855 /// #### `shell-precmd`
856 /// Emitted right before an interactive shell shows a
857 /// first-level prompt.
858 ///
859 ///
860 ///
861 ///
862 /// #### `shell-preexec`
863 /// Emitted when the interactive shell has read in a complete
864 /// command and is about to execute it.
865 ///
866 ///
867 ///
868 ///
869 /// #### `window-title-changed`
870 /// Emitted when the #VteTerminal:window-title property is modified.
871 ///
872 ///
873 /// <details><summary><h4>Widget</h4></summary>
874 ///
875 ///
876 /// #### `destroy`
877 /// Signals that all holders of a reference to the widget should release
878 /// the reference that they hold.
879 ///
880 /// May result in finalization of the widget if all references are released.
881 ///
882 /// This signal is not suitable for saving widget state.
883 ///
884 ///
885 ///
886 ///
887 /// #### `direction-changed`
888 /// Emitted when the text direction of a widget changes.
889 ///
890 ///
891 ///
892 ///
893 /// #### `hide`
894 /// Emitted when @widget is hidden.
895 ///
896 ///
897 ///
898 ///
899 /// #### `keynav-failed`
900 /// Emitted if keyboard navigation fails.
901 ///
902 /// See [`WidgetExtManual::keynav_failed()`][crate::gtk::prelude::WidgetExtManual::keynav_failed()] for details.
903 ///
904 ///
905 ///
906 ///
907 /// #### `map`
908 /// Emitted when @widget is going to be mapped.
909 ///
910 /// A widget is mapped when the widget is visible (which is controlled with
911 /// [`visible`][struct@crate::gtk::Widget#visible]) and all its parents up to the toplevel widget
912 /// are also visible.
913 ///
914 /// The ::map signal can be used to determine whether a widget will be drawn,
915 /// for instance it can resume an animation that was stopped during the
916 /// emission of [`unmap`][struct@crate::gtk::Widget#unmap].
917 ///
918 ///
919 ///
920 ///
921 /// #### `mnemonic-activate`
922 /// Emitted when a widget is activated via a mnemonic.
923 ///
924 /// The default handler for this signal activates @widget if @group_cycling
925 /// is [`false`], or just makes @widget grab focus if @group_cycling is [`true`].
926 ///
927 ///
928 ///
929 ///
930 /// #### `move-focus`
931 /// Emitted when the focus is moved.
932 ///
933 /// The ::move-focus signal is a [keybinding signal](class.SignalAction.html).
934 ///
935 /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
936 /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
937 ///
938 /// Action
939 ///
940 ///
941 /// #### `query-tooltip`
942 /// Emitted when the widget’s tooltip is about to be shown.
943 ///
944 /// This happens when the [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] property
945 /// is [`true`] and the hover timeout has expired with the cursor hovering
946 /// "above" @widget; or emitted when @widget got focus in keyboard mode.
947 ///
948 /// Using the given coordinates, the signal handler should determine
949 /// whether a tooltip should be shown for @widget. If this is the case
950 /// [`true`] should be returned, [`false`] otherwise. Note that if
951 /// @keyboard_mode is [`true`], the values of @x and @y are undefined and
952 /// should not be used.
953 ///
954 /// The signal handler is free to manipulate @tooltip with the therefore
955 /// destined function calls.
956 ///
957 ///
958 ///
959 ///
960 /// #### `realize`
961 /// Emitted when @widget is associated with a `GdkSurface`.
962 ///
963 /// This means that [`WidgetExtManual::realize()`][crate::gtk::prelude::WidgetExtManual::realize()] has been called
964 /// or the widget has been mapped (that is, it is going to be drawn).
965 ///
966 ///
967 ///
968 ///
969 /// #### `show`
970 /// Emitted when @widget is shown.
971 ///
972 ///
973 ///
974 ///
975 /// #### `state-flags-changed`
976 /// Emitted when the widget state changes.
977 ///
978 /// See [`WidgetExtManual::state_flags()`][crate::gtk::prelude::WidgetExtManual::state_flags()].
979 ///
980 ///
981 ///
982 ///
983 /// #### `unmap`
984 /// Emitted when @widget is going to be unmapped.
985 ///
986 /// A widget is unmapped when either it or any of its parents up to the
987 /// toplevel widget have been set as hidden.
988 ///
989 /// As ::unmap indicates that a widget will not be shown any longer,
990 /// it can be used to, for example, stop an animation on the widget.
991 ///
992 ///
993 ///
994 ///
995 /// #### `unrealize`
996 /// Emitted when the `GdkSurface` associated with @widget is destroyed.
997 ///
998 /// This means that [`WidgetExtManual::unrealize()`][crate::gtk::prelude::WidgetExtManual::unrealize()] has been called
999 /// or the widget has been unmapped (that is, it is going to be hidden).
1000 ///
1001 ///
1002 /// </details>
1003 ///
1004 /// # Implements
1005 ///
1006 /// [`TerminalExt`][trait@crate::prelude::TerminalExt], [`trait@gtk::prelude::WidgetExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`], [`trait@gtk::prelude::ScrollableExt`]
1007 #[doc(alias = "VteTerminal")]
1008 pub struct Terminal(Object<ffi::VteTerminal, ffi::VteTerminalClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Scrollable;
1009
1010 match fn {
1011 type_ => || ffi::vte_terminal_get_type(),
1012 }
1013}
1014
1015impl Terminal {
1016 pub const NONE: Option<&'static Terminal> = None;
1017
1018 /// Creates a new terminal widget.
1019 ///
1020 /// # Returns
1021 ///
1022 /// a new #VteTerminal object
1023 #[doc(alias = "vte_terminal_new")]
1024 pub fn new() -> Terminal {
1025 assert_initialized_main_thread!();
1026 unsafe { from_glib_none(ffi::vte_terminal_new()) }
1027 }
1028
1029 // rustdoc-stripper-ignore-next
1030 /// Creates a new builder-pattern struct instance to construct [`Terminal`] objects.
1031 ///
1032 /// This method returns an instance of [`TerminalBuilder`](crate::builders::TerminalBuilder) which can be used to create [`Terminal`] objects.
1033 pub fn builder() -> TerminalBuilder {
1034 TerminalBuilder::new()
1035 }
1036}
1037
1038impl Default for Terminal {
1039 fn default() -> Self {
1040 Self::new()
1041 }
1042}
1043
1044// rustdoc-stripper-ignore-next
1045/// A [builder-pattern] type to construct [`Terminal`] objects.
1046///
1047/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1048#[must_use = "The builder must be built to be used"]
1049pub struct TerminalBuilder {
1050 builder: glib::object::ObjectBuilder<'static, Terminal>,
1051}
1052
1053impl TerminalBuilder {
1054 fn new() -> Self {
1055 Self {
1056 builder: glib::object::Object::builder(),
1057 }
1058 }
1059
1060 /// Controls whether or not hyperlinks (OSC 8 escape sequence) are recognized and displayed.
1061 pub fn allow_hyperlink(self, allow_hyperlink: bool) -> Self {
1062 Self {
1063 builder: self.builder.property("allow-hyperlink", allow_hyperlink),
1064 }
1065 }
1066
1067 /// Controls whether or not the terminal will beep when the child outputs the
1068 /// "bl" sequence.
1069 pub fn audible_bell(self, audible_bell: bool) -> Self {
1070 Self {
1071 builder: self.builder.property("audible-bell", audible_bell),
1072 }
1073 }
1074
1075 /// Controls what string or control sequence the terminal sends to its child
1076 /// when the user presses the backspace key.
1077 pub fn backspace_binding(self, backspace_binding: EraseBinding) -> Self {
1078 Self {
1079 builder: self
1080 .builder
1081 .property("backspace-binding", backspace_binding),
1082 }
1083 }
1084
1085 /// Whether the SGR 1 attribute also switches to the bright counterpart
1086 /// of the first 8 palette colors, in addition to making them bold (legacy behavior)
1087 /// or if SGR 1 only enables bold and leaves the color intact.
1088 pub fn bold_is_bright(self, bold_is_bright: bool) -> Self {
1089 Self {
1090 builder: self.builder.property("bold-is-bright", bold_is_bright),
1091 }
1092 }
1093
1094 /// Scale factor for the cell height, to increase line spacing. (The font's height is not affected.)
1095 pub fn cell_height_scale(self, cell_height_scale: f64) -> Self {
1096 Self {
1097 builder: self
1098 .builder
1099 .property("cell-height-scale", cell_height_scale),
1100 }
1101 }
1102
1103 /// Scale factor for the cell width, to increase letter spacing. (The font's width is not affected.)
1104 pub fn cell_width_scale(self, cell_width_scale: f64) -> Self {
1105 Self {
1106 builder: self.builder.property("cell-width-scale", cell_width_scale),
1107 }
1108 }
1109
1110 /// This setting controls whether ambiguous-width characters are narrow or wide.
1111 /// (Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
1112 /// the width of ambiguous-width characters is fixed and determined by the encoding
1113 /// itself.)
1114 ///
1115 /// This setting only takes effect the next time the terminal is reset, either
1116 /// via escape sequence or with vte_terminal_reset().
1117 pub fn cjk_ambiguous_width(self, cjk_ambiguous_width: i32) -> Self {
1118 Self {
1119 builder: self
1120 .builder
1121 .property("cjk-ambiguous-width", cjk_ambiguous_width),
1122 }
1123 }
1124
1125 /// The menu used for context menus. Note that context menu model set with the
1126 /// #VteTerminal::context-menu-model property or vte_terminal_set_context_menu_model()
1127 /// takes precedence over this.
1128 #[cfg(feature = "v0_76")]
1129 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1130 pub fn context_menu(self, context_menu: &impl IsA<gtk::Popover>) -> Self {
1131 Self {
1132 builder: self
1133 .builder
1134 .property("context-menu", context_menu.clone().upcast()),
1135 }
1136 }
1137
1138 /// The menu model used for context menus. If non-[`None`], the context menu is
1139 /// generated from this model, and overrides a context menu set with the
1140 /// #VteTerminal::context-menu property or vte_terminal_set_context_menu().
1141 #[cfg(feature = "v0_76")]
1142 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1143 pub fn context_menu_model(self, context_menu_model: &impl IsA<gio::MenuModel>) -> Self {
1144 Self {
1145 builder: self
1146 .builder
1147 .property("context-menu-model", context_menu_model.clone().upcast()),
1148 }
1149 }
1150
1151 /// Sets whether or not the cursor will blink. Using [`CursorBlinkMode::System`][crate::CursorBlinkMode::System]
1152 /// will use the #GtkSettings:gtk-cursor-blink setting.
1153 pub fn cursor_blink_mode(self, cursor_blink_mode: CursorBlinkMode) -> Self {
1154 Self {
1155 builder: self
1156 .builder
1157 .property("cursor-blink-mode", cursor_blink_mode),
1158 }
1159 }
1160
1161 /// Controls the shape of the cursor.
1162 pub fn cursor_shape(self, cursor_shape: CursorShape) -> Self {
1163 Self {
1164 builder: self.builder.property("cursor-shape", cursor_shape),
1165 }
1166 }
1167
1168 /// Controls what string or control sequence the terminal sends to its child
1169 /// when the user presses the delete key.
1170 pub fn delete_binding(self, delete_binding: EraseBinding) -> Self {
1171 Self {
1172 builder: self.builder.property("delete-binding", delete_binding),
1173 }
1174 }
1175
1176 /// Controls whether or not a11y is enabled for the widget.
1177 #[cfg(feature = "v0_78")]
1178 #[cfg_attr(docsrs, doc(cfg(feature = "v0_78")))]
1179 pub fn enable_a11y(self, enable_a11y: bool) -> Self {
1180 Self {
1181 builder: self.builder.property("enable-a11y", enable_a11y),
1182 }
1183 }
1184
1185 /// Controls whether or not the terminal will perform bidirectional text rendering.
1186 pub fn enable_bidi(self, enable_bidi: bool) -> Self {
1187 Self {
1188 builder: self.builder.property("enable-bidi", enable_bidi),
1189 }
1190 }
1191
1192 pub fn enable_fallback_scrolling(self, enable_fallback_scrolling: bool) -> Self {
1193 Self {
1194 builder: self
1195 .builder
1196 .property("enable-fallback-scrolling", enable_fallback_scrolling),
1197 }
1198 }
1199
1200 /// Controls whether or not the terminal will shape Arabic text.
1201 pub fn enable_shaping(self, enable_shaping: bool) -> Self {
1202 Self {
1203 builder: self.builder.property("enable-shaping", enable_shaping),
1204 }
1205 }
1206
1207 /// Controls whether SIXEL image support is enabled.
1208 pub fn enable_sixel(self, enable_sixel: bool) -> Self {
1209 Self {
1210 builder: self.builder.property("enable-sixel", enable_sixel),
1211 }
1212 }
1213
1214 /// Specifies the font used for rendering all text displayed by the terminal,
1215 /// overriding any fonts set using gtk_widget_modify_font(). The terminal
1216 /// will immediately attempt to load the desired font, retrieve its
1217 /// metrics, and attempt to resize itself to keep the same number of rows
1218 /// and columns.
1219 pub fn font_desc(self, font_desc: &pango::FontDescription) -> Self {
1220 Self {
1221 builder: self.builder.property("font-desc", font_desc),
1222 }
1223 }
1224
1225 /// The terminal's font options, or [`None`] to use the default font options.
1226 ///
1227 /// Note that on GTK4, the terminal by default uses font options
1228 /// with `CAIRO_HINT_METRICS_ON` set; to override that, use this
1229 /// function to set a #cairo_font_options_t that has
1230 /// `CAIRO_HINT_METRICS_OFF` set.
1231 #[cfg(feature = "v0_74")]
1232 #[cfg_attr(docsrs, doc(cfg(feature = "v0_74")))]
1233 pub fn font_options(self, font_options: &cairo::FontOptions) -> Self {
1234 Self {
1235 builder: self.builder.property("font-options", font_options),
1236 }
1237 }
1238
1239 /// The terminal's font scale.
1240 pub fn font_scale(self, font_scale: f64) -> Self {
1241 Self {
1242 builder: self.builder.property("font-scale", font_scale),
1243 }
1244 }
1245
1246 /// Controls whether the terminal allows user input. When user input is disabled,
1247 /// key press and mouse button press and motion events are not sent to the
1248 /// terminal's child.
1249 pub fn input_enabled(self, input_enabled: bool) -> Self {
1250 Self {
1251 builder: self.builder.property("input-enabled", input_enabled),
1252 }
1253 }
1254
1255 /// Controls the value of the terminal's mouse autohide setting. When autohiding
1256 /// is enabled, the mouse cursor will be hidden when the user presses a key and
1257 /// shown when the user moves the mouse.
1258 pub fn pointer_autohide(self, pointer_autohide: bool) -> Self {
1259 Self {
1260 builder: self.builder.property("pointer-autohide", pointer_autohide),
1261 }
1262 }
1263
1264 /// The PTY object for the terminal.
1265 pub fn pty(self, pty: &Pty) -> Self {
1266 Self {
1267 builder: self.builder.property("pty", pty.clone()),
1268 }
1269 }
1270
1271 /// Controls whether or not the terminal will forcibly scroll to the bottom of
1272 /// the viewable history when the text is inserted (e.g. by a paste).
1273 #[cfg(feature = "v0_76")]
1274 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1275 pub fn scroll_on_insert(self, scroll_on_insert: bool) -> Self {
1276 Self {
1277 builder: self.builder.property("scroll-on-insert", scroll_on_insert),
1278 }
1279 }
1280
1281 /// Controls whether or not the terminal will forcibly scroll to the bottom of
1282 /// the viewable history when the user presses a key. Modifier keys do not
1283 /// trigger this behavior.
1284 pub fn scroll_on_keystroke(self, scroll_on_keystroke: bool) -> Self {
1285 Self {
1286 builder: self
1287 .builder
1288 .property("scroll-on-keystroke", scroll_on_keystroke),
1289 }
1290 }
1291
1292 /// Controls whether or not the terminal will forcibly scroll to the bottom of
1293 /// the viewable history when the new data is received from the child.
1294 pub fn scroll_on_output(self, scroll_on_output: bool) -> Self {
1295 Self {
1296 builder: self.builder.property("scroll-on-output", scroll_on_output),
1297 }
1298 }
1299
1300 /// Controls whether the terminal's GtkAdjustment values unit is lines
1301 /// or pixels. This can be enabled when the terminal is the child of a
1302 /// GtkScrolledWindow to fix some bugs with its kinetic scrolling.
1303 pub fn scroll_unit_is_pixels(self, scroll_unit_is_pixels: bool) -> Self {
1304 Self {
1305 builder: self
1306 .builder
1307 .property("scroll-unit-is-pixels", scroll_unit_is_pixels),
1308 }
1309 }
1310
1311 /// The length of the scrollback buffer used by the terminal. The size of
1312 /// the scrollback buffer will be set to the larger of this value and the number
1313 /// of visible rows the widget can display, so 0 can safely be used to disable
1314 /// scrollback. Note that this setting only affects the normal screen buffer.
1315 /// For terminal types which have an alternate screen buffer, no scrollback is
1316 /// allowed on the alternate screen buffer.
1317 pub fn scrollback_lines(self, scrollback_lines: u32) -> Self {
1318 Self {
1319 builder: self.builder.property("scrollback-lines", scrollback_lines),
1320 }
1321 }
1322
1323 /// Controls whether or not the terminal will allow blinking text.
1324 pub fn text_blink_mode(self, text_blink_mode: TextBlinkMode) -> Self {
1325 Self {
1326 builder: self.builder.property("text-blink-mode", text_blink_mode),
1327 }
1328 }
1329
1330 /// The horizontal alignment of @terminal within its allocation.
1331 #[cfg(feature = "v0_76")]
1332 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1333 pub fn xalign(self, xalign: Align) -> Self {
1334 Self {
1335 builder: self.builder.property("xalign", xalign),
1336 }
1337 }
1338
1339 /// The horizontal fillment of @terminal within its allocation.
1340 #[cfg(feature = "v0_76")]
1341 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1342 pub fn xfill(self, xfill: bool) -> Self {
1343 Self {
1344 builder: self.builder.property("xfill", xfill),
1345 }
1346 }
1347
1348 /// The vertical alignment of @terminal within its allocation
1349 #[cfg(feature = "v0_76")]
1350 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1351 pub fn yalign(self, yalign: Align) -> Self {
1352 Self {
1353 builder: self.builder.property("yalign", yalign),
1354 }
1355 }
1356
1357 /// The vertical fillment of @terminal within its allocation.
1358 /// Note that #VteTerminal:yfill=[`true`] is only supported with
1359 /// #VteTerminal:yalign=[`Align::Start`][crate::Align::Start], and is ignored for
1360 /// all other yalign values.
1361 #[cfg(feature = "v0_76")]
1362 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1363 pub fn yfill(self, yfill: bool) -> Self {
1364 Self {
1365 builder: self.builder.property("yfill", yfill),
1366 }
1367 }
1368
1369 /// Whether the widget or any of its descendents can accept
1370 /// the input focus.
1371 ///
1372 /// This property is meant to be set by widget implementations,
1373 /// typically in their instance init function.
1374 pub fn can_focus(self, can_focus: bool) -> Self {
1375 Self {
1376 builder: self.builder.property("can-focus", can_focus),
1377 }
1378 }
1379
1380 /// Whether the widget can receive pointer events.
1381 pub fn can_target(self, can_target: bool) -> Self {
1382 Self {
1383 builder: self.builder.property("can-target", can_target),
1384 }
1385 }
1386
1387 /// A list of css classes applied to this widget.
1388 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1389 Self {
1390 builder: self.builder.property("css-classes", css_classes.into()),
1391 }
1392 }
1393
1394 /// The name of this widget in the CSS tree.
1395 ///
1396 /// This property is meant to be set by widget implementations,
1397 /// typically in their instance init function.
1398 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1399 Self {
1400 builder: self.builder.property("css-name", css_name.into()),
1401 }
1402 }
1403
1404 //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self {
1405 // Self { builder: self.builder.property("cursor", cursor), }
1406 //}
1407
1408 /// Whether the widget should grab focus when it is clicked with the mouse.
1409 ///
1410 /// This property is only relevant for widgets that can take focus.
1411 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1412 Self {
1413 builder: self.builder.property("focus-on-click", focus_on_click),
1414 }
1415 }
1416
1417 /// Whether this widget itself will accept the input focus.
1418 pub fn focusable(self, focusable: bool) -> Self {
1419 Self {
1420 builder: self.builder.property("focusable", focusable),
1421 }
1422 }
1423
1424 //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self {
1425 // Self { builder: self.builder.property("halign", halign), }
1426 //}
1427
1428 /// Enables or disables the emission of the ::query-tooltip signal on @widget.
1429 ///
1430 /// A value of [`true`] indicates that @widget can have a tooltip, in this case
1431 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
1432 /// determine whether it will provide a tooltip or not.
1433 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1434 Self {
1435 builder: self.builder.property("has-tooltip", has_tooltip),
1436 }
1437 }
1438
1439 /// Override for height request of the widget.
1440 ///
1441 /// If this is -1, the natural request will be used.
1442 pub fn height_request(self, height_request: i32) -> Self {
1443 Self {
1444 builder: self.builder.property("height-request", height_request),
1445 }
1446 }
1447
1448 /// Whether to expand horizontally.
1449 pub fn hexpand(self, hexpand: bool) -> Self {
1450 Self {
1451 builder: self.builder.property("hexpand", hexpand),
1452 }
1453 }
1454
1455 /// Whether to use the `hexpand` property.
1456 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1457 Self {
1458 builder: self.builder.property("hexpand-set", hexpand_set),
1459 }
1460 }
1461
1462 //pub fn layout_manager(self, layout_manager: &impl IsA</*Ignored*/gtk::LayoutManager>) -> Self {
1463 // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), }
1464 //}
1465
1466 /// Margin on bottom side of widget.
1467 ///
1468 /// This property adds margin outside of the widget's normal size
1469 /// request, the margin will be added in addition to the size from
1470 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1471 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1472 Self {
1473 builder: self.builder.property("margin-bottom", margin_bottom),
1474 }
1475 }
1476
1477 /// Margin on end of widget, horizontally.
1478 ///
1479 /// This property supports left-to-right and right-to-left text
1480 /// directions.
1481 ///
1482 /// This property adds margin outside of the widget's normal size
1483 /// request, the margin will be added in addition to the size from
1484 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1485 pub fn margin_end(self, margin_end: i32) -> Self {
1486 Self {
1487 builder: self.builder.property("margin-end", margin_end),
1488 }
1489 }
1490
1491 /// Margin on start of widget, horizontally.
1492 ///
1493 /// This property supports left-to-right and right-to-left text
1494 /// directions.
1495 ///
1496 /// This property adds margin outside of the widget's normal size
1497 /// request, the margin will be added in addition to the size from
1498 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1499 pub fn margin_start(self, margin_start: i32) -> Self {
1500 Self {
1501 builder: self.builder.property("margin-start", margin_start),
1502 }
1503 }
1504
1505 /// Margin on top side of widget.
1506 ///
1507 /// This property adds margin outside of the widget's normal size
1508 /// request, the margin will be added in addition to the size from
1509 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1510 pub fn margin_top(self, margin_top: i32) -> Self {
1511 Self {
1512 builder: self.builder.property("margin-top", margin_top),
1513 }
1514 }
1515
1516 /// The name of the widget.
1517 pub fn name(self, name: impl Into<glib::GString>) -> Self {
1518 Self {
1519 builder: self.builder.property("name", name.into()),
1520 }
1521 }
1522
1523 /// The requested opacity of the widget.
1524 pub fn opacity(self, opacity: f64) -> Self {
1525 Self {
1526 builder: self.builder.property("opacity", opacity),
1527 }
1528 }
1529
1530 //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self {
1531 // Self { builder: self.builder.property("overflow", overflow), }
1532 //}
1533
1534 /// Whether the widget will receive the default action when it is focused.
1535 pub fn receives_default(self, receives_default: bool) -> Self {
1536 Self {
1537 builder: self.builder.property("receives-default", receives_default),
1538 }
1539 }
1540
1541 /// Whether the widget responds to input.
1542 pub fn sensitive(self, sensitive: bool) -> Self {
1543 Self {
1544 builder: self.builder.property("sensitive", sensitive),
1545 }
1546 }
1547
1548 /// Sets the text of tooltip to be the given string, which is marked up
1549 /// with Pango markup.
1550 ///
1551 /// Also see `Gtk::Tooltip::set_markup()`.
1552 ///
1553 /// This is a convenience property which will take care of getting the
1554 /// tooltip shown if the given string is not [`None`]:
1555 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to [`true`]
1556 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
1557 /// the default signal handler.
1558 ///
1559 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
1560 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
1561 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1562 Self {
1563 builder: self
1564 .builder
1565 .property("tooltip-markup", tooltip_markup.into()),
1566 }
1567 }
1568
1569 /// Sets the text of tooltip to be the given string.
1570 ///
1571 /// Also see `Gtk::Tooltip::set_text()`.
1572 ///
1573 /// This is a convenience property which will take care of getting the
1574 /// tooltip shown if the given string is not [`None`]:
1575 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to [`true`]
1576 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
1577 /// the default signal handler.
1578 ///
1579 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
1580 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
1581 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1582 Self {
1583 builder: self.builder.property("tooltip-text", tooltip_text.into()),
1584 }
1585 }
1586
1587 //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self {
1588 // Self { builder: self.builder.property("valign", valign), }
1589 //}
1590
1591 /// Whether to expand vertically.
1592 pub fn vexpand(self, vexpand: bool) -> Self {
1593 Self {
1594 builder: self.builder.property("vexpand", vexpand),
1595 }
1596 }
1597
1598 /// Whether to use the `vexpand` property.
1599 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1600 Self {
1601 builder: self.builder.property("vexpand-set", vexpand_set),
1602 }
1603 }
1604
1605 /// Whether the widget is visible.
1606 pub fn visible(self, visible: bool) -> Self {
1607 Self {
1608 builder: self.builder.property("visible", visible),
1609 }
1610 }
1611
1612 /// Override for width request of the widget.
1613 ///
1614 /// If this is -1, the natural request will be used.
1615 pub fn width_request(self, width_request: i32) -> Self {
1616 Self {
1617 builder: self.builder.property("width-request", width_request),
1618 }
1619 }
1620
1621 //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self {
1622 // Self { builder: self.builder.property("accessible-role", accessible_role), }
1623 //}
1624
1625 //pub fn hadjustment(self, hadjustment: &impl IsA</*Ignored*/gtk::Adjustment>) -> Self {
1626 // Self { builder: self.builder.property("hadjustment", hadjustment.clone().upcast()), }
1627 //}
1628
1629 //pub fn hscroll_policy(self, hscroll_policy: /*Ignored*/gtk::ScrollablePolicy) -> Self {
1630 // Self { builder: self.builder.property("hscroll-policy", hscroll_policy), }
1631 //}
1632
1633 //pub fn vadjustment(self, vadjustment: &impl IsA</*Ignored*/gtk::Adjustment>) -> Self {
1634 // Self { builder: self.builder.property("vadjustment", vadjustment.clone().upcast()), }
1635 //}
1636
1637 //pub fn vscroll_policy(self, vscroll_policy: /*Ignored*/gtk::ScrollablePolicy) -> Self {
1638 // Self { builder: self.builder.property("vscroll-policy", vscroll_policy), }
1639 //}
1640
1641 // rustdoc-stripper-ignore-next
1642 /// Build the [`Terminal`].
1643 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1644 pub fn build(self) -> Terminal {
1645 self.builder.build()
1646 }
1647}
1648
1649mod sealed {
1650 pub trait Sealed {}
1651 impl<T: super::IsA<super::Terminal>> Sealed for T {}
1652}
1653
1654/// Trait containing all [`struct@Terminal`] methods.
1655///
1656/// # Implementors
1657///
1658/// [`Terminal`][struct@crate::Terminal]
1659pub trait TerminalExt: IsA<Terminal> + sealed::Sealed + 'static {
1660 /// Returns a nonempty string: the target of the explicit hyperlink (printed using the OSC 8
1661 /// escape sequence) at the position (x, y), or [`None`].
1662 ///
1663 /// Proper use of the escape sequence should result in URI-encoded URIs with a proper scheme
1664 /// like "http://", "https://", "file://", "mailto:" etc. This is, however, not enforced by VTE.
1665 /// The caller must tolerate the returned string potentially not being a valid URI.
1666 ///
1667 /// # Returns
1668 ///
1669 /// a newly allocated string containing the target of the hyperlink,
1670 /// or [`None`]
1671 #[cfg(feature = "v0_70")]
1672 #[cfg_attr(docsrs, doc(cfg(feature = "v0_70")))]
1673 #[doc(alias = "vte_terminal_check_hyperlink_at")]
1674 fn check_hyperlink_at(&self, x: f64, y: f64) -> Option<glib::GString> {
1675 unsafe {
1676 from_glib_full(ffi::vte_terminal_check_hyperlink_at(
1677 self.as_ref().to_glib_none().0,
1678 x,
1679 y,
1680 ))
1681 }
1682 }
1683
1684 /// Checks if the text in and around the position (x, y) matches any of the
1685 /// regular expressions previously set using vte_terminal_match_add(). If a
1686 /// match exists, the text string is returned and if @tag is not [`None`], the number
1687 /// associated with the matched regular expression will be stored in @tag.
1688 ///
1689 /// If more than one regular expression has been set with
1690 /// vte_terminal_match_add(), then expressions are checked in the order in
1691 /// which they were added.
1692 ///
1693 /// # Returns
1694 ///
1695 /// a newly allocated string which matches one of the previously
1696 /// set regular expressions, or [`None`] if there is no match
1697 ///
1698 /// ## `tag`
1699 /// a location to store the tag, or [`None`]
1700 #[cfg(feature = "v0_70")]
1701 #[cfg_attr(docsrs, doc(cfg(feature = "v0_70")))]
1702 #[doc(alias = "vte_terminal_check_match_at")]
1703 fn check_match_at(&self, x: f64, y: f64) -> (Option<glib::GString>, i32) {
1704 unsafe {
1705 let mut tag = std::mem::MaybeUninit::uninit();
1706 let ret = from_glib_full(ffi::vte_terminal_check_match_at(
1707 self.as_ref().to_glib_none().0,
1708 x,
1709 y,
1710 tag.as_mut_ptr(),
1711 ));
1712 (ret, tag.assume_init())
1713 }
1714 }
1715
1716 /// Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD
1717 /// selection in the form specified by @format.
1718 ///
1719 /// For all formats, the selection data (see #GtkSelectionData) will include the
1720 /// text targets (see gtk_target_list_add_text_targets() and
1721 /// gtk_selection_data_targets_includes_text()). For [`Format::Html`][crate::Format::Html],
1722 /// the selection will also include the "text/html" target, which when requested,
1723 /// returns the HTML data in UTF-16 with a U+FEFF BYTE ORDER MARK character at
1724 /// the start.
1725 /// ## `format`
1726 /// a #VteFormat
1727 #[doc(alias = "vte_terminal_copy_clipboard_format")]
1728 fn copy_clipboard_format(&self, format: Format) {
1729 unsafe {
1730 ffi::vte_terminal_copy_clipboard_format(
1731 self.as_ref().to_glib_none().0,
1732 format.into_glib(),
1733 );
1734 }
1735 }
1736
1737 /// Places the selected text in the terminal in the #GDK_SELECTION_PRIMARY
1738 /// selection.
1739 #[doc(alias = "vte_terminal_copy_primary")]
1740 fn copy_primary(&self) {
1741 unsafe {
1742 ffi::vte_terminal_copy_primary(self.as_ref().to_glib_none().0);
1743 }
1744 }
1745
1746 /// Interprets @data as if it were data received from a child process.
1747 /// ## `data`
1748 /// a string in the terminal's current encoding
1749 #[doc(alias = "vte_terminal_feed")]
1750 fn feed(&self, data: &[u8]) {
1751 let length = data.len() as _;
1752 unsafe {
1753 ffi::vte_terminal_feed(
1754 self.as_ref().to_glib_none().0,
1755 data.to_glib_none().0,
1756 length,
1757 );
1758 }
1759 }
1760
1761 /// Sends a block of UTF-8 text to the child as if it were entered by the user
1762 /// at the keyboard.
1763 /// ## `text`
1764 /// data to send to the child
1765 #[doc(alias = "vte_terminal_feed_child")]
1766 fn feed_child(&self, text: &[u8]) {
1767 let length = text.len() as _;
1768 unsafe {
1769 ffi::vte_terminal_feed_child(
1770 self.as_ref().to_glib_none().0,
1771 text.to_glib_none().0,
1772 length,
1773 );
1774 }
1775 }
1776
1777 /// Checks whether or not hyperlinks (OSC 8 escape sequence) are allowed.
1778 ///
1779 /// # Returns
1780 ///
1781 /// [`true`] if hyperlinks are enabled, [`false`] if not
1782 #[doc(alias = "vte_terminal_get_allow_hyperlink")]
1783 #[doc(alias = "get_allow_hyperlink")]
1784 #[doc(alias = "allow-hyperlink")]
1785 fn allows_hyperlink(&self) -> bool {
1786 unsafe {
1787 from_glib(ffi::vte_terminal_get_allow_hyperlink(
1788 self.as_ref().to_glib_none().0,
1789 ))
1790 }
1791 }
1792
1793 /// Checks whether or not the terminal will beep when the child outputs the
1794 /// "bl" sequence.
1795 ///
1796 /// # Returns
1797 ///
1798 /// [`true`] if audible bell is enabled, [`false`] if not
1799 #[doc(alias = "vte_terminal_get_audible_bell")]
1800 #[doc(alias = "get_audible_bell")]
1801 #[doc(alias = "audible-bell")]
1802 fn is_audible_bell(&self) -> bool {
1803 unsafe {
1804 from_glib(ffi::vte_terminal_get_audible_bell(
1805 self.as_ref().to_glib_none().0,
1806 ))
1807 }
1808 }
1809
1810 /// Checks whether the SGR 1 attribute also switches to the bright counterpart
1811 /// of the first 8 palette colors, in addition to making them bold (legacy behavior)
1812 /// or if SGR 1 only enables bold and leaves the color intact.
1813 ///
1814 /// # Returns
1815 ///
1816 /// [`true`] if bold also enables bright, [`false`] if not
1817 #[doc(alias = "vte_terminal_get_bold_is_bright")]
1818 #[doc(alias = "get_bold_is_bright")]
1819 #[doc(alias = "bold-is-bright")]
1820 fn is_bold_is_bright(&self) -> bool {
1821 unsafe {
1822 from_glib(ffi::vte_terminal_get_bold_is_bright(
1823 self.as_ref().to_glib_none().0,
1824 ))
1825 }
1826 }
1827
1828 ///
1829 /// # Returns
1830 ///
1831 /// the terminal's cell height scale
1832 #[doc(alias = "vte_terminal_get_cell_height_scale")]
1833 #[doc(alias = "get_cell_height_scale")]
1834 #[doc(alias = "cell-height-scale")]
1835 fn cell_height_scale(&self) -> f64 {
1836 unsafe { ffi::vte_terminal_get_cell_height_scale(self.as_ref().to_glib_none().0) }
1837 }
1838
1839 ///
1840 /// # Returns
1841 ///
1842 /// the terminal's cell width scale
1843 #[doc(alias = "vte_terminal_get_cell_width_scale")]
1844 #[doc(alias = "get_cell_width_scale")]
1845 #[doc(alias = "cell-width-scale")]
1846 fn cell_width_scale(&self) -> f64 {
1847 unsafe { ffi::vte_terminal_get_cell_width_scale(self.as_ref().to_glib_none().0) }
1848 }
1849
1850 ///
1851 /// # Returns
1852 ///
1853 /// the height of a character cell
1854 ///
1855 /// Note that this method should rather be called vte_terminal_get_cell_height,
1856 /// because the return value takes cell-height-scale into account.
1857 #[doc(alias = "vte_terminal_get_char_height")]
1858 #[doc(alias = "get_char_height")]
1859 fn char_height(&self) -> libc::c_long {
1860 unsafe { ffi::vte_terminal_get_char_height(self.as_ref().to_glib_none().0) }
1861 }
1862
1863 ///
1864 /// # Returns
1865 ///
1866 /// the width of a character cell
1867 ///
1868 /// Note that this method should rather be called vte_terminal_get_cell_width,
1869 /// because the return value takes cell-width-scale into account.
1870 #[doc(alias = "vte_terminal_get_char_width")]
1871 #[doc(alias = "get_char_width")]
1872 fn char_width(&self) -> libc::c_long {
1873 unsafe { ffi::vte_terminal_get_char_width(self.as_ref().to_glib_none().0) }
1874 }
1875
1876 /// Returns whether ambiguous-width characters are narrow or wide.
1877 /// (Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
1878 /// the width of ambiguous-width characters is fixed and determined by the encoding
1879 /// itself.)
1880 ///
1881 /// # Returns
1882 ///
1883 /// 1 if ambiguous-width characters are narrow, or 2 if they are wide
1884 #[doc(alias = "vte_terminal_get_cjk_ambiguous_width")]
1885 #[doc(alias = "get_cjk_ambiguous_width")]
1886 #[doc(alias = "cjk-ambiguous-width")]
1887 fn cjk_ambiguous_width(&self) -> i32 {
1888 unsafe { ffi::vte_terminal_get_cjk_ambiguous_width(self.as_ref().to_glib_none().0) }
1889 }
1890
1891 /// Returns the background colour, as used by @self when
1892 /// drawing the background, which may be different from
1893 /// the color set by vte_terminal_set_color_background().
1894 ///
1895 /// Note: you must only call this function while handling the
1896 /// GtkWidget::draw signal.
1897 ///
1898 /// This function is rarely useful. One use for it is if you disable
1899 /// drawing the background (see vte_terminal_set_clear_background())
1900 /// and then need to draw the background yourself.
1901 ///
1902 /// # Returns
1903 ///
1904 ///
1905 /// ## `color`
1906 /// a location to store a #GdkRGBA color
1907 #[doc(alias = "vte_terminal_get_color_background_for_draw")]
1908 #[doc(alias = "get_color_background_for_draw")]
1909 fn color_background_for_draw(&self) -> gdk::RGBA {
1910 unsafe {
1911 let mut color = gdk::RGBA::uninitialized();
1912 ffi::vte_terminal_get_color_background_for_draw(
1913 self.as_ref().to_glib_none().0,
1914 color.to_glib_none_mut().0,
1915 );
1916 color
1917 }
1918 }
1919
1920 ///
1921 /// # Returns
1922 ///
1923 /// the number of columns
1924 #[doc(alias = "vte_terminal_get_column_count")]
1925 #[doc(alias = "get_column_count")]
1926 fn column_count(&self) -> libc::c_long {
1927 unsafe { ffi::vte_terminal_get_column_count(self.as_ref().to_glib_none().0) }
1928 }
1929
1930 ///
1931 /// # Returns
1932 ///
1933 /// the context menu, or [`None`]
1934 #[cfg(feature = "v0_76")]
1935 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1936 #[doc(alias = "vte_terminal_get_context_menu")]
1937 #[doc(alias = "get_context_menu")]
1938 #[doc(alias = "context-menu")]
1939 fn context_menu(&self) -> Option<gtk::Widget> {
1940 unsafe {
1941 from_glib_none(ffi::vte_terminal_get_context_menu(
1942 self.as_ref().to_glib_none().0,
1943 ))
1944 }
1945 }
1946
1947 ///
1948 /// # Returns
1949 ///
1950 /// the context menu model, or [`None`]
1951 #[cfg(feature = "v0_76")]
1952 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
1953 #[doc(alias = "vte_terminal_get_context_menu_model")]
1954 #[doc(alias = "get_context_menu_model")]
1955 #[doc(alias = "context-menu-model")]
1956 fn context_menu_model(&self) -> Option<gio::MenuModel> {
1957 unsafe {
1958 from_glib_none(ffi::vte_terminal_get_context_menu_model(
1959 self.as_ref().to_glib_none().0,
1960 ))
1961 }
1962 }
1963
1964 ///
1965 /// # Returns
1966 ///
1967 /// the name of the current
1968 /// container, or [`None`]
1969 #[doc(alias = "vte_terminal_get_current_container_name")]
1970 #[doc(alias = "get_current_container_name")]
1971 #[doc(alias = "current-container-name")]
1972 fn current_container_name(&self) -> Option<glib::GString> {
1973 unsafe {
1974 from_glib_none(ffi::vte_terminal_get_current_container_name(
1975 self.as_ref().to_glib_none().0,
1976 ))
1977 }
1978 }
1979
1980 ///
1981 /// # Returns
1982 ///
1983 /// the name of the runtime
1984 /// toolset used to set up the current container, or [`None`]
1985 #[doc(alias = "vte_terminal_get_current_container_runtime")]
1986 #[doc(alias = "get_current_container_runtime")]
1987 #[doc(alias = "current-container-runtime")]
1988 fn current_container_runtime(&self) -> Option<glib::GString> {
1989 unsafe {
1990 from_glib_none(ffi::vte_terminal_get_current_container_runtime(
1991 self.as_ref().to_glib_none().0,
1992 ))
1993 }
1994 }
1995
1996 ///
1997 /// # Returns
1998 ///
1999 /// the URI of the current directory of the
2000 /// process running in the terminal, or [`None`]
2001 #[doc(alias = "vte_terminal_get_current_directory_uri")]
2002 #[doc(alias = "get_current_directory_uri")]
2003 #[doc(alias = "current-directory-uri")]
2004 fn current_directory_uri(&self) -> Option<glib::GString> {
2005 unsafe {
2006 from_glib_none(ffi::vte_terminal_get_current_directory_uri(
2007 self.as_ref().to_glib_none().0,
2008 ))
2009 }
2010 }
2011
2012 ///
2013 /// # Returns
2014 ///
2015 /// the URI of the current file the
2016 /// process running in the terminal is operating on, or [`None`] if
2017 /// not set
2018 #[doc(alias = "vte_terminal_get_current_file_uri")]
2019 #[doc(alias = "get_current_file_uri")]
2020 #[doc(alias = "current-file-uri")]
2021 fn current_file_uri(&self) -> Option<glib::GString> {
2022 unsafe {
2023 from_glib_none(ffi::vte_terminal_get_current_file_uri(
2024 self.as_ref().to_glib_none().0,
2025 ))
2026 }
2027 }
2028
2029 /// Returns the currently set cursor blink mode.
2030 ///
2031 /// # Returns
2032 ///
2033 /// cursor blink mode.
2034 #[doc(alias = "vte_terminal_get_cursor_blink_mode")]
2035 #[doc(alias = "get_cursor_blink_mode")]
2036 #[doc(alias = "cursor-blink-mode")]
2037 fn cursor_blink_mode(&self) -> CursorBlinkMode {
2038 unsafe {
2039 from_glib(ffi::vte_terminal_get_cursor_blink_mode(
2040 self.as_ref().to_glib_none().0,
2041 ))
2042 }
2043 }
2044
2045 /// Reads the location of the insertion cursor and returns it. The row
2046 /// coordinate is absolute.
2047 ///
2048 /// This method is unaware of BiDi. The returned column is logical column.
2049 ///
2050 /// # Returns
2051 ///
2052 ///
2053 /// ## `column`
2054 /// a location to store the column, or [`None`]
2055 ///
2056 /// ## `row`
2057 /// a location to store the row, or [`None`]
2058 #[doc(alias = "vte_terminal_get_cursor_position")]
2059 #[doc(alias = "get_cursor_position")]
2060 fn cursor_position(&self) -> (libc::c_long, libc::c_long) {
2061 unsafe {
2062 let mut column = std::mem::MaybeUninit::uninit();
2063 let mut row = std::mem::MaybeUninit::uninit();
2064 ffi::vte_terminal_get_cursor_position(
2065 self.as_ref().to_glib_none().0,
2066 column.as_mut_ptr(),
2067 row.as_mut_ptr(),
2068 );
2069 (column.assume_init(), row.assume_init())
2070 }
2071 }
2072
2073 /// Returns the currently set cursor shape.
2074 ///
2075 /// # Returns
2076 ///
2077 /// cursor shape.
2078 #[doc(alias = "vte_terminal_get_cursor_shape")]
2079 #[doc(alias = "get_cursor_shape")]
2080 #[doc(alias = "cursor-shape")]
2081 fn cursor_shape(&self) -> CursorShape {
2082 unsafe {
2083 from_glib(ffi::vte_terminal_get_cursor_shape(
2084 self.as_ref().to_glib_none().0,
2085 ))
2086 }
2087 }
2088
2089 /// Checks whether the terminal communicates with a11y backends
2090 ///
2091 /// # Returns
2092 ///
2093 /// [`true`] if a11y is enabled, [`false`] if not
2094 #[cfg(feature = "v0_78")]
2095 #[cfg_attr(docsrs, doc(cfg(feature = "v0_78")))]
2096 #[doc(alias = "vte_terminal_get_enable_a11y")]
2097 #[doc(alias = "get_enable_a11y")]
2098 #[doc(alias = "enable-a11y")]
2099 fn enables_a11y(&self) -> bool {
2100 unsafe {
2101 from_glib(ffi::vte_terminal_get_enable_a11y(
2102 self.as_ref().to_glib_none().0,
2103 ))
2104 }
2105 }
2106
2107 /// Checks whether the terminal performs bidirectional text rendering.
2108 ///
2109 /// # Returns
2110 ///
2111 /// [`true`] if BiDi is enabled, [`false`] if not
2112 #[doc(alias = "vte_terminal_get_enable_bidi")]
2113 #[doc(alias = "get_enable_bidi")]
2114 #[doc(alias = "enable-bidi")]
2115 fn enables_bidi(&self) -> bool {
2116 unsafe {
2117 from_glib(ffi::vte_terminal_get_enable_bidi(
2118 self.as_ref().to_glib_none().0,
2119 ))
2120 }
2121 }
2122
2123 ///
2124 /// # Returns
2125 ///
2126 /// [`true`] if fallback scrolling is enabled
2127 #[doc(alias = "vte_terminal_get_enable_fallback_scrolling")]
2128 #[doc(alias = "get_enable_fallback_scrolling")]
2129 #[doc(alias = "enable-fallback-scrolling")]
2130 fn enables_fallback_scrolling(&self) -> bool {
2131 unsafe {
2132 from_glib(ffi::vte_terminal_get_enable_fallback_scrolling(
2133 self.as_ref().to_glib_none().0,
2134 ))
2135 }
2136 }
2137
2138 /// Checks whether the terminal shapes Arabic text.
2139 ///
2140 /// # Returns
2141 ///
2142 /// [`true`] if Arabic shaping is enabled, [`false`] if not
2143 #[doc(alias = "vte_terminal_get_enable_shaping")]
2144 #[doc(alias = "get_enable_shaping")]
2145 #[doc(alias = "enable-shaping")]
2146 fn enables_shaping(&self) -> bool {
2147 unsafe {
2148 from_glib(ffi::vte_terminal_get_enable_shaping(
2149 self.as_ref().to_glib_none().0,
2150 ))
2151 }
2152 }
2153
2154 ///
2155 /// # Returns
2156 ///
2157 /// [`false`]
2158 #[doc(alias = "vte_terminal_get_enable_sixel")]
2159 #[doc(alias = "get_enable_sixel")]
2160 #[doc(alias = "enable-sixel")]
2161 fn enables_sixel(&self) -> bool {
2162 unsafe {
2163 from_glib(ffi::vte_terminal_get_enable_sixel(
2164 self.as_ref().to_glib_none().0,
2165 ))
2166 }
2167 }
2168
2169 /// Queries the terminal for information about the fonts which will be
2170 /// used to draw text in the terminal. The actual font takes the font scale
2171 /// into account, this is not reflected in the return value, the unscaled
2172 /// font is returned.
2173 ///
2174 /// # Returns
2175 ///
2176 /// a #PangoFontDescription describing the font the
2177 /// terminal uses to render text at the default font scale of 1.0.
2178 #[doc(alias = "vte_terminal_get_font")]
2179 #[doc(alias = "get_font")]
2180 fn font(&self) -> Option<pango::FontDescription> {
2181 unsafe { from_glib_none(ffi::vte_terminal_get_font(self.as_ref().to_glib_none().0)) }
2182 }
2183
2184 ///
2185 /// # Returns
2186 ///
2187 /// the terminal's font options, or [`None`]
2188 #[cfg(feature = "v0_74")]
2189 #[cfg_attr(docsrs, doc(cfg(feature = "v0_74")))]
2190 #[doc(alias = "vte_terminal_get_font_options")]
2191 #[doc(alias = "get_font_options")]
2192 #[doc(alias = "font-options")]
2193 fn font_options(&self) -> Option<cairo::FontOptions> {
2194 unsafe {
2195 from_glib_none(ffi::vte_terminal_get_font_options(
2196 self.as_ref().to_glib_none().0,
2197 ))
2198 }
2199 }
2200
2201 ///
2202 /// # Returns
2203 ///
2204 /// the terminal's font scale
2205 #[doc(alias = "vte_terminal_get_font_scale")]
2206 #[doc(alias = "get_font_scale")]
2207 #[doc(alias = "font-scale")]
2208 fn font_scale(&self) -> f64 {
2209 unsafe { ffi::vte_terminal_get_font_scale(self.as_ref().to_glib_none().0) }
2210 }
2211
2212 /// Checks if the terminal currently contains selected text. Note that this
2213 /// is different from determining if the terminal is the owner of any
2214 /// #GtkClipboard items.
2215 ///
2216 /// # Returns
2217 ///
2218 /// [`true`] if part of the text in the terminal is selected.
2219 #[doc(alias = "vte_terminal_get_has_selection")]
2220 #[doc(alias = "get_has_selection")]
2221 fn has_selection(&self) -> bool {
2222 unsafe {
2223 from_glib(ffi::vte_terminal_get_has_selection(
2224 self.as_ref().to_glib_none().0,
2225 ))
2226 }
2227 }
2228
2229 /// Returns whether the terminal allow user input.
2230 #[doc(alias = "vte_terminal_get_input_enabled")]
2231 #[doc(alias = "get_input_enabled")]
2232 #[doc(alias = "input-enabled")]
2233 fn is_input_enabled(&self) -> bool {
2234 unsafe {
2235 from_glib(ffi::vte_terminal_get_input_enabled(
2236 self.as_ref().to_glib_none().0,
2237 ))
2238 }
2239 }
2240
2241 /// Determines the value of the terminal's mouse autohide setting. When
2242 /// autohiding is enabled, the mouse cursor will be hidden when the user presses
2243 /// a key and shown when the user moves the mouse. This setting can be changed
2244 /// using vte_terminal_set_mouse_autohide().
2245 ///
2246 /// # Returns
2247 ///
2248 /// [`true`] if autohiding is enabled, [`false`] if not
2249 #[doc(alias = "vte_terminal_get_mouse_autohide")]
2250 #[doc(alias = "get_mouse_autohide")]
2251 fn is_mouse_autohide(&self) -> bool {
2252 unsafe {
2253 from_glib(ffi::vte_terminal_get_mouse_autohide(
2254 self.as_ref().to_glib_none().0,
2255 ))
2256 }
2257 }
2258
2259 /// Returns the #VtePty of @self.
2260 ///
2261 /// # Returns
2262 ///
2263 /// a #VtePty, or [`None`]
2264 #[doc(alias = "vte_terminal_get_pty")]
2265 #[doc(alias = "get_pty")]
2266 fn pty(&self) -> Option<Pty> {
2267 unsafe { from_glib_none(ffi::vte_terminal_get_pty(self.as_ref().to_glib_none().0)) }
2268 }
2269
2270 ///
2271 /// # Returns
2272 ///
2273 /// the number of rows
2274 #[doc(alias = "vte_terminal_get_row_count")]
2275 #[doc(alias = "get_row_count")]
2276 fn row_count(&self) -> libc::c_long {
2277 unsafe { ffi::vte_terminal_get_row_count(self.as_ref().to_glib_none().0) }
2278 }
2279
2280 ///
2281 /// # Returns
2282 ///
2283 /// whether or not the terminal will forcibly scroll to the bottom of
2284 /// the viewable history when the new data is received from the child.
2285 #[cfg(feature = "v0_76")]
2286 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
2287 #[doc(alias = "vte_terminal_get_scroll_on_insert")]
2288 #[doc(alias = "get_scroll_on_insert")]
2289 #[doc(alias = "scroll-on-insert")]
2290 fn is_scroll_on_insert(&self) -> bool {
2291 unsafe {
2292 from_glib(ffi::vte_terminal_get_scroll_on_insert(
2293 self.as_ref().to_glib_none().0,
2294 ))
2295 }
2296 }
2297
2298 ///
2299 /// # Returns
2300 ///
2301 /// whether or not the terminal will forcibly scroll to the bottom of
2302 /// the viewable history when the user presses a key. Modifier keys do not
2303 /// trigger this behavior.
2304 #[doc(alias = "vte_terminal_get_scroll_on_keystroke")]
2305 #[doc(alias = "get_scroll_on_keystroke")]
2306 #[doc(alias = "scroll-on-keystroke")]
2307 fn is_scroll_on_keystroke(&self) -> bool {
2308 unsafe {
2309 from_glib(ffi::vte_terminal_get_scroll_on_keystroke(
2310 self.as_ref().to_glib_none().0,
2311 ))
2312 }
2313 }
2314
2315 ///
2316 /// # Returns
2317 ///
2318 /// whether or not the terminal will forcibly scroll to the bottom of
2319 /// the viewable history when the new data is received from the child.
2320 #[doc(alias = "vte_terminal_get_scroll_on_output")]
2321 #[doc(alias = "get_scroll_on_output")]
2322 #[doc(alias = "scroll-on-output")]
2323 fn is_scroll_on_output(&self) -> bool {
2324 unsafe {
2325 from_glib(ffi::vte_terminal_get_scroll_on_output(
2326 self.as_ref().to_glib_none().0,
2327 ))
2328 }
2329 }
2330
2331 ///
2332 /// # Returns
2333 ///
2334 /// [`true`] if the scroll unit is pixels; or [`false`] if the unit is lines
2335 #[doc(alias = "vte_terminal_get_scroll_unit_is_pixels")]
2336 #[doc(alias = "get_scroll_unit_is_pixels")]
2337 #[doc(alias = "scroll-unit-is-pixels")]
2338 fn is_scroll_unit_is_pixels(&self) -> bool {
2339 unsafe {
2340 from_glib(ffi::vte_terminal_get_scroll_unit_is_pixels(
2341 self.as_ref().to_glib_none().0,
2342 ))
2343 }
2344 }
2345
2346 ///
2347 /// # Returns
2348 ///
2349 /// length of the scrollback buffer used by the terminal.
2350 /// A negative value means "infinite scrollback".
2351 #[doc(alias = "vte_terminal_get_scrollback_lines")]
2352 #[doc(alias = "get_scrollback_lines")]
2353 #[doc(alias = "scrollback-lines")]
2354 fn scrollback_lines(&self) -> libc::c_long {
2355 unsafe { ffi::vte_terminal_get_scrollback_lines(self.as_ref().to_glib_none().0) }
2356 }
2357
2358 //#[cfg_attr(feature = "v0_76", deprecated = "Since 0.76")]
2359 //#[allow(deprecated)]
2360 //#[doc(alias = "vte_terminal_get_text")]
2361 //#[doc(alias = "get_text")]
2362 //fn text(&self, is_selected: Option<&mut dyn (FnMut(&Terminal, libc::c_long, libc::c_long) -> bool)>, attributes: /*Unknown conversion*//*Unimplemented*/Array TypeId { ns_id: 1, id: 1 }) -> Option<glib::GString> {
2363 // unsafe { TODO: call ffi:vte_terminal_get_text() }
2364 //}
2365
2366 /// Checks whether or not the terminal will allow blinking text.
2367 ///
2368 /// # Returns
2369 ///
2370 /// the blinking setting
2371 #[doc(alias = "vte_terminal_get_text_blink_mode")]
2372 #[doc(alias = "get_text_blink_mode")]
2373 #[doc(alias = "text-blink-mode")]
2374 fn text_blink_mode(&self) -> TextBlinkMode {
2375 unsafe {
2376 from_glib(ffi::vte_terminal_get_text_blink_mode(
2377 self.as_ref().to_glib_none().0,
2378 ))
2379 }
2380 }
2381
2382 /// Returns text from the visible part of the terminal in the specified format.
2383 ///
2384 /// This method is unaware of BiDi. The columns returned in @attributes are
2385 /// logical columns.
2386 /// ## `format`
2387 /// the #VteFormat to use
2388 ///
2389 /// # Returns
2390 ///
2391 /// a newly allocated text string, or [`None`].
2392 #[cfg(feature = "v0_76")]
2393 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
2394 #[doc(alias = "vte_terminal_get_text_format")]
2395 #[doc(alias = "get_text_format")]
2396 fn text_format(&self, format: Format) -> Option<glib::GString> {
2397 unsafe {
2398 from_glib_full(ffi::vte_terminal_get_text_format(
2399 self.as_ref().to_glib_none().0,
2400 format.into_glib(),
2401 ))
2402 }
2403 }
2404
2405 //#[cfg_attr(feature = "v0_76", deprecated = "Since 0.76")]
2406 //#[allow(deprecated)]
2407 //#[doc(alias = "vte_terminal_get_text_range")]
2408 //#[doc(alias = "get_text_range")]
2409 //fn text_range(&self, start_row: libc::c_long, start_col: libc::c_long, end_row: libc::c_long, end_col: libc::c_long, is_selected: Option<&mut dyn (FnMut(&Terminal, libc::c_long, libc::c_long) -> bool)>, attributes: /*Unknown conversion*//*Unimplemented*/Array TypeId { ns_id: 1, id: 1 }) -> Option<glib::GString> {
2410 // unsafe { TODO: call ffi:vte_terminal_get_text_range() }
2411 //}
2412
2413 /// Returns the specified range of text in the specified format.
2414 /// ## `format`
2415 /// the #VteFormat to use
2416 /// ## `start_row`
2417 /// the first row of the range
2418 /// ## `start_col`
2419 /// the first column of the range
2420 /// ## `end_row`
2421 /// the last row of the range
2422 /// ## `end_col`
2423 /// the last column of the range
2424 ///
2425 /// # Returns
2426 ///
2427 /// a newly allocated string, or [`None`].
2428 ///
2429 /// ## `length`
2430 /// a pointer to a #gsize to store the string length
2431 #[cfg(feature = "v0_72")]
2432 #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))]
2433 #[doc(alias = "vte_terminal_get_text_range_format")]
2434 #[doc(alias = "get_text_range_format")]
2435 fn text_range_format(
2436 &self,
2437 format: Format,
2438 start_row: libc::c_long,
2439 start_col: libc::c_long,
2440 end_row: libc::c_long,
2441 end_col: libc::c_long,
2442 ) -> (Option<glib::GString>, usize) {
2443 unsafe {
2444 let mut length = std::mem::MaybeUninit::uninit();
2445 let ret = from_glib_full(ffi::vte_terminal_get_text_range_format(
2446 self.as_ref().to_glib_none().0,
2447 format.into_glib(),
2448 start_row,
2449 start_col,
2450 end_row,
2451 end_col,
2452 length.as_mut_ptr(),
2453 ));
2454 (ret, length.assume_init())
2455 }
2456 }
2457
2458 /// Gets the currently selected text in the format specified by @format.
2459 /// Since 0.72, this function also supports [`Format::Html`][crate::Format::Html] format.
2460 /// ## `format`
2461 /// the #VteFormat to use
2462 ///
2463 /// # Returns
2464 ///
2465 /// a newly allocated string containing the selected text, or [`None`] if there is no selection or the format is not supported
2466 #[cfg(feature = "v0_70")]
2467 #[cfg_attr(docsrs, doc(cfg(feature = "v0_70")))]
2468 #[doc(alias = "vte_terminal_get_text_selected")]
2469 #[doc(alias = "get_text_selected")]
2470 fn text_selected(&self, format: Format) -> Option<glib::GString> {
2471 unsafe {
2472 from_glib_full(ffi::vte_terminal_get_text_selected(
2473 self.as_ref().to_glib_none().0,
2474 format.into_glib(),
2475 ))
2476 }
2477 }
2478
2479 /// Gets the currently selected text in the format specified by @format.
2480 /// ## `format`
2481 /// the #VteFormat to use
2482 ///
2483 /// # Returns
2484 ///
2485 /// a newly allocated string containing the selected text, or [`None`] if there is no selection or the format is not supported
2486 ///
2487 /// ## `length`
2488 /// a pointer to a #gsize to store the string length
2489 #[cfg(feature = "v0_72")]
2490 #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))]
2491 #[doc(alias = "vte_terminal_get_text_selected_full")]
2492 #[doc(alias = "get_text_selected_full")]
2493 fn text_selected_full(&self, format: Format) -> (Option<glib::GString>, usize) {
2494 unsafe {
2495 let mut length = std::mem::MaybeUninit::uninit();
2496 let ret = from_glib_full(ffi::vte_terminal_get_text_selected_full(
2497 self.as_ref().to_glib_none().0,
2498 format.into_glib(),
2499 length.as_mut_ptr(),
2500 ));
2501 (ret, length.assume_init())
2502 }
2503 }
2504
2505 ///
2506 /// # Returns
2507 ///
2508 /// the window title, or [`None`]
2509 #[doc(alias = "vte_terminal_get_window_title")]
2510 #[doc(alias = "get_window_title")]
2511 #[doc(alias = "window-title")]
2512 fn window_title(&self) -> Option<glib::GString> {
2513 unsafe {
2514 from_glib_none(ffi::vte_terminal_get_window_title(
2515 self.as_ref().to_glib_none().0,
2516 ))
2517 }
2518 }
2519
2520 /// Returns the set of characters which will be considered parts of a word
2521 /// when doing word-wise selection, in addition to the default which only
2522 /// considers alphanumeric characters part of a word.
2523 ///
2524 /// If [`None`], a built-in set is used.
2525 ///
2526 /// # Returns
2527 ///
2528 /// a string, or [`None`]
2529 #[doc(alias = "vte_terminal_get_word_char_exceptions")]
2530 #[doc(alias = "get_word_char_exceptions")]
2531 #[doc(alias = "word-char-exceptions")]
2532 fn word_char_exceptions(&self) -> Option<glib::GString> {
2533 unsafe {
2534 from_glib_none(ffi::vte_terminal_get_word_char_exceptions(
2535 self.as_ref().to_glib_none().0,
2536 ))
2537 }
2538 }
2539
2540 ///
2541 /// # Returns
2542 ///
2543 /// the horizontal alignment of @self within its allocation
2544 #[cfg(feature = "v0_76")]
2545 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
2546 #[doc(alias = "vte_terminal_get_xalign")]
2547 #[doc(alias = "get_xalign")]
2548 fn xalign(&self) -> Align {
2549 unsafe { from_glib(ffi::vte_terminal_get_xalign(self.as_ref().to_glib_none().0)) }
2550 }
2551
2552 ///
2553 /// # Returns
2554 ///
2555 /// the horizontal fillment of @self within its allocation
2556 #[cfg(feature = "v0_76")]
2557 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
2558 #[doc(alias = "vte_terminal_get_xfill")]
2559 #[doc(alias = "get_xfill")]
2560 #[doc(alias = "xfill")]
2561 fn is_xfill(&self) -> bool {
2562 unsafe { from_glib(ffi::vte_terminal_get_xfill(self.as_ref().to_glib_none().0)) }
2563 }
2564
2565 ///
2566 /// # Returns
2567 ///
2568 /// the vertical alignment of @self within its allocation
2569 #[cfg(feature = "v0_76")]
2570 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
2571 #[doc(alias = "vte_terminal_get_yalign")]
2572 #[doc(alias = "get_yalign")]
2573 fn yalign(&self) -> Align {
2574 unsafe { from_glib(ffi::vte_terminal_get_yalign(self.as_ref().to_glib_none().0)) }
2575 }
2576
2577 ///
2578 /// # Returns
2579 ///
2580 /// the vertical fillment of @self within its allocation
2581 #[cfg(feature = "v0_76")]
2582 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
2583 #[doc(alias = "vte_terminal_get_yfill")]
2584 #[doc(alias = "get_yfill")]
2585 #[doc(alias = "yfill")]
2586 fn is_yfill(&self) -> bool {
2587 unsafe { from_glib(ffi::vte_terminal_get_yfill(self.as_ref().to_glib_none().0)) }
2588 }
2589
2590 /// Adds the regular expression @regex to the list of matching expressions. When the
2591 /// user moves the mouse cursor over a section of displayed text which matches
2592 /// this expression, the text will be highlighted.
2593 ///
2594 /// Note that @regex should have been created using the <literal>PCRE2_MULTILINE</literal>
2595 /// flag.
2596 /// ## `regex`
2597 /// a #VteRegex
2598 /// ## `flags`
2599 /// PCRE2 match flags, or 0
2600 ///
2601 /// # Returns
2602 ///
2603 /// an integer associated with this expression
2604 #[doc(alias = "vte_terminal_match_add_regex")]
2605 fn match_add_regex(&self, regex: &Regex, flags: u32) -> i32 {
2606 unsafe {
2607 ffi::vte_terminal_match_add_regex(
2608 self.as_ref().to_glib_none().0,
2609 regex.to_glib_none().0,
2610 flags,
2611 )
2612 }
2613 }
2614
2615 /// Removes the regular expression which is associated with the given @tag from
2616 /// the list of expressions which the terminal will highlight when the user
2617 /// moves the mouse cursor over matching text.
2618 /// ## `tag`
2619 /// the tag of the regex to remove
2620 #[doc(alias = "vte_terminal_match_remove")]
2621 fn match_remove(&self, tag: i32) {
2622 unsafe {
2623 ffi::vte_terminal_match_remove(self.as_ref().to_glib_none().0, tag);
2624 }
2625 }
2626
2627 /// Clears the list of regular expressions the terminal uses to highlight text
2628 /// when the user moves the mouse cursor.
2629 #[doc(alias = "vte_terminal_match_remove_all")]
2630 fn match_remove_all(&self) {
2631 unsafe {
2632 ffi::vte_terminal_match_remove_all(self.as_ref().to_glib_none().0);
2633 }
2634 }
2635
2636 /// Sets which cursor the terminal will use if the pointer is over the pattern
2637 /// specified by @tag.
2638 /// ## `tag`
2639 /// the tag of the regex which should use the specified cursor
2640 /// ## `cursor_name`
2641 /// the name of the cursor
2642 #[doc(alias = "vte_terminal_match_set_cursor_name")]
2643 fn match_set_cursor_name(&self, tag: i32, cursor_name: &str) {
2644 unsafe {
2645 ffi::vte_terminal_match_set_cursor_name(
2646 self.as_ref().to_glib_none().0,
2647 tag,
2648 cursor_name.to_glib_none().0,
2649 );
2650 }
2651 }
2652
2653 /// Sends the contents of the #GDK_SELECTION_CLIPBOARD selection to the
2654 /// terminal's child. It's called on paste menu item, or when
2655 /// user presses Shift+Insert.
2656 #[doc(alias = "vte_terminal_paste_clipboard")]
2657 fn paste_clipboard(&self) {
2658 unsafe {
2659 ffi::vte_terminal_paste_clipboard(self.as_ref().to_glib_none().0);
2660 }
2661 }
2662
2663 /// Sends the contents of the #GDK_SELECTION_PRIMARY selection to the terminal's
2664 /// child. The terminal will call also paste the
2665 /// #GDK_SELECTION_PRIMARY selection when the user clicks with the the second
2666 /// mouse button.
2667 #[doc(alias = "vte_terminal_paste_primary")]
2668 fn paste_primary(&self) {
2669 unsafe {
2670 ffi::vte_terminal_paste_primary(self.as_ref().to_glib_none().0);
2671 }
2672 }
2673
2674 /// Sends @text to the terminal's child as if retrived from the clipboard,
2675 /// this differs from vte_terminal_feed_child() in that it may process
2676 /// @text before passing it to the child (e.g. apply bracketed mode)
2677 /// ## `text`
2678 /// a string to paste
2679 #[doc(alias = "vte_terminal_paste_text")]
2680 fn paste_text(&self, text: &str) {
2681 unsafe {
2682 ffi::vte_terminal_paste_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
2683 }
2684 }
2685
2686 /// Creates a new #VtePty, sets the emulation property
2687 /// from #VteTerminal:emulation, and sets the size using
2688 /// @self's size.
2689 ///
2690 /// See vte_pty_new() for more information.
2691 /// ## `flags`
2692 /// flags from #VtePtyFlags
2693 /// ## `cancellable`
2694 /// a #GCancellable, or [`None`]
2695 ///
2696 /// # Returns
2697 ///
2698 /// a new #VtePty
2699 #[doc(alias = "vte_terminal_pty_new_sync")]
2700 fn pty_new_sync(
2701 &self,
2702 flags: PtyFlags,
2703 cancellable: Option<&impl IsA<gio::Cancellable>>,
2704 ) -> Result<Pty, glib::Error> {
2705 unsafe {
2706 let mut error = std::ptr::null_mut();
2707 let ret = ffi::vte_terminal_pty_new_sync(
2708 self.as_ref().to_glib_none().0,
2709 flags.into_glib(),
2710 cancellable.map(|p| p.as_ref()).to_glib_none().0,
2711 &mut error,
2712 );
2713 if error.is_null() {
2714 Ok(from_glib_full(ret))
2715 } else {
2716 Err(from_glib_full(error))
2717 }
2718 }
2719 }
2720
2721 /// Resets as much of the terminal's internal state as possible, discarding any
2722 /// unprocessed input data, resetting character attributes, cursor state,
2723 /// national character set state, status line, terminal modes (insert/delete),
2724 /// selection state, and encoding.
2725 /// ## `clear_tabstops`
2726 /// whether to reset tabstops
2727 /// ## `clear_history`
2728 /// whether to empty the terminal's scrollback buffer
2729 #[doc(alias = "vte_terminal_reset")]
2730 fn reset(&self, clear_tabstops: bool, clear_history: bool) {
2731 unsafe {
2732 ffi::vte_terminal_reset(
2733 self.as_ref().to_glib_none().0,
2734 clear_tabstops.into_glib(),
2735 clear_history.into_glib(),
2736 );
2737 }
2738 }
2739
2740 /// Searches the next string matching the search regex set with
2741 /// vte_terminal_search_set_regex().
2742 ///
2743 /// # Returns
2744 ///
2745 /// [`true`] if a match was found
2746 #[doc(alias = "vte_terminal_search_find_next")]
2747 fn search_find_next(&self) -> bool {
2748 unsafe {
2749 from_glib(ffi::vte_terminal_search_find_next(
2750 self.as_ref().to_glib_none().0,
2751 ))
2752 }
2753 }
2754
2755 /// Searches the previous string matching the search regex set with
2756 /// vte_terminal_search_set_regex().
2757 ///
2758 /// # Returns
2759 ///
2760 /// [`true`] if a match was found
2761 #[doc(alias = "vte_terminal_search_find_previous")]
2762 fn search_find_previous(&self) -> bool {
2763 unsafe {
2764 from_glib(ffi::vte_terminal_search_find_previous(
2765 self.as_ref().to_glib_none().0,
2766 ))
2767 }
2768 }
2769
2770 ///
2771 /// # Returns
2772 ///
2773 /// the search #VteRegex regex set in @self, or [`None`]
2774 #[doc(alias = "vte_terminal_search_get_regex")]
2775 fn search_get_regex(&self) -> Option<Regex> {
2776 unsafe {
2777 from_glib_none(ffi::vte_terminal_search_get_regex(
2778 self.as_ref().to_glib_none().0,
2779 ))
2780 }
2781 }
2782
2783 ///
2784 /// # Returns
2785 ///
2786 /// whether searching will wrap around
2787 #[doc(alias = "vte_terminal_search_get_wrap_around")]
2788 fn search_get_wrap_around(&self) -> bool {
2789 unsafe {
2790 from_glib(ffi::vte_terminal_search_get_wrap_around(
2791 self.as_ref().to_glib_none().0,
2792 ))
2793 }
2794 }
2795
2796 /// Sets the regex to search for. Unsets the search regex when passed [`None`].
2797 ///
2798 /// Note that @regex should have been created using the
2799 /// <literal>PCRE2_MULTILINE</literal> flag.
2800 /// ## `regex`
2801 /// a #VteRegex, or [`None`]
2802 /// ## `flags`
2803 /// PCRE2 match flags, or 0
2804 #[doc(alias = "vte_terminal_search_set_regex")]
2805 fn search_set_regex(&self, regex: Option<&Regex>, flags: u32) {
2806 unsafe {
2807 ffi::vte_terminal_search_set_regex(
2808 self.as_ref().to_glib_none().0,
2809 regex.to_glib_none().0,
2810 flags,
2811 );
2812 }
2813 }
2814
2815 /// Sets whether search should wrap around to the beginning of the
2816 /// terminal content when reaching its end.
2817 /// ## `wrap_around`
2818 /// whether search should wrap
2819 #[doc(alias = "vte_terminal_search_set_wrap_around")]
2820 fn search_set_wrap_around(&self, wrap_around: bool) {
2821 unsafe {
2822 ffi::vte_terminal_search_set_wrap_around(
2823 self.as_ref().to_glib_none().0,
2824 wrap_around.into_glib(),
2825 );
2826 }
2827 }
2828
2829 /// Selects all text within the terminal (not including the scrollback buffer).
2830 #[doc(alias = "vte_terminal_select_all")]
2831 fn select_all(&self) {
2832 unsafe {
2833 ffi::vte_terminal_select_all(self.as_ref().to_glib_none().0);
2834 }
2835 }
2836
2837 /// Controls whether or not hyperlinks (OSC 8 escape sequence) are allowed.
2838 /// ## `allow_hyperlink`
2839 /// [`true`] if the terminal should allow hyperlinks
2840 #[doc(alias = "vte_terminal_set_allow_hyperlink")]
2841 #[doc(alias = "allow-hyperlink")]
2842 fn set_allow_hyperlink(&self, allow_hyperlink: bool) {
2843 unsafe {
2844 ffi::vte_terminal_set_allow_hyperlink(
2845 self.as_ref().to_glib_none().0,
2846 allow_hyperlink.into_glib(),
2847 );
2848 }
2849 }
2850
2851 /// Controls whether or not the terminal will beep when the child outputs the
2852 /// "bl" sequence.
2853 /// ## `is_audible`
2854 /// [`true`] if the terminal should beep
2855 #[doc(alias = "vte_terminal_set_audible_bell")]
2856 #[doc(alias = "audible-bell")]
2857 fn set_audible_bell(&self, is_audible: bool) {
2858 unsafe {
2859 ffi::vte_terminal_set_audible_bell(
2860 self.as_ref().to_glib_none().0,
2861 is_audible.into_glib(),
2862 );
2863 }
2864 }
2865
2866 /// Modifies the terminal's backspace key binding, which controls what
2867 /// string or control sequence the terminal sends to its child when the user
2868 /// presses the backspace key.
2869 /// ## `binding`
2870 /// a #VteEraseBinding for the backspace key
2871 #[doc(alias = "vte_terminal_set_backspace_binding")]
2872 #[doc(alias = "backspace-binding")]
2873 fn set_backspace_binding(&self, binding: EraseBinding) {
2874 unsafe {
2875 ffi::vte_terminal_set_backspace_binding(
2876 self.as_ref().to_glib_none().0,
2877 binding.into_glib(),
2878 );
2879 }
2880 }
2881
2882 /// Sets whether the SGR 1 attribute also switches to the bright counterpart
2883 /// of the first 8 palette colors, in addition to making them bold (legacy behavior)
2884 /// or if SGR 1 only enables bold and leaves the color intact.
2885 /// ## `bold_is_bright`
2886 /// [`true`] if bold should also enable bright
2887 #[doc(alias = "vte_terminal_set_bold_is_bright")]
2888 #[doc(alias = "bold-is-bright")]
2889 fn set_bold_is_bright(&self, bold_is_bright: bool) {
2890 unsafe {
2891 ffi::vte_terminal_set_bold_is_bright(
2892 self.as_ref().to_glib_none().0,
2893 bold_is_bright.into_glib(),
2894 );
2895 }
2896 }
2897
2898 /// Sets the terminal's cell height scale to @scale.
2899 ///
2900 /// This can be used to increase the line spacing. (The font's height is not affected.)
2901 /// Valid values go from 1.0 (default) to 2.0 ("double spacing").
2902 /// ## `scale`
2903 /// the cell height scale
2904 #[doc(alias = "vte_terminal_set_cell_height_scale")]
2905 #[doc(alias = "cell-height-scale")]
2906 fn set_cell_height_scale(&self, scale: f64) {
2907 unsafe {
2908 ffi::vte_terminal_set_cell_height_scale(self.as_ref().to_glib_none().0, scale);
2909 }
2910 }
2911
2912 /// Sets the terminal's cell width scale to @scale.
2913 ///
2914 /// This can be used to increase the letter spacing. (The font's width is not affected.)
2915 /// Valid values go from 1.0 (default) to 2.0.
2916 /// ## `scale`
2917 /// the cell width scale
2918 #[doc(alias = "vte_terminal_set_cell_width_scale")]
2919 #[doc(alias = "cell-width-scale")]
2920 fn set_cell_width_scale(&self, scale: f64) {
2921 unsafe {
2922 ffi::vte_terminal_set_cell_width_scale(self.as_ref().to_glib_none().0, scale);
2923 }
2924 }
2925
2926 /// This setting controls whether ambiguous-width characters are narrow or wide.
2927 /// (Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
2928 /// the width of ambiguous-width characters is fixed and determined by the encoding
2929 /// itself.)
2930 /// ## `width`
2931 /// either 1 (narrow) or 2 (wide)
2932 #[doc(alias = "vte_terminal_set_cjk_ambiguous_width")]
2933 #[doc(alias = "cjk-ambiguous-width")]
2934 fn set_cjk_ambiguous_width(&self, width: i32) {
2935 unsafe {
2936 ffi::vte_terminal_set_cjk_ambiguous_width(self.as_ref().to_glib_none().0, width);
2937 }
2938 }
2939
2940 /// Sets whether to paint the background with the background colour.
2941 /// The default is [`true`].
2942 ///
2943 /// This function is rarely useful. One use for it is to add a background
2944 /// image to the terminal.
2945 /// ## `setting`
2946 /// whether to clear the background
2947 #[doc(alias = "vte_terminal_set_clear_background")]
2948 fn set_clear_background(&self, setting: bool) {
2949 unsafe {
2950 ffi::vte_terminal_set_clear_background(
2951 self.as_ref().to_glib_none().0,
2952 setting.into_glib(),
2953 );
2954 }
2955 }
2956
2957 /// Sets the background color for text which does not have a specific background
2958 /// color assigned. Only has effect when no background image is set and when
2959 /// the terminal is not transparent.
2960 /// ## `background`
2961 /// the new background color
2962 #[doc(alias = "vte_terminal_set_color_background")]
2963 fn set_color_background(&self, background: &gdk::RGBA) {
2964 unsafe {
2965 ffi::vte_terminal_set_color_background(
2966 self.as_ref().to_glib_none().0,
2967 background.to_glib_none().0,
2968 );
2969 }
2970 }
2971
2972 /// Sets the color used to draw bold text in the default foreground color.
2973 /// If @bold is [`None`] then the default color is used.
2974 /// ## `bold`
2975 /// the new bold color or [`None`]
2976 #[doc(alias = "vte_terminal_set_color_bold")]
2977 fn set_color_bold(&self, bold: Option<&gdk::RGBA>) {
2978 unsafe {
2979 ffi::vte_terminal_set_color_bold(self.as_ref().to_glib_none().0, bold.to_glib_none().0);
2980 }
2981 }
2982
2983 /// Sets the background color for text which is under the cursor. If [`None`], text
2984 /// under the cursor will be drawn with foreground and background colors
2985 /// reversed.
2986 /// ## `cursor_background`
2987 /// the new color to use for the text cursor, or [`None`]
2988 #[doc(alias = "vte_terminal_set_color_cursor")]
2989 fn set_color_cursor(&self, cursor_background: Option<&gdk::RGBA>) {
2990 unsafe {
2991 ffi::vte_terminal_set_color_cursor(
2992 self.as_ref().to_glib_none().0,
2993 cursor_background.to_glib_none().0,
2994 );
2995 }
2996 }
2997
2998 /// Sets the foreground color for text which is under the cursor. If [`None`], text
2999 /// under the cursor will be drawn with foreground and background colors
3000 /// reversed.
3001 /// ## `cursor_foreground`
3002 /// the new color to use for the text cursor, or [`None`]
3003 #[doc(alias = "vte_terminal_set_color_cursor_foreground")]
3004 fn set_color_cursor_foreground(&self, cursor_foreground: Option<&gdk::RGBA>) {
3005 unsafe {
3006 ffi::vte_terminal_set_color_cursor_foreground(
3007 self.as_ref().to_glib_none().0,
3008 cursor_foreground.to_glib_none().0,
3009 );
3010 }
3011 }
3012
3013 /// Sets the foreground color used to draw normal text.
3014 /// ## `foreground`
3015 /// the new foreground color
3016 #[doc(alias = "vte_terminal_set_color_foreground")]
3017 fn set_color_foreground(&self, foreground: &gdk::RGBA) {
3018 unsafe {
3019 ffi::vte_terminal_set_color_foreground(
3020 self.as_ref().to_glib_none().0,
3021 foreground.to_glib_none().0,
3022 );
3023 }
3024 }
3025
3026 /// Sets the background color for text which is highlighted. If [`None`],
3027 /// it is unset. If neither highlight background nor highlight foreground are set,
3028 /// highlighted text (which is usually highlighted because it is selected) will
3029 /// be drawn with foreground and background colors reversed.
3030 /// ## `highlight_background`
3031 /// the new color to use for highlighted text, or [`None`]
3032 #[doc(alias = "vte_terminal_set_color_highlight")]
3033 fn set_color_highlight(&self, highlight_background: Option<&gdk::RGBA>) {
3034 unsafe {
3035 ffi::vte_terminal_set_color_highlight(
3036 self.as_ref().to_glib_none().0,
3037 highlight_background.to_glib_none().0,
3038 );
3039 }
3040 }
3041
3042 /// Sets the foreground color for text which is highlighted. If [`None`],
3043 /// it is unset. If neither highlight background nor highlight foreground are set,
3044 /// highlighted text (which is usually highlighted because it is selected) will
3045 /// be drawn with foreground and background colors reversed.
3046 /// ## `highlight_foreground`
3047 /// the new color to use for highlighted text, or [`None`]
3048 #[doc(alias = "vte_terminal_set_color_highlight_foreground")]
3049 fn set_color_highlight_foreground(&self, highlight_foreground: Option<&gdk::RGBA>) {
3050 unsafe {
3051 ffi::vte_terminal_set_color_highlight_foreground(
3052 self.as_ref().to_glib_none().0,
3053 highlight_foreground.to_glib_none().0,
3054 );
3055 }
3056 }
3057
3058 /// Sets @menu as the context menu in @self.
3059 /// Use [`None`] to unset the current menu.
3060 ///
3061 /// Note that a menu model set with vte_terminal_set_context_menu_model()
3062 /// takes precedence over a menu set using this function.
3063 /// ## `menu`
3064 /// a menu
3065 #[cfg(feature = "v0_76")]
3066 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3067 #[doc(alias = "vte_terminal_set_context_menu")]
3068 #[doc(alias = "context-menu")]
3069 fn set_context_menu(&self, menu: Option<&impl IsA<gtk::Widget>>) {
3070 unsafe {
3071 ffi::vte_terminal_set_context_menu(
3072 self.as_ref().to_glib_none().0,
3073 menu.map(|p| p.as_ref()).to_glib_none().0,
3074 );
3075 }
3076 }
3077
3078 /// Sets @model as the context menu model in @self.
3079 /// Use [`None`] to unset the current menu model.
3080 /// ## `model`
3081 /// a #GMenuModel
3082 #[cfg(feature = "v0_76")]
3083 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3084 #[doc(alias = "vte_terminal_set_context_menu_model")]
3085 #[doc(alias = "context-menu-model")]
3086 fn set_context_menu_model(&self, model: Option<&impl IsA<gio::MenuModel>>) {
3087 unsafe {
3088 ffi::vte_terminal_set_context_menu_model(
3089 self.as_ref().to_glib_none().0,
3090 model.map(|p| p.as_ref()).to_glib_none().0,
3091 );
3092 }
3093 }
3094
3095 /// Sets whether or not the cursor will blink. Using [`CursorBlinkMode::System`][crate::CursorBlinkMode::System]
3096 /// will use the #GtkSettings::gtk-cursor-blink setting.
3097 /// ## `mode`
3098 /// the #VteCursorBlinkMode to use
3099 #[doc(alias = "vte_terminal_set_cursor_blink_mode")]
3100 #[doc(alias = "cursor-blink-mode")]
3101 fn set_cursor_blink_mode(&self, mode: CursorBlinkMode) {
3102 unsafe {
3103 ffi::vte_terminal_set_cursor_blink_mode(
3104 self.as_ref().to_glib_none().0,
3105 mode.into_glib(),
3106 );
3107 }
3108 }
3109
3110 /// Sets the shape of the cursor drawn.
3111 /// ## `shape`
3112 /// the #VteCursorShape to use
3113 #[doc(alias = "vte_terminal_set_cursor_shape")]
3114 #[doc(alias = "cursor-shape")]
3115 fn set_cursor_shape(&self, shape: CursorShape) {
3116 unsafe {
3117 ffi::vte_terminal_set_cursor_shape(self.as_ref().to_glib_none().0, shape.into_glib());
3118 }
3119 }
3120
3121 /// Reset the terminal palette to reasonable compiled-in default color.
3122 #[doc(alias = "vte_terminal_set_default_colors")]
3123 fn set_default_colors(&self) {
3124 unsafe {
3125 ffi::vte_terminal_set_default_colors(self.as_ref().to_glib_none().0);
3126 }
3127 }
3128
3129 /// Modifies the terminal's delete key binding, which controls what
3130 /// string or control sequence the terminal sends to its child when the user
3131 /// presses the delete key.
3132 /// ## `binding`
3133 /// a #VteEraseBinding for the delete key
3134 #[doc(alias = "vte_terminal_set_delete_binding")]
3135 #[doc(alias = "delete-binding")]
3136 fn set_delete_binding(&self, binding: EraseBinding) {
3137 unsafe {
3138 ffi::vte_terminal_set_delete_binding(
3139 self.as_ref().to_glib_none().0,
3140 binding.into_glib(),
3141 );
3142 }
3143 }
3144
3145 /// Controls whether or not the terminal will communicate with a11y backends.
3146 /// ## `enable_a11y`
3147 /// [`true`] to enable a11y support
3148 #[cfg(feature = "v0_78")]
3149 #[cfg_attr(docsrs, doc(cfg(feature = "v0_78")))]
3150 #[doc(alias = "vte_terminal_set_enable_a11y")]
3151 #[doc(alias = "enable-a11y")]
3152 fn set_enable_a11y(&self, enable_a11y: bool) {
3153 unsafe {
3154 ffi::vte_terminal_set_enable_a11y(
3155 self.as_ref().to_glib_none().0,
3156 enable_a11y.into_glib(),
3157 );
3158 }
3159 }
3160
3161 /// Controls whether or not the terminal will perform bidirectional text rendering.
3162 /// ## `enable_bidi`
3163 /// [`true`] to enable BiDi support
3164 #[doc(alias = "vte_terminal_set_enable_bidi")]
3165 #[doc(alias = "enable-bidi")]
3166 fn set_enable_bidi(&self, enable_bidi: bool) {
3167 unsafe {
3168 ffi::vte_terminal_set_enable_bidi(
3169 self.as_ref().to_glib_none().0,
3170 enable_bidi.into_glib(),
3171 );
3172 }
3173 }
3174
3175 /// Controls whether the terminal uses scroll events to scroll the history
3176 /// if the event was not otherwise consumed by it.
3177 ///
3178 /// This function is rarely useful, except when the terminal is added to a
3179 /// #GtkScrolledWindow, to perform kinetic scrolling (while vte itself does
3180 /// not, yet, implement kinetic scrolling by itself).
3181 /// ## `enable`
3182 /// whether to enable fallback scrolling
3183 #[doc(alias = "vte_terminal_set_enable_fallback_scrolling")]
3184 #[doc(alias = "enable-fallback-scrolling")]
3185 fn set_enable_fallback_scrolling(&self, enable: bool) {
3186 unsafe {
3187 ffi::vte_terminal_set_enable_fallback_scrolling(
3188 self.as_ref().to_glib_none().0,
3189 enable.into_glib(),
3190 );
3191 }
3192 }
3193
3194 /// Controls whether or not the terminal will shape Arabic text.
3195 /// ## `enable_shaping`
3196 /// [`true`] to enable Arabic shaping
3197 #[doc(alias = "vte_terminal_set_enable_shaping")]
3198 #[doc(alias = "enable-shaping")]
3199 fn set_enable_shaping(&self, enable_shaping: bool) {
3200 unsafe {
3201 ffi::vte_terminal_set_enable_shaping(
3202 self.as_ref().to_glib_none().0,
3203 enable_shaping.into_glib(),
3204 );
3205 }
3206 }
3207
3208 /// Set whether to enable SIXEL images.
3209 /// ## `enabled`
3210 /// whether to enable SIXEL images
3211 #[doc(alias = "vte_terminal_set_enable_sixel")]
3212 #[doc(alias = "enable-sixel")]
3213 fn set_enable_sixel(&self, enabled: bool) {
3214 unsafe {
3215 ffi::vte_terminal_set_enable_sixel(self.as_ref().to_glib_none().0, enabled.into_glib());
3216 }
3217 }
3218
3219 /// Sets the font used for rendering all text displayed by the terminal,
3220 /// overriding any fonts set using gtk_widget_modify_font(). The terminal
3221 /// will immediately attempt to load the desired font, retrieve its
3222 /// metrics, and attempt to resize itself to keep the same number of rows
3223 /// and columns. The font scale is applied to the specified font.
3224 /// ## `font_desc`
3225 /// a #PangoFontDescription for the desired font, or [`None`]
3226 #[doc(alias = "vte_terminal_set_font")]
3227 fn set_font(&self, font_desc: Option<&pango::FontDescription>) {
3228 unsafe {
3229 ffi::vte_terminal_set_font(self.as_ref().to_glib_none().0, font_desc.to_glib_none().0);
3230 }
3231 }
3232
3233 /// Sets the terminal's font options to @options.
3234 ///
3235 /// Note that on GTK4, the terminal by default uses font options
3236 /// with `CAIRO_HINT_METRICS_ON` set; to override that, use this
3237 /// function to set a #cairo_font_options_t that has
3238 /// `CAIRO_HINT_METRICS_OFF` set.
3239 /// ## `font_options`
3240 /// the font options, or [`None`]
3241 #[cfg(feature = "v0_74")]
3242 #[cfg_attr(docsrs, doc(cfg(feature = "v0_74")))]
3243 #[doc(alias = "vte_terminal_set_font_options")]
3244 #[doc(alias = "font-options")]
3245 fn set_font_options(&self, font_options: Option<&cairo::FontOptions>) {
3246 unsafe {
3247 ffi::vte_terminal_set_font_options(
3248 self.as_ref().to_glib_none().0,
3249 font_options.to_glib_none().0,
3250 );
3251 }
3252 }
3253
3254 /// Sets the terminal's font scale to @scale.
3255 /// ## `scale`
3256 /// the font scale
3257 #[doc(alias = "vte_terminal_set_font_scale")]
3258 #[doc(alias = "font-scale")]
3259 fn set_font_scale(&self, scale: f64) {
3260 unsafe {
3261 ffi::vte_terminal_set_font_scale(self.as_ref().to_glib_none().0, scale);
3262 }
3263 }
3264
3265 /// Enables or disables user input. When user input is disabled,
3266 /// the terminal's child will not receive any key press, or mouse button
3267 /// press or motion events sent to it.
3268 /// ## `enabled`
3269 /// whether to enable user input
3270 #[doc(alias = "vte_terminal_set_input_enabled")]
3271 #[doc(alias = "input-enabled")]
3272 fn set_input_enabled(&self, enabled: bool) {
3273 unsafe {
3274 ffi::vte_terminal_set_input_enabled(
3275 self.as_ref().to_glib_none().0,
3276 enabled.into_glib(),
3277 );
3278 }
3279 }
3280
3281 /// Changes the value of the terminal's mouse autohide setting. When autohiding
3282 /// is enabled, the mouse cursor will be hidden when the user presses a key and
3283 /// shown when the user moves the mouse. This setting can be read using
3284 /// vte_terminal_get_mouse_autohide().
3285 /// ## `setting`
3286 /// whether the mouse pointer should autohide
3287 #[doc(alias = "vte_terminal_set_mouse_autohide")]
3288 fn set_mouse_autohide(&self, setting: bool) {
3289 unsafe {
3290 ffi::vte_terminal_set_mouse_autohide(
3291 self.as_ref().to_glib_none().0,
3292 setting.into_glib(),
3293 );
3294 }
3295 }
3296
3297 /// Sets @pty as the PTY to use in @self.
3298 /// Use [`None`] to unset the PTY.
3299 /// ## `pty`
3300 /// a #VtePty, or [`None`]
3301 #[doc(alias = "vte_terminal_set_pty")]
3302 #[doc(alias = "pty")]
3303 fn set_pty(&self, pty: Option<&Pty>) {
3304 unsafe {
3305 ffi::vte_terminal_set_pty(self.as_ref().to_glib_none().0, pty.to_glib_none().0);
3306 }
3307 }
3308
3309 /// Controls whether or not the terminal will forcibly scroll to the bottom of
3310 /// the viewable history when text is inserted, e.g. by a paste.
3311 /// ## `scroll`
3312 /// whether the terminal should scroll on insert
3313 #[cfg(feature = "v0_76")]
3314 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3315 #[doc(alias = "vte_terminal_set_scroll_on_insert")]
3316 #[doc(alias = "scroll-on-insert")]
3317 fn set_scroll_on_insert(&self, scroll: bool) {
3318 unsafe {
3319 ffi::vte_terminal_set_scroll_on_insert(
3320 self.as_ref().to_glib_none().0,
3321 scroll.into_glib(),
3322 );
3323 }
3324 }
3325
3326 /// Controls whether or not the terminal will forcibly scroll to the bottom of
3327 /// the viewable history when the user presses a key. Modifier keys do not
3328 /// trigger this behavior.
3329 /// ## `scroll`
3330 /// whether the terminal should scroll on keystrokes
3331 #[doc(alias = "vte_terminal_set_scroll_on_keystroke")]
3332 #[doc(alias = "scroll-on-keystroke")]
3333 fn set_scroll_on_keystroke(&self, scroll: bool) {
3334 unsafe {
3335 ffi::vte_terminal_set_scroll_on_keystroke(
3336 self.as_ref().to_glib_none().0,
3337 scroll.into_glib(),
3338 );
3339 }
3340 }
3341
3342 /// Controls whether or not the terminal will forcibly scroll to the bottom of
3343 /// the viewable history when the new data is received from the child.
3344 /// ## `scroll`
3345 /// whether the terminal should scroll on output
3346 #[doc(alias = "vte_terminal_set_scroll_on_output")]
3347 #[doc(alias = "scroll-on-output")]
3348 fn set_scroll_on_output(&self, scroll: bool) {
3349 unsafe {
3350 ffi::vte_terminal_set_scroll_on_output(
3351 self.as_ref().to_glib_none().0,
3352 scroll.into_glib(),
3353 );
3354 }
3355 }
3356
3357 /// Controls whether the terminal's scroll unit is lines or pixels.
3358 ///
3359 /// This function is rarely useful, except when the terminal is added to a
3360 /// #GtkScrolledWindow.
3361 /// ## `enable`
3362 /// whether to use pixels as scroll unit
3363 #[doc(alias = "vte_terminal_set_scroll_unit_is_pixels")]
3364 #[doc(alias = "scroll-unit-is-pixels")]
3365 fn set_scroll_unit_is_pixels(&self, enable: bool) {
3366 unsafe {
3367 ffi::vte_terminal_set_scroll_unit_is_pixels(
3368 self.as_ref().to_glib_none().0,
3369 enable.into_glib(),
3370 );
3371 }
3372 }
3373
3374 /// Sets the length of the scrollback buffer used by the terminal. The size of
3375 /// the scrollback buffer will be set to the larger of this value and the number
3376 /// of visible rows the widget can display, so 0 can safely be used to disable
3377 /// scrollback.
3378 ///
3379 /// A negative value means "infinite scrollback".
3380 ///
3381 /// Using a large scrollback buffer (roughly 1M+ lines) may lead to performance
3382 /// degradation or exhaustion of system resources, and is therefore not recommended.
3383 ///
3384 /// Note that this setting only affects the normal screen buffer.
3385 /// No scrollback is allowed on the alternate screen buffer.
3386 /// ## `lines`
3387 /// the length of the history buffer
3388 #[doc(alias = "vte_terminal_set_scrollback_lines")]
3389 #[doc(alias = "scrollback-lines")]
3390 fn set_scrollback_lines(&self, lines: libc::c_long) {
3391 unsafe {
3392 ffi::vte_terminal_set_scrollback_lines(self.as_ref().to_glib_none().0, lines);
3393 }
3394 }
3395
3396 /// Attempts to change the terminal's size in terms of rows and columns. If
3397 /// the attempt succeeds, the widget will resize itself to the proper size.
3398 /// ## `columns`
3399 /// the desired number of columns
3400 /// ## `rows`
3401 /// the desired number of rows
3402 #[doc(alias = "vte_terminal_set_size")]
3403 fn set_size(&self, columns: libc::c_long, rows: libc::c_long) {
3404 unsafe {
3405 ffi::vte_terminal_set_size(self.as_ref().to_glib_none().0, columns, rows);
3406 }
3407 }
3408
3409 /// Controls whether or not the terminal will allow blinking text.
3410 /// ## `text_blink_mode`
3411 /// the #VteTextBlinkMode to use
3412 #[doc(alias = "vte_terminal_set_text_blink_mode")]
3413 #[doc(alias = "text-blink-mode")]
3414 fn set_text_blink_mode(&self, text_blink_mode: TextBlinkMode) {
3415 unsafe {
3416 ffi::vte_terminal_set_text_blink_mode(
3417 self.as_ref().to_glib_none().0,
3418 text_blink_mode.into_glib(),
3419 );
3420 }
3421 }
3422
3423 /// With this function you can provide a set of characters which will
3424 /// be considered parts of a word when doing word-wise selection, in
3425 /// addition to the default which only considers alphanumeric characters
3426 /// part of a word.
3427 ///
3428 /// The characters in @exceptions must be non-alphanumeric, each character
3429 /// must occur only once, and if @exceptions contains the character
3430 /// U+002D HYPHEN-MINUS, it must be at the start of the string.
3431 ///
3432 /// Use [`None`] to reset the set of exception characters to the default.
3433 /// ## `exceptions`
3434 /// a string of ASCII punctuation characters, or [`None`]
3435 #[doc(alias = "vte_terminal_set_word_char_exceptions")]
3436 fn set_word_char_exceptions(&self, exceptions: &str) {
3437 unsafe {
3438 ffi::vte_terminal_set_word_char_exceptions(
3439 self.as_ref().to_glib_none().0,
3440 exceptions.to_glib_none().0,
3441 );
3442 }
3443 }
3444
3445 /// Sets the horizontal alignment of @self within its allocation.
3446 ///
3447 /// Note: `VTE_ALIGN_START_FILL` is not supported, and will be treated
3448 /// like [`Align::Start`][crate::Align::Start].
3449 /// ## `align`
3450 /// alignment value from #VteAlign
3451 #[cfg(feature = "v0_76")]
3452 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3453 #[doc(alias = "vte_terminal_set_xalign")]
3454 #[doc(alias = "xalign")]
3455 fn set_xalign(&self, align: Align) {
3456 unsafe {
3457 ffi::vte_terminal_set_xalign(self.as_ref().to_glib_none().0, align.into_glib());
3458 }
3459 }
3460
3461 /// Sets the horizontal fillment of @self within its allocation.
3462 ///
3463 /// Note: `VTE_FILL_START_FILL` is not supported, and will be treated
3464 /// like `VTE_FILL_START`.
3465 /// ## `fill`
3466 /// fillment value from #VteFill
3467 #[cfg(feature = "v0_76")]
3468 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3469 #[doc(alias = "vte_terminal_set_xfill")]
3470 #[doc(alias = "xfill")]
3471 fn set_xfill(&self, fill: bool) {
3472 unsafe {
3473 ffi::vte_terminal_set_xfill(self.as_ref().to_glib_none().0, fill.into_glib());
3474 }
3475 }
3476
3477 /// Sets the vertical alignment of @self within its allocation.
3478 /// ## `align`
3479 /// alignment value from #VteAlign
3480 #[cfg(feature = "v0_76")]
3481 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3482 #[doc(alias = "vte_terminal_set_yalign")]
3483 #[doc(alias = "yalign")]
3484 fn set_yalign(&self, align: Align) {
3485 unsafe {
3486 ffi::vte_terminal_set_yalign(self.as_ref().to_glib_none().0, align.into_glib());
3487 }
3488 }
3489
3490 /// Sets the vertical fillment of @self within its allocation.
3491 /// Note that yfill is only supported with yalign set to
3492 /// [`Align::Start`][crate::Align::Start], and is ignored for all other yalign values.
3493 /// ## `fill`
3494 /// fillment value from #VteFill
3495 #[cfg(feature = "v0_76")]
3496 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
3497 #[doc(alias = "vte_terminal_set_yfill")]
3498 #[doc(alias = "yfill")]
3499 fn set_yfill(&self, fill: bool) {
3500 unsafe {
3501 ffi::vte_terminal_set_yfill(self.as_ref().to_glib_none().0, fill.into_glib());
3502 }
3503 }
3504
3505 /// Clears the current selection.
3506 #[doc(alias = "vte_terminal_unselect_all")]
3507 fn unselect_all(&self) {
3508 unsafe {
3509 ffi::vte_terminal_unselect_all(self.as_ref().to_glib_none().0);
3510 }
3511 }
3512
3513 /// Write contents of the current contents of @self (including any
3514 /// scrollback history) to @stream according to @flags.
3515 ///
3516 /// If @cancellable is not [`None`], then the operation can be cancelled by triggering
3517 /// the cancellable object from another thread. If the operation was cancelled,
3518 /// the error `G_IO_ERROR_CANCELLED` will be returned in @error.
3519 ///
3520 /// This is a synchronous operation and will make the widget (and input
3521 /// processing) during the write operation, which may take a long time
3522 /// depending on scrollback history and @stream availability for writing.
3523 /// ## `stream`
3524 /// a #GOutputStream to write to
3525 /// ## `flags`
3526 /// a set of #VteWriteFlags
3527 /// ## `cancellable`
3528 /// a #GCancellable object, or [`None`]
3529 ///
3530 /// # Returns
3531 ///
3532 /// [`true`] on success, [`false`] if there was an error
3533 #[doc(alias = "vte_terminal_write_contents_sync")]
3534 fn write_contents_sync(
3535 &self,
3536 stream: &impl IsA<gio::OutputStream>,
3537 flags: WriteFlags,
3538 cancellable: Option<&impl IsA<gio::Cancellable>>,
3539 ) -> Result<(), glib::Error> {
3540 unsafe {
3541 let mut error = std::ptr::null_mut();
3542 let is_ok = ffi::vte_terminal_write_contents_sync(
3543 self.as_ref().to_glib_none().0,
3544 stream.as_ref().to_glib_none().0,
3545 flags.into_glib(),
3546 cancellable.map(|p| p.as_ref()).to_glib_none().0,
3547 &mut error,
3548 );
3549 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
3550 if error.is_null() {
3551 Ok(())
3552 } else {
3553 Err(from_glib_full(error))
3554 }
3555 }
3556 }
3557
3558 /// Controls what string or control sequence the terminal sends to its child
3559 /// when the user presses the backspace key.
3560 #[doc(alias = "backspace-binding")]
3561 fn backspace_binding(&self) -> EraseBinding {
3562 ObjectExt::property(self.as_ref(), "backspace-binding")
3563 }
3564
3565 /// Controls what string or control sequence the terminal sends to its child
3566 /// when the user presses the delete key.
3567 #[doc(alias = "delete-binding")]
3568 fn delete_binding(&self) -> EraseBinding {
3569 ObjectExt::property(self.as_ref(), "delete-binding")
3570 }
3571
3572 /// Specifies the font used for rendering all text displayed by the terminal,
3573 /// overriding any fonts set using gtk_widget_modify_font(). The terminal
3574 /// will immediately attempt to load the desired font, retrieve its
3575 /// metrics, and attempt to resize itself to keep the same number of rows
3576 /// and columns.
3577 #[doc(alias = "font-desc")]
3578 fn font_desc(&self) -> Option<pango::FontDescription> {
3579 ObjectExt::property(self.as_ref(), "font-desc")
3580 }
3581
3582 /// Specifies the font used for rendering all text displayed by the terminal,
3583 /// overriding any fonts set using gtk_widget_modify_font(). The terminal
3584 /// will immediately attempt to load the desired font, retrieve its
3585 /// metrics, and attempt to resize itself to keep the same number of rows
3586 /// and columns.
3587 #[doc(alias = "font-desc")]
3588 fn set_font_desc(&self, font_desc: Option<&pango::FontDescription>) {
3589 ObjectExt::set_property(self.as_ref(), "font-desc", font_desc)
3590 }
3591
3592 /// The currently hovered hyperlink URI, or [`None`] if unset.
3593 #[doc(alias = "hyperlink-hover-uri")]
3594 fn hyperlink_hover_uri(&self) -> Option<glib::GString> {
3595 ObjectExt::property(self.as_ref(), "hyperlink-hover-uri")
3596 }
3597
3598 /// Controls the value of the terminal's mouse autohide setting. When autohiding
3599 /// is enabled, the mouse cursor will be hidden when the user presses a key and
3600 /// shown when the user moves the mouse.
3601 #[doc(alias = "pointer-autohide")]
3602 fn is_pointer_autohide(&self) -> bool {
3603 ObjectExt::property(self.as_ref(), "pointer-autohide")
3604 }
3605
3606 /// Controls the value of the terminal's mouse autohide setting. When autohiding
3607 /// is enabled, the mouse cursor will be hidden when the user presses a key and
3608 /// shown when the user moves the mouse.
3609 #[doc(alias = "pointer-autohide")]
3610 fn set_pointer_autohide(&self, pointer_autohide: bool) {
3611 ObjectExt::set_property(self.as_ref(), "pointer-autohide", pointer_autohide)
3612 }
3613
3614 /// This signal is emitted when the a child sends a bell request to the
3615 /// terminal.
3616 #[doc(alias = "bell")]
3617 fn connect_bell<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3618 unsafe extern "C" fn bell_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
3619 this: *mut ffi::VteTerminal,
3620 f: glib::ffi::gpointer,
3621 ) {
3622 let f: &F = &*(f as *const F);
3623 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3624 }
3625 unsafe {
3626 let f: Box_<F> = Box_::new(f);
3627 connect_raw(
3628 self.as_ptr() as *mut _,
3629 b"bell\0".as_ptr() as *const _,
3630 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3631 bell_trampoline::<Self, F> as *const (),
3632 )),
3633 Box_::into_raw(f),
3634 )
3635 }
3636 }
3637
3638 /// Emitted whenever the cell size changes, e.g. due to a change in
3639 /// font, font-scale or cell-width/height-scale.
3640 ///
3641 /// Note that this signal should rather be called "cell-size-changed".
3642 /// ## `width`
3643 /// the new character cell width
3644 /// ## `height`
3645 /// the new character cell height
3646 #[doc(alias = "char-size-changed")]
3647 fn connect_char_size_changed<F: Fn(&Self, u32, u32) + 'static>(&self, f: F) -> SignalHandlerId {
3648 unsafe extern "C" fn char_size_changed_trampoline<
3649 P: IsA<Terminal>,
3650 F: Fn(&P, u32, u32) + 'static,
3651 >(
3652 this: *mut ffi::VteTerminal,
3653 width: libc::c_uint,
3654 height: libc::c_uint,
3655 f: glib::ffi::gpointer,
3656 ) {
3657 let f: &F = &*(f as *const F);
3658 f(
3659 Terminal::from_glib_borrow(this).unsafe_cast_ref(),
3660 width,
3661 height,
3662 )
3663 }
3664 unsafe {
3665 let f: Box_<F> = Box_::new(f);
3666 connect_raw(
3667 self.as_ptr() as *mut _,
3668 b"char-size-changed\0".as_ptr() as *const _,
3669 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3670 char_size_changed_trampoline::<Self, F> as *const (),
3671 )),
3672 Box_::into_raw(f),
3673 )
3674 }
3675 }
3676
3677 /// This signal is emitted when the terminal detects that a child
3678 /// watched using vte_terminal_watch_child() has exited.
3679 /// ## `status`
3680 /// the child's exit status
3681 #[doc(alias = "child-exited")]
3682 fn connect_child_exited<F: Fn(&Self, i32) + 'static>(&self, f: F) -> SignalHandlerId {
3683 unsafe extern "C" fn child_exited_trampoline<P: IsA<Terminal>, F: Fn(&P, i32) + 'static>(
3684 this: *mut ffi::VteTerminal,
3685 status: libc::c_int,
3686 f: glib::ffi::gpointer,
3687 ) {
3688 let f: &F = &*(f as *const F);
3689 f(Terminal::from_glib_borrow(this).unsafe_cast_ref(), status)
3690 }
3691 unsafe {
3692 let f: Box_<F> = Box_::new(f);
3693 connect_raw(
3694 self.as_ptr() as *mut _,
3695 b"child-exited\0".as_ptr() as *const _,
3696 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3697 child_exited_trampoline::<Self, F> as *const (),
3698 )),
3699 Box_::into_raw(f),
3700 )
3701 }
3702 }
3703
3704 /// Emitted whenever the terminal receives input from the user and
3705 /// prepares to send it to the child process.
3706 /// ## `text`
3707 /// a string of text
3708 /// ## `size`
3709 /// the length of that string of text
3710 #[doc(alias = "commit")]
3711 fn connect_commit<F: Fn(&Self, &str, u32) + 'static>(&self, f: F) -> SignalHandlerId {
3712 unsafe extern "C" fn commit_trampoline<P: IsA<Terminal>, F: Fn(&P, &str, u32) + 'static>(
3713 this: *mut ffi::VteTerminal,
3714 text: *mut libc::c_char,
3715 size: libc::c_uint,
3716 f: glib::ffi::gpointer,
3717 ) {
3718 let f: &F = &*(f as *const F);
3719 f(
3720 Terminal::from_glib_borrow(this).unsafe_cast_ref(),
3721 &glib::GString::from_glib_borrow(text),
3722 size,
3723 )
3724 }
3725 unsafe {
3726 let f: Box_<F> = Box_::new(f);
3727 connect_raw(
3728 self.as_ptr() as *mut _,
3729 b"commit\0".as_ptr() as *const _,
3730 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3731 commit_trampoline::<Self, F> as *const (),
3732 )),
3733 Box_::into_raw(f),
3734 )
3735 }
3736 }
3737
3738 /// Emitted whenever the visible appearance of the terminal has changed.
3739 /// Used primarily by #VteTerminalAccessible.
3740 #[doc(alias = "contents-changed")]
3741 fn connect_contents_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3742 unsafe extern "C" fn contents_changed_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
3743 this: *mut ffi::VteTerminal,
3744 f: glib::ffi::gpointer,
3745 ) {
3746 let f: &F = &*(f as *const F);
3747 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3748 }
3749 unsafe {
3750 let f: Box_<F> = Box_::new(f);
3751 connect_raw(
3752 self.as_ptr() as *mut _,
3753 b"contents-changed\0".as_ptr() as *const _,
3754 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3755 contents_changed_trampoline::<Self, F> as *const (),
3756 )),
3757 Box_::into_raw(f),
3758 )
3759 }
3760 }
3761
3762 /// Emitted whenever vte_terminal_copy_clipboard() is called.
3763 #[doc(alias = "copy-clipboard")]
3764 fn connect_copy_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3765 unsafe extern "C" fn copy_clipboard_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
3766 this: *mut ffi::VteTerminal,
3767 f: glib::ffi::gpointer,
3768 ) {
3769 let f: &F = &*(f as *const F);
3770 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3771 }
3772 unsafe {
3773 let f: Box_<F> = Box_::new(f);
3774 connect_raw(
3775 self.as_ptr() as *mut _,
3776 b"copy-clipboard\0".as_ptr() as *const _,
3777 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3778 copy_clipboard_trampoline::<Self, F> as *const (),
3779 )),
3780 Box_::into_raw(f),
3781 )
3782 }
3783 }
3784
3785 fn emit_copy_clipboard(&self) {
3786 self.emit_by_name::<()>("copy-clipboard", &[]);
3787 }
3788
3789 /// Emitted when the current directory URI is modified.
3790 #[doc(alias = "current-directory-uri-changed")]
3791 fn connect_current_directory_uri_changed<F: Fn(&Self) + 'static>(
3792 &self,
3793 f: F,
3794 ) -> SignalHandlerId {
3795 unsafe extern "C" fn current_directory_uri_changed_trampoline<
3796 P: IsA<Terminal>,
3797 F: Fn(&P) + 'static,
3798 >(
3799 this: *mut ffi::VteTerminal,
3800 f: glib::ffi::gpointer,
3801 ) {
3802 let f: &F = &*(f as *const F);
3803 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3804 }
3805 unsafe {
3806 let f: Box_<F> = Box_::new(f);
3807 connect_raw(
3808 self.as_ptr() as *mut _,
3809 b"current-directory-uri-changed\0".as_ptr() as *const _,
3810 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3811 current_directory_uri_changed_trampoline::<Self, F> as *const (),
3812 )),
3813 Box_::into_raw(f),
3814 )
3815 }
3816 }
3817
3818 /// Emitted when the current file URI is modified.
3819 #[doc(alias = "current-file-uri-changed")]
3820 fn connect_current_file_uri_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3821 unsafe extern "C" fn current_file_uri_changed_trampoline<
3822 P: IsA<Terminal>,
3823 F: Fn(&P) + 'static,
3824 >(
3825 this: *mut ffi::VteTerminal,
3826 f: glib::ffi::gpointer,
3827 ) {
3828 let f: &F = &*(f as *const F);
3829 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3830 }
3831 unsafe {
3832 let f: Box_<F> = Box_::new(f);
3833 connect_raw(
3834 self.as_ptr() as *mut _,
3835 b"current-file-uri-changed\0".as_ptr() as *const _,
3836 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3837 current_file_uri_changed_trampoline::<Self, F> as *const (),
3838 )),
3839 Box_::into_raw(f),
3840 )
3841 }
3842 }
3843
3844 /// Emitted whenever the cursor moves to a new character cell. Used
3845 /// primarily by #VteTerminalAccessible.
3846 #[doc(alias = "cursor-moved")]
3847 fn connect_cursor_moved<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3848 unsafe extern "C" fn cursor_moved_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
3849 this: *mut ffi::VteTerminal,
3850 f: glib::ffi::gpointer,
3851 ) {
3852 let f: &F = &*(f as *const F);
3853 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3854 }
3855 unsafe {
3856 let f: Box_<F> = Box_::new(f);
3857 connect_raw(
3858 self.as_ptr() as *mut _,
3859 b"cursor-moved\0".as_ptr() as *const _,
3860 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3861 cursor_moved_trampoline::<Self, F> as *const (),
3862 )),
3863 Box_::into_raw(f),
3864 )
3865 }
3866 }
3867
3868 /// Emitted when the user hits the '-' key while holding the Control key.
3869 #[doc(alias = "decrease-font-size")]
3870 fn connect_decrease_font_size<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3871 unsafe extern "C" fn decrease_font_size_trampoline<
3872 P: IsA<Terminal>,
3873 F: Fn(&P) + 'static,
3874 >(
3875 this: *mut ffi::VteTerminal,
3876 f: glib::ffi::gpointer,
3877 ) {
3878 let f: &F = &*(f as *const F);
3879 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3880 }
3881 unsafe {
3882 let f: Box_<F> = Box_::new(f);
3883 connect_raw(
3884 self.as_ptr() as *mut _,
3885 b"decrease-font-size\0".as_ptr() as *const _,
3886 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3887 decrease_font_size_trampoline::<Self, F> as *const (),
3888 )),
3889 Box_::into_raw(f),
3890 )
3891 }
3892 }
3893
3894 /// Emitted whenever the terminal's current encoding has changed.
3895 ///
3896 /// Note: support for non-UTF-8 is deprecated.
3897 #[doc(alias = "encoding-changed")]
3898 fn connect_encoding_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3899 unsafe extern "C" fn encoding_changed_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
3900 this: *mut ffi::VteTerminal,
3901 f: glib::ffi::gpointer,
3902 ) {
3903 let f: &F = &*(f as *const F);
3904 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3905 }
3906 unsafe {
3907 let f: Box_<F> = Box_::new(f);
3908 connect_raw(
3909 self.as_ptr() as *mut _,
3910 b"encoding-changed\0".as_ptr() as *const _,
3911 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3912 encoding_changed_trampoline::<Self, F> as *const (),
3913 )),
3914 Box_::into_raw(f),
3915 )
3916 }
3917 }
3918
3919 /// Emitted when the terminal receives an end-of-file from a child which
3920 /// is running in the terminal. This signal is frequently (but not
3921 /// always) emitted with a #VteTerminal::child-exited signal.
3922 #[doc(alias = "eof")]
3923 fn connect_eof<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3924 unsafe extern "C" fn eof_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
3925 this: *mut ffi::VteTerminal,
3926 f: glib::ffi::gpointer,
3927 ) {
3928 let f: &F = &*(f as *const F);
3929 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3930 }
3931 unsafe {
3932 let f: Box_<F> = Box_::new(f);
3933 connect_raw(
3934 self.as_ptr() as *mut _,
3935 b"eof\0".as_ptr() as *const _,
3936 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3937 eof_trampoline::<Self, F> as *const (),
3938 )),
3939 Box_::into_raw(f),
3940 )
3941 }
3942 }
3943
3944 //#[doc(alias = "hyperlink-hover-uri-changed")]
3945 //fn connect_hyperlink_hover_uri_changed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
3946 // Ignored bbox: Gdk.Rectangle
3947 //}
3948
3949 /// Emitted when the user hits the '+' key while holding the Control key.
3950 #[doc(alias = "increase-font-size")]
3951 fn connect_increase_font_size<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3952 unsafe extern "C" fn increase_font_size_trampoline<
3953 P: IsA<Terminal>,
3954 F: Fn(&P) + 'static,
3955 >(
3956 this: *mut ffi::VteTerminal,
3957 f: glib::ffi::gpointer,
3958 ) {
3959 let f: &F = &*(f as *const F);
3960 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
3961 }
3962 unsafe {
3963 let f: Box_<F> = Box_::new(f);
3964 connect_raw(
3965 self.as_ptr() as *mut _,
3966 b"increase-font-size\0".as_ptr() as *const _,
3967 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3968 increase_font_size_trampoline::<Self, F> as *const (),
3969 )),
3970 Box_::into_raw(f),
3971 )
3972 }
3973 }
3974
3975 /// Emitted when a process running in the terminal wants to
3976 /// send a notification to the desktop environment.
3977 /// ## `summary`
3978 /// The summary
3979 /// ## `body`
3980 /// Extra optional text
3981 #[doc(alias = "notification-received")]
3982 fn connect_notification_received<F: Fn(&Self, &str, Option<&str>) + 'static>(
3983 &self,
3984 f: F,
3985 ) -> SignalHandlerId {
3986 unsafe extern "C" fn notification_received_trampoline<
3987 P: IsA<Terminal>,
3988 F: Fn(&P, &str, Option<&str>) + 'static,
3989 >(
3990 this: *mut ffi::VteTerminal,
3991 summary: *mut libc::c_char,
3992 body: *mut libc::c_char,
3993 f: glib::ffi::gpointer,
3994 ) {
3995 let f: &F = &*(f as *const F);
3996 f(
3997 Terminal::from_glib_borrow(this).unsafe_cast_ref(),
3998 &glib::GString::from_glib_borrow(summary),
3999 Option::<glib::GString>::from_glib_borrow(body)
4000 .as_ref()
4001 .as_ref()
4002 .map(|s| s.as_str()),
4003 )
4004 }
4005 unsafe {
4006 let f: Box_<F> = Box_::new(f);
4007 connect_raw(
4008 self.as_ptr() as *mut _,
4009 b"notification-received\0".as_ptr() as *const _,
4010 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4011 notification_received_trampoline::<Self, F> as *const (),
4012 )),
4013 Box_::into_raw(f),
4014 )
4015 }
4016 }
4017
4018 /// Emitted whenever vte_terminal_paste_clipboard() is called.
4019 #[doc(alias = "paste-clipboard")]
4020 fn connect_paste_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4021 unsafe extern "C" fn paste_clipboard_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4022 this: *mut ffi::VteTerminal,
4023 f: glib::ffi::gpointer,
4024 ) {
4025 let f: &F = &*(f as *const F);
4026 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4027 }
4028 unsafe {
4029 let f: Box_<F> = Box_::new(f);
4030 connect_raw(
4031 self.as_ptr() as *mut _,
4032 b"paste-clipboard\0".as_ptr() as *const _,
4033 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4034 paste_clipboard_trampoline::<Self, F> as *const (),
4035 )),
4036 Box_::into_raw(f),
4037 )
4038 }
4039 }
4040
4041 fn emit_paste_clipboard(&self) {
4042 self.emit_by_name::<()>("paste-clipboard", &[]);
4043 }
4044
4045 /// Emitted at the child application's request.
4046 /// ## `width`
4047 /// the desired number of columns
4048 /// ## `height`
4049 /// the desired number of rows
4050 #[doc(alias = "resize-window")]
4051 fn connect_resize_window<F: Fn(&Self, u32, u32) + 'static>(&self, f: F) -> SignalHandlerId {
4052 unsafe extern "C" fn resize_window_trampoline<
4053 P: IsA<Terminal>,
4054 F: Fn(&P, u32, u32) + 'static,
4055 >(
4056 this: *mut ffi::VteTerminal,
4057 width: libc::c_uint,
4058 height: libc::c_uint,
4059 f: glib::ffi::gpointer,
4060 ) {
4061 let f: &F = &*(f as *const F);
4062 f(
4063 Terminal::from_glib_borrow(this).unsafe_cast_ref(),
4064 width,
4065 height,
4066 )
4067 }
4068 unsafe {
4069 let f: Box_<F> = Box_::new(f);
4070 connect_raw(
4071 self.as_ptr() as *mut _,
4072 b"resize-window\0".as_ptr() as *const _,
4073 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4074 resize_window_trampoline::<Self, F> as *const (),
4075 )),
4076 Box_::into_raw(f),
4077 )
4078 }
4079 }
4080
4081 /// Emitted whenever the contents of terminal's selection changes.
4082 #[doc(alias = "selection-changed")]
4083 fn connect_selection_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4084 unsafe extern "C" fn selection_changed_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4085 this: *mut ffi::VteTerminal,
4086 f: glib::ffi::gpointer,
4087 ) {
4088 let f: &F = &*(f as *const F);
4089 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4090 }
4091 unsafe {
4092 let f: Box_<F> = Box_::new(f);
4093 connect_raw(
4094 self.as_ptr() as *mut _,
4095 b"selection-changed\0".as_ptr() as *const _,
4096 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4097 selection_changed_trampoline::<Self, F> as *const (),
4098 )),
4099 Box_::into_raw(f),
4100 )
4101 }
4102 }
4103
4104 //#[doc(alias = "setup-context-menu")]
4105 //fn connect_setup_context_menu<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
4106 // Ignored context: Vte.EventContext
4107 //}
4108
4109 /// Emitted right before an interactive shell shows a
4110 /// first-level prompt.
4111 #[doc(alias = "shell-precmd")]
4112 fn connect_shell_precmd<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4113 unsafe extern "C" fn shell_precmd_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4114 this: *mut ffi::VteTerminal,
4115 f: glib::ffi::gpointer,
4116 ) {
4117 let f: &F = &*(f as *const F);
4118 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4119 }
4120 unsafe {
4121 let f: Box_<F> = Box_::new(f);
4122 connect_raw(
4123 self.as_ptr() as *mut _,
4124 b"shell-precmd\0".as_ptr() as *const _,
4125 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4126 shell_precmd_trampoline::<Self, F> as *const (),
4127 )),
4128 Box_::into_raw(f),
4129 )
4130 }
4131 }
4132
4133 /// Emitted when the interactive shell has read in a complete
4134 /// command and is about to execute it.
4135 #[doc(alias = "shell-preexec")]
4136 fn connect_shell_preexec<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4137 unsafe extern "C" fn shell_preexec_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4138 this: *mut ffi::VteTerminal,
4139 f: glib::ffi::gpointer,
4140 ) {
4141 let f: &F = &*(f as *const F);
4142 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4143 }
4144 unsafe {
4145 let f: Box_<F> = Box_::new(f);
4146 connect_raw(
4147 self.as_ptr() as *mut _,
4148 b"shell-preexec\0".as_ptr() as *const _,
4149 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4150 shell_preexec_trampoline::<Self, F> as *const (),
4151 )),
4152 Box_::into_raw(f),
4153 )
4154 }
4155 }
4156
4157 /// Emitted when the #VteTerminal:window-title property is modified.
4158 #[doc(alias = "window-title-changed")]
4159 fn connect_window_title_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4160 unsafe extern "C" fn window_title_changed_trampoline<
4161 P: IsA<Terminal>,
4162 F: Fn(&P) + 'static,
4163 >(
4164 this: *mut ffi::VteTerminal,
4165 f: glib::ffi::gpointer,
4166 ) {
4167 let f: &F = &*(f as *const F);
4168 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4169 }
4170 unsafe {
4171 let f: Box_<F> = Box_::new(f);
4172 connect_raw(
4173 self.as_ptr() as *mut _,
4174 b"window-title-changed\0".as_ptr() as *const _,
4175 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4176 window_title_changed_trampoline::<Self, F> as *const (),
4177 )),
4178 Box_::into_raw(f),
4179 )
4180 }
4181 }
4182
4183 #[doc(alias = "allow-hyperlink")]
4184 fn connect_allow_hyperlink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4185 unsafe extern "C" fn notify_allow_hyperlink_trampoline<
4186 P: IsA<Terminal>,
4187 F: Fn(&P) + 'static,
4188 >(
4189 this: *mut ffi::VteTerminal,
4190 _param_spec: glib::ffi::gpointer,
4191 f: glib::ffi::gpointer,
4192 ) {
4193 let f: &F = &*(f as *const F);
4194 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4195 }
4196 unsafe {
4197 let f: Box_<F> = Box_::new(f);
4198 connect_raw(
4199 self.as_ptr() as *mut _,
4200 b"notify::allow-hyperlink\0".as_ptr() as *const _,
4201 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4202 notify_allow_hyperlink_trampoline::<Self, F> as *const (),
4203 )),
4204 Box_::into_raw(f),
4205 )
4206 }
4207 }
4208
4209 #[doc(alias = "audible-bell")]
4210 fn connect_audible_bell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4211 unsafe extern "C" fn notify_audible_bell_trampoline<
4212 P: IsA<Terminal>,
4213 F: Fn(&P) + 'static,
4214 >(
4215 this: *mut ffi::VteTerminal,
4216 _param_spec: glib::ffi::gpointer,
4217 f: glib::ffi::gpointer,
4218 ) {
4219 let f: &F = &*(f as *const F);
4220 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4221 }
4222 unsafe {
4223 let f: Box_<F> = Box_::new(f);
4224 connect_raw(
4225 self.as_ptr() as *mut _,
4226 b"notify::audible-bell\0".as_ptr() as *const _,
4227 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4228 notify_audible_bell_trampoline::<Self, F> as *const (),
4229 )),
4230 Box_::into_raw(f),
4231 )
4232 }
4233 }
4234
4235 #[doc(alias = "backspace-binding")]
4236 fn connect_backspace_binding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4237 unsafe extern "C" fn notify_backspace_binding_trampoline<
4238 P: IsA<Terminal>,
4239 F: Fn(&P) + 'static,
4240 >(
4241 this: *mut ffi::VteTerminal,
4242 _param_spec: glib::ffi::gpointer,
4243 f: glib::ffi::gpointer,
4244 ) {
4245 let f: &F = &*(f as *const F);
4246 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4247 }
4248 unsafe {
4249 let f: Box_<F> = Box_::new(f);
4250 connect_raw(
4251 self.as_ptr() as *mut _,
4252 b"notify::backspace-binding\0".as_ptr() as *const _,
4253 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4254 notify_backspace_binding_trampoline::<Self, F> as *const (),
4255 )),
4256 Box_::into_raw(f),
4257 )
4258 }
4259 }
4260
4261 #[doc(alias = "bold-is-bright")]
4262 fn connect_bold_is_bright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4263 unsafe extern "C" fn notify_bold_is_bright_trampoline<
4264 P: IsA<Terminal>,
4265 F: Fn(&P) + 'static,
4266 >(
4267 this: *mut ffi::VteTerminal,
4268 _param_spec: glib::ffi::gpointer,
4269 f: glib::ffi::gpointer,
4270 ) {
4271 let f: &F = &*(f as *const F);
4272 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4273 }
4274 unsafe {
4275 let f: Box_<F> = Box_::new(f);
4276 connect_raw(
4277 self.as_ptr() as *mut _,
4278 b"notify::bold-is-bright\0".as_ptr() as *const _,
4279 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4280 notify_bold_is_bright_trampoline::<Self, F> as *const (),
4281 )),
4282 Box_::into_raw(f),
4283 )
4284 }
4285 }
4286
4287 #[doc(alias = "cell-height-scale")]
4288 fn connect_cell_height_scale_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4289 unsafe extern "C" fn notify_cell_height_scale_trampoline<
4290 P: IsA<Terminal>,
4291 F: Fn(&P) + 'static,
4292 >(
4293 this: *mut ffi::VteTerminal,
4294 _param_spec: glib::ffi::gpointer,
4295 f: glib::ffi::gpointer,
4296 ) {
4297 let f: &F = &*(f as *const F);
4298 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4299 }
4300 unsafe {
4301 let f: Box_<F> = Box_::new(f);
4302 connect_raw(
4303 self.as_ptr() as *mut _,
4304 b"notify::cell-height-scale\0".as_ptr() as *const _,
4305 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4306 notify_cell_height_scale_trampoline::<Self, F> as *const (),
4307 )),
4308 Box_::into_raw(f),
4309 )
4310 }
4311 }
4312
4313 #[doc(alias = "cell-width-scale")]
4314 fn connect_cell_width_scale_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4315 unsafe extern "C" fn notify_cell_width_scale_trampoline<
4316 P: IsA<Terminal>,
4317 F: Fn(&P) + 'static,
4318 >(
4319 this: *mut ffi::VteTerminal,
4320 _param_spec: glib::ffi::gpointer,
4321 f: glib::ffi::gpointer,
4322 ) {
4323 let f: &F = &*(f as *const F);
4324 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4325 }
4326 unsafe {
4327 let f: Box_<F> = Box_::new(f);
4328 connect_raw(
4329 self.as_ptr() as *mut _,
4330 b"notify::cell-width-scale\0".as_ptr() as *const _,
4331 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4332 notify_cell_width_scale_trampoline::<Self, F> as *const (),
4333 )),
4334 Box_::into_raw(f),
4335 )
4336 }
4337 }
4338
4339 #[doc(alias = "cjk-ambiguous-width")]
4340 fn connect_cjk_ambiguous_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4341 unsafe extern "C" fn notify_cjk_ambiguous_width_trampoline<
4342 P: IsA<Terminal>,
4343 F: Fn(&P) + 'static,
4344 >(
4345 this: *mut ffi::VteTerminal,
4346 _param_spec: glib::ffi::gpointer,
4347 f: glib::ffi::gpointer,
4348 ) {
4349 let f: &F = &*(f as *const F);
4350 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4351 }
4352 unsafe {
4353 let f: Box_<F> = Box_::new(f);
4354 connect_raw(
4355 self.as_ptr() as *mut _,
4356 b"notify::cjk-ambiguous-width\0".as_ptr() as *const _,
4357 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4358 notify_cjk_ambiguous_width_trampoline::<Self, F> as *const (),
4359 )),
4360 Box_::into_raw(f),
4361 )
4362 }
4363 }
4364
4365 #[cfg(feature = "v0_76")]
4366 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
4367 #[doc(alias = "context-menu")]
4368 fn connect_context_menu_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4369 unsafe extern "C" fn notify_context_menu_trampoline<
4370 P: IsA<Terminal>,
4371 F: Fn(&P) + 'static,
4372 >(
4373 this: *mut ffi::VteTerminal,
4374 _param_spec: glib::ffi::gpointer,
4375 f: glib::ffi::gpointer,
4376 ) {
4377 let f: &F = &*(f as *const F);
4378 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4379 }
4380 unsafe {
4381 let f: Box_<F> = Box_::new(f);
4382 connect_raw(
4383 self.as_ptr() as *mut _,
4384 b"notify::context-menu\0".as_ptr() as *const _,
4385 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4386 notify_context_menu_trampoline::<Self, F> as *const (),
4387 )),
4388 Box_::into_raw(f),
4389 )
4390 }
4391 }
4392
4393 #[cfg(feature = "v0_76")]
4394 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
4395 #[doc(alias = "context-menu-model")]
4396 fn connect_context_menu_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4397 unsafe extern "C" fn notify_context_menu_model_trampoline<
4398 P: IsA<Terminal>,
4399 F: Fn(&P) + 'static,
4400 >(
4401 this: *mut ffi::VteTerminal,
4402 _param_spec: glib::ffi::gpointer,
4403 f: glib::ffi::gpointer,
4404 ) {
4405 let f: &F = &*(f as *const F);
4406 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4407 }
4408 unsafe {
4409 let f: Box_<F> = Box_::new(f);
4410 connect_raw(
4411 self.as_ptr() as *mut _,
4412 b"notify::context-menu-model\0".as_ptr() as *const _,
4413 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4414 notify_context_menu_model_trampoline::<Self, F> as *const (),
4415 )),
4416 Box_::into_raw(f),
4417 )
4418 }
4419 }
4420
4421 #[doc(alias = "current-container-name")]
4422 fn connect_current_container_name_notify<F: Fn(&Self) + 'static>(
4423 &self,
4424 f: F,
4425 ) -> SignalHandlerId {
4426 unsafe extern "C" fn notify_current_container_name_trampoline<
4427 P: IsA<Terminal>,
4428 F: Fn(&P) + 'static,
4429 >(
4430 this: *mut ffi::VteTerminal,
4431 _param_spec: glib::ffi::gpointer,
4432 f: glib::ffi::gpointer,
4433 ) {
4434 let f: &F = &*(f as *const F);
4435 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4436 }
4437 unsafe {
4438 let f: Box_<F> = Box_::new(f);
4439 connect_raw(
4440 self.as_ptr() as *mut _,
4441 b"notify::current-container-name\0".as_ptr() as *const _,
4442 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4443 notify_current_container_name_trampoline::<Self, F> as *const (),
4444 )),
4445 Box_::into_raw(f),
4446 )
4447 }
4448 }
4449
4450 #[doc(alias = "current-container-runtime")]
4451 fn connect_current_container_runtime_notify<F: Fn(&Self) + 'static>(
4452 &self,
4453 f: F,
4454 ) -> SignalHandlerId {
4455 unsafe extern "C" fn notify_current_container_runtime_trampoline<
4456 P: IsA<Terminal>,
4457 F: Fn(&P) + 'static,
4458 >(
4459 this: *mut ffi::VteTerminal,
4460 _param_spec: glib::ffi::gpointer,
4461 f: glib::ffi::gpointer,
4462 ) {
4463 let f: &F = &*(f as *const F);
4464 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4465 }
4466 unsafe {
4467 let f: Box_<F> = Box_::new(f);
4468 connect_raw(
4469 self.as_ptr() as *mut _,
4470 b"notify::current-container-runtime\0".as_ptr() as *const _,
4471 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4472 notify_current_container_runtime_trampoline::<Self, F> as *const (),
4473 )),
4474 Box_::into_raw(f),
4475 )
4476 }
4477 }
4478
4479 #[doc(alias = "current-directory-uri")]
4480 fn connect_current_directory_uri_notify<F: Fn(&Self) + 'static>(
4481 &self,
4482 f: F,
4483 ) -> SignalHandlerId {
4484 unsafe extern "C" fn notify_current_directory_uri_trampoline<
4485 P: IsA<Terminal>,
4486 F: Fn(&P) + 'static,
4487 >(
4488 this: *mut ffi::VteTerminal,
4489 _param_spec: glib::ffi::gpointer,
4490 f: glib::ffi::gpointer,
4491 ) {
4492 let f: &F = &*(f as *const F);
4493 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4494 }
4495 unsafe {
4496 let f: Box_<F> = Box_::new(f);
4497 connect_raw(
4498 self.as_ptr() as *mut _,
4499 b"notify::current-directory-uri\0".as_ptr() as *const _,
4500 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4501 notify_current_directory_uri_trampoline::<Self, F> as *const (),
4502 )),
4503 Box_::into_raw(f),
4504 )
4505 }
4506 }
4507
4508 #[doc(alias = "current-file-uri")]
4509 fn connect_current_file_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4510 unsafe extern "C" fn notify_current_file_uri_trampoline<
4511 P: IsA<Terminal>,
4512 F: Fn(&P) + 'static,
4513 >(
4514 this: *mut ffi::VteTerminal,
4515 _param_spec: glib::ffi::gpointer,
4516 f: glib::ffi::gpointer,
4517 ) {
4518 let f: &F = &*(f as *const F);
4519 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4520 }
4521 unsafe {
4522 let f: Box_<F> = Box_::new(f);
4523 connect_raw(
4524 self.as_ptr() as *mut _,
4525 b"notify::current-file-uri\0".as_ptr() as *const _,
4526 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4527 notify_current_file_uri_trampoline::<Self, F> as *const (),
4528 )),
4529 Box_::into_raw(f),
4530 )
4531 }
4532 }
4533
4534 #[doc(alias = "cursor-blink-mode")]
4535 fn connect_cursor_blink_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4536 unsafe extern "C" fn notify_cursor_blink_mode_trampoline<
4537 P: IsA<Terminal>,
4538 F: Fn(&P) + 'static,
4539 >(
4540 this: *mut ffi::VteTerminal,
4541 _param_spec: glib::ffi::gpointer,
4542 f: glib::ffi::gpointer,
4543 ) {
4544 let f: &F = &*(f as *const F);
4545 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4546 }
4547 unsafe {
4548 let f: Box_<F> = Box_::new(f);
4549 connect_raw(
4550 self.as_ptr() as *mut _,
4551 b"notify::cursor-blink-mode\0".as_ptr() as *const _,
4552 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4553 notify_cursor_blink_mode_trampoline::<Self, F> as *const (),
4554 )),
4555 Box_::into_raw(f),
4556 )
4557 }
4558 }
4559
4560 #[doc(alias = "cursor-shape")]
4561 fn connect_cursor_shape_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4562 unsafe extern "C" fn notify_cursor_shape_trampoline<
4563 P: IsA<Terminal>,
4564 F: Fn(&P) + 'static,
4565 >(
4566 this: *mut ffi::VteTerminal,
4567 _param_spec: glib::ffi::gpointer,
4568 f: glib::ffi::gpointer,
4569 ) {
4570 let f: &F = &*(f as *const F);
4571 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4572 }
4573 unsafe {
4574 let f: Box_<F> = Box_::new(f);
4575 connect_raw(
4576 self.as_ptr() as *mut _,
4577 b"notify::cursor-shape\0".as_ptr() as *const _,
4578 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4579 notify_cursor_shape_trampoline::<Self, F> as *const (),
4580 )),
4581 Box_::into_raw(f),
4582 )
4583 }
4584 }
4585
4586 #[doc(alias = "delete-binding")]
4587 fn connect_delete_binding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4588 unsafe extern "C" fn notify_delete_binding_trampoline<
4589 P: IsA<Terminal>,
4590 F: Fn(&P) + 'static,
4591 >(
4592 this: *mut ffi::VteTerminal,
4593 _param_spec: glib::ffi::gpointer,
4594 f: glib::ffi::gpointer,
4595 ) {
4596 let f: &F = &*(f as *const F);
4597 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4598 }
4599 unsafe {
4600 let f: Box_<F> = Box_::new(f);
4601 connect_raw(
4602 self.as_ptr() as *mut _,
4603 b"notify::delete-binding\0".as_ptr() as *const _,
4604 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4605 notify_delete_binding_trampoline::<Self, F> as *const (),
4606 )),
4607 Box_::into_raw(f),
4608 )
4609 }
4610 }
4611
4612 #[cfg(feature = "v0_78")]
4613 #[cfg_attr(docsrs, doc(cfg(feature = "v0_78")))]
4614 #[doc(alias = "enable-a11y")]
4615 fn connect_enable_a11y_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4616 unsafe extern "C" fn notify_enable_a11y_trampoline<
4617 P: IsA<Terminal>,
4618 F: Fn(&P) + 'static,
4619 >(
4620 this: *mut ffi::VteTerminal,
4621 _param_spec: glib::ffi::gpointer,
4622 f: glib::ffi::gpointer,
4623 ) {
4624 let f: &F = &*(f as *const F);
4625 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4626 }
4627 unsafe {
4628 let f: Box_<F> = Box_::new(f);
4629 connect_raw(
4630 self.as_ptr() as *mut _,
4631 b"notify::enable-a11y\0".as_ptr() as *const _,
4632 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4633 notify_enable_a11y_trampoline::<Self, F> as *const (),
4634 )),
4635 Box_::into_raw(f),
4636 )
4637 }
4638 }
4639
4640 #[doc(alias = "enable-bidi")]
4641 fn connect_enable_bidi_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4642 unsafe extern "C" fn notify_enable_bidi_trampoline<
4643 P: IsA<Terminal>,
4644 F: Fn(&P) + 'static,
4645 >(
4646 this: *mut ffi::VteTerminal,
4647 _param_spec: glib::ffi::gpointer,
4648 f: glib::ffi::gpointer,
4649 ) {
4650 let f: &F = &*(f as *const F);
4651 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4652 }
4653 unsafe {
4654 let f: Box_<F> = Box_::new(f);
4655 connect_raw(
4656 self.as_ptr() as *mut _,
4657 b"notify::enable-bidi\0".as_ptr() as *const _,
4658 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4659 notify_enable_bidi_trampoline::<Self, F> as *const (),
4660 )),
4661 Box_::into_raw(f),
4662 )
4663 }
4664 }
4665
4666 #[doc(alias = "enable-fallback-scrolling")]
4667 fn connect_enable_fallback_scrolling_notify<F: Fn(&Self) + 'static>(
4668 &self,
4669 f: F,
4670 ) -> SignalHandlerId {
4671 unsafe extern "C" fn notify_enable_fallback_scrolling_trampoline<
4672 P: IsA<Terminal>,
4673 F: Fn(&P) + 'static,
4674 >(
4675 this: *mut ffi::VteTerminal,
4676 _param_spec: glib::ffi::gpointer,
4677 f: glib::ffi::gpointer,
4678 ) {
4679 let f: &F = &*(f as *const F);
4680 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4681 }
4682 unsafe {
4683 let f: Box_<F> = Box_::new(f);
4684 connect_raw(
4685 self.as_ptr() as *mut _,
4686 b"notify::enable-fallback-scrolling\0".as_ptr() as *const _,
4687 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4688 notify_enable_fallback_scrolling_trampoline::<Self, F> as *const (),
4689 )),
4690 Box_::into_raw(f),
4691 )
4692 }
4693 }
4694
4695 #[doc(alias = "enable-shaping")]
4696 fn connect_enable_shaping_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4697 unsafe extern "C" fn notify_enable_shaping_trampoline<
4698 P: IsA<Terminal>,
4699 F: Fn(&P) + 'static,
4700 >(
4701 this: *mut ffi::VteTerminal,
4702 _param_spec: glib::ffi::gpointer,
4703 f: glib::ffi::gpointer,
4704 ) {
4705 let f: &F = &*(f as *const F);
4706 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4707 }
4708 unsafe {
4709 let f: Box_<F> = Box_::new(f);
4710 connect_raw(
4711 self.as_ptr() as *mut _,
4712 b"notify::enable-shaping\0".as_ptr() as *const _,
4713 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4714 notify_enable_shaping_trampoline::<Self, F> as *const (),
4715 )),
4716 Box_::into_raw(f),
4717 )
4718 }
4719 }
4720
4721 #[doc(alias = "enable-sixel")]
4722 fn connect_enable_sixel_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4723 unsafe extern "C" fn notify_enable_sixel_trampoline<
4724 P: IsA<Terminal>,
4725 F: Fn(&P) + 'static,
4726 >(
4727 this: *mut ffi::VteTerminal,
4728 _param_spec: glib::ffi::gpointer,
4729 f: glib::ffi::gpointer,
4730 ) {
4731 let f: &F = &*(f as *const F);
4732 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4733 }
4734 unsafe {
4735 let f: Box_<F> = Box_::new(f);
4736 connect_raw(
4737 self.as_ptr() as *mut _,
4738 b"notify::enable-sixel\0".as_ptr() as *const _,
4739 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4740 notify_enable_sixel_trampoline::<Self, F> as *const (),
4741 )),
4742 Box_::into_raw(f),
4743 )
4744 }
4745 }
4746
4747 #[doc(alias = "font-desc")]
4748 fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4749 unsafe extern "C" fn notify_font_desc_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4750 this: *mut ffi::VteTerminal,
4751 _param_spec: glib::ffi::gpointer,
4752 f: glib::ffi::gpointer,
4753 ) {
4754 let f: &F = &*(f as *const F);
4755 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4756 }
4757 unsafe {
4758 let f: Box_<F> = Box_::new(f);
4759 connect_raw(
4760 self.as_ptr() as *mut _,
4761 b"notify::font-desc\0".as_ptr() as *const _,
4762 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4763 notify_font_desc_trampoline::<Self, F> as *const (),
4764 )),
4765 Box_::into_raw(f),
4766 )
4767 }
4768 }
4769
4770 #[cfg(feature = "v0_74")]
4771 #[cfg_attr(docsrs, doc(cfg(feature = "v0_74")))]
4772 #[doc(alias = "font-options")]
4773 fn connect_font_options_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4774 unsafe extern "C" fn notify_font_options_trampoline<
4775 P: IsA<Terminal>,
4776 F: Fn(&P) + 'static,
4777 >(
4778 this: *mut ffi::VteTerminal,
4779 _param_spec: glib::ffi::gpointer,
4780 f: glib::ffi::gpointer,
4781 ) {
4782 let f: &F = &*(f as *const F);
4783 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4784 }
4785 unsafe {
4786 let f: Box_<F> = Box_::new(f);
4787 connect_raw(
4788 self.as_ptr() as *mut _,
4789 b"notify::font-options\0".as_ptr() as *const _,
4790 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4791 notify_font_options_trampoline::<Self, F> as *const (),
4792 )),
4793 Box_::into_raw(f),
4794 )
4795 }
4796 }
4797
4798 #[doc(alias = "font-scale")]
4799 fn connect_font_scale_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4800 unsafe extern "C" fn notify_font_scale_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4801 this: *mut ffi::VteTerminal,
4802 _param_spec: glib::ffi::gpointer,
4803 f: glib::ffi::gpointer,
4804 ) {
4805 let f: &F = &*(f as *const F);
4806 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4807 }
4808 unsafe {
4809 let f: Box_<F> = Box_::new(f);
4810 connect_raw(
4811 self.as_ptr() as *mut _,
4812 b"notify::font-scale\0".as_ptr() as *const _,
4813 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4814 notify_font_scale_trampoline::<Self, F> as *const (),
4815 )),
4816 Box_::into_raw(f),
4817 )
4818 }
4819 }
4820
4821 #[doc(alias = "hyperlink-hover-uri")]
4822 fn connect_hyperlink_hover_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4823 unsafe extern "C" fn notify_hyperlink_hover_uri_trampoline<
4824 P: IsA<Terminal>,
4825 F: Fn(&P) + 'static,
4826 >(
4827 this: *mut ffi::VteTerminal,
4828 _param_spec: glib::ffi::gpointer,
4829 f: glib::ffi::gpointer,
4830 ) {
4831 let f: &F = &*(f as *const F);
4832 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4833 }
4834 unsafe {
4835 let f: Box_<F> = Box_::new(f);
4836 connect_raw(
4837 self.as_ptr() as *mut _,
4838 b"notify::hyperlink-hover-uri\0".as_ptr() as *const _,
4839 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4840 notify_hyperlink_hover_uri_trampoline::<Self, F> as *const (),
4841 )),
4842 Box_::into_raw(f),
4843 )
4844 }
4845 }
4846
4847 #[doc(alias = "input-enabled")]
4848 fn connect_input_enabled_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4849 unsafe extern "C" fn notify_input_enabled_trampoline<
4850 P: IsA<Terminal>,
4851 F: Fn(&P) + 'static,
4852 >(
4853 this: *mut ffi::VteTerminal,
4854 _param_spec: glib::ffi::gpointer,
4855 f: glib::ffi::gpointer,
4856 ) {
4857 let f: &F = &*(f as *const F);
4858 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4859 }
4860 unsafe {
4861 let f: Box_<F> = Box_::new(f);
4862 connect_raw(
4863 self.as_ptr() as *mut _,
4864 b"notify::input-enabled\0".as_ptr() as *const _,
4865 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4866 notify_input_enabled_trampoline::<Self, F> as *const (),
4867 )),
4868 Box_::into_raw(f),
4869 )
4870 }
4871 }
4872
4873 #[doc(alias = "pointer-autohide")]
4874 fn connect_pointer_autohide_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4875 unsafe extern "C" fn notify_pointer_autohide_trampoline<
4876 P: IsA<Terminal>,
4877 F: Fn(&P) + 'static,
4878 >(
4879 this: *mut ffi::VteTerminal,
4880 _param_spec: glib::ffi::gpointer,
4881 f: glib::ffi::gpointer,
4882 ) {
4883 let f: &F = &*(f as *const F);
4884 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4885 }
4886 unsafe {
4887 let f: Box_<F> = Box_::new(f);
4888 connect_raw(
4889 self.as_ptr() as *mut _,
4890 b"notify::pointer-autohide\0".as_ptr() as *const _,
4891 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4892 notify_pointer_autohide_trampoline::<Self, F> as *const (),
4893 )),
4894 Box_::into_raw(f),
4895 )
4896 }
4897 }
4898
4899 #[doc(alias = "pty")]
4900 fn connect_pty_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4901 unsafe extern "C" fn notify_pty_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
4902 this: *mut ffi::VteTerminal,
4903 _param_spec: glib::ffi::gpointer,
4904 f: glib::ffi::gpointer,
4905 ) {
4906 let f: &F = &*(f as *const F);
4907 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4908 }
4909 unsafe {
4910 let f: Box_<F> = Box_::new(f);
4911 connect_raw(
4912 self.as_ptr() as *mut _,
4913 b"notify::pty\0".as_ptr() as *const _,
4914 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4915 notify_pty_trampoline::<Self, F> as *const (),
4916 )),
4917 Box_::into_raw(f),
4918 )
4919 }
4920 }
4921
4922 #[cfg(feature = "v0_76")]
4923 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
4924 #[doc(alias = "scroll-on-insert")]
4925 fn connect_scroll_on_insert_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4926 unsafe extern "C" fn notify_scroll_on_insert_trampoline<
4927 P: IsA<Terminal>,
4928 F: Fn(&P) + 'static,
4929 >(
4930 this: *mut ffi::VteTerminal,
4931 _param_spec: glib::ffi::gpointer,
4932 f: glib::ffi::gpointer,
4933 ) {
4934 let f: &F = &*(f as *const F);
4935 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4936 }
4937 unsafe {
4938 let f: Box_<F> = Box_::new(f);
4939 connect_raw(
4940 self.as_ptr() as *mut _,
4941 b"notify::scroll-on-insert\0".as_ptr() as *const _,
4942 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4943 notify_scroll_on_insert_trampoline::<Self, F> as *const (),
4944 )),
4945 Box_::into_raw(f),
4946 )
4947 }
4948 }
4949
4950 #[doc(alias = "scroll-on-keystroke")]
4951 fn connect_scroll_on_keystroke_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4952 unsafe extern "C" fn notify_scroll_on_keystroke_trampoline<
4953 P: IsA<Terminal>,
4954 F: Fn(&P) + 'static,
4955 >(
4956 this: *mut ffi::VteTerminal,
4957 _param_spec: glib::ffi::gpointer,
4958 f: glib::ffi::gpointer,
4959 ) {
4960 let f: &F = &*(f as *const F);
4961 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4962 }
4963 unsafe {
4964 let f: Box_<F> = Box_::new(f);
4965 connect_raw(
4966 self.as_ptr() as *mut _,
4967 b"notify::scroll-on-keystroke\0".as_ptr() as *const _,
4968 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4969 notify_scroll_on_keystroke_trampoline::<Self, F> as *const (),
4970 )),
4971 Box_::into_raw(f),
4972 )
4973 }
4974 }
4975
4976 #[doc(alias = "scroll-on-output")]
4977 fn connect_scroll_on_output_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4978 unsafe extern "C" fn notify_scroll_on_output_trampoline<
4979 P: IsA<Terminal>,
4980 F: Fn(&P) + 'static,
4981 >(
4982 this: *mut ffi::VteTerminal,
4983 _param_spec: glib::ffi::gpointer,
4984 f: glib::ffi::gpointer,
4985 ) {
4986 let f: &F = &*(f as *const F);
4987 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
4988 }
4989 unsafe {
4990 let f: Box_<F> = Box_::new(f);
4991 connect_raw(
4992 self.as_ptr() as *mut _,
4993 b"notify::scroll-on-output\0".as_ptr() as *const _,
4994 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4995 notify_scroll_on_output_trampoline::<Self, F> as *const (),
4996 )),
4997 Box_::into_raw(f),
4998 )
4999 }
5000 }
5001
5002 #[doc(alias = "scroll-unit-is-pixels")]
5003 fn connect_scroll_unit_is_pixels_notify<F: Fn(&Self) + 'static>(
5004 &self,
5005 f: F,
5006 ) -> SignalHandlerId {
5007 unsafe extern "C" fn notify_scroll_unit_is_pixels_trampoline<
5008 P: IsA<Terminal>,
5009 F: Fn(&P) + 'static,
5010 >(
5011 this: *mut ffi::VteTerminal,
5012 _param_spec: glib::ffi::gpointer,
5013 f: glib::ffi::gpointer,
5014 ) {
5015 let f: &F = &*(f as *const F);
5016 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5017 }
5018 unsafe {
5019 let f: Box_<F> = Box_::new(f);
5020 connect_raw(
5021 self.as_ptr() as *mut _,
5022 b"notify::scroll-unit-is-pixels\0".as_ptr() as *const _,
5023 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5024 notify_scroll_unit_is_pixels_trampoline::<Self, F> as *const (),
5025 )),
5026 Box_::into_raw(f),
5027 )
5028 }
5029 }
5030
5031 #[doc(alias = "scrollback-lines")]
5032 fn connect_scrollback_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5033 unsafe extern "C" fn notify_scrollback_lines_trampoline<
5034 P: IsA<Terminal>,
5035 F: Fn(&P) + 'static,
5036 >(
5037 this: *mut ffi::VteTerminal,
5038 _param_spec: glib::ffi::gpointer,
5039 f: glib::ffi::gpointer,
5040 ) {
5041 let f: &F = &*(f as *const F);
5042 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5043 }
5044 unsafe {
5045 let f: Box_<F> = Box_::new(f);
5046 connect_raw(
5047 self.as_ptr() as *mut _,
5048 b"notify::scrollback-lines\0".as_ptr() as *const _,
5049 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5050 notify_scrollback_lines_trampoline::<Self, F> as *const (),
5051 )),
5052 Box_::into_raw(f),
5053 )
5054 }
5055 }
5056
5057 #[doc(alias = "text-blink-mode")]
5058 fn connect_text_blink_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5059 unsafe extern "C" fn notify_text_blink_mode_trampoline<
5060 P: IsA<Terminal>,
5061 F: Fn(&P) + 'static,
5062 >(
5063 this: *mut ffi::VteTerminal,
5064 _param_spec: glib::ffi::gpointer,
5065 f: glib::ffi::gpointer,
5066 ) {
5067 let f: &F = &*(f as *const F);
5068 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5069 }
5070 unsafe {
5071 let f: Box_<F> = Box_::new(f);
5072 connect_raw(
5073 self.as_ptr() as *mut _,
5074 b"notify::text-blink-mode\0".as_ptr() as *const _,
5075 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5076 notify_text_blink_mode_trampoline::<Self, F> as *const (),
5077 )),
5078 Box_::into_raw(f),
5079 )
5080 }
5081 }
5082
5083 #[doc(alias = "window-title")]
5084 fn connect_window_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5085 unsafe extern "C" fn notify_window_title_trampoline<
5086 P: IsA<Terminal>,
5087 F: Fn(&P) + 'static,
5088 >(
5089 this: *mut ffi::VteTerminal,
5090 _param_spec: glib::ffi::gpointer,
5091 f: glib::ffi::gpointer,
5092 ) {
5093 let f: &F = &*(f as *const F);
5094 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5095 }
5096 unsafe {
5097 let f: Box_<F> = Box_::new(f);
5098 connect_raw(
5099 self.as_ptr() as *mut _,
5100 b"notify::window-title\0".as_ptr() as *const _,
5101 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5102 notify_window_title_trampoline::<Self, F> as *const (),
5103 )),
5104 Box_::into_raw(f),
5105 )
5106 }
5107 }
5108
5109 #[doc(alias = "word-char-exceptions")]
5110 fn connect_word_char_exceptions_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5111 unsafe extern "C" fn notify_word_char_exceptions_trampoline<
5112 P: IsA<Terminal>,
5113 F: Fn(&P) + 'static,
5114 >(
5115 this: *mut ffi::VteTerminal,
5116 _param_spec: glib::ffi::gpointer,
5117 f: glib::ffi::gpointer,
5118 ) {
5119 let f: &F = &*(f as *const F);
5120 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5121 }
5122 unsafe {
5123 let f: Box_<F> = Box_::new(f);
5124 connect_raw(
5125 self.as_ptr() as *mut _,
5126 b"notify::word-char-exceptions\0".as_ptr() as *const _,
5127 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5128 notify_word_char_exceptions_trampoline::<Self, F> as *const (),
5129 )),
5130 Box_::into_raw(f),
5131 )
5132 }
5133 }
5134
5135 #[cfg(feature = "v0_76")]
5136 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
5137 #[doc(alias = "xalign")]
5138 fn connect_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5139 unsafe extern "C" fn notify_xalign_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
5140 this: *mut ffi::VteTerminal,
5141 _param_spec: glib::ffi::gpointer,
5142 f: glib::ffi::gpointer,
5143 ) {
5144 let f: &F = &*(f as *const F);
5145 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5146 }
5147 unsafe {
5148 let f: Box_<F> = Box_::new(f);
5149 connect_raw(
5150 self.as_ptr() as *mut _,
5151 b"notify::xalign\0".as_ptr() as *const _,
5152 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5153 notify_xalign_trampoline::<Self, F> as *const (),
5154 )),
5155 Box_::into_raw(f),
5156 )
5157 }
5158 }
5159
5160 #[cfg(feature = "v0_76")]
5161 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
5162 #[doc(alias = "xfill")]
5163 fn connect_xfill_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5164 unsafe extern "C" fn notify_xfill_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
5165 this: *mut ffi::VteTerminal,
5166 _param_spec: glib::ffi::gpointer,
5167 f: glib::ffi::gpointer,
5168 ) {
5169 let f: &F = &*(f as *const F);
5170 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5171 }
5172 unsafe {
5173 let f: Box_<F> = Box_::new(f);
5174 connect_raw(
5175 self.as_ptr() as *mut _,
5176 b"notify::xfill\0".as_ptr() as *const _,
5177 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5178 notify_xfill_trampoline::<Self, F> as *const (),
5179 )),
5180 Box_::into_raw(f),
5181 )
5182 }
5183 }
5184
5185 #[cfg(feature = "v0_76")]
5186 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
5187 #[doc(alias = "yalign")]
5188 fn connect_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5189 unsafe extern "C" fn notify_yalign_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
5190 this: *mut ffi::VteTerminal,
5191 _param_spec: glib::ffi::gpointer,
5192 f: glib::ffi::gpointer,
5193 ) {
5194 let f: &F = &*(f as *const F);
5195 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5196 }
5197 unsafe {
5198 let f: Box_<F> = Box_::new(f);
5199 connect_raw(
5200 self.as_ptr() as *mut _,
5201 b"notify::yalign\0".as_ptr() as *const _,
5202 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5203 notify_yalign_trampoline::<Self, F> as *const (),
5204 )),
5205 Box_::into_raw(f),
5206 )
5207 }
5208 }
5209
5210 #[cfg(feature = "v0_76")]
5211 #[cfg_attr(docsrs, doc(cfg(feature = "v0_76")))]
5212 #[doc(alias = "yfill")]
5213 fn connect_yfill_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5214 unsafe extern "C" fn notify_yfill_trampoline<P: IsA<Terminal>, F: Fn(&P) + 'static>(
5215 this: *mut ffi::VteTerminal,
5216 _param_spec: glib::ffi::gpointer,
5217 f: glib::ffi::gpointer,
5218 ) {
5219 let f: &F = &*(f as *const F);
5220 f(Terminal::from_glib_borrow(this).unsafe_cast_ref())
5221 }
5222 unsafe {
5223 let f: Box_<F> = Box_::new(f);
5224 connect_raw(
5225 self.as_ptr() as *mut _,
5226 b"notify::yfill\0".as_ptr() as *const _,
5227 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5228 notify_yfill_trampoline::<Self, F> as *const (),
5229 )),
5230 Box_::into_raw(f),
5231 )
5232 }
5233 }
5234}
5235
5236impl<O: IsA<Terminal>> TerminalExt for O {}