From: Kouhei S. <nu...@co...> - 2017-07-23 06:19:50
|
Kouhei Sutou 2017-07-23 15:19:06 +0900 (Sun, 23 Jul 2017) New Revision: de7a7bcba45be3d7da6e55da1e29235f2c89cea0 https://github.com/ruby-gnome2/ruby-gnome2/commit/de7a7bcba45be3d7da6e55da1e29235f2c89cea0 Message: poppler: keep backward compatibility Added files: poppler/lib/poppler/deprecated.rb Modified files: poppler/lib/poppler/loader.rb Added: poppler/lib/poppler/deprecated.rb (+49 -0) 100644 =================================================================== --- /dev/null +++ poppler/lib/poppler/deprecated.rb 2017-07-23 15:19:06 +0900 (644ad3b) @@ -0,0 +1,49 @@ +# 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 + extend GLib::Deprecatable + + define_deprecated_const(:AnnotationType, "Poppler::AnnotType") + define_deprecated_const(:AnnotationFlag, "Poppler::AnnotFlag") + define_deprecated_const(:AnnotationMarkupReplyType, + "Poppler::AnnotMarkupReplyType") + define_deprecated_const(:AnnotationExternalDataType, + "Poppler::AnnotExternalDataType") + define_deprecated_const(:AnnotationTextState, "Poppler::AnnotTextSate") + define_deprecated_const(:AnnotationFreeTextQuadding, + "Poppler::AnnotFreeTextQuadding") + define_deprecated_const(:AnnotationMarkup, + "Poppler::AnnotMarkup") + define_deprecated_const(:AnnotationText, + "Poppler::AnnotText") + define_deprecated_const(:AnnotationFreeText, + "Poppler::AnnotFreeText") + define_deprecated_const(:AnnotationMapping, + "Poppler::AnnotMapping") + + class AnnotMapping + extend GLib::Deprecatable + + define_deprecated_method(:annotation, :annot) + end + + class Page + extend GLib::Deprecatable + + define_deprecated_method(:annotation_mapping, :annot_mapping) + end +end Modified: poppler/lib/poppler/loader.rb (+14 -0) =================================================================== --- poppler/lib/poppler/loader.rb 2017-07-23 15:18:47 +0900 (2b2f49b) +++ poppler/lib/poppler/loader.rb 2017-07-23 15:19:06 +0900 (a09f392) @@ -26,8 +26,22 @@ module Poppler def require_libraries require "poppler/version" + require "poppler/annot-callout-line" require "poppler/document" + + require "poppler/deprecated" + end + + def load_method_info(info, klass, method_name) + case klass.name + when "Poppler::Annot" + case method_name + when "annot_type" + method_name = "type" + end + end + super(info, klass, method_name) end end end |