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.



16
17
18
19
20
21
# File 'lib/gtk2html.rb', line 16

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



23
24
25
26
27
28
29
30
31
# File 'lib/gtk2html.rb', line 23

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



45
46
47
48
49
50
51
52
53
# File 'lib/gtk2html.rb', line 45

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



55
56
57
58
59
60
61
62
# File 'lib/gtk2html.rb', line 55

def html(e, attributes, style)   

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

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

#input(e, attributes, style) ⇒ Object



64
65
66
67
68
69
70
71
# File 'lib/gtk2html.rb', line 64

def input(e, attributes, style)   

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

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

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



33
34
35
36
37
38
39
40
41
# File 'lib/gtk2html.rb', line 33

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



73
74
75
# File 'lib/gtk2html.rb', line 73

def style(*args)
  
end