discuss-gnustep
[Top][All Lists]
Advanced

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

Re: A thought on Renaissance


From: Nicola Pero
Subject: Re: A thought on Renaissance
Date: Mon, 19 Apr 2004 11:00:52 +0100 (BST)

> Hi,
> 
>   I have a thought on Renaissance since I'm considering to use it.
> 
>   Is it possible (or worth) to make Renaissance load bundles to process 
> customized XML tag ?
>   In other word, people can add customized bundle for Renaissance
>   in order to support tag which is not built in Renaissance.
>   Renaissance support only standard GNUstep GUI components, now.
>   If I need to add custom view, I need to do that in the source code.
>   If Renaissance can accept customized bundle for not built-in tag,
>   it may be more easy to reuse objects.

Yes, you can easily add new tags.

Just look at how the "standard" tags are implemented.  There is a class
for each of them.  Write a class for your customized tag.  Make sure the
class is already linked into your executable (put it in your application,
a library, a bundle which you load) when you load the Renaissance file.  
When you load the Renaissance file, your class will be found and used
automatically (when Renaissance finds the tag xxx, it will look for a
class called GSMarkupTagXxx to "execute" the tag).

Example, say you have a custom view called StreetView.  You just need to 
add the following to your application - 

@implementation GSMarkupTagStreetView : GSMarkupTagView
@end

@implementation GSMarkupTagStreetView

+ (NSString *) tagName
{
  return @"streetView";
}

+ (Class) defaultPlatformObjectClass
{
  return [StreetView class];
}

- (void) platformObjectInit
{
  [super platformObjectInit];

  /* Read your custom attributes here, and use them.  */
}

@end

And when you load a Renaissance file containing the tag <streetView>, it
will generate a StreetView object.

The only warning is that as an interface builder will become available,
the API for tags might need to be updated/reviewed to support the
interface builder, so you might need to modify your stuff slightly.





reply via email to

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