2 Copyright (C) 2015, The AROS Development Team.
7 #include <aros/debug.h>
9 #include <proto/alib.h>
10 #include <proto/dos.h>
11 #include <proto/exec.h>
12 #include <proto/muimaster.h>
13 #include <proto/oop.h>
14 #include <proto/utility.h>
15 #include <proto/intuition.h>
17 #include <mui/NListtree_mcc.h>
18 #include <mui/NListview_mcc.h>
19 #include <utility/tagitem.h>
20 #include <utility/hooks.h>
22 #include <hidd/graphics.h>
28 OOP_AttrBase HiddGfxAttrBase
;
30 const struct OOP_ABDescr gfx_abd
[] =
32 {IID_Hidd_Gfx
, &HiddGfxAttrBase
},
36 static void addGgfxDisplay(OOP_Object
*obj
, struct MUI_NListtree_TreeNode
*parent
)
38 struct InsertObjectMsg msg
=
41 .winClass
= MonitorWindow_CLASS
45 OOP_GetAttr(obj
, aHidd_Name
, (IPTR
*)&name
);
47 DoMethod(hidd_tree
, MUIM_NListtree_Insert
, name
, &msg
,
48 parent
, MUIV_NListtree_Insert_PrevNode_Tail
, 0);
51 void gfxEnum(OOP_Object
*obj
, struct MUI_NListtree_TreeNode
*tn
)
53 OOP_Object
*display
= NULL
;
54 struct List
*displays
= NULL
;
56 D(bug("[SysExplorer:Gfx] %s: found '%s'\n", __PRETTY_FUNCTION__
, OOP_OCLASS(obj
)->ClassNode
.ln_Name
));
58 /* software rasterizer doesnt have an actual "sidplay" */
59 if (OOP_OCLASS(obj
) == OOP_FindClass(CLID_Hidd_Gfx
))
62 OOP_GetAttr(obj
, aHidd_Gfx_DisplayList
, (IPTR
*)&displays
);
65 ForeachNode(displays
, display
)
67 addGgfxDisplay(display
, tn
);
72 OOP_GetAttr(obj
, aHidd_Gfx_DisplayDefault
, (IPTR
*)&display
);
74 addGgfxDisplay(display
, tn
);
78 BOOL
gfxValid(OOP_Object
*obj
, ULONG
*flags
)
80 if (OOP_OCLASS(obj
) == OOP_FindClass(CLID_Hidd_Gfx
))
82 ULONG _flags
= *flags
;
89 BOOL
gfxenum_init(void)
91 D(bug("[SysExplorer:Gfx] Initialising..\n"));
93 OOP_ObtainAttrBases(gfx_abd
);
94 RegisterClassHandler(CLID_Hidd_Gfx
, 60, &GfxWindow_CLASS
, gfxEnum
, gfxValid
);
99 ADD2INIT(gfxenum_init
, 10);