Class: GTK::SafeArea

Inherits:
Object show all
Defined in:
dragon/layout.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSafeArea

Returns a new instance of SafeArea.


37
38
39
40
41
# File 'dragon/layout.rb', line 37

def initialize
  @w      = 0
  @h      = 0
  @margin = Margin.new
end

Instance Attribute Details

#hObject (readonly)

Returns the value of attribute h


35
36
37
# File 'dragon/layout.rb', line 35

def h
  @h
end

#marginObject (readonly)

Returns the value of attribute margin


35
36
37
# File 'dragon/layout.rb', line 35

def margin
  @margin
end

#wObject (readonly)

Returns the value of attribute w


35
36
37
# File 'dragon/layout.rb', line 35

def w
  @w
end

Instance Method Details

#inspectObject


51
52
53
# File 'dragon/layout.rb', line 51

def inspect
  serialize.to_s
end

#serializeObject


43
44
45
46
47
48
49
# File 'dragon/layout.rb', line 43

def serialize
  {
    w:      @w,
    h:      @h,
    margin: @margin.serialize
  }
end

#to_sObject


55
56
57
# File 'dragon/layout.rb', line 55

def to_s
  serialize.to_s
end