Class: Plushie::Event::Window

Inherits:
Data
  • Object
show all
Defined in:
lib/plushie/event.rb

Overview

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, window_id: nil, x: nil, y: nil, width: nil, height: nil, scale_factor: nil, path: nil) ⇒ Window

Returns a new instance of Window.



146
147
148
149
# File 'lib/plushie/event.rb', line 146

def initialize(type:, window_id: nil, x: nil, y: nil,
  width: nil, height: nil, scale_factor: nil, path: nil)
  super
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



144
145
146
# File 'lib/plushie/event.rb', line 144

def height
  @height
end

#height [Float, nil] window height (for :resized, :opened)([Float, nil]() ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



144
145
146
# File 'lib/plushie/event.rb', line 144

def path
  @path
end

#path [String, nil] file path (for :file_dropped, :file_hovered)([String, nil]() ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#scale_factorObject (readonly)

Returns the value of attribute scale_factor

Returns:

  • (Object)

    the current value of scale_factor



144
145
146
# File 'lib/plushie/event.rb', line 144

def scale_factor
  @scale_factor
end

#scale_factor [Float, nil] display scale factor([Float, nil]) ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



144
145
146
# File 'lib/plushie/event.rb', line 144

def type
  @type
end

#type [Symbol] :opened, :close_requested, :resized, :moved, :focused, :unfocused, :file_dropped, :file_hovered([Symbol], : close_requested, : resized, : moved, : focused, : unfocused, : file_dropped, : file_hovered) ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#widthObject (readonly)

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



144
145
146
# File 'lib/plushie/event.rb', line 144

def width
  @width
end

#width [Float, nil] window width (for :resized, :opened)([Float, nil]() ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#window_idObject (readonly)

Returns the value of attribute window_id

Returns:

  • (Object)

    the current value of window_id



144
145
146
# File 'lib/plushie/event.rb', line 144

def window_id
  @window_id
end

#window_id [String, nil] ID of the affected window([String, nil]) ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#xObject (readonly)

Returns the value of attribute x

Returns:

  • (Object)

    the current value of x



144
145
146
# File 'lib/plushie/event.rb', line 144

def x
  @x
end

#x [Float, nil] window x position (for :moved)([Float, nil]() ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end

#yObject (readonly)

Returns the value of attribute y

Returns:

  • (Object)

    the current value of y



144
145
146
# File 'lib/plushie/event.rb', line 144

def y
  @y
end

#y [Float, nil] window y position (for :moved)([Float, nil]() ⇒ Object (readonly)

Window lifecycle events (open, close, resize, move, focus, etc.). Triggered by window manager actions or user interaction with window chrome. Subscribe via Subscription.on_window_close, on_window_open, on_window_resize, etc.

Examples:

Window close requested

in Event::Window[type: :close_requested, window_id:]

Window resized

in Event::Window[type: :resized, width:, height:]


144
145
146
147
148
149
150
# File 'lib/plushie/event.rb', line 144

Window = Data.define(:type, :window_id, :x, :y, :width, :height,
  :scale_factor, :path) do
  def initialize(type:, window_id: nil, x: nil, y: nil,
    width: nil, height: nil, scale_factor: nil, path: nil)
    super
  end
end