vte 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,57 @@
1
+ 2011-09-15 Kouhei Sutou <kou@cozmixng.org>
2
+
3
+ * lib/vte/deprecated.rb (GLib::Deprecatable#const_missing): don't
4
+ shadow real const_missing error.
5
+
6
+ 2011-09-13 Masaaki Aoyagi
7
+
8
+ * lib/vte/deprecated.rb:
9
+ - change module name to GLib::Deprecatable(TODO: move to glib).
10
+ - improve warning message.
11
+ - fix constant_get
12
+
13
+ 2011-09-11 Masaaki Aoyagi
14
+
15
+ * ext/vte/rbvte-terminal.c:
16
+ - add constants(EraseBinding,CursorBlinkMode,CursorShape).
17
+ * ext/vte/rbvte.c:
18
+ - delete deprecated constants(TerminalEraseBinding,TerminalCursorBlinkMode,TerminalCursorShape).
19
+ * lib/vte/deprecated.rb:
20
+ - define deprecated constants.
21
+
22
+ 2011-09-11 Masaaki Aoyagi
23
+
24
+ * ext/vte/rbvte-terminal.c: merge 'match_set_cursor*' methods.
25
+ * lib/vte.rb: add require "vte/deprecated".
26
+ * lib/vte/deprecated.rb: add.
27
+
28
+ 2011-09-11 Masaaki Aoyagi
29
+
30
+ * ext/vte/rbvte-terminal.c: not define method if property exist.
31
+
32
+ 2011-09-11 Masaaki Aoyagi
33
+
34
+ * ext/vte/rbvte-terminal.c: change return value to self
35
+
36
+ 2011-09-11 Masaaki Aoyagi
37
+
38
+ * ext/vte/rbvte.c,rbvte-pty.c,rbvte-terminal.c:
39
+ - implement version 0.26.2(exclude regular expressions)
40
+
41
+ 2011-08-28 Masaaki Aoyagi
42
+
43
+ * ext/vte/rbvte-access.c: -> ext/vte/rbvte-terminalaccessible.c
44
+
45
+ 2011-07-24 Masaaki Aoyagi
46
+
47
+ * ext/vte/*:
48
+ - divide by namespace.
49
+ - apply naming rules.
50
+
51
+ 2011-07-23 Masaaki Aoyagi
52
+
53
+ * ext/vte/*.c: change file header comment.
54
+
1
55
  2011-03-04 Kouhei Sutou <kou@clear-code.com>
2
56
 
3
57
  * ext/vte/depend: fix .pc path. #3199587
@@ -0,0 +1,76 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library 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 GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rbvte.h"
22
+
23
+ #define RG_TARGET_NAMESPACE cCharAttributes
24
+
25
+ static ID id_row, id_column, id_fore, id_back, id_underline, id_strikethrough;
26
+
27
+ static VALUE
28
+ rg_initialize(VALUE self, VALUE row, VALUE column, VALUE fore, VALUE back,
29
+ VALUE underline, VALUE strikethrough)
30
+ {
31
+ rb_ivar_set(self, id_row, row);
32
+ rb_ivar_set(self, id_column, column);
33
+ rb_ivar_set(self, id_fore, fore);
34
+ rb_ivar_set(self, id_back, back);
35
+ rb_ivar_set(self, id_underline, underline);
36
+ rb_ivar_set(self, id_strikethrough, strikethrough);
37
+ return Qnil;
38
+ }
39
+
40
+ static VALUE
41
+ rg_underline_p(VALUE self)
42
+ {
43
+ return rb_ivar_get(self, id_underline);
44
+ }
45
+
46
+ static VALUE
47
+ rg_strikethrough_p(VALUE self)
48
+ {
49
+ return rb_ivar_get(self, id_strikethrough);
50
+ }
51
+
52
+ void
53
+ Init_vte_charattributes(VALUE mVte)
54
+ {
55
+ VALUE RG_TARGET_NAMESPACE;
56
+
57
+ id_row = rb_intern("@row");
58
+ id_column = rb_intern("@column");
59
+ id_fore = rb_intern("@fore");
60
+ id_back = rb_intern("@back");
61
+ id_underline = rb_intern("@underline");
62
+ id_strikethrough = rb_intern("@strikethrough");
63
+
64
+ RG_TARGET_NAMESPACE = rb_define_class_under(mVte, "CharAttributes", rb_cObject);
65
+
66
+ RG_DEF_METHOD(initialize, 6);
67
+ RG_DEF_ATTR("row", TRUE, FALSE, TRUE);
68
+ RG_DEF_ATTR("column", TRUE, FALSE, TRUE);
69
+ RG_DEF_ATTR("fore", TRUE, FALSE, TRUE);
70
+ RG_DEF_ATTR("back", TRUE, FALSE, TRUE);
71
+ RG_DEF_ALIAS("foreground", "fore");
72
+ RG_DEF_ALIAS("background", "back");
73
+ RG_DEF_METHOD_P(underline, 0);
74
+ RG_DEF_METHOD_P(strikethrough, 0);
75
+ }
76
+
@@ -0,0 +1,120 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library 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 GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rbvte.h"
22
+
23
+ #define RG_TARGET_NAMESPACE cPty
24
+ #define _SELF(s) (VTE_PTY(RVAL2GOBJ(s)))
25
+
26
+ #if VTE_CHECK_VERSION(0, 26, 0)
27
+ static VALUE
28
+ rg_initialize(VALUE self, VALUE flags_or_fd)
29
+ {
30
+ VtePty *pty = NULL;
31
+ GError *error = NULL;
32
+
33
+ if (TYPE(flags_or_fd) == T_FIXNUM) {
34
+ pty = vte_pty_new_foreign(NUM2INT(flags_or_fd), &error);
35
+ } else {
36
+ pty = vte_pty_new(RVAL2GFLAGS(flags_or_fd, VTE_TYPE_PTY_FLAGS), &error);
37
+ }
38
+ if (error)
39
+ RAISE_GERROR(error);
40
+
41
+ G_INITIALIZE(self, pty);
42
+
43
+ return Qnil;
44
+ }
45
+
46
+ static VALUE
47
+ rg_child_setup(VALUE self)
48
+ {
49
+ vte_pty_child_setup(_SELF(self));
50
+
51
+ return self;
52
+ }
53
+
54
+ static VALUE
55
+ rg_close(VALUE self)
56
+ {
57
+ vte_pty_close(_SELF(self));
58
+
59
+ return self;
60
+ }
61
+
62
+ static VALUE
63
+ rg_size(VALUE self)
64
+ {
65
+ int rows, columns;
66
+ gboolean result;
67
+ GError *error = NULL;
68
+
69
+ result = vte_pty_get_size(_SELF(self), &rows, &columns, &error);
70
+ if (error)
71
+ RAISE_GERROR(error);
72
+
73
+ return rb_ary_new3(2, INT2NUM(rows), INT2NUM(columns));
74
+ }
75
+
76
+ static VALUE
77
+ rg_set_size(VALUE self, VALUE rows, VALUE columns)
78
+ {
79
+ gboolean result;
80
+ GError *error = NULL;
81
+
82
+ result = vte_pty_set_size(_SELF(self), NUM2INT(rows), NUM2INT(columns), &error);
83
+ if (error)
84
+ RAISE_GERROR(error);
85
+
86
+ return self;
87
+ }
88
+
89
+ static VALUE
90
+ rg_set_utf8(VALUE self, VALUE utf8)
91
+ {
92
+ gboolean result;
93
+ GError *error = NULL;
94
+
95
+ result = vte_pty_set_utf8(_SELF(self), RVAL2CBOOL(utf8), &error);
96
+ if (error)
97
+ RAISE_GERROR(error);
98
+
99
+ return self;
100
+ }
101
+ #endif
102
+
103
+ void
104
+ Init_vte_pty(VALUE mVte)
105
+ {
106
+ #if VTE_CHECK_VERSION(0, 26, 0)
107
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_PTY, "Pty", mVte);
108
+ G_DEF_CLASS(VTE_TYPE_PTY_ERROR, "Error", RG_TARGET_NAMESPACE);
109
+ G_DEF_CLASS(VTE_TYPE_PTY_FLAGS, "Flags", RG_TARGET_NAMESPACE);
110
+
111
+ RG_DEF_METHOD(initialize, 1);
112
+ RG_DEF_METHOD(child_setup, 0);
113
+ RG_DEF_METHOD(close, 0);
114
+ RG_DEF_METHOD(size, 0);
115
+ RG_DEF_METHOD(set_size, 2);
116
+ RG_DEF_METHOD(set_utf8, 1);
117
+
118
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
119
+ #endif
120
+ }
@@ -1,19 +1,29 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /**********************************************************************
3
-
4
- rbvte-reaper.c -
5
-
6
- $Author: ktou $
7
- $Date: 2006/05/17 12:40:47 $
8
-
9
- Copyright (C) 2006 Ruby-GNOME2 Project Team
10
-
11
- **********************************************************************/
2
+ /*
3
+ * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library 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 GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
12
20
 
13
21
  #include "rbvte.h"
14
22
 
23
+ #define RG_TARGET_NAMESPACE cReaper
24
+
15
25
  static VALUE
16
- reaper_get(VALUE self)
26
+ rg_m_get(VALUE self)
17
27
  {
18
28
  return GOBJ2RVAL(vte_reaper_get());
19
29
  }
@@ -21,11 +31,11 @@ reaper_get(VALUE self)
21
31
  void
22
32
  Init_vte_reaper(VALUE mVte)
23
33
  {
24
- VALUE cReaper;
34
+ VALUE RG_TARGET_NAMESPACE;
25
35
 
26
- cReaper = G_DEF_CLASS(VTE_TYPE_REAPER, "Reaper", mVte);
36
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_REAPER, "Reaper", mVte);
27
37
 
28
- rb_define_module_function(cReaper, "get", reaper_get, 0);
38
+ RG_DEF_MODFUNC(get, 0);
29
39
 
30
- G_DEF_SETTERS(cReaper);
40
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
31
41
  }
@@ -1,21 +1,32 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /**********************************************************************
2
+ /*
3
+ * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library 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 GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
3
20
 
4
- rbvte-terminal.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:34 $
8
-
9
- Copyright (C) 2006 Ruby-GNOME2 Project Team
21
+ #include "rbvte.h"
10
22
 
11
- **********************************************************************/
23
+ #include <stdarg.h>
24
+ #include <pwd.h>
12
25
 
13
- #include "rbvte.h"
26
+ #define RG_TARGET_NAMESPACE cTerminal
27
+ #define _SELF(s) (VTE_TERMINAL(RVAL2GOBJ(s)))
14
28
 
15
- static VALUE cCharAttributes;
16
29
  static ID id_new, id_call;
17
- static ID id_row, id_column, id_fore, id_back, id_underline, id_strikethrough;
18
-
19
30
 
20
31
  static char **
21
32
  rval2cstrary(VALUE ary)
@@ -53,15 +64,16 @@ static VALUE
53
64
  attrary2rval(GArray *attrs)
54
65
  {
55
66
  long i, len;
56
- VALUE rb_attrs;
67
+ VALUE rb_attrs, rb_class;
57
68
 
58
69
  len = attrs->len;
59
70
  rb_attrs = rb_ary_new2(len);
71
+ rb_class = rb_const_get(rb_const_get(rb_cObject, rb_intern("Vte")), rb_intern("CharAttributes"));
60
72
 
61
73
  for (i = 0; i < len; i++) {
62
74
  VteCharAttributes *attr;
63
75
  attr = &g_array_index(attrs, VteCharAttributes, i);
64
- rb_ary_push(rb_attrs, rb_funcall(cCharAttributes, id_new, 6,
76
+ rb_ary_push(rb_attrs, rb_funcall(rb_class, id_new, 6,
65
77
  LONG2NUM(attr->row),
66
78
  LONG2NUM(attr->column),
67
79
  COLOR2RVAL(&(attr->fore)),
@@ -73,44 +85,130 @@ attrary2rval(GArray *attrs)
73
85
  return rb_attrs;
74
86
  }
75
87
 
76
-
77
-
78
88
  static VALUE
79
- ca_initialize(VALUE self, VALUE row, VALUE column, VALUE fore, VALUE back,
80
- VALUE underline, VALUE strikethrough)
89
+ rg_initialize(VALUE self)
81
90
  {
82
- rb_ivar_set(self, id_row, row);
83
- rb_ivar_set(self, id_column, column);
84
- rb_ivar_set(self, id_fore, fore);
85
- rb_ivar_set(self, id_back, back);
86
- rb_ivar_set(self, id_underline, underline);
87
- rb_ivar_set(self, id_strikethrough, strikethrough);
91
+ RBGTK_INITIALIZE(self, vte_terminal_new());
88
92
  return Qnil;
89
93
  }
90
94
 
91
- static VALUE
92
- ca_get_underline(VALUE self)
95
+ #if VTE_CHECK_VERSION(0, 26, 0)
96
+ static const char *
97
+ rb_grn_inspect (VALUE object)
93
98
  {
94
- return rb_ivar_get(self, id_underline);
99
+ VALUE inspected;
100
+
101
+ inspected = rb_funcall(object, rb_intern("inspect"), 0);
102
+ return StringValueCStr(inspected);
103
+ }
104
+
105
+
106
+ static void
107
+ rb_grn_scan_options (VALUE options, ...)
108
+ {
109
+ VALUE original_options = options;
110
+ VALUE available_keys;
111
+ const char *key;
112
+ VALUE *value;
113
+ va_list args;
114
+
115
+ options = rb_check_convert_type(options, T_HASH, "Hash", "to_hash");
116
+ if (NIL_P(options)) {
117
+ options = rb_hash_new();
118
+ } else if (options == original_options) {
119
+ options = rb_funcall(options, rb_intern("dup"), 0);
120
+ }
121
+
122
+ available_keys = rb_ary_new();
123
+ va_start(args, options);
124
+ key = va_arg(args, const char *);
125
+ while (key) {
126
+ VALUE rb_key;
127
+ value = va_arg(args, VALUE *);
128
+
129
+ rb_key = ID2SYM(rb_intern(key));
130
+ rb_ary_push(available_keys, rb_key);
131
+ *value = rb_funcall(options, rb_intern("delete"), 1, rb_key);
132
+
133
+ key = va_arg(args, const char *);
134
+ }
135
+ va_end(args);
136
+
137
+ if (RVAL2CBOOL(rb_funcall(options, rb_intern("empty?"), 0)))
138
+ return;
139
+
140
+ rb_raise(rb_eArgError,
141
+ "unexpected key(s) exist: %s: available keys: %s",
142
+ rb_grn_inspect(rb_funcall(options, rb_intern("keys"), 0)),
143
+ rb_grn_inspect(available_keys));
95
144
  }
96
145
 
97
146
  static VALUE
98
- ca_get_strikethrough(VALUE self)
147
+ fork_command_default_argv(void)
99
148
  {
100
- return rb_ivar_get(self, id_strikethrough);
101
- }
149
+ struct passwd *pwd;
150
+ const char *shell = NULL;
102
151
 
152
+ pwd = getpwuid(getuid());
153
+ if (pwd != NULL)
154
+ shell = pwd->pw_shell;
155
+ if (shell == NULL)
156
+ shell = g_getenv("SHELL") ? g_getenv("SHELL") : "/bin/sh";
157
+
158
+ return rb_ary_new3(1, CSTR2RVAL(shell));
159
+ }
103
160
 
104
-
105
161
  static VALUE
106
- term_initialize(VALUE self)
162
+ fork_command_full(int argc, VALUE *argv, VALUE self)
107
163
  {
108
- RBGTK_INITIALIZE(self, vte_terminal_new());
109
- return Qnil;
164
+ VALUE options, rb_pty_flags, rb_working_directory, rb_command_argv, rb_envv, rb_spawn_flags;
165
+ int pty_flags, spawn_flags;
166
+ char *working_directory;
167
+ char **command_argv;
168
+ char **envv;
169
+ GPid child_pid;
170
+ gboolean result;
171
+ GError *error = NULL;
172
+
173
+ rb_scan_args(argc, argv, "01", &options);
174
+ rb_grn_scan_options(options,
175
+ "pty_flags", &rb_pty_flags,
176
+ "working_directory", &rb_working_directory,
177
+ "argv", &rb_command_argv,
178
+ "envv", &rb_envv,
179
+ "spawn_flags", &rb_spawn_flags,
180
+ NULL);
181
+ pty_flags = NIL_P(rb_pty_flags) ?
182
+ VTE_PTY_DEFAULT :
183
+ RVAL2GFLAGS(rb_pty_flags, VTE_TYPE_PTY_FLAGS);
184
+ working_directory = NIL_P(rb_working_directory) ? NULL : RVAL2CSTR(rb_working_directory);
185
+ command_argv = rval2cstrary(NIL_P(rb_command_argv) ? fork_command_default_argv() : rb_command_argv);
186
+ envv = rval2cstrary(rb_envv);
187
+ spawn_flags = NIL_P(rb_spawn_flags) ?
188
+ G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH :
189
+ NUM2INT(rb_spawn_flags);
190
+
191
+ result = vte_terminal_fork_command_full(_SELF(self),
192
+ pty_flags,
193
+ working_directory,
194
+ command_argv,
195
+ envv,
196
+ spawn_flags,
197
+ NULL,
198
+ NULL,
199
+ &child_pid,
200
+ &error);
201
+ free_cstrary(command_argv);
202
+ free_cstrary(envv);
203
+ if (error)
204
+ RAISE_GERROR(error);
205
+
206
+ return INT2NUM(child_pid);
110
207
  }
208
+ #endif
111
209
 
112
210
  static VALUE
113
- term_fork_command(int argc, VALUE *argv, VALUE self)
211
+ rg_fork_command(int argc, VALUE *argv, VALUE self)
114
212
  {
115
213
  VALUE rb_command, rb_command_argv, rb_envv, rb_directory;
116
214
  VALUE lastlog, utmp, wtmp;
@@ -123,6 +221,15 @@ term_fork_command(int argc, VALUE *argv, VALUE self)
123
221
  rb_scan_args(argc, argv, "07", &rb_command, &rb_command_argv,
124
222
  &rb_envv, &rb_directory, &lastlog, &utmp, &wtmp);
125
223
 
224
+ #if VTE_CHECK_VERSION(0, 26, 0)
225
+ if (argc == 0 || TYPE(rb_command) == T_HASH)
226
+ return fork_command_full(1, &rb_command, self);
227
+
228
+ rb_warn("'fork_commad(command, argv, envv, directory, lastlog, utmp, wtmp)' style"
229
+ " has been deprecated since version 0.26."
230
+ " Use 'fork_commad(options = {})' style.");
231
+ #endif
232
+
126
233
  command = NIL_P(rb_command) ? NULL : RVAL2CSTR(rb_command);
127
234
  command_argv = rval2cstrary(rb_command_argv);
128
235
  envv = rval2cstrary(rb_envv);
@@ -139,7 +246,7 @@ term_fork_command(int argc, VALUE *argv, VALUE self)
139
246
  }
140
247
 
141
248
  static VALUE
142
- term_fork_pty(int argc, VALUE *argv, VALUE self)
249
+ rg_fork_pty(int argc, VALUE *argv, VALUE self)
143
250
  {
144
251
  VALUE rb_envv, rb_directory, lastlog, utmp, wtmp;
145
252
  char **envv;
@@ -161,7 +268,7 @@ term_fork_pty(int argc, VALUE *argv, VALUE self)
161
268
  }
162
269
 
163
270
  static VALUE
164
- term_feed(VALUE self, VALUE data)
271
+ rg_feed(VALUE self, VALUE data)
165
272
  {
166
273
  glong length;
167
274
 
@@ -171,11 +278,11 @@ term_feed(VALUE self, VALUE data)
171
278
  vte_terminal_feed(RVAL2TERM(self), RSTRING_PTR(data), length);
172
279
  }
173
280
 
174
- return Qnil;
281
+ return self;
175
282
  }
176
283
 
177
284
  static VALUE
178
- term_feed_child(VALUE self, VALUE data)
285
+ rg_feed_child(VALUE self, VALUE data)
179
286
  {
180
287
  glong length;
181
288
 
@@ -185,11 +292,11 @@ term_feed_child(VALUE self, VALUE data)
185
292
  vte_terminal_feed_child(RVAL2TERM(self), RSTRING_PTR(data), length);
186
293
  }
187
294
 
188
- return Qnil;
295
+ return self;
189
296
  }
190
297
 
191
298
  static VALUE
192
- term_feed_child_binary(VALUE self, VALUE data)
299
+ rg_feed_child_binary(VALUE self, VALUE data)
193
300
  {
194
301
  glong length;
195
302
 
@@ -200,138 +307,138 @@ term_feed_child_binary(VALUE self, VALUE data)
200
307
  RSTRING_PTR(data), length);
201
308
  }
202
309
 
203
- return Qnil;
310
+ return self;
204
311
  }
205
312
 
206
313
  static VALUE
207
- term_copy_clipboard(VALUE self)
314
+ rg_copy_clipboard(VALUE self)
208
315
  {
209
316
  vte_terminal_copy_clipboard(RVAL2TERM(self));
210
- return Qnil;
317
+ return self;
211
318
  }
212
319
 
213
320
  static VALUE
214
- term_paste_clipboard(VALUE self)
321
+ rg_paste_clipboard(VALUE self)
215
322
  {
216
323
  vte_terminal_paste_clipboard(RVAL2TERM(self));
217
- return Qnil;
324
+ return self;
218
325
  }
219
326
 
220
327
  static VALUE
221
- term_copy_primary(VALUE self)
328
+ rg_copy_primary(VALUE self)
222
329
  {
223
330
  vte_terminal_copy_primary(RVAL2TERM(self));
224
- return Qnil;
331
+ return self;
225
332
  }
226
333
 
227
334
  static VALUE
228
- term_paste_primary(VALUE self)
335
+ rg_paste_primary(VALUE self)
229
336
  {
230
337
  vte_terminal_paste_primary(RVAL2TERM(self));
231
- return Qnil;
338
+ return self;
232
339
  }
233
340
 
234
341
  static VALUE
235
- term_set_size(VALUE self, VALUE columns, VALUE rows)
342
+ rg_set_size(VALUE self, VALUE columns, VALUE rows)
236
343
  {
237
344
  vte_terminal_set_size(RVAL2TERM(self), NUM2LONG(columns), NUM2LONG(rows));
238
- return Qnil;
345
+ return self;
239
346
  }
240
347
 
241
348
  static VALUE
242
- term_set_audible_bell(VALUE self, VALUE is_audible)
349
+ rg_set_audible_bell(VALUE self, VALUE is_audible)
243
350
  {
244
351
  vte_terminal_set_audible_bell(RVAL2TERM(self), RVAL2CBOOL(is_audible));
245
- return Qnil;
352
+ return self;
246
353
  }
247
354
 
248
355
  static VALUE
249
- term_get_audible_bell(VALUE self)
356
+ rg_audible_bell_p(VALUE self)
250
357
  {
251
358
  return CBOOL2RVAL(vte_terminal_get_audible_bell(RVAL2TERM(self)));
252
359
  }
253
360
 
254
361
  static VALUE
255
- term_set_visible_bell(VALUE self, VALUE is_visible)
362
+ rg_set_visible_bell(VALUE self, VALUE is_visible)
256
363
  {
257
364
  vte_terminal_set_visible_bell(RVAL2TERM(self), RVAL2CBOOL(is_visible));
258
- return Qnil;
365
+ return self;
259
366
  }
260
367
 
261
368
  static VALUE
262
- term_get_visible_bell(VALUE self)
369
+ rg_visible_bell_p(VALUE self)
263
370
  {
264
371
  return CBOOL2RVAL(vte_terminal_get_visible_bell(RVAL2TERM(self)));
265
372
  }
266
373
 
267
374
  static VALUE
268
- term_set_scroll_background(VALUE self, VALUE scroll)
375
+ rg_set_scroll_background(VALUE self, VALUE scroll)
269
376
  {
270
377
  vte_terminal_set_scroll_background(RVAL2TERM(self), RVAL2CBOOL(scroll));
271
- return Qnil;
378
+ return self;
272
379
  }
273
380
 
274
381
  static VALUE
275
- term_set_scroll_on_output(VALUE self, VALUE scroll)
382
+ rg_set_scroll_on_output(VALUE self, VALUE scroll)
276
383
  {
277
384
  vte_terminal_set_scroll_on_output(RVAL2TERM(self), RVAL2CBOOL(scroll));
278
- return Qnil;
385
+ return self;
279
386
  }
280
387
 
281
388
  static VALUE
282
- term_set_scroll_on_keystroke(VALUE self, VALUE scroll)
389
+ rg_set_scroll_on_keystroke(VALUE self, VALUE scroll)
283
390
  {
284
391
  vte_terminal_set_scroll_on_keystroke(RVAL2TERM(self), RVAL2CBOOL(scroll));
285
- return Qnil;
392
+ return self;
286
393
  }
287
394
 
288
395
  static VALUE
289
- term_set_color_dim(VALUE self, VALUE dim)
396
+ rg_set_color_dim(VALUE self, VALUE dim)
290
397
  {
291
398
  vte_terminal_set_color_dim(RVAL2TERM(self), RVAL2COLOR(dim));
292
- return Qnil;
399
+ return self;
293
400
  }
294
401
 
295
402
  static VALUE
296
- term_set_color_bold(VALUE self, VALUE bold)
403
+ rg_set_color_bold(VALUE self, VALUE bold)
297
404
  {
298
405
  vte_terminal_set_color_bold(RVAL2TERM(self), RVAL2COLOR(bold));
299
- return Qnil;
406
+ return self;
300
407
  }
301
408
 
302
409
  static VALUE
303
- term_set_color_foreground(VALUE self, VALUE foreground)
410
+ rg_set_color_foreground(VALUE self, VALUE foreground)
304
411
  {
305
412
  vte_terminal_set_color_foreground(RVAL2TERM(self), RVAL2COLOR(foreground));
306
- return Qnil;
413
+ return self;
307
414
  }
308
415
 
309
416
  static VALUE
310
- term_set_color_background(VALUE self, VALUE background)
417
+ rg_set_color_background(VALUE self, VALUE background)
311
418
  {
312
419
  vte_terminal_set_color_background(RVAL2TERM(self), RVAL2COLOR(background));
313
- return Qnil;
420
+ return self;
314
421
  }
315
422
 
316
423
  static VALUE
317
- term_set_color_cursor(VALUE self, VALUE cursor)
424
+ rg_set_color_cursor(VALUE self, VALUE cursor)
318
425
  {
319
426
  vte_terminal_set_color_cursor(RVAL2TERM(self),
320
427
  NIL_P(cursor) ? NULL : RVAL2COLOR(cursor));
321
- return Qnil;
428
+ return self;
322
429
  }
323
430
 
324
431
  static VALUE
325
- term_set_color_highlight(VALUE self, VALUE highlight)
432
+ rg_set_color_highlight(VALUE self, VALUE highlight)
326
433
  {
327
434
  vte_terminal_set_color_highlight(RVAL2TERM(self),
328
435
  NIL_P(highlight) ?
329
436
  NULL : RVAL2COLOR(highlight));
330
- return Qnil;
437
+ return self;
331
438
  }
332
439
 
333
440
  static VALUE
334
- term_set_colors(VALUE self, VALUE foreground, VALUE background,
441
+ rg_set_colors(VALUE self, VALUE foreground, VALUE background,
335
442
  VALUE rb_palette)
336
443
  {
337
444
  glong i, len;
@@ -355,18 +462,18 @@ term_set_colors(VALUE self, VALUE foreground, VALUE background,
355
462
 
356
463
  vte_terminal_set_colors(RVAL2TERM(self), RVAL2COLOR(foreground),
357
464
  RVAL2COLOR(background), palette, len);
358
- return Qnil;
465
+ return self;
359
466
  }
360
467
 
361
468
  static VALUE
362
- term_set_default_colors(VALUE self)
469
+ rg_set_default_colors(VALUE self)
363
470
  {
364
471
  vte_terminal_set_default_colors(RVAL2TERM(self));
365
- return Qnil;
472
+ return self;
366
473
  }
367
474
 
368
475
  static VALUE
369
- term_set_background_image(VALUE self, VALUE image_or_path)
476
+ rg_set_background_image(VALUE self, VALUE image_or_path)
370
477
  {
371
478
  if (RVAL2CBOOL(rb_obj_is_kind_of(image_or_path, rb_cString))) {
372
479
  vte_terminal_set_background_image_file(RVAL2TERM(self),
@@ -376,34 +483,34 @@ term_set_background_image(VALUE self, VALUE image_or_path)
376
483
  RVAL2GOBJ(image_or_path));
377
484
  }
378
485
 
379
- return Qnil;
486
+ return self;
380
487
  }
381
488
 
382
489
  static VALUE
383
- term_set_background_tint_color(VALUE self, VALUE color)
490
+ rg_set_background_tint_color(VALUE self, VALUE color)
384
491
  {
385
492
  vte_terminal_set_background_tint_color(RVAL2TERM(self), RVAL2COLOR(color));
386
- return Qnil;
493
+ return self;
387
494
  }
388
495
 
389
496
  static VALUE
390
- term_set_background_saturation(VALUE self, VALUE saturation)
497
+ rg_set_background_saturation(VALUE self, VALUE saturation)
391
498
  {
392
499
  vte_terminal_set_background_saturation(RVAL2TERM(self),
393
500
  NUM2DBL(saturation));
394
- return Qnil;
501
+ return self;
395
502
  }
396
503
 
397
504
  static VALUE
398
- term_set_background_transparent(VALUE self, VALUE transparent)
505
+ rg_set_background_transparent(VALUE self, VALUE transparent)
399
506
  {
400
507
  vte_terminal_set_background_transparent(RVAL2TERM(self),
401
508
  RVAL2CBOOL(transparent));
402
- return Qnil;
509
+ return self;
403
510
  }
404
511
 
405
512
  static VALUE
406
- term_set_cursor_blinks(VALUE self, VALUE blink)
513
+ rg_set_cursor_blinks(VALUE self, VALUE blink)
407
514
  {
408
515
  #if VTE_CHECK_VERSION(0, 18, 0)
409
516
  VteTerminalCursorBlinkMode mode;
@@ -413,22 +520,22 @@ term_set_cursor_blinks(VALUE self, VALUE blink)
413
520
  #else
414
521
  vte_terminal_set_cursor_blinks(RVAL2TERM(self), RVAL2CBOOL(blink));
415
522
  #endif
416
- return Qnil;
523
+ return self;
417
524
  }
418
525
 
419
526
  #if VTE_CHECK_VERSION(0, 18, 0)
420
527
  static VALUE
421
- term_set_cursor_blink_mode(VALUE self, VALUE rb_mode)
528
+ rg_set_cursor_blink_mode(VALUE self, VALUE rb_mode)
422
529
  {
423
530
  VteTerminalCursorBlinkMode mode;
424
531
 
425
532
  mode = RVAL2GENUM(rb_mode, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE);
426
533
  vte_terminal_set_cursor_blink_mode(RVAL2TERM(self), mode);
427
- return Qnil;
534
+ return self;
428
535
  }
429
536
 
430
537
  static VALUE
431
- term_get_cursor_blink_mode(VALUE self)
538
+ rg_cursor_blink_mode(VALUE self)
432
539
  {
433
540
  VteTerminalCursorBlinkMode mode;
434
541
 
@@ -439,17 +546,17 @@ term_get_cursor_blink_mode(VALUE self)
439
546
 
440
547
  #if VTE_CHECK_VERSION(0, 19, 1)
441
548
  static VALUE
442
- term_set_cursor_shape(VALUE self, VALUE rb_shape)
549
+ rg_set_cursor_shape(VALUE self, VALUE rb_shape)
443
550
  {
444
551
  VteTerminalCursorShape shape;
445
552
 
446
553
  shape = RVAL2GENUM(rb_shape, VTE_TYPE_TERMINAL_CURSOR_SHAPE);
447
554
  vte_terminal_set_cursor_shape(RVAL2TERM(self), shape);
448
- return Qnil;
555
+ return self;
449
556
  }
450
557
 
451
558
  static VALUE
452
- term_get_cursor_shape(VALUE self)
559
+ rg_cursor_shape(VALUE self)
453
560
  {
454
561
  VteTerminalCursorShape shape;
455
562
 
@@ -457,35 +564,37 @@ term_get_cursor_shape(VALUE self)
457
564
  return GENUM2RVAL(shape, VTE_TYPE_TERMINAL_CURSOR_SHAPE);
458
565
  }
459
566
 
567
+ #if !VTE_CHECK_VERSION(0, 20, 0)
460
568
  static VALUE
461
- term_get_pty(VALUE self)
569
+ rg_pty(VALUE self)
462
570
  {
463
571
  return INT2NUM(vte_terminal_get_pty(RVAL2TERM(self)));
464
572
  }
573
+ #endif
465
574
 
466
575
  static VALUE
467
- term_get_child_exit_status(VALUE self)
576
+ rg_child_exit_status(VALUE self)
468
577
  {
469
578
  return INT2NUM(vte_terminal_get_child_exit_status(RVAL2TERM(self)));
470
579
  }
471
580
  #endif
472
581
 
473
582
  static VALUE
474
- term_set_scrollback_lines(VALUE self, VALUE lines)
583
+ rg_set_scrollback_lines(VALUE self, VALUE lines)
475
584
  {
476
585
  vte_terminal_set_scrollback_lines(RVAL2TERM(self), NUM2LONG(lines));
477
- return Qnil;
586
+ return self;
478
587
  }
479
588
 
480
589
  static VALUE
481
- term_im_append_menuitems(VALUE self, VALUE menushell)
590
+ rg_im_append_menuitems(VALUE self, VALUE menushell)
482
591
  {
483
592
  vte_terminal_im_append_menuitems(RVAL2TERM(self), RVAL2GOBJ(menushell));
484
- return Qnil;
593
+ return self;
485
594
  }
486
595
 
487
596
  static VALUE
488
- term_set_font(int argc, VALUE *argv, VALUE self)
597
+ rg_set_font(int argc, VALUE *argv, VALUE self)
489
598
  {
490
599
  VALUE font_desc_or_name, rb_antialias;
491
600
  VteTerminalAntiAlias antialias = VTE_ANTI_ALIAS_USE_DEFAULT;
@@ -513,11 +622,11 @@ term_set_font(int argc, VALUE *argv, VALUE self)
513
622
  vte_terminal_set_font_full(term, font_desc, antialias);
514
623
  }
515
624
 
516
- return Qnil;
625
+ return self;
517
626
  }
518
627
 
519
628
  static VALUE
520
- term_get_font(VALUE self)
629
+ rg_font(VALUE self)
521
630
  {
522
631
  PangoFontDescription *font_desc;
523
632
  font_desc = (PangoFontDescription *)vte_terminal_get_font(RVAL2TERM(self));
@@ -525,78 +634,78 @@ term_get_font(VALUE self)
525
634
  }
526
635
 
527
636
  static VALUE
528
- term_get_using_xft(VALUE self)
637
+ rg_using_xft_p(VALUE self)
529
638
  {
530
639
  return CBOOL2RVAL(vte_terminal_get_using_xft(RVAL2TERM(self)));
531
640
  }
532
641
 
533
642
  static VALUE
534
- term_set_allow_bold(VALUE self, VALUE allow_bold)
643
+ rg_set_allow_bold(VALUE self, VALUE allow_bold)
535
644
  {
536
645
  vte_terminal_set_allow_bold(RVAL2TERM(self), RVAL2CBOOL(allow_bold));
537
- return Qnil;
646
+ return self;
538
647
  }
539
648
 
540
649
  static VALUE
541
- term_get_allow_bold(VALUE self)
650
+ rg_allow_bold_p(VALUE self)
542
651
  {
543
652
  return CBOOL2RVAL(vte_terminal_get_allow_bold(RVAL2TERM(self)));
544
653
  }
545
654
 
546
655
  static VALUE
547
- term_get_has_selection(VALUE self)
656
+ rg_has_selection_p(VALUE self)
548
657
  {
549
658
  return CBOOL2RVAL(vte_terminal_get_has_selection(RVAL2TERM(self)));
550
659
  }
551
660
 
552
661
  static VALUE
553
- term_set_word_chars(VALUE self, VALUE word_chars)
662
+ rg_set_word_chars(VALUE self, VALUE word_chars)
554
663
  {
555
664
  vte_terminal_set_word_chars(RVAL2TERM(self),
556
665
  NIL_P(word_chars) ?
557
666
  NULL : RVAL2CSTR(word_chars));
558
- return Qnil;
667
+ return self;
559
668
  }
560
669
 
561
670
  static VALUE
562
- term_is_word_char(VALUE self, VALUE c)
671
+ rg_word_char_p(VALUE self, VALUE c)
563
672
  {
564
673
  return CBOOL2RVAL(vte_terminal_is_word_char(RVAL2TERM(self), NUM2UINT(c)));
565
674
  }
566
675
 
567
676
  static VALUE
568
- term_set_backspace_binding(VALUE self, VALUE binding)
677
+ rg_set_backspace_binding(VALUE self, VALUE binding)
569
678
  {
570
679
  vte_terminal_set_backspace_binding(RVAL2TERM(self), RVAL2EB(binding));
571
- return Qnil;
680
+ return self;
572
681
  }
573
682
 
574
683
  static VALUE
575
- term_set_delete_binding(VALUE self, VALUE binding)
684
+ rg_set_delete_binding(VALUE self, VALUE binding)
576
685
  {
577
686
  vte_terminal_set_delete_binding(RVAL2TERM(self), RVAL2EB(binding));
578
- return Qnil;
687
+ return self;
579
688
  }
580
689
 
581
690
  static VALUE
582
- term_get_mouse_autohide(VALUE self)
691
+ rg_mouse_autohide_p(VALUE self)
583
692
  {
584
693
  return CBOOL2RVAL(vte_terminal_get_mouse_autohide(RVAL2TERM(self)));
585
694
  }
586
695
 
587
696
  static VALUE
588
- term_set_mouse_autohide(VALUE self, VALUE setting)
697
+ rg_set_mouse_autohide(VALUE self, VALUE setting)
589
698
  {
590
699
  vte_terminal_set_mouse_autohide(RVAL2TERM(self), RVAL2CBOOL(setting));
591
- return Qnil;
700
+ return self;
592
701
  }
593
702
 
594
703
  static VALUE
595
- term_reset(VALUE self, VALUE full, VALUE clear_history)
704
+ rg_reset(VALUE self, VALUE full, VALUE clear_history)
596
705
  {
597
706
  vte_terminal_reset(RVAL2TERM(self), RVAL2CBOOL(full),
598
707
  RVAL2CBOOL(clear_history));
599
- return Qnil;
708
+ return self;
600
709
  }
601
710
 
602
711
  static gboolean
@@ -617,7 +726,7 @@ term_is_selected_cb(VteTerminal *terminal, glong column, glong row,
617
726
  }
618
727
 
619
728
  static VALUE
620
- term_get_text(int argc, VALUE *argv, VALUE self)
729
+ rg_get_text(int argc, VALUE *argv, VALUE self)
621
730
  {
622
731
  VALUE get_attrs, include_trailing_spaces, proc, rb_text;
623
732
  GArray *attrs = NULL;
@@ -650,7 +759,7 @@ term_get_text(int argc, VALUE *argv, VALUE self)
650
759
  }
651
760
 
652
761
  static VALUE
653
- term_get_text_range(int argc, VALUE *argv, VALUE self)
762
+ rg_get_text_range(int argc, VALUE *argv, VALUE self)
654
763
  {
655
764
  VALUE start_row, start_col, end_row, end_col, get_attrs, proc, rb_text;
656
765
  GArray *attrs = NULL;
@@ -684,7 +793,7 @@ term_get_text_range(int argc, VALUE *argv, VALUE self)
684
793
  }
685
794
 
686
795
  static VALUE
687
- term_get_cursor_position(VALUE self)
796
+ rg_cursor_position(VALUE self)
688
797
  {
689
798
  glong column, row;
690
799
  vte_terminal_get_cursor_position(RVAL2TERM(self), &column, &row);
@@ -692,43 +801,43 @@ term_get_cursor_position(VALUE self)
692
801
  }
693
802
 
694
803
  static VALUE
695
- term_match_clear_all(VALUE self)
804
+ rg_match_clear_all(VALUE self)
696
805
  {
697
806
  vte_terminal_match_clear_all(RVAL2TERM(self));
698
- return Qnil;
807
+ return self;
699
808
  }
700
809
 
701
810
  static VALUE
702
- term_match_add(VALUE self, VALUE match)
811
+ rg_match_add(VALUE self, VALUE match)
703
812
  {
704
813
  return INT2NUM(vte_terminal_match_add(RVAL2TERM(self), RVAL2CSTR(match)));
705
814
  }
706
815
 
707
816
  static VALUE
708
- term_match_set_cursor(VALUE self, VALUE tag, VALUE cursor)
817
+ rg_match_set_cursor(VALUE self, VALUE tag, VALUE cursor)
709
818
  {
710
- vte_terminal_match_set_cursor(RVAL2TERM(self), NUM2INT(tag),
711
- RVAL2GOBJ(cursor));
712
- return Qnil;
713
- }
819
+ if (NIL_P(cursor) || RVAL2GTYPE(cursor) == GDK_TYPE_CURSOR) {
820
+ vte_terminal_match_set_cursor(RVAL2TERM(self), NUM2INT(tag), RVAL2GOBJ(cursor));
821
+ } else if (RVAL2GTYPE(cursor) == GDK_TYPE_CURSOR_TYPE) {
822
+ vte_terminal_match_set_cursor_type(RVAL2TERM(self), NUM2INT(tag), RVAL2CT(cursor));
823
+ #if VTE_CHECK_VERSION(0, 17, 1)
824
+ } else {
825
+ vte_terminal_match_set_cursor_name(_SELF(self), NUM2INT(tag), RVAL2CSTR(cursor));
826
+ #endif
827
+ }
714
828
 
715
- static VALUE
716
- term_match_set_cursor_type(VALUE self, VALUE tag, VALUE cursor_type)
717
- {
718
- vte_terminal_match_set_cursor_type(RVAL2TERM(self), NUM2INT(tag),
719
- RVAL2CT(cursor_type));
720
- return Qnil;
829
+ return self;
721
830
  }
722
831
 
723
832
  static VALUE
724
- term_match_remove(VALUE self, VALUE tag)
833
+ rg_match_remove(VALUE self, VALUE tag)
725
834
  {
726
835
  vte_terminal_match_remove(RVAL2TERM(self), NUM2INT(tag));
727
- return Qnil;
836
+ return self;
728
837
  }
729
838
 
730
839
  static VALUE
731
- term_match_check(VALUE self, VALUE column, VALUE row)
840
+ rg_match_check(VALUE self, VALUE column, VALUE row)
732
841
  {
733
842
  char *string;
734
843
  int tag;
@@ -745,286 +854,389 @@ term_match_check(VALUE self, VALUE column, VALUE row)
745
854
  }
746
855
  }
747
856
 
857
+ #if !VTE_CHECK_VERSION(0, 20, 0)
748
858
  static VALUE
749
- term_set_emulation(VALUE self, VALUE emulation)
859
+ rg_set_emulation(VALUE self, VALUE emulation)
750
860
  {
751
861
  vte_terminal_set_emulation(RVAL2TERM(self), RVAL2CSTR(emulation));
752
- return Qnil;
862
+ return self;
753
863
  }
754
864
 
755
865
  static VALUE
756
- term_get_emulation(VALUE self)
866
+ rg_emulation(VALUE self)
757
867
  {
758
868
  return CSTR2RVAL(vte_terminal_get_emulation(RVAL2TERM(self)));
759
869
  }
870
+ #endif
760
871
 
761
872
  static VALUE
762
- term_get_default_emulation(VALUE self)
873
+ rg_default_emulation(VALUE self)
763
874
  {
764
875
  return CSTR2RVAL(vte_terminal_get_default_emulation(RVAL2TERM(self)));
765
876
  }
766
877
 
878
+ #if !VTE_CHECK_VERSION(0, 20, 0)
767
879
  static VALUE
768
- term_set_encoding(VALUE self, VALUE encoding)
880
+ rg_set_encoding(VALUE self, VALUE encoding)
769
881
  {
770
882
  vte_terminal_set_encoding(RVAL2TERM(self), RVAL2CSTR(encoding));
771
- return Qnil;
883
+ return self;
772
884
  }
773
885
 
774
886
  static VALUE
775
- term_get_encoding(VALUE self)
887
+ rg_encoding(VALUE self)
776
888
  {
777
889
  return CSTR2RVAL(vte_terminal_get_encoding(RVAL2TERM(self)));
778
890
  }
891
+ #endif
779
892
 
780
893
  static VALUE
781
- term_get_status_line(VALUE self)
894
+ rg_status_line(VALUE self)
782
895
  {
783
896
  return CSTR2RVAL(vte_terminal_get_status_line(RVAL2TERM(self)));
784
897
  }
785
898
 
786
899
  static VALUE
787
- term_get_padding(VALUE self)
900
+ rg_padding(VALUE self)
788
901
  {
789
902
  int xpad, ypad;
790
903
  vte_terminal_get_padding(RVAL2TERM(self), &xpad, &ypad);
791
904
  return rb_ary_new3(2, INT2NUM(xpad), INT2NUM(ypad));
792
905
  }
793
906
 
907
+ #if !VTE_CHECK_VERSION(0, 20, 0)
794
908
  static VALUE
795
- term_set_pty(VALUE self, VALUE pty_master)
909
+ rg_set_pty(VALUE self, VALUE pty_master)
796
910
  {
797
911
  vte_terminal_set_pty(RVAL2TERM(self), NUM2INT(pty_master));
798
- return Qnil;
912
+ return self;
799
913
  }
914
+ #endif
800
915
 
801
916
  static VALUE
802
- term_get_adjustment(VALUE self)
917
+ rg_adjustment(VALUE self)
803
918
  {
804
919
  return GOBJ2RVAL(vte_terminal_get_adjustment(RVAL2TERM(self)));
805
920
  }
806
921
 
807
922
  static VALUE
808
- term_get_char_width(VALUE self)
923
+ rg_char_width(VALUE self)
809
924
  {
810
925
  return LONG2NUM(vte_terminal_get_char_width(RVAL2TERM(self)));
811
926
  }
812
927
 
813
928
  static VALUE
814
- term_get_char_height(VALUE self)
929
+ rg_char_height(VALUE self)
815
930
  {
816
931
  return LONG2NUM(vte_terminal_get_char_height(RVAL2TERM(self)));
817
932
  }
818
933
 
819
934
  static VALUE
820
- term_get_char_descent(VALUE self)
935
+ rg_char_descent(VALUE self)
821
936
  {
822
937
  return LONG2NUM(vte_terminal_get_char_descent(RVAL2TERM(self)));
823
938
  }
824
939
 
825
940
  static VALUE
826
- term_get_char_ascent(VALUE self)
941
+ rg_char_ascent(VALUE self)
827
942
  {
828
943
  return LONG2NUM(vte_terminal_get_char_ascent(RVAL2TERM(self)));
829
944
  }
830
945
 
831
946
  static VALUE
832
- term_get_row_count(VALUE self)
947
+ rg_row_count(VALUE self)
833
948
  {
834
949
  return LONG2NUM(vte_terminal_get_row_count(RVAL2TERM(self)));
835
950
  }
836
951
 
837
952
  static VALUE
838
- term_get_column_count(VALUE self)
953
+ rg_column_count(VALUE self)
839
954
  {
840
955
  return LONG2NUM(vte_terminal_get_column_count(RVAL2TERM(self)));
841
956
  }
842
957
 
843
958
  static VALUE
844
- term_get_window_title(VALUE self)
959
+ rg_window_title(VALUE self)
845
960
  {
846
961
  return CSTR2RVAL(vte_terminal_get_window_title(RVAL2TERM(self)));
847
962
  }
848
963
 
849
964
  static VALUE
850
- term_get_icon_title(VALUE self)
965
+ rg_icon_title(VALUE self)
851
966
  {
852
967
  return CSTR2RVAL(vte_terminal_get_icon_title(RVAL2TERM(self)));
853
968
  }
854
969
 
970
+ #if VTE_CHECK_VERSION(0, 26, 0)
971
+ static VALUE
972
+ rg_pty_new(VALUE self, VALUE flags)
973
+ {
974
+ VtePty *result;
975
+ GError *error = NULL;
855
976
 
856
- void
857
- Init_vte_terminal(VALUE mVte)
977
+ result = vte_terminal_pty_new(_SELF(self), RVAL2GFLAGS(flags, VTE_TYPE_PTY_FLAGS), &error);
978
+ if (error)
979
+ RAISE_GERROR(error);
980
+
981
+ return GOBJ2RVAL(result);
982
+ }
983
+ #endif
984
+
985
+ #if VTE_CHECK_VERSION(0, 26, 0)
986
+ static VALUE
987
+ rg_search_find_next(VALUE self)
858
988
  {
859
- VALUE cTerminal, cTerminalEraseBinding, cTerminalAntiAlias;
860
- #if VTE_CHECK_VERSION(0, 18, 0)
861
- VALUE cTerminalCursorBlinkMode;
989
+ gboolean result;
990
+
991
+ result = vte_terminal_search_find_next(_SELF(self));
992
+
993
+ return CBOOL2RVAL(result);
994
+ }
862
995
  #endif
863
- #if VTE_CHECK_VERSION(0, 19, 1)
864
- VALUE cTerminalCursorShape;
996
+
997
+ #if VTE_CHECK_VERSION(0, 26, 0)
998
+ static VALUE
999
+ rg_search_find_previous(VALUE self)
1000
+ {
1001
+ gboolean result;
1002
+
1003
+ result = vte_terminal_search_find_previous(_SELF(self));
1004
+
1005
+ return CBOOL2RVAL(result);
1006
+ }
1007
+ #endif
1008
+
1009
+ #if VTE_CHECK_VERSION(0, 26, 0)
1010
+ static VALUE
1011
+ rg_search_get_wrap_around_p(VALUE self)
1012
+ {
1013
+ gboolean result;
1014
+
1015
+ result = vte_terminal_search_get_wrap_around(_SELF(self));
1016
+
1017
+ return CBOOL2RVAL(result);
1018
+ }
1019
+ #endif
1020
+
1021
+ #if VTE_CHECK_VERSION(0, 26, 0)
1022
+ static VALUE
1023
+ rg_search_set_wrap_around(VALUE self, VALUE wrap_around)
1024
+ {
1025
+ vte_terminal_search_set_wrap_around(_SELF(self), RVAL2CBOOL(wrap_around));
1026
+
1027
+ return self;
1028
+ }
1029
+ #endif
1030
+
1031
+ #if VTE_CHECK_VERSION(0, 16, 0)
1032
+ static VALUE
1033
+ rg_select_all(VALUE self)
1034
+ {
1035
+ vte_terminal_select_all(_SELF(self));
1036
+
1037
+ return self;
1038
+ }
865
1039
  #endif
866
1040
 
1041
+ #if VTE_CHECK_VERSION(0, 16, 0)
1042
+ static VALUE
1043
+ rg_select_none(VALUE self)
1044
+ {
1045
+ vte_terminal_select_none(_SELF(self));
1046
+
1047
+ return self;
1048
+ }
1049
+ #endif
1050
+
1051
+ static VALUE
1052
+ rg_set_opacity(VALUE self, VALUE opacity)
1053
+ {
1054
+ vte_terminal_set_opacity(_SELF(self), NUM2UINT(opacity));
1055
+
1056
+ return self;
1057
+ }
1058
+
1059
+ #if VTE_CHECK_VERSION(0, 26, 0)
1060
+ static VALUE
1061
+ rg_watch_child(VALUE self, VALUE child_pid)
1062
+ {
1063
+ vte_terminal_watch_child(_SELF(self), NUM2INT(child_pid));
1064
+
1065
+ return self;
1066
+ }
1067
+ #endif
1068
+
1069
+ #if VTE_CHECK_VERSION(0, 24, 0)
1070
+ static VALUE
1071
+ rg_write_contents(int argc, VALUE *argv, VALUE self)
1072
+ {
1073
+ VALUE stream, flags, rb_cancellable;
1074
+ GCancellable *cancellable;
1075
+ gboolean result;
1076
+ GError *error = NULL;
1077
+
1078
+ rb_scan_args(argc, argv, "21", &stream, &flags, &rb_cancellable);
1079
+ cancellable = NIL_P(rb_cancellable) ? NULL : RVAL2GOBJ(rb_cancellable);
1080
+
1081
+ result = vte_terminal_write_contents(_SELF(self),
1082
+ RVAL2GOBJ(stream),
1083
+ RVAL2GENUM(flags, VTE_TYPE_TERMINAL_WRITE_FLAGS),
1084
+ cancellable,
1085
+ &error);
1086
+ if (error)
1087
+ RAISE_GERROR(error);
1088
+
1089
+ return CBOOL2RVAL(result);
1090
+ }
1091
+ #endif
1092
+
1093
+ void
1094
+ Init_vte_terminal(VALUE mVte)
1095
+ {
1096
+ VALUE RG_TARGET_NAMESPACE;
1097
+
867
1098
  id_new = rb_intern("new");
868
1099
  id_call = rb_intern("call");
869
1100
 
870
- id_row = rb_intern("@row");
871
- id_column = rb_intern("@column");
872
- id_fore = rb_intern("@fore");
873
- id_back = rb_intern("@back");
874
- id_underline = rb_intern("@underline");
875
- id_strikethrough = rb_intern("@strikethrough");
1101
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_TERMINAL, "Terminal", mVte);
876
1102
 
877
- cTerminal = G_DEF_CLASS(VTE_TYPE_TERMINAL, "Terminal", mVte);
878
- cTerminalEraseBinding = G_DEF_CLASS(VTE_TYPE_TERMINAL_ERASE_BINDING,
879
- "TerminalEraseBinding", mVte);
1103
+ G_DEF_CLASS(VTE_TYPE_TERMINAL_ERASE_BINDING, "EraseBinding", RG_TARGET_NAMESPACE);
880
1104
  #if VTE_CHECK_VERSION(0, 18, 0)
881
- cTerminalCursorBlinkMode = G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE,
882
- "TerminalCursorBlinkMode", mVte);
1105
+ G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE, "CursorBlinkMode", RG_TARGET_NAMESPACE);
883
1106
  #endif
884
1107
  #if VTE_CHECK_VERSION(0, 19, 1)
885
- cTerminalCursorShape = G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_SHAPE,
886
- "TerminalCursorShape", mVte);
1108
+ G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_SHAPE, "CursorShape", RG_TARGET_NAMESPACE);
887
1109
  #endif
888
- cTerminalAntiAlias = G_DEF_CLASS(VTE_TYPE_TERMINAL_ANTI_ALIAS,
889
- "TerminalAntiAlias", mVte);
890
-
891
- cCharAttributes = rb_define_class_under(mVte, "CharAttributes", rb_cObject);
892
-
893
- rb_define_method(cCharAttributes, "initialize", ca_initialize, 6);
894
- rb_attr(cCharAttributes, rb_intern("row"), TRUE, FALSE, TRUE);
895
- rb_attr(cCharAttributes, rb_intern("column"), TRUE, FALSE, TRUE);
896
- rb_attr(cCharAttributes, rb_intern("fore"), TRUE, FALSE, TRUE);
897
- rb_attr(cCharAttributes, rb_intern("back"), TRUE, FALSE, TRUE);
898
- rb_define_alias(cCharAttributes, "foreground", "fore");
899
- rb_define_alias(cCharAttributes, "background", "back");
900
- rb_define_method(cCharAttributes, "underline?", ca_get_underline, 0);
901
- rb_define_method(cCharAttributes, "strikethrough?",
902
- ca_get_strikethrough, 0);
903
-
904
-
905
- rb_define_method(cTerminal, "initialize", term_initialize, 0);
906
-
907
- rb_define_method(cTerminal, "fork_command", term_fork_command, -1);
908
- rb_define_method(cTerminal, "fork_pty", term_fork_pty, -1);
909
-
910
- rb_define_method(cTerminal, "feed", term_feed, 1);
911
- rb_define_method(cTerminal, "feed_child", term_feed_child, 1);
912
- rb_define_method(cTerminal, "feed_child_binary", term_feed_child_binary, 1);
913
-
914
- rb_define_method(cTerminal, "copy_clipboard", term_copy_clipboard, 0);
915
- rb_define_method(cTerminal, "paste_clipboard", term_paste_clipboard, 0);
916
- rb_define_method(cTerminal, "copy_primary", term_copy_primary, 0);
917
- rb_define_method(cTerminal, "paste_primary", term_paste_primary, 0);
918
-
919
- rb_define_method(cTerminal, "set_size", term_set_size, 2);
920
-
921
- rb_define_method(cTerminal, "set_audible_bell", term_set_audible_bell, 1);
922
- rb_define_method(cTerminal, "audible_bell?", term_get_audible_bell, 0);
923
- rb_define_method(cTerminal, "set_visible_bell", term_set_visible_bell, 1);
924
- rb_define_method(cTerminal, "visible_bell?", term_get_visible_bell, 0);
925
-
926
- rb_define_method(cTerminal, "set_scroll_background",
927
- term_set_scroll_background, 1);
928
- rb_define_method(cTerminal, "set_scroll_on_output",
929
- term_set_scroll_on_output, 1);
930
- rb_define_method(cTerminal, "set_scroll_on_keystroke",
931
- term_set_scroll_on_keystroke, 1);
932
-
933
- rb_define_method(cTerminal, "set_color_dim", term_set_color_dim, 1);
934
- rb_define_method(cTerminal, "set_color_bold", term_set_color_bold, 1);
935
- rb_define_method(cTerminal, "set_color_foreground",
936
- term_set_color_foreground, 1);
937
- rb_define_method(cTerminal, "set_color_background",
938
- term_set_color_background, 1);
939
- rb_define_method(cTerminal, "set_color_cursor", term_set_color_cursor, 1);
940
- rb_define_method(cTerminal, "set_color_highlight",
941
- term_set_color_highlight, 1);
942
- rb_define_method(cTerminal, "set_colors", term_set_colors, 3);
943
- rb_define_method(cTerminal, "set_default_colors",
944
- term_set_default_colors, 0);
945
- rb_define_method(cTerminal, "set_background_image",
946
- term_set_background_image, 1);
947
- rb_define_method(cTerminal, "set_background_tint_color",
948
- term_set_background_tint_color, 1);
949
- rb_define_method(cTerminal, "set_background_saturation",
950
- term_set_background_saturation, 1);
951
- rb_define_method(cTerminal, "set_background_transparent",
952
- term_set_background_transparent, 1);
953
- rb_define_method(cTerminal, "set_cursor_blinks", term_set_cursor_blinks, 1);
1110
+ G_DEF_CLASS(VTE_TYPE_TERMINAL_WRITE_FLAGS, "WriteFlags", RG_TARGET_NAMESPACE);
1111
+
1112
+ RG_DEF_METHOD(initialize, 0);
1113
+
1114
+ RG_DEF_METHOD(fork_command, -1);
1115
+ RG_DEF_METHOD(fork_pty, -1);
1116
+
1117
+ RG_DEF_METHOD(feed, 1);
1118
+ RG_DEF_METHOD(feed_child, 1);
1119
+ RG_DEF_METHOD(feed_child_binary, 1);
1120
+
1121
+ RG_DEF_METHOD(copy_clipboard, 0);
1122
+ RG_DEF_METHOD(paste_clipboard, 0);
1123
+ RG_DEF_METHOD(copy_primary, 0);
1124
+ RG_DEF_METHOD(paste_primary, 0);
1125
+
1126
+ RG_DEF_METHOD(set_size, 2);
1127
+
1128
+ RG_DEF_METHOD(set_audible_bell, 1);
1129
+ RG_DEF_METHOD_P(audible_bell, 0);
1130
+ RG_DEF_METHOD(set_visible_bell, 1);
1131
+ RG_DEF_METHOD_P(visible_bell, 0);
1132
+
1133
+ RG_DEF_METHOD(set_scroll_background, 1);
1134
+ RG_DEF_METHOD(set_scroll_on_output, 1);
1135
+ RG_DEF_METHOD(set_scroll_on_keystroke, 1);
1136
+
1137
+ RG_DEF_METHOD(set_color_dim, 1);
1138
+ RG_DEF_METHOD(set_color_bold, 1);
1139
+ RG_DEF_METHOD(set_color_foreground, 1);
1140
+ RG_DEF_METHOD(set_color_background, 1);
1141
+ RG_DEF_METHOD(set_color_cursor, 1);
1142
+ RG_DEF_METHOD(set_color_highlight, 1);
1143
+ RG_DEF_METHOD(set_colors, 3);
1144
+ RG_DEF_METHOD(set_default_colors, 0);
1145
+ RG_DEF_METHOD(set_background_image, 1);
1146
+ RG_DEF_METHOD(set_background_tint_color, 1);
1147
+ RG_DEF_METHOD(set_background_saturation, 1);
1148
+ RG_DEF_METHOD(set_background_transparent, 1);
1149
+ RG_DEF_METHOD(set_cursor_blinks, 1);
954
1150
  #if VTE_CHECK_VERSION(0, 18, 0)
955
- rb_define_method(cTerminal, "set_cursor_blink_mode",
956
- term_set_cursor_blink_mode, 1);
957
- rb_define_method(cTerminal, "cursor_blink_mode",
958
- term_get_cursor_blink_mode, 0);
1151
+ RG_DEF_METHOD(set_cursor_blink_mode, 1);
1152
+ RG_DEF_METHOD(cursor_blink_mode, 0);
959
1153
  #endif
960
1154
  #if VTE_CHECK_VERSION(0, 19, 1)
961
- rb_define_method(cTerminal, "set_cursor_shape", term_set_cursor_shape, 1);
962
- rb_define_method(cTerminal, "cursor_shape", term_get_cursor_shape, 0);
963
- rb_define_method(cTerminal, "pty", term_get_pty, 0);
964
- rb_define_method(cTerminal, "child_exit_status",
965
- term_get_child_exit_status, 0);
1155
+ RG_DEF_METHOD(set_cursor_shape, 1);
1156
+ RG_DEF_METHOD(cursor_shape, 0);
1157
+ #if !VTE_CHECK_VERSION(0, 20, 0)
1158
+ RG_DEF_METHOD(pty, 0);
1159
+ #endif
1160
+ RG_DEF_METHOD(child_exit_status, 0);
966
1161
  #endif
967
- rb_define_method(cTerminal, "set_scrollback_lines",
968
- term_set_scrollback_lines, 1);
969
-
970
- rb_define_method(cTerminal, "im_append_menuitems",
971
- term_im_append_menuitems, 1);
972
-
973
- rb_define_method(cTerminal, "set_font", term_set_font, -1);
974
- rb_define_method(cTerminal, "font", term_get_font, 0);
975
- rb_define_method(cTerminal, "using_xft?", term_get_using_xft, 0);
976
- rb_define_method(cTerminal, "set_allow_bold", term_set_allow_bold, 1);
977
- rb_define_method(cTerminal, "allow_bold?", term_get_allow_bold, 0);
978
- rb_define_method(cTerminal, "has_selection?", term_get_has_selection, 0);
979
- rb_define_alias(cTerminal, "have_selection?", "has_selection?");
980
- rb_define_method(cTerminal, "set_word_chars", term_set_word_chars, 1);
981
- rb_define_method(cTerminal, "word_char?", term_is_word_char, 1);
982
- rb_define_method(cTerminal, "set_backspace_binding",
983
- term_set_backspace_binding, 1);
984
- rb_define_method(cTerminal, "set_delete_binding",
985
- term_set_delete_binding, 1);
986
- rb_define_method(cTerminal, "mouse_autohide?", term_get_mouse_autohide, 0);
987
- rb_define_method(cTerminal, "set_mouse_autohide",
988
- term_set_mouse_autohide, 1);
989
-
990
- rb_define_method(cTerminal, "reset", term_reset, 2);
991
-
992
- rb_define_method(cTerminal, "get_text", term_get_text, -1);
993
- rb_define_method(cTerminal, "get_text_range", term_get_text_range, -1);
994
-
995
- rb_define_method(cTerminal, "cursor_position", term_get_cursor_position, 0);
996
-
997
- rb_define_method(cTerminal, "match_clear_all", term_match_clear_all, 0);
998
- rb_define_method(cTerminal, "match_add", term_match_add, 1);
999
- rb_define_method(cTerminal, "match_set_cursor",
1000
- term_match_set_cursor, 2);
1001
- rb_define_method(cTerminal, "match_set_cursor_type",
1002
- term_match_set_cursor_type, 2);
1003
- rb_define_method(cTerminal, "match_remove", term_match_remove, 1);
1004
- rb_define_method(cTerminal, "match_check", term_match_check, 2);
1005
-
1006
- rb_define_method(cTerminal, "set_emulation", term_set_emulation, 1);
1007
- rb_define_method(cTerminal, "emulation", term_get_emulation, 0);
1008
- rb_define_method(cTerminal, "default_emulation",
1009
- term_get_default_emulation, 0);
1010
-
1011
- rb_define_method(cTerminal, "set_encoding", term_set_encoding, 1);
1012
- rb_define_method(cTerminal, "encoding", term_get_encoding, 0);
1013
-
1014
- rb_define_method(cTerminal, "status_line", term_get_status_line, 0);
1015
- rb_define_method(cTerminal, "padding", term_get_padding, 0);
1016
-
1017
- rb_define_method(cTerminal, "set_pty", term_set_pty, 1);
1018
-
1019
- rb_define_method(cTerminal, "adjustment", term_get_adjustment, 0);
1020
- rb_define_method(cTerminal, "char_width", term_get_char_width, 0);
1021
- rb_define_method(cTerminal, "char_height", term_get_char_height, 0);
1022
- rb_define_method(cTerminal, "char_descent", term_get_char_descent, 0);
1023
- rb_define_method(cTerminal, "char_ascent", term_get_char_ascent, 0);
1024
- rb_define_method(cTerminal, "row_count", term_get_row_count, 0);
1025
- rb_define_method(cTerminal, "column_count", term_get_column_count, 0);
1026
- rb_define_method(cTerminal, "window_title", term_get_window_title, 0);
1027
- rb_define_method(cTerminal, "icon_title", term_get_icon_title, 0);
1028
-
1029
- G_DEF_SETTERS(cTerminal);
1162
+ RG_DEF_METHOD(set_scrollback_lines, 1);
1163
+
1164
+ RG_DEF_METHOD(im_append_menuitems, 1);
1165
+
1166
+ RG_DEF_METHOD(set_font, -1);
1167
+ RG_DEF_METHOD(font, 0);
1168
+ RG_DEF_METHOD_P(using_xft, 0);
1169
+ RG_DEF_METHOD(set_allow_bold, 1);
1170
+ RG_DEF_METHOD_P(allow_bold, 0);
1171
+ RG_DEF_METHOD_P(has_selection, 0);
1172
+ RG_DEF_ALIAS("have_selection?", "has_selection?");
1173
+ RG_DEF_METHOD(set_word_chars, 1);
1174
+ RG_DEF_METHOD_P(word_char, 1);
1175
+ RG_DEF_METHOD(set_backspace_binding, 1);
1176
+ RG_DEF_METHOD(set_delete_binding, 1);
1177
+ RG_DEF_METHOD_P(mouse_autohide, 0);
1178
+ RG_DEF_METHOD(set_mouse_autohide, 1);
1179
+
1180
+ RG_DEF_METHOD(reset, 2);
1181
+
1182
+ RG_DEF_METHOD(get_text, -1);
1183
+ RG_DEF_METHOD(get_text_range, -1);
1184
+
1185
+ RG_DEF_METHOD(cursor_position, 0);
1186
+
1187
+ RG_DEF_METHOD(match_clear_all, 0);
1188
+ RG_DEF_METHOD(match_add, 1);
1189
+ RG_DEF_METHOD(match_set_cursor, 2);
1190
+ RG_DEF_METHOD(match_remove, 1);
1191
+ RG_DEF_METHOD(match_check, 2);
1192
+
1193
+ #if !VTE_CHECK_VERSION(0, 20, 0)
1194
+ RG_DEF_METHOD(set_emulation, 1);
1195
+ RG_DEF_METHOD(emulation, 0);
1196
+ #endif
1197
+ RG_DEF_METHOD(default_emulation, 0);
1198
+
1199
+ #if !VTE_CHECK_VERSION(0, 20, 0)
1200
+ RG_DEF_METHOD(set_encoding, 1);
1201
+ RG_DEF_METHOD(encoding, 0);
1202
+ #endif
1203
+
1204
+ RG_DEF_METHOD(status_line, 0);
1205
+ RG_DEF_METHOD(padding, 0);
1206
+
1207
+ #if !VTE_CHECK_VERSION(0, 20, 0)
1208
+ RG_DEF_METHOD(set_pty, 1);
1209
+ #endif
1210
+
1211
+ RG_DEF_METHOD(adjustment, 0);
1212
+ RG_DEF_METHOD(char_width, 0);
1213
+ RG_DEF_METHOD(char_height, 0);
1214
+ RG_DEF_METHOD(char_descent, 0);
1215
+ RG_DEF_METHOD(char_ascent, 0);
1216
+ RG_DEF_METHOD(row_count, 0);
1217
+ RG_DEF_METHOD(column_count, 0);
1218
+ RG_DEF_METHOD(window_title, 0);
1219
+ RG_DEF_METHOD(icon_title, 0);
1220
+
1221
+ #if VTE_CHECK_VERSION(0, 26, 0)
1222
+ RG_DEF_METHOD(pty_new, 1);
1223
+ RG_DEF_METHOD(search_find_next, 0);
1224
+ RG_DEF_METHOD(search_find_previous, 0);
1225
+ RG_DEF_METHOD_P(search_get_wrap_around, 0);
1226
+ RG_DEF_METHOD(search_set_wrap_around, 1);
1227
+ RG_DEF_ALIAS("search_wrap_around=", "search_set_wrap_around");
1228
+ #endif
1229
+ #if VTE_CHECK_VERSION(0, 16, 0)
1230
+ RG_DEF_METHOD(select_all, 0);
1231
+ RG_DEF_METHOD(select_none, 0);
1232
+ #endif
1233
+ RG_DEF_METHOD(set_opacity, 1);
1234
+ #if VTE_CHECK_VERSION(0, 26, 0)
1235
+ RG_DEF_METHOD(watch_child, 1);
1236
+ #endif
1237
+ #if VTE_CHECK_VERSION(0, 24, 0)
1238
+ RG_DEF_METHOD(write_contents, -1);
1239
+ #endif
1240
+
1241
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
1030
1242
  }