vte 0.90.6

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -0,0 +1,31 @@
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
+ **********************************************************************/
12
+
13
+ #include "rbvte.h"
14
+
15
+ void
16
+ Init_vte(void)
17
+ {
18
+ VALUE mVte;
19
+
20
+ mVte = rb_define_module("Vte");
21
+
22
+ rb_define_const(mVte, "BUILD_VERSION",
23
+ rb_ary_new3(3,
24
+ INT2FIX(VTE_MAJOR_VERSION),
25
+ INT2FIX(VTE_MINOR_VERSION),
26
+ INT2FIX(VTE_MICRO_VERSION)));
27
+
28
+ Init_vte_access(mVte);
29
+ Init_vte_reaper(mVte);
30
+ Init_vte_terminal(mVte);
31
+ }
@@ -0,0 +1,28 @@
1
+ #ifndef __RBVTE_H__
2
+ #define __RBVTE_H__
3
+
4
+ #include <ruby.h>
5
+ #include <rbgtk.h>
6
+
7
+ #include <vte/vte.h>
8
+ #include <vte/vteaccess.h>
9
+ #include <vte/reaper.h>
10
+
11
+ #ifndef VTE_CHECK_VERSION
12
+ # include "rbvteversion.h"
13
+ #endif
14
+
15
+ #define RVAL2TERM(obj) (RVAL2GOBJ(obj))
16
+ #define RVAL2COLOR(obj) ((GdkColor *)RVAL2BOXED(obj, GDK_TYPE_COLOR))
17
+ #define COLOR2RVAL(obj) (BOXED2RVAL(obj, GDK_TYPE_COLOR))
18
+ #define RVAL2AA(obj) (RVAL2GENUM(obj, VTE_TYPE_TERMINAL_ANTI_ALIAS))
19
+ #define RVAL2EB(obj) (RVAL2GENUM(obj, VTE_TYPE_TERMINAL_ERASE_BINDING))
20
+ #define RVAL2CT(obj) (RVAL2GENUM(obj, GDK_TYPE_CURSOR_TYPE))
21
+ #define RVAL2PFD(obj) ((PangoFontDescription*)RVAL2BOXED(self, PANGO_TYPE_FONT_DESCRIPTION))
22
+ #define PFD2RVAL(obj) (BOXED2RVAL(obj, PANGO_TYPE_FONT_DESCRIPTION))
23
+
24
+ extern void Init_vte_access(VALUE mVte);
25
+ extern void Init_vte_reaper(VALUE mVte);
26
+ extern void Init_vte_terminal(VALUE mVte);
27
+
28
+ #endif
Binary file
@@ -0,0 +1,3 @@
1
+ Name: Ruby/VTE
2
+ Description: Ruby bindings for Vte terminal widget.
3
+ Version: 0.90.6
Binary file
@@ -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 = "vte"
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,2 @@
1
+ require "gtk2"
2
+ require "vte.so"
@@ -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 "vte"
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 "vte"
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,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vte
3
+ version: !ruby/object:Gem::Version
4
+ hash: 379
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 90
9
+ - 6
10
+ version: 0.90.6
11
+ platform: ruby
12
+ authors:
13
+ - The Ruby-GNOME2 Proejct Team
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-30 00:00:00 +09:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: gtk2
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 379
30
+ segments:
31
+ - 0
32
+ - 90
33
+ - 6
34
+ version: 0.90.6
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: Ruby/VTE is a Ruby binding of VTE.
38
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
39
+ executables: []
40
+
41
+ extensions:
42
+ - ext/vte/extconf.rb
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - ChangeLog
47
+ - README
48
+ - Rakefile
49
+ - extconf.rb
50
+ - lib/vte.rb
51
+ - ext/vte/rbvte-terminal.c
52
+ - ext/vte/rbvte-terminal.o
53
+ - ext/vte/rbvte-reaper.c
54
+ - ext/vte/rbvte.h
55
+ - ext/vte/Makefile
56
+ - ext/vte/rbvte-access.c
57
+ - ext/vte/extconf.rb
58
+ - ext/vte/rbvte-access.o
59
+ - ext/vte/rbvte.c
60
+ - ext/vte/rbvte-reaper.o
61
+ - ext/vte/vte.so
62
+ - ext/vte/depend
63
+ - ext/vte/ruby-vte.pc
64
+ - ext/vte/rbvte.o
65
+ - sample/multiterm.rb
66
+ - sample/terminal.rb
67
+ has_rdoc: true
68
+ homepage: http://ruby-gnome2.sourceforge.jp/
69
+ licenses: []
70
+
71
+ post_install_message:
72
+ rdoc_options: []
73
+
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ hash: 61
82
+ segments:
83
+ - 1
84
+ - 8
85
+ - 5
86
+ version: 1.8.5
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ requirements: []
97
+
98
+ rubyforge_project:
99
+ rubygems_version: 1.3.7
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: Ruby/VTE is a Ruby binding of VTE.
103
+ test_files: []
104
+