From: cedlemo <nu...@co...> - 2017-07-21 12:58:17
|
cedlemo 2017-07-21 01:59:47 +0900 (Fri, 21 Jul 2017) New Revision: 355163025fa4996d6b09ab6c48371b798b70c7a8 https://github.com/ruby-gnome2/ruby-gnome2/commit/355163025fa4996d6b09ab6c48371b798b70c7a8 Merged 7316c70: Merge pull request #1068 from cedlemo/poppler_gi_form Message: Add customized loader Added files: poppler/lib/poppler/loader.rb Modified files: poppler/lib/poppler.rb Modified: poppler/lib/poppler.rb (+30 -3) =================================================================== --- poppler/lib/poppler.rb 2017-07-21 01:26:54 +0900 (025f6ae) +++ poppler/lib/poppler.rb 2017-07-21 01:59:47 +0900 (33393b3) @@ -24,13 +24,12 @@ GLib.prepend_dll_path(vendor_bin_dir) vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) +require "poppler/loader" + module Poppler LOG_DOMAIN = "Poppler" GLib::Log.set_log_domain(LOG_DOMAIN) - class Loader < GObjectIntrospection::Loader - end - loader = Loader.new(self) loader.load("Poppler") @@ -51,4 +50,32 @@ module Poppler end end end + + class AnnotCalloutLine + alias_method :initialize_raw, :initialize + def initialize(*args) + initialize_raw + if args.size == 1 && args.class == Hash + self.multiline = args[:multiline] || false + self.x1 = args[:x1] || 0 + self.y1 = args[:y1] || 0 + self.x2 = args[:x2] || 0 + self.y2 = args[:y2] || 0 + self.x3 = args[:x3] || 0 + self.y3 = args[:y3] || 0 + elsif args.class == Array && args.size == 7 + self.multiline = args[0] + self.x1 = args[1] + self.y1 = args[2] + self.x2 = args[3] + self.y2 = args[4] + self.x3 = args[5] + self.y3 = args[6] + end + end + + def to_a + [multiline?, x1, y1, x2, y2, x3, y3] + end + end end Added: poppler/lib/poppler/loader.rb (+30 -0) 100644 =================================================================== --- /dev/null +++ poppler/lib/poppler/loader.rb 2017-07-21 01:59:47 +0900 (9bee7b3) @@ -0,0 +1,30 @@ +# Copyright (C) 2017 Ruby-GNOME2 Project Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +module Poppler + class Loader < GObjectIntrospection::Loader + private + def pre_load(repository, namespace) + end + + def post_load(repository, namespace) + require_libraries + end + + def require_libraries + end + end +end |