gsf 3.0.9-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +55 -0
  3. data/lib/gsf/input.rb +26 -0
  4. data/lib/gsf/loader.rb +57 -0
  5. data/lib/gsf.rb +53 -0
  6. data/test/gsf-test-utils.rb +22 -0
  7. data/test/run-test.rb +46 -0
  8. data/test/test-input-stdio.rb +25 -0
  9. data/vendor/local/bin/gsf-office-thumbnailer.exe +0 -0
  10. data/vendor/local/bin/gsf-vba-dump.exe +0 -0
  11. data/vendor/local/bin/gsf.exe +0 -0
  12. data/vendor/local/bin/libgsf-1-114.dll +0 -0
  13. data/vendor/local/bin/libgsf-win32-1-114.dll +0 -0
  14. data/vendor/local/include/libgsf-1/gsf/gsf-blob.h +39 -0
  15. data/vendor/local/include/libgsf-1/gsf/gsf-clip-data.h +72 -0
  16. data/vendor/local/include/libgsf-1/gsf/gsf-doc-meta-data.h +66 -0
  17. data/vendor/local/include/libgsf-1/gsf/gsf-docprop-vector.h +47 -0
  18. data/vendor/local/include/libgsf-1/gsf/gsf-fwd.h +121 -0
  19. data/vendor/local/include/libgsf-1/gsf/gsf-impl-utils.h +156 -0
  20. data/vendor/local/include/libgsf-1/gsf/gsf-infile-impl.h +50 -0
  21. data/vendor/local/include/libgsf-1/gsf/gsf-infile-msole.h +45 -0
  22. data/vendor/local/include/libgsf-1/gsf/gsf-infile-msvba.h +49 -0
  23. data/vendor/local/include/libgsf-1/gsf/gsf-infile-stdio.h +43 -0
  24. data/vendor/local/include/libgsf-1/gsf/gsf-infile-tar.h +40 -0
  25. data/vendor/local/include/libgsf-1/gsf/gsf-infile-zip.h +43 -0
  26. data/vendor/local/include/libgsf-1/gsf/gsf-infile.h +46 -0
  27. data/vendor/local/include/libgsf-1/gsf/gsf-input-bzip.h +34 -0
  28. data/vendor/local/include/libgsf-1/gsf/gsf-input-gio.h +44 -0
  29. data/vendor/local/include/libgsf-1/gsf/gsf-input-gzip.h +43 -0
  30. data/vendor/local/include/libgsf-1/gsf/gsf-input-http.h +45 -0
  31. data/vendor/local/include/libgsf-1/gsf/gsf-input-impl.h +68 -0
  32. data/vendor/local/include/libgsf-1/gsf/gsf-input-iochannel.h +35 -0
  33. data/vendor/local/include/libgsf-1/gsf/gsf-input-memory.h +46 -0
  34. data/vendor/local/include/libgsf-1/gsf/gsf-input-proxy.h +46 -0
  35. data/vendor/local/include/libgsf-1/gsf/gsf-input-stdio.h +48 -0
  36. data/vendor/local/include/libgsf-1/gsf/gsf-input-textline.h +46 -0
  37. data/vendor/local/include/libgsf-1/gsf/gsf-input.h +69 -0
  38. data/vendor/local/include/libgsf-1/gsf/gsf-libxml.h +225 -0
  39. data/vendor/local/include/libgsf-1/gsf/gsf-meta-names.h +482 -0
  40. data/vendor/local/include/libgsf-1/gsf/gsf-msole-utils.h +70 -0
  41. data/vendor/local/include/libgsf-1/gsf/gsf-open-pkg-utils.h +95 -0
  42. data/vendor/local/include/libgsf-1/gsf/gsf-opendoc-utils.h +162 -0
  43. data/vendor/local/include/libgsf-1/gsf/gsf-outfile-impl.h +46 -0
  44. data/vendor/local/include/libgsf-1/gsf/gsf-outfile-msole.h +47 -0
  45. data/vendor/local/include/libgsf-1/gsf/gsf-outfile-stdio.h +49 -0
  46. data/vendor/local/include/libgsf-1/gsf/gsf-outfile-zip.h +61 -0
  47. data/vendor/local/include/libgsf-1/gsf/gsf-outfile.h +49 -0
  48. data/vendor/local/include/libgsf-1/gsf/gsf-output-bzip.h +43 -0
  49. data/vendor/local/include/libgsf-1/gsf/gsf-output-csv.h +84 -0
  50. data/vendor/local/include/libgsf-1/gsf/gsf-output-gio.h +44 -0
  51. data/vendor/local/include/libgsf-1/gsf/gsf-output-gzip.h +43 -0
  52. data/vendor/local/include/libgsf-1/gsf/gsf-output-iconv.h +47 -0
  53. data/vendor/local/include/libgsf-1/gsf/gsf-output-impl.h +37 -0
  54. data/vendor/local/include/libgsf-1/gsf/gsf-output-iochannel.h +43 -0
  55. data/vendor/local/include/libgsf-1/gsf/gsf-output-memory.h +44 -0
  56. data/vendor/local/include/libgsf-1/gsf/gsf-output-stdio.h +52 -0
  57. data/vendor/local/include/libgsf-1/gsf/gsf-output.h +99 -0
  58. data/vendor/local/include/libgsf-1/gsf/gsf-shared-memory.h +51 -0
  59. data/vendor/local/include/libgsf-1/gsf/gsf-structured-blob.h +45 -0
  60. data/vendor/local/include/libgsf-1/gsf/gsf-timestamp.h +70 -0
  61. data/vendor/local/include/libgsf-1/gsf/gsf-utils.h +340 -0
  62. data/vendor/local/include/libgsf-1/gsf/gsf.h +98 -0
  63. data/vendor/local/include/libgsf-1/gsf-win32/gsf-input-win32.h +41 -0
  64. data/vendor/local/include/libgsf-1/gsf-win32/gsf-output-win32.h +41 -0
  65. data/vendor/local/lib/libgsf-1.a +0 -0
  66. data/vendor/local/lib/libgsf-1.dll.a +0 -0
  67. data/vendor/local/lib/libgsf-1.la +41 -0
  68. data/vendor/local/lib/libgsf-win32-1.a +0 -0
  69. data/vendor/local/lib/libgsf-win32-1.dll.a +0 -0
  70. data/vendor/local/lib/libgsf-win32-1.la +41 -0
  71. data/vendor/local/lib/pkgconfig/libgsf-1.pc +11 -0
  72. data/vendor/local/lib/pkgconfig/libgsf-win32-1.pc +11 -0
  73. data/vendor/local/share/gtk-doc/html/gsf/annotation-glossary.html +56 -0
  74. data/vendor/local/share/gtk-doc/html/gsf/api.html +107 -0
  75. data/vendor/local/share/gtk-doc/html/gsf/dependencies.html +109 -0
  76. data/vendor/local/share/gtk-doc/html/gsf/gsf-Compression.html +369 -0
  77. data/vendor/local/share/gtk-doc/html/gsf/gsf-GIO.html +307 -0
  78. data/vendor/local/share/gtk-doc/html/gsf/gsf-GIOChannel.html +119 -0
  79. data/vendor/local/share/gtk-doc/html/gsf/gsf-Infile-reading-structed-files.html +397 -0
  80. data/vendor/local/share/gtk-doc/html/gsf/gsf-Input-from-unstructured-files.html +887 -0
  81. data/vendor/local/share/gtk-doc/html/gsf/gsf-MS-OLE2.html +894 -0
  82. data/vendor/local/share/gtk-doc/html/gsf/gsf-OASIS-Open-Document.html +398 -0
  83. data/vendor/local/share/gtk-doc/html/gsf/gsf-Outfile-writing-structed-files.html +237 -0
  84. data/vendor/local/share/gtk-doc/html/gsf/gsf-Output-to-unstructured-files.html +830 -0
  85. data/vendor/local/share/gtk-doc/html/gsf/gsf-Reading-and-Writing-from-local-files-and-directories.html +593 -0
  86. data/vendor/local/share/gtk-doc/html/gsf/gsf-Text.html +523 -0
  87. data/vendor/local/share/gtk-doc/html/gsf/gsf-XML-and-libxml.html +2032 -0
  88. data/vendor/local/share/gtk-doc/html/gsf/gsf-Zip.html +338 -0
  89. data/vendor/local/share/gtk-doc/html/gsf/gsf-blobs.html +56 -0
  90. data/vendor/local/share/gtk-doc/html/gsf/gsf-clip-data.html +444 -0
  91. data/vendor/local/share/gtk-doc/html/gsf/gsf-index.html +875 -0
  92. data/vendor/local/share/gtk-doc/html/gsf/gsf-memory.html +332 -0
  93. data/vendor/local/share/gtk-doc/html/gsf/gsf-metadata.html +1762 -0
  94. data/vendor/local/share/gtk-doc/html/gsf/gsf-users.html +73 -0
  95. data/vendor/local/share/gtk-doc/html/gsf/gsf-utils.html +2503 -0
  96. data/vendor/local/share/gtk-doc/html/gsf/gsf.devhelp2 +440 -0
  97. data/vendor/local/share/gtk-doc/html/gsf/history.html +45 -0
  98. data/vendor/local/share/gtk-doc/html/gsf/home.png +0 -0
  99. data/vendor/local/share/gtk-doc/html/gsf/index.html +98 -0
  100. data/vendor/local/share/gtk-doc/html/gsf/index.sgml +572 -0
  101. data/vendor/local/share/gtk-doc/html/gsf/intro.html +39 -0
  102. data/vendor/local/share/gtk-doc/html/gsf/io.html +38 -0
  103. data/vendor/local/share/gtk-doc/html/gsf/left-insensitive.png +0 -0
  104. data/vendor/local/share/gtk-doc/html/gsf/left.png +0 -0
  105. data/vendor/local/share/gtk-doc/html/gsf/misc.html +33 -0
  106. data/vendor/local/share/gtk-doc/html/gsf/parsers.html +59 -0
  107. data/vendor/local/share/gtk-doc/html/gsf/right-insensitive.png +0 -0
  108. data/vendor/local/share/gtk-doc/html/gsf/right.png +0 -0
  109. data/vendor/local/share/gtk-doc/html/gsf/sources.html +50 -0
  110. data/vendor/local/share/gtk-doc/html/gsf/style.css +461 -0
  111. data/vendor/local/share/gtk-doc/html/gsf/up-insensitive.png +0 -0
  112. data/vendor/local/share/gtk-doc/html/gsf/up.png +0 -0
  113. data/vendor/local/share/license/libgsf/AUTHORS +3 -0
  114. data/vendor/local/share/license/libgsf/COPYING +340 -0
  115. data/vendor/local/share/license/libgsf/COPYING.LIB +504 -0
  116. data/vendor/local/share/locale/as/LC_MESSAGES/libgsf.mo +0 -0
  117. data/vendor/local/share/locale/bs/LC_MESSAGES/libgsf.mo +0 -0
  118. data/vendor/local/share/locale/ca/LC_MESSAGES/libgsf.mo +0 -0
  119. data/vendor/local/share/locale/ca@valencia/LC_MESSAGES/libgsf.mo +0 -0
  120. data/vendor/local/share/locale/cs/LC_MESSAGES/libgsf.mo +0 -0
  121. data/vendor/local/share/locale/da/LC_MESSAGES/libgsf.mo +0 -0
  122. data/vendor/local/share/locale/de/LC_MESSAGES/libgsf.mo +0 -0
  123. data/vendor/local/share/locale/el/LC_MESSAGES/libgsf.mo +0 -0
  124. data/vendor/local/share/locale/en_GB/LC_MESSAGES/libgsf.mo +0 -0
  125. data/vendor/local/share/locale/eo/LC_MESSAGES/libgsf.mo +0 -0
  126. data/vendor/local/share/locale/es/LC_MESSAGES/libgsf.mo +0 -0
  127. data/vendor/local/share/locale/eu/LC_MESSAGES/libgsf.mo +0 -0
  128. data/vendor/local/share/locale/fi/LC_MESSAGES/libgsf.mo +0 -0
  129. data/vendor/local/share/locale/fr/LC_MESSAGES/libgsf.mo +0 -0
  130. data/vendor/local/share/locale/gl/LC_MESSAGES/libgsf.mo +0 -0
  131. data/vendor/local/share/locale/he/LC_MESSAGES/libgsf.mo +0 -0
  132. data/vendor/local/share/locale/hu/LC_MESSAGES/libgsf.mo +0 -0
  133. data/vendor/local/share/locale/id/LC_MESSAGES/libgsf.mo +0 -0
  134. data/vendor/local/share/locale/it/LC_MESSAGES/libgsf.mo +0 -0
  135. data/vendor/local/share/locale/ja/LC_MESSAGES/libgsf.mo +0 -0
  136. data/vendor/local/share/locale/ko/LC_MESSAGES/libgsf.mo +0 -0
  137. data/vendor/local/share/locale/lt/LC_MESSAGES/libgsf.mo +0 -0
  138. data/vendor/local/share/locale/lv/LC_MESSAGES/libgsf.mo +0 -0
  139. data/vendor/local/share/locale/ml/LC_MESSAGES/libgsf.mo +0 -0
  140. data/vendor/local/share/locale/nb/LC_MESSAGES/libgsf.mo +0 -0
  141. data/vendor/local/share/locale/nn/LC_MESSAGES/libgsf.mo +0 -0
  142. data/vendor/local/share/locale/oc/LC_MESSAGES/libgsf.mo +0 -0
  143. data/vendor/local/share/locale/pa/LC_MESSAGES/libgsf.mo +0 -0
  144. data/vendor/local/share/locale/pl/LC_MESSAGES/libgsf.mo +0 -0
  145. data/vendor/local/share/locale/pt/LC_MESSAGES/libgsf.mo +0 -0
  146. data/vendor/local/share/locale/pt_BR/LC_MESSAGES/libgsf.mo +0 -0
  147. data/vendor/local/share/locale/ro/LC_MESSAGES/libgsf.mo +0 -0
  148. data/vendor/local/share/locale/ru/LC_MESSAGES/libgsf.mo +0 -0
  149. data/vendor/local/share/locale/sk/LC_MESSAGES/libgsf.mo +0 -0
  150. data/vendor/local/share/locale/sl/LC_MESSAGES/libgsf.mo +0 -0
  151. data/vendor/local/share/locale/sr/LC_MESSAGES/libgsf.mo +0 -0
  152. data/vendor/local/share/locale/sr@latin/LC_MESSAGES/libgsf.mo +0 -0
  153. data/vendor/local/share/locale/sv/LC_MESSAGES/libgsf.mo +0 -0
  154. data/vendor/local/share/locale/ta/LC_MESSAGES/libgsf.mo +0 -0
  155. data/vendor/local/share/locale/tg/LC_MESSAGES/libgsf.mo +0 -0
  156. data/vendor/local/share/locale/th/LC_MESSAGES/libgsf.mo +0 -0
  157. data/vendor/local/share/locale/tr/LC_MESSAGES/libgsf.mo +0 -0
  158. data/vendor/local/share/locale/uk/LC_MESSAGES/libgsf.mo +0 -0
  159. data/vendor/local/share/locale/zh_CN/LC_MESSAGES/libgsf.mo +0 -0
  160. data/vendor/local/share/locale/zh_HK/LC_MESSAGES/libgsf.mo +0 -0
  161. data/vendor/local/share/locale/zh_TW/LC_MESSAGES/libgsf.mo +0 -0
  162. data/vendor/local/share/man/man1/gsf-office-thumbnailer.1 +71 -0
  163. data/vendor/local/share/man/man1/gsf-vba-dump.1 +61 -0
  164. data/vendor/local/share/man/man1/gsf.1 +91 -0
  165. data/vendor/local/share/thumbnailers/gsf-office.thumbnailer +4 -0
  166. metadata +235 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 43d840ca6c3f88d77f6229f0d52e53f508022e5c
4
+ data.tar.gz: bd7641767ff94784647b3698af64c41ad84654ad
5
+ SHA512:
6
+ metadata.gz: 079ffa99c9018e77be0ec51b17636e2a4499158da53ccc1417dc3eee40e46d0df1df4d361f39c28580fe99e49fa2bc5b194c185863bbb1e028e63f8e995724b2
7
+ data.tar.gz: 515ceedad09f15b1e98d7dd119c7c4a344efd20285ee76cd6dc7104d432ad75fab1534b3477ab8ddaf32de2d01355601f93ed268f86f82c93b5eb1ef4d873e27
data/Rakefile ADDED
@@ -0,0 +1,55 @@
1
+ # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2016 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
+ $LOAD_PATH.unshift("./../glib2/lib")
20
+ require 'gnome2/rake/package-task'
21
+
22
+ package_task = GNOME2::Rake::PackageTask.new do |package|
23
+ package.summary = "Ruby/GSF is a Ruby binding of GSF."
24
+ package.description = "Ruby/GSF is a Ruby binding of GSF."
25
+ package.dependency.gem.runtime = ["gio2", "gobject-introspection"]
26
+ package.windows.packages = []
27
+ package.windows.dependencies = ["libxml2"]
28
+ package.windows.build_dependencies = [
29
+ "glib2",
30
+ "gio2",
31
+ "cairo-gobject",
32
+ "gobject-introspection",
33
+ ]
34
+ package.windows.gobject_introspection_dependencies = [
35
+ "gio2",
36
+ "cairo-gobject",
37
+ ]
38
+ package.external_packages = [
39
+ {
40
+ :name => "libgsf",
41
+ :download_site => :gnome,
42
+ :label => "gsf",
43
+ :version => "1.14.39",
44
+ :compression_method => "xz",
45
+ :windows => {
46
+ :configure_args => [
47
+ ],
48
+ :patches => [
49
+ ],
50
+ :built_file => "bin/libgsf-win32-1-114.dll",
51
+ },
52
+ },
53
+ ]
54
+ end
55
+ package_task.define
data/lib/gsf/input.rb ADDED
@@ -0,0 +1,26 @@
1
+ # Copyright (C) 2016 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 Gsf
18
+ class Input
19
+ alias_method :read_raw, :read
20
+ def read(size=nil)
21
+ size ||= remaining
22
+ bytes = read_raw(size)
23
+ bytes.pack("C*")
24
+ end
25
+ end
26
+ end
data/lib/gsf/loader.rb ADDED
@@ -0,0 +1,57 @@
1
+ # Copyright (C) 2016 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 Gsf
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 load_enum_value(value_info, enum_module)
31
+ # TODO: Add constant name rename feature to
32
+ # gobject-introspection and use it.
33
+ if value_info.name == "2nd"
34
+ enum_module.const_set("SECOND", value_info.value)
35
+ else
36
+ super
37
+ end
38
+ end
39
+
40
+ def pre_load(repository, namespace)
41
+ end
42
+
43
+ def post_load(repository, namespace)
44
+ require_libraries
45
+ end
46
+
47
+ def require_libraries
48
+ require "gsf/input"
49
+ end
50
+
51
+ def initialize_post(object)
52
+ super
53
+ return unless object.is_a?(GLib::Object)
54
+ self.class.reference_gobject(object, :sink => true)
55
+ end
56
+ end
57
+ end
data/lib/gsf.rb ADDED
@@ -0,0 +1,53 @@
1
+ # Copyright (C) 2016 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"
18
+ require "gio2"
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 "gsf/loader"
28
+
29
+ module Gsf
30
+ LOG_DOMAIN = "Gsf"
31
+ GLib::Log.set_log_domain(LOG_DOMAIN)
32
+
33
+ class << self
34
+ def const_missing(name)
35
+ init
36
+ if const_defined?(name)
37
+ const_get(name)
38
+ else
39
+ super
40
+ end
41
+ end
42
+
43
+ def init
44
+ class << self
45
+ remove_method(:init)
46
+ remove_method(:const_missing)
47
+ end
48
+ Gio.init if Gio.respond_to?(:init)
49
+ loader = Loader.new(self)
50
+ loader.load("Gsf")
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,22 @@
1
+ # Copyright (C) 2016 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 "tempfile"
18
+
19
+ require "test-unit"
20
+
21
+ module GsfTestUtils
22
+ end
data/test/run-test.rb ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2016 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
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
23
+ gio2_base = File.join(ruby_gnome2_base, "gio2")
24
+ gsf_base = File.join(ruby_gnome2_base, "gsf")
25
+
26
+ modules = [
27
+ [gobject_introspection_base, "gobject-introspection"],
28
+ [gio2_base, "gio2"],
29
+ [gsf_base, "gsf"]
30
+ ]
31
+
32
+ modules.each do |target, module_name|
33
+ makefile = File.join(target, "Makefile")
34
+ if File.exist?(makefile) and system("which make > /dev/null")
35
+ `make -C #{target.dump} > /dev/null` or exit(false)
36
+ end
37
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
38
+ $LOAD_PATH.unshift(File.join(target, "lib"))
39
+ end
40
+
41
+ $LOAD_PATH.unshift(File.join(gsf_base, "test"))
42
+ require "gsf-test-utils"
43
+
44
+ require "gsf"
45
+
46
+ exit Test::Unit::AutoRunner.run(true, File.join(gsf_base, "test"))
@@ -0,0 +1,25 @@
1
+ # Copyright (C) 2016 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
+ class InputStdioTest < Test::Unit::TestCase
18
+ test ".new" do
19
+ file = Tempfile.new("test-input-stdio")
20
+ file.write("hello")
21
+ file.close
22
+ input = Gsf::InputStdio.new(file.path)
23
+ assert_equal("hello", input.read)
24
+ end
25
+ end
Binary file
Binary file
Binary file
@@ -0,0 +1,39 @@
1
+ #ifndef GSF_BLOB_H
2
+ #define GSF_BLOB_H
3
+
4
+ #include <gsf/gsf-fwd.h>
5
+
6
+ G_BEGIN_DECLS
7
+
8
+ #define GSF_BLOB_TYPE (gsf_blob_get_type ())
9
+ #define GSF_BLOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSF_BLOB_TYPE, GsfBlob))
10
+ #define GSF_BLOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSF_BLOB_TYPE, GsfBlobClass))
11
+ #define GSF_IS_BLOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSF_BLOB_TYPE))
12
+ #define GSF_IS_BLOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSF_BLOB_TYPE))
13
+ #define GSF_BLOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSF_BLOB_TYPE, GsfBlobClass))
14
+
15
+ /* Deprecated old typo */
16
+ #define GSF_TYPE_BLOB (gsf_blob_get_type ())
17
+
18
+ typedef struct _GsfBlobClass GsfBlobClass;
19
+ typedef struct _GsfBlobPrivate GsfBlobPrivate;
20
+
21
+ struct _GsfBlob {
22
+ GObject object;
23
+ GsfBlobPrivate *priv;
24
+ };
25
+
26
+ GType gsf_blob_get_type (void) G_GNUC_CONST;
27
+ /* void gsf_blob_register_type (GTypeModule *module); glib dynamic types are not thread safe */
28
+
29
+ GsfBlob *gsf_blob_new (gsize size,
30
+ gconstpointer data_to_copy,
31
+ GError **error);
32
+
33
+ gsize gsf_blob_get_size (GsfBlob const *blob);
34
+
35
+ gconstpointer gsf_blob_peek_data (GsfBlob const *blob);
36
+
37
+ G_END_DECLS
38
+
39
+ #endif
@@ -0,0 +1,72 @@
1
+ #ifndef GSF_CLIP_DATA_H
2
+ #define GSF_CLIP_DATA_H
3
+
4
+ #include <gsf/gsf-fwd.h>
5
+
6
+ G_BEGIN_DECLS
7
+
8
+ /**
9
+ * GsfClipFormat:
10
+ * @GSF_CLIP_FORMAT_WINDOWS_CLIPBOARD: Windows clipboard format
11
+ * @GSF_CLIP_FORMAT_MACINTOSH_CLIPBOARD: Macintosh clipboard format
12
+ * @GSF_CLIP_FORMAT_GUID: GUID that contains a format identifier
13
+ * @GSF_CLIP_FORMAT_NO_DATA: No clipboard data
14
+ * @GSF_CLIP_FORMAT_CLIPBOARD_FORMAT_NAME: Custom clipboard format
15
+ * @GSF_CLIP_FORMAT_UNKNOWN: Unknown clipboard type or invalid data
16
+ */
17
+
18
+ typedef enum {
19
+ GSF_CLIP_FORMAT_WINDOWS_CLIPBOARD = -1,
20
+ GSF_CLIP_FORMAT_MACINTOSH_CLIPBOARD = -2,
21
+ GSF_CLIP_FORMAT_GUID = -3,
22
+ GSF_CLIP_FORMAT_NO_DATA = 0,
23
+ GSF_CLIP_FORMAT_CLIPBOARD_FORMAT_NAME = 1, /* in the file it's actually any positive integer */
24
+ GSF_CLIP_FORMAT_UNKNOWN /* this is our own value for unknown types or invalid data */
25
+ } GsfClipFormat;
26
+
27
+ typedef enum {
28
+ GSF_CLIP_FORMAT_WINDOWS_ERROR = -1, /* our own value */
29
+ GSF_CLIP_FORMAT_WINDOWS_UNKNOWN = -2, /* our own value */
30
+ GSF_CLIP_FORMAT_WINDOWS_METAFILE = 3, /* CF_METAFILEPICT */
31
+ GSF_CLIP_FORMAT_WINDOWS_DIB = 8, /* CF_DIB */
32
+ GSF_CLIP_FORMAT_WINDOWS_ENHANCED_METAFILE = 14 /* CF_ENHMETAFILE */
33
+ } GsfClipFormatWindows;
34
+
35
+ #define GSF_TYPE_CLIP_DATA (gsf_clip_data_get_type ())
36
+ #define GSF_CLIP_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSF_TYPE_CLIP_DATA, GsfClipData))
37
+ #define GSF_CLIP_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSF_TYPE_CLIP_DATA, GsfClipDataClass))
38
+ #define GSF_IS_CLIP_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSF_TYPE_CLIP_DATA))
39
+ #define GSF_IS_CLIP_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSF_TYPE_CLIP_DATA))
40
+ #define GSF_CLIP_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSF_TYPE_CLIP_DATA, GsfClipDataClass))
41
+
42
+ typedef struct _GsfClipData GsfClipData;
43
+ typedef struct _GsfClipDataClass GsfClipDataClass;
44
+ typedef struct _GsfClipDataPrivate GsfClipDataPrivate;
45
+
46
+ struct _GsfClipData {
47
+ GObject object;
48
+
49
+ GsfClipDataPrivate *priv;
50
+ };
51
+
52
+ GType gsf_clip_data_get_type (void) G_GNUC_CONST;
53
+ /* void gsf_clip_data_register_type (GTypeModule *module); glib dynamic types are not thread safe */
54
+
55
+ GsfClipData *gsf_clip_data_new (GsfClipFormat format,
56
+ GsfBlob *data_blob);
57
+
58
+ GsfClipFormat gsf_clip_data_get_format (GsfClipData *clip_data);
59
+
60
+ GsfBlob *gsf_clip_data_get_data_blob (GsfClipData *clip_data);
61
+
62
+ GsfClipFormatWindows gsf_clip_data_get_windows_clipboard_format (GsfClipData *clip_data,
63
+ GError **error);
64
+
65
+ gconstpointer gsf_clip_data_peek_real_data (GsfClipData *clip_data,
66
+ gsize *ret_size,
67
+ GError **error);
68
+
69
+
70
+ G_END_DECLS
71
+
72
+ #endif /* GSF_CLIP_DATA_H */
@@ -0,0 +1,66 @@
1
+ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
+ /*
3
+ * gsf-doc-meta-data.h: get, set, remove custom meta properties associated with documents
4
+ *
5
+ * Copyright (C) 2002-2006 Dom Lachowicz (cinamod@hotmail.com)
6
+ * Jody Goldberg (jody@gnome.org)
7
+ *
8
+ * This program is free software; you can redistribute it and/or
9
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
10
+ * License as published by the Free Software Foundation.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20
+ * USA
21
+ */
22
+
23
+ #ifndef GSF_DOC_META_DATA_H
24
+ #define GSF_DOC_META_DATA_H
25
+
26
+ #include <gsf/gsf-fwd.h>
27
+
28
+ G_BEGIN_DECLS
29
+
30
+ #define GSF_DOC_META_DATA_TYPE (gsf_doc_meta_data_get_type ())
31
+ #define GSF_DOC_META_DATA(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSF_DOC_META_DATA_TYPE, GsfDocMetaData))
32
+ #define IS_GSF_DOC_META_DATA(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSF_DOC_META_DATA_TYPE))
33
+
34
+ GType gsf_doc_meta_data_get_type (void) G_GNUC_CONST;
35
+ /* void gsf_doc_meta_data_register_type (GTypeModule *module); glib dynamic types are not thread safe */
36
+
37
+ GsfDocMetaData *gsf_doc_meta_data_new (void);
38
+ GsfDocProp *gsf_doc_meta_data_lookup (GsfDocMetaData const *meta,
39
+ char const *name);
40
+ void gsf_doc_meta_data_insert (GsfDocMetaData *meta,
41
+ char *name, GValue *value);
42
+ void gsf_doc_meta_data_remove (GsfDocMetaData *meta,
43
+ char const *name);
44
+ GsfDocProp *gsf_doc_meta_data_steal (GsfDocMetaData *meta,
45
+ char const *name);
46
+ void gsf_doc_meta_data_store (GsfDocMetaData *meta,
47
+ GsfDocProp *prop);
48
+ void gsf_doc_meta_data_foreach (GsfDocMetaData const *meta,
49
+ GHFunc func, gpointer user_data);
50
+ gsize gsf_doc_meta_data_size (GsfDocMetaData const *meta);
51
+ void gsf_doc_meta_dump (GsfDocMetaData const *meta);
52
+
53
+ GType gsf_doc_prop_get_type (void);
54
+ GsfDocProp *gsf_doc_prop_new (char *name);
55
+ void gsf_doc_prop_free (GsfDocProp *prop);
56
+ char const *gsf_doc_prop_get_name (GsfDocProp const *prop);
57
+ GValue const *gsf_doc_prop_get_val (GsfDocProp const *prop);
58
+ void gsf_doc_prop_set_val (GsfDocProp *prop, GValue *val);
59
+ GValue *gsf_doc_prop_swap_val (GsfDocProp *prop, GValue *val);
60
+ char const *gsf_doc_prop_get_link (GsfDocProp const *prop);
61
+ void gsf_doc_prop_set_link (GsfDocProp *prop, char *link);
62
+ void gsf_doc_prop_dump (GsfDocProp const *prop);
63
+
64
+ G_END_DECLS
65
+
66
+ #endif /* GSF_DOC_META_DATA_H */
@@ -0,0 +1,47 @@
1
+ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
+ /*
3
+ * gsf-docprop-vectors.h: A type implementing OLE Document Property vectors
4
+ *
5
+ * Copyright (C) 2004-2006 Frank Chiulli (fc-linux@cox.net)
6
+ *
7
+ * This program is free software; you can redistribute it and/or
8
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
19
+ * USA
20
+ */
21
+
22
+ #ifndef GSF_DOCPROP_VECTOR_H
23
+ #define GSF_DOCPROP_VECTOR_H
24
+
25
+ #include <gsf/gsf-fwd.h>
26
+
27
+ G_BEGIN_DECLS
28
+
29
+ #define GSF_DOCPROP_VECTOR_TYPE (gsf_docprop_vector_get_type ())
30
+ #define GSF_DOCPROP_VECTOR(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GSF_DOCPROP_VECTOR, GsfDocPropVector))
31
+ #define IS_GSF_DOCPROP_VECTOR(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GSF_DOCPROP_VECTOR_TYPE))
32
+
33
+ typedef struct _GsfDocPropVector GsfDocPropVector;
34
+ GType gsf_docprop_vector_get_type (void) G_GNUC_CONST;
35
+ /* void gsf_docprop_vector_register_type (GTypeModule *module); glib dynamic types are not thread safe */
36
+
37
+ GsfDocPropVector *gsf_docprop_vector_new (void);
38
+ void gsf_docprop_vector_append (GsfDocPropVector *vector, GValue *value);
39
+ gchar *gsf_docprop_vector_as_string (GsfDocPropVector const *vector);
40
+
41
+ #define VAL_IS_GSF_DOCPROP_VECTOR(v) (G_TYPE_CHECK_VALUE_TYPE((v), GSF_DOCPROP_VECTOR_TYPE))
42
+ GsfDocPropVector *gsf_value_get_docprop_vector (GValue const *value);
43
+ GValueArray *gsf_value_get_docprop_varray (GValue const *value);
44
+
45
+ G_END_DECLS
46
+
47
+ #endif /* GSF_DOCPROP_VECTOR_H */
@@ -0,0 +1,121 @@
1
+ /*
2
+ * gsf-fwd.h:
3
+ *
4
+ * Copyright (C) 2002-2006 Jody Goldberg (jody@gnome.org)
5
+ * Copyright (C) 2013 Morten Welinder (terra@gnome.org)
6
+ *
7
+ * This program is free software; you can redistribute it and/or
8
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
19
+ * USA
20
+ */
21
+
22
+ #ifndef GSF_FWD_H
23
+ #define GSF_FWD_H
24
+
25
+ #include <glib.h>
26
+ #include <glib-object.h>
27
+
28
+ G_BEGIN_DECLS
29
+
30
+ /**
31
+ * GsfInput:
32
+ *
33
+ * Class representing an input stream.
34
+ */
35
+ typedef struct _GsfInput GsfInput;
36
+
37
+ /**
38
+ * GsfInfil:
39
+ *
40
+ * Class representing an input file.
41
+ */
42
+ typedef struct _GsfInfile GsfInfile;
43
+
44
+ /**
45
+ * GsfOutput:
46
+ *
47
+ * Class representing an output stream, counterpart to #GsfInput.
48
+ */
49
+ typedef struct _GsfOutput GsfOutput;
50
+
51
+ /**
52
+ * GsfOutfile:
53
+ *
54
+ * Class representing an output file, counterpart to #GsfInfile.
55
+ */
56
+ typedef struct _GsfOutfile GsfOutfile;
57
+
58
+ /**
59
+ * GsfDocProp:
60
+ *
61
+ * Class representing a properties of a document.
62
+ */
63
+ typedef struct _GsfDocProp GsfDocProp;
64
+
65
+ /**
66
+ * GsfDocMetaData:
67
+ *
68
+ * Class representing information about a document, such as creator and time of
69
+ * last modification.
70
+ */
71
+ typedef struct _GsfDocMetaData GsfDocMetaData;
72
+
73
+ /**
74
+ * GsfTimestamp:
75
+ * @date : #GDate in local timezone
76
+ * @seconds : #glong number of seconds since @date.
77
+ * @time_zone : possibly blank #GString of the timezone
78
+ * @timet : as from mktime.
79
+ *
80
+ * A point in time.
81
+ */
82
+ typedef struct _GsfTimestamp GsfTimestamp;
83
+
84
+ /**
85
+ * gsf_off_t:
86
+ *
87
+ * Data type to represent offsets (positions) within a data stream.
88
+ *
89
+ * FIXME:
90
+ * gsf_off_t is really supposed to be the widest type off_t can be configured
91
+ * to on the platform
92
+ */
93
+ typedef gint64 gsf_off_t;
94
+
95
+ /**
96
+ * GSF_OFF_T_FORMAT:
97
+ *
98
+ * The printf(3) conversion specifier to be used for printing values of type
99
+ * #gsf_off_t.
100
+ */
101
+ #define GSF_OFF_T_FORMAT G_GINT64_FORMAT
102
+
103
+ typedef struct _GsfXMLIn GsfXMLIn;
104
+ typedef struct _GsfXMLInDoc GsfXMLInDoc;
105
+ typedef struct _GsfXMLInNode GsfXMLInNode;
106
+ typedef struct _GsfXMLInNS GsfXMLInNS;
107
+ typedef struct _GsfXMLBlob GsfXMLBlob;
108
+ typedef struct _GsfXMLOut GsfXMLOut;
109
+ typedef struct GsfXMLOutClass_ GsfXMLOutClass;
110
+
111
+ typedef struct _GsfBlob GsfBlob;
112
+
113
+ #if GLIB_CHECK_VERSION(2,32,0)
114
+ #define GSF_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
115
+ #else
116
+ #define GSF_DEPRECATED_FOR(f)
117
+ #endif
118
+
119
+ G_END_DECLS
120
+
121
+ #endif /* GSF_H */