poppler 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b01b795199455ead82ad2777cfcbbeb257b4793f
4
- data.tar.gz: 19af7209f58dfbbfe069bcfb12d75c52176f3249
3
+ metadata.gz: 36e33bd0811adc3fb87f693e5e23d7476bf01b32
4
+ data.tar.gz: c75bbab33f74ec28549d65c97e19f913c3484707
5
5
  SHA512:
6
- metadata.gz: e7e001be7aec5d2112f101e8ebf020ebc3feea41d082746f51f78ec3ebe37cffc8ded1294196109b46724cc915118e39e931613a170648a6fd39a5d4674bcbf1
7
- data.tar.gz: 4464ff0fb7dbca8207146cf071eedf8df8286da3ef934cabc147dc4b6c66f742ae664e3ffbe185c64994c5c34a2e29aedf248abdeeb6d05cdb8af7d398d8023b
6
+ metadata.gz: b752b14686825dcc22de63a284c2d50f12c2b8e8996694ed56a2fd0385be15bc1c1a2ee1490f3ce3f82d29e9c32ad6722fc6146cee833d8d05e39ff4195c87e7
7
+ data.tar.gz: 617d007f8c9301598833536d7f616d6cfda57ba854840b65bc2ce07244dd4c775ee15e296b7a185a8c6313445235b649cce17cda399cad29a28b162f845e4b43
@@ -30,7 +30,7 @@ rescue LoadError
30
30
  require 'mkmf-gnome2'
31
31
  end
32
32
 
33
- ["glib2", "atk"].each do |package|
33
+ ["glib2", "gdk_pixbuf2"].each do |package|
34
34
  directory = "#{package}#{version_suffix}"
35
35
  build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
36
36
  add_depend_package(package, "#{directory}/ext/#{package}",
@@ -308,48 +308,78 @@ Init_poppler_action(VALUE mPoppler)
308
308
  rbg_define_method(rb_cPopplerActionAny, "type", action_any_type, 0);
309
309
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionAny, any, title);
310
310
 
311
- rb_cPopplerActionUnknown = rb_define_class_under(mPoppler, "ActionUnknown",
312
- rb_cPopplerAction);
313
-
314
- rb_cPopplerActionGotoDest = rb_define_class_under(mPoppler, "ActionGotoDest",
315
- rb_cPopplerActionAny);
311
+ rb_cPopplerActionUnknown =
312
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_UNKNOWN,
313
+ "ActionUnknown",
314
+ mPoppler,
315
+ rb_cPopplerAction);
316
+
317
+ rb_cPopplerActionGotoDest =
318
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_GOTO_DEST,
319
+ "ActionGotoDest",
320
+ mPoppler,
321
+ rb_cPopplerActionAny);
316
322
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionGotoDest, goto_dest, dest);
317
323
 
318
- rb_cPopplerActionGotoRemote = rb_define_class_under(mPoppler, "ActionGotoRemote",
319
- rb_cPopplerActionAny);
324
+ rb_cPopplerActionGotoRemote =
325
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_GOTO_REMOTE,
326
+ "ActionGotoRemote",
327
+ mPoppler,
328
+ rb_cPopplerActionAny);
320
329
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionGotoRemote, goto_remote, file_name);
321
330
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionGotoRemote, goto_remote, dest);
322
331
 
323
- rb_cPopplerActionLaunch = rb_define_class_under(mPoppler, "ActionLaunch",
324
- rb_cPopplerActionAny);
332
+ rb_cPopplerActionLaunch =
333
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_LAUNCH,
334
+ "ActionLaunch",
335
+ mPoppler,
336
+ rb_cPopplerActionAny);
325
337
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionLaunch, launch, file_name);
326
338
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionLaunch, launch, params);
327
339
 
328
- rb_cPopplerActionURI = rb_define_class_under(mPoppler, "ActionURI", rb_cPopplerActionAny);
340
+ rb_cPopplerActionURI =
341
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_URI,
342
+ "ActionURI",
343
+ mPoppler,
344
+ rb_cPopplerActionAny);
329
345
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionURI, uri, uri);
330
346
 
331
- rb_cPopplerActionNamed = rb_define_class_under(mPoppler, "ActionNamed",
332
- rb_cPopplerActionAny);
347
+ rb_cPopplerActionNamed =
348
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_NAMED,
349
+ "ActionNamed",
350
+ mPoppler,
351
+ rb_cPopplerActionAny);
333
352
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionNamed, named, named_dest);
334
353
 
335
354
  #if POPPLER_CHECK_VERSION(0, 14, 0)
336
- rb_cPopplerActionMovie = rb_define_class_under(mPoppler, "ActionMovie",
337
- rb_cPopplerActionAny);
355
+ rb_cPopplerActionMovie =
356
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_MOVIE,
357
+ "ActionMovie",
358
+ mPoppler,
359
+ rb_cPopplerActionAny);
338
360
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionMovie, movie, movie);
339
361
 
340
- rb_cPopplerActionRendition = rb_define_class_under(mPoppler, "ActionRendtion",
341
- rb_cPopplerActionAny);
362
+ rb_cPopplerActionRendition =
363
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_RENDITION,
364
+ "ActionRendtion",
365
+ mPoppler,
366
+ rb_cPopplerActionAny);
342
367
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionRendition, rendition, media);
343
368
 
344
- rb_cPopplerActionOCGState = rb_define_class_under(mPoppler, "ActionOCGState",
345
- rb_cPopplerActionAny);
369
+ rb_cPopplerActionOCGState =
370
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_OCG_STATE,
371
+ "ActionOCGState",
372
+ mPoppler,
373
+ rb_cPopplerActionAny);
346
374
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionOCGState, ocg_state, state_list);
347
375
  #endif
348
376
 
349
377
  #if POPPLER_CHECK_VERSION(0, 18, 0)
350
378
  rb_cPopplerActionJavaScript =
351
- rb_define_class_under(mPoppler, "ActionJavaScript",
352
- rb_cPopplerActionAny);
379
+ G_DEF_CLASS_WITH_PARENT(POPPLER_ACTION_TYPE_JAVASCRIPT,
380
+ "ActionJavaScript",
381
+ mPoppler,
382
+ rb_cPopplerActionAny);
353
383
  DEFINE_ACTION_ACCESSOR(rb_cPopplerActionJavaScript, javascript, script);
354
384
  #endif
355
385
 
@@ -44,7 +44,6 @@ rg_initialize(VALUE self, VALUE document)
44
44
  PopplerIndexIter *iter;
45
45
  iter = poppler_index_iter_new(RVAL2POPPLERDOCUMENT(document));
46
46
  G_INITIALIZE(self, iter);
47
- poppler_index_iter_free(iter);
48
47
  rb_ivar_set(self, id_valid, CBOOL2RVAL(iter));
49
48
  return Qnil;
50
49
  }
@@ -57,6 +56,9 @@ rg_child(VALUE self)
57
56
 
58
57
  CHECK_IITER_IS_VALID(self);
59
58
  child = poppler_index_iter_get_child(RVAL2POPPLERINDEXITER(self));
59
+ if (!child)
60
+ return Qnil;
61
+
60
62
  rb_child = POPPLERINDEXITER2RVAL(child);
61
63
  rb_ivar_set(rb_child, id_valid, CBOOL2RVAL(child));
62
64
  poppler_index_iter_free(child);
Binary file
Binary file
@@ -37,6 +37,10 @@ module PopplerTestUtils
37
37
  File.join(fixtures_dir, "image.png")
38
38
  end
39
39
 
40
+ def outline_pdf
41
+ File.join(fixtures_dir, "outline.pdf")
42
+ end
43
+
40
44
  def later_version?(major, minor, micro=nil)
41
45
  micro ||= 0
42
46
  (Poppler::BUILD_VERSION <=> [major, minor, micro]) >= 0
@@ -0,0 +1,49 @@
1
+ # Copyright (C) 2017 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 TestIndexIter < Test::Unit::TestCase
18
+ def test_title
19
+ document = Poppler::Document.new(outline_pdf)
20
+ assert_equal([
21
+ [
22
+ "Heading1",
23
+ [
24
+ [
25
+ "Heading2",
26
+ [
27
+ [
28
+ "Heading3",
29
+ ],
30
+ ],
31
+ ],
32
+ ],
33
+ ],
34
+ ],
35
+ collect_titles(document.index_iter))
36
+ end
37
+
38
+ private
39
+ def collect_titles(iter)
40
+ iter.collect do
41
+ titles = [iter.action.title]
42
+ child_iter = iter.child
43
+ if child_iter
44
+ titles << collect_titles(child_iter)
45
+ end
46
+ titles
47
+ end
48
+ end
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poppler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-13 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.0
33
+ version: 3.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.0
40
+ version: 3.1.1
41
41
  description: Ruby/Poppler is a Ruby binding of poppler-glib.
42
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
43
43
  executables: []
@@ -88,8 +88,11 @@ files:
88
88
  - sample/pdfdiv.rb
89
89
  - test/fixtures/image.pdf
90
90
  - test/fixtures/image.png
91
+ - test/fixtures/outline.odt
92
+ - test/fixtures/outline.pdf
91
93
  - test/poppler-test-utils.rb
92
94
  - test/run-test.rb
95
+ - test/test-index-iter.rb
93
96
  - test/test-version.rb
94
97
  - test/test_annotation.rb
95
98
  - test/test_color.rb
@@ -116,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
119
  version: '0'
117
120
  requirements: []
118
121
  rubyforge_project:
119
- rubygems_version: 2.5.1
122
+ rubygems_version: 2.5.2
120
123
  signing_key:
121
124
  specification_version: 4
122
125
  summary: Ruby/Poppler is a Ruby binding of poppler-glib.