Class: Wnck::Screen

Inherits:
Object
  • Object
show all
Defined in:
lib/wnck.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handle) ⇒ Screen

Returns a new instance of Screen.



167
168
169
170
# File 'lib/wnck.rb', line 167

def initialize(handle)
	@handle = handle
	Wnck::wnck_screen_force_update handle
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.



202
203
204
# File 'lib/wnck.rb', line 202

def handle
  @handle
end

Class Method Details

.countObject



179
# File 'lib/wnck.rb', line 179

def self.count()   i = 0; i += 1 while get i; i   end

.defaultObject



178
# File 'lib/wnck.rb', line 178

def self.default()   Screen.new(Wnck::wnck_screen_get_default)   end

.each(&b) ⇒ Object



181
# File 'lib/wnck.rb', line 181

def self.each(&b)   screens.each &b   end

.get(i) ⇒ Object



182
183
184
185
# File 'lib/wnck.rb', line 182

def self.get(i)
	h = Wnck::wnck_screen_get(i)
	(h.null?) ? nil : Screen.new(h)
end

.new(handle) ⇒ Object



172
173
174
175
176
# File 'lib/wnck.rb', line 172

def self.new(handle)
	return get(handle) if handle.kind_of? Integer
	return nil if handle.null?
	super handle
end

.screensObject



180
# File 'lib/wnck.rb', line 180

def self.screens()   (0 ... Screen.count).collect { |i| Screen.get(i) }	end

Instance Method Details

#net_wm_supports?(atom) ⇒ Boolean

Returns:

  • (Boolean)


204
# File 'lib/wnck.rb', line 204

def net_wm_supports?(atom)		Wnck::wnck_screen_net_wm_supports(@handle, atom)							end

#workspace_at(index) ⇒ Object

def force_update() Wnck::wnck_screen_force_update(@handle) end def width() Wnck::wnck_screen_get_width(@handle) end def height() Wnck::wnck_screen_get_height(@handle) end def number() Wnck::wnck_screen_get_number(@handle) end def name() Wnck::wnck_screen_get_window_manager_name(@handle) end def active_window() Window.new(self, Wnck::wnck_screen_get_active_window(@handle)) end def previously_active_window() Window.new(self, Wnck::wnck_screen_get_previously_active_window(@handle)) end def toggle_show_desktop() Wnck::wnck_screen_toggle_showing_desktop(@handle) end



223
# File 'lib/wnck.rb', line 223

def workspace_at(index)   Workspace.new Wnck::wnck_screen_get_workspace(@handle, index)   end

#workspace_index(ws) ⇒ Object



224
# File 'lib/wnck.rb', line 224

def workspace_index(ws)   Wnck::wnck_screen_get_workspace_index(@handle, ws.handle)   end