1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = VteTerminal.html 27 * outPack = vte 28 * outFile = Terminal 29 * strct = VteTerminal 30 * realStrct= 31 * ctorStrct= 32 * clss = Terminal 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - ScrollableIF 40 * prefixes: 41 * - vte_terminal_ 42 * - vte_ 43 * omit structs: 44 * omit prefixes: 45 * omit code: 46 * omit signals: 47 * imports: 48 * - glib.Str 49 * - glib.ErrorG 50 * - glib.GException 51 * - glib.ArrayG 52 * - glib.Regex 53 * - gio.Cancellable 54 * - gio.OutputStream 55 * - gdk.Color 56 * - gdk.Cursor 57 * - gdk.RGBA 58 * - gtk.Adjustment 59 * - gtk.MenuShell 60 * - pango.PgFontDescription 61 * - vte.Pty 62 * - gtk.ScrollableIF 63 * - gtk.ScrollableT 64 * structWrap: 65 * - GArray* -> ArrayG 66 * - GCancellable* -> Cancellable 67 * - GOutputStream* -> OutputStream 68 * - GRegex* -> Regex 69 * - GdkColor* -> Color 70 * - GdkCursor* -> Cursor 71 * - GdkRGBA* -> RGBA 72 * - GtkAdjustment* -> Adjustment 73 * - GtkMenuShell* -> MenuShell 74 * - PangoFontDescription* -> PgFontDescription 75 * - VtePty* -> Pty 76 * module aliases: 77 * local aliases: 78 * overrides: 79 */ 80 81 module vte.Terminal; 82 83 public import vtec.vtetypes; 84 85 private import vtec.vte; 86 private import glib.ConstructionException; 87 private import gobject.ObjectG; 88 89 private import gobject.Signals; 90 public import gtkc.gdktypes; 91 private import glib.Str; 92 private import glib.ErrorG; 93 private import glib.GException; 94 private import glib.ArrayG; 95 private import glib.Regex; 96 private import gio.Cancellable; 97 private import gio.OutputStream; 98 private import gdk.Color; 99 private import gdk.Cursor; 100 private import gdk.RGBA; 101 private import gtk.Adjustment; 102 private import gtk.MenuShell; 103 private import pango.PgFontDescription; 104 private import vte.Pty; 105 private import gtk.ScrollableIF; 106 private import gtk.ScrollableT; 107 108 109 private import gtk.Widget; 110 111 /** 112 * A VteTerminal is a terminal emulator implemented as a GTK2 widget. 113 */ 114 public class Terminal : Widget, ScrollableIF 115 { 116 117 /** the main Gtk struct */ 118 protected VteTerminal* vteTerminal; 119 120 121 /** Get the main Gtk struct */ 122 public VteTerminal* getTerminalStruct() 123 { 124 return vteTerminal; 125 } 126 127 128 /** the main Gtk struct as a void* */ 129 protected override void* getStruct() 130 { 131 return cast(void*)vteTerminal; 132 } 133 134 /** 135 * Sets our main struct and passes it to the parent class 136 */ 137 public this (VteTerminal* vteTerminal) 138 { 139 super(cast(GtkWidget*)vteTerminal); 140 this.vteTerminal = vteTerminal; 141 } 142 143 protected override void setStruct(GObject* obj) 144 { 145 super.setStruct(obj); 146 vteTerminal = cast(VteTerminal*)obj; 147 } 148 149 // add the Scrollable capabilities 150 mixin ScrollableT!(VteTerminal); 151 152 alias Widget.setOpacity setOpacity; 153 154 /** 155 */ 156 int[string] connectedSignals; 157 158 void delegate(Terminal)[] onBeepListeners; 159 /** 160 * This signal is emitted when the a child sends a beep request to the 161 * terminal. 162 */ 163 void addOnBeep(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 164 { 165 if ( !("beep" in connectedSignals) ) 166 { 167 Signals.connectData( 168 getStruct(), 169 "beep", 170 cast(GCallback)&callBackBeep, 171 cast(void*)this, 172 null, 173 connectFlags); 174 connectedSignals["beep"] = 1; 175 } 176 onBeepListeners ~= dlg; 177 } 178 extern(C) static void callBackBeep(VteTerminal* vteterminalStruct, Terminal _terminal) 179 { 180 foreach ( void delegate(Terminal) dlg ; _terminal.onBeepListeners ) 181 { 182 dlg(_terminal); 183 } 184 } 185 186 void delegate(guint, guint, Terminal)[] onCharSizeChangedListeners; 187 /** 188 * Emitted whenever selection of a new font causes the values of the 189 * char_width or char_height fields to change. 190 */ 191 void addOnCharSizeChanged(void delegate(guint, guint, Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 192 { 193 if ( !("char-size-changed" in connectedSignals) ) 194 { 195 Signals.connectData( 196 getStruct(), 197 "char-size-changed", 198 cast(GCallback)&callBackCharSizeChanged, 199 cast(void*)this, 200 null, 201 connectFlags); 202 connectedSignals["char-size-changed"] = 1; 203 } 204 onCharSizeChangedListeners ~= dlg; 205 } 206 extern(C) static void callBackCharSizeChanged(VteTerminal* vteterminalStruct, guint width, guint height, Terminal _terminal) 207 { 208 foreach ( void delegate(guint, guint, Terminal) dlg ; _terminal.onCharSizeChangedListeners ) 209 { 210 dlg(width, height, _terminal); 211 } 212 } 213 214 void delegate(Terminal)[] onChildExitedListeners; 215 /** 216 * This signal is emitted when the terminal detects that a child started 217 * using vte_terminal_fork_command() has exited. 218 */ 219 void addOnChildExited(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 220 { 221 if ( !("child-exited" in connectedSignals) ) 222 { 223 Signals.connectData( 224 getStruct(), 225 "child-exited", 226 cast(GCallback)&callBackChildExited, 227 cast(void*)this, 228 null, 229 connectFlags); 230 connectedSignals["child-exited"] = 1; 231 } 232 onChildExitedListeners ~= dlg; 233 } 234 extern(C) static void callBackChildExited(VteTerminal* vteterminalStruct, Terminal _terminal) 235 { 236 foreach ( void delegate(Terminal) dlg ; _terminal.onChildExitedListeners ) 237 { 238 dlg(_terminal); 239 } 240 } 241 242 void delegate(string, guint, Terminal)[] onCommitListeners; 243 /** 244 * Emitted whenever the terminal receives input from the user and 245 * prepares to send it to the child process. The signal is emitted even 246 * when there is no child process. 247 */ 248 void addOnCommit(void delegate(string, guint, Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 249 { 250 if ( !("commit" in connectedSignals) ) 251 { 252 Signals.connectData( 253 getStruct(), 254 "commit", 255 cast(GCallback)&callBackCommit, 256 cast(void*)this, 257 null, 258 connectFlags); 259 connectedSignals["commit"] = 1; 260 } 261 onCommitListeners ~= dlg; 262 } 263 extern(C) static void callBackCommit(VteTerminal* vteterminalStruct, gchar* text, guint size, Terminal _terminal) 264 { 265 foreach ( void delegate(string, guint, Terminal) dlg ; _terminal.onCommitListeners ) 266 { 267 dlg(Str.toString(text), size, _terminal); 268 } 269 } 270 271 void delegate(Terminal)[] onContentsChangedListeners; 272 /** 273 * Emitted whenever the visible appearance of the terminal has changed. 274 * Used primarily by VteTerminalAccessible. 275 */ 276 void addOnContentsChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 277 { 278 if ( !("contents-changed" in connectedSignals) ) 279 { 280 Signals.connectData( 281 getStruct(), 282 "contents-changed", 283 cast(GCallback)&callBackContentsChanged, 284 cast(void*)this, 285 null, 286 connectFlags); 287 connectedSignals["contents-changed"] = 1; 288 } 289 onContentsChangedListeners ~= dlg; 290 } 291 extern(C) static void callBackContentsChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 292 { 293 foreach ( void delegate(Terminal) dlg ; _terminal.onContentsChangedListeners ) 294 { 295 dlg(_terminal); 296 } 297 } 298 299 void delegate(Terminal)[] onCopyClipboardListeners; 300 /** 301 * Emitted whenever vte_terminal_copy_clipboard() is called. 302 */ 303 void addOnCopyClipboard(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 304 { 305 if ( !("copy-clipboard" in connectedSignals) ) 306 { 307 Signals.connectData( 308 getStruct(), 309 "copy-clipboard", 310 cast(GCallback)&callBackCopyClipboard, 311 cast(void*)this, 312 null, 313 connectFlags); 314 connectedSignals["copy-clipboard"] = 1; 315 } 316 onCopyClipboardListeners ~= dlg; 317 } 318 extern(C) static void callBackCopyClipboard(VteTerminal* vteterminalStruct, Terminal _terminal) 319 { 320 foreach ( void delegate(Terminal) dlg ; _terminal.onCopyClipboardListeners ) 321 { 322 dlg(_terminal); 323 } 324 } 325 326 void delegate(Terminal)[] onCurrentDirectoryUriChangedListeners; 327 /** 328 * Emitted when the current directory URI is modified. 329 * Since 0.34 330 */ 331 void addOnCurrentDirectoryUriChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 332 { 333 if ( !("current-directory-uri-changed" in connectedSignals) ) 334 { 335 Signals.connectData( 336 getStruct(), 337 "current-directory-uri-changed", 338 cast(GCallback)&callBackCurrentDirectoryUriChanged, 339 cast(void*)this, 340 null, 341 connectFlags); 342 connectedSignals["current-directory-uri-changed"] = 1; 343 } 344 onCurrentDirectoryUriChangedListeners ~= dlg; 345 } 346 extern(C) static void callBackCurrentDirectoryUriChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 347 { 348 foreach ( void delegate(Terminal) dlg ; _terminal.onCurrentDirectoryUriChangedListeners ) 349 { 350 dlg(_terminal); 351 } 352 } 353 354 void delegate(Terminal)[] onCurrentFileUriChangedListeners; 355 /** 356 * Emitted when the current file URI is modified. 357 * Since 0.34 358 */ 359 void addOnCurrentFileUriChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 360 { 361 if ( !("current-file-uri-changed" in connectedSignals) ) 362 { 363 Signals.connectData( 364 getStruct(), 365 "current-file-uri-changed", 366 cast(GCallback)&callBackCurrentFileUriChanged, 367 cast(void*)this, 368 null, 369 connectFlags); 370 connectedSignals["current-file-uri-changed"] = 1; 371 } 372 onCurrentFileUriChangedListeners ~= dlg; 373 } 374 extern(C) static void callBackCurrentFileUriChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 375 { 376 foreach ( void delegate(Terminal) dlg ; _terminal.onCurrentFileUriChangedListeners ) 377 { 378 dlg(_terminal); 379 } 380 } 381 382 void delegate(Terminal)[] onCursorMovedListeners; 383 /** 384 * Emitted whenever the cursor moves to a new character cell. Used 385 * primarily by VteTerminalAccessible. 386 */ 387 void addOnCursorMoved(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 388 { 389 if ( !("cursor-moved" in connectedSignals) ) 390 { 391 Signals.connectData( 392 getStruct(), 393 "cursor-moved", 394 cast(GCallback)&callBackCursorMoved, 395 cast(void*)this, 396 null, 397 connectFlags); 398 connectedSignals["cursor-moved"] = 1; 399 } 400 onCursorMovedListeners ~= dlg; 401 } 402 extern(C) static void callBackCursorMoved(VteTerminal* vteterminalStruct, Terminal _terminal) 403 { 404 foreach ( void delegate(Terminal) dlg ; _terminal.onCursorMovedListeners ) 405 { 406 dlg(_terminal); 407 } 408 } 409 410 void delegate(Terminal)[] onDecreaseFontSizeListeners; 411 /** 412 * Emitted when the user hits the '-' key while holding the Control key. 413 */ 414 void addOnDecreaseFontSize(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 415 { 416 if ( !("decrease-font-size" in connectedSignals) ) 417 { 418 Signals.connectData( 419 getStruct(), 420 "decrease-font-size", 421 cast(GCallback)&callBackDecreaseFontSize, 422 cast(void*)this, 423 null, 424 connectFlags); 425 connectedSignals["decrease-font-size"] = 1; 426 } 427 onDecreaseFontSizeListeners ~= dlg; 428 } 429 extern(C) static void callBackDecreaseFontSize(VteTerminal* vteterminalStruct, Terminal _terminal) 430 { 431 foreach ( void delegate(Terminal) dlg ; _terminal.onDecreaseFontSizeListeners ) 432 { 433 dlg(_terminal); 434 } 435 } 436 437 void delegate(Terminal)[] onDeiconifyWindowListeners; 438 /** 439 * Emitted at the child application's request. 440 */ 441 void addOnDeiconifyWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 442 { 443 if ( !("deiconify-window" in connectedSignals) ) 444 { 445 Signals.connectData( 446 getStruct(), 447 "deiconify-window", 448 cast(GCallback)&callBackDeiconifyWindow, 449 cast(void*)this, 450 null, 451 connectFlags); 452 connectedSignals["deiconify-window"] = 1; 453 } 454 onDeiconifyWindowListeners ~= dlg; 455 } 456 extern(C) static void callBackDeiconifyWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 457 { 458 foreach ( void delegate(Terminal) dlg ; _terminal.onDeiconifyWindowListeners ) 459 { 460 dlg(_terminal); 461 } 462 } 463 464 void delegate(Terminal)[] onEmulationChangedListeners; 465 /** 466 * Emitted whenever the terminal's emulation changes, only possible at 467 * the parent application's request. 468 */ 469 void addOnEmulationChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 470 { 471 if ( !("emulation-changed" in connectedSignals) ) 472 { 473 Signals.connectData( 474 getStruct(), 475 "emulation-changed", 476 cast(GCallback)&callBackEmulationChanged, 477 cast(void*)this, 478 null, 479 connectFlags); 480 connectedSignals["emulation-changed"] = 1; 481 } 482 onEmulationChangedListeners ~= dlg; 483 } 484 extern(C) static void callBackEmulationChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 485 { 486 foreach ( void delegate(Terminal) dlg ; _terminal.onEmulationChangedListeners ) 487 { 488 dlg(_terminal); 489 } 490 } 491 492 void delegate(Terminal)[] onEncodingChangedListeners; 493 /** 494 * Emitted whenever the terminal's current encoding has changed, either 495 * as a result of receiving a control sequence which toggled between the 496 * local and UTF-8 encodings, or at the parent application's request. 497 */ 498 void addOnEncodingChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 499 { 500 if ( !("encoding-changed" in connectedSignals) ) 501 { 502 Signals.connectData( 503 getStruct(), 504 "encoding-changed", 505 cast(GCallback)&callBackEncodingChanged, 506 cast(void*)this, 507 null, 508 connectFlags); 509 connectedSignals["encoding-changed"] = 1; 510 } 511 onEncodingChangedListeners ~= dlg; 512 } 513 extern(C) static void callBackEncodingChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 514 { 515 foreach ( void delegate(Terminal) dlg ; _terminal.onEncodingChangedListeners ) 516 { 517 dlg(_terminal); 518 } 519 } 520 521 void delegate(Terminal)[] onEofListeners; 522 /** 523 * Emitted when the terminal receives an end-of-file from a child which 524 * is running in the terminal. This signal is frequently (but not 525 * always) emitted with a "child-exited" signal. 526 */ 527 void addOnEof(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 528 { 529 if ( !("eof" in connectedSignals) ) 530 { 531 Signals.connectData( 532 getStruct(), 533 "eof", 534 cast(GCallback)&callBackEof, 535 cast(void*)this, 536 null, 537 connectFlags); 538 connectedSignals["eof"] = 1; 539 } 540 onEofListeners ~= dlg; 541 } 542 extern(C) static void callBackEof(VteTerminal* vteterminalStruct, Terminal _terminal) 543 { 544 foreach ( void delegate(Terminal) dlg ; _terminal.onEofListeners ) 545 { 546 dlg(_terminal); 547 } 548 } 549 550 void delegate(Terminal)[] onIconTitleChangedListeners; 551 /** 552 * Emitted when the terminal's icon_title field is modified. 553 */ 554 void addOnIconTitleChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 555 { 556 if ( !("icon-title-changed" in connectedSignals) ) 557 { 558 Signals.connectData( 559 getStruct(), 560 "icon-title-changed", 561 cast(GCallback)&callBackIconTitleChanged, 562 cast(void*)this, 563 null, 564 connectFlags); 565 connectedSignals["icon-title-changed"] = 1; 566 } 567 onIconTitleChangedListeners ~= dlg; 568 } 569 extern(C) static void callBackIconTitleChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 570 { 571 foreach ( void delegate(Terminal) dlg ; _terminal.onIconTitleChangedListeners ) 572 { 573 dlg(_terminal); 574 } 575 } 576 577 void delegate(Terminal)[] onIconifyWindowListeners; 578 /** 579 * Emitted at the child application's request. 580 */ 581 void addOnIconifyWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 582 { 583 if ( !("iconify-window" in connectedSignals) ) 584 { 585 Signals.connectData( 586 getStruct(), 587 "iconify-window", 588 cast(GCallback)&callBackIconifyWindow, 589 cast(void*)this, 590 null, 591 connectFlags); 592 connectedSignals["iconify-window"] = 1; 593 } 594 onIconifyWindowListeners ~= dlg; 595 } 596 extern(C) static void callBackIconifyWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 597 { 598 foreach ( void delegate(Terminal) dlg ; _terminal.onIconifyWindowListeners ) 599 { 600 dlg(_terminal); 601 } 602 } 603 604 void delegate(Terminal)[] onIncreaseFontSizeListeners; 605 /** 606 * Emitted when the user hits the '+' key while holding the Control key. 607 */ 608 void addOnIncreaseFontSize(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 609 { 610 if ( !("increase-font-size" in connectedSignals) ) 611 { 612 Signals.connectData( 613 getStruct(), 614 "increase-font-size", 615 cast(GCallback)&callBackIncreaseFontSize, 616 cast(void*)this, 617 null, 618 connectFlags); 619 connectedSignals["increase-font-size"] = 1; 620 } 621 onIncreaseFontSizeListeners ~= dlg; 622 } 623 extern(C) static void callBackIncreaseFontSize(VteTerminal* vteterminalStruct, Terminal _terminal) 624 { 625 foreach ( void delegate(Terminal) dlg ; _terminal.onIncreaseFontSizeListeners ) 626 { 627 dlg(_terminal); 628 } 629 } 630 631 void delegate(Terminal)[] onLowerWindowListeners; 632 /** 633 * Emitted at the child application's request. 634 */ 635 void addOnLowerWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 636 { 637 if ( !("lower-window" in connectedSignals) ) 638 { 639 Signals.connectData( 640 getStruct(), 641 "lower-window", 642 cast(GCallback)&callBackLowerWindow, 643 cast(void*)this, 644 null, 645 connectFlags); 646 connectedSignals["lower-window"] = 1; 647 } 648 onLowerWindowListeners ~= dlg; 649 } 650 extern(C) static void callBackLowerWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 651 { 652 foreach ( void delegate(Terminal) dlg ; _terminal.onLowerWindowListeners ) 653 { 654 dlg(_terminal); 655 } 656 } 657 658 void delegate(Terminal)[] onMaximizeWindowListeners; 659 /** 660 * Emitted at the child application's request. 661 */ 662 void addOnMaximizeWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 663 { 664 if ( !("maximize-window" in connectedSignals) ) 665 { 666 Signals.connectData( 667 getStruct(), 668 "maximize-window", 669 cast(GCallback)&callBackMaximizeWindow, 670 cast(void*)this, 671 null, 672 connectFlags); 673 connectedSignals["maximize-window"] = 1; 674 } 675 onMaximizeWindowListeners ~= dlg; 676 } 677 extern(C) static void callBackMaximizeWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 678 { 679 foreach ( void delegate(Terminal) dlg ; _terminal.onMaximizeWindowListeners ) 680 { 681 dlg(_terminal); 682 } 683 } 684 685 void delegate(guint, guint, Terminal)[] onMoveWindowListeners; 686 /** 687 * Emitted at the child application's request. 688 */ 689 void addOnMoveWindow(void delegate(guint, guint, Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 690 { 691 if ( !("move-window" in connectedSignals) ) 692 { 693 Signals.connectData( 694 getStruct(), 695 "move-window", 696 cast(GCallback)&callBackMoveWindow, 697 cast(void*)this, 698 null, 699 connectFlags); 700 connectedSignals["move-window"] = 1; 701 } 702 onMoveWindowListeners ~= dlg; 703 } 704 extern(C) static void callBackMoveWindow(VteTerminal* vteterminalStruct, guint x, guint y, Terminal _terminal) 705 { 706 foreach ( void delegate(guint, guint, Terminal) dlg ; _terminal.onMoveWindowListeners ) 707 { 708 dlg(x, y, _terminal); 709 } 710 } 711 712 void delegate(Terminal)[] onPasteClipboardListeners; 713 /** 714 * Emitted whenever vte_terminal_paste_clipboard() is called. 715 */ 716 void addOnPasteClipboard(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 717 { 718 if ( !("paste-clipboard" in connectedSignals) ) 719 { 720 Signals.connectData( 721 getStruct(), 722 "paste-clipboard", 723 cast(GCallback)&callBackPasteClipboard, 724 cast(void*)this, 725 null, 726 connectFlags); 727 connectedSignals["paste-clipboard"] = 1; 728 } 729 onPasteClipboardListeners ~= dlg; 730 } 731 extern(C) static void callBackPasteClipboard(VteTerminal* vteterminalStruct, Terminal _terminal) 732 { 733 foreach ( void delegate(Terminal) dlg ; _terminal.onPasteClipboardListeners ) 734 { 735 dlg(_terminal); 736 } 737 } 738 739 void delegate(Terminal)[] onRaiseWindowListeners; 740 /** 741 * Emitted at the child application's request. 742 */ 743 void addOnRaiseWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 744 { 745 if ( !("raise-window" in connectedSignals) ) 746 { 747 Signals.connectData( 748 getStruct(), 749 "raise-window", 750 cast(GCallback)&callBackRaiseWindow, 751 cast(void*)this, 752 null, 753 connectFlags); 754 connectedSignals["raise-window"] = 1; 755 } 756 onRaiseWindowListeners ~= dlg; 757 } 758 extern(C) static void callBackRaiseWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 759 { 760 foreach ( void delegate(Terminal) dlg ; _terminal.onRaiseWindowListeners ) 761 { 762 dlg(_terminal); 763 } 764 } 765 766 void delegate(Terminal)[] onRefreshWindowListeners; 767 /** 768 * Emitted at the child application's request. 769 */ 770 void addOnRefreshWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 771 { 772 if ( !("refresh-window" in connectedSignals) ) 773 { 774 Signals.connectData( 775 getStruct(), 776 "refresh-window", 777 cast(GCallback)&callBackRefreshWindow, 778 cast(void*)this, 779 null, 780 connectFlags); 781 connectedSignals["refresh-window"] = 1; 782 } 783 onRefreshWindowListeners ~= dlg; 784 } 785 extern(C) static void callBackRefreshWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 786 { 787 foreach ( void delegate(Terminal) dlg ; _terminal.onRefreshWindowListeners ) 788 { 789 dlg(_terminal); 790 } 791 } 792 793 void delegate(guint, guint, Terminal)[] onResizeWindowListeners; 794 /** 795 * Emitted at the child application's request. 796 */ 797 void addOnResizeWindow(void delegate(guint, guint, Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 798 { 799 if ( !("resize-window" in connectedSignals) ) 800 { 801 Signals.connectData( 802 getStruct(), 803 "resize-window", 804 cast(GCallback)&callBackResizeWindow, 805 cast(void*)this, 806 null, 807 connectFlags); 808 connectedSignals["resize-window"] = 1; 809 } 810 onResizeWindowListeners ~= dlg; 811 } 812 extern(C) static void callBackResizeWindow(VteTerminal* vteterminalStruct, guint width, guint height, Terminal _terminal) 813 { 814 foreach ( void delegate(guint, guint, Terminal) dlg ; _terminal.onResizeWindowListeners ) 815 { 816 dlg(width, height, _terminal); 817 } 818 } 819 820 void delegate(Terminal)[] onRestoreWindowListeners; 821 /** 822 * Emitted at the child application's request. 823 */ 824 void addOnRestoreWindow(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 825 { 826 if ( !("restore-window" in connectedSignals) ) 827 { 828 Signals.connectData( 829 getStruct(), 830 "restore-window", 831 cast(GCallback)&callBackRestoreWindow, 832 cast(void*)this, 833 null, 834 connectFlags); 835 connectedSignals["restore-window"] = 1; 836 } 837 onRestoreWindowListeners ~= dlg; 838 } 839 extern(C) static void callBackRestoreWindow(VteTerminal* vteterminalStruct, Terminal _terminal) 840 { 841 foreach ( void delegate(Terminal) dlg ; _terminal.onRestoreWindowListeners ) 842 { 843 dlg(_terminal); 844 } 845 } 846 847 void delegate(Terminal)[] onSelectionChangedListeners; 848 /** 849 * Emitted whenever the contents of terminal's selection changes. 850 */ 851 void addOnSelectionChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 852 { 853 if ( !("selection-changed" in connectedSignals) ) 854 { 855 Signals.connectData( 856 getStruct(), 857 "selection-changed", 858 cast(GCallback)&callBackSelectionChanged, 859 cast(void*)this, 860 null, 861 connectFlags); 862 connectedSignals["selection-changed"] = 1; 863 } 864 onSelectionChangedListeners ~= dlg; 865 } 866 extern(C) static void callBackSelectionChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 867 { 868 foreach ( void delegate(Terminal) dlg ; _terminal.onSelectionChangedListeners ) 869 { 870 dlg(_terminal); 871 } 872 } 873 874 void delegate(Terminal)[] onStatusLineChangedListeners; 875 /** 876 * Emitted whenever the contents of the status line are modified or 877 * cleared. 878 */ 879 void addOnStatusLineChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 880 { 881 if ( !("status-line-changed" in connectedSignals) ) 882 { 883 Signals.connectData( 884 getStruct(), 885 "status-line-changed", 886 cast(GCallback)&callBackStatusLineChanged, 887 cast(void*)this, 888 null, 889 connectFlags); 890 connectedSignals["status-line-changed"] = 1; 891 } 892 onStatusLineChangedListeners ~= dlg; 893 } 894 extern(C) static void callBackStatusLineChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 895 { 896 foreach ( void delegate(Terminal) dlg ; _terminal.onStatusLineChangedListeners ) 897 { 898 dlg(_terminal); 899 } 900 } 901 902 void delegate(Terminal)[] onTextDeletedListeners; 903 /** 904 * An internal signal used for communication between the terminal and 905 * its accessibility peer. May not be emitted under certain 906 * circumstances. 907 */ 908 void addOnTextDeleted(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 909 { 910 if ( !("text-deleted" in connectedSignals) ) 911 { 912 Signals.connectData( 913 getStruct(), 914 "text-deleted", 915 cast(GCallback)&callBackTextDeleted, 916 cast(void*)this, 917 null, 918 connectFlags); 919 connectedSignals["text-deleted"] = 1; 920 } 921 onTextDeletedListeners ~= dlg; 922 } 923 extern(C) static void callBackTextDeleted(VteTerminal* vteterminalStruct, Terminal _terminal) 924 { 925 foreach ( void delegate(Terminal) dlg ; _terminal.onTextDeletedListeners ) 926 { 927 dlg(_terminal); 928 } 929 } 930 931 void delegate(Terminal)[] onTextInsertedListeners; 932 /** 933 * An internal signal used for communication between the terminal and 934 * its accessibility peer. May not be emitted under certain 935 * circumstances. 936 */ 937 void addOnTextInserted(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 938 { 939 if ( !("text-inserted" in connectedSignals) ) 940 { 941 Signals.connectData( 942 getStruct(), 943 "text-inserted", 944 cast(GCallback)&callBackTextInserted, 945 cast(void*)this, 946 null, 947 connectFlags); 948 connectedSignals["text-inserted"] = 1; 949 } 950 onTextInsertedListeners ~= dlg; 951 } 952 extern(C) static void callBackTextInserted(VteTerminal* vteterminalStruct, Terminal _terminal) 953 { 954 foreach ( void delegate(Terminal) dlg ; _terminal.onTextInsertedListeners ) 955 { 956 dlg(_terminal); 957 } 958 } 959 960 void delegate(Terminal)[] onTextModifiedListeners; 961 /** 962 * An internal signal used for communication between the terminal and 963 * its accessibility peer. May not be emitted under certain 964 * circumstances. 965 */ 966 void addOnTextModified(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 967 { 968 if ( !("text-modified" in connectedSignals) ) 969 { 970 Signals.connectData( 971 getStruct(), 972 "text-modified", 973 cast(GCallback)&callBackTextModified, 974 cast(void*)this, 975 null, 976 connectFlags); 977 connectedSignals["text-modified"] = 1; 978 } 979 onTextModifiedListeners ~= dlg; 980 } 981 extern(C) static void callBackTextModified(VteTerminal* vteterminalStruct, Terminal _terminal) 982 { 983 foreach ( void delegate(Terminal) dlg ; _terminal.onTextModifiedListeners ) 984 { 985 dlg(_terminal); 986 } 987 } 988 989 void delegate(gint, Terminal)[] onTextScrolledListeners; 990 /** 991 * An internal signal used for communication between the terminal and 992 * its accessibility peer. May not be emitted under certain 993 * circumstances. 994 */ 995 void addOnTextScrolled(void delegate(gint, Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 996 { 997 if ( !("text-scrolled" in connectedSignals) ) 998 { 999 Signals.connectData( 1000 getStruct(), 1001 "text-scrolled", 1002 cast(GCallback)&callBackTextScrolled, 1003 cast(void*)this, 1004 null, 1005 connectFlags); 1006 connectedSignals["text-scrolled"] = 1; 1007 } 1008 onTextScrolledListeners ~= dlg; 1009 } 1010 extern(C) static void callBackTextScrolled(VteTerminal* vteterminalStruct, gint delta, Terminal _terminal) 1011 { 1012 foreach ( void delegate(gint, Terminal) dlg ; _terminal.onTextScrolledListeners ) 1013 { 1014 dlg(delta, _terminal); 1015 } 1016 } 1017 1018 void delegate(Terminal)[] onWindowTitleChangedListeners; 1019 /** 1020 * Emitted when the terminal's window_title field is modified. 1021 */ 1022 void addOnWindowTitleChanged(void delegate(Terminal) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1023 { 1024 if ( !("window-title-changed" in connectedSignals) ) 1025 { 1026 Signals.connectData( 1027 getStruct(), 1028 "window-title-changed", 1029 cast(GCallback)&callBackWindowTitleChanged, 1030 cast(void*)this, 1031 null, 1032 connectFlags); 1033 connectedSignals["window-title-changed"] = 1; 1034 } 1035 onWindowTitleChangedListeners ~= dlg; 1036 } 1037 extern(C) static void callBackWindowTitleChanged(VteTerminal* vteterminalStruct, Terminal _terminal) 1038 { 1039 foreach ( void delegate(Terminal) dlg ; _terminal.onWindowTitleChangedListeners ) 1040 { 1041 dlg(_terminal); 1042 } 1043 } 1044 1045 1046 /** 1047 * Creates a new terminal widget. 1048 * Throws: ConstructionException GTK+ fails to create the object. 1049 */ 1050 public this () 1051 { 1052 // GtkWidget * vte_terminal_new (void); 1053 auto p = vte_terminal_new(); 1054 if(p is null) 1055 { 1056 throw new ConstructionException("null returned by vte_terminal_new()"); 1057 } 1058 this(cast(VteTerminal*) p); 1059 } 1060 1061 /** 1062 * Warning 1063 * vte_terminal_im_append_menuitems is deprecated and should not be used in newly-written code. 1064 * Appends menu items for various input methods to the given menu. The 1065 * user can select one of these items to modify the input method used by 1066 * the terminal. 1067 * Params: 1068 * menushell = a GtkMenuShell 1069 */ 1070 public void imAppendMenuitems(MenuShell menushell) 1071 { 1072 // void vte_terminal_im_append_menuitems (VteTerminal *terminal, GtkMenuShell *menushell); 1073 vte_terminal_im_append_menuitems(vteTerminal, (menushell is null) ? null : menushell.getMenuShellStruct()); 1074 } 1075 1076 /** 1077 * Interprets data as if it were data received from a child process. This 1078 * can either be used to drive the terminal without a child process, or just 1079 * to mess with your users. 1080 * Params: 1081 * data = a string in the terminal's current encoding. [array length=length][element-type guint8] 1082 */ 1083 public void feed(string data) 1084 { 1085 // void vte_terminal_feed (VteTerminal *terminal, const char *data, glong length); 1086 vte_terminal_feed(vteTerminal, cast(char*)data.ptr, cast(int) data.length); 1087 } 1088 1089 /** 1090 * Sends a block of UTF-8 text to the child as if it were entered by the user 1091 * at the keyboard. 1092 * Params: 1093 * text = data to send to the child 1094 */ 1095 public void feedChild(string text) 1096 { 1097 // void vte_terminal_feed_child (VteTerminal *terminal, const char *text, glong length); 1098 vte_terminal_feed_child(vteTerminal, cast(char*)text.ptr, cast(int) text.length); 1099 } 1100 1101 /** 1102 * Sends a block of binary data to the child. 1103 * Params: 1104 * data = data to send to the child 1105 */ 1106 public void feedChildBinary(string data) 1107 { 1108 // void vte_terminal_feed_child_binary (VteTerminal *terminal, const char *data, glong length); 1109 vte_terminal_feed_child_binary(vteTerminal, cast(char*)data.ptr, cast(int) data.length); 1110 } 1111 1112 /** 1113 * Gets the exit status of the command started by vte_terminal_fork_command(). 1114 * See your C library's documentation for more details on how to interpret the 1115 * exit status. 1116 * Note that this function may only be called from the signal handler of 1117 * the "child-exited" signal. 1118 * Returns: the child's exit status Since 0.20 1119 */ 1120 public int getChildExitStatus() 1121 { 1122 // int vte_terminal_get_child_exit_status (VteTerminal *terminal); 1123 return vte_terminal_get_child_exit_status(vteTerminal); 1124 } 1125 1126 /** 1127 * Selects all text within the terminal (including the scrollback buffer). 1128 */ 1129 public void selectAll() 1130 { 1131 // void vte_terminal_select_all (VteTerminal *terminal); 1132 vte_terminal_select_all(vteTerminal); 1133 } 1134 1135 /** 1136 * Clears the current selection. 1137 */ 1138 public void selectNone() 1139 { 1140 // void vte_terminal_select_none (VteTerminal *terminal); 1141 vte_terminal_select_none(vteTerminal); 1142 } 1143 1144 /** 1145 * Places the selected text in the terminal in the GDK_SELECTION_CLIPBOARD 1146 * selection. 1147 */ 1148 public void copyClipboard() 1149 { 1150 // void vte_terminal_copy_clipboard (VteTerminal *terminal); 1151 vte_terminal_copy_clipboard(vteTerminal); 1152 } 1153 1154 /** 1155 * Sends the contents of the GDK_SELECTION_CLIPBOARD selection to the 1156 * terminal's child. If necessary, the data is converted from UTF-8 to the 1157 * terminal's current encoding. It's called on paste menu item, or when 1158 * user presses Shift+Insert. 1159 */ 1160 public void pasteClipboard() 1161 { 1162 // void vte_terminal_paste_clipboard (VteTerminal *terminal); 1163 vte_terminal_paste_clipboard(vteTerminal); 1164 } 1165 1166 /** 1167 * Places the selected text in the terminal in the GDK_SELECTION_PRIMARY 1168 * selection. 1169 */ 1170 public void copyPrimary() 1171 { 1172 // void vte_terminal_copy_primary (VteTerminal *terminal); 1173 vte_terminal_copy_primary(vteTerminal); 1174 } 1175 1176 /** 1177 * Sends the contents of the GDK_SELECTION_PRIMARY selection to the terminal's 1178 * child. If necessary, the data is converted from UTF-8 to the terminal's 1179 * current encoding. The terminal will call also paste the 1180 * GDK_SELECTION_PRIMARY selection when the user clicks with the the second 1181 * mouse button. 1182 */ 1183 public void pastePrimary() 1184 { 1185 // void vte_terminal_paste_primary (VteTerminal *terminal); 1186 vte_terminal_paste_primary(vteTerminal); 1187 } 1188 1189 /** 1190 * Attempts to change the terminal's size in terms of rows and columns. If 1191 * the attempt succeeds, the widget will resize itself to the proper size. 1192 * Params: 1193 * columns = the desired number of columns 1194 * rows = the desired number of rows 1195 */ 1196 public void setSize(glong columns, glong rows) 1197 { 1198 // void vte_terminal_set_size (VteTerminal *terminal, glong columns, glong rows); 1199 vte_terminal_set_size(vteTerminal, columns, rows); 1200 } 1201 1202 /** 1203 * Controls whether or not the terminal will beep when the child outputs the 1204 * "bl" sequence. 1205 * Params: 1206 * isAudible = TRUE if the terminal should beep 1207 */ 1208 public void setAudibleBell(int isAudible) 1209 { 1210 // void vte_terminal_set_audible_bell (VteTerminal *terminal, gboolean is_audible); 1211 vte_terminal_set_audible_bell(vteTerminal, isAudible); 1212 } 1213 1214 /** 1215 * Checks whether or not the terminal will beep when the child outputs the 1216 * "bl" sequence. 1217 * Returns: TRUE if audible bell is enabled, FALSE if not 1218 */ 1219 public int getAudibleBell() 1220 { 1221 // gboolean vte_terminal_get_audible_bell (VteTerminal *terminal); 1222 return vte_terminal_get_audible_bell(vteTerminal); 1223 } 1224 1225 /** 1226 * Controls whether or not the terminal will present a visible bell to the 1227 * user when the child outputs the "bl" sequence. The terminal 1228 * will clear itself to the default foreground color and then repaint itself. 1229 * Params: 1230 * isVisible = whether the terminal should flash on bell 1231 */ 1232 public void setVisibleBell(int isVisible) 1233 { 1234 // void vte_terminal_set_visible_bell (VteTerminal *terminal, gboolean is_visible); 1235 vte_terminal_set_visible_bell(vteTerminal, isVisible); 1236 } 1237 1238 /** 1239 * Checks whether or not the terminal will present a visible bell to the 1240 * user when the child outputs the "bl" sequence. The terminal 1241 * will clear itself to the default foreground color and then repaint itself. 1242 * Returns: TRUE if visible bell is enabled, FALSE if not 1243 */ 1244 public int getVisibleBell() 1245 { 1246 // gboolean vte_terminal_get_visible_bell (VteTerminal *terminal); 1247 return vte_terminal_get_visible_bell(vteTerminal); 1248 } 1249 1250 /** 1251 * Controls whether or not the terminal will attempt to draw bold text, 1252 * either by using a bold font variant or by repainting text with a different 1253 * offset. 1254 * Params: 1255 * allowBold = TRUE if the terminal should attempt to draw bold text 1256 */ 1257 public void setAllowBold(int allowBold) 1258 { 1259 // void vte_terminal_set_allow_bold (VteTerminal *terminal, gboolean allow_bold); 1260 vte_terminal_set_allow_bold(vteTerminal, allowBold); 1261 } 1262 1263 /** 1264 * Checks whether or not the terminal will attempt to draw bold text by 1265 * repainting text with a one-pixel offset. 1266 * Returns: TRUE if bolding is enabled, FALSE if not 1267 */ 1268 public int getAllowBold() 1269 { 1270 // gboolean vte_terminal_get_allow_bold (VteTerminal *terminal); 1271 return vte_terminal_get_allow_bold(vteTerminal); 1272 } 1273 1274 /** 1275 * Controls whether or not the terminal will forcibly scroll to the bottom of 1276 * the viewable history when the new data is received from the child. 1277 * Params: 1278 * scroll = whether the terminal should scroll on output 1279 */ 1280 public void setScrollOnOutput(int scroll) 1281 { 1282 // void vte_terminal_set_scroll_on_output (VteTerminal *terminal, gboolean scroll); 1283 vte_terminal_set_scroll_on_output(vteTerminal, scroll); 1284 } 1285 1286 /** 1287 * Controls whether or not the terminal will forcibly scroll to the bottom of 1288 * the viewable history when the user presses a key. Modifier keys do not 1289 * trigger this behavior. 1290 * Params: 1291 * scroll = whether the terminal should scroll on keystrokes 1292 */ 1293 public void setScrollOnKeystroke(int scroll) 1294 { 1295 // void vte_terminal_set_scroll_on_keystroke (VteTerminal *terminal, gboolean scroll); 1296 vte_terminal_set_scroll_on_keystroke(vteTerminal, scroll); 1297 } 1298 1299 /** 1300 * Sets the color used to draw bold text in the default foreground color. 1301 * Params: 1302 * bold = the new bold color 1303 */ 1304 public void setColorBold(Color bold) 1305 { 1306 // void vte_terminal_set_color_bold (VteTerminal *terminal, const GdkColor *bold); 1307 vte_terminal_set_color_bold(vteTerminal, (bold is null) ? null : bold.getColorStruct()); 1308 } 1309 1310 /** 1311 * Sets the color used to draw bold text in the default foreground color. 1312 * If bold is NULL then the default color is used. 1313 * Params: 1314 * bold = the new bold color or NULL. [allow-none] 1315 */ 1316 public void setColorBoldRgba(RGBA bold) 1317 { 1318 // void vte_terminal_set_color_bold_rgba (VteTerminal *terminal, const GdkRGBA *bold); 1319 vte_terminal_set_color_bold_rgba(vteTerminal, (bold is null) ? null : bold.getRGBAStruct()); 1320 } 1321 1322 /** 1323 * Sets the foreground color used to draw normal text 1324 * Params: 1325 * foreground = the new foreground color 1326 */ 1327 public void setColorForeground(Color foreground) 1328 { 1329 // void vte_terminal_set_color_foreground (VteTerminal *terminal, const GdkColor *foreground); 1330 vte_terminal_set_color_foreground(vteTerminal, (foreground is null) ? null : foreground.getColorStruct()); 1331 } 1332 1333 /** 1334 * Sets the foreground color used to draw normal text. 1335 * Params: 1336 * foreground = the new foreground color 1337 * Since 0.28 1338 */ 1339 public void setColorForegroundRgba(RGBA foreground) 1340 { 1341 // void vte_terminal_set_color_foreground_rgba (VteTerminal *terminal, const GdkRGBA *foreground); 1342 vte_terminal_set_color_foreground_rgba(vteTerminal, (foreground is null) ? null : foreground.getRGBAStruct()); 1343 } 1344 1345 /** 1346 * Sets the background color for text which does not have a specific background 1347 * color assigned. Only has effect when no background image is set and when 1348 * the terminal is not transparent. 1349 * Params: 1350 * background = the new background color 1351 */ 1352 public void setColorBackground(Color background) 1353 { 1354 // void vte_terminal_set_color_background (VteTerminal *terminal, const GdkColor *background); 1355 vte_terminal_set_color_background(vteTerminal, (background is null) ? null : background.getColorStruct()); 1356 } 1357 1358 /** 1359 * Sets the background color for text which does not have a specific background 1360 * color assigned. Only has effect when no background image is set and when 1361 * the terminal is not transparent. 1362 * Params: 1363 * background = the new background color 1364 * Since 0.28 1365 */ 1366 public void setColorBackgroundRgba(RGBA background) 1367 { 1368 // void vte_terminal_set_color_background_rgba (VteTerminal *terminal, const GdkRGBA *background); 1369 vte_terminal_set_color_background_rgba(vteTerminal, (background is null) ? null : background.getRGBAStruct()); 1370 } 1371 1372 /** 1373 * Sets the color used to draw dim text in the default foreground color. 1374 * Params: 1375 * dim = the new dim color 1376 */ 1377 public void setColorDim(Color dim) 1378 { 1379 // void vte_terminal_set_color_dim (VteTerminal *terminal, const GdkColor *dim); 1380 vte_terminal_set_color_dim(vteTerminal, (dim is null) ? null : dim.getColorStruct()); 1381 } 1382 1383 /** 1384 * Sets the color used to draw dim text in the default foreground color. 1385 * If dim is NULL then the default color is used. 1386 * Params: 1387 * dim = the new dim color or NULL. [allow-none] 1388 * Since 0.28 1389 */ 1390 public void setColorDimRgba(RGBA dim) 1391 { 1392 // void vte_terminal_set_color_dim_rgba (VteTerminal *terminal, const GdkRGBA *dim); 1393 vte_terminal_set_color_dim_rgba(vteTerminal, (dim is null) ? null : dim.getRGBAStruct()); 1394 } 1395 1396 /** 1397 * Sets the background color for text which is under the cursor. If NULL, text 1398 * under the cursor will be drawn with foreground and background colors 1399 * reversed. 1400 * Params: 1401 * cursorBackground = the new color to use for the text cursor, or NULL. [allow-none] 1402 * Since 0.11.11 1403 */ 1404 public void setColorCursor(Color cursorBackground) 1405 { 1406 // void vte_terminal_set_color_cursor (VteTerminal *terminal, const GdkColor *cursor_background); 1407 vte_terminal_set_color_cursor(vteTerminal, (cursorBackground is null) ? null : cursorBackground.getColorStruct()); 1408 } 1409 1410 /** 1411 * Sets the background color for text which is under the cursor. If NULL, text 1412 * under the cursor will be drawn with foreground and background colors 1413 * reversed. 1414 * Params: 1415 * cursorBackground = the new color to use for the text cursor, or NULL. [allow-none] 1416 * Since 0.28 1417 */ 1418 public void setColorCursorRgba(RGBA cursorBackground) 1419 { 1420 // void vte_terminal_set_color_cursor_rgba (VteTerminal *terminal, const GdkRGBA *cursor_background); 1421 vte_terminal_set_color_cursor_rgba(vteTerminal, (cursorBackground is null) ? null : cursorBackground.getRGBAStruct()); 1422 } 1423 1424 /** 1425 * Sets the background color for text which is highlighted. If NULL, 1426 * highlighted text (which is usually highlighted because it is selected) will 1427 * be drawn with foreground and background colors reversed. 1428 * Params: 1429 * highlightBackground = the new color to use for highlighted text, or NULL. [allow-none] 1430 * Since 0.11.11 1431 */ 1432 public void setColorHighlight(Color highlightBackground) 1433 { 1434 // void vte_terminal_set_color_highlight (VteTerminal *terminal, const GdkColor *highlight_background); 1435 vte_terminal_set_color_highlight(vteTerminal, (highlightBackground is null) ? null : highlightBackground.getColorStruct()); 1436 } 1437 1438 /** 1439 * Sets the background color for text which is highlighted. If NULL, 1440 * highlighted text (which is usually highlighted because it is selected) will 1441 * be drawn with foreground and background colors reversed. 1442 * Params: 1443 * highlightBackground = the new color to use for highlighted text, or NULL. [allow-none] 1444 * Since 0.28 1445 */ 1446 public void setColorHighlightRgba(RGBA highlightBackground) 1447 { 1448 // void vte_terminal_set_color_highlight_rgba (VteTerminal *terminal, const GdkRGBA *highlight_background); 1449 vte_terminal_set_color_highlight_rgba(vteTerminal, (highlightBackground is null) ? null : highlightBackground.getRGBAStruct()); 1450 } 1451 1452 /** 1453 * The terminal widget uses a 28-color model comprised of the default foreground 1454 * and background colors, the bold foreground color, the dim foreground 1455 * color, an eight color palette, bold versions of the eight color palette, 1456 * and a dim version of the the eight color palette. 1457 * palette_size must be either 0, 8, 16, or 24, or between 25 and 255 inclusive. 1458 * If foreground is NULL and 1459 * palette_size is greater than 0, the new foreground color is taken from 1460 * palette[7]. If background is NULL and palette_size is greater than 0, 1461 * the new background color is taken from palette[0]. If 1462 * palette_size is 8 or 16, the third (dim) and possibly the second (bold) 1463 * 8-color palettes are extrapolated from the new background color and the items 1464 * in palette. 1465 * Params: 1466 * foreground = the new foreground color, or NULL. [allow-none] 1467 * background = the new background color, or NULL. [allow-none] 1468 * palette = the color palette. [array length=palette_size zero-terminated=0][element-type Gdk.Color] 1469 * paletteSize = the number of entries in palette 1470 */ 1471 public void setColors(Color foreground, Color background, Color palette, glong paletteSize) 1472 { 1473 // void vte_terminal_set_colors (VteTerminal *terminal, const GdkColor *foreground, const GdkColor *background, const GdkColor *palette, glong palette_size); 1474 vte_terminal_set_colors(vteTerminal, (foreground is null) ? null : foreground.getColorStruct(), (background is null) ? null : background.getColorStruct(), (palette is null) ? null : palette.getColorStruct(), paletteSize); 1475 } 1476 1477 /** 1478 * The terminal widget uses a 28-color model comprised of the default foreground 1479 * and background colors, the bold foreground color, the dim foreground 1480 * color, an eight color palette, bold versions of the eight color palette, 1481 * and a dim version of the the eight color palette. 1482 * palette_size must be either 0, 8, 16, or 24, or between 25 and 255 inclusive. 1483 * If foreground is NULL and 1484 * palette_size is greater than 0, the new foreground color is taken from 1485 * palette[7]. If background is NULL and palette_size is greater than 0, 1486 * the new background color is taken from palette[0]. If 1487 * palette_size is 8 or 16, the third (dim) and possibly the second (bold) 1488 * 8-color palettes are extrapolated from the new background color and the items 1489 * in palette. 1490 * Params: 1491 * foreground = the new foreground color, or NULL. [allow-none] 1492 * background = the new background color, or NULL. [allow-none] 1493 * palette = the color palette. [array length=palette_size zero-terminated=0][element-type Gdk.RGBA] 1494 * paletteSize = the number of entries in palette 1495 * Since 0.28 1496 */ 1497 public void setColorsRgba(RGBA foreground, RGBA background, RGBA palette, gsize paletteSize) 1498 { 1499 // void vte_terminal_set_colors_rgba (VteTerminal *terminal, const GdkRGBA *foreground, const GdkRGBA *background, const GdkRGBA *palette, gsize palette_size); 1500 vte_terminal_set_colors_rgba(vteTerminal, (foreground is null) ? null : foreground.getRGBAStruct(), (background is null) ? null : background.getRGBAStruct(), (palette is null) ? null : palette.getRGBAStruct(), paletteSize); 1501 } 1502 1503 /** 1504 * Reset the terminal palette to reasonable compiled-in default color. 1505 */ 1506 public void setDefaultColors() 1507 { 1508 // void vte_terminal_set_default_colors (VteTerminal *terminal); 1509 vte_terminal_set_default_colors(vteTerminal); 1510 } 1511 1512 /** 1513 * Sets the opacity of the terminal background, were 0 means completely 1514 * transparent and 65535 means completely opaque. 1515 * Params: 1516 * opacity = the new opacity 1517 */ 1518 public void setOpacity(ushort opacity) 1519 { 1520 // void vte_terminal_set_opacity (VteTerminal *terminal, guint16 opacity); 1521 vte_terminal_set_opacity(vteTerminal, opacity); 1522 } 1523 1524 /** 1525 * Sets a background image for the widget. Text which would otherwise be 1526 * drawn using the default background color will instead be drawn over the 1527 * specified image. If necessary, the image will be tiled to cover the 1528 * widget's entire visible area. If specified by 1529 * vte_terminal_set_background_saturation(), the terminal will tint its 1530 * in-memory copy of the image before applying it to the terminal. 1531 * Params: 1532 * image = a GdkPixbuf to use, or NULL to unset the background. [allow-none] 1533 */ 1534 public void setBackgroundImage(GdkPixbuf* image) 1535 { 1536 // void vte_terminal_set_background_image (VteTerminal *terminal, GdkPixbuf *image); 1537 vte_terminal_set_background_image(vteTerminal, image); 1538 } 1539 1540 /** 1541 * Sets a background image for the widget. If specified by 1542 * vte_terminal_set_background_saturation(), the terminal will tint its 1543 * in-memory copy of the image before applying it to the terminal. 1544 * Params: 1545 * path = path to an image file. [type filename] 1546 */ 1547 public void setBackgroundImageFile(string path) 1548 { 1549 // void vte_terminal_set_background_image_file (VteTerminal *terminal, const char *path); 1550 vte_terminal_set_background_image_file(vteTerminal, Str.toStringz(path)); 1551 } 1552 1553 /** 1554 * If a background image has been set using 1555 * vte_terminal_set_background_image(), 1556 * vte_terminal_set_background_image_file(), or 1557 * vte_terminal_set_background_transparent(), and the saturation value is less 1558 * than 1.0, the terminal will adjust the colors of the image before drawing 1559 * the image. To do so, the terminal will create a copy of the background 1560 * image (or snapshot of the root window) and modify its pixel values. 1561 * Params: 1562 * saturation = a floating point value between 0.0 and 1.0. 1563 */ 1564 public void setBackgroundSaturation(double saturation) 1565 { 1566 // void vte_terminal_set_background_saturation (VteTerminal *terminal, double saturation); 1567 vte_terminal_set_background_saturation(vteTerminal, saturation); 1568 } 1569 1570 /** 1571 * Sets the terminal's background image to the pixmap stored in the root 1572 * window, adjusted so that if there are no windows below your application, 1573 * the widget will appear to be transparent. 1574 * Params: 1575 * transparent = whether the terminal should fake transparency 1576 */ 1577 public void setBackgroundTransparent(int transparent) 1578 { 1579 // void vte_terminal_set_background_transparent (VteTerminal *terminal, gboolean transparent); 1580 vte_terminal_set_background_transparent(vteTerminal, transparent); 1581 } 1582 1583 /** 1584 * If a background image has been set using 1585 * vte_terminal_set_background_image(), 1586 * vte_terminal_set_background_image_file(), or 1587 * vte_terminal_set_background_transparent(), and the value set by 1588 * vte_terminal_set_background_saturation() is less than one, the terminal 1589 * will adjust the color of the image before drawing the image. To do so, 1590 * the terminal will create a copy of the background image (or snapshot of 1591 * the root window) and modify its pixel values. The initial tint color 1592 * is black. 1593 * Params: 1594 * color = a color which the terminal background should be tinted to if its 1595 * saturation is not 1.0. 1596 * Since 0.11 1597 */ 1598 public void setBackgroundTintColor(Color color) 1599 { 1600 // void vte_terminal_set_background_tint_color (VteTerminal *terminal, const GdkColor *color); 1601 vte_terminal_set_background_tint_color(vteTerminal, (color is null) ? null : color.getColorStruct()); 1602 } 1603 1604 /** 1605 * Controls whether or not the terminal will scroll the background image (if 1606 * one is set) when the text in the window must be scrolled. 1607 * Params: 1608 * scroll = whether the terminal should scroll the background image along with 1609 * the text 1610 * Since 0.11 1611 */ 1612 public void setScrollBackground(int scroll) 1613 { 1614 // void vte_terminal_set_scroll_background (VteTerminal *terminal, gboolean scroll); 1615 vte_terminal_set_scroll_background(vteTerminal, scroll); 1616 } 1617 1618 /** 1619 * Sets the shape of the cursor drawn. 1620 * Params: 1621 * shape = the VteTerminalCursorShape to use 1622 * Since 0.20 1623 */ 1624 public void setCursorShape(VteTerminalCursorShape shape) 1625 { 1626 // void vte_terminal_set_cursor_shape (VteTerminal *terminal, VteTerminalCursorShape shape); 1627 vte_terminal_set_cursor_shape(vteTerminal, shape); 1628 } 1629 1630 /** 1631 * Returns the currently set cursor shape. 1632 * Returns: cursor shape. Since 0.17.6 1633 */ 1634 public VteTerminalCursorShape getCursorShape() 1635 { 1636 // VteTerminalCursorShape vte_terminal_get_cursor_shape (VteTerminal *terminal); 1637 return vte_terminal_get_cursor_shape(vteTerminal); 1638 } 1639 1640 /** 1641 * Warning 1642 * vte_terminal_set_cursor_blinks is deprecated and should not be used in newly-written code. 0.17.1 Use vte_terminal_set_cursor_blink_mode() instead. 1643 * Sets whether or not the cursor will blink. 1644 * Params: 1645 * blink = whether the cursor should blink 1646 */ 1647 public void setCursorBlinks(int blink) 1648 { 1649 // void vte_terminal_set_cursor_blinks (VteTerminal *terminal, gboolean blink); 1650 vte_terminal_set_cursor_blinks(vteTerminal, blink); 1651 } 1652 1653 /** 1654 * Returns the currently set cursor blink mode. 1655 * Returns: cursor blink mode. Since 0.17.1 1656 */ 1657 public VteTerminalCursorBlinkMode getCursorBlinkMode() 1658 { 1659 // VteTerminalCursorBlinkMode vte_terminal_get_cursor_blink_mode (VteTerminal *terminal); 1660 return vte_terminal_get_cursor_blink_mode(vteTerminal); 1661 } 1662 1663 /** 1664 * Sets whether or not the cursor will blink. Using VTE_CURSOR_BLINK_SYSTEM 1665 * will use the "gtk-cursor-blink" setting. 1666 * Params: 1667 * mode = the VteTerminalCursorBlinkMode to use 1668 * Since 0.17.1 1669 */ 1670 public void setCursorBlinkMode(VteTerminalCursorBlinkMode mode) 1671 { 1672 // void vte_terminal_set_cursor_blink_mode (VteTerminal *terminal, VteTerminalCursorBlinkMode mode); 1673 vte_terminal_set_cursor_blink_mode(vteTerminal, mode); 1674 } 1675 1676 /** 1677 * Sets the length of the scrollback buffer used by the terminal. The size of 1678 * the scrollback buffer will be set to the larger of this value and the number 1679 * of visible rows the widget can display, so 0 can safely be used to disable 1680 * scrollback. 1681 * A negative value means "infinite scrollback". 1682 * Note that this setting only affects the normal screen buffer. 1683 * For terminal types which have an alternate screen buffer, no scrollback is 1684 * allowed on the alternate screen buffer. 1685 * Params: 1686 * lines = the length of the history buffer 1687 */ 1688 public void setScrollbackLines(glong lines) 1689 { 1690 // void vte_terminal_set_scrollback_lines (VteTerminal *terminal, glong lines); 1691 vte_terminal_set_scrollback_lines(vteTerminal, lines); 1692 } 1693 1694 /** 1695 * Sets the font used for rendering all text displayed by the terminal, 1696 * overriding any fonts set using gtk_widget_modify_font(). The terminal 1697 * will immediately attempt to load the desired font, retrieve its 1698 * metrics, and attempt to resize itself to keep the same number of rows 1699 * and columns. 1700 * Params: 1701 * fontDesc = a PangoFontDescription for the desired font, or NULL. [allow-none] 1702 */ 1703 public void setFont(PgFontDescription fontDesc) 1704 { 1705 // void vte_terminal_set_font (VteTerminal *terminal, const PangoFontDescription *font_desc); 1706 vte_terminal_set_font(vteTerminal, (fontDesc is null) ? null : fontDesc.getPgFontDescriptionStruct()); 1707 } 1708 1709 /** 1710 * A convenience function which converts name into a PangoFontDescription and 1711 * passes it to vte_terminal_set_font(). 1712 * Params: 1713 * name = a pango font description in string form. [type utf8] 1714 */ 1715 public void setFontFromString(string name) 1716 { 1717 // void vte_terminal_set_font_from_string (VteTerminal *terminal, const char *name); 1718 vte_terminal_set_font_from_string(vteTerminal, Str.toStringz(name)); 1719 } 1720 1721 /** 1722 * Warning 1723 * vte_terminal_set_font_from_string_full has been deprecated since version 0.20 and should not be used in newly-written code. Use vte_terminal_set_font() 1724 * A convenience function which converts name into a PangoFontDescription and 1725 * passes it to vte_terminal_set_font_full(). 1726 * Params: 1727 * name = A string describing the font. 1728 * antialias = Whether or not to antialias the font (if possible). 1729 * Since 0.11.11 1730 */ 1731 public void setFontFromStringFull(string name, VteTerminalAntiAlias antialias) 1732 { 1733 // void vte_terminal_set_font_from_string_full (VteTerminal *terminal, const char *name, VteTerminalAntiAlias antialias); 1734 vte_terminal_set_font_from_string_full(vteTerminal, Str.toStringz(name), antialias); 1735 } 1736 1737 /** 1738 * Warning 1739 * vte_terminal_set_font_full has been deprecated since version 0.20 and should not be used in newly-written code. Use vte_terminal_set_font() 1740 * Sets the font used for rendering all text displayed by the terminal, 1741 * overriding any fonts set using gtk_widget_modify_font(). The terminal 1742 * will immediately attempt to load the desired font, retrieve its 1743 * metrics, and attempt to resize itself to keep the same number of rows 1744 * and columns. 1745 * Params: 1746 * fontDesc = The PangoFontDescription of the desired font, or NULL 1747 * antialias = Specify if anti aliasing of the fonts is to be used or not. 1748 * Since 0.11.11 1749 */ 1750 public void setFontFull(PgFontDescription fontDesc, VteTerminalAntiAlias antialias) 1751 { 1752 // void vte_terminal_set_font_full (VteTerminal *terminal, const PangoFontDescription *font_desc, VteTerminalAntiAlias antialias); 1753 vte_terminal_set_font_full(vteTerminal, (fontDesc is null) ? null : fontDesc.getPgFontDescriptionStruct(), antialias); 1754 } 1755 1756 /** 1757 * Queries the terminal for information about the fonts which will be 1758 * used to draw text in the terminal. 1759 * Returns: a PangoFontDescription describing the font the terminal is currently using to render text. [transfer none] 1760 */ 1761 public PgFontDescription getFont() 1762 { 1763 // const PangoFontDescription * vte_terminal_get_font (VteTerminal *terminal); 1764 auto p = vte_terminal_get_font(vteTerminal); 1765 1766 if(p is null) 1767 { 1768 return null; 1769 } 1770 1771 return ObjectG.getDObject!(PgFontDescription)(cast(PangoFontDescription*) p); 1772 } 1773 1774 /** 1775 * Warning 1776 * vte_terminal_get_using_xft is deprecated and should not be used in newly-written code. 0.20 1777 * A VteTerminal can use multiple methods to draw text. This function 1778 * allows an application to determine whether or not the current method uses 1779 * fontconfig to find fonts. This setting cannot be changed by the caller, 1780 * but in practice usually matches the behavior of GTK+ itself. 1781 * Returns: TRUE 1782 */ 1783 public int getUsingXft() 1784 { 1785 // gboolean vte_terminal_get_using_xft (VteTerminal *terminal); 1786 return vte_terminal_get_using_xft(vteTerminal); 1787 } 1788 1789 /** 1790 * Checks if the terminal currently contains selected text. Note that this 1791 * is different from determining if the terminal is the owner of any 1792 * GtkClipboard items. 1793 * Returns: TRUE if part of the text in the terminal is selected. 1794 */ 1795 public int getHasSelection() 1796 { 1797 // gboolean vte_terminal_get_has_selection (VteTerminal *terminal); 1798 return vte_terminal_get_has_selection(vteTerminal); 1799 } 1800 1801 /** 1802 * When the user double-clicks to start selection, the terminal will extend 1803 * the selection on word boundaries. It will treat characters included in spec 1804 * as parts of words, and all other characters as word separators. Ranges of 1805 * characters can be specified by separating them with a hyphen. 1806 * As a special case, if spec is NULL or the empty string, the terminal will 1807 * treat all graphic non-punctuation non-space characters as word characters. 1808 * Params: 1809 * spec = a specification 1810 */ 1811 public void setWordChars(string spec) 1812 { 1813 // void vte_terminal_set_word_chars (VteTerminal *terminal, const char *spec); 1814 vte_terminal_set_word_chars(vteTerminal, Str.toStringz(spec)); 1815 } 1816 1817 /** 1818 * Checks if a particular character is considered to be part of a word or not, 1819 * based on the values last passed to vte_terminal_set_word_chars(). 1820 * Params: 1821 * c = a candidate Unicode code point 1822 * Returns: TRUE if the character is considered to be part of a word 1823 */ 1824 public int isWordChar(gunichar c) 1825 { 1826 // gboolean vte_terminal_is_word_char (VteTerminal *terminal, gunichar c); 1827 return vte_terminal_is_word_char(vteTerminal, c); 1828 } 1829 1830 /** 1831 * Modifies the terminal's backspace key binding, which controls what 1832 * string or control sequence the terminal sends to its child when the user 1833 * presses the backspace key. 1834 * Params: 1835 * binding = a VteTerminalEraseBinding for the backspace key 1836 */ 1837 public void setBackspaceBinding(VteTerminalEraseBinding binding) 1838 { 1839 // void vte_terminal_set_backspace_binding (VteTerminal *terminal, VteTerminalEraseBinding binding); 1840 vte_terminal_set_backspace_binding(vteTerminal, binding); 1841 } 1842 1843 /** 1844 * Modifies the terminal's delete key binding, which controls what 1845 * string or control sequence the terminal sends to its child when the user 1846 * presses the delete key. 1847 * Params: 1848 * binding = a VteTerminalEraseBinding for the delete key 1849 */ 1850 public void setDeleteBinding(VteTerminalEraseBinding binding) 1851 { 1852 // void vte_terminal_set_delete_binding (VteTerminal *terminal, VteTerminalEraseBinding binding); 1853 vte_terminal_set_delete_binding(vteTerminal, binding); 1854 } 1855 1856 /** 1857 * Changes the value of the terminal's mouse autohide setting. When autohiding 1858 * is enabled, the mouse cursor will be hidden when the user presses a key and 1859 * shown when the user moves the mouse. This setting can be read using 1860 * vte_terminal_get_mouse_autohide(). 1861 * Params: 1862 * setting = whether the mouse pointer should autohide 1863 */ 1864 public void setMouseAutohide(int setting) 1865 { 1866 // void vte_terminal_set_mouse_autohide (VteTerminal *terminal, gboolean setting); 1867 vte_terminal_set_mouse_autohide(vteTerminal, setting); 1868 } 1869 1870 /** 1871 * Determines the value of the terminal's mouse autohide setting. When 1872 * autohiding is enabled, the mouse cursor will be hidden when the user presses 1873 * a key and shown when the user moves the mouse. This setting can be changed 1874 * using vte_terminal_set_mouse_autohide(). 1875 * Returns: TRUE if autohiding is enabled, FALSE if not 1876 */ 1877 public int getMouseAutohide() 1878 { 1879 // gboolean vte_terminal_get_mouse_autohide (VteTerminal *terminal); 1880 return vte_terminal_get_mouse_autohide(vteTerminal); 1881 } 1882 1883 /** 1884 * Resets as much of the terminal's internal state as possible, discarding any 1885 * unprocessed input data, resetting character attributes, cursor state, 1886 * national character set state, status line, terminal modes (insert/delete), 1887 * selection state, and encoding. 1888 * Params: 1889 * clearTabstops = whether to reset tabstops 1890 * clearHistory = whether to empty the terminal's scrollback buffer 1891 */ 1892 public void reset(int clearTabstops, int clearHistory) 1893 { 1894 // void vte_terminal_reset (VteTerminal *terminal, gboolean clear_tabstops, gboolean clear_history); 1895 vte_terminal_reset(vteTerminal, clearTabstops, clearHistory); 1896 } 1897 1898 /** 1899 * Extracts a view of the visible part of the terminal. If is_selected is not 1900 * NULL, characters will only be read if is_selected returns TRUE after being 1901 * passed the column and row, respectively. A VteCharAttributes structure 1902 * is added to attributes for each byte added to the returned string detailing 1903 * the character's position, colors, and other characteristics. 1904 * Params: 1905 * isSelected = a VteSelectionFunc callback. [scope call][allow-none] 1906 * userData = user data to be passed to the callback. [closure] 1907 * attributes = location for storing text attributes. [out caller-allocates][transfer full][array][element-type Vte.CharAttributes] 1908 * Returns: a newly allocated text string, or NULL. [transfer full] 1909 */ 1910 public string getText(VteSelectionFunc isSelected, void* userData, ArrayG attributes) 1911 { 1912 // char * vte_terminal_get_text (VteTerminal *terminal, VteSelectionFunc is_selected, gpointer user_data, GArray *attributes); 1913 return Str.toString(vte_terminal_get_text(vteTerminal, isSelected, userData, (attributes is null) ? null : attributes.getArrayGStruct())); 1914 } 1915 1916 /** 1917 * Extracts a view of the visible part of the terminal. If is_selected is not 1918 * NULL, characters will only be read if is_selected returns TRUE after being 1919 * passed the column and row, respectively. A VteCharAttributes structure 1920 * is added to attributes for each byte added to the returned string detailing 1921 * the character's position, colors, and other characteristics. This function 1922 * differs from vte_terminal_get_text() in that trailing spaces at the end of 1923 * lines are included. 1924 * Params: 1925 * isSelected = a VteSelectionFunc callback. [scope call][allow-none] 1926 * userData = user data to be passed to the callback. [closure] 1927 * attributes = location for storing text attributes. [out caller-allocates][transfer full][array][element-type Vte.CharAttributes] 1928 * Returns: a newly allocated text string, or NULL. [transfer full] Since 0.11.11 1929 */ 1930 public string getTextIncludeTrailingSpaces(VteSelectionFunc isSelected, void* userData, ArrayG attributes) 1931 { 1932 // char * vte_terminal_get_text_include_trailing_spaces (VteTerminal *terminal, VteSelectionFunc is_selected, gpointer user_data, GArray *attributes); 1933 return Str.toString(vte_terminal_get_text_include_trailing_spaces(vteTerminal, isSelected, userData, (attributes is null) ? null : attributes.getArrayGStruct())); 1934 } 1935 1936 /** 1937 * Extracts a view of the visible part of the terminal. If is_selected is not 1938 * NULL, characters will only be read if is_selected returns TRUE after being 1939 * passed the column and row, respectively. A VteCharAttributes structure 1940 * is added to attributes for each byte added to the returned string detailing 1941 * the character's position, colors, and other characteristics. The 1942 * entire scrollback buffer is scanned, so it is possible to read the entire 1943 * contents of the buffer using this function. 1944 * Params: 1945 * startRow = first row to search for data 1946 * startCol = first column to search for data 1947 * endRow = last row to search for data 1948 * endCol = last column to search for data 1949 * isSelected = a VteSelectionFunc callback. [scope call][allow-none] 1950 * userData = user data to be passed to the callback. [closure] 1951 * attributes = location for storing text attributes. [out caller-allocates][transfer full][array][element-type Vte.CharAttributes] 1952 * Returns: a newly allocated text string, or NULL. [transfer full] 1953 */ 1954 public string getTextRange(glong startRow, glong startCol, glong endRow, glong endCol, VteSelectionFunc isSelected, void* userData, ArrayG attributes) 1955 { 1956 // char * vte_terminal_get_text_range (VteTerminal *terminal, glong start_row, glong start_col, glong end_row, glong end_col, VteSelectionFunc is_selected, gpointer user_data, GArray *attributes); 1957 return Str.toString(vte_terminal_get_text_range(vteTerminal, startRow, startCol, endRow, endCol, isSelected, userData, (attributes is null) ? null : attributes.getArrayGStruct())); 1958 } 1959 1960 /** 1961 * Reads the location of the insertion cursor and returns it. The row 1962 * coordinate is absolute. 1963 * Params: 1964 * column = a location to store the column, or NULL. [out][allow-none] 1965 * row = a location to store the row, or NULL. [out][allow-none] 1966 */ 1967 public void getCursorPosition(out glong column, out glong row) 1968 { 1969 // void vte_terminal_get_cursor_position (VteTerminal *terminal, glong *column, glong *row); 1970 vte_terminal_get_cursor_position(vteTerminal, &column, &row); 1971 } 1972 1973 /** 1974 * Clears the list of regular expressions the terminal uses to highlight text 1975 * when the user moves the mouse cursor. 1976 */ 1977 public void matchClearAll() 1978 { 1979 // void vte_terminal_match_clear_all (VteTerminal *terminal); 1980 vte_terminal_match_clear_all(vteTerminal); 1981 } 1982 1983 /** 1984 * Warning 1985 * vte_terminal_match_add has been deprecated since version 0.17.1 and should not be used in newly-written code. Use vte_terminal_match_add_gregex() instead 1986 * Adds a regular expression to the list of matching expressions. When the 1987 * user moves the mouse cursor over a section of displayed text which matches 1988 * this expression, the text will be highlighted. 1989 * Params: 1990 * match = a regular expression 1991 * Returns: an integer associated with this expression 1992 */ 1993 public int matchAdd(string match) 1994 { 1995 // int vte_terminal_match_add (VteTerminal *terminal, const char *match); 1996 return vte_terminal_match_add(vteTerminal, Str.toStringz(match)); 1997 } 1998 1999 /** 2000 * Adds the regular expression regex to the list of matching expressions. When the 2001 * user moves the mouse cursor over a section of displayed text which matches 2002 * this expression, the text will be highlighted. 2003 * Params: 2004 * regex = a GRegex 2005 * flags = the GRegexMatchFlags to use when matching the regex 2006 * Returns: an integer associated with this expression Since 0.17.1 2007 */ 2008 public int matchAddGregex(Regex regex, GRegexMatchFlags flags) 2009 { 2010 // int vte_terminal_match_add_gregex (VteTerminal *terminal, GRegex *regex, GRegexMatchFlags flags); 2011 return vte_terminal_match_add_gregex(vteTerminal, (regex is null) ? null : regex.getRegexStruct(), flags); 2012 } 2013 2014 /** 2015 * Removes the regular expression which is associated with the given tag from 2016 * the list of expressions which the terminal will highlight when the user 2017 * moves the mouse cursor over matching text. 2018 * Params: 2019 * tag = the tag of the regex to remove 2020 */ 2021 public void matchRemove(int tag) 2022 { 2023 // void vte_terminal_match_remove (VteTerminal *terminal, int tag); 2024 vte_terminal_match_remove(vteTerminal, tag); 2025 } 2026 2027 /** 2028 * Checks if the text in and around the specified position matches any of the 2029 * regular expressions previously set using vte_terminal_match_add(). If a 2030 * match exists, the text string is returned and if tag is not NULL, the number 2031 * associated with the matched regular expression will be stored in tag. 2032 * If more than one regular expression has been set with 2033 * vte_terminal_match_add(), then expressions are checked in the order in 2034 * which they were added. 2035 * Params: 2036 * column = the text column 2037 * row = the text row 2038 * tag = a location to store the tag, or NULL. [out][allow-none] 2039 * Returns: a newly allocated string which matches one of the previously set regular expressions. [transfer full] 2040 */ 2041 public string matchCheck(glong column, glong row, out int tag) 2042 { 2043 // char * vte_terminal_match_check (VteTerminal *terminal, glong column, glong row, int *tag); 2044 return Str.toString(vte_terminal_match_check(vteTerminal, column, row, &tag)); 2045 } 2046 2047 /** 2048 * Sets which cursor the terminal will use if the pointer is over the pattern 2049 * specified by tag. The terminal keeps a reference to cursor. 2050 * Params: 2051 * tag = the tag of the regex which should use the specified cursor 2052 * cursor = the GdkCursor which the terminal should use when the pattern is 2053 * highlighted, or NULL to use the standard cursor. [allow-none] 2054 * Since 0.11 2055 */ 2056 public void matchSetCursor(int tag, Cursor cursor) 2057 { 2058 // void vte_terminal_match_set_cursor (VteTerminal *terminal, int tag, GdkCursor *cursor); 2059 vte_terminal_match_set_cursor(vteTerminal, tag, (cursor is null) ? null : cursor.getCursorStruct()); 2060 } 2061 2062 /** 2063 * Sets which cursor the terminal will use if the pointer is over the pattern 2064 * specified by tag. 2065 * Params: 2066 * tag = the tag of the regex which should use the specified cursor 2067 * cursorType = a GdkCursorType 2068 * Since 0.11.9 2069 */ 2070 public void matchSetCursorType(int tag, GdkCursorType cursorType) 2071 { 2072 // void vte_terminal_match_set_cursor_type (VteTerminal *terminal, int tag, GdkCursorType cursor_type); 2073 vte_terminal_match_set_cursor_type(vteTerminal, tag, cursorType); 2074 } 2075 2076 /** 2077 * Sets which cursor the terminal will use if the pointer is over the pattern 2078 * specified by tag. 2079 * Params: 2080 * tag = the tag of the regex which should use the specified cursor 2081 * cursorName = the name of the cursor 2082 * Since 0.17.1 2083 */ 2084 public void matchSetCursorName(int tag, string cursorName) 2085 { 2086 // void vte_terminal_match_set_cursor_name (VteTerminal *terminal, int tag, const char *cursor_name); 2087 vte_terminal_match_set_cursor_name(vteTerminal, tag, Str.toStringz(cursorName)); 2088 } 2089 2090 /** 2091 * Sets what type of terminal the widget attempts to emulate by scanning for 2092 * control sequences defined in the system's termcap file. Unless you 2093 * are interested in this feature, always use "xterm". 2094 * Params: 2095 * emulation = the name of a terminal description, or NULL to use the default. [allow-none] 2096 */ 2097 public void setEmulation(string emulation) 2098 { 2099 // void vte_terminal_set_emulation (VteTerminal *terminal, const char *emulation); 2100 vte_terminal_set_emulation(vteTerminal, Str.toStringz(emulation)); 2101 } 2102 2103 /** 2104 * Queries the terminal for its current emulation, as last set by a call to 2105 * vte_terminal_set_emulation(). 2106 * Returns: an interned string containing the name of the terminal type the widget is attempting to emulate 2107 */ 2108 public string getEmulation() 2109 { 2110 // const char * vte_terminal_get_emulation (VteTerminal *terminal); 2111 return Str.toString(vte_terminal_get_emulation(vteTerminal)); 2112 } 2113 2114 /** 2115 * Queries the terminal for its default emulation, which is attempted if the 2116 * terminal type passed to vte_terminal_set_emulation() is NULL. 2117 * Returns: an interned string containing the name of the default terminal type the widget attempts to emulate. [transfer none][type utf8] Since 0.11.11 2118 */ 2119 public string getDefaultEmulation() 2120 { 2121 // const char * vte_terminal_get_default_emulation (VteTerminal *terminal); 2122 return Str.toString(vte_terminal_get_default_emulation(vteTerminal)); 2123 } 2124 2125 /** 2126 * Changes the encoding the terminal will expect data from the child to 2127 * be encoded with. For certain terminal types, applications executing in the 2128 * terminal can change the encoding. The default encoding is defined by the 2129 * application's locale settings. 2130 * Params: 2131 * codeset = a valid GIConv target, or NULL to use the default encoding. [allow-none] 2132 */ 2133 public void setEncoding(string codeset) 2134 { 2135 // void vte_terminal_set_encoding (VteTerminal *terminal, const char *codeset); 2136 vte_terminal_set_encoding(vteTerminal, Str.toStringz(codeset)); 2137 } 2138 2139 /** 2140 * Determines the name of the encoding in which the terminal expects data to be 2141 * encoded. 2142 * Returns: the current encoding for the terminal. [transfer none] 2143 */ 2144 public string getEncoding() 2145 { 2146 // const char * vte_terminal_get_encoding (VteTerminal *terminal); 2147 return Str.toString(vte_terminal_get_encoding(vteTerminal)); 2148 } 2149 2150 /** 2151 * Some terminal emulations specify a status line which is separate from the 2152 * main display area, and define a means for applications to move the cursor 2153 * to the status line and back. 2154 * Returns: the current contents of the terminal's status line. For terminals like "xterm", this will usually be the empty string. The string must not be modified or freed by the caller. [transfer none] 2155 */ 2156 public string getStatusLine() 2157 { 2158 // const char * vte_terminal_get_status_line (VteTerminal *terminal); 2159 return Str.toString(vte_terminal_get_status_line(vteTerminal)); 2160 } 2161 2162 /** 2163 * Warning 2164 * vte_terminal_get_padding has been deprecated since version 0.26 and should not be used in newly-written code. Get the "inner-border" style property instead 2165 * Determines the amount of additional space the widget is using to pad the 2166 * edges of its visible area. This is necessary for cases where characters in 2167 * the selected font don't themselves include a padding area and the text 2168 * itself would otherwise be contiguous with the window border. Applications 2169 * which use the widget's row_count, column_count, char_height, and 2170 * char_width fields to set geometry hints using 2171 * gtk_window_set_geometry_hints() will need to add this value to the base 2172 * size. The values returned in xpad and ypad are the total padding used in 2173 * each direction, and do not need to be doubled. 2174 * Params: 2175 * xpad = address in which to store left/right-edge padding 2176 * ypad = address in which to store top/bottom-edge ypadding 2177 */ 2178 public void getPadding(out int xpad, out int ypad) 2179 { 2180 // void vte_terminal_get_padding (VteTerminal *terminal, int *xpad, int *ypad); 2181 vte_terminal_get_padding(vteTerminal, &xpad, &ypad); 2182 } 2183 2184 /** 2185 * Write contents of the current contents of terminal (including any 2186 * scrollback history) to stream according to flags. 2187 * If cancellable is not NULL, then the operation can be cancelled by triggering 2188 * the cancellable object from another thread. If the operation was cancelled, 2189 * the error G_IO_ERROR_CANCELLED will be returned in error. 2190 * This is a synchronous operation and will make the widget (and input 2191 * processing) during the write operation, which may take a long time 2192 * depending on scrollback history and stream availability for writing. 2193 * Params: 2194 * stream = a GOutputStream to write to 2195 * flags = a set of VteTerminalWriteFlags 2196 * cancellable = a GCancellable object, or NULL. [allow-none] 2197 * Returns: TRUE on success, FALSE if there was an error Since 0.24 2198 * Throws: GException on failure. 2199 */ 2200 public int writeContents(OutputStream stream, VteTerminalWriteFlags flags, Cancellable cancellable) 2201 { 2202 // gboolean vte_terminal_write_contents (VteTerminal *terminal, GOutputStream *stream, VteTerminalWriteFlags flags, GCancellable *cancellable, GError **error); 2203 GError* err = null; 2204 2205 auto p = vte_terminal_write_contents(vteTerminal, (stream is null) ? null : stream.getOutputStreamStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err); 2206 2207 if (err !is null) 2208 { 2209 throw new GException( new ErrorG(err) ); 2210 } 2211 2212 return p; 2213 } 2214 2215 /** 2216 * Searches the next string matching the search regex set with 2217 * vte_terminal_search_set_gregex(). 2218 * Returns: TRUE if a match was found Since 0.26 2219 */ 2220 public int searchFindNext() 2221 { 2222 // gboolean vte_terminal_search_find_next (VteTerminal *terminal); 2223 return vte_terminal_search_find_next(vteTerminal); 2224 } 2225 2226 /** 2227 * Searches the previous string matching the search regex set with 2228 * vte_terminal_search_set_gregex(). 2229 * Returns: TRUE if a match was found Since 0.26 2230 */ 2231 public int searchFindPrevious() 2232 { 2233 // gboolean vte_terminal_search_find_previous (VteTerminal *terminal); 2234 return vte_terminal_search_find_previous(vteTerminal); 2235 } 2236 2237 /** 2238 * Returns: the search GRegex regex set in terminal, or NULL. [transfer none] Since 0.26 2239 */ 2240 public Regex searchGetGregex() 2241 { 2242 // GRegex * vte_terminal_search_get_gregex (VteTerminal *terminal); 2243 auto p = vte_terminal_search_get_gregex(vteTerminal); 2244 2245 if(p is null) 2246 { 2247 return null; 2248 } 2249 2250 return ObjectG.getDObject!(Regex)(cast(GRegex*) p); 2251 } 2252 2253 /** 2254 * Returns: whether searching will wrap around Since 0.26 2255 */ 2256 public int searchGetWrapAround() 2257 { 2258 // gboolean vte_terminal_search_get_wrap_around (VteTerminal *terminal); 2259 return vte_terminal_search_get_wrap_around(vteTerminal); 2260 } 2261 2262 /** 2263 * Sets the GRegex regex to search for. Unsets the search regex when passed NULL. 2264 * Params: 2265 * regex = a GRegex, or NULL. [allow-none] 2266 * Since 0.26 2267 */ 2268 public void searchSetGregex(Regex regex) 2269 { 2270 // void vte_terminal_search_set_gregex (VteTerminal *terminal, GRegex *regex); 2271 vte_terminal_search_set_gregex(vteTerminal, (regex is null) ? null : regex.getRegexStruct()); 2272 } 2273 2274 /** 2275 * Sets whether search should wrap around to the beginning of the 2276 * terminal content when reaching its end. 2277 * Params: 2278 * wrapAround = whether search should wrap 2279 * Since 0.26 2280 */ 2281 public void searchSetWrapAround(int wrapAround) 2282 { 2283 // void vte_terminal_search_set_wrap_around (VteTerminal *terminal, gboolean wrap_around); 2284 vte_terminal_search_set_wrap_around(vteTerminal, wrapAround); 2285 } 2286 2287 /** 2288 * Gets the user's shell, or NULL. In the latter case, the 2289 * system default (usually "/bin/sh") should be used. 2290 * Returns: a newly allocated string with the user's shell, or NULL. [transfer full][type filename] Since 0.28 2291 */ 2292 public static string getUserShell() 2293 { 2294 // char * vte_get_user_shell (void); 2295 return Str.toString(vte_get_user_shell()); 2296 } 2297 2298 /** 2299 * Warning 2300 * vte_terminal_fork_command has been deprecated since version 0.26 and should not be used in newly-written code. Use vte_terminal_fork_command_full() 2301 * Starts the specified command under a newly-allocated controlling 2302 * pseudo-terminal. The argv and envv lists should be NULL-terminated, and 2303 * argv[0] is expected to be the name of the file being run, as it would be if 2304 * execve() were being called. TERM is automatically set to reflect the 2305 * terminal widget's emulation setting. If lastlog, utmp, or wtmp are TRUE, 2306 * logs the session to the specified system log files. 2307 * Note that all file descriptors except stdin/stdout/stderr will be closed 2308 * before calling exec() in the child. 2309 * Params: 2310 * command = the name of a binary to run, or NULL to spawn the user's shell. [allow-none][type filename] 2311 * argv = the argument list to be passed to command, or NULL. [allow-none][array zero-terminated=1][element-type filename] 2312 * envv = a list of environment variables to be added to the environment before 2313 * starting command, or NULL. [allow-none][array zero-terminated=1][element-type filename] 2314 * workingDirectory = the name of a directory the command should start in, or NULL. [allow-none][type filename] 2315 * lastlog = TRUE if the session should be logged to the lastlog 2316 * utmp = TRUE if the session should be logged to the utmp/utmpx log 2317 * wtmp = TRUE if the session should be logged to the wtmp/wtmpx log 2318 * Returns: the PID of the new process, or -1 on failure 2319 */ 2320 public pid_t forkCommand(string command, string[] argv, string[] envv, string workingDirectory, int lastlog, int utmp, int wtmp) 2321 { 2322 // pid_t vte_terminal_fork_command (VteTerminal *terminal, const char *command, char **argv, char **envv, const char *working_directory, gboolean lastlog, gboolean utmp, gboolean wtmp); 2323 return vte_terminal_fork_command(vteTerminal, Str.toStringz(command), Str.toStringzArray(argv), Str.toStringzArray(envv), Str.toStringz(workingDirectory), lastlog, utmp, wtmp); 2324 } 2325 2326 /** 2327 * Starts the specified command under a newly-allocated controlling 2328 * pseudo-terminal. The argv and envv lists should be NULL-terminated. 2329 * The "TERM" environment variable is automatically set to reflect the 2330 * terminal widget's emulation setting. 2331 * pty_flags controls logging the session to the specified system log files. 2332 * Note that G_SPAWN_DO_NOT_REAP_CHILD will always be added to spawn_flags. 2333 * Note that unless spawn_flags contains G_SPAWN_LEAVE_DESCRIPTORS_OPEN, all file 2334 * descriptors except stdin/stdout/stderr will be closed before calling exec() 2335 * in the child. 2336 * See vte_pty_new(), g_spawn_async() and vte_terminal_watch_child() for more information. 2337 * Params: 2338 * ptyFlags = flags from VtePtyFlags 2339 * workingDirectory = the name of a directory the command should start 2340 * in, or NULL to use the current working directory. [allow-none] 2341 * argv = child's argument vector. [array zero-terminated=1][element-type filename] 2342 * envv = a list of environment 2343 * variables to be added to the environment before starting the process, or NULL. [allow-none][array zero-terminated=1][element-type filename] 2344 * spawnFlags = flags from GSpawnFlags 2345 * childSetup = an extra child setup function to run in the child just before exec(), or NULL. [allow-none][scope call] 2346 * childSetupData = user data for child_setup 2347 * childPid = a location to store the child PID, or NULL. [out][allow-none][transfer full] 2348 * Returns: TRUE on success, or FALSE on error with error filled in Since 0.26 2349 * Throws: GException on failure. 2350 */ 2351 public int forkCommandFull(VtePtyFlags ptyFlags, string workingDirectory, string[] argv, string[] envv, GSpawnFlags spawnFlags, GSpawnChildSetupFunc childSetup, void* childSetupData, out GPid childPid) 2352 { 2353 // gboolean vte_terminal_fork_command_full (VteTerminal *terminal, VtePtyFlags pty_flags, const char *working_directory, char **argv, char **envv, GSpawnFlags spawn_flags, GSpawnChildSetupFunc child_setup, gpointer child_setup_data, GPid *child_pid, GError **error); 2354 GError* err = null; 2355 2356 auto p = vte_terminal_fork_command_full(vteTerminal, ptyFlags, Str.toStringz(workingDirectory), Str.toStringzArray(argv), Str.toStringzArray(envv), spawnFlags, childSetup, childSetupData, &childPid, &err); 2357 2358 if (err !is null) 2359 { 2360 throw new GException( new ErrorG(err) ); 2361 } 2362 2363 return p; 2364 } 2365 2366 /** 2367 * Warning 2368 * vte_terminal_forkpty has been deprecated since version 0.26 and should not be used in newly-written code. Use VtePty and fork() instead 2369 * Starts a new child process under a newly-allocated controlling 2370 * pseudo-terminal. TERM is automatically set to reflect the terminal widget's 2371 * emulation setting. If lastlog, utmp, or wtmp are TRUE, logs the session 2372 * to the specified system log files. 2373 * Note that all file descriptors except stdin/stdout/stderr will be closed 2374 * in the child. 2375 * Note that envv and working_directory are silently ignored. 2376 * Params: 2377 * envv = a list of environment variables to be added to the environment before 2378 * starting returning in the child process, or NULL 2379 * workingDirectory = the name of a directory the child process should change to, or 2380 * NULL 2381 * lastlog = TRUE if the session should be logged to the lastlog 2382 * utmp = TRUE if the session should be logged to the utmp/utmpx log 2383 * wtmp = TRUE if the session should be logged to the wtmp/wtmpx log 2384 * Returns: the ID of the new process in the parent, 0 in the child, and -1 if there was an error Since 0.11.11 2385 */ 2386 public pid_t forkpty(string[] envv, string workingDirectory, int lastlog, int utmp, int wtmp) 2387 { 2388 // pid_t vte_terminal_forkpty (VteTerminal *terminal, char **envv, const char *working_directory, gboolean lastlog, gboolean utmp, gboolean wtmp); 2389 return vte_terminal_forkpty(vteTerminal, Str.toStringzArray(envv), Str.toStringz(workingDirectory), lastlog, utmp, wtmp); 2390 } 2391 2392 /** 2393 * Warning 2394 * vte_terminal_get_pty has been deprecated since version 0.26 and should not be used in newly-written code. Use vte_terminal_get_pty_object() and vte_pty_get_fd() 2395 * Returns the file descriptor of the master end of terminal's PTY. 2396 * Returns: the file descriptor, or -1 if the terminal has no PTY. Since 0.20 2397 */ 2398 public int getPty() 2399 { 2400 // int vte_terminal_get_pty (VteTerminal *terminal); 2401 return vte_terminal_get_pty(vteTerminal); 2402 } 2403 2404 /** 2405 * Returns the VtePty of terminal. 2406 * Returns: a VtePty, or NULL. [transfer none] Since 0.26 2407 */ 2408 public Pty getPtyObject() 2409 { 2410 // VtePty * vte_terminal_get_pty_object (VteTerminal *terminal); 2411 auto p = vte_terminal_get_pty_object(vteTerminal); 2412 2413 if(p is null) 2414 { 2415 return null; 2416 } 2417 2418 return ObjectG.getDObject!(Pty)(cast(VtePty*) p); 2419 } 2420 2421 /** 2422 * Creates a new VtePty, and sets the emulation property 2423 * from "emulation". 2424 * See vte_pty_new() for more information. 2425 * Params: 2426 * flags = flags from VtePtyFlags 2427 * Returns: a new VtePty. [transfer full] Since 0.26 2428 * Throws: GException on failure. 2429 */ 2430 public Pty ptyNew(VtePtyFlags flags) 2431 { 2432 // VtePty * vte_terminal_pty_new (VteTerminal *terminal, VtePtyFlags flags, GError **error); 2433 GError* err = null; 2434 2435 auto p = vte_terminal_pty_new(vteTerminal, flags, &err); 2436 2437 if (err !is null) 2438 { 2439 throw new GException( new ErrorG(err) ); 2440 } 2441 2442 2443 if(p is null) 2444 { 2445 return null; 2446 } 2447 2448 return ObjectG.getDObject!(Pty)(cast(VtePty*) p); 2449 } 2450 2451 /** 2452 * Warning 2453 * vte_terminal_set_pty has been deprecated since version 0.26 and should not be used in newly-written code. Use vte_pty_new_foreign() and vte_terminal_set_pty_object() 2454 * Attach an existing PTY master side to the terminal widget. Use 2455 * instead of vte_terminal_fork_command() or vte_terminal_forkpty(). 2456 * Params: 2457 * ptyMaster = a file descriptor of the master end of a PTY, or -1 2458 * Since 0.12.1 2459 */ 2460 public void setPty(int ptyMaster) 2461 { 2462 // void vte_terminal_set_pty (VteTerminal *terminal, int pty_master); 2463 vte_terminal_set_pty(vteTerminal, ptyMaster); 2464 } 2465 2466 /** 2467 * Sets pty as the PTY to use in terminal. 2468 * Use NULL to unset the PTY. 2469 * Params: 2470 * pty = a VtePty, or NULL. [allow-none] 2471 * Since 0.26. 2472 */ 2473 public void setPtyObject(Pty pty) 2474 { 2475 // void vte_terminal_set_pty_object (VteTerminal *terminal, VtePty *pty); 2476 vte_terminal_set_pty_object(vteTerminal, (pty is null) ? null : pty.getPtyStruct()); 2477 } 2478 2479 /** 2480 * Watches child_pid. When the process exists, the "child-exited" 2481 * signal will be called. Use vte_terminal_get_child_exit_status() to 2482 * retrieve the child's exit status. 2483 * Prior to calling this function, a VtePty must have been set in terminal 2484 * using vte_terminal_set_pty_object(). 2485 * When the child exits, the terminal's VtePty will be set to NULL. 2486 * Note: g_child_watch_add() or g_child_watch_add_full() must not have 2487 * been called for child_pid, nor a GSource for it been created with 2488 * g_child_watch_source_new(). 2489 * Note: when using the g_spawn_async() family of functions, 2490 * the G_SPAWN_DO_NOT_REAP_CHILD flag MUST have been passed. 2491 * Params: 2492 * childPid = a GPid 2493 * Since 0.26 2494 */ 2495 public void watchChild(GPid childPid) 2496 { 2497 // void vte_terminal_watch_child (VteTerminal *terminal, GPid child_pid); 2498 vte_terminal_watch_child(vteTerminal, childPid); 2499 } 2500 2501 /** 2502 * Warning 2503 * vte_terminal_get_adjustment has been deprecated since version 0.28 and should not be used in newly-written code. Use gtk_scrollable_get_vadjustment() instead 2504 * An accessor function provided for the benefit of language bindings. 2505 * Returns: the contents of terminal's adjustment field. [transfer none] 2506 */ 2507 public Adjustment getAdjustment() 2508 { 2509 // GtkAdjustment * vte_terminal_get_adjustment (VteTerminal *terminal); 2510 auto p = vte_terminal_get_adjustment(vteTerminal); 2511 2512 if(p is null) 2513 { 2514 return null; 2515 } 2516 2517 return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p); 2518 } 2519 2520 /** 2521 * Warning 2522 * vte_terminal_get_char_ascent is deprecated and should not be used in newly-written code. 0.20 2523 * An accessor function provided for the benefit of language bindings. 2524 * Returns: the contents of terminal's char_ascent field 2525 */ 2526 public glong getCharAscent() 2527 { 2528 // glong vte_terminal_get_char_ascent (VteTerminal *terminal); 2529 return vte_terminal_get_char_ascent(vteTerminal); 2530 } 2531 2532 /** 2533 * Warning 2534 * vte_terminal_get_char_descent is deprecated and should not be used in newly-written code. 0.20 2535 * An accessor function provided for the benefit of language bindings. 2536 * Returns: the contents of terminal's char_descent field 2537 */ 2538 public glong getCharDescent() 2539 { 2540 // glong vte_terminal_get_char_descent (VteTerminal *terminal); 2541 return vte_terminal_get_char_descent(vteTerminal); 2542 } 2543 2544 /** 2545 * Returns: the height of a character cell 2546 */ 2547 public glong getCharHeight() 2548 { 2549 // glong vte_terminal_get_char_height (VteTerminal *terminal); 2550 return vte_terminal_get_char_height(vteTerminal); 2551 } 2552 2553 /** 2554 * Returns: the width of a character cell 2555 */ 2556 public glong getCharWidth() 2557 { 2558 // glong vte_terminal_get_char_width (VteTerminal *terminal); 2559 return vte_terminal_get_char_width(vteTerminal); 2560 } 2561 2562 /** 2563 * Returns: the number of columns 2564 */ 2565 public glong getColumnCount() 2566 { 2567 // glong vte_terminal_get_column_count (VteTerminal *terminal); 2568 return vte_terminal_get_column_count(vteTerminal); 2569 } 2570 2571 /** 2572 * Returns: the icon title. [transfer none] 2573 */ 2574 public string getIconTitle() 2575 { 2576 // const char * vte_terminal_get_icon_title (VteTerminal *terminal); 2577 return Str.toString(vte_terminal_get_icon_title(vteTerminal)); 2578 } 2579 2580 /** 2581 * Returns: the number of rows 2582 */ 2583 public glong getRowCount() 2584 { 2585 // glong vte_terminal_get_row_count (VteTerminal *terminal); 2586 return vte_terminal_get_row_count(vteTerminal); 2587 } 2588 2589 /** 2590 * Returns: the window title. [transfer none] 2591 */ 2592 public string getWindowTitle() 2593 { 2594 // const char * vte_terminal_get_window_title (VteTerminal *terminal); 2595 return Str.toString(vte_terminal_get_window_title(vteTerminal)); 2596 } 2597 2598 /** 2599 * Returns: the URI of the current directory of the process running in the terminal, or NULL. [transfer none] Since 0.34 2600 */ 2601 public string getCurrentDirectoryUri() 2602 { 2603 // const char * vte_terminal_get_current_directory_uri (VteTerminal *terminal); 2604 return Str.toString(vte_terminal_get_current_directory_uri(vteTerminal)); 2605 } 2606 2607 /** 2608 * Returns: the URI of the current file the process running in the terminal is operating on, or NULL if not set. [transfer none] Since 0.34 2609 */ 2610 public string getCurrentFileUri() 2611 { 2612 // const char * vte_terminal_get_current_file_uri (VteTerminal *terminal); 2613 return Str.toString(vte_terminal_get_current_file_uri(vteTerminal)); 2614 } 2615 }