Deprecated functions in reaction_macros.h
Deprecated functions in reaction_macros.h
Although the Autodocs specifically mention that functions like CHECKBOX_GetClass() or GETFILE_GetClass() are deprecated as of V52, the reaction_macros.h include file still contains many object macro definitions using these obsolete functions instead of the public class ID.
The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Deprecated functions in reaction_macros.h
Your right they do, I've made a note in bugzilla bug #7108
Re: Deprecated functions in reaction_macros.h
If it was my personal choice I would abolish those macros entirely. I know some think it makes their code more readable or whatever but I found in practice it just hides nasty bugs especially in any sizable project. The names are far too generic and easily clash. We inherited the code so I suppose we are stuck with it now but I would love to just deprecate the entire macro mess.trixie wrote:Although the Autodocs specifically mention that functions like CHECKBOX_GetClass() or GETFILE_GetClass() are deprecated as of V52, the reaction_macros.h include file still contains many object macro definitions using these obsolete functions instead of the public class ID.
I would also like to point out that you should be using IIntuition->OpenClass() and IIntuition->CloseClass() exclusively when loading/unloading BOOPSI classes. The only time you do not need these functions is when accessing classes already loaded into RAM (e.g. intuition.library) in which case you access them via their class name.
ExecSG Team Lead
Re: Deprecated functions in reaction_macros.h
The autodoc for OpenClass() says: "Use of this function can eliminate the need for getting the class interface ..." I'm slightly puzzled by this "CAN eliminate". So DOES it eliminate GetInterface() or not?ssolie wrote:I would also like to point out that you should be using IIntuition->OpenClass() and IIntuition->CloseClass() exclusively when loading/unloading BOOPSI classes.
The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Deprecated functions in reaction_macros.h
If all you need from the interface is the #?_GetClass() function then yes it eleiminates the need for that.The autodoc for OpenClass() says: "Use of this function can eliminate the need for getting the class interface ..." I'm slightly puzzled by this "CAN eliminate". So DOES it eliminate GetInterface() or not?
Some gadget inetrfaces have more functions than that tough, so in those cases you might need to get the inetface as well.
An example of the latter would be listbrowser.gadget it has quite a few functiosn for allocating and editiong nodes columns etc.
Re: Deprecated functions in reaction_macros.h
I see, so whenever I want to call IListBrowser->AllocListBrowserNode() or similar functions, I do need to GetInterface() first. OK, that makes good sense.broadblues wrote:Some gadget inetrfaces have more functions than that tough, so in those cases you might need to get the inetface as well.
To sum it up, in order to open a ReAction class and create an object from it, I need to declare as many as four variables:
Code: Select all
struct ClassLibrary *MyClassBase; /* the class library base pointer */
struct MyClassIFace *IMyClass; /* the class interface pointer */
Class *MyClass; /* the class pointer */
Object *MyObject; /* the object pointer */
Code: Select all
MyClassBase = IExec->OpenClass("classname", version, &MyClass);
Code: Select all
IMyClass = IExec->GetInterface( (struct Library *) MyClassBase, "main", 1L, NULL);
Code: Select all
MyObject = IIntuition->NewObject(MyClass, NULL, tags ...);
The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition