gdk3 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43cdf70dcfe8628796bdbba8afbfd9a5b02a4e9d
4
- data.tar.gz: 0c8679eb6c85998ea1226770e5173fbdc4d6dc85
3
+ metadata.gz: 206587292098f841c7876261634760a2f8ebbf4c
4
+ data.tar.gz: 3fe6c0a45780a747239101957dac075022bb6e10
5
5
  SHA512:
6
- metadata.gz: 690e68b6d430a6c42ec97a948511a692dad8b2386b5c71a3ffc64193c7b45f9ace5994f60015f0fd537ee6481c22582adf5a84a3b0499fbf4badd7b336bb72a6
7
- data.tar.gz: 9fdc98cb39f43654fc0046a8a4bf51be0c131ea17dd85c5a91b9eced376ff67cbaf974de84ff6724e2e9ce0129f1fa7cddb8ca6efa09df5a6dd908dc59e0f21e
6
+ metadata.gz: d642f1ba249355265e7588ea0a1db639d0eb410dfb4b62d3d7842243b26b6dac3c8b4663d2b2015f7ba604d4d91af6daa9383d22e3db4746d6886fc825de3796
7
+ data.tar.gz: f185d5c116462036b2fbf9d0eb5072c29a9b2f7f4ae9aa5cfcb9a45c748ff3deee6e010b9a3aa3e48af7c717de67a458580683a85d0e3af2879ecaf2e9e6bc31
data/Rakefile CHANGED
@@ -59,7 +59,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
59
59
  :name => "gtk+",
60
60
  :download_site => :gnome,
61
61
  :label => "GTK+",
62
- :version => "3.22.7",
62
+ :version => "3.22.12",
63
63
  :compression_method => "xz",
64
64
  :windows => {
65
65
  :configure_args => [
@@ -89,7 +89,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
89
89
  :name => "adwaita-icon-theme",
90
90
  :download_site => :gnome,
91
91
  :label => "adwaita-icon-theme",
92
- :version => "3.22.0",
92
+ :version => "3.24.0",
93
93
  :compression_method => "xz",
94
94
  :windows => {
95
95
  :use_gobject_introspection => false,
@@ -0,0 +1,43 @@
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
+ require "pkg-config"
18
+ require "native-package-installer"
19
+
20
+ case RUBY_PLATFORM
21
+ when /mingw|mswin/
22
+ task :default => "nothing"
23
+ else
24
+ task :default => "dependency:check"
25
+ end
26
+
27
+ task :nothing do
28
+ end
29
+
30
+ namespace :dependency do
31
+ desc "Check dependency"
32
+ task :check do
33
+ unless PKGConfig.check_version?("gdk-3.0")
34
+ unless NativePackageInstaller.install(:altlinux => "libgtk+3-devel",
35
+ :debian => "libgtk-3-dev",
36
+ :fedora => "gtk3-devel",
37
+ :homebrew => "gtk+3",
38
+ :macports => "gtk3")
39
+ exit(false)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,117 @@
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
+ module Gdk
18
+ module EventAxisReader
19
+ def get_axis(type)
20
+ found, value = super(type)
21
+ if found
22
+ value
23
+ else
24
+ nil
25
+ end
26
+ end
27
+ end
28
+
29
+ module EventButtonReader
30
+ def button
31
+ found, value = super
32
+ if found
33
+ value
34
+ else
35
+ nil
36
+ end
37
+ end
38
+ end
39
+
40
+ module EventStateReader
41
+ def state
42
+ found, value = super
43
+ if found
44
+ value
45
+ else
46
+ nil
47
+ end
48
+ end
49
+ end
50
+
51
+ module EventCoordsReader
52
+ def coords
53
+ found, x, y = super
54
+ if found
55
+ [x, y]
56
+ else
57
+ nil
58
+ end
59
+ end
60
+
61
+ def x
62
+ (coords || [])[0]
63
+ end
64
+
65
+ def y
66
+ (coords || [])[1]
67
+ end
68
+
69
+ def get_distance(other_event)
70
+ calculated, distance = Event.get_distance(self, other_event)
71
+ if calculated
72
+ distance
73
+ else
74
+ nil
75
+ end
76
+ end
77
+
78
+ def get_angle(other_event)
79
+ calculated, angle = Event.get_angle(self, other_event)
80
+ if calculated
81
+ angle
82
+ else
83
+ nil
84
+ end
85
+ end
86
+
87
+ def center
88
+ calculated, x, y = super
89
+ if calculated
90
+ [x, y]
91
+ else
92
+ nil
93
+ end
94
+ end
95
+ end
96
+
97
+ module EventRootCoordsReader
98
+ def root_coords
99
+ found, x, y = super
100
+ if found
101
+ [x, y]
102
+ else
103
+ nil
104
+ end
105
+ end
106
+
107
+ def x_root
108
+ (root_coords || [])[0]
109
+ end
110
+ alias_method :root_x, :x_root
111
+
112
+ def y_root
113
+ (root_coords || [])[1]
114
+ end
115
+ alias_method :root_y, :y_root
116
+ end
117
+ end
data/lib/gdk3/event.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2014-2017 Ruby-GNOME2 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
@@ -28,6 +28,13 @@ module Gdk
28
28
  end
29
29
  end
30
30
 
31
+ class EventButton
32
+ def click_count
33
+ _, number = get_click_count
34
+ number
35
+ end
36
+ end
37
+
31
38
  class EventFocus
32
39
  alias_method :in_raw=, :in=
33
40
  def in=(value)
@@ -45,4 +52,50 @@ module Gdk
45
52
  not in_raw.zero?
46
53
  end
47
54
  end
55
+
56
+ class EventKey
57
+ alias_method :keyval_raw, :keyval
58
+ def keyval
59
+ found, value = keyval_raw
60
+ if found
61
+ value
62
+ else
63
+ nil
64
+ end
65
+ end
66
+
67
+ alias_method :keycode_raw, :keycode
68
+ def keycode
69
+ found, value = keycode_raw
70
+ if found
71
+ value
72
+ else
73
+ nil
74
+ end
75
+ end
76
+ end
77
+
78
+ class EventScroll
79
+ def direction
80
+ found, value = scroll_direction
81
+ if found
82
+ value
83
+ else
84
+ nil
85
+ end
86
+ end
87
+
88
+ def deltas
89
+ found, x, y = scroll_deltas
90
+ if found
91
+ [x, y]
92
+ else
93
+ nil
94
+ end
95
+ end
96
+
97
+ if method_defined?(:scroll_stop_event?)
98
+ alias_method :stop_event?, :scroll_stop_event?
99
+ end
100
+ end
48
101
  end
data/lib/gdk3/loader.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2015 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2017 Ruby-GNOME2 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
@@ -16,6 +16,10 @@
16
16
 
17
17
  module Gdk
18
18
  class Loader < GObjectIntrospection::Loader
19
+ def load
20
+ super("Gdk")
21
+ end
22
+
19
23
  private
20
24
  def window_class
21
25
  @window_class ||= @base_module.const_get(:Window)
@@ -34,6 +38,7 @@ module Gdk
34
38
  setup_pending_rectangle_functions
35
39
  define_keyval_module
36
40
  define_selection_module
41
+ require_pre_libraries
37
42
  end
38
43
 
39
44
  def define_keyval_module
@@ -46,10 +51,14 @@ module Gdk
46
51
  @base_module.const_set("Selection", @selection_module)
47
52
  end
48
53
 
54
+ def require_pre_libraries
55
+ require "gdk3/event-readers"
56
+ end
57
+
49
58
  def post_load(repository, namespace)
50
59
  apply_pending_constants
51
60
  apply_pending_rectangle_functions
52
- require_libraries
61
+ require_post_libraries
53
62
  convert_event_classes
54
63
  define_selection_constants
55
64
  end
@@ -111,7 +120,7 @@ module Gdk
111
120
  nil
112
121
  end
113
122
 
114
- def require_libraries
123
+ def require_post_libraries
115
124
  require "gdk3/atom"
116
125
  require "gdk3/color"
117
126
  require "gdk3/cursor"
@@ -222,8 +231,11 @@ module Gdk
222
231
  when "request_motions"
223
232
  define_method(info, event_motion_class, "request")
224
233
  else
225
- super # TODO
234
+ # ignore because moved to Gdk::Event
226
235
  end
236
+ when /\Aevents_/
237
+ method_name = rubyish_method_name(info, :prefix => "events_")
238
+ define_singleton_method(event_class, method_name, info)
227
239
  when /\Acairo_/
228
240
  name = $POSTMATCH
229
241
  case name
@@ -289,5 +301,39 @@ module Gdk
289
301
  super
290
302
  end
291
303
  end
304
+
305
+ def load_field(info, i, field_info, klass)
306
+ return super unless klass.name.start_with?("Gdk::Event")
307
+
308
+ field_name = field_info.name
309
+ if klass.name == "Gdk::Event"
310
+ super if field_name == "type"
311
+ return
312
+ end
313
+
314
+ case field_name
315
+ when "window", "direction"
316
+ super(info, i, field_info, klass, :readable => false)
317
+ when "axes"
318
+ klass.__send__(:prepend, EventAxisReader)
319
+ when "button"
320
+ klass.__send__(:prepend, EventButtonReader)
321
+ when "state"
322
+ case klass.name
323
+ when "Gdk::EventProperty", "Gdk::EventVisibility"
324
+ super
325
+ else
326
+ klass.__send__(:prepend, EventStateReader)
327
+ end
328
+ when "x"
329
+ klass.__send__(:prepend, EventCoordsReader)
330
+ when "x_root"
331
+ klass.__send__(:prepend, EventRootCoordsReader)
332
+ else
333
+ unless klass.method_defined?(field_name)
334
+ super
335
+ end
336
+ end
337
+ end
292
338
  end
293
339
  end
@@ -0,0 +1,27 @@
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
+ module Gdk
18
+ class X11Loader < GObjectIntrospection::Loader
19
+ def load
20
+ begin
21
+ super("GdkX11")
22
+ rescue GObjectIntrospection::RepositoryError::TypelibNotFound
23
+ # Ignore. Some environments such as Windows don't have it.
24
+ end
25
+ end
26
+ end
27
+ end
data/lib/gdk3.rb CHANGED
@@ -28,6 +28,7 @@ vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
28
28
  GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
29
29
 
30
30
  require "gdk3/loader"
31
+ require "gdk3/x11-loader"
31
32
 
32
33
  module Gdk
33
34
  LOG_DOMAIN = "Gdk"
@@ -53,7 +54,9 @@ module Gdk
53
54
  remove_method(:const_missing)
54
55
  end
55
56
  loader = Loader.new(self)
56
- loader.load("Gdk")
57
+ loader.load
58
+ x11_loader = X11Loader.new(self)
59
+ x11_loader.load
57
60
  if Object.const_defined?(:Gtk) and Gtk.respond_to?(:init)
58
61
  Gtk.init
59
62
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -180,10 +178,8 @@ class TestGdkEvent < Test::Unit::TestCase
180
178
  assert_kind_of(Float, @touch.y)
181
179
  end
182
180
 
183
- def test_axes
184
- assert_nothing_raised do
185
- @touch.axes
186
- end
181
+ def test_axis
182
+ assert_kind_of(Numeric, @touch.get_axis(:x))
187
183
  end
188
184
 
189
185
  def test_state
@@ -409,11 +405,11 @@ class TestGdkEvent < Test::Unit::TestCase
409
405
  end
410
406
 
411
407
  def test_x
412
- assert_kind_of(Integer, @configure.x)
408
+ assert_kind_of(Numeric, @configure.x)
413
409
  end
414
410
 
415
411
  def test_y
416
- assert_kind_of(Integer, @configure.y)
412
+ assert_kind_of(Numeric, @configure.y)
417
413
  end
418
414
 
419
415
  def test_width
@@ -552,11 +548,11 @@ class TestGdkEvent < Test::Unit::TestCase
552
548
  end
553
549
 
554
550
  def test_x_root
555
- assert_kind_of(Integer, @dnd.x_root)
551
+ assert_kind_of(Numeric, @dnd.x_root)
556
552
  end
557
553
 
558
554
  def test_y_root
559
- assert_kind_of(Integer, @dnd.y_root)
555
+ assert_kind_of(Numeric, @dnd.y_root)
560
556
  end
561
557
  end
562
558
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdk3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
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: 2017-01-26 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pango
@@ -16,69 +16,72 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.1
19
+ version: 3.1.2
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.1.1
26
+ version: 3.1.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gdk_pixbuf2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.1
33
+ version: 3.1.2
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.1
40
+ version: 3.1.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cairo-gobject
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.1.1
47
+ version: 3.1.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 3.1.1
54
+ version: 3.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: gobject-introspection
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 3.1.1
61
+ version: 3.1.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 3.1.1
68
+ version: 3.1.2
69
69
  description: Ruby/GDK3 is a Ruby binding of GDK-3.x.
70
70
  email: ruby-gnome2-devel-en@lists.sourceforge.net
71
71
  executables: []
72
- extensions: []
72
+ extensions:
73
+ - dependency-check/Rakefile
73
74
  extra_rdoc_files: []
74
75
  files:
75
76
  - Rakefile
77
+ - dependency-check/Rakefile
76
78
  - lib/gdk3.rb
77
79
  - lib/gdk3/atom.rb
78
80
  - lib/gdk3/cairo.rb
79
81
  - lib/gdk3/color.rb
80
82
  - lib/gdk3/cursor.rb
81
83
  - lib/gdk3/deprecated.rb
84
+ - lib/gdk3/event-readers.rb
82
85
  - lib/gdk3/event.rb
83
86
  - lib/gdk3/loader.rb
84
87
  - lib/gdk3/rectangle.rb
@@ -86,6 +89,7 @@ files:
86
89
  - lib/gdk3/screen.rb
87
90
  - lib/gdk3/window-attr.rb
88
91
  - lib/gdk3/window.rb
92
+ - lib/gdk3/x11-loader.rb
89
93
  - test/fixture/ruby-gnome2-logo.png
90
94
  - test/gdk-test-utils.rb
91
95
  - test/run-test.rb
@@ -105,7 +109,7 @@ files:
105
109
  - test/test-gdk-window-attr.rb
106
110
  homepage: http://ruby-gnome2.sourceforge.jp/
107
111
  licenses:
108
- - LGPLv2.1+
112
+ - LGPL-2.1+
109
113
  metadata: {}
110
114
  post_install_message:
111
115
  rdoc_options: []