Class: RGhost::PsFacade

Inherits:
PsObject show all
Defined in:
lib/rghost/ps_facade.rb

Overview

PsFacade is just a big facade involving an instance of most postscript objects.

Direct Known Subclasses

Document

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PsObject

#<<, #call, #graphic_scope, #ps, #raw, #set, #to_s

Constructor Details

#initialize(&block) ⇒ PsFacade

Returns a new instance of PsFacade.



44
45
46
47
48
# File 'lib/rghost/ps_facade.rb', line 44

def initialize(&block)
  super(""){}
  @rows=0
  instance_eval(&block) if block
end

Instance Attribute Details

#rowsObject (readonly)

Returns the value of attribute rows.



42
43
44
# File 'lib/rghost/ps_facade.rb', line 42

def rows
  @rows
end

Instance Method Details

#background_row(options = {}) ⇒ Object

A facade for the method Frame.background_row



145
146
147
# File 'lib/rghost/ps_facade.rb', line 145

def background_row(options={})
  set RGhost::Frame.background_row(options)
end

#border(options = {}) ⇒ Object

A facade for the class Border



243
244
245
# File 'lib/rghost/ps_facade.rb', line 243

def border(options={})
  set RGhost::Border.new(options)
end

#circle(option = {}) ⇒ Object

A facade for the class Circle



262
263
264
# File 'lib/rghost/ps_facade.rb', line 262

def circle(option={})
  set RGhost::Circle.new(options)
end

#closepathObject

Close path of the graphic state



58
59
60
# File 'lib/rghost/ps_facade.rb', line 58

def closepath
  call :closepath
end

#color(options) ⇒ Object

A facade for the method Color.create



238
239
240
# File 'lib/rghost/ps_facade.rb', line 238

def color(options)
  set RGhost::Color.create(options)
end

#dash(options = {}) ⇒ Object

A facade for the class Dash



233
234
235
# File 'lib/rghost/ps_facade.rb', line 233

def dash(options={})
  set RGhost::Dash.new(options)
end

#dsc_entry(&block) ⇒ Object

A facade for the class DSCEntry



120
121
122
# File 'lib/rghost/ps_facade.rb', line 120

def dsc_entry(&block)
  set RGhost::DSCEntry.new(&block)
end

#frame(options) ⇒ Object

A facade for the class Frame



253
254
255
# File 'lib/rghost/ps_facade.rb', line 253

def frame(options)
  set RGhost::Frame.new(options)
end

#goto_row(row) ⇒ Object

A facade for the method Cursor.goto_row



89
90
91
92
# File 'lib/rghost/ps_facade.rb', line 89

def goto_row(row)
  
  set RGhost::Cursor.goto_row(row)    
end

#graphic(ps_obj = RGhost::PsObject.new, &block) ⇒ Object

A facade for the class Graphic



68
69
70
# File 'lib/rghost/ps_facade.rb', line 68

def graphic(ps_obj=RGhost::PsObject.new,&block)
  set RGhost::Graphic.new(ps_obj,&block)
end

#hl(valign = :middle, options = {}) ⇒ Object

alias horizontal_line



135
136
137
# File 'lib/rghost/ps_facade.rb', line 135

def hl(valign=:middle,options={})
  set RGhost::HorizontalLine.new(valign,options)
end

#horizontal_line(valign = :middle, options = {}) ⇒ Object

A facade for the class HorizontalLine



140
141
142
# File 'lib/rghost/ps_facade.rb', line 140

def horizontal_line(valign=:middle,options={})
  hl(valign,options)
end

#image(path, options = {}) ⇒ Object

A facade for the class Image.for



130
131
132
# File 'lib/rghost/ps_facade.rb', line 130

def image(path,options={})
  set RGhost::Image.for(path,options)
end

#jump_rows(row) ⇒ Object

A facade for the method Cursor.jump_rows



95
96
97
98
# File 'lib/rghost/ps_facade.rb', line 95

def jump_rows(row)
  @rows+=row
  set RGhost::Cursor.jump_rows(row)
end

#line_width(value = nil) ⇒ Object

A facade for the class LineWidth



84
85
86
# File 'lib/rghost/ps_facade.rb', line 84

def line_width(value=nil)
  set RGhost::LineWidth.new(value)
end

#lineto(point = {}) ⇒ Object

A facade for the method Line.lineto



223
224
225
# File 'lib/rghost/ps_facade.rb', line 223

def lineto(point={})
  set RGhost::Line.make_command(:lineto,point)
end

#moveto(point = {}) ⇒ Object

A facade for the method Cursor.moveto



105
106
107
# File 'lib/rghost/ps_facade.rb', line 105

def moveto(point={})
  set RGhost::Cursor.moveto(point)
end

#newpath(&block) ⇒ Object

A facade for the class NewPath



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

def newpath(&block)
  set RGhost::NewPath.new(&block)
end

#next_pageObject

A facade for the method Cursor.next_page



63
64
65
# File 'lib/rghost/ps_facade.rb', line 63

def next_page
  set RGhost::Cursor.next_page
end

#next_rowObject

A facade for the method Cursor.next_row



51
52
53
54
# File 'lib/rghost/ps_facade.rb', line 51

def next_row
  @rows+=1
  set RGhost::Cursor.next_row
end

#polygon(options = {}, &block) ⇒ Object

A facade for the class Polygon



257
258
259
# File 'lib/rghost/ps_facade.rb', line 257

def polygon(options={},&block)
  set RGhost::Polygon.new(options,&block)
end

A facade for the class RectangleLink



267
268
269
# File 'lib/rghost/ps_facade.rb', line 267

def rectangle_link(options={})
  set RGhost::RectangleLink.new(options)
end

#rlineto(point = {}) ⇒ Object

A facade for the method Line.rlineto



228
229
230
# File 'lib/rghost/ps_facade.rb', line 228

def rlineto(point={})
  set RGhost::Line.make_command(:rlineto,point)
end

#rmoveto(point = {}) ⇒ Object

A facade for the method Cursor.rmoveto



110
111
112
# File 'lib/rghost/ps_facade.rb', line 110

def rmoveto(point={})
  set RGhost::Cursor.rmoveto(point)
end

#rotate(angle) ⇒ Object

A facade for the method Cursor.rotate



101
102
103
# File 'lib/rghost/ps_facade.rb', line 101

def rotate(angle) 
  set RGhost::Cursor.rotate(angle)
end

#scale(sx, sy) ⇒ Object

A facade for the class Scale



150
151
152
153
# File 'lib/rghost/ps_facade.rb', line 150

def scale(sx,sy)
  set RGhost::Scale.new(sx,sy)
 
end

#shape_content(options = {}) ⇒ Object

A facade for the class ShapeContent



248
249
250
# File 'lib/rghost/ps_facade.rb', line 248

def shape_content(options={})
  set RGhost::ShapeContent.new(options)
end

#show(text, align = { :align=> :show_left }) ⇒ Object

A facade for the class Show



177
178
179
# File 'lib/rghost/ps_facade.rb', line 177

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



181
182
183
184
# File 'lib/rghost/ps_facade.rb', line 181

def show_next_row(text,align={ :align=> :show_left })
  next_row
  show(text,align)
end

#showpageObject

A facade for the method Cursor.showpage



78
79
80
81
82
# File 'lib/rghost/ps_facade.rb', line 78

def showpage
  
  set RGhost::Cursor.showpage
  
end

#strokeObject

Forces draw shapes



217
218
219
220
# File 'lib/rghost/ps_facade.rb', line 217

def stroke
  
  call :stroke
end

#text(text, tag_parse = true) ⇒ Object

A facade for the class Text



172
173
174
# File 'lib/rghost/ps_facade.rb', line 172

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



200
201
202
203
204
# File 'lib/rghost/ps_facade.rb', line 200

def text_area(text,options={},tag_parse=true)
  ta=RGhost::TextArea.new(text,options,tag_parse)
  raw ta.ps
  ta
end

#text_in(options = {}) ⇒ Object

A facade for the class TextIn



161
162
163
# File 'lib/rghost/ps_facade.rb', line 161

def text_in(options={})
  set RGhost::TextIn.new(options)
end

A facade for the class TextLinkIn



166
167
168
169
# File 'lib/rghost/ps_facade.rb', line 166

def text_link(label,options={})
   options[:label]=label
  set RGhost::TextLinkIn.new(options)
end

#translate(point = {}) ⇒ Object

A facade for the method Cursor.translate



115
116
117
# File 'lib/rghost/ps_facade.rb', line 115

def translate(point={})
  set RGhost::Cursor.translate(point)
end

#use_function(name) ⇒ Object

Call internal function by name



195
196
197
# File 'lib/rghost/ps_facade.rb', line 195

def use_function(name)
  call "_#{name}"
end

#use_tag(tag_name) ⇒ Object

Use tag after defined in define_tags



125
126
127
# File 'lib/rghost/ps_facade.rb', line 125

def use_tag(tag_name)
  raw "_#{tag_name}"
end

#use_template(name) ⇒ Object

Allows call template after it definition.



190
191
192
# File 'lib/rghost/ps_facade.rb', line 190

def use_template(name)
  call "_#{name}"
end

#vertical_line(options = {:start_in => :limit_left, :size => :area_y}) ⇒ Object

A facade for the class VerticalLine



207
208
209
# File 'lib/rghost/ps_facade.rb', line 207

def vertical_line(options={:start_in => :limit_left, :size => :area_y})
  set RGhost::VerticalLine.new(options)
end

#vertical_line_row(border_options = RGhost::Border::DEFAULT_OPTIONS) ⇒ Object

A facade for the method VerticalLine.row



212
213
214
# File 'lib/rghost/ps_facade.rb', line 212

def vertical_line_row(border_options=RGhost::Border::DEFAULT_OPTIONS)
  set RGhost::VerticalLine.row(border_options)
end

#write(text, align = { :align=> :show_left }) ⇒ Object

Alias for show



186
187
188
# File 'lib/rghost/ps_facade.rb', line 186

def write(text,align={ :align=> :show_left })
  show(text.to_s,align)  
end

#zoom(percent) ⇒ Object

A facade for the method Scale.zoom



156
157
158
# File 'lib/rghost/ps_facade.rb', line 156

def zoom(percent)
  set RGhost::Scale.zoom(percent)
end