X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=lib%2Fredact%2Fredact.rb;h=70f6770e8af618abdc24b9f62ddd1595ce611aba;hb=2815a23df18ddbaf3e0be81e013f869658829e61;hp=499b7fdb64bfa705d138aaa5f10bb3f85cfd6f1b;hpb=5243d32b6d7e35d5aad02b55018c958acd3aca09;p=redact.git diff --git a/lib/redact/redact.rb b/lib/redact/redact.rb index 499b7fd..70f6770 100644 --- a/lib/redact/redact.rb +++ b/lib/redact/redact.rb @@ -1,5 +1,5 @@ #-- -# $Id: redact.rb 6 2005-03-26 20:24:40Z tilman $ +# $Id: redact.rb 35 2005-04-25 17:14:49Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -57,7 +57,7 @@ class String end module Redact - VERSION = "0.1.0" + VERSION = "0.1.1" class RedactError < StandardError; end @@ -90,6 +90,7 @@ module Redact block_given? ? (yield c) : c end + protected def to_eet_name "Edje_File" end @@ -123,12 +124,14 @@ module Redact @value = value.to_str.dup.freeze end + protected def to_eet_name "Edje_Data" end end class FontDirectory < Array # :nodoc: + protected def to_eet_name "Edje_Font_Directory" end @@ -145,6 +148,7 @@ module Redact @filename = filename.to_str.dup.freeze end + protected def to_eet_name "Edje_Font_Directory_Entry" end @@ -161,6 +165,7 @@ module Redact entry.id = size - 1 end + protected def to_eet_name "Edje_Image_Directory" end @@ -191,6 +196,7 @@ module Redact end end + protected def to_eet_name "Edje_Image_Directory_Entry" end @@ -204,6 +210,7 @@ module Redact end class CollectionDirectory < Array # :nodoc: + protected def to_eet_name "Edje_Part_Collection_Directory" end @@ -219,6 +226,7 @@ module Redact @id = col.id end + protected def to_eet_name "Edje_Part_Collection_Directory_Entry" end @@ -230,8 +238,8 @@ module Redact end class Collection - attr_reader :name, :id, :data, :min, :max, :parts, :programs - attr_accessor :script + attr_reader :name, :id, :data, :min, :max, :parts, :programs, + :script def initialize(name, id) @name = name.to_str.dup.freeze @@ -247,6 +255,10 @@ module Redact @script = nil end + def script=(v) + @script = v.to_str.dup + end + def part(name, type = :invalid) # :yields: part p = @parts[name] if p.nil? @@ -261,7 +273,7 @@ module Redact ImagePart else raise(ArgumentError, - "invalid program type - #{type.to_s}") + "invalid part type - #{type.to_s}") end p = klass.new(self, @parts.size, name) @@ -322,6 +334,7 @@ module Redact end end + protected def to_eet_name "Edje_Part_Collection" end