The visualization of a tag.

Methods
A
C
E
F
M
N
S
Included Modules
Class Public methods
curr()

Returns the currently focused view.

# File lib/rumai/wm.rb, line 628
        def self.curr
          new FOCUSED_WIDGET_ID
        end
new(view_id)
# File lib/rumai/wm.rb, line 667
      def initialize view_id
        super view_id, '/tag'
      end
Instance Public methods
area_ids()

Returns the IDs of all areas in this view.

# File lib/rumai/wm.rb, line 709
        def area_ids
          manifest.scan(/^# (\d+)/).flatten.unshift(FLOATING_AREA_ID)
        end
area_of_client(client_or_id)

Returns the area which contains the given client in this view.

# File lib/rumai/wm.rb, line 692
        def area_of_client client_or_id
          arg =
            if client_or_id.respond_to? :id
              client_or_id.id
            else
              client_or_id
            end

          manifest =~ /^(\S+) #{arg}/
          if area_id = $1
            Area.new area_id, self
          end
        end
areas()

Returns all areas in this view.

# File lib/rumai/wm.rb, line 716
        def areas
          area_ids.map! {|i| Area.new i, self }
        end
arrange_as_larswm()

Arranges the clients in this view, while maintaining their relative order, in the tiling fashion of LarsWM.

Only the first client in the primary column is kept; all others are evicted to the top of the secondary column. Any subsequent columns are squeezed into the bottom of the secondary column.

# File lib/rumai/wm.rb, line 768
        def arrange_as_larswm
          maintain_focus do
            # keep only one client in the primary column
            main = Area.new(1, self)
            main.length = 1
            main.layout = :default

            # collapse remaining areas into secondary column
            extra = columns[1..-1]

            if extra.length > 1
              extra.reverse.each_cons(2) do |src, dst|
                dst.concat src
              end
            end

            if dock = extra.first
              dock.layout = :default
            end
          end
        end
arrange_in_diamond()

Arranges the clients in this view, while maintaining their relative order, in a (at best) equilateral triangle. However, the resulting arrangement appears like a diamond because wmii does not waste screen space.

# File lib/rumai/wm.rb, line 822
        def arrange_in_diamond
          num_clients = num_managed_clients
          return unless num_clients > 1

          # determine dimensions of the rising sub-triangle
          rise = num_clients / 2

          span = sum = 0
          1.upto rise do |h|
            if sum + h > rise
              break
            else
              sum += h
              span += 1
            end
          end

          peak = num_clients - (sum * 2)

          # describe the overall triangle as a sequence of heights
          rise_seq = (1..span).to_a
          fall_seq = rise_seq.reverse

          heights = rise_seq
          heights << peak if peak > 0
          heights.concat fall_seq

          # apply the heights
          maintain_focus do
            each_column do |col|
              if h = heights.shift
                col.length = h
                col.layout = :default
              end
            end
          end
        end
arrange_in_grid(max_clients_per_column = nil)

Arranges the clients in this view, while maintaining their relative order, in a (at best) square grid.

# File lib/rumai/wm.rb, line 794
        def arrange_in_grid max_clients_per_column = nil
          # compute client distribution
          unless max_clients_per_column
            num_clients = num_managed_clients
            return unless num_clients > 0

            num_columns = Math.sqrt(num_clients)
            max_clients_per_column = (num_clients / num_columns).round
          end

          return if max_clients_per_column < 1

          # apply the distribution
          maintain_focus do
            each_column do |a|
              a.length = max_clients_per_column
              a.layout = :default
            end
          end
        end
chain()

Returns a list of all views.

# File lib/rumai/wm.rb, line 644
        def chain
          Rumai.views
        end
client_ids(area_id = '\S+')

Returns the IDs of the clients contained in the given area within this view.

# File lib/rumai/wm.rb, line 654
        def client_ids area_id = '\S+'
          manifest.scan(/^#{area_id} (0x\S+)/).flatten
        end
columns()

Returns all columns (managed areas) in this view.

This method is also aliased as managed_areas
# File lib/rumai/wm.rb, line 730
        def columns
          areas[1..-1]
        end
each(&block)

Iterates through each area in this view.

# File lib/rumai/wm.rb, line 663
        def each &block
          areas.each(&block)
        end
each_column(starting_column_id = 1)

Resiliently iterates through possibly destructive changes to each column. That is, if the given block creates new columns, then those will also be processed in the iteration.

This method is also aliased as each_managed_area
# File lib/rumai/wm.rb, line 741
        def each_column starting_column_id = 1
          i = starting_column_id
          loop do
            a = Area.new i, self

            if a.exist?
              yield a
            else
              break
            end

            i += 1
          end
        end
each_managed_area(starting_column_id = 1)

Alias for each_column

floating_area()

Returns the floating area of this view.

# File lib/rumai/wm.rb, line 723
        def floating_area
          Area.floating self
        end
focus()

Focuses this view.

# File lib/rumai/wm.rb, line 635
        def focus
          IXP_FS_ROOT.ctl.write "view #{@id}"
        end
managed_areas()

Alias for columns

manifest()

Returns the manifest of all areas and clients in this view.

# File lib/rumai/wm.rb, line 676
        def manifest
          index.read || ''
        end
select(direction)

Moves the focus from the current client in the given direction.

# File lib/rumai/wm.rb, line 683
        def select direction
          ctl.write "select #{direction}"
        end