cairo-gobject 3.3.7 → 3.3.8

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: f9dce994114c1ad87717c87fa66e3ba35dedd9254ad55e11cf6157cb16fd85b1
4
- data.tar.gz: ed30f7c744371d406cee639087f6240c367be27d6a3fb2b401709f7d3d3881c4
3
+ metadata.gz: a87d8bc7d59251a4596776a305c959aef4b6ccec7e7196260e048c88f092eee7
4
+ data.tar.gz: 7ee049e7287c9f4b943e99b1a4637e296cb55afd483a4baada92a2de62e56f51
5
5
  SHA512:
6
- metadata.gz: bd21125cab6d37d6f46ea4287984c2e375c082f20d2fbe5c93a286365cc6462c9947c8251db3b0063c0cbd901f0d52daf020f029273a867efe7b22867999bb57
7
- data.tar.gz: 441a2c648496697f2b4cfb122501f415ccc06114e1f2ec5699e0022e09de64f3ba960c000943f3f1f54914382b75378d8defff092d9b7429356749528ca38267
6
+ metadata.gz: 5cb02022e6e0a4ef1223954617e8ec01f7a1e6c6a7714a32eb9943189e75f674bfbb066e82eb17f9c32b699070a6c511b7bf8efc267b28eb98caa50238b673ac
7
+ data.tar.gz: d6186c3a986353380b3204bd21ce5f01f80805810b4946f23ce8bb6cf1a3046f31b40acc8d414311dff481018d0a7d5c9bd6142843663118b057b91d500810cc
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2018 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2018 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,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.name = "cairo-gobject"
23
23
  s.summary = "Ruby/CairoGObject is a Ruby binding of cairo-gobject."
24
24
  s.description = "Ruby/CairoGObject is a Ruby binding of cairo-gobject."
25
- s.author = "The Ruby-GNOME2 Project Team"
25
+ s.author = "The Ruby-GNOME Project Team"
26
26
  s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
27
27
  s.homepage = "https://ruby-gnome2.osdn.jp/"
28
28
  s.licenses = ["LGPL-2.1+"]
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2013-2018 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2013-2019 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,8 +22,11 @@
22
22
 
23
23
  #define RG_TARGET_NAMESPACE rb_mCairoGObject
24
24
 
25
+ static VALUE RG_TARGET_NAMESPACE;
26
+
25
27
  #define DEFINE_CONVERSION(prefix, \
26
28
  gtype, \
29
+ ClassName, \
27
30
  rb_klass, \
28
31
  RVAL2CR, \
29
32
  CR2RVAL) \
@@ -47,10 +50,22 @@ prefix ## _s_gtype(G_GNUC_UNUSED VALUE klass) \
47
50
  return rbgobj_gtype_new(gtype); \
48
51
  } \
49
52
  \
53
+ static VALUE \
54
+ rg_ ## prefix ## _s_try_convert(VALUE klass, VALUE value) \
55
+ { \
56
+ if (RTEST(rb_obj_is_kind_of(value, klass))) { \
57
+ return value; \
58
+ } else { \
59
+ gpointer raw_object = RVAL2CR(value); \
60
+ return BOXED2RVAL(raw_object, gtype); \
61
+ } \
62
+ } \
63
+ \
50
64
  static void \
51
65
  define_ ## prefix ## _conversion(void) \
52
66
  { \
53
67
  RGConvertTable table; \
68
+ VALUE rg_klass; \
54
69
  \
55
70
  memset(&table, 0, sizeof(RGConvertTable)); \
56
71
  table.type = gtype; \
@@ -64,32 +79,66 @@ define_ ## prefix ## _conversion(void) \
64
79
  "gtype", \
65
80
  prefix ## _s_gtype, \
66
81
  0); \
82
+ \
83
+ rg_klass = G_DEF_CLASS(gtype, ClassName, RG_TARGET_NAMESPACE); \
84
+ rb_define_singleton_method(rg_klass, \
85
+ "try_convert", \
86
+ rg_ ## prefix ## _s_try_convert, \
87
+ 1); \
67
88
  }
68
89
 
69
- DEFINE_CONVERSION(context, CAIRO_GOBJECT_TYPE_CONTEXT, rb_cCairo_Context,
70
- RVAL2CRCONTEXT, CRCONTEXT2RVAL)
71
- DEFINE_CONVERSION(device, CAIRO_GOBJECT_TYPE_DEVICE, rb_cCairo_Device,
72
- RVAL2CRDEVICE, CRDEVICE2RVAL)
73
- DEFINE_CONVERSION(pattern, CAIRO_GOBJECT_TYPE_PATTERN, rb_cCairo_Pattern,
74
- RVAL2CRPATTERN, CRPATTERN2RVAL)
75
- DEFINE_CONVERSION(surface, CAIRO_GOBJECT_TYPE_SURFACE, rb_cCairo_Surface,
76
- RVAL2CRSURFACE, CRSURFACE2RVAL)
77
- DEFINE_CONVERSION(scaled_font, CAIRO_GOBJECT_TYPE_SCALED_FONT,
90
+ DEFINE_CONVERSION(context,
91
+ CAIRO_GOBJECT_TYPE_CONTEXT,
92
+ "Context",
93
+ rb_cCairo_Context,
94
+ RVAL2CRCONTEXT,
95
+ CRCONTEXT2RVAL)
96
+ DEFINE_CONVERSION(device,
97
+ CAIRO_GOBJECT_TYPE_DEVICE,
98
+ "Device",
99
+ rb_cCairo_Device,
100
+ RVAL2CRDEVICE,
101
+ CRDEVICE2RVAL)
102
+ DEFINE_CONVERSION(pattern,
103
+ CAIRO_GOBJECT_TYPE_PATTERN,
104
+ "Pattern",
105
+ rb_cCairo_Pattern,
106
+ RVAL2CRPATTERN,
107
+ CRPATTERN2RVAL)
108
+ DEFINE_CONVERSION(surface,
109
+ CAIRO_GOBJECT_TYPE_SURFACE,
110
+ "Surface",
111
+ rb_cCairo_Surface,
112
+ RVAL2CRSURFACE,
113
+ CRSURFACE2RVAL)
114
+ DEFINE_CONVERSION(scaled_font,
115
+ CAIRO_GOBJECT_TYPE_SCALED_FONT,
116
+ "ScaledFont",
78
117
  rb_cCairo_ScaledFont,
79
- RVAL2CRSCALEDFONT, CRSCALEDFONT2RVAL)
80
- DEFINE_CONVERSION(font_face, CAIRO_GOBJECT_TYPE_FONT_FACE, rb_cCairo_FontFace,
81
- RVAL2CRFONTFACE, CRFONTFACE2RVAL)
82
- DEFINE_CONVERSION(font_options, CAIRO_GOBJECT_TYPE_FONT_OPTIONS,
118
+ RVAL2CRSCALEDFONT,
119
+ CRSCALEDFONT2RVAL)
120
+ DEFINE_CONVERSION(font_face,
121
+ CAIRO_GOBJECT_TYPE_FONT_FACE,
122
+ "FontFace",
123
+ rb_cCairo_FontFace,
124
+ RVAL2CRFONTFACE,
125
+ CRFONTFACE2RVAL)
126
+ DEFINE_CONVERSION(font_options,
127
+ CAIRO_GOBJECT_TYPE_FONT_OPTIONS,
128
+ "FontOptions",
83
129
  rb_cCairo_FontOptions,
84
- RVAL2CRFONTOPTIONS, CRFONTOPTIONS2RVAL)
85
- DEFINE_CONVERSION(region, CAIRO_GOBJECT_TYPE_REGION, rb_cCairo_Region,
86
- RVAL2CRREGION, CRREGION2RVAL)
130
+ RVAL2CRFONTOPTIONS,
131
+ CRFONTOPTIONS2RVAL)
132
+ DEFINE_CONVERSION(region,
133
+ CAIRO_GOBJECT_TYPE_REGION,
134
+ "Region",
135
+ rb_cCairo_Region,
136
+ RVAL2CRREGION,
137
+ CRREGION2RVAL)
87
138
 
88
139
  void
89
140
  Init_cairo_gobject(void)
90
141
  {
91
- VALUE RG_TARGET_NAMESPACE;
92
-
93
142
  RG_TARGET_NAMESPACE = rb_define_module("CairoGObject");
94
143
 
95
144
  rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cairo-gobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.7
4
+ version: 3.3.8
5
5
  platform: ruby
6
6
  authors:
7
- - The Ruby-GNOME2 Project Team
7
+ - The Ruby-GNOME Project Team
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: cairo
@@ -29,14 +30,14 @@ dependencies:
29
30
  requirements:
30
31
  - - '='
31
32
  - !ruby/object:Gem::Version
32
- version: 3.3.7
33
+ version: 3.3.8
33
34
  type: :runtime
34
35
  prerelease: false
35
36
  version_requirements: !ruby/object:Gem::Requirement
36
37
  requirements:
37
38
  - - '='
38
39
  - !ruby/object:Gem::Version
39
- version: 3.3.7
40
+ version: 3.3.8
40
41
  description: Ruby/CairoGObject is a Ruby binding of cairo-gobject.
41
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
42
43
  executables: []