gtksourceview2 0.90.6

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.
Files changed (40) hide show
  1. data/ChangeLog +57 -0
  2. data/README +29 -0
  3. data/Rakefile +14 -0
  4. data/ext/gtksourceview2/Makefile +162 -0
  5. data/ext/gtksourceview2/depend +5 -0
  6. data/ext/gtksourceview2/extconf.rb +73 -0
  7. data/ext/gtksourceview2/gtksourceview2.def +2 -0
  8. data/ext/gtksourceview2/gtksourceview2.so +0 -0
  9. data/ext/gtksourceview2/rbgtksourcebuffer.c +401 -0
  10. data/ext/gtksourceview2/rbgtksourcebuffer.o +0 -0
  11. data/ext/gtksourceview2/rbgtksourceiter.c +110 -0
  12. data/ext/gtksourceview2/rbgtksourceiter.o +0 -0
  13. data/ext/gtksourceview2/rbgtksourcelanguage.c +126 -0
  14. data/ext/gtksourceview2/rbgtksourcelanguage.o +0 -0
  15. data/ext/gtksourceview2/rbgtksourcelanguagemanager.c +188 -0
  16. data/ext/gtksourceview2/rbgtksourcelanguagemanager.o +0 -0
  17. data/ext/gtksourceview2/rbgtksourcemain.c +38 -0
  18. data/ext/gtksourceview2/rbgtksourcemain.h +32 -0
  19. data/ext/gtksourceview2/rbgtksourcemain.o +0 -0
  20. data/ext/gtksourceview2/rbgtksourcemark.c +90 -0
  21. data/ext/gtksourceview2/rbgtksourcemark.o +0 -0
  22. data/ext/gtksourceview2/rbgtksourceprintcompositor.c +249 -0
  23. data/ext/gtksourceview2/rbgtksourceprintcompositor.o +0 -0
  24. data/ext/gtksourceview2/rbgtksourcestyle.c +48 -0
  25. data/ext/gtksourceview2/rbgtksourcestyle.o +0 -0
  26. data/ext/gtksourceview2/rbgtksourcestylescheme.c +71 -0
  27. data/ext/gtksourceview2/rbgtksourcestylescheme.o +0 -0
  28. data/ext/gtksourceview2/rbgtksourcestyleschememanager.c +211 -0
  29. data/ext/gtksourceview2/rbgtksourcestyleschememanager.o +0 -0
  30. data/ext/gtksourceview2/rbgtksourceview.c +239 -0
  31. data/ext/gtksourceview2/rbgtksourceview.o +0 -0
  32. data/ext/gtksourceview2/rbgtksourceview2version.h +25 -0
  33. data/ext/gtksourceview2/ruby-gtksourceview2.pc +3 -0
  34. data/extconf.rb +49 -0
  35. data/lib/gtksourceview2.rb +2 -0
  36. data/sample/sourcelanguagemanager.rb +21 -0
  37. data/sample/test.rb +32 -0
  38. data/test/run-test.rb +33 -0
  39. data/test/test_source_view.rb +17 -0
  40. metadata +122 -0
data/ChangeLog ADDED
@@ -0,0 +1,57 @@
1
+ 2011-01-30 Kouhei Sutou <kou@cozmixng.org>
2
+
3
+ * ./: support gem build for Windows.
4
+
5
+ 2011-01-22 Masaaki Aoyagi
6
+
7
+ * src/lib/: -> lib/.
8
+
9
+ * src/: -> ext/gtksourceview2/.
10
+
11
+ * extconf.rb: -> ext/gtksourceview2/extconf.rb
12
+
13
+ * ext/gtksourceview2/extconf.rb: support directory structure change.
14
+
15
+ * extconf.rb: add.
16
+
17
+ * Rakefile: add.
18
+
19
+ 2010-09-28 Kouhei Sutou <kou@cozmixng.org>
20
+
21
+ * test/run-test.rb: fix path.
22
+
23
+ 2010-09-23 Kouhei Sutou <kou@cozmixng.org>
24
+
25
+ * extconf.rb: support Ruby/GLib2 directory structure change.
26
+
27
+ 2008-11-09 Kouhei Sutou <kou@cozmixng.org>
28
+
29
+ * src/rbgtksourcemain.h, src/rbgtksourceprintcompositor.c: remove
30
+ needless definitions.
31
+
32
+ 2008-11-01 Kouhei Sutou <kou@cozmixng.org>
33
+
34
+ * src/: use RARRAY_PTR() and RARRAY_LEN().
35
+
36
+ 2008-09-30 Kouhei Sutou <kou@cozmixng.org>
37
+
38
+ * src/rbgtksourceview.c: cleanup style.
39
+
40
+ * test/test_source_view.rb: add a test.
41
+
42
+ * test/run-test.rb: setup testing environment.
43
+
44
+ * src/rbgtksourceview.c, test/test_source_view.rb: fix
45
+ Gtk::SourceView#{get,set}_mark_category_background bugs.
46
+
47
+ 2008-09-21 yselkowitz
48
+
49
+ Wrap new features in 2.4.0.
50
+ * extconf.rb: Test for new functions in 2.4.
51
+ * src/rbgtksourceview.c: Add Gtk::SourceView#get_mark_category_background,
52
+ #set_mark_category_background, ::DRAW_SPACES_*.
53
+ * src/rbgtksourcelanguagemanager.c: Add Gtk::SourceLanguageManager#guess_language.
54
+
55
+ 2008-07-11 yselkowitz
56
+
57
+ Initial import of gtksourceview2.
data/README ADDED
@@ -0,0 +1,29 @@
1
+ Ruby/GtkSourceView2
2
+ ===================
3
+ Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x.
4
+
5
+ Requirements
6
+ ------------
7
+ Ruby: http://www.ruby-lang.org/
8
+ Ruby-GNOME2: http://ruby-gnome2.sourceforge.jp/
9
+ GtkSourceView: ftp://ftp.gnome.org/pub/GNOME/sources/gtksourceview
10
+
11
+ Install
12
+ -------
13
+ 0. install ruby 1.8.0 or newer, GtkSourceView 2.0.0 or newer, Ruby/GTK2.
14
+ 1. ruby extconf.rb
15
+ 2. make
16
+ 3. su
17
+ 4. make install
18
+
19
+ Copying
20
+ -------
21
+ Copyright (c) 2008 Ruby-GNOME2 Project Team
22
+
23
+ This program is free software.
24
+ You can distribute/modify this program under the terms of
25
+ the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
26
+
27
+ Project Website
28
+ ---------------
29
+ http://ruby-gnome2.sourceforge.jp/
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # -*- ruby -*-
2
+
3
+ require './../glib2/lib/gnome2-raketask'
4
+
5
+ package = GNOME2Package.new do |_package|
6
+ _package.summary = "Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x."
7
+ _package.description = "Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x."
8
+ _package.dependency.gem.runtime = ["gtk2"]
9
+ _package.win32.packages = ["gtksourceview"]
10
+ _package.win32.dependencies = ["libxml2"]
11
+ _package.post_install_message = "This library is experimental."
12
+ end
13
+ package.define_tasks
14
+
@@ -0,0 +1,162 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = /home/kou/work/ruby/ruby-gnome2/gtksourceview2/ext/gtksourceview2
7
+ topdir = /usr/lib/ruby/1.8/x86_64-linux
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ exec_prefix = $(prefix)
11
+ prefix = $(DESTDIR)/usr
12
+ sharedstatedir = $(prefix)/com
13
+ mandir = $(prefix)/share/man
14
+ psdir = $(docdir)
15
+ oldincludedir = $(DESTDIR)/usr/include
16
+ localedir = $(datarootdir)/locale
17
+ bindir = $(exec_prefix)/bin
18
+ libexecdir = $(prefix)/lib/ruby1.8
19
+ sitedir = $(DESTDIR)/usr/local/lib/site_ruby
20
+ htmldir = $(docdir)
21
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
22
+ includedir = $(prefix)/include
23
+ infodir = $(prefix)/share/info
24
+ vendorlibdir = $(vendordir)/$(ruby_version)
25
+ sysconfdir = $(DESTDIR)/etc
26
+ libdir = $(exec_prefix)/lib
27
+ sbindir = $(exec_prefix)/sbin
28
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
29
+ docdir = $(datarootdir)/doc/$(PACKAGE)
30
+ dvidir = $(docdir)
31
+ vendordir = $(libdir)/ruby/vendor_ruby
32
+ datarootdir = $(prefix)/share
33
+ pdfdir = $(docdir)
34
+ archdir = $(rubylibdir)/$(arch)
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ datadir = $(datarootdir)
37
+ localstatedir = $(DESTDIR)/var
38
+ sitelibdir = $(sitedir)/$(ruby_version)
39
+
40
+ CC = gcc
41
+ LIBRUBY = $(LIBRUBY_SO)
42
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
44
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
+
46
+ RUBY_EXTCONF_H =
47
+ CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags) -Wall -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -pthread
48
+ INCFLAGS = -I. -I/home/kou/work/ruby/ruby-gnome2/gtk2/ext/gtk2 -I/home/kou/work/ruby/ruby-gnome2/gtk2/ext/gtk2 -I/home/kou/work/ruby/ruby-gnome2/gtk2/ext/gtk2 -I/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2 -I/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2 -I/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2 -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/ruby-gnome2/gtksourceview2/ext/gtksourceview2
49
+ DEFS =
50
+ CPPFLAGS = -DHAVE_RB_DEFINE_ALLOC_FUNC -DHAVE_RB_BLOCK_PROC -DHAVE_OBJECT_ALLOCATE -DHAVE_NODE_ATTRASGN -DHAVE_GTK_SOURCE_MARK_GET_TYPE -DHAVE_GTK_SOURCE_PRINT_COMPOSITOR_GET_TYPE -DHAVE_GTK_SOURCE_VIEW_GET_MARK_CATEGORY_BACKGROUND -DHAVE_GTK_SOURCE_LANGUAGE_MANAGER_GUESS_LANGUAGE -DRUBY_GTKSOURCEVIEW2_COMPILATION
51
+ CXXFLAGS = $(CFLAGS)
52
+ ldflags = -L. -rdynamic -Wl,-export-dynamic -pthread
53
+ dldflags =
54
+ archflag =
55
+ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
+ LDSHARED = $(CC) -shared
57
+ AR = ar
58
+ EXEEXT =
59
+
60
+ RUBY_INSTALL_NAME = ruby1.8
61
+ RUBY_SO_NAME = ruby1.8
62
+ arch = x86_64-linux
63
+ sitearch = x86_64-linux
64
+ ruby_version = 1.8
65
+ ruby = /usr/bin/ruby1.8
66
+ RUBY = $(ruby)
67
+ RM = rm -f
68
+ MAKEDIRS = mkdir -p
69
+ INSTALL = /usr/bin/install -c
70
+ INSTALL_PROG = $(INSTALL) -m 0755
71
+ INSTALL_DATA = $(INSTALL) -m 644
72
+ COPY = cp
73
+
74
+ #### End of system configuration section. ####
75
+
76
+ preload =
77
+
78
+ libpath = . $(libdir)
79
+ LIBPATH = -L. -L$(libdir)
80
+ DEFFILE =
81
+
82
+ CLEANFILES = mkmf.log
83
+ DISTCLEANFILES = rbgtksourceview2version.h
84
+
85
+ extout =
86
+ extout_prefix =
87
+ target_prefix =
88
+ LOCAL_LIBS =
89
+ LIBS = $(LIBRUBYARG_SHARED) -lgtksourceview-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lrt -lgmodule-2.0 -lpango-1.0 -lpangocairo-1.0 -lcairo -lgio-2.0 -latk-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpthread -lrt -ldl -lcrypt -lm -lc
90
+ SRCS = rbgtksourceprintcompositor.c rbgtksourcestyle.c rbgtksourcemain.c rbgtksourcemark.c rbgtksourceview.c rbgtksourcelanguage.c rbgtksourcestylescheme.c rbgtksourcelanguagemanager.c rbgtksourceiter.c rbgtksourcestyleschememanager.c rbgtksourcebuffer.c
91
+ OBJS = rbgtksourceprintcompositor.o rbgtksourcestyle.o rbgtksourcemain.o rbgtksourcemark.o rbgtksourceview.o rbgtksourcelanguage.o rbgtksourcestylescheme.o rbgtksourcelanguagemanager.o rbgtksourceiter.o rbgtksourcestyleschememanager.o rbgtksourcebuffer.o
92
+ TARGET = gtksourceview2
93
+ DLLIB = $(TARGET).so
94
+ EXTSTATIC =
95
+ STATIC_LIB =
96
+
97
+ BINDIR = $(bindir)
98
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
99
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
100
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
101
+
102
+ TARGET_SO = $(DLLIB)
103
+ CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
104
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
105
+
106
+ all: $(DLLIB)
107
+ static: $(STATIC_LIB)
108
+
109
+ clean:
110
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
111
+
112
+ distclean: clean
113
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
114
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
115
+
116
+ realclean: distclean
117
+ install: install-so install-rb
118
+
119
+ install-so: $(RUBYARCHDIR)
120
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
121
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
122
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
123
+ install-rb: pre-install-rb install-rb-default
124
+ install-rb-default: pre-install-rb-default
125
+ pre-install-rb: Makefile
126
+ pre-install-rb-default: Makefile
127
+ $(RUBYARCHDIR):
128
+ $(MAKEDIRS) $@
129
+
130
+ site-install: site-install-so site-install-rb
131
+ site-install-so: install-so
132
+ site-install-rb: install-rb
133
+
134
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
135
+
136
+ .cc.o:
137
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
138
+
139
+ .cxx.o:
140
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
141
+
142
+ .cpp.o:
143
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
144
+
145
+ .C.o:
146
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
147
+
148
+ .c.o:
149
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
150
+
151
+ $(DLLIB): $(OBJS) Makefile
152
+ @-$(RM) $@
153
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
154
+
155
+
156
+
157
+ ###
158
+ install:
159
+ if test -n "$(pkgconfigdir)"; then \
160
+ $(MAKEDIRS) $(pkgconfigdir); \
161
+ $(INSTALL_DATA) ../ruby-gtksourceview2.pc $(pkgconfigdir); \
162
+ fi
@@ -0,0 +1,5 @@
1
+ install:
2
+ if test -n "$(pkgconfigdir)"; then \
3
+ $(MAKEDIRS) $(pkgconfigdir); \
4
+ $(INSTALL_DATA) ../ruby-gtksourceview2.pc $(pkgconfigdir); \
5
+ fi
@@ -0,0 +1,73 @@
1
+ =begin
2
+ extconf.rb for Ruby/GtkSourceView2 extension library
3
+ =end
4
+
5
+ require 'pathname'
6
+
7
+ base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ top_dir = base_dir.parent
9
+ top_build_dir = Pathname(".").parent.parent.parent.expand_path
10
+
11
+ mkmf_gnome2_dir = top_dir + "glib2" + 'lib'
12
+ version_suffix = ""
13
+ unless mkmf_gnome2_dir.exist?
14
+ if /(-\d+\.\d+\.\d+)\z/ =~ base_dir.basename.to_s
15
+ version_suffix = $1
16
+ mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib'
17
+ end
18
+ end
19
+
20
+ $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
21
+
22
+ module_name = "gtksourceview2"
23
+ package_id = "gtksourceview-2.0"
24
+
25
+ require 'mkmf-gnome2'
26
+
27
+ ["glib2", "atk", "pango", "gdk_pixbuf2", "gtk2"].each do |package|
28
+ directory = "#{package}#{version_suffix}"
29
+ build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
30
+ add_depend_package(package, "#{directory}/ext/#{package}",
31
+ top_dir.to_s,
32
+ :top_build_dir => top_build_dir.to_s,
33
+ :target_build_dir => build_dir)
34
+ end
35
+
36
+ rcairo_options = {}
37
+ rcairo_source_dir_names = ["rcairo"]
38
+ if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
39
+ rcairo_source_dir_names.unshift("rcairo.win32")
40
+ end
41
+ rcairo_source_dir_names.each do |rcairo_source_dir_name|
42
+ rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name
43
+ if rcairo_source_dir.exist?
44
+ rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s
45
+ break
46
+ end
47
+ end
48
+ check_cairo(rcairo_options)
49
+
50
+ setup_win32(module_name, base_dir)
51
+
52
+ PKGConfig.have_package(package_id) or exit(false)
53
+
54
+ # 2.2
55
+ have_func('gtk_source_mark_get_type', "gtksourceview/gtksourcemark.h")
56
+ have_func('gtk_source_print_compositor_get_type', "gtksourceview/gtksourceprintcompositor.h")
57
+ # 2.4
58
+ have_func('gtk_source_view_get_mark_category_background', "gtksourceview/gtksourceview.h")
59
+ have_func('gtk_source_language_manager_guess_language', "gtksourceview/gtksourcelanguagemanager.h")
60
+
61
+ make_version_header("GTKSOURCEVIEW2", package_id, ".")
62
+
63
+ create_pkg_config_file("Ruby/GtkSourceView2", package_id)
64
+ $defs << "-DRUBY_GTKSOURCEVIEW2_COMPILATION"
65
+ create_makefile(module_name)
66
+ pkg_config_dir = with_config("pkg-config-dir")
67
+ if pkg_config_dir.is_a?(String)
68
+ File.open("Makefile", "ab") do |makefile|
69
+ makefile.puts
70
+ makefile.puts("pkgconfigdir=#{pkg_config_dir}")
71
+ end
72
+ end
73
+
@@ -0,0 +1,2 @@
1
+ EXPORTS
2
+ Init_gtksourceview2