Class: Weechat::Window

Inherits:
Object show all
Extended by:
Properties
Includes:
Pointer
Defined in:
lib/weechat/window.rb

Overview

Gettable properties

buffer

The buffer currently shown in the window

x

X position of the window in the terminal

y

Y position of the window in the terminal

width

Width of the window

height

Height of the window

width_pct

Width relative to the one of the parent window (0..100%)

height_pct

Height relative to the one of the parent window (0..100%)

first_line_displayed?

True if the first line of the displayed buffer is displayed on the screen

scrolling?

True if the window is currently being scrolled

scrolling_lines

Number of lines that are not being displayed (in the bottom direction)

The chat area

See Chat

Defined Under Namespace

Classes: Chat

Instance Attribute Summary collapse

Attributes included from Pointer

#ptr

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Properties::ClassMethods

#apply_transformation, #init_properties, #known_integer_properties, #known_properties, #known_string_properties, #mappings, #rtransformations, #settable_properties, #transformations, #type

Methods included from Pointer

#==, #hash, #inspect, #to_s

Constructor Details

#initialize(*args) ⇒ Window

Returns a new instance of Window.



98
99
100
101
# File 'lib/weechat/window.rb', line 98

def initialize(*args)
  super
  @chat = Chat.new(self)
end

Instance Attribute Details

#chatObject (readonly)

Returns the value of attribute chat.



97
98
99
# File 'lib/weechat/window.rb', line 97

def chat
  @chat
end

Class Method Details

.currentObject



80
81
82
# File 'lib/weechat/window.rb', line 80

def current
  Window.new(Weechat.current_window)
end

.windowsObject Also known as: all

TODO:

TODO move into own module



85
86
87
88
89
90
91
# File 'lib/weechat/window.rb', line 85

def windows
  windows = []
  Weechat::Infolist.parse("window").each do |window|
    windows << Window.new(window[:pointer])
  end
  windows
end