2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
7 * A newstyle startup code for resident display drivers.
9 * Now it's the job of the driver to add ifself to the system.
10 * The driver does not have to be a library anymore, it can be
11 * plain executable which is started from DEVS:Monitors.
13 * The job of driver startup code is to create all necessary
14 * classes (driver class and bitmap class) and create as many
15 * driver objects as possible. Every object needs to be given
16 * to AddDisplayDriverA() in order to become functional.
18 * When the transition completes, kludges from bootmenu and
19 * dosboot will be removed. Noone will care about library
23 #include <aros/debug.h>
24 #include <aros/symbolsets.h>
25 #include <hidd/hidd.h>
26 #include <hidd/keyboard.h>
27 #include <hidd/mouse.h>
28 #include <graphics/gfxbase.h>
29 #include <proto/exec.h>
30 #include <proto/graphics.h>
31 #include <proto/oop.h>
33 #include LC_LIBDEFS_FILE
35 static int X11_Startup(LIBBASETYPEPTR LIBBASE
)
37 struct TagItem kbd_tags
[] =
39 {aHidd_Name
, (IPTR
)"X11Kbd" },
40 {aHidd_HardwareName
, (IPTR
)"X Window keyboard input"},
41 {aHidd_ProducerName
, (IPTR
)"X.Org Foundation" },
44 struct TagItem mouse_tags
[] =
46 {aHidd_Name
, (IPTR
)"X11Mouse" },
47 {aHidd_HardwareName
, (IPTR
)"X Window pointer input"},
48 {aHidd_ProducerName
, (IPTR
)"X.Org Foundation" },
51 struct GfxBase
*GfxBase
;
53 OOP_Object
*kbdriver
= NULL
;
54 OOP_Object
*msdriver
= NULL
;
58 D(bug("[X11] X11_Startup()\n"));
60 GfxBase
= (struct GfxBase
*)OpenLibrary("graphics.library", 41);
61 D(bug("[X11_Startup] GfxBase 0x%p\n", GfxBase
));
65 /* Add keyboard and mouse driver to the system */
66 kbd
= OOP_NewObject(NULL
, CLID_Hidd_Kbd
, NULL
);
67 ms
= OOP_NewObject(NULL
, CLID_Hidd_Mouse
, NULL
);
71 CloseLibrary(&GfxBase
->LibNode
);
75 kbdriver
= HW_AddDriver(kbd
, LIBBASE
->xsd
.kbdclass
, kbd_tags
);
77 msdriver
= HW_AddDriver(ms
, LIBBASE
->xsd
.mouseclass
, mouse_tags
);
79 /* If we got no input, we can't work, fail */
82 CloseLibrary(&GfxBase
->LibNode
);
86 err
= AddDisplayDriverA(LIBBASE
->xsd
.gfxclass
, NULL
, NULL
);
88 D(bug("[X11_Startup] AddDisplayDriver() result: %u\n", err
));
91 LIBBASE
->library
.lib_OpenCnt
= 1;
97 HW_RemoveDriver(kbd
, kbdriver
);
99 HW_RemoveDriver(ms
, msdriver
);
102 CloseLibrary(&GfxBase
->LibNode
);
107 /* This routine must be called AFTER everything all other initialization was run */
108 ADD2INITLIB(X11_Startup
, 10);