1 #include <dos/dosextens.h>
2 #include <exec/libraries.h>
3 #include <oop/ifmeta.h>
6 #include <proto/exec.h>
7 #include <proto/graphics.h>
10 #include "compositor_intern.h"
13 struct Library
*OOPBase
;
14 struct Library
*UtilityBase
;
17 OOP_AttrBase HiddPixFmtAttrBase
;
18 OOP_AttrBase HiddSyncAttrBase
;
19 OOP_AttrBase HiddBitMapAttrBase
;
20 OOP_AttrBase HiddGCAttrBase
;
21 OOP_AttrBase HiddCompositorAttrBase
;
23 const TEXT version
[] = "$VER: Compositor 41.1 (8.10.2013)\n";
25 static const struct OOP_ABDescr attrbases
[] =
27 { IID_Hidd_PixFmt
, &HiddPixFmtAttrBase
},
28 { IID_Hidd_Sync
, &HiddSyncAttrBase
},
29 { IID_Hidd_BitMap
, &HiddBitMapAttrBase
},
30 { IID_Hidd_GC
, &HiddGCAttrBase
},
31 { IID_Hidd_Compositor
, &HiddCompositorAttrBase
},
35 static OOP_Class
*InitClass(void)
37 OOP_AttrBase MetaAttrBase
= OOP_ObtainAttrBase(IID_Meta
);
40 struct TagItem Compositor_tags
[] =
42 {aMeta_SuperID
, (IPTR
)CLID_Root
},
43 {aMeta_InterfaceDescr
, (IPTR
)Compositor_ifdescr
},
44 {aMeta_InstSize
, sizeof(struct HIDDCompositorData
)},
45 {aMeta_ID
, (IPTR
)CLID_Hidd_Compositor
},
49 if (MetaAttrBase
== 0)
52 cl
= OOP_NewObject(NULL
, CLID_HiddMeta
, Compositor_tags
);
56 OOP_ReleaseAttrBase(IID_Meta
);
60 int __nocommandline
= 1;
64 int ret
= RETURN_FAIL
;
67 * Open these libraries manually because we don't want them to be
68 * automatically closed when we stay resident.
70 UtilityBase
= OpenLibrary("utility.library", 0);
73 OOPBase
= OpenLibrary("oop.library", 42);
76 if (OOP_ObtainAttrBases(attrbases
))
78 if (OOP_FindClass(CLID_Hidd_Compositor
))
80 /* Double-starting is a valid operation. */
85 OOP_Class
*cl
= InitClass();
90 * Yes, composer is not a real display driver. It has totally different API.
91 * AddDisplayDriverA() knows this.
93 ULONG err
= AddDisplayDriverA(cl
, NULL
, NULL
);
98 struct Process
*me
= (struct Process
*) FindTask(NULL
);
102 struct CommandLineInterface
*cli
= BADDR(me
->pr_CLI
);
104 cli
->cli_Module
= BNULL
;
107 me
->pr_SegList
= BNULL
;
109 /* Don't close our libraries and release attrbases. The HIDD needs them. */
116 OOP_ReleaseAttrBases(attrbases
);
117 CloseLibrary(OOPBase
);
119 CloseLibrary(UtilityBase
);