Class: RGhost::PsFacade
Overview
PsFacade is just a big facade involving an instance of most postscript objects.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
-
#background_row(options = {}) ⇒ Object
A facade for the method Frame.background_row.
-
#border(options = {}) ⇒ Object
A facade for the class Border.
-
#circle(options = {}) ⇒ Object
A facade for the class Circle.
-
#closepath ⇒ Object
Close path of the graphic state.
-
#color(options) ⇒ Object
A facade for the method Color.create.
-
#dash(options = {}) ⇒ Object
A facade for the class Dash.
-
#dsc_entry(&block) ⇒ Object
A facade for the class DSCEntry.
-
#frame(options) ⇒ Object
A facade for the class Frame.
-
#goto_row(row) ⇒ Object
A facade for the method Cursor.goto_row.
-
#graphic {|psfc| ... } ⇒ Object
A facade for the class Graphic.
-
#hl(valign = :middle, options = {}) ⇒ Object
alias horizontal_line.
-
#horizontal_line(valign = :middle, options = {}) ⇒ Object
A facade for the class HorizontalLine.
-
#image(path, options = {}) ⇒ Object
A facade for the class Image.for.
-
#initialize {|_self| ... } ⇒ PsFacade
constructor
(&block).
-
#jump_rows(row) ⇒ Object
A facade for the method Cursor.jump_rows.
-
#line_width(value = nil) ⇒ Object
A facade for the class LineWidth.
-
#lineto(point = {}) ⇒ Object
A facade for the method Line.lineto.
-
#moveto(point = {}) ⇒ Object
A facade for the method Cursor.moveto.
-
#newpath {|psfc| ... } ⇒ Object
A facade for the class NewPath.
-
#next_page ⇒ Object
A facade for the method Cursor.next_page.
-
#next_row ⇒ Object
A facade for the method Cursor.next_row.
-
#polygon(options = {}, &block) ⇒ Object
A facade for the class Polygon.
-
#rectangle_link(options = {}) ⇒ Object
A facade for the class RectangleLink.
-
#rlineto(point = {}) ⇒ Object
A facade for the method Line.rlineto.
-
#rmoveto(point = {}) ⇒ Object
A facade for the method Cursor.rmoveto.
-
#rotate(angle) ⇒ Object
A facade for the method Cursor.rotate.
-
#scale(sx, sy) ⇒ Object
A facade for the class Scale.
-
#shape_content(options = {}) ⇒ Object
A facade for the class ShapeContent.
-
#show(text, align = { :align=> :show_left }) ⇒ Object
A facade for the class Show.
- #show_next_row(text, align = { :align=> :show_left }) ⇒ Object
-
#showpage ⇒ Object
A facade for the method Cursor.showpage.
-
#stroke ⇒ Object
Forces draw shapes.
-
#text(text, tag_parse = true) ⇒ Object
A facade for the class Text.
-
#text_area(text, options = {}, tag_parse = true) ⇒ Object
A facade for the class TextArea.
-
#text_in(options = {}) ⇒ Object
A facade for the class TextIn.
-
#text_link(label, options = {}) ⇒ Object
A facade for the class TextLinkIn.
-
#translate(point = {}) ⇒ Object
A facade for the method Cursor.translate.
-
#use_function(name) ⇒ Object
Call internal function by name.
-
#use_tag(tag_name) ⇒ Object
Use tag after defined in define_tags.
-
#use_template(name) ⇒ Object
Allows call template after it definition.
-
#vertical_line(options = {:start_in => :limit_left, :size => :area_y}) ⇒ Object
A facade for the class VerticalLine.
-
#vertical_line_row(border_options = RGhost::Border::DEFAULT_OPTIONS) ⇒ Object
A facade for the method VerticalLine.row.
-
#write(text, align = { :align=> :show_left }) ⇒ Object
Alias for show.
-
#zoom(percent) ⇒ Object
A facade for the method Scale.zoom.
Methods inherited from PsObject
#<<, #call, #graphic_scope, #ps, #raw, #set, #to_s
Constructor Details
#initialize {|_self| ... } ⇒ PsFacade
(&block)
12 13 14 15 16 17 |
# File 'lib/rghost/ps_facade.rb', line 12 def initialize #(&block) super(""){} @rows=0 yield self if block_given? #instance_eval(&block) if block end |
Instance Attribute Details
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
10 11 12 |
# File 'lib/rghost/ps_facade.rb', line 10 def rows @rows end |
Instance Method Details
#background_row(options = {}) ⇒ Object
A facade for the method Frame.background_row
124 125 126 |
# File 'lib/rghost/ps_facade.rb', line 124 def background_row(={}) set RGhost::Frame.background_row() end |
#border(options = {}) ⇒ Object
A facade for the class Border
222 223 224 |
# File 'lib/rghost/ps_facade.rb', line 222 def border(={}) set RGhost::Border.new() end |
#circle(options = {}) ⇒ Object
A facade for the class Circle
241 242 243 |
# File 'lib/rghost/ps_facade.rb', line 241 def circle(={}) set RGhost::Circle.new() end |
#closepath ⇒ Object
Close path of the graphic state
27 28 29 |
# File 'lib/rghost/ps_facade.rb', line 27 def closepath call :closepath end |
#color(options) ⇒ Object
A facade for the method Color.create
217 218 219 |
# File 'lib/rghost/ps_facade.rb', line 217 def color() set RGhost::Color.create() end |
#dash(options = {}) ⇒ Object
A facade for the class Dash
212 213 214 |
# File 'lib/rghost/ps_facade.rb', line 212 def dash(={}) set RGhost::Dash.new() end |
#dsc_entry(&block) ⇒ Object
A facade for the class DSCEntry
99 100 101 |
# File 'lib/rghost/ps_facade.rb', line 99 def dsc_entry(&block) set RGhost::DSCEntry.new(&block) end |
#frame(options) ⇒ Object
A facade for the class Frame
232 233 234 |
# File 'lib/rghost/ps_facade.rb', line 232 def frame() set RGhost::Frame.new() end |
#goto_row(row) ⇒ Object
A facade for the method Cursor.goto_row
68 69 70 71 |
# File 'lib/rghost/ps_facade.rb', line 68 def goto_row(row) set RGhost::Cursor.goto_row(row) end |
#graphic {|psfc| ... } ⇒ Object
A facade for the class Graphic
37 38 39 40 41 42 43 44 |
# File 'lib/rghost/ps_facade.rb', line 37 def graphic(&block) psfc=RGhost::PsFacade.new yield psfc raw :gsave set psfc raw :grestore end |
#hl(valign = :middle, options = {}) ⇒ Object
alias horizontal_line
114 115 116 |
# File 'lib/rghost/ps_facade.rb', line 114 def hl(valign=:middle,={}) set RGhost::HorizontalLine.new(valign,) end |
#horizontal_line(valign = :middle, options = {}) ⇒ Object
A facade for the class HorizontalLine
119 120 121 |
# File 'lib/rghost/ps_facade.rb', line 119 def horizontal_line(valign=:middle,={}) hl(valign,) end |
#image(path, options = {}) ⇒ Object
A facade for the class Image.for
109 110 111 |
# File 'lib/rghost/ps_facade.rb', line 109 def image(path,={}) set RGhost::Image.for(path,) end |
#jump_rows(row) ⇒ Object
A facade for the method Cursor.jump_rows
74 75 76 77 |
# File 'lib/rghost/ps_facade.rb', line 74 def jump_rows(row) @rows+=row set RGhost::Cursor.jump_rows(row) end |
#line_width(value = nil) ⇒ Object
A facade for the class LineWidth
63 64 65 |
# File 'lib/rghost/ps_facade.rb', line 63 def line_width(value=nil) set RGhost::LineWidth.new(value) end |
#lineto(point = {}) ⇒ Object
A facade for the method Line.lineto
202 203 204 |
# File 'lib/rghost/ps_facade.rb', line 202 def lineto(point={}) set RGhost::Line.make_command(:lineto,point) end |
#moveto(point = {}) ⇒ Object
A facade for the method Cursor.moveto
84 85 86 |
# File 'lib/rghost/ps_facade.rb', line 84 def moveto(point={}) set RGhost::Cursor.moveto(point) end |
#newpath {|psfc| ... } ⇒ Object
A facade for the class NewPath
47 48 49 50 51 52 53 54 |
# File 'lib/rghost/ps_facade.rb', line 47 def newpath(&block) psfc=RGhost::PsFacade.new yield psfc raw :newpath set psfc raw :closepath #set RGhost::NewPath.new(&block) end |
#next_page ⇒ Object
A facade for the method Cursor.next_page
32 33 34 |
# File 'lib/rghost/ps_facade.rb', line 32 def next_page set RGhost::Cursor.next_page end |
#next_row ⇒ Object
A facade for the method Cursor.next_row
20 21 22 23 |
# File 'lib/rghost/ps_facade.rb', line 20 def next_row @rows+=1 set RGhost::Cursor.next_row end |
#polygon(options = {}, &block) ⇒ Object
A facade for the class Polygon
236 237 238 |
# File 'lib/rghost/ps_facade.rb', line 236 def polygon(={},&block) set RGhost::Polygon.new(,&block) end |
#rectangle_link(options = {}) ⇒ Object
A facade for the class RectangleLink
246 247 248 |
# File 'lib/rghost/ps_facade.rb', line 246 def rectangle_link(={}) set RGhost::RectangleLink.new() end |
#rlineto(point = {}) ⇒ Object
A facade for the method Line.rlineto
207 208 209 |
# File 'lib/rghost/ps_facade.rb', line 207 def rlineto(point={}) set RGhost::Line.make_command(:rlineto,point) end |
#rmoveto(point = {}) ⇒ Object
A facade for the method Cursor.rmoveto
89 90 91 |
# File 'lib/rghost/ps_facade.rb', line 89 def rmoveto(point={}) set RGhost::Cursor.rmoveto(point) end |
#rotate(angle) ⇒ Object
A facade for the method Cursor.rotate
80 81 82 |
# File 'lib/rghost/ps_facade.rb', line 80 def rotate(angle) set RGhost::Cursor.rotate(angle) end |
#scale(sx, sy) ⇒ Object
A facade for the class Scale
129 130 131 132 |
# File 'lib/rghost/ps_facade.rb', line 129 def scale(sx,sy) set RGhost::Scale.new(sx,sy) end |
#shape_content(options = {}) ⇒ Object
A facade for the class ShapeContent
227 228 229 |
# File 'lib/rghost/ps_facade.rb', line 227 def shape_content(={}) set RGhost::ShapeContent.new() end |
#show(text, align = { :align=> :show_left }) ⇒ Object
A facade for the class Show
156 157 158 |
# File 'lib/rghost/ps_facade.rb', line 156 def show(text,align={ :align=> :show_left }) set RGhost::Show.new(text.to_s,align) end |
#show_next_row(text, align = { :align=> :show_left }) ⇒ Object
160 161 162 163 |
# File 'lib/rghost/ps_facade.rb', line 160 def show_next_row(text,align={ :align=> :show_left }) next_row show(text,align) end |
#showpage ⇒ Object
A facade for the method Cursor.showpage
57 58 59 60 61 |
# File 'lib/rghost/ps_facade.rb', line 57 def showpage set RGhost::Cursor.showpage end |
#stroke ⇒ Object
Forces draw shapes
196 197 198 199 |
# File 'lib/rghost/ps_facade.rb', line 196 def stroke call :stroke end |
#text(text, tag_parse = true) ⇒ Object
A facade for the class Text
151 152 153 |
# File 'lib/rghost/ps_facade.rb', line 151 def text(text,tag_parse=true) set RGhost::Text.new(text.to_s,tag_parse) end |
#text_area(text, options = {}, tag_parse = true) ⇒ Object
A facade for the class TextArea
179 180 181 182 183 |
# File 'lib/rghost/ps_facade.rb', line 179 def text_area(text,={},tag_parse=true) ta=RGhost::TextArea.new(text,,tag_parse) raw ta.ps ta end |
#text_in(options = {}) ⇒ Object
A facade for the class TextIn
140 141 142 |
# File 'lib/rghost/ps_facade.rb', line 140 def text_in(={}) set RGhost::TextIn.new() end |
#text_link(label, options = {}) ⇒ Object
A facade for the class TextLinkIn
145 146 147 148 |
# File 'lib/rghost/ps_facade.rb', line 145 def text_link(label,={}) [:label]=label set RGhost::TextLinkIn.new() end |
#translate(point = {}) ⇒ Object
A facade for the method Cursor.translate
94 95 96 |
# File 'lib/rghost/ps_facade.rb', line 94 def translate(point={}) set RGhost::Cursor.translate(point) end |
#use_function(name) ⇒ Object
Call internal function by name
174 175 176 |
# File 'lib/rghost/ps_facade.rb', line 174 def use_function(name) call "_#{name}" end |
#use_tag(tag_name) ⇒ Object
Use tag after defined in define_tags
104 105 106 |
# File 'lib/rghost/ps_facade.rb', line 104 def use_tag(tag_name) raw "_#{tag_name}" end |
#use_template(name) ⇒ Object
Allows call template after it definition.
169 170 171 |
# File 'lib/rghost/ps_facade.rb', line 169 def use_template(name) call "_#{name}" end |
#vertical_line(options = {:start_in => :limit_left, :size => :area_y}) ⇒ Object
A facade for the class VerticalLine
186 187 188 |
# File 'lib/rghost/ps_facade.rb', line 186 def vertical_line(={:start_in => :limit_left, :size => :area_y}) set RGhost::VerticalLine.new() end |
#vertical_line_row(border_options = RGhost::Border::DEFAULT_OPTIONS) ⇒ Object
A facade for the method VerticalLine.row
191 192 193 |
# File 'lib/rghost/ps_facade.rb', line 191 def vertical_line_row(=RGhost::Border::DEFAULT_OPTIONS) set RGhost::VerticalLine.row() end |
#write(text, align = { :align=> :show_left }) ⇒ Object
Alias for show
165 166 167 |
# File 'lib/rghost/ps_facade.rb', line 165 def write(text,align={ :align=> :show_left }) show(text.to_s,align) end |