vte3 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,41 @@
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 "rbvte3private.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(RVAL2VTETERMINAL(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
+ }
data/extconf.rb ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+ require 'mkmf'
5
+ require 'rbconfig'
6
+ require 'fileutils'
7
+
8
+ package = "vte3"
9
+
10
+ base_dir = Pathname(__FILE__).dirname.expand_path
11
+ ext_dir = base_dir + "ext" + package
12
+ mkmf_gnome2_dir = base_dir + 'lib'
13
+
14
+ ruby = File.join(RbConfig::CONFIG['bindir'],
15
+ RbConfig::CONFIG['ruby_install_name'] +
16
+ RbConfig::CONFIG["EXEEXT"])
17
+
18
+ build_dir = Pathname("ext") + package
19
+ FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
20
+ extconf_rb_path = ext_dir + "extconf.rb"
21
+ system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
22
+
23
+ create_makefile(package)
24
+ FileUtils.mv("Makefile", "Makefile.lib")
25
+
26
+ File.open("Makefile", "w") do |makefile|
27
+ makefile.puts(<<-EOM)
28
+ all:
29
+ (cd ext/#{package} && $(MAKE))
30
+ $(MAKE) -f Makefile.lib
31
+
32
+ install:
33
+ (cd ext/#{package} && $(MAKE) install)
34
+ $(MAKE) -f Makefile.lib install
35
+
36
+ site-install:
37
+ (cd ext/#{package} && $(MAKE) site-install)
38
+ $(MAKE) -f Makefile.lib site-install
39
+
40
+ clean:
41
+ (cd ext/#{package} && $(MAKE) clean)
42
+ $(MAKE) -f Makefile.lib clean
43
+
44
+ distclean:
45
+ (cd ext/#{package} && $(MAKE) distclean)
46
+ $(MAKE) -f Makefile.lib distclean
47
+ @rm -f Makefile.lib
48
+ EOM
49
+ end
@@ -0,0 +1,44 @@
1
+ module Vte
2
+ extend GLib::Deprecatable
3
+ define_deprecated_const :TerminalEraseBinding, 'Vte::Terminal::EraseBinding'
4
+ define_deprecated_const :TerminalCursorBlinkMode, 'Vte::Terminal::CursorBlinkMode'
5
+ define_deprecated_const :TerminalCursorShape, 'Vte::Terminal::CursorShape'
6
+
7
+ class Terminal
8
+ extend GLib::Deprecatable
9
+ define_deprecated_method :match_set_cursor_type, :match_set_cursor
10
+ define_deprecated_method :fork_pty, :raise => "Use 'Vte::Pty#fork'."
11
+ define_deprecated_method :using_xft?, :warn => "Don't use this method." do |_self|
12
+ false
13
+ end
14
+ define_deprecated_method :padding, :warn => "Use 'inner-border' style property." do |_self|
15
+ [0, 0]
16
+ end
17
+ define_deprecated_method :char_descent, :warn => "Don't use this method." do |_self|
18
+ 0
19
+ end
20
+ define_deprecated_method :char_ascent, :warn => "Don't use this method." do |_self|
21
+ 0
22
+ end
23
+ define_deprecated_method_by_hash_args :fork_command,
24
+ 'command, argv, envv, directory, lastlog, utmp, wtmp',
25
+ ':pty_flags => :default, :working_directory => <current>, :argv => <user_shell>, :envv => nil, :spawn_flags => :child_inherits_stdin' do
26
+ |_self, command, argv, envv, directory, lastlog = true, utmp = true, wtmp = true|
27
+ pty_flags = [!lastlog && :no_lastlog, !utmp && :no_utmp, !wtmp && :no_wtmp].select{|f| f}
28
+ argv = command && [command, *argv]
29
+ [{:pty_flags => pty_flags, :working_directory => directory, :argv => argv, :envv => envv}]
30
+ end
31
+
32
+ alias :__set_font__ :set_font
33
+ private :__set_font__
34
+ def set_font(*args)
35
+ if args.size == 1
36
+ params = args.first
37
+ else
38
+ raise GLib::DeprecatedError.new("#{caller[0]}: '#{self.class}#set_font(desc_or_name, antialias)' style has been deprecated. Use '#{self.class}#set_font(desc_or_name)' style.")
39
+ end
40
+ __set_font__(params)
41
+ end
42
+ end
43
+ end
44
+
data/lib/vte3.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "gtk3"
2
+ require "vte3.so"
3
+ require "vte3/deprecated"
4
+
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ multiterm.rb - Ruby/VTE sample script.
4
+
5
+ Copyright (c) 2006 Ruby-GNOME2 Project Team
6
+ This program is licenced under the same licence as Ruby-GNOME2.
7
+
8
+ $Id: multiterm.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $
9
+ =end
10
+
11
+ require "vte3"
12
+
13
+ class MultiTerm
14
+ def initialize
15
+ @terminals = []
16
+ init_window
17
+ add_terminal
18
+ end
19
+
20
+ def run
21
+ @window.show_all
22
+ @notebook.get_nth_page(@notebook.page).grab_focus
23
+ end
24
+
25
+ private
26
+ def init_window
27
+ @window = Gtk::Window.new("MultiTerm sample")
28
+ @window.signal_connect("destroy") do |widget|
29
+ Gtk.main_quit
30
+ end
31
+ init_notebook
32
+ @window.add(@notebook)
33
+ end
34
+
35
+ def init_notebook
36
+ @notebook = Gtk::Notebook.new
37
+ @last_page_index = nil
38
+ @notebook.signal_connect_after("switch-page") do |widget, page, i|
39
+ max_page_index = widget.n_pages - 1
40
+ if max_page_index > 0 and i == max_page_index
41
+ widget.page = @last_page_index
42
+ end
43
+ end
44
+ @notebook.signal_connect("switch-page") do |widget, page, i|
45
+ @last_page_index ||= i
46
+ terminal = widget.get_nth_page(i)
47
+ if terminal.respond_to?(:window_title)
48
+ @last_page_index = i
49
+ update_window_title(terminal.window_title)
50
+ end
51
+ end
52
+ @notebook.tab_reorderable = true if @notebook.respond_to?(:tab_reorderable=)
53
+ @notebook.scrollable = true
54
+ init_new_tab_label
55
+ dummy = Gtk::EventBox.new
56
+ @notebook.append_page(dummy, @new_tab_label)
57
+ end
58
+
59
+ def init_new_tab_label
60
+ @new_tab_label = Gtk::EventBox.new
61
+ @new_tab_label.signal_connect("button-press-event") do |widget, event|
62
+ add_terminal
63
+ @notebook.page = @last_page_index
64
+ true
65
+ end
66
+ # @new_tab_label.set_size_request(30, -1)
67
+ image = Gtk::Image.new(Gtk::Stock::NEW, Gtk::IconSize::MENU)
68
+ image.show
69
+ @new_tab_label.add(image)
70
+ @new_tab_label
71
+ end
72
+
73
+ def destroy
74
+ @window.destroy
75
+ end
76
+
77
+ def add_terminal
78
+ terminal = Vte::Terminal.new
79
+ terminal.signal_connect("child-exited") do |widget|
80
+ @notebook.remove_page(@notebook.page_num(widget))
81
+ @terminals.delete(widget)
82
+ destroy if @terminals.empty?
83
+ end
84
+ terminal.signal_connect("window-title-changed") do |widget|
85
+ @notebook.set_tab_label_text(widget, widget.window_title)
86
+ update_window_title(widget.window_title)
87
+ end
88
+ terminal.set_font("Monospace 14")
89
+ terminal.fork_command
90
+ terminal.show
91
+ last = @notebook.n_pages
92
+ @notebook.insert_page(last - 1, terminal)
93
+ @terminals << terminal
94
+ end
95
+
96
+ def update_window_title(title)
97
+ @window.title = title if title
98
+ end
99
+ end
100
+
101
+ multi_term = MultiTerm.new
102
+ multi_term.run
103
+ Gtk.main
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ terminal.rb - Ruby/VTE sample script.
4
+
5
+ Copyright (c) 2006 Ruby-GNOME2 Project Team
6
+ This program is licenced under the same licence as Ruby-GNOME2.
7
+
8
+ $Id: terminal.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $
9
+ =end
10
+
11
+ require "vte3"
12
+
13
+ window = Gtk::Window.new("Terminal sample")
14
+ window.signal_connect("destroy"){Gtk.main_quit}
15
+
16
+ terminal = Vte::Terminal.new
17
+ terminal.set_font("Monospace 16", Vte::TerminalAntiAlias::FORCE_ENABLE)
18
+ terminal.signal_connect("child-exited") do |widget|
19
+ Gtk.main_quit
20
+ end
21
+ terminal.signal_connect("window-title-changed") do |widget|
22
+ window.title = terminal.window_title
23
+ end
24
+ terminal.fork_command
25
+ window.add(terminal)
26
+ window.show_all
27
+
28
+ Gtk.main
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vte3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 2
9
+ - 0
10
+ version: 1.2.0
11
+ platform: ruby
12
+ authors:
13
+ - The Ruby-GNOME2 Project Team
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2013-01-24 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: gtk3
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 31
29
+ segments:
30
+ - 1
31
+ - 2
32
+ - 0
33
+ version: 1.2.0
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ description: Ruby/VTE is a Ruby binding of VTE.
37
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
38
+ executables: []
39
+
40
+ extensions:
41
+ - ext/vte3/extconf.rb
42
+ extra_rdoc_files: []
43
+
44
+ files:
45
+ - README
46
+ - Rakefile
47
+ - extconf.rb
48
+ - lib/vte3.rb
49
+ - lib/vte3/deprecated.rb
50
+ - ext/vte3/rbvteterminal.c
51
+ - ext/vte3/rbvtepty.c
52
+ - ext/vte3/extconf.rb
53
+ - ext/vte3/rbvte3conversions.h
54
+ - ext/vte3/rbvteterminalaccessible.c
55
+ - ext/vte3/rbvte3private.h
56
+ - ext/vte3/rbvtecharattributes.c
57
+ - ext/vte3/rbvte.c
58
+ - ext/vte3/rbvtereaper.c
59
+ - ext/vte3/depend
60
+ - sample/multiterm.rb
61
+ - sample/terminal.rb
62
+ homepage: http://ruby-gnome2.sourceforge.jp/
63
+ licenses: []
64
+
65
+ post_install_message: This library is experimental.
66
+ rdoc_options: []
67
+
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 55
76
+ segments:
77
+ - 1
78
+ - 9
79
+ - 2
80
+ version: 1.9.2
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ requirements: []
91
+
92
+ rubyforge_project:
93
+ rubygems_version: 1.8.24
94
+ signing_key:
95
+ specification_version: 3
96
+ summary: Ruby/VTE is a Ruby binding of VTE.
97
+ test_files: []
98
+