Permalink
Browse files

Update copyright date

  • Loading branch information...
rmagick
rmagick committed Jan 20, 2007
1 parent ea64d46 commit 738116ed508eec4769be634be08aa526d1555120
Showing with 2,213 additions and 2,177 deletions.
  1. +38 −36 lib/rvg/clippath.rb
  2. +120 −118 lib/rvg/container.rb
  3. +44 −42 lib/rvg/deep_equal.rb
  4. +49 −47 lib/rvg/describable.rb
  5. +399 −397 lib/rvg/embellishable.rb
  6. +613 −603 lib/rvg/misc.rb
  7. +38 −36 lib/rvg/paint.rb
  8. +124 −122 lib/rvg/pathdata.rb
  9. +202 −200 lib/rvg/rvg.rb
  10. +132 −130 lib/rvg/stretchable.rb
  11. +101 −99 lib/rvg/stylable.rb
  12. +173 −171 lib/rvg/text.rb
  13. +120 −118 lib/rvg/transformable.rb
  14. +60 −58 lib/rvg/units.rb
View
@@ -1,46 +1,48 @@
#--
-# $Id: clippath.rb,v 1.2 2005/12/31 14:41:04 rmagick Exp $
-# Copyright (C) 2006 Timothy P. Hunter
+# $Id: clippath.rb,v 1.3 2007/01/20 17:39:48 rmagick Exp $
+# Copyright (C) 2007 Timothy P. Hunter
#++
-class Magick::RVG
+module Magick
+ class RVG
- class ClipPath
- include ShapeConstructors
- include UseConstructors
- include TextConstructors
- include Describable
- include Stylable
- include Duplicatable
+ class ClipPath
+ include ShapeConstructors
+ include UseConstructors
+ include TextConstructors
+ include Describable
+ include Stylable
+ include Duplicatable
- # Create a clipping path. Within the block create an outline
- # from one or more paths, basic shapes, text objects, or +use+.
- # Everything drawn within the outline will be displayed.
- # Anything drawn outside the outline will not.
- #
- # If the clipping path contains a +use+, it
- # must directly reference path, basic shape, or text objects.
- #
- # Attach the clipping path to an object with the :clip_path style.
- def initialize(clip_path_units='userSpaceOnUse')
- super()
- if ! ['userSpaceOnUse', 'objectBoundingBox'].include?(clip_path_units)
- raise ArgumentError, "undefined value for clip path units: #{clip_path_units}"
+ # Create a clipping path. Within the block create an outline
+ # from one or more paths, basic shapes, text objects, or +use+.
+ # Everything drawn within the outline will be displayed.
+ # Anything drawn outside the outline will not.
+ #
+ # If the clipping path contains a +use+, it
+ # must directly reference path, basic shape, or text objects.
+ #
+ # Attach the clipping path to an object with the :clip_path style.
+ def initialize(clip_path_units='userSpaceOnUse')
+ super()
+ if ! ['userSpaceOnUse', 'objectBoundingBox'].include?(clip_path_units)
+ raise ArgumentError, "undefined value for clip path units: #{clip_path_units}"
+ end
+ @clip_path_units = clip_path_units
+ @content = Content.new
+ yield(self) if block_given?
end
- @clip_path_units = clip_path_units
- @content = Content.new
- yield(self) if block_given?
- end
- def add_primitives(gc, style) #:nodoc:
- name = __id__.to_s
- gc.define_clip_path(name) do
- gc.clip_units(@clip_path_units)
- @content.each { |element| element.add_primitives(gc) }
+ def add_primitives(gc, style) #:nodoc:
+ name = __id__.to_s
+ gc.define_clip_path(name) do
+ gc.clip_units(@clip_path_units)
+ @content.each { |element| element.add_primitives(gc) }
+ end
+ gc.clip_path(name)
end
- gc.clip_path(name)
- end
- end # class ClipPath
+ end # class ClipPath
-end # class Magick::RVG
+ end # class RVG
+end # module Magick
View
@@ -1,129 +1,131 @@
#--
-# $Id: container.rb,v 1.2 2005/12/31 14:41:04 rmagick Exp $
-# Copyright (C) 2006 Timothy P. Hunter
+# $Id: container.rb,v 1.3 2007/01/20 17:39:49 rmagick Exp $
+# Copyright (C) 2007 Timothy P. Hunter
#++
-class Magick::RVG
-
- # Content is simply an Array with a deep_copy method.
- # When unit-testing, it also has a deep_equal method.
- class Content < Array #:nodoc:
-
- def deep_copy(h = {})
- me = self.__id__
- copy = h[me]
- unless copy
- copy = self.class.new
- each do |c|
- copy << case
- when c.nil?
- nil
- when c.respond_to?(:deep_copy)
- c.deep_copy(h)
- when c.respond_to?(:dup)
- c.dup rescue c
- else
- c
- end
+module Magick
+ class RVG
+
+ # Content is simply an Array with a deep_copy method.
+ # When unit-testing, it also has a deep_equal method.
+ class Content < Array #:nodoc:
+
+ def deep_copy(h = {})
+ me = self.__id__
+ copy = h[me]
+ unless copy
+ copy = self.class.new
+ each do |c|
+ copy << case
+ when c.nil?
+ nil
+ when c.respond_to?(:deep_copy)
+ c.deep_copy(h)
+ when c.respond_to?(:dup)
+ c.dup rescue c
+ else
+ c
+ end
+ end
+ copy.freeze if frozen?
+ h[me] = copy
end
- copy.freeze if frozen?
- h[me] = copy
+ return copy
end
- return copy
- end
-
- end # class Content
-
- # Define a collection of shapes, text, etc. that can be reused.
- # Group objects are _containers_. That is, styles and transforms defined
- # on the group are used by contained objects such as shapes, text, and
- # nested groups unless overridden by a nested container or the object itself.
- # Groups can be reused with the RVG::UseConstructors#use method.
- # Create groups within
- # containers with the RVG::StructureConstructors#g method.
- #
- # Example:
- # # All elements in the group will be translated by 50 in the
- # # x-direction and 10 in the y-direction.
- # rvg.g.translate(50, 10).styles(:stroke=>'red',:fill=>'none') do |grp|
- # # The line will be red.
- # grp.line(10,10, 20,20)
- # # The circle will be blue.
- # grp.circle(10, 20, 20).styles(:stroke=>'blue')
- # end
- class Group
- include Stylable
- include Transformable
- include Embellishable
- include Describable
- include Duplicatable
-
- def initialize
- super
- @content = Content.new
- yield(self) if block_given?
- end
-
- def add_primitives(gc) #:nodoc:
- gc.push
- add_transform_primitives(gc)
- add_style_primitives(gc)
- @content.each { |element| element.add_primitives(gc) }
- gc.pop
- end
-
- # Translate container according to #use arguments
- def ref(x, y, width, height) #:nodoc:
- translate(x, y) if (x != 0 || y != 0)
- end
-
- # Append an arbitrary object to the group's content. Called
- # by #use to insert a non-container object into a group.
- def <<(obj) #:nodoc:
- @content << obj
- end
-
- end # class Group
-
-
- # A Use object allows the re-use of RVG and RVG::Group
- # objects within a container. Create a Use object with the
- # RVG::UseConstructors#use method.
- class Use
- include Stylable
- include Transformable
- include Duplicatable
-
- # In a container, Use objects are created indirectly via the
+
+ end # class Content
+
+ # Define a collection of shapes, text, etc. that can be reused.
+ # Group objects are _containers_. That is, styles and transforms defined
+ # on the group are used by contained objects such as shapes, text, and
+ # nested groups unless overridden by a nested container or the object itself.
+ # Groups can be reused with the RVG::UseConstructors#use method.
+ # Create groups within
+ # containers with the RVG::StructureConstructors#g method.
+ #
+ # Example:
+ # # All elements in the group will be translated by 50 in the
+ # # x-direction and 10 in the y-direction.
+ # rvg.g.translate(50, 10).styles(:stroke=>'red',:fill=>'none') do |grp|
+ # # The line will be red.
+ # grp.line(10,10, 20,20)
+ # # The circle will be blue.
+ # grp.circle(10, 20, 20).styles(:stroke=>'blue')
+ # end
+ class Group
+ include Stylable
+ include Transformable
+ include Embellishable
+ include Describable
+ include Duplicatable
+
+ def initialize
+ super
+ @content = Content.new
+ yield(self) if block_given?
+ end
+
+ def add_primitives(gc) #:nodoc:
+ gc.push
+ add_transform_primitives(gc)
+ add_style_primitives(gc)
+ @content.each { |element| element.add_primitives(gc) }
+ gc.pop
+ end
+
+ # Translate container according to #use arguments
+ def ref(x, y, width, height) #:nodoc:
+ translate(x, y) if (x != 0 || y != 0)
+ end
+
+ # Append an arbitrary object to the group's content. Called
+ # by #use to insert a non-container object into a group.
+ def <<(obj) #:nodoc:
+ @content << obj
+ end
+
+ end # class Group
+
+
+ # A Use object allows the re-use of RVG and RVG::Group
+ # objects within a container. Create a Use object with the
# RVG::UseConstructors#use method.
- # The +x+ and +y+ arguments
- # can be used to specify an additional translation for
- # the group. The +width+ and +height+ arguments specify
- # a width and height for referenced RVG objects.
- def initialize(element, x=0, y=0, width=nil, height=nil)
- super()
-
- # If the element is not a group, defs, symbol, or rvg,
- # wrap a group around it so it can get a transform and
- # possibly a new viewport.
- if ! element.respond_to?(:ref)
- @element = Group.new
- @element << element.deep_copy
- else
- @element = element.deep_copy
+ class Use
+ include Stylable
+ include Transformable
+ include Duplicatable
+
+ # In a container, Use objects are created indirectly via the
+ # RVG::UseConstructors#use method.
+ # The +x+ and +y+ arguments
+ # can be used to specify an additional translation for
+ # the group. The +width+ and +height+ arguments specify
+ # a width and height for referenced RVG objects.
+ def initialize(element, x=0, y=0, width=nil, height=nil)
+ super()
+
+ # If the element is not a group, defs, symbol, or rvg,
+ # wrap a group around it so it can get a transform and
+ # possibly a new viewport.
+ if ! element.respond_to?(:ref)
+ @element = Group.new
+ @element << element.deep_copy
+ else
+ @element = element.deep_copy
+ end
+ @element.ref(x, y, width, height)
end
- @element.ref(x, y, width, height)
- end
- def add_primitives(gc) #:nodoc:
- gc.push
- add_transform_primitives(gc)
- add_style_primitives(gc)
- @element.add_primitives(gc)
- gc.pop
- end
+ def add_primitives(gc) #:nodoc:
+ gc.push
+ add_transform_primitives(gc)
+ add_style_primitives(gc)
+ @element.add_primitives(gc)
+ gc.pop
+ end
- end # class Use
+ end # class Use
-end # class Magick::RVG
+ end # class RVG
+end # module Magick
Oops, something went wrong.

0 comments on commit 738116e

Please sign in to comment.