pango 3.4.7 → 3.5.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
  SHA256:
3
- metadata.gz: c719bc9d4ba242899e118ca77e6852342f00f97d9c53270f252cffd7bb24c729
4
- data.tar.gz: a730d2ae6c24392d6d1c84a04743f19d21d947188e1cb49f9167337bab837d91
3
+ metadata.gz: be28139580135340befb1427090197a0310f50f220991fa27221d616017faaa2
4
+ data.tar.gz: 389b6d52f9849b2595cbdb3035b5c44444d24fcd4fc0e7602b94546ea752ec24
5
5
  SHA512:
6
- metadata.gz: 69464643ad58f2bd6dd53c53faf3e2ae28a37b9f8916ed2ac56252c76594b0fefdfa23d490ebd8c0be0b5d6890c531166f3e6d8b4033bcc522c63516ac9f891c
7
- data.tar.gz: 3fbdcd92c07848bb22b1329f4ce84776925cee8fb332658863c6df6cd66fc2aa4e6610bb8497a46cc9d9dcbd523965e6eff820e9f03a47877382ba7f438616c7
6
+ metadata.gz: 25e0f41c2c2665b39d34eccfbd6ac276e21379aae031cf08c1a1294dddcb39a4bc1e2355268feb07271d8fd18a389343e563c2d1d3cf474d1d0a29bf4c2729a2
7
+ data.tar.gz: dd1e6c4860451ded190eaea7798f93c7bf71f7815c74086437d21e300e5b5af22614c21cd6ca5d541a90a73722cddecf596aaca4de6456b9c224702ac168dc97
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2017 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2017-2022 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -23,10 +23,12 @@
23
23
  #define RG_TARGET_NAMESPACE cAttrIterator
24
24
  #define _SELF(self) (RVAL2PANGOATTRITERATOR(self))
25
25
 
26
- G_DEFINE_BOXED_TYPE(PangoAttrIterator,
27
- pango_attr_iterator,
28
- pango_attr_iterator_copy,
29
- pango_attr_iterator_destroy);
26
+ #if !PANGO_CHECK_VERSION(1, 44, 0)
27
+ G_DEFINE_BOXED_TYPE(PangoAttrIterator,
28
+ pango_attr_iterator,
29
+ pango_attr_iterator_copy,
30
+ pango_attr_iterator_destroy);
31
+ #endif
30
32
 
31
33
  static VALUE
32
34
  rg_attrs(VALUE self)
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2017-2018 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2017-2022 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -20,14 +20,6 @@
20
20
 
21
21
  #include "rb-pango-private.h"
22
22
 
23
- #ifndef PANGO_CHECK_VERSION
24
- # define PANGO_CHECK_VERSION(major, minor, micro) \
25
- (PANGO_VERSION_MAJOR > (major) || \
26
- (PANGO_VERSION_MAJOR == (major) && PANGO_VERSION_MINOR > (minor)) || \
27
- (PANGO_VERSION_MAJOR == (major) && PANGO_VERSION_MINOR == (minor) && \
28
- PANGO_VERSION_MICRO >= (micro)))
29
- #endif
30
-
31
23
  #if !PANGO_CHECK_VERSION(1, 44, 0)
32
24
  static GType
33
25
  pango_attribute_get_type(void)
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2017 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2017-2022 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,14 @@
22
22
 
23
23
  #include "rb-pango.h"
24
24
 
25
+ #ifndef PANGO_CHECK_VERSION
26
+ # define PANGO_CHECK_VERSION(major, minor, micro) \
27
+ (PANGO_VERSION_MAJOR > (major) || \
28
+ (PANGO_VERSION_MAJOR == (major) && PANGO_VERSION_MINOR > (minor)) || \
29
+ (PANGO_VERSION_MAJOR == (major) && PANGO_VERSION_MINOR == (minor) && \
30
+ PANGO_VERSION_MICRO >= (micro)))
31
+ #endif
32
+
25
33
  G_GNUC_INTERNAL void rbpango_attribute_init(VALUE mPango);
26
34
  G_GNUC_INTERNAL void rbpango_attr_iterator_init(VALUE mPango);
27
35
  G_GNUC_INTERNAL void rbpango_attr_list_init(VALUE mPango);
data/ext/pango/rb-pango.c CHANGED
@@ -28,6 +28,21 @@ rg_s_pixels(G_GNUC_UNUSED VALUE self, VALUE pixels)
28
28
  return rb_float_new(PANGO_PIXELS(NUM2DBL(pixels)));
29
29
  }
30
30
 
31
+ #ifdef _WIN32
32
+ /* Workaround: See glib2/ext/glib2/rbglib.c for details. */
33
+ BOOL WINAPI
34
+ DllMain(G_GNUC_UNUSED HINSTANCE hinstDLL,
35
+ G_GNUC_UNUSED DWORD fdwReason,
36
+ G_GNUC_UNUSED LPVOID lpvReserved);
37
+ BOOL WINAPI
38
+ DllMain(G_GNUC_UNUSED HINSTANCE hinstDLL,
39
+ G_GNUC_UNUSED DWORD fdwReason,
40
+ G_GNUC_UNUSED LPVOID lpvReserved)
41
+ {
42
+ return TRUE;
43
+ }
44
+ #endif
45
+
31
46
  void
32
47
  Init_pango(void)
33
48
  {
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017-2021 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -14,15 +14,18 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- module Pango
18
- class CairoLoader < GObjectIntrospection::Loader
17
+ module PangoCairo
18
+ class Loader < GObjectIntrospection::Loader
19
19
  private
20
20
  def pre_load(repository, namespace)
21
- @context_class = @base_module.const_get(:Context)
21
+ @context_cairo_methods_module =
22
+ define_methods_module(:ContextCairoMethods)
23
+ @cairo_context_methods_module =
24
+ define_methods_module(:CairoContextMethods)
22
25
  end
23
26
 
24
27
  def post_load(repository, namespace)
25
- font_map_class = @base_module.const_get("CairoFontMap")
28
+ font_map_class = @base_module::FontMap
26
29
  font_types = []
27
30
  font_types << :quartz if Cairo::FontFace.quartz_supported?
28
31
  font_types << :win32 if Cairo::Surface.quartz_supported?
@@ -30,45 +33,52 @@ module Pango
30
33
  font_types.each do |font_type|
31
34
  font_map = font_map_class.new_for_font_type(font_type)
32
35
  next if font_map.nil?
33
- @base_module.const_set(font_map.class.gtype.name.gsub(/\APango/, ""),
34
- font_map.class)
36
+ name = font_map.class.gtype.name.gsub(/\APangoCairo/, "")
37
+ next if @base_module.const_defined?(name)
38
+ @base_module.const_set(name, font_map.class)
35
39
  end
36
- end
40
+ apply_methods_module(@context_cairo_methods_module, Pango::Context)
41
+ apply_methods_module(@cairo_context_methods_module, Cairo::Context)
37
42
 
38
- def rubyish_class_name(info)
39
- "Cairo#{super}"
43
+ @base_module.constants.each do |constant|
44
+ case constant
45
+ when :INVOKERS,
46
+ :Loader
47
+ next
48
+ else
49
+ value = @base_module.const_get(constant)
50
+ next if value == @context_cairo_methods_module
51
+ next if value == @cairo_context_methods_module
52
+ Pango.const_set("Cairo#{constant}", value)
53
+ end
54
+ end
40
55
  end
41
56
 
42
57
  def load_function_info(info)
43
58
  case info.name
44
59
  when /\Acontext_get_(.+)\z/
45
60
  method_name = $1
46
- define_method(info, @context_class, method_name)
61
+ define_method(info, @context_cairo_methods_module, method_name)
47
62
  when /\Acontext_set_(.+)\z/
48
63
  method_base_name = $1
49
64
  setter_method_name = "set_#{method_base_name}"
50
- if @context_class.method_defined?(setter_method_name)
51
- # ignore
52
- return
53
- end
54
- define_method(info, @context_class, setter_method_name)
65
+ define_method(info, @context_cairo_methods_module, setter_method_name)
55
66
  if info.n_args == 2
56
67
  equal_method_name = "#{method_base_name}="
57
- remove_existing_method(@context_class, equal_method_name)
58
- @context_class.__send__(:alias_method,
59
- equal_method_name,
60
- setter_method_name)
68
+ @context_cairo_methods_module.__send__(:alias_method,
69
+ equal_method_name,
70
+ setter_method_name)
61
71
  end
62
72
  when /\Afont_map_/
63
73
  # ignore
64
74
  when /\Acreate_(.+)\z/
65
- define_method(info, Cairo::Context, "create_pango_#{$1}")
75
+ define_method(info, @cairo_context_methods_module, "create_pango_#{$1}")
66
76
  when /\A(.+_path)\z/
67
- define_method(info, Cairo::Context, "pango_#{$1}")
77
+ define_method(info, @cairo_context_methods_module, "pango_#{$1}")
68
78
  when /\Ashow_(.+)\z/
69
- define_method(info, Cairo::Context, "show_pango_#{$1}")
79
+ define_method(info, @cairo_context_methods_module, "show_pango_#{$1}")
70
80
  when /\Aupdate_(.+)\z/
71
- define_method(info, Cairo::Context, "update_pango_#{$1}")
81
+ define_method(info, @cairo_context_methods_module, "update_pango_#{$1}")
72
82
  else
73
83
  warn("Unsupported PangoCairo function: #{info.name}")
74
84
  end
@@ -14,11 +14,24 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- module Pango
18
- class FcLoader < GObjectIntrospection::Loader
19
- private
20
- def rubyish_class_name(info)
21
- "Fc#{super}"
17
+ module PangoFc
18
+ class Loader < GObjectIntrospection::Loader
19
+ def post_load(repository, namespace)
20
+ @base_module.constants.each do |constant|
21
+ case constant
22
+ when :INVOKERS,
23
+ :Loader
24
+ next
25
+ else
26
+ if constant.to_s.upcase == constant.to_s
27
+ name = "FC_#{constant}"
28
+ else
29
+ name = "Fc#{constant}"
30
+ end
31
+ value = @base_module.const_get(constant)
32
+ Pango.const_set(name, value)
33
+ end
34
+ end
22
35
  end
23
36
  end
24
37
  end
@@ -14,11 +14,24 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- module Pango
18
- class FT2Loader < GObjectIntrospection::Loader
19
- private
20
- def rubyish_class_name(info)
21
- "FT2#{super}"
17
+ module PangoFT2
18
+ class Loader < GObjectIntrospection::Loader
19
+ def post_load(repository, namespace)
20
+ @base_module.constants.each do |constant|
21
+ case constant
22
+ when :INVOKERS,
23
+ :Loader
24
+ next
25
+ else
26
+ if constant.to_s.upcase == constant.to_s
27
+ name = "FT2_#{constant}"
28
+ else
29
+ name = "FT2#{constant}"
30
+ end
31
+ value = @base_module.const_get(constant)
32
+ Pango.const_set(name, value)
33
+ end
34
+ end
22
35
  end
23
36
  end
24
37
  end
data/lib/pango/loader.rb CHANGED
@@ -26,8 +26,10 @@ module Pango
26
26
  @pending_attribute_infos.each do |info|
27
27
  name = rubyish_class_name(info)
28
28
  klass = @base_module.const_get(name)
29
- load_fields(info, klass)
30
- load_methods(info, klass)
29
+ prepare_class(klass) do
30
+ load_fields(info, klass)
31
+ load_methods(info, klass)
32
+ end
31
33
  end
32
34
  require_libraries
33
35
  convert_attribute_classes
@@ -14,11 +14,24 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- module Pango
18
- class OTLoader < GObjectIntrospection::Loader
19
- private
20
- def rubyish_class_name(info)
21
- "OT#{super}"
17
+ module PangoOT
18
+ class Loader < GObjectIntrospection::Loader
19
+ def post_load(repository, namespace)
20
+ @base_module.constants.each do |constant|
21
+ case constant
22
+ when :INVOKERS,
23
+ :Loader
24
+ next
25
+ else
26
+ if constant.to_s.upcase == constant.to_s
27
+ name = "OT_#{constant}"
28
+ else
29
+ name = "OT#{constant}"
30
+ end
31
+ value = @base_module.const_get(constant)
32
+ Pango.const_set(name, value)
33
+ end
34
+ end
22
35
  end
23
36
  end
24
37
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017-2022 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -47,7 +47,9 @@ module Pango
47
47
 
48
48
  def dup
49
49
  duplicated = self.class.new(x, y, width, height)
50
- duplicated.taint if tainted?
50
+ if respond_to?(:tainted?) and tainted?
51
+ duplicated.taint
52
+ end
51
53
  duplicated
52
54
  end
53
55
  end
data/lib/pango.rb CHANGED
@@ -30,22 +30,30 @@ module Pango
30
30
 
31
31
  loader = Loader.new(self)
32
32
  loader.load("Pango")
33
+ end
33
34
 
34
- cairo_loader = CairoLoader.new(self)
35
- cairo_loader.load("PangoCairo")
35
+ module PangoCairo
36
+ loader = Loader.new(self)
37
+ loader.load("PangoCairo")
38
+ end
36
39
 
37
- fc_loader = FcLoader.new(self)
40
+ module PangoFc
41
+ loader = Loader.new(self)
38
42
  begin
39
- fc_loader.load("PangoFc")
43
+ loader.load("PangoFc")
40
44
  rescue GObjectIntrospection::RepositoryError::TypelibNotFound
41
45
  end
46
+ end
42
47
 
43
- ft2_loader = FT2Loader.new(self)
44
- ft2_loader.load("PangoFT2")
48
+ module PangoFT2
49
+ loader = Loader.new(self)
50
+ loader.load("PangoFT2")
51
+ end
45
52
 
46
- ot_loader = OTLoader.new(self)
53
+ module PangoOT
54
+ loader = Loader.new(self)
47
55
  begin
48
- ot_loader.load("PangoOT")
56
+ loader.load("PangoOT")
49
57
  rescue GObjectIntrospection::RepositoryError::TypelibNotFound
50
58
  end
51
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pango
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.7
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-30 00:00:00.000000000 Z
11
+ date: 2022-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo-gobject
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.4.7
19
+ version: 3.5.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.4.7
26
+ version: 3.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gobject-introspection
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.4.7
33
+ version: 3.5.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.4.7
40
+ version: 3.5.1
41
41
  description: Ruby/Pango is a Ruby binding of pango-1.x based on GObject-Introspection.
42
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
43
43
  executables: []
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.3.0.dev
106
+ rubygems_version: 3.4.0.dev
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Ruby/Pango is a Ruby binding of pango-1.x.