# styles.rb: commands for setting styles # copyright (c) 2014 by Vincent Fourmond # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details (in the COPYING file). require 'ctioga2/utils' require 'ctioga2/log' require 'ctioga2/graphics/coordinates' # This module contains all the classes used by ctioga module CTioga2 module Graphics module Styles StyleSheetGroup = CmdGroup.new('style-sheets', "Default styles", < --define-line-style * /color=Pink makes all lines pink (unless overriden by the /color option to {command: draw-line}), while > --define-line-style .pink /color=Pink only affect those to which the /class=pink style option was given. EOD StyleSheetCommands['legend'].long_description = < Types::Dimension.new(:frame, 1.0, :x) }) LoadStyleCommand = Cmd.new("load-style", nil, "--load-style", [ CmdArg.new('file'), ], {} ) do |plotmaker, file| Utils::open(file) do |f| str = f.read StyleSheet.style_sheet.update_from_string(str) end end LoadStyleCommand. describe("Load a style file", <<"EOH", StyleSheetGroup) ... EOH end end end