x11 0.0.1a1 → 0.0.1a2

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.
Files changed (52) hide show
  1. data/lib/X11/X.rb +3 -0
  2. data/lib/X11/X/c.rb +16 -15
  3. data/lib/X11/Xatom.rb +167 -0
  4. data/lib/X11/Xatom/c.rb +52 -0
  5. data/lib/X11/Xdefs/c.rb +10 -6
  6. data/lib/X11/Xlib.rb +6 -0
  7. data/lib/X11/Xlib/c/functions.rb +15 -0
  8. data/lib/X11/Xlib/c/type/key_sym.rb +47 -0
  9. data/lib/X11/Xlib/c/type/status.rb +47 -0
  10. data/lib/X11/Xlib/c/types.rb +2 -0
  11. data/lib/X11/Xlib/display.rb +128 -28
  12. data/lib/X11/Xlib/event.rb +15 -0
  13. data/lib/X11/Xlib/event/generic_event.rb +1 -1
  14. data/lib/X11/Xlib/event/helper.rb +19 -13
  15. data/lib/X11/Xlib/exceptions.rb +37 -0
  16. data/lib/X11/Xlib/hints.rb +49 -0
  17. data/lib/X11/Xlib/hints/flags.rb +42 -0
  18. data/lib/X11/Xlib/hints/icon.rb +44 -0
  19. data/lib/X11/Xlib/keysym.rb +53 -0
  20. data/lib/X11/Xlib/mask.rb +52 -40
  21. data/lib/X11/Xlib/revert_to.rb +37 -0
  22. data/lib/X11/Xlib/screen.rb +12 -1
  23. data/lib/X11/Xlib/status.rb +93 -0
  24. data/lib/X11/Xlib/transform.rb +58 -0
  25. data/lib/X11/Xlib/window.rb +164 -51
  26. data/lib/X11/Xlib/window/properties.rb +66 -0
  27. data/lib/X11/Xlib/window/properties/property.rb +98 -0
  28. data/lib/X11/Xlib/window/properties/property/class.rb +37 -0
  29. data/lib/X11/Xlib/window/properties/property/command.rb +37 -0
  30. data/lib/X11/Xlib/window/properties/property/net_virtual_root.rb +39 -0
  31. data/lib/X11/Xlib/window/properties/property/parser.rb +69 -0
  32. data/lib/X11/Xlib/window/properties/property/parser/arc.rb +41 -0
  33. data/lib/X11/Xlib/window/properties/property/parser/atom.rb +35 -0
  34. data/lib/X11/Xlib/window/properties/property/parser/cardinal.rb +34 -0
  35. data/lib/X11/Xlib/window/properties/property/parser/hints.rb +41 -0
  36. data/lib/X11/Xmd/c.rb +14 -12
  37. data/lib/X11/Xutil.rb +41 -0
  38. data/lib/X11/Xutil/c.rb +33 -0
  39. data/lib/X11/Xutil/c/functions.rb +37 -0
  40. data/lib/X11/Xutil/c/type/class_hint.rb +33 -0
  41. data/lib/X11/Xutil/c/type/text_property.rb +35 -0
  42. data/lib/X11/Xutil/c/types.rb +30 -0
  43. data/lib/X11/Xutil/window.rb +61 -0
  44. data/lib/X11/cursorfont.rb +31 -0
  45. data/lib/X11/cursorfont/c.rb +41 -0
  46. data/lib/X11/cursorfont/font.rb +147 -0
  47. data/lib/X11/extensions.rb +81 -16
  48. data/lib/X11/keysym.rb +47 -0
  49. data/lib/X11/simple.rb +33 -0
  50. data/lib/X11/simple/display.rb +64 -0
  51. data/lib/X11/simple/window.rb +45 -0
  52. metadata +63 -5
@@ -0,0 +1,66 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ require 'X11/Xlib/window/properties/property'
30
+
31
+ module X11; class Window
32
+
33
+ class Properties
34
+ include Enumerable
35
+ extend Forwardable
36
+
37
+ attr_reader :window
38
+ def_delegators :@window, :display
39
+
40
+ def initialize (window)
41
+ @window = window
42
+ end
43
+
44
+ def each (&block)
45
+ number = FFI::MemoryPointer.new :int
46
+ list = C::XListProperties(display.to_ffi, window.to_ffi, number)
47
+
48
+ return if list.null?
49
+
50
+ list.read_array_of(:Atom, number.typecast(:int)).each {|atom|
51
+ block.call Property.new(window, Atom.new(atom.to_i, display))
52
+ }
53
+
54
+ C::XFree(list)
55
+
56
+ self
57
+ end
58
+
59
+ def [] (name)
60
+ find {|property|
61
+ property.name == name.to_s
62
+ }
63
+ end
64
+ end
65
+
66
+ end; end
@@ -0,0 +1,98 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ require 'X11/Xlib/window/properties/property/parser'
30
+
31
+ module X11; class Window; class Properties
32
+
33
+ class Property
34
+ @transforms = {
35
+ :default => Transform.new(:default) {
36
+ input do |property, data|
37
+ data
38
+ end
39
+
40
+ output do |property, data|
41
+ data
42
+ end
43
+ }
44
+ }
45
+
46
+ def self.register (name, &block)
47
+ @transforms[name.to_s] = Transform.new(name, &block)
48
+ end
49
+
50
+ def self.transform (property)
51
+ (@transforms[property.name] || @transforms[:default]).for(property)
52
+ end
53
+
54
+ MaxLength = 500000
55
+
56
+ extend Forwardable
57
+
58
+ attr_reader :window, :atom, :value
59
+ def_delegators :@window, :display
60
+ def_delegators :@atom, :to_s, :to_i, :to_ffi
61
+ def_delegator :@atom, :to_s, :name
62
+
63
+ def initialize (window, atom)
64
+ @window = window
65
+ @atom = atom
66
+
67
+ @value = Retarded.new {
68
+ type = FFI::MemoryPointer.new :Atom
69
+ format = FFI::MemoryPointer.new :int
70
+ length = FFI::MemoryPointer.new :ulong
71
+ after = FFI::MemoryPointer.new :ulong
72
+ property = FFI::MemoryPointer.new :pointer
73
+
74
+ return unless C::XGetWindowProperty(display.to_ffi, window.to_ffi, atom.to_ffi,
75
+ 0, (MaxLength + 3) / 4, false, AnyProperty, type, format, length, after, property).ok?
76
+
77
+ size = format.typecast(:int)
78
+ length = [length.typecast(:ulong) * FFI.type_size({ 8 => :char, 16 => :short, 32 => :long }[size]), MaxLength].min
79
+
80
+ @type = Atom.new(type.typecast(:Atom).to_i, display)
81
+
82
+ Property.transform(self).output(Property::Parser.parse(self, property.typecast(:pointer).read_string(length)))
83
+ }
84
+ end
85
+
86
+ def type
87
+ @type or (~@value; @type)
88
+ end
89
+
90
+ def inspect
91
+ "#<X11::Window::Property(#{name}): #{type}#{" #{value.inspect}" unless value.nil?}>"
92
+ end
93
+ end
94
+
95
+ end; end; end
96
+
97
+ require 'X11/Xlib/window/properties/property/class'
98
+ require 'X11/Xlib/window/properties/property/command'
@@ -0,0 +1,37 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties
30
+
31
+ Property.register :WM_CLASS do
32
+ output do |property, data|
33
+ data.split("\0").compact
34
+ end
35
+ end
36
+
37
+ end; end; end
@@ -0,0 +1,37 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties
30
+
31
+ Property.register :WM_COMMAND do
32
+ output do |property, data|
33
+ data.split("\0").compact
34
+ end
35
+ end
36
+
37
+ end; end; end
@@ -0,0 +1,39 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties
30
+
31
+ Property.register :_NET_VIRTUAL_ROOTS do
32
+ output do |property, data|
33
+ data.unpack('L!' * (data.length / FFI.type_size(:long))).map {|win|
34
+ Window.new(property.display, win)
35
+ }
36
+ end
37
+ end
38
+
39
+ end; end; end
@@ -0,0 +1,69 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties; class Property
30
+
31
+ module Parser
32
+ @parsers = {}
33
+
34
+ def self.register (name, &block)
35
+ @parsers[name.to_s] = block
36
+ end
37
+
38
+ def self.parse (property, data)
39
+ return data unless @parsers[property.type.to_s]
40
+
41
+ @parsers[property.type.to_s].call(property, data)
42
+ end
43
+
44
+ def self.format (property, data, format)
45
+ data.unpack(format.chars.map {|char|
46
+ case char
47
+ when 'c' then 'L!'
48
+ when 'i', 'a', 'b' then 'l!'
49
+ else char
50
+ end
51
+ }.join).each_with_index.map {|data, index|
52
+ case format[index].chr
53
+ when 'a' then Atom.new(data, property.display)
54
+ when 'b' then !data.zero?
55
+ else data
56
+ end
57
+ }
58
+ end
59
+
60
+ def self.string (data, type)
61
+
62
+ end
63
+ end
64
+
65
+ end; end; end; end
66
+
67
+ require 'X11/Xlib/window/properties/property/parser/arc'
68
+ require 'X11/Xlib/window/properties/property/parser/atom'
69
+ require 'X11/Xlib/window/properties/property/parser/cardinal'
@@ -0,0 +1,41 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties; class Property
30
+
31
+ Parser.register :ARC do |property, data|
32
+ data = Parser.format(property, data, 'iiccii')
33
+
34
+ Struct.new(:position, :size, :angles).new(
35
+ Struct.new(:x, :y).new(data.shift, data.shift),
36
+ Struct.new(:width, :height).new(data.shift, data.shift),
37
+ Struct.new(:from, :to).new(data.shift, data.shift)
38
+ )
39
+ end
40
+
41
+ end; end; end; end
@@ -0,0 +1,35 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties; class Property
30
+
31
+ Parser.register :ATOM do |property, data|
32
+ Parser.format(property, data, 'a').first
33
+ end
34
+
35
+ end; end; end; end
@@ -0,0 +1,34 @@
1
+ #--
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice, this list
11
+ # of conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
15
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
17
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ #
24
+ # The views and conclusions contained in the software and documentation are those of the
25
+ # authors and should not be interpreted as representing official policies, either expressed
26
+ # or implied.
27
+ #++
28
+
29
+ module X11; class Window; class Properties; class Property
30
+
31
+ Parser.register :CARDINAL do |property, data|
32
+ end
33
+
34
+ end; end; end; end