2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: GraphicsAmigaIntui hidd class implementation.
9 #include <proto/exec.h>
10 #include <proto/utility.h>
11 #include <proto/oop.h>
12 #include <exec/libraries.h>
14 #include <utility/tagitem.h>
15 #include <hidd/graphics.h>
16 #include <hidd/graphics-amiga-intuition.h>
19 #include "graphics_intern.h"
24 #include <aros/debug.h>
27 /*** HIDDGfx::NewBitMap() ****************************************************/
29 static Object
* hiddgfx_newbitmap(Class
*cl
, Object
*o
, struct pHidd_Gfx_NewBitMap
*msg
)
31 Object
*bitMap
= NULL
;
33 EnterFunc(bug("HIDDGfxAmigaIntui::NewBitMap()\n"));
35 bitMap
= NewObject(NULL
, CLID_Hidd_BitMapAmigaIntui
, msg
->attrList
);
37 ReturnPtr("HIDDGfxAmigaIntui::NewBitMap", Object
*, bitMap
);
41 /*** HIDDGfx::DisposeBitMap() ************************************************/
43 static VOID
hiddgfx_disposebitmap(Class
*cl
, Object
*o
, struct pHidd_Gfx_DisposeBitMap
*msg
)
45 EnterFunc(bug("HIDDGfxAmigaIntui::DisposeBitMap()\n"));
47 DisposeObject(msg
->bitMap
);
49 ReturnVoid("HIDDGfxAmigaIntui::DisposeBitMap");
52 /*************************** Classes *****************************/
58 #define NUM_GFXHIDD_METHODS 2
59 #define OOPBase (csd->oopbase)
60 #define SysBase (csd->sysbase)
62 Class
*init_gfxhiddclass (struct class_static_data
*csd
)
67 struct MethodDescr gfxhidd_descr
[NUM_GFXHIDD_METHODS
+ 1] =
69 {(IPTR (*)())hiddgfx_newbitmap
, moHidd_Gfx_NewBitMap
},
70 {(IPTR (*)())hiddgfx_disposebitmap
, moHidd_Gfx_DisposeBitMap
},
75 struct InterfaceDescr ifdescr
[] =
77 {gfxhidd_descr
, IID_Hidd_Gfx
, NUM_GFXHIDD_METHODS
},
81 AttrBase MetaAttrBase
= GetAttrBase(IID_Meta
);
83 struct TagItem tags
[] =
85 { aMeta_SuperID
, (IPTR
)CLID_Hidd_Gfx
},
86 { aMeta_InterfaceDescr
, (IPTR
)ifdescr
},
87 { aMeta_ID
, (IPTR
)CLID_Hidd_GfxAmigaIntui
},
88 { aMeta_InstSize
, (IPTR
)sizeof (struct HIDDGraphicsAmigaIntuiData
) },
93 EnterFunc(bug("init_gfxhiddclassAmigaIntui(csd=%p)\n", csd
));
95 cl
= NewObject(NULL
, CLID_HiddMeta
, tags
);
96 D(bug("Class=%p\n", cl
));
99 D(bug("GfxHiddClass ok\n"));
100 cl
->UserData
= (APTR
)csd
;
102 csd
->bitmapclass
= init_bitmapclass(csd
);
103 D(bug("bitmapclass: %p\n", csd
->bitmapclass
));
107 D(bug("BitMapClass ok\n"));
115 free_gfxhiddclass(csd
);
123 ReturnPtr("init_gfxhiddclassAmigaIntui", Class
*, cl
);
127 void free_gfxhiddclass(struct class_static_data
*csd
)
129 EnterFunc(bug("free_gfxhiddclassAmigaIntui(csd=%p)\n", csd
));
133 RemoveClass(csd
->gfxhiddclass
);
134 free_bitmapclass(csd
);
136 DisposeObject((Object
*) csd
->gfxhiddclass
);
139 ReturnVoid("free_gfxhiddclassAmigaIntui");