added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / amiga / workbench / hidds / graphics / intuition / GraphicsClass.c
blob3270103168eb1f303e4fe957006e5a4e95703f6b
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: GraphicsAmigaIntui hidd class implementation.
6 Lang: english
7 */
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"
21 #undef SDEBUG
22 #undef DEBUG
23 #define DEBUG 1
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 *****************************/
54 #undef OOPBase
55 #undef SysBase
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)
64 Class *cl = NULL;
65 BOOL ok = FALSE;
67 struct MethodDescr gfxhidd_descr[NUM_GFXHIDD_METHODS + 1] =
69 {(IPTR (*)())hiddgfx_newbitmap, moHidd_Gfx_NewBitMap},
70 {(IPTR (*)())hiddgfx_disposebitmap, moHidd_Gfx_DisposeBitMap},
71 {NULL, 0UL}
75 struct InterfaceDescr ifdescr[] =
77 {gfxhidd_descr, IID_Hidd_Gfx, NUM_GFXHIDD_METHODS},
78 {NULL, NULL, 0}
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) },
89 {TAG_DONE, 0UL}
93 EnterFunc(bug("init_gfxhiddclassAmigaIntui(csd=%p)\n", csd));
95 cl = NewObject(NULL, CLID_HiddMeta, tags);
96 D(bug("Class=%p\n", cl));
97 if(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));
105 if(csd->bitmapclass)
107 D(bug("BitMapClass ok\n"));
109 ok = TRUE;
113 if(ok == FALSE)
115 free_gfxhiddclass(csd);
116 cl = NULL;
118 else
120 AddClass(cl);
123 ReturnPtr("init_gfxhiddclassAmigaIntui", Class *, cl);
127 void free_gfxhiddclass(struct class_static_data *csd)
129 EnterFunc(bug("free_gfxhiddclassAmigaIntui(csd=%p)\n", csd));
131 if(csd)
133 RemoveClass(csd->gfxhiddclass);
134 free_bitmapclass(csd);
136 DisposeObject((Object *) csd->gfxhiddclass);
139 ReturnVoid("free_gfxhiddclassAmigaIntui");