Class: Gtk2HTML::Render

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

Instance Method Summary collapse

Constructor Details

#initialize(x, width, height) ⇒ Render

Returns a new instance of Render.



51
52
53
54
55
56
# File 'lib/gtk2html.rb', line 51

def initialize(x, width, height)
  
  @width, @height = width.to_i, height.to_i
  super x
  
end

Instance Method Details

#body(e, attributes, raw_style) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'lib/gtk2html.rb', line 58

def body(e, attributes, raw_style)

  style = style_filter(attributes).merge(raw_style)
  margin = style[:margin].values
  coords = [nil, nil, nil, nil]
  padding = style[:padding].values
  
  [[:draw_box, margin, coords, padding, style], render_all(e)]
end

#div(e, attributes, raw_style) ⇒ Object



80
81
82
83
84
85
86
87
88
# File 'lib/gtk2html.rb', line 80

def div(e, attributes, raw_style)
  
  style = style_filter(attributes).merge(raw_style)
  margin = style[:margin].values
  coords = [nil, nil, nil, nil]
  padding = style[:padding].values
  
  [[:draw_box, margin, coords, padding, style], render_all(e)]
end

#html(e, attributes, style) ⇒ Object



90
91
92
93
94
95
96
97
# File 'lib/gtk2html.rb', line 90

def html(e, attributes, style)   

  margin = style[:margin].values
  coords = [0, 0, @width, @height]
  padding = style[:padding].values

  [[:draw_box, margin, coords, padding, style], render_all(e)]
end

#strong(e, attributes, raw_style) ⇒ Object Also known as: b



68
69
70
71
72
73
74
75
76
# File 'lib/gtk2html.rb', line 68

def strong(e, attributes, raw_style)

  style = style_filter(attributes).merge(raw_style)
  margin = style[:margin].values
  coords = [nil, nil, nil, nil]
  padding = style[:padding].values
  
  [[:draw_box, margin, coords, padding, style], render_all(e)]
end

#style(*args) ⇒ Object



99
100
101
# File 'lib/gtk2html.rb', line 99

def style(*args)
  
end