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.



13
14
15
16
17
18
# File 'lib/gtk2html.rb', line 13

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

Instance Method Details

#body(e, attributes, raw_style) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/gtk2html.rb', line 20

def body(e, attributes, raw_style)

  style = style_filter(attributes).merge(raw_style)

  h = attributes
  
  [:draw_box, [x1,y1,x2,y2], style, render_all(e)]
end

#div(e, attributes, raw_style) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/gtk2html.rb', line 29

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

#html(e, attributes, style) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/gtk2html.rb', line 39

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