Fixed compatibility of output.
[AROS.git] / test / hidds / graphics / obsolete / gfxhiddtool.c
blobcd5413b565410a6561450b0b9206ae395e744c31
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define AROS_USE_OOP
8 #include <stdio.h>
9 #include <strings.h>
11 #include <aros/config.h>
12 #include <exec/types.h>
14 #include <proto/exec.h>
15 #include <proto/dos.h>
16 #include <proto/oop.h>
17 #include <proto/utility.h>
19 #include <utility/tagitem.h>
21 #include <oop/oop.h>
22 #include <hidd/graphics.h>
24 #include "gfxhiddtool.h"
26 #undef SDEBUG
27 #undef DEBUG
28 #define DEBUG 1
29 #include <aros/debug.h>
31 extern struct Library *OOPBase;
32 /***************************************************************/
34 BOOL ght_OpenLibs(struct ght_OpenLibs *libsArray)
36 ULONG i = 0;
37 BOOL ok = TRUE;
39 while(libsArray[i].base)
41 *libsArray[i++].base = NULL;
44 i = 0;
46 while(libsArray[i].libName && ok)
48 *libsArray[i].base = OpenLibrary(libsArray[i].libName, libsArray[i].version);
49 if(*libsArray[i].base == NULL)
51 printf("Can't open library '%s' V%li!\n",
52 libsArray[i].libName,
53 libsArray[i].version
55 ok = FALSE;
58 i++;
61 return ok;
63 /***************************************************************/
65 void ght_CloseLibs(struct ght_OpenLibs *libsArray)
67 ULONG i = 0;
68 BOOL quit = FALSE;
70 while(libsArray[i].base && !quit)
72 if(*libsArray[i].base != NULL)
74 CloseLibrary(*libsArray[i].base);
75 i++;
77 else
79 quit = TRUE;
83 /***************************************************************/
85 ULONG ght_GetAttr(Object *obj, ULONG attrID)
87 ULONG ret;
89 GetAttr(obj, attrID, &ret);
90 return ret;
92 /***************************************************************/
94 OOP_Object * NewGC(OOP_Object *hiddGfx, ULONG gcType, struct TagItem *tagList)
96 static OOP_MethodID mid = 0;
97 struct pHidd_Gfx_NewGC p;
99 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Gfx, moHidd_Gfx_NewGC);
101 p.mID = mid;
102 /* p.gcType = gcType;*/
103 p.attrList = tagList;
105 return((OOP_Object *) OOP_DoMethod(hiddGfx, (OOP_Msg) &p));
107 /***************************************************************/
109 void DisposeGC(OOP_Object *hiddGfx, OOP_Object *gc)
111 static OOP_MethodID mid = 0;
112 struct pHidd_Gfx_DisposeGC p;
114 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Gfx, moHidd_Gfx_DisposeGC);
116 p.mID = mid;
117 p.gc = gc;
119 OOP_DoMethod(hiddGfx, (OOP_Msg) &p);
121 /***************************************************************/
123 OOP_Object * NewBitMap(OOP_Object *hiddGfx, struct TagItem *tagList)
125 static OOP_MethodID mid = 0;
126 struct pHidd_Gfx_NewBitMap p;
128 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Gfx, moHidd_Gfx_NewBitMap);
130 p.mID = mid;
131 p.attrList = tagList;
133 return((OOP_Object *) OOP_DoMethod(hiddGfx, (OOP_Msg) &p));
135 /***************************************************************/
137 void DisposeBitMap(OOP_Object *hiddGfx, OOP_Object *bitMap)
139 static OOP_MethodID mid = 0;
140 struct pHidd_Gfx_DisposeBitMap p;
142 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Gfx, moHidd_Gfx_DisposeBitMap);
144 p.mID = mid;
145 p.bitMap = bitMap;
147 OOP_DoMethod(hiddGfx, (OOP_Msg) &p);
149 /***************************************************************/