2 Copyright (C) 2015-2018, 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>
25 #include "gfx_classes.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
);
48 DoMethod(hidd_tree
, MUIM_NListtree_Insert
, name
, &msg
,
49 parent
, MUIV_NListtree_Insert_PrevNode_Tail
, 0);
52 void gfxEnum(OOP_Object
*obj
, struct MUI_NListtree_TreeNode
*tn
)
54 OOP_Object
*display
= NULL
;
55 struct List
*displays
= NULL
;
57 D(bug("[SysExplorer:Gfx] %s: found '%s'\n", __PRETTY_FUNCTION__
, OOP_OCLASS(obj
)->ClassNode
.ln_Name
));
59 /* software rasterizer doesnt have an actual "sidplay" */
60 if (OOP_OCLASS(obj
) == OOP_FindClass(CLID_Hidd_Gfx
))
63 OOP_GetAttr(obj
, aHidd_Gfx_DisplayList
, (IPTR
*)&displays
);
66 ForeachNode(displays
, display
)
68 addGgfxDisplay(display
, tn
);
73 OOP_GetAttr(obj
, aHidd_Gfx_DisplayDefault
, (IPTR
*)&display
);
75 addGgfxDisplay(display
, tn
);
79 BOOL
gfxValid(OOP_Object
*obj
, ULONG
*flags
)
81 if (OOP_OCLASS(obj
) == OOP_FindClass(CLID_Hidd_Gfx
))
83 ULONG _flags
= *flags
;
90 BOOL
gfxenum_init(void)
92 D(bug("[SysExplorer:Gfx] Initialising..\n"));
94 OOP_ObtainAttrBases(gfx_abd
);
95 RegisterClassHandler(CLID_Hidd_Gfx
, 60, &GfxWindow_CLASS
, gfxEnum
, gfxValid
);
100 ADD2INIT(gfxenum_init
, 10);