discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Appreciation of .gmodel format (was deprecation)


From: Alexander Malmberg
Subject: Re: RFC: Appreciation of .gmodel format (was deprecation)
Date: Tue, 06 Jan 2004 17:47:30 +0100

Gregory John Casamento wrote:
> --- Georg Fleischmann <georg@vhf.de> wrote:
> > Additionally, I'm a fan of ASCII formats like gmodel-files (or Renaissance),
> > so I never thought much of using Gorm yet. I'm more of waiting for some 
> > ASCII
> > support of Gorm.
> 
> Gorm's output format is dependent on NSData which, by default, encodes objects
> in binary form.   If this could be changed it would definitely be an 
> advantage,
> since it would mean that *all* data encoded by GNUstep programs would be 
> output
> to text-based formats instead of binary.

Writing a subclass of NSData (or, more appropriately, NSCoder) that
encodes as text is fairly easy, but also pointless. The resulting text
would be no more readable than the output of 'hexdump foo.gorm'. Eg. for
NSView, we have:

...
  [aCoder encodeRect: _frame];
  [aCoder encodeRect: _bounds];
  [aCoder encodeValueOfObjCType: @encode(BOOL) at:
&_is_rotated_from_base];
  [aCoder encodeValueOfObjCType: @encode(BOOL)
                             at: &_is_rotated_or_scaled_from_base];
  [aCoder encodeValueOfObjCType: @encode(BOOL) at:
&_post_frame_changes];
  [aCoder encodeValueOfObjCType: @encode(BOOL) at:
&_autoresizes_subviews];
  [aCoder encodeValueOfObjCType: @encode(unsigned int) at:
&_autoresizingMask];
...

so instead of a bit of binary data, you'd get something like "0.0 0.0
100.0 100.0 0.0 0.0 100.0 100.0 0 0 0 1 5" .... Sure, it's text, but
you'd go insane if you tried to edit it by hand. :)

I believe what Georg Fleischmann wants isn't just a text format, it's a
structured, human readable text format.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]