x11 0.0.1a2 → 0.0.1a3
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.
- data/lib/X11/X.rb +14 -9
- data/lib/X11/X/c.rb +21 -20
- data/lib/X11/XKBlib.rb +29 -0
- data/lib/X11/Xatom.rb +152 -136
- data/lib/X11/Xatom/c.rb +15 -15
- data/lib/X11/Xdefs.rb +7 -7
- data/lib/X11/Xdefs/c.rb +20 -20
- data/lib/X11/Xlib.rb +19 -7
- data/lib/X11/Xlib/c.rb +21 -8
- data/lib/X11/Xlib/c/functions.rb +373 -27
- data/lib/X11/Xlib/c/type/any_event.rb +13 -13
- data/lib/X11/Xlib/c/type/button_event.rb +23 -23
- data/lib/X11/Xlib/c/type/circulate_event.rb +15 -15
- data/lib/X11/Xlib/c/type/circulate_request_event.rb +15 -15
- data/lib/X11/Xlib/c/type/client_message_event.rb +22 -22
- data/lib/X11/Xlib/c/type/colormap_event.rb +16 -16
- data/lib/X11/Xlib/c/type/configure_event.rb +21 -21
- data/lib/X11/Xlib/c/type/configure_request_event.rb +22 -22
- data/lib/X11/Xlib/c/type/create_window_event.rb +20 -20
- data/lib/X11/Xlib/c/type/crossing_event.rb +25 -25
- data/lib/X11/Xlib/c/type/destroy_window_event.rb +14 -14
- data/lib/X11/Xlib/c/type/display.rb +52 -52
- data/lib/X11/Xlib/c/type/error_event.rb +15 -15
- data/lib/X11/Xlib/c/type/event.rb +43 -43
- data/lib/X11/Xlib/c/type/expose_event.rb +18 -18
- data/lib/X11/Xlib/c/type/focus_change_event.rb +15 -15
- data/lib/X11/Xlib/c/type/gc.rb +10 -10
- data/lib/X11/Xlib/c/type/gc_values.rb +54 -0
- data/lib/X11/Xlib/c/type/generic_event.rb +14 -14
- data/lib/X11/Xlib/c/type/generic_event_cookie.rb +16 -16
- data/lib/X11/Xlib/c/type/graphics_expose_event.rb +21 -21
- data/lib/X11/Xlib/c/type/gravity_event.rb +16 -16
- data/lib/X11/Xlib/c/type/image.rb +56 -0
- data/lib/X11/Xlib/c/type/key_event.rb +23 -23
- data/lib/X11/Xlib/c/type/key_sym.rb +15 -15
- data/lib/X11/Xlib/c/type/keymap_event.rb +14 -14
- data/lib/X11/Xlib/c/type/map_event.rb +15 -15
- data/lib/X11/Xlib/c/type/map_request_event.rb +18 -18
- data/lib/X11/Xlib/c/type/mapping_event.rb +16 -16
- data/lib/X11/Xlib/c/type/motion_event.rb +23 -23
- data/lib/X11/Xlib/c/type/no_expose_event.rb +15 -15
- data/lib/X11/Xlib/c/type/point.rb +33 -0
- data/lib/X11/Xlib/c/type/property_event.rb +16 -16
- data/lib/X11/Xlib/c/type/reparent_event.rb +18 -18
- data/lib/X11/Xlib/c/type/resize_request_event.rb +15 -15
- data/lib/X11/Xlib/c/type/screen.rb +27 -27
- data/lib/X11/Xlib/c/type/selection_clear_event.rb +15 -15
- data/lib/X11/Xlib/c/type/selection_event.rb +17 -17
- data/lib/X11/Xlib/c/type/selection_request_event.rb +18 -18
- data/lib/X11/Xlib/c/type/status.rb +15 -15
- data/lib/X11/Xlib/c/type/unmap_event.rb +15 -15
- data/lib/X11/Xlib/c/type/visibility_event.rb +14 -14
- data/lib/X11/Xlib/c/type/visual.rb +16 -16
- data/lib/X11/Xlib/c/type/window_attributes.rb +31 -31
- data/lib/X11/Xlib/c/types.rb +9 -7
- data/lib/X11/Xlib/display.rb +257 -174
- data/lib/X11/Xlib/display/extensions.rb +56 -0
- data/lib/X11/Xlib/drawable.rb +48 -0
- data/lib/X11/Xlib/error.rb +100 -0
- data/lib/X11/Xlib/event.rb +66 -37
- data/lib/X11/Xlib/event/any.rb +8 -10
- data/lib/X11/Xlib/event/button_press.rb +9 -20
- data/lib/X11/Xlib/event/button_release.rb +9 -20
- data/lib/X11/Xlib/event/circulate_notify.rb +11 -12
- data/lib/X11/Xlib/event/circulate_request.rb +11 -12
- data/lib/X11/Xlib/event/client_message.rb +11 -13
- data/lib/X11/Xlib/event/colormap_notify.rb +12 -13
- data/lib/X11/Xlib/event/configure_notify.rb +17 -18
- data/lib/X11/Xlib/event/configure_request.rb +18 -19
- data/lib/X11/Xlib/event/create_notify.rb +16 -17
- data/lib/X11/Xlib/event/destroy_notify.rb +10 -11
- data/lib/X11/Xlib/event/enter_notify.rb +10 -8
- data/lib/X11/Xlib/event/expose.rb +15 -16
- data/lib/X11/Xlib/event/focus_in.rb +9 -12
- data/lib/X11/Xlib/event/focus_out.rb +9 -12
- data/lib/X11/Xlib/event/generic.rb +35 -0
- data/lib/X11/Xlib/event/generic/button.rb +46 -0
- data/lib/X11/Xlib/event/generic/crossing.rb +48 -0
- data/lib/X11/Xlib/{window/properties/property/class.rb → event/generic/focus_change.rb} +16 -14
- data/lib/X11/Xlib/event/generic/key.rb +46 -0
- data/lib/X11/Xlib/event/generic/motion.rb +46 -0
- data/lib/X11/Xlib/event/generic_event.rb +12 -14
- data/lib/X11/Xlib/event/graphics_expose.rb +15 -14
- data/lib/X11/Xlib/event/gravity_notify.rb +12 -13
- data/lib/X11/Xlib/event/helper.rb +123 -91
- data/lib/X11/Xlib/event/key_press.rb +9 -20
- data/lib/X11/Xlib/event/key_release.rb +9 -20
- data/lib/X11/Xlib/event/keymap_notify.rb +13 -14
- data/lib/X11/Xlib/event/leave_notify.rb +10 -20
- data/lib/X11/Xlib/event/map_notify.rb +11 -12
- data/lib/X11/Xlib/event/map_request.rb +10 -11
- data/lib/X11/Xlib/event/mapping_notify.rb +11 -13
- data/lib/X11/Xlib/event/motion_notify.rb +10 -20
- data/lib/X11/Xlib/event/no_expose.rb +8 -9
- data/lib/X11/Xlib/event/property_notify.rb +12 -13
- data/lib/X11/Xlib/event/reparent_notify.rb +14 -15
- data/lib/X11/Xlib/event/resize_request.rb +11 -12
- data/lib/X11/Xlib/event/selection_clear.rb +10 -12
- data/lib/X11/Xlib/event/selection_notify.rb +13 -15
- data/lib/X11/Xlib/event/selection_request.rb +14 -16
- data/lib/X11/Xlib/event/unmap_notify.rb +11 -12
- data/lib/X11/Xlib/event/visibility_notify.rb +10 -11
- data/lib/X11/Xlib/events.rb +11 -7
- data/lib/X11/Xlib/exceptions.rb +10 -10
- data/lib/X11/Xlib/graphic_context.rb +69 -0
- data/lib/X11/Xlib/graphic_context/functions.rb +50 -0
- data/lib/X11/Xlib/{window/properties/property/command.rb → graphic_context/values.rb} +17 -13
- data/lib/X11/Xlib/hints.rb +19 -18
- data/lib/X11/Xlib/hints/flags.rb +15 -15
- data/lib/X11/Xlib/hints/icon.rb +14 -16
- data/lib/X11/Xlib/id.rb +75 -0
- data/lib/X11/Xlib/image.rb +64 -0
- data/lib/X11/Xlib/keysym.rb +53 -26
- data/lib/X11/Xlib/mask.rb +81 -55
- data/lib/X11/Xlib/pixmap.rb +60 -0
- data/lib/X11/Xlib/planes.rb +50 -0
- data/lib/X11/Xlib/revert_to.rb +10 -10
- data/lib/X11/Xlib/screen.rb +48 -31
- data/lib/X11/Xlib/status.rb +56 -56
- data/lib/X11/Xlib/transform.rb +25 -25
- data/lib/X11/Xlib/visual.rb +19 -19
- data/lib/X11/Xlib/window.rb +399 -188
- data/lib/X11/Xlib/window/attributes.rb +74 -41
- data/lib/X11/Xlib/window/properties.rb +57 -38
- data/lib/X11/Xlib/window/properties/property.rb +135 -70
- data/lib/X11/Xlib/window/properties/property/net_virtual_root.rb +13 -13
- data/lib/X11/Xlib/window/properties/property/parser.rb +45 -35
- data/lib/X11/Xlib/window/properties/property/parser/arc.rb +18 -16
- data/lib/X11/Xlib/window/properties/property/parser/atom.rb +14 -10
- data/lib/X11/Xlib/window/properties/property/parser/cardinal.rb +14 -9
- data/lib/X11/Xlib/window/properties/property/parser/hints.rb +17 -16
- data/lib/X11/Xlib/window/properties/property/parser/integer.rb +39 -0
- data/lib/X11/Xlib/window/properties/property/parser/state.rb +39 -0
- data/lib/X11/Xlib/window/properties/property/parser/string.rb +59 -0
- data/lib/X11/Xlib/window/properties/property/parser/window.rb +39 -0
- data/lib/X11/Xmd.rb +7 -7
- data/lib/X11/Xmd/c.rb +19 -19
- data/lib/X11/Xregion.rb +32 -0
- data/lib/X11/Xregion/c.rb +29 -0
- data/lib/X11/Xregion/c/type/box.rb +35 -0
- data/lib/X11/Xregion/c/type/point_block.rb +33 -0
- data/lib/X11/Xregion/c/type/rectangle.rb +35 -0
- data/lib/X11/Xregion/c/type/region.rb +35 -0
- data/lib/X11/Xregion/c/types.rb +32 -0
- data/lib/X11/Xutil.rb +12 -17
- data/lib/X11/Xutil/c.rb +7 -10
- data/lib/X11/Xutil/c/functions.rb +7 -7
- data/lib/X11/Xutil/c/type/class_hint.rb +10 -10
- data/lib/X11/Xutil/c/type/region.rb +31 -0
- data/lib/X11/Xutil/c/type/text_property.rb +12 -12
- data/lib/X11/Xutil/c/types.rb +8 -7
- data/lib/X11/Xutil/state.rb +43 -0
- data/lib/X11/Xutil/window.rb +28 -28
- data/lib/X11/cursorfont.rb +7 -7
- data/lib/X11/cursorfont/c.rb +8 -8
- data/lib/X11/cursorfont/font.rb +113 -113
- data/lib/X11/extension.rb +65 -0
- data/lib/X11/extensions.rb +105 -126
- data/lib/X11/extensions/Xrandr.rb +49 -0
- data/lib/X11/extensions/Xrandr/c.rb +30 -0
- data/lib/X11/extensions/Xrandr/c/functions.rb +106 -0
- data/lib/X11/extensions/Xrandr/c/type/crtc_gamma.rb +35 -0
- data/lib/X11/extensions/Xrandr/c/type/crtc_info.rb +43 -0
- data/lib/X11/extensions/Xrandr/c/type/crtc_transform_attributes.rb +39 -0
- data/lib/X11/extensions/Xrandr/c/type/mode_info.rb +45 -0
- data/lib/X11/extensions/Xrandr/c/type/output_info.rb +46 -0
- data/lib/X11/extensions/Xrandr/c/type/panning.rb +44 -0
- data/lib/X11/extensions/Xrandr/c/type/property_info.rb +36 -0
- data/lib/X11/extensions/Xrandr/c/type/screen_resources.rb +39 -0
- data/lib/X11/extensions/Xrandr/c/type/screen_size.rb +35 -0
- data/lib/X11/extensions/Xrandr/c/types.rb +48 -0
- data/lib/X11/extensions/Xrandr/crtc.rb +70 -0
- data/lib/X11/extensions/Xrandr/crtc/gamma.rb +100 -0
- data/lib/X11/extensions/Xrandr/crtc/info.rb +62 -0
- data/lib/X11/extensions/Xrandr/crtc/panning.rb +74 -0
- data/lib/X11/extensions/Xrandr/event.rb +29 -0
- data/lib/X11/extensions/Xrandr/output.rb +59 -0
- data/lib/X11/extensions/Xrandr/output/info.rb +105 -0
- data/lib/X11/extensions/Xrandr/output/properties.rb +78 -0
- data/lib/X11/extensions/Xrandr/output/properties/property.rb +161 -0
- data/lib/X11/extensions/Xrandr/output/properties/property/info.rb +73 -0
- data/lib/X11/extensions/Xrandr/output/properties/property/parser.rb +73 -0
- data/lib/X11/extensions/Xrandr/output/properties/property/parser/atom.rb +39 -0
- data/lib/X11/extensions/Xrandr/output/properties/property/parser/integer.rb +43 -0
- data/lib/X11/extensions/Xrandr/screen.rb +49 -0
- data/lib/X11/extensions/Xrandr/screen/backlight.rb +76 -0
- data/lib/X11/extensions/Xrandr/screen_resources.rb +81 -0
- data/lib/X11/extensions/Xrandr/window.rb +41 -0
- data/lib/X11/extensions/Xrender.rb +34 -0
- data/lib/X11/extensions/Xrender/c.rb +30 -0
- data/lib/X11/extensions/Xrender/c/functions.rb +50 -0
- data/lib/X11/extensions/Xrender/c/type/anim_cursor.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/circle.rb +34 -0
- data/lib/X11/extensions/Xrender/c/type/conical_gradient.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/filters.rb +35 -0
- data/lib/X11/extensions/Xrender/c/type/glyph_elt16.rb +36 -0
- data/lib/X11/extensions/Xrender/c/type/glyph_elt32.rb +36 -0
- data/lib/X11/extensions/Xrender/c/type/glyph_elt8.rb +36 -0
- data/lib/X11/extensions/Xrender/c/type/glyph_info.rb +37 -0
- data/lib/X11/extensions/Xrender/c/type/index_value.rb +36 -0
- data/lib/X11/extensions/Xrender/c/type/line_fixed.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/linear_gradient.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/point_double.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/point_fixed.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/radial_gradient.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/render_color.rb +35 -0
- data/lib/X11/extensions/Xrender/c/type/render_direct_format.rb +39 -0
- data/lib/X11/extensions/Xrender/c/type/render_pict_format.rb +36 -0
- data/lib/X11/extensions/Xrender/c/type/render_picture_attributes.rb +44 -0
- data/lib/X11/extensions/Xrender/c/type/span_fix.rb +34 -0
- data/lib/X11/extensions/Xrender/c/type/transform.rb +32 -0
- data/lib/X11/extensions/Xrender/c/type/trap.rb +33 -0
- data/lib/X11/extensions/Xrender/c/type/trapezoid.rb +35 -0
- data/lib/X11/extensions/Xrender/c/type/triangle.rb +34 -0
- data/lib/X11/extensions/Xrender/c/types.rb +56 -0
- data/lib/X11/extensions/Xrender/mask.rb +48 -0
- data/lib/X11/extensions/randr.rb +29 -0
- data/lib/X11/extensions/randr/c.rb +38 -0
- data/lib/X11/extensions/render.rb +29 -0
- data/lib/X11/extensions/render/c.rb +34 -0
- data/lib/X11/extensions/xf86vmode.rb +42 -0
- data/lib/X11/extensions/xf86vmode/c.rb +30 -0
- data/lib/X11/extensions/xf86vmode/c/functions.rb +59 -0
- data/lib/X11/extensions/xf86vmode/c/type/gamma.rb +34 -0
- data/lib/X11/extensions/xf86vmode/c/type/mode_info.rb +44 -0
- data/lib/X11/extensions/xf86vmode/c/type/mode_line.rb +43 -0
- data/lib/X11/extensions/xf86vmode/c/type/monitor.rb +38 -0
- data/lib/X11/extensions/xf86vmode/c/type/sync_range.rb +33 -0
- data/lib/X11/extensions/xf86vmode/c/types.rb +36 -0
- data/lib/X11/extensions/xf86vmode/screen.rb +53 -0
- data/lib/X11/extensions/xf86vmode/screen/gamma.rb +79 -0
- data/lib/X11/extensions/xf86vmode/screen/gamma/ramp.rb +86 -0
- data/lib/X11/keysym.rb +7 -25
- data/lib/X11/misc/temperature.rb +458 -0
- data/lib/X11/simple.rb +8 -7
- data/lib/X11/simple/display.rb +35 -37
- data/lib/X11/simple/window.rb +39 -19
- data/lib/X11/window_manager.rb +32 -0
- data/lib/X11/window_manager/desktops.rb +82 -0
- data/lib/X11/window_manager/desktops/desktop.rb +78 -0
- data/lib/X11/window_manager/supports.rb +56 -0
- data/lib/X11/window_manager/supports/feature.rb +46 -0
- data/lib/X11/window_manager/window.rb +102 -0
- data/lib/X11/window_manager/window_manager.rb +73 -0
- metadata +216 -66
data/lib/X11/Xlib/transform.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
#--
|
2
2
|
# Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
|
3
|
-
#
|
3
|
+
#
|
4
4
|
# Redistribution and use in source and binary forms, with or without modification, are
|
5
5
|
# permitted provided that the following conditions are met:
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
8
8
|
# conditions and the following disclaimer.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
11
11
|
# of conditions and the following disclaimer in the documentation and/or other materials
|
12
12
|
# provided with the distribution.
|
13
|
-
#
|
14
|
-
# THIS SOFTWARE IS PROVIDED BY
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY meh ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
15
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
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL meh OR
|
17
17
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18
18
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
19
19
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
20
20
|
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
21
21
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
22
22
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
|
-
#
|
23
|
+
#
|
24
24
|
# The views and conclusions contained in the software and documentation are those of the
|
25
25
|
# authors and should not be interpreted as representing official policies, either expressed
|
26
26
|
# or implied.
|
@@ -29,30 +29,30 @@
|
|
29
29
|
module X11
|
30
30
|
|
31
31
|
class Transform
|
32
|
-
|
32
|
+
attr_reader :name
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
def initialize (name, &block)
|
35
|
+
@name = name
|
36
|
+
@callbacks = {}
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
instance_eval &block
|
39
|
+
end
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
def for (*args)
|
42
|
+
@for = args
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
self
|
45
|
+
end
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
def method_missing (name, *args, &block)
|
48
|
+
if block
|
49
|
+
@callbacks[name] = block
|
50
|
+
else
|
51
|
+
return super unless @callbacks[name]
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
@callbacks[name].call(*@for, *args)
|
54
|
+
end
|
55
|
+
end
|
56
56
|
end
|
57
57
|
|
58
58
|
end
|
data/lib/X11/Xlib/visual.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
#--
|
2
2
|
# Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
|
3
|
-
#
|
3
|
+
#
|
4
4
|
# Redistribution and use in source and binary forms, with or without modification, are
|
5
5
|
# permitted provided that the following conditions are met:
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
8
8
|
# conditions and the following disclaimer.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
11
11
|
# of conditions and the following disclaimer in the documentation and/or other materials
|
12
12
|
# provided with the distribution.
|
13
|
-
#
|
14
|
-
# THIS SOFTWARE IS PROVIDED BY
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY meh ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
15
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
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL meh OR
|
17
17
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18
18
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
19
19
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
20
20
|
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
21
21
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
22
22
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
|
-
#
|
23
|
+
#
|
24
24
|
# The views and conclusions contained in the software and documentation are those of the
|
25
25
|
# authors and should not be interpreted as representing official policies, either expressed
|
26
26
|
# or implied.
|
@@ -29,20 +29,20 @@
|
|
29
29
|
module X11
|
30
30
|
|
31
31
|
class Visual
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
def initialize (visual)
|
33
|
+
visual = visual.typecast(C::Visual) unless visual.is_a?(C::Visual)
|
34
|
+
@visual = visual
|
35
|
+
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
C::Visual.layout.members.each_with_index {|name, index|
|
38
|
+
define_method name do
|
39
|
+
@visual[name]
|
40
|
+
end
|
41
|
+
}
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
def visual_id
|
44
|
+
@visual[:VisualID]
|
45
|
+
end
|
46
46
|
end
|
47
47
|
|
48
48
|
end
|
data/lib/X11/Xlib/window.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
#--
|
2
2
|
# Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
|
3
|
-
#
|
3
|
+
#
|
4
4
|
# Redistribution and use in source and binary forms, with or without modification, are
|
5
5
|
# permitted provided that the following conditions are met:
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
8
8
|
# conditions and the following disclaimer.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
11
11
|
# of conditions and the following disclaimer in the documentation and/or other materials
|
12
12
|
# provided with the distribution.
|
13
|
-
#
|
14
|
-
# THIS SOFTWARE IS PROVIDED BY
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY meh ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
15
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
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL meh OR
|
17
17
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18
18
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
19
19
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
20
20
|
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
21
21
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
22
22
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
|
-
#
|
23
|
+
#
|
24
24
|
# The views and conclusions contained in the software and documentation are those of the
|
25
25
|
# authors and should not be interpreted as representing official policies, either expressed
|
26
26
|
# or implied.
|
@@ -31,187 +31,398 @@ require 'X11/Xlib/window/properties'
|
|
31
31
|
|
32
32
|
module X11
|
33
33
|
|
34
|
-
class Window
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
34
|
+
class Window < Drawable
|
35
|
+
singleton_named :display, :parent, :x, :y, :width, :height, :border_width, :depth, :input_only?, :visual, :attributes, :optional => 1 .. -1, :alias => { :w => :width, :h => :height }
|
36
|
+
def self.create (display, parent=nil, x=nil, y=nil, width=nil, height=nil, border_width=nil, depth=nil, input_only=nil, visual=nil, attributes=nil)
|
37
|
+
parent ||= display.root_window
|
38
|
+
x ||= display.width / 2
|
39
|
+
y ||= display.height / 2
|
40
|
+
width ||= 320
|
41
|
+
height ||= 200
|
42
|
+
border_width ||= 0
|
43
|
+
depth ||= :copy
|
44
|
+
input_only ||= :copy
|
45
|
+
visual ||= :copy
|
46
|
+
attributes ||= Attributes.new
|
47
|
+
end
|
48
|
+
|
49
|
+
include ForwardTo
|
50
|
+
|
51
|
+
attr_reader :display, :parent, :reported_events
|
52
|
+
forward_to :attributes
|
53
|
+
|
54
|
+
def initialize (display, value)
|
55
|
+
super
|
56
|
+
|
57
|
+
@reported_events = Mask::Event[]
|
58
|
+
|
59
|
+
revert_to
|
60
|
+
end
|
61
|
+
|
62
|
+
def parent
|
63
|
+
root = FFI::MemoryPointer.new :Window
|
64
|
+
parent = FFI::MemoryPointer.new :Window
|
65
|
+
number = FFI::MemoryPointer.new :uint
|
66
|
+
children = FFI::MemoryPointer.new :pointer
|
67
|
+
|
68
|
+
C::XQueryTree(display.to_ffi, id, root, parent, children, number)
|
69
|
+
C::XFree(children.typecast(:pointer))
|
70
|
+
|
71
|
+
Window.new(display, parent.typecast(:Window))
|
72
|
+
end
|
73
|
+
|
74
|
+
named :parent, :x, :y, :optional => [:x, :y]
|
75
|
+
def reparent (parent, x=nil, y=nil)
|
76
|
+
position.tap {|p|
|
77
|
+
x ||= p.x
|
78
|
+
y ||= p.y
|
79
|
+
}
|
80
|
+
|
81
|
+
parent.tap {
|
82
|
+
C::XReparentWindow(display.to_ffi, to_ffi, parent.to_ffi, x, y)
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
def revert_to?
|
87
|
+
@revert_to
|
88
|
+
end
|
89
|
+
|
90
|
+
def revert_to (value=nil)
|
91
|
+
@revert_to = if value.is_a?(Integer)
|
92
|
+
RevertTo.key(value)
|
93
|
+
else
|
94
|
+
revert_to RevertTo[value] || 0
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def attributes
|
99
|
+
FFI::MemoryPointer.new(C::XWindowAttributes).tap! {|attr|
|
100
|
+
C::XGetWindowAttributes(display.to_ffi, to_ffi, attr)
|
101
|
+
|
102
|
+
Attributes.new(self, attr)
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
def viewable?
|
107
|
+
attributes.tap! {|attr|
|
108
|
+
!attr.input_only? && attr.viewable?
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
def properties
|
113
|
+
Properties.new(self)
|
114
|
+
end
|
115
|
+
|
116
|
+
def size
|
117
|
+
attributes.tap! {|attr|
|
118
|
+
Struct.new(:width, :height).new(attr.width, attr.height)
|
119
|
+
}
|
120
|
+
end
|
121
|
+
|
122
|
+
def position
|
123
|
+
child = FFI::MemoryPointer.new :Window
|
124
|
+
x = FFI::MemoryPointer.new :int
|
125
|
+
y = FFI::MemoryPointer.new :int
|
126
|
+
|
127
|
+
C::XTranslateCoordinates(display.to_ffi, to_ffi, root.to_ffi, 0, 0, x, y, child)
|
128
|
+
|
129
|
+
Struct.new(:x, :y).new(x.typecast(:int), y.typecast(:int))
|
130
|
+
end
|
131
|
+
|
132
|
+
named :x, :y, :optional => [:x, :y]
|
133
|
+
def move (x=nil, y=nil)
|
134
|
+
position.tap {|p|
|
135
|
+
x ||= p.x
|
136
|
+
y ||= p.y
|
137
|
+
}
|
138
|
+
|
139
|
+
C::XMoveWindow(display.to_ffi, to_ffi, x, y)
|
140
|
+
|
141
|
+
display.flush
|
142
|
+
|
143
|
+
self
|
144
|
+
end
|
145
|
+
|
146
|
+
named :width, :height, :optional => [:width, :height], :alias => { :w => :width, :h => :height }
|
147
|
+
def resize (width=nil, height=nil)
|
148
|
+
attributes.tap {|attr|
|
149
|
+
width ||= attr.width
|
150
|
+
height ||= attr.height
|
151
|
+
}
|
152
|
+
|
153
|
+
C::XResizeWindow(display.to_ffi, to_ffi, width, height)
|
154
|
+
|
155
|
+
display.flush
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
def raise
|
161
|
+
C::XRaiseWindow(display.to_ffi, to_ffi)
|
162
|
+
display.flush
|
163
|
+
self
|
164
|
+
end
|
165
|
+
|
166
|
+
def iconify
|
167
|
+
C::XIconifyWindow(display.to_ffi, to_ffi, screen.to_i)
|
168
|
+
display.flush
|
169
|
+
self
|
170
|
+
end
|
171
|
+
|
172
|
+
def withdraw
|
173
|
+
C::XWithdrawWindow(display.to_ffi, to_ffi, screen.to_i)
|
174
|
+
display.flush
|
175
|
+
self
|
176
|
+
end
|
177
|
+
|
178
|
+
def lower
|
179
|
+
C::XLowerWindow(display.to_ffi, to_ffi)
|
180
|
+
display.flush
|
181
|
+
self
|
182
|
+
end
|
183
|
+
|
184
|
+
def map (subwindows=false)
|
185
|
+
if subwindows
|
186
|
+
C::XMapSubwindows(display.to_ffi, to_ffi)
|
187
|
+
else
|
188
|
+
C::XMapWindow(display.to_ffi, to_ffi)
|
189
|
+
end
|
190
|
+
|
191
|
+
display.flush
|
192
|
+
|
193
|
+
self
|
194
|
+
end
|
195
|
+
|
196
|
+
def unmap (subwindows=false)
|
197
|
+
if subwindows
|
198
|
+
C::XMapSubwindows(display.to_ffi, to_ffi)
|
199
|
+
else
|
200
|
+
C::XMapWindow(display.to_ffi, to_ffi)
|
201
|
+
end
|
202
|
+
|
203
|
+
self
|
204
|
+
end
|
205
|
+
|
206
|
+
def destroy (subwindows=false)
|
207
|
+
if subwindows
|
208
|
+
C::XDetroyWindow(display.to_ffi, to_ffi)
|
209
|
+
else
|
210
|
+
C::XDestroySubwindows(display.to_ffi, to_ffi)
|
211
|
+
end
|
212
|
+
|
213
|
+
display.flush
|
214
|
+
make_unusable
|
215
|
+
|
216
|
+
self
|
217
|
+
end
|
218
|
+
|
219
|
+
def subwindows (deep=false)
|
220
|
+
Enumerator.new do |e|
|
221
|
+
root = FFI::MemoryPointer.new :Window
|
222
|
+
parent = FFI::MemoryPointer.new :Window
|
223
|
+
number = FFI::MemoryPointer.new :uint
|
224
|
+
children = FFI::MemoryPointer.new :pointer
|
225
|
+
|
226
|
+
C::XQueryTree(display.to_ffi, id, root, parent, children, number)
|
227
|
+
|
228
|
+
next if children.typecast(:pointer).null?
|
229
|
+
|
230
|
+
children.typecast(:pointer).read_array_of(:Window, number.typecast(:uint)).each {|win|
|
231
|
+
Window.new(display, win).tap! {|win|
|
232
|
+
e.yield win
|
233
|
+
|
234
|
+
if deep
|
235
|
+
win.subwindows(true).each {|win|
|
236
|
+
e.yield win
|
237
|
+
}
|
238
|
+
end
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
C::XFree(children.typecast(:pointer))
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
named :normal?, :mask, :pointer, :keyboard, :confine_to, :cursor, :time, :optional => 0 .. -1
|
247
|
+
def grab_pointer (owner_events=true, event_mask=Mask::Event[:NoEvent], pointer_mode=:sync, keyboard_mode=:async, confine_to=0, cursor=0, time=0, &block)
|
248
|
+
result = C::XGrabPointer(display.to_ffi, to_ffi, !!owner_events, event_mask.to_ffi, mode_to_int(pointer_mode), mode_to_int(keyboard_mode), confine_to.to_ffi, cursor.to_ffi, time).zero?
|
249
|
+
|
250
|
+
if block && result
|
251
|
+
begin
|
252
|
+
result = block.call self
|
253
|
+
ensure
|
254
|
+
ungrab_pointer
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
result
|
259
|
+
end
|
260
|
+
|
261
|
+
def ungrab_pointer (time=0)
|
262
|
+
display.ungrab_pointer(time)
|
263
|
+
end
|
264
|
+
|
265
|
+
named :key, :modifiers, :normal?, :pointer, :keyboard, :optional => 1 .. -1
|
266
|
+
def grab_key (keycode, modifiers=0, owner_events=true, pointer_mode=:async, keyboard_mode=:sync)
|
267
|
+
C::XGrabKey(display.to_ffi, Keysym[keycode, display].to_keycode, modifiers, to_ffi, !!owner_events, mode_to_int(pointer_mode), mode_to_int(keyboard_mode))
|
268
|
+
end
|
269
|
+
|
270
|
+
def ungrab_key (keycode, modifiers=0)
|
271
|
+
C::XUngrabKey(display.to_ffi, Keysym[keycode, display].to_keycode, modifiers, to_ffi)
|
272
|
+
end
|
273
|
+
|
274
|
+
named :button, :modifiers, :normal?, :mask, :pointer, :keyboard, :confine_to, :cursor, :optional => 0 .. -1
|
275
|
+
def grab_button (button, modifiers=0, owner_events=true, event_mask=Mask::Event[:ButtonPress], pointer_mode=:async, keyboard_mode=:sync, confine_to=0, cursor=0)
|
276
|
+
C::XGrabButton(display.to_ffi, button, modifiers, to_ffi, !!owner_events, event_mask.to_ffi, mode_to_int(pointer_mode), mode_to_int(keyboard_mode), confine_to.to_ffi, cursor.to_ffi)
|
277
|
+
end
|
278
|
+
|
279
|
+
def ungrab_button (button, modifiers=0)
|
280
|
+
C::XUngrabButton(display.to_ffi, button, modifiers, to_ffi)
|
281
|
+
end
|
282
|
+
|
283
|
+
def under_pointer
|
284
|
+
root = FFI::MemoryPointer.new :Window
|
285
|
+
child = FFI::MemoryPointer.new :Window
|
286
|
+
dummy = FFI::MemoryPointer.new :int
|
287
|
+
|
288
|
+
C::XQueryPointer(display.to_ffi, to_ffi, root, child, dummy, dummy, dummy, dummy, dummy)
|
289
|
+
|
290
|
+
Window.new(display, child.typecast(:Window))
|
291
|
+
end
|
292
|
+
|
293
|
+
def pointer_at? (on_root=false)
|
294
|
+
dummy = FFI::MemoryPointer.new :Window
|
295
|
+
y = FFI::MemoryPointer.new :int
|
296
|
+
x = FFI::MemoryPointer.new :int
|
297
|
+
|
298
|
+
if on_root
|
299
|
+
C::XQueryPointer(display.to_ffi, to_ffi, dummy, dummy, x, y, dummy, dummy, dummy)
|
300
|
+
else
|
301
|
+
C::XQueryPointer(display.to_ffi, to_ffi, dummy, dummy, dummy, dummy, x, y, dummy)
|
302
|
+
end
|
303
|
+
|
304
|
+
[x.typecast(:int), y.typecast(:int)]
|
305
|
+
end
|
306
|
+
|
307
|
+
def reported_events= (mask)
|
308
|
+
mask = Mask::Event[mask] unless mask.is_a?(Bitmap::Value)
|
309
|
+
|
310
|
+
(@reported_events = mask).tap {
|
311
|
+
C::XSelectInput(display.to_ffi, to_ffi, mask.to_ffi)
|
312
|
+
}
|
313
|
+
end; alias select_input reported_events=
|
314
|
+
|
315
|
+
def next_event (what=nil, options=nil, &block)
|
316
|
+
what, options = if what.is_a?(Hash)
|
317
|
+
[Mask::Event.all, what]
|
318
|
+
else
|
319
|
+
[what, options || {}]
|
320
|
+
end
|
321
|
+
|
322
|
+
|
323
|
+
# this would be cool, but it's slow as hell, if anyone finds a way to optimize it, let me know
|
324
|
+
=begin
|
325
|
+
mask = Event.mask_for(what)
|
326
|
+
|
327
|
+
old, self.reported_events = if options[:select] != false && !reported_events.has?(mask)
|
328
|
+
[reported_events, mask]
|
329
|
+
end
|
330
|
+
|
331
|
+
display.next_event(what, options) {|event|
|
332
|
+
if event.window == self
|
333
|
+
block ? block.call(event) : true
|
334
|
+
end
|
335
|
+
}.tap {
|
336
|
+
self.reported_events = old if old
|
337
|
+
}
|
338
|
+
=end
|
339
|
+
|
340
|
+
event = FFI::MemoryPointer.new(C::XEvent)
|
341
|
+
|
342
|
+
if block
|
343
|
+
callback = FFI::Function.new(:Bool, [:pointer, :pointer, :pointer]) do |_, event|
|
344
|
+
block.call Event.new(event) if event.window == self
|
345
|
+
end
|
346
|
+
|
347
|
+
@reported_events.tap {|old|
|
348
|
+
self.reported_events = Mask::Event.all unless options[:select] == false
|
349
|
+
|
350
|
+
begin
|
351
|
+
if options[:blocking?] == false
|
352
|
+
C::XCheckIfEvent(display.to_ffi, event, callback, nil) or return
|
353
|
+
else
|
354
|
+
if options[:delete] != false
|
355
|
+
C::XIfEvent(display.to_ffi, event, callback, nil)
|
356
|
+
else
|
357
|
+
C::XPeekIfEvent(display.to_ffi, event, callback, nil)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
ensure
|
361
|
+
self.reported_events = old unless options[:select] == false
|
362
|
+
end
|
363
|
+
}
|
364
|
+
else
|
365
|
+
if what.is_a?(Symbol) && options[:blocking?] == false
|
366
|
+
Kernel.raise ArgumentError, 'cannot look for event by type and block'
|
367
|
+
end
|
368
|
+
|
369
|
+
if what.is_a?(Symbol)
|
370
|
+
C::XCheckTypedWindowEvent(display.to_ffi, to_ffi, Event.index(what), event) or return
|
371
|
+
else
|
372
|
+
old = reported_events
|
373
|
+
what = Mask::Event.all if what.nil?
|
374
|
+
|
375
|
+
self.reported_events += what unless options[:select] == false || old.has?(what)
|
376
|
+
|
377
|
+
if options[:blocking?] == false
|
378
|
+
C::XCheckWindowEvent(display.to_ffi, to_ffi, what.to_ffi, event) or return
|
379
|
+
else
|
380
|
+
C::XWindowEvent(display.to_ffi, to_ffi, what.to_ffi, event)
|
381
|
+
end
|
382
|
+
|
383
|
+
if options[:delete] == false
|
384
|
+
C::XPutBackEvent(to_ffi, event.to_ffi)
|
385
|
+
end
|
386
|
+
|
387
|
+
self.reported_events = old unless reported_events == old
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
Event.new(event)
|
392
|
+
end
|
393
|
+
|
394
|
+
def each_event (what=nil, options=nil, &block)
|
395
|
+
return unless block
|
396
|
+
|
397
|
+
catch(:skip) {
|
398
|
+
loop {
|
399
|
+
next_event(what, options).tap {|event|
|
400
|
+
if !event
|
401
|
+
return if options[:blocking] == false
|
402
|
+
next
|
403
|
+
end
|
404
|
+
|
405
|
+
block.call event
|
406
|
+
}
|
407
|
+
}
|
408
|
+
}
|
409
|
+
end
|
410
|
+
|
411
|
+
def inspect
|
412
|
+
begin
|
413
|
+
attributes.tap! {|attr|
|
414
|
+
"#<X11::Window(#{id}): #{attr.width}x#{attr.height} (#{attr.x}; #{attr.y})>"
|
415
|
+
}
|
416
|
+
rescue BadWindow
|
417
|
+
"#<X11::Window: invalid window>"
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
protected
|
422
|
+
|
423
|
+
def mode_to_int (mode)
|
424
|
+
(mode == true || mode == :async) ? 1 : 0
|
425
|
+
end
|
215
426
|
end
|
216
427
|
|
217
428
|
end
|