vte3 2.2.5 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5bcd8fdc0b8b9e19027204cc232c442f454c322
4
- data.tar.gz: 8c9db262d2beae07bcb59b998e8a0e429d97093f
3
+ metadata.gz: 94408dceea5a6c1b7509a685823fd20e1742ceeb
4
+ data.tar.gz: 2435d3de5366f369e1e2c9a854ee7ec8e6701ad0
5
5
  SHA512:
6
- metadata.gz: 5f5c14ee4fb112339eae65491285d3572a45f952391b6831642d65fa68630e6ce277f26f1b2b9112b4d6dbf98d35ef116b568cff7473495c89042be528394abe
7
- data.tar.gz: a0ce903de96acd5281cb2bcef8110bc740c1b376c9984c179ee8d15274b4b0ee95a620a4ef2c645472342a36198241484ff07d86040df6bd2044c719a068a954
6
+ metadata.gz: 3a2927cb3923cf0f8d73b2e6217bf128e6747acac55bca80c5123403f5cf85de23b37e1d93678f678d4be058e320e66fde881f2bc3ce70835e5a84c8fdcb2094
7
+ data.tar.gz: 24892fe03e9f46399822cf0c13b620500ac7dd8afd24be76a2ec1177223bb832b1d8fbfaecfca969c094c5cdfb0db6580ddb8f8036e2ed690aed09031a0b947e
data/Rakefile CHANGED
@@ -1,4 +1,20 @@
1
1
  # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2011-2015 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, MA 02110-1301 USA
2
18
 
3
19
  $LOAD_PATH.unshift("./../glib2/lib")
4
20
  require 'gnome2/rake/package-task'
@@ -6,41 +22,41 @@ require 'gnome2/rake/package-task'
6
22
  package_task = GNOME2::Rake::PackageTask.new do |package|
7
23
  package.summary = "Ruby/VTE is a Ruby binding of VTE."
8
24
  package.description = "Ruby/VTE is a Ruby binding of VTE."
9
- package.dependency.gem.runtime = ["gtk3"]
25
+ package.dependency.gem.runtime = ["gtk3", "gobject-introspection"]
10
26
  package.windows.packages = []
11
27
  package.windows.dependencies = []
12
28
  package.windows.build_dependencies = [
13
- "glib2", "atk", "pango", "gdk_pixbuf2", "gdk3",
29
+ "glib2",
30
+ "gio2",
31
+ "atk",
32
+ "pango",
33
+ "gdk_pixbuf2",
34
+ "gdk3",
35
+ "gobject-introspection",
14
36
  ]
15
- package.windows.build_packages = [
16
- # {
17
- # :name => "ncurses",
18
- # :download_base_url => "http://ftp.gnu.org/pub/gnu/ncurses",
19
- # :label => "ncurses",
20
- # :version => "5.9",
21
- # :configure_args => [
22
- # "--enable-sp-funcs",
23
- # "--enable-term-driver",
24
- # "--with-shared",
25
- # "--without-normal",
26
- # "--without-progs",
27
- # "--without-tests",
28
- # ],
29
- # :patches => [
30
- # "ncurses-5.9-support-mingw32.diff",
31
- # "ncurses-5.9-add-missing-exe.diff",
32
- # ],
33
- # },
34
- # {
35
- # :name => "vte",
36
- # :download_site => :gnome,
37
- # :label => "vte",
38
- # :version => "0.34.2",
39
- # :configure_args => [],
40
- # :compression_method => "xz",
41
- # }
37
+ package.windows.gobject_introspection_dependencies = [
38
+ "gio2",
39
+ "atk",
40
+ "pango",
41
+ "gdk_pixbuf2",
42
+ "gdk3",
43
+ ]
44
+ package.external_packages = [
45
+ {
46
+ :name => "vte",
47
+ :download_site => :gnome,
48
+ :label => "vte",
49
+ :version => "0.41.90",
50
+ :compression_method => "xz",
51
+ :windows => {
52
+ :configure_args => [
53
+ "--disable-vala",
54
+ ],
55
+ :patches => [
56
+ ],
57
+ :need_autoreconf => true,
58
+ },
59
+ },
42
60
  ]
43
- package.post_install_message = "This library is experimental."
44
61
  end
45
62
  package_task.define
46
-
@@ -1,4 +1,56 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ require "gobject-introspection"
1
18
  require "gtk3"
2
- require "vte3.so"
3
- require "vte3/deprecated"
4
19
 
20
+ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
21
+ vendor_dir = base_dir + "vendor" + "local"
22
+ vendor_bin_dir = vendor_dir + "bin"
23
+ GLib.prepend_dll_path(vendor_bin_dir)
24
+ vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
25
+ GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
26
+
27
+ require "vte3/loader"
28
+
29
+ module Vte
30
+ LOG_DOMAIN = "Vte"
31
+ GLib::Log.set_log_domain(LOG_DOMAIN)
32
+
33
+ class Error < StandardError
34
+ end
35
+
36
+ class << self
37
+ def const_missing(name)
38
+ init
39
+ if const_defined?(name)
40
+ const_get(name)
41
+ else
42
+ super
43
+ end
44
+ end
45
+
46
+ def init
47
+ class << self
48
+ remove_method(:init)
49
+ remove_method(:const_missing)
50
+ end
51
+ Gtk.init if Gtk.respond_to?(:init)
52
+ loader = Loader.new(self)
53
+ loader.load("Vte")
54
+ end
55
+ end
56
+ end
@@ -1,3 +1,19 @@
1
+ # Copyright (C) 2014-2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
1
17
  module Vte
2
18
  extend GLib::Deprecatable
3
19
 
@@ -8,7 +24,6 @@ module Vte
8
24
  define_deprecated_const :CursorShape, 'Vte::TerminalCursorShape'
9
25
  define_deprecated_const :WriteFlags, 'Vte::TerminalWriteFlags'
10
26
 
11
- define_deprecated_method :match_set_cursor_type, :match_set_cursor
12
27
  define_deprecated_method :fork_pty, :raise => "Use 'Vte::Pty#fork'."
13
28
  define_deprecated_method :using_xft?, :warn => "Don't use this method." do |_self|
14
29
  false
@@ -16,30 +31,13 @@ module Vte
16
31
  define_deprecated_method :padding, :warn => "Use 'inner-border' style property." do |_self|
17
32
  [0, 0]
18
33
  end
19
- define_deprecated_method :char_descent, :warn => "Don't use this method." do |_self|
20
- 0
21
- end
22
- define_deprecated_method :char_ascent, :warn => "Don't use this method." do |_self|
23
- 0
24
- end
25
- define_deprecated_method_by_hash_args :fork_command,
26
- 'command, argv, envv, directory, lastlog, utmp, wtmp',
27
- ':pty_flags => :default, :working_directory => <current>, :argv => <user_shell>, :envv => nil, :spawn_flags => :child_inherits_stdin' do
28
- |_self, command, argv, envv, directory, lastlog = true, utmp = true, wtmp = true|
29
- pty_flags = [!lastlog && :no_lastlog, !utmp && :no_utmp, !wtmp && :no_wtmp].select{|f| f}
30
- argv = command && [command, *argv]
31
- [{:pty_flags => pty_flags, :working_directory => directory, :argv => argv, :envv => envv}]
34
+
35
+ unless method_defined?(:pty_object)
36
+ define_deprecated_method :pty_object, :pty
32
37
  end
33
38
 
34
- alias :__set_font__ :set_font
35
- private :__set_font__
36
- def set_font(*args)
37
- if args.size == 1
38
- params = args.first
39
- else
40
- 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.")
41
- end
42
- __set_font__(params)
39
+ unless method_defined?(:fork_command)
40
+ define_deprecated_method :fork_command, :spawn
43
41
  end
44
42
  end
45
43
  end
@@ -0,0 +1,66 @@
1
+ # Copyright (C) 2014-2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Vte
18
+ class Loader < GObjectIntrospection::Loader
19
+ private
20
+ def load_function_info(info)
21
+ name = info.name
22
+ case name
23
+ when "init"
24
+ # ignore
25
+ else
26
+ super
27
+ end
28
+ end
29
+
30
+ def pre_load(repository, namespace)
31
+ define_version_module
32
+ end
33
+
34
+ def define_version_module
35
+ @version_module = Module.new
36
+ @base_module.const_set("Version", @version_module)
37
+ end
38
+
39
+ def post_load(repository, namespace)
40
+ require_libraries
41
+ end
42
+
43
+ def require_libraries
44
+ require "vte3/pty"
45
+ require "vte3/terminal"
46
+ require "vte3/version"
47
+
48
+ require "vte3/deprecated"
49
+ end
50
+
51
+ def load_constant_info(info)
52
+ case info.name
53
+ when /_VERSION\z/
54
+ @version_module.const_set($PREMATCH, info.value)
55
+ else
56
+ super
57
+ end
58
+ end
59
+
60
+ def initialize_post(object)
61
+ super
62
+ return unless object.is_a?(GLib::Object)
63
+ self.class.reference_gobject(object, :sink => true)
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,29 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Vte
18
+ class Pty
19
+ alias_method :size_raw, :size
20
+ def size
21
+ succeeded, rows, columns = size_raw
22
+ if succeeded
23
+ [rows, columns]
24
+ else
25
+ nil
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,73 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Vte
18
+ class Terminal
19
+ if method_defined?(:fork_command_full)
20
+ def fork_command(options={})
21
+ pty_flags = options[:pty_flags] || PtyFlags::DEFAULT
22
+ working_directory = options[:working_directory]
23
+ argv = options[:argv] || [ENV["SHELL"] || "/bin/sh"]
24
+ envv = options[:envv]
25
+ default_spawn_flags =
26
+ GLib::Spawn::CHILD_INHERITS_STDIN | GLib::Spawn::SEARCH_PATH
27
+ spawn_flags = options[:spawn_flags] || default_spawn_flags
28
+ succeeded, pid = fork_command_full(pty_flags,
29
+ working_directory,
30
+ argv,
31
+ envv,
32
+ spawn_flags)
33
+ if succeeded
34
+ pid
35
+ else
36
+ nil
37
+ end
38
+ end
39
+
40
+ alias_method :spawn, :fork_command
41
+
42
+ alias_method :pty_raw, :pty
43
+ def pty
44
+ pty_object
45
+ end
46
+ else
47
+ def spawn(options)
48
+ pty_flags = options[:pty_flags] || PtyFlags::DEFAULT
49
+ working_directory = options[:working_directory]
50
+ argv = options[:argv] || [ENV["SHELL"] || "/bin/sh"]
51
+ envv = options[:envv]
52
+ default_spawn_flags =
53
+ GLib::Spawn::CHILD_INHERITS_STDIN | GLib::Spawn::SEARCH_PATH
54
+ spawn_flags = options[:spawn_flags] || default_spawn_flags
55
+ succeeded, pid = spawn_sync(pty_flags,
56
+ working_directory,
57
+ argv,
58
+ envv,
59
+ spawn_flags)
60
+ if succeeded
61
+ pid
62
+ else
63
+ nil
64
+ end
65
+ end
66
+ end
67
+
68
+ alias_method :feed_child_raw, :feed_child
69
+ def feed_child(text)
70
+ feed_child_raw(text, text.bytesize)
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,35 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Vte
18
+ module Version
19
+ if const_defined?(:MAJOR)
20
+ STRING = [MAJOR, MINOR, MICRO].join(".")
21
+
22
+ class << self
23
+ def or_later?(major, minor, micro=nil)
24
+ micro ||= 0
25
+ version = [
26
+ MAJOR,
27
+ MINOR,
28
+ MICRO,
29
+ ]
30
+ (version <=> [major, minor, micro]) >= 0
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2014-2015 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, MA 02110-1301 USA
18
+
19
+ ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
20
+ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
21
+
22
+ glib_base = File.join(ruby_gnome2_base, "glib2")
23
+ atk_base = File.join(ruby_gnome2_base, "atk")
24
+ pango_base = File.join(ruby_gnome2_base, "pango")
25
+ gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2")
26
+ cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
27
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
28
+ gio2_base = File.join(ruby_gnome2_base, "gio2")
29
+ gdk3_base = File.join(ruby_gnome2_base, "gdk3")
30
+ gtk3_base = File.join(ruby_gnome2_base, "gtk3")
31
+ vte3_base = File.join(ruby_gnome2_base, "vte3")
32
+
33
+ modules = [
34
+ [glib_base, "glib2"],
35
+ [atk_base, "atk"],
36
+ [pango_base, "pango"],
37
+ [cairo_gobject_base, "cairo-gobject"],
38
+ [gdk_pixbuf_base, "gdk_pixbuf2"],
39
+ [gobject_introspection_base, "gobject-introspection"],
40
+ [gio2_base, "gio2"],
41
+ [gdk3_base, "gdk3"],
42
+ [gtk3_base, "gtk3"],
43
+ [vte3_base, "vte3"],
44
+ ]
45
+
46
+ modules.each do |target, module_name|
47
+ makefile = File.join(target, "Makefile")
48
+ if File.exist?(makefile) and system("which make > /dev/null")
49
+ `make -C #{target.dump} > /dev/null` or exit(false)
50
+ end
51
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
52
+ $LOAD_PATH.unshift(File.join(target, "lib"))
53
+ end
54
+
55
+ $LOAD_PATH.unshift(File.join(glib_base, "test"))
56
+ require "glib-test-init"
57
+
58
+ $LOAD_PATH.unshift(File.join(vte3_base, "test"))
59
+ require "vte3-test-utils"
60
+
61
+ require "vte3"
62
+
63
+ exit Test::Unit::AutoRunner.run(true)