Subclassing SimpleHTML Datatype

4 posts / 0 new
Last post
trixie
trixie's picture
Offline
Last seen: 1 month 1 week ago
Joined: 2011-02-03 13:58
Subclassing SimpleHTML Datatype

How would one go about subclassing the SimpleHTML Datatype? As it doesn't come with any public include file, I'm wondering how to obtain a data buffer from it. For example, with the Text Datatype you can use GetDTAttrs() to query about TDTA_Buffer and then process the buffer data in your subclass. I need something similar - a buffer with unprocessed data - but looking at the source code in A-EON's repository I'm not sure SimpleHTML is designed for subclassing at all.

broadblues
broadblues's picture
Offline
Last seen: 4 years 4 months ago
Joined: 2012-05-02 21:48
Re: Subclassing SimpleHTML Datatype

What would you want to acheive with a subclass?

I doubt subclassing is really feasible TBH.

It's a very annoying datatype that's stops you from view HTML src in MultiView(er) :-)

It's html rendering is rather horrid. Best use a webbrowser...

Note text.datatype is root class (well at least its the root of the GID_TEXT group anyway) so is designed for subclassing.

BTW I'm not sure you could easily subclass amigaguide.datatype either.

broadblues
broadblues's picture
Offline
Last seen: 4 years 4 months ago
Joined: 2012-05-02 21:48
Re: Subclassing SimpleHTML Datatype

But it appears I may have overestimated SimpleHTML, and looking at its rather convoluted source code I can't see an easy way to achieve what I need.

Your going about that the wrong way. Subclass a class that complex is not going to work. But you can *embed* an html datatype object in your mark down object in the same way as you might embed a button gadget in more complex file request gadget.

So parse in the markdown data as a top level GID_DOCUMENT then pass the html created to the embded html object.

Note text.datatype is root class (well at least its the root of the GID_TEXT group anyway) so is designed for subclassing.

I think both Text Datatype and SimpleHTML Datatype are direct subclasses of datatypesclass (which is a subclass of gadgetclass) and as such they should have been designed for further subclassing, or otherwise what's the purpose of Amiga Datatypes being object-oriented?

Zen reponse: Not all branches on a tree have twigs.

Gadget analogy: Consider one of the really heavy duty gadgets like listbrowser.gadget usefully subclassing that would be very difficult, as there is no public access to the inner datastructures, like wise with the more heavy duty datatypes.

Log in or register to post comments