mirror of
https://github.com/vidarh/ruby-x11
synced 2024-12-27 09:59:21 +01:00
736e4d179b
When we created a Packet object before using Packet.read would return a hash. Instead, return an OpenStruct object which makes accessing parameters easier
22 lines
348 B
Ruby
22 lines
348 B
Ruby
module X11
|
|
class Screen
|
|
attr_reader :display
|
|
|
|
def initialize(display, data)
|
|
@display = display
|
|
@internal = data
|
|
end
|
|
|
|
def width
|
|
@internal.width_in_pixels
|
|
end
|
|
|
|
def height
|
|
@internal.height_in_pixels
|
|
end
|
|
|
|
def to_s
|
|
"#<X11::Screen(#{id}) width=#{width} height=#{height}>"
|
|
end
|
|
end
|
|
end
|