gtksourceview3 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +29 -0
- data/Rakefile +16 -0
- data/ext/gtksourceview3/depend +6 -0
- data/ext/gtksourceview3/extconf.rb +76 -0
- data/ext/gtksourceview3/gtksourceview3.def +2 -0
- data/ext/gtksourceview3/rbgtksource.c +53 -0
- data/ext/gtksourceview3/rbgtksourcebuffer.c +318 -0
- data/ext/gtksourceview3/rbgtksourcegutter.c +82 -0
- data/ext/gtksourceview3/rbgtksourcegutterrenderer.c +143 -0
- data/ext/gtksourceview3/rbgtksourcegutterrendererpixbuf.c +42 -0
- data/ext/gtksourceview3/rbgtksourcegutterrenderertext.c +64 -0
- data/ext/gtksourceview3/rbgtksourcelanguage.c +124 -0
- data/ext/gtksourceview3/rbgtksourcelanguagemanager.c +114 -0
- data/ext/gtksourceview3/rbgtksourcemark.c +85 -0
- data/ext/gtksourceview3/rbgtksourcemarkattributes.c +77 -0
- data/ext/gtksourceview3/rbgtksourceprintcompositor.c +171 -0
- data/ext/gtksourceview3/rbgtksourcestyle.c +42 -0
- data/ext/gtksourceview3/rbgtksourcestylescheme.c +72 -0
- data/ext/gtksourceview3/rbgtksourcestyleschememanager.c +140 -0
- data/ext/gtksourceview3/rbgtksourceundomanager.c +83 -0
- data/ext/gtksourceview3/rbgtksourceview.c +94 -0
- data/ext/gtksourceview3/rbgtksourceview3conversions.h +43 -0
- data/ext/gtksourceview3/rbgtksourceview3private.h +54 -0
- data/extconf.rb +49 -0
- data/lib/gtksourceview3/deprecated.rb +47 -0
- data/lib/gtksourceview3.rb +20 -0
- data/sample/sourcelanguagemanager.rb +21 -0
- data/sample/test.rb +32 -0
- data/test/run-test.rb +33 -0
- data/test/test_source_view.rb +17 -0
- metadata +111 -0
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 = "gtksourceview3"
|
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,47 @@
|
|
1
|
+
module Gtk
|
2
|
+
extend GLib::Deprecatable
|
3
|
+
define_deprecated_const :SourceBuffer, 'GtkSource::Buffer'
|
4
|
+
define_deprecated_const :SourceLanguage, 'GtkSource::Language'
|
5
|
+
define_deprecated_const :SourceLanguageManager, 'GtkSource::LanguageManager'
|
6
|
+
define_deprecated_const :SourceMark, 'GtkSource::Mark'
|
7
|
+
define_deprecated_const :SourcePrintCompositor, 'GtkSource::PrintCompositor'
|
8
|
+
define_deprecated_const :SourceStyle, 'GtkSource::Style'
|
9
|
+
define_deprecated_const :SourceStyleScheme, 'GtkSource::StyleScheme'
|
10
|
+
define_deprecated_const :SourceStyleSchemeManager, 'GtkSource::StyleSchemeManager'
|
11
|
+
define_deprecated_const :SourceView, 'GtkSource::View'
|
12
|
+
end
|
13
|
+
|
14
|
+
module GtkSource
|
15
|
+
class Buffer
|
16
|
+
extend GLib::Deprecatable
|
17
|
+
define_deprecated_method :not_undoable_action, :begin_not_undoable_action
|
18
|
+
define_deprecated_method :non_undoable_action, :begin_not_undoable_action
|
19
|
+
end
|
20
|
+
|
21
|
+
class View
|
22
|
+
extend GLib::Deprecatable
|
23
|
+
define_deprecated_flags :DrawSpacesFlags, 'DRAW_SPACES'
|
24
|
+
define_deprecated_enums :SmartHomeEndType, 'SMART_HOME_END'
|
25
|
+
define_deprecated_const :BUILD_VERSION, 'GtkSource::BUILD_VERSION'
|
26
|
+
define_deprecated_method :set_mark_category_background, :warn => "Use 'GtkSource::MarkAttributes#set_background'." do |_self, category, background|
|
27
|
+
_self.get_mark_attributes(category).first.set_background(background) # TODO
|
28
|
+
end
|
29
|
+
define_deprecated_method :get_mark_category_background, :warn => "Use 'GtkSource::MarkAttributes#background'." do |_self, category|
|
30
|
+
_self.get_mark_attributes(category).first.background # TODO
|
31
|
+
end
|
32
|
+
define_deprecated_method :set_mark_category_pixbuf, :warn => "Use 'GtkSource::MarkAttributes#set_pixbuf'." do |_self, category, pixbuf|
|
33
|
+
_self.get_mark_attributes(category).first.set_pixbuf(pixbuf) # TODO
|
34
|
+
end
|
35
|
+
define_deprecated_method :get_mark_category_pixbuf, :warn => "Use 'GtkSource::MarkAttributes#pixbuf'." do |_self, category|
|
36
|
+
_self.get_mark_attributes(category).first.pixbuf # TODO
|
37
|
+
end
|
38
|
+
define_deprecated_method :set_mark_category_priority, :warn => "Use '#{self}#set_mark_attributes'." do |_self, category, priority|
|
39
|
+
attributes = _self.get_mark_attributes(category).first # TODO
|
40
|
+
_self.set_mark_attributes(category, attributes, priority)
|
41
|
+
end
|
42
|
+
define_deprecated_method :get_mark_category_priority, :warn => "Use '#{self}#get_mark_attributes'." do |_self, category|
|
43
|
+
_self.get_mark_attributes(category).last # TODO
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2008-2011 Ruby-GNOME2 Project Team
|
3
|
+
This program is licensed under the same licence as Ruby-GNOME2.
|
4
|
+
=end
|
5
|
+
|
6
|
+
require 'gtk3'
|
7
|
+
|
8
|
+
base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
|
9
|
+
vendor_dir = base_dir + "vendor" + "local"
|
10
|
+
vendor_bin_dir = vendor_dir + "bin"
|
11
|
+
GLib.prepend_environment_path(vendor_bin_dir)
|
12
|
+
begin
|
13
|
+
major, minor, micro, = RUBY_VERSION.split(/\./)
|
14
|
+
require "#{major}.#{minor}/gtksourceview3.so"
|
15
|
+
rescue LoadError
|
16
|
+
require "gtksourceview3.so"
|
17
|
+
end
|
18
|
+
|
19
|
+
require 'gtksourceview3/deprecated'
|
20
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
sourcelanguagesmanager.rb - Ruby/GtkSourceView 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: sourcelanguagesmanager.rb,v 1.3 2007/06/03 02:11:07 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtksourceview3'
|
12
|
+
|
13
|
+
s = Gtk::SourceLanguageManager.new
|
14
|
+
s.language_ids.each do |v|
|
15
|
+
puts v
|
16
|
+
end
|
17
|
+
s.search_path.each do |v|
|
18
|
+
puts v
|
19
|
+
end
|
20
|
+
puts s.get_language("html").name
|
21
|
+
|
data/sample/test.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
test.rb - Ruby/GtkSourceView2 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: test.rb,v 1.4 2007/06/03 02:11:07 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtksourceview3'
|
12
|
+
|
13
|
+
w = Gtk::Window.new
|
14
|
+
w.signal_connect("delete-event"){Gtk::main_quit}
|
15
|
+
|
16
|
+
view = Gtk::SourceView.new
|
17
|
+
w.add(Gtk::ScrolledWindow.new.add(view))
|
18
|
+
view.show_line_numbers = true
|
19
|
+
view.insert_spaces_instead_of_tabs = true
|
20
|
+
view.indent_width = 4
|
21
|
+
view.show_right_margin = true
|
22
|
+
view.right_margin_position = 80
|
23
|
+
|
24
|
+
lang = Gtk::SourceLanguageManager.new.get_language('ruby')
|
25
|
+
view.buffer.language = lang
|
26
|
+
view.buffer.highlight_syntax = true
|
27
|
+
view.buffer.highlight_matching_brackets = true
|
28
|
+
|
29
|
+
w.set_default_size(450,300)
|
30
|
+
w.show_all
|
31
|
+
|
32
|
+
Gtk.main
|
data/test/run-test.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
|
4
|
+
ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
|
5
|
+
|
6
|
+
glib_base = File.join(ruby_gnome2_base, "glib2")
|
7
|
+
atk_base = File.join(ruby_gnome2_base, "atk")
|
8
|
+
pango_base = File.join(ruby_gnome2_base, "pango")
|
9
|
+
gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2")
|
10
|
+
gtk_base = File.join(ruby_gnome2_base, "gtk2")
|
11
|
+
gtk_source_view2_base = File.join(ruby_gnome2_base, "gtksourceview2")
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(glib_base)
|
14
|
+
require 'test/glib-test-init'
|
15
|
+
|
16
|
+
[glib_base, atk_base, pango_base, gdk_pixbuf_base, gtk_base,
|
17
|
+
gtk_source_view2_base].each do |target|
|
18
|
+
if system("which make > /dev/null")
|
19
|
+
`make -C #{target.dump} > /dev/null` or exit(1)
|
20
|
+
end
|
21
|
+
$LOAD_PATH.unshift(File.join(target, "ext", File.basename(target)))
|
22
|
+
$LOAD_PATH.unshift(File.join(target, "src"))
|
23
|
+
$LOAD_PATH.unshift(File.join(target, "src", "lib"))
|
24
|
+
$LOAD_PATH.unshift(File.join(target))
|
25
|
+
$LOAD_PATH.unshift(File.join(target, "lib"))
|
26
|
+
end
|
27
|
+
|
28
|
+
$LOAD_PATH.unshift(File.join(gtk_base, "test"))
|
29
|
+
require 'gtk-test-utils'
|
30
|
+
|
31
|
+
require 'gtksourceview2'
|
32
|
+
|
33
|
+
exit Test::Unit::AutoRunner.run(true)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
class TestSourceView < Test::Unit::TestCase
|
4
|
+
def test_mark_category_background
|
5
|
+
view = Gtk::SourceView.new
|
6
|
+
|
7
|
+
red_rgb = [65535, 0, 0]
|
8
|
+
red_color = Gdk::Color.parse("red")
|
9
|
+
assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a)
|
10
|
+
|
11
|
+
view.set_mark_category_background("XXX", red_color)
|
12
|
+
assert_equal(red_rgb, view.get_mark_category_background("XXX").to_a)
|
13
|
+
|
14
|
+
view.set_mark_category_background("XXX", nil)
|
15
|
+
assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a)
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gtksourceview3
|
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/GtkSourceView3 is a Ruby binding of gtksourceview-3.x.
|
37
|
+
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions:
|
41
|
+
- ext/gtksourceview3/extconf.rb
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- README
|
46
|
+
- Rakefile
|
47
|
+
- extconf.rb
|
48
|
+
- lib/gtksourceview3/deprecated.rb
|
49
|
+
- lib/gtksourceview3.rb
|
50
|
+
- ext/gtksourceview3/rbgtksourcegutterrendererpixbuf.c
|
51
|
+
- ext/gtksourceview3/rbgtksourceprintcompositor.c
|
52
|
+
- ext/gtksourceview3/rbgtksourceundomanager.c
|
53
|
+
- ext/gtksourceview3/rbgtksourcestyle.c
|
54
|
+
- ext/gtksourceview3/gtksourceview3.def
|
55
|
+
- ext/gtksourceview3/rbgtksourcemark.c
|
56
|
+
- ext/gtksourceview3/rbgtksourcegutterrenderer.c
|
57
|
+
- ext/gtksourceview3/rbgtksourceview3conversions.h
|
58
|
+
- ext/gtksourceview3/rbgtksourceview.c
|
59
|
+
- ext/gtksourceview3/rbgtksourcegutterrenderertext.c
|
60
|
+
- ext/gtksourceview3/extconf.rb
|
61
|
+
- ext/gtksourceview3/rbgtksourcelanguage.c
|
62
|
+
- ext/gtksourceview3/rbgtksourcestylescheme.c
|
63
|
+
- ext/gtksourceview3/rbgtksourcelanguagemanager.c
|
64
|
+
- ext/gtksourceview3/rbgtksource.c
|
65
|
+
- ext/gtksourceview3/rbgtksourcemarkattributes.c
|
66
|
+
- ext/gtksourceview3/rbgtksourcestyleschememanager.c
|
67
|
+
- ext/gtksourceview3/rbgtksourcegutter.c
|
68
|
+
- ext/gtksourceview3/depend
|
69
|
+
- ext/gtksourceview3/rbgtksourcebuffer.c
|
70
|
+
- ext/gtksourceview3/rbgtksourceview3private.h
|
71
|
+
- sample/sourcelanguagemanager.rb
|
72
|
+
- sample/test.rb
|
73
|
+
- test/test_source_view.rb
|
74
|
+
- test/run-test.rb
|
75
|
+
homepage: http://ruby-gnome2.sourceforge.jp/
|
76
|
+
licenses: []
|
77
|
+
|
78
|
+
post_install_message: This library is experimental.
|
79
|
+
rdoc_options: []
|
80
|
+
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 55
|
89
|
+
segments:
|
90
|
+
- 1
|
91
|
+
- 9
|
92
|
+
- 2
|
93
|
+
version: 1.9.2
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
103
|
+
requirements: []
|
104
|
+
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 1.8.24
|
107
|
+
signing_key:
|
108
|
+
specification_version: 3
|
109
|
+
summary: Ruby/GtkSourceView3 is a Ruby binding of gtksourceview-3.x.
|
110
|
+
test_files: []
|
111
|
+
|