vte 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,43 @@
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 cTerminalAccessible
24
+
25
+ static VALUE
26
+ rg_initialize(VALUE self, VALUE terminal)
27
+ {
28
+ G_INITIALIZE(self, vte_terminal_accessible_new(RVAL2TERM(terminal)));
29
+ return Qnil;
30
+ }
31
+
32
+ void
33
+ Init_vte_access(VALUE mVte)
34
+ {
35
+ VALUE RG_TARGET_NAMESPACE;
36
+
37
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_TERMINAL_ACCESSIBLE,
38
+ "TerminalAccessible", mVte);
39
+
40
+ RG_DEF_METHOD(initialize, 1);
41
+
42
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
43
+ }
data/ext/vte/rbvte.c CHANGED
@@ -1,31 +1,45 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /**********************************************************************
3
-
4
- rbvte.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 mVte
24
+
15
25
  void
16
26
  Init_vte(void)
17
27
  {
18
- VALUE mVte;
28
+ VALUE RG_TARGET_NAMESPACE;
19
29
 
20
- mVte = rb_define_module("Vte");
30
+ RG_TARGET_NAMESPACE = rb_define_module("Vte");
21
31
 
22
- rb_define_const(mVte, "BUILD_VERSION",
32
+ rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
23
33
  rb_ary_new3(3,
24
34
  INT2FIX(VTE_MAJOR_VERSION),
25
35
  INT2FIX(VTE_MINOR_VERSION),
26
36
  INT2FIX(VTE_MICRO_VERSION)));
27
37
 
28
- Init_vte_access(mVte);
29
- Init_vte_reaper(mVte);
30
- Init_vte_terminal(mVte);
38
+ G_DEF_CLASS(VTE_TYPE_TERMINAL_ANTI_ALIAS, "TerminalAntiAlias", RG_TARGET_NAMESPACE);
39
+
40
+ Init_vte_access(RG_TARGET_NAMESPACE);
41
+ Init_vte_reaper(RG_TARGET_NAMESPACE);
42
+ Init_vte_terminal(RG_TARGET_NAMESPACE);
43
+ Init_vte_charattributes(RG_TARGET_NAMESPACE);
44
+ Init_vte_pty(RG_TARGET_NAMESPACE);
31
45
  }
data/ext/vte/rbvte.h CHANGED
@@ -21,8 +21,33 @@
21
21
  #define RVAL2PFD(obj) ((PangoFontDescription*)RVAL2BOXED(self, PANGO_TYPE_FONT_DESCRIPTION))
22
22
  #define PFD2RVAL(obj) (BOXED2RVAL(obj, PANGO_TYPE_FONT_DESCRIPTION))
23
23
 
24
+ #define RG_DEF_MODFUNC(method, argc) \
25
+ rb_define_module_function(RG_TARGET_NAMESPACE, #method, rg_m_ ## method, argc)
26
+ #define RG_DEF_MODFUNC_P(method, argc) \
27
+ rb_define_module_function(RG_TARGET_NAMESPACE, #method"?", rg_m_ ## method ## _p, argc)
28
+ #define RG_DEF_MODFUNC_OPERATOR(ope, func, argc) \
29
+ rb_define_module_function(RG_TARGET_NAMESPACE, ope, rg_m_operator_ ## func, argc)
30
+ #define RG_DEF_SMETHOD(method, argc) \
31
+ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc)
32
+ #define RG_DEF_SMETHOD_P(method, argc) \
33
+ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method"?", rg_s_ ## method ## _p, argc)
34
+ #define RG_DEF_SMETHOD_OPERATOR(ope, func, argc) \
35
+ rb_define_singleton_method(RG_TARGET_NAMESPACE, ope, rg_s_operator_ ## func, argc)
36
+ #define RG_DEF_METHOD(method, argc) \
37
+ rb_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc)
38
+ #define RG_DEF_METHOD_P(method, argc) \
39
+ rb_define_method(RG_TARGET_NAMESPACE, #method"?", rg_ ## method ## _p, argc)
40
+ #define RG_DEF_METHOD_BANG(method, argc) \
41
+ rb_define_method(RG_TARGET_NAMESPACE, #method"!", rg_ ## method ## _bang, argc)
42
+ #define RG_DEF_METHOD_OPERATOR(ope, func, argc) \
43
+ rb_define_method(RG_TARGET_NAMESPACE, ope, rg_operator_ ## func, argc)
44
+ #define RG_DEF_ATTR(attr, read, write, ex) \
45
+ rb_attr(RG_TARGET_NAMESPACE, rb_intern(attr), read, write, ex)
46
+ #define RG_DEF_ALIAS(new, old) rb_define_alias(RG_TARGET_NAMESPACE, new, old)
47
+
24
48
  extern void Init_vte_access(VALUE mVte);
25
49
  extern void Init_vte_reaper(VALUE mVte);
26
50
  extern void Init_vte_terminal(VALUE mVte);
51
+ extern void Init_vte_charattributes(VALUE mVte);
27
52
 
28
53
  #endif
data/lib/vte.rb CHANGED
@@ -1,2 +1,4 @@
1
1
  require "gtk2"
2
2
  require "vte.so"
3
+ require "vte/deprecated"
4
+
@@ -0,0 +1,51 @@
1
+ module GLib
2
+ module Deprecatable
3
+ @@deprecated_const = {}
4
+
5
+ def define_deprecated_const(deprecated_const, new_const)
6
+ @@deprecated_const[self] ||= {}
7
+ @@deprecated_const[self][deprecated_const.to_sym] = new_const
8
+ end
9
+
10
+ def define_deprecated_method(deprecated_method, new_method)
11
+ if public_method_defined?(new_method)
12
+ define_method(deprecated_method) do |*args, &block|
13
+ warn "#{caller[0]}: '#{deprecated_method}' has been deprecated. Use '#{new_method}'."
14
+ __send__(new_method, *args, &block)
15
+ end
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def const_missing(deprecated_const)
22
+ if new_const = (@@deprecated_const[self] || {})[deprecated_const.to_sym]
23
+ if new_const = constant_get(new_const)
24
+ warn "#{caller[0]}: '#{[name, deprecated_const].join('::')}' has been deprecated. Use '#{new_const}'."
25
+ const_set(deprecated_const, new_const)
26
+ else
27
+ super
28
+ end
29
+ else
30
+ super
31
+ end
32
+ end
33
+
34
+ def constant_get(const)
35
+ const.split('::').inject(Object){|r, c| r.const_get(c)} rescue nil
36
+ end
37
+ end
38
+ end
39
+
40
+ module Vte
41
+ extend GLib::Deprecatable
42
+ define_deprecated_const 'TerminalEraseBinding', 'Vte::Terminal::EraseBinding'
43
+ define_deprecated_const 'TerminalCursorBlinkMode', 'Vte::Terminal::CursorBlinkMode'
44
+ define_deprecated_const 'TerminalCursorShape', 'Vte::Terminal::CursorShape'
45
+
46
+ class Terminal
47
+ extend GLib::Deprecatable
48
+ define_deprecated_method 'match_set_cursor_type', 'match_set_cursor'
49
+ end
50
+ end
51
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vte
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - The Ruby-GNOME2 Proejct Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-13 00:00:00 Z
18
+ date: 2011-09-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: gtk2
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 23
28
+ hash: 21
29
29
  segments:
30
30
  - 1
31
31
  - 0
32
- - 0
33
- version: 1.0.0
32
+ - 1
33
+ version: 1.0.1
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  description: Ruby/VTE is a Ruby binding of VTE.
@@ -46,12 +46,15 @@ files:
46
46
  - README
47
47
  - Rakefile
48
48
  - extconf.rb
49
+ - lib/vte/deprecated.rb
49
50
  - lib/vte.rb
51
+ - ext/vte/rbvte-charattributes.c
50
52
  - ext/vte/rbvte-terminal.c
51
53
  - ext/vte/rbvte-reaper.c
52
54
  - ext/vte/rbvte.h
53
- - ext/vte/rbvte-access.c
55
+ - ext/vte/rbvte-terminalaccessible.c
54
56
  - ext/vte/extconf.rb
57
+ - ext/vte/rbvte-pty.c
55
58
  - ext/vte/rbvte.c
56
59
  - ext/vte/depend
57
60
  - sample/multiterm.rb
@@ -1,33 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /**********************************************************************
3
-
4
- rbvte-access.c -
5
-
6
- $Author: ktou $
7
- $Date: 2006/05/17 12:40:47 $
8
-
9
- Copyright (C) 2006 Ruby-GNOME2 Project Team
10
-
11
- **********************************************************************/
12
-
13
- #include "rbvte.h"
14
-
15
- static VALUE
16
- ta_initialize(VALUE self, VALUE terminal)
17
- {
18
- G_INITIALIZE(self, vte_terminal_accessible_new(RVAL2TERM(terminal)));
19
- return Qnil;
20
- }
21
-
22
- void
23
- Init_vte_access(VALUE mVte)
24
- {
25
- VALUE cTerminalAccessible;
26
-
27
- cTerminalAccessible = G_DEF_CLASS(VTE_TYPE_TERMINAL_ACCESSIBLE,
28
- "TerminalAccessible", mVte);
29
-
30
- rb_define_method(cTerminalAccessible, "initialize", ta_initialize, 1);
31
-
32
- G_DEF_SETTERS(cTerminalAccessible);
33
- }