Class: CTioga::Themes::BaseTheme

Inherits:
Object
  • Object
show all
Defined in:
lib/CTioga/themes.rb

Direct Known Subclasses

ClassicalTheme, FitsTheme

Constant Summary collapse

THEMES =
{}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBaseTheme

Basic initialization. Cannot take any compulsory parameter



32
33
# File 'lib/CTioga/themes.rb', line 32

def initialize
end

Class Method Details

.inherited(cls) ⇒ Object

A callback to register themes.



61
62
63
64
65
# File 'lib/CTioga/themes.rb', line 61

def self.inherited(cls)
  # THEMES[cls.name] = cls # Probably too long to be useful.
  THEMES[cls.name.split(/::/).last.gsub(/Theme/,"")] = cls
  THEMES[cls.name.split(/::/).last.gsub(/Theme/,"").downcase] = cls
end

Instance Method Details

#bod_hook(t) ⇒ Object

A hook to be run at the beginning of the drawing. t is the FigureMaker object.



44
45
46
# File 'lib/CTioga/themes.rb', line 44

def bod_hook(t)
  # Does nothing by default.
end

#choose_set(type, set) ⇒ Object

A function to be reimplemented by children to handle color_



56
57
58
# File 'lib/CTioga/themes.rb', line 56

def choose_set(type,set)
  warn "Theme #{self.class.name} does not support sets"
end

#cmdline_extra_argsObject

returns extra arguments to be pushed onto the cmdline. Can come in useful if you don’t want to play with ctiog’s internals



51
52
53
# File 'lib/CTioga/themes.rb', line 51

def cmdline_extra_args
  return []
end

#next_curve_style(name) ⇒ Object

Returns an object appropriate to describe the style of the next curve. It must return all information as appropriate, in the form of a CurveStyle object. It takes the name of the next set.



39
40
# File 'lib/CTioga/themes.rb', line 39

def next_curve_style(name)
end