Class: CqlsBeamer::Scene
- Inherits:
-
Object
- Object
- CqlsBeamer::Scene
- Defined in:
- lib/dyndoc/plugins/tex/beamer.rb
Constant Summary collapse
- @@scenes =
{}
- @@curScene =
nil
Instance Attribute Summary collapse
-
#align ⇒ Object
default values for actors in its scene.
-
#bg ⇒ Object
Returns the value of attribute bg.
-
#cpt ⇒ Object
Returns the value of attribute cpt.
-
#dim ⇒ Object
Returns the value of attribute dim.
-
#fg ⇒ Object
Returns the value of attribute fg.
-
#framed ⇒ Object
Returns the value of attribute framed.
-
#minipage ⇒ Object
default values for actors in its scene.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rounded ⇒ Object
Returns the value of attribute rounded.
-
#scene ⇒ Object
Returns the value of attribute scene.
-
#txt ⇒ Object
Returns the value of attribute txt.
-
#unit ⇒ Object
Returns the value of attribute unit.
Class Method Summary collapse
Instance Method Summary collapse
- #append(obj) ⇒ Object (also: #<<)
- #first ⇒ Object
- #init ⇒ Object
-
#initialize(name, dim) ⇒ Scene
constructor
A new instance of Scene.
- #last ⇒ Object
- #output ⇒ Object
Constructor Details
#initialize(name, dim) ⇒ Scene
Returns a new instance of Scene.
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 82 def initialize(name,dim) @name=name @scene=Group.new @unit="cm" @dim=dim.map{|e| e.to_s} @txt="" #default values @align="left,top" @minipage="" Scene[name]=self @@curScene=self end |
Instance Attribute Details
#align ⇒ Object
default values for actors in its scene
65 66 67 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 65 def align @align end |
#bg ⇒ Object
Returns the value of attribute bg.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def bg @bg end |
#cpt ⇒ Object
Returns the value of attribute cpt.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def cpt @cpt end |
#dim ⇒ Object
Returns the value of attribute dim.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def dim @dim end |
#fg ⇒ Object
Returns the value of attribute fg.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def fg @fg end |
#framed ⇒ Object
Returns the value of attribute framed.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def framed @framed end |
#minipage ⇒ Object
default values for actors in its scene
65 66 67 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 65 def minipage @minipage end |
#name ⇒ Object
Returns the value of attribute name.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def name @name end |
#rounded ⇒ Object
Returns the value of attribute rounded.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def rounded @rounded end |
#scene ⇒ Object
Returns the value of attribute scene.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def scene @scene end |
#txt ⇒ Object
Returns the value of attribute txt.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def txt @txt end |
#unit ⇒ Object
Returns the value of attribute unit.
63 64 65 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63 def unit @unit end |
Class Method Details
.[](key) ⇒ Object
74 75 76 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 74 def Scene.[](key) @@scenes[key] end |
.[]=(key, val) ⇒ Object
70 71 72 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 70 def Scene.[]=(key,val) @@scenes[key]=val end |
.current ⇒ Object
78 79 80 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 78 def Scene.current @@curScene end |
Instance Method Details
#append(obj) ⇒ Object Also known as: <<
101 102 103 104 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 101 def append(obj) @@curScene=self @scene.append(obj) end |
#first ⇒ Object
108 109 110 111 112 113 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 108 def first txt="" txt += "\\setbeamercolor{#{@name}color}{fg=#{fg},bg=#{@bg}}\n\\begin{beamercolorbox}[wd=#{dim[2]+@unit},ht=#{dim[3]+@unit},rounded=#{@rounded}]{#{@name}color}" if @framed txt+="\\pgfsetxvec{\\pgfpoint{#{dim[2]+@unit}}{0cm}}\n\\pgfsetyvec{\\pgfpoint{0cm}{#{dim[3]+@unit}}}\n\\begin{pgfpicture}{#{dim[0]+@unit}}{#{dim[1]+@unit}}{#{dim[2]+@unit}}{#{dim[3]+@unit}}\n" return txt end |
#init ⇒ Object
95 96 97 98 99 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 95 def init @scene.init @txt="" @cpt[0]=1 end |
#last ⇒ Object
115 116 117 118 119 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 115 def last txt="\\end{pgfpicture}\n" txt += "\\end{beamercolorbox}" if @framed return txt end |
#output ⇒ Object
121 122 123 124 |
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 121 def output @scene.output(@txt) return @txt end |