toolbox-programming with oslib
Tony van der Hoff
Tony at mk-net.demon.co.uk
Fri Oct 20 14:13:02 BST 2000
In message <232d0e104a.druck at druck.freeuk.net>, David J. Ruck
<druck at freeuk.com> writes
>On 19 Oct 2000 Tony van der Hoff <OSLib at mk-net.demon.co.uk> wrote:
>>
>> > typedef struct
>> > {
>> > toolbox_class object_class;
>> > int flags;
>> > int version;
>> > char name[MAX_OBJECT_NAME];
>> > int total_size;
>> > void *body;
>> > int body_size;
>> > } toolbox_object_header;
>>
>> Interesting, I've not used Template_Lookup; I'm a bit surprised at your
>> void* in there, does the SWI translate the offset into an absolute address?
>
>Thats how it is in tboxlib, as it is an absoulte address which points at
>class specfic data - this would be so much nicer with C++ classes.
>
OK, where does the memory buffer get allocated? More to the point, how
is it released, and who is responsible for doing so?
>
>> I shall be adding:
>> struct
>> {
>> toolbox_RESOURCE_FILE_OBJECT_MEMBERS
>> } toolbox_object_template_header;
>> and
>> struct
>> {
>> toolbox_RESOURCE_FILE_OBJECT MEMBERS
>> window_OBJECT_MEMBERS
>> } window_object_template;
>>
Which, as David Bryan has discovered, DefMod won't presently let us do
correctly :-(
>
>> there is no reason why you shouldn't do that yourself until I
>> re-release OSLib (use a different name, though ;-).
>
>I wouldn't put it past you!
>
No, I'll use the names above; *you* use a different name :-)
>> I'm not convinced that that the toolbox_object_template_header structure is
>> actually needed, but what the hell...
>
>Well, if you can invent a call to do the sprite area setting directly, I'll
>use that - maybe something for OSLibSupport?
>
Yes, good idea. When you've written it, perhaps you'd like to contribute
it.
>> It would probably also be useful to define some macros for size and offset
>> fields in each template.
>>
For which DefMod also has no syntax. I suppose I could put them in
types.h at a pinch. Not very tidy, though :-(
--
Tony van der Hoff | mailto:OSLib at mk-net.demon.co.uk
Buckinghamshire, England | http://www.mk-net.demon.co.uk/oslib/
----------------------------------------------------------------
More information about the oslib-user
mailing list