2 Copyright (C) 2013, The AROS Development Team.
6 #define MUIMASTER_YES_INLINE_STDARG
8 #include <exec/memory.h>
10 #include <hidd/graphics.h>
11 #include <libraries/mui.h>
12 #include <mui/NFloattext_mcc.h>
13 #include <utility/tagitem.h>
14 #include <utility/hooks.h>
16 #include <proto/alib.h>
17 #include <proto/exec.h>
18 #include <proto/muimaster.h>
19 #include <proto/utility.h>
20 #include <proto/intuition.h>
27 #include "cpuspecific.h"
30 #include <zune/customclasses.h>
32 /*** Instance Data **********************************************************/
39 struct TagItem gfxMemTags
[12];
42 static Object
*GfxWindow__OM_NEW(Class
*cl
, Object
*self
, struct opSet
*msg
)
44 STRPTR pagetitles
[3] =
50 Object
*memTotal
, *memFree
, *GARTTotal
, *GARTFree
;
52 OOP_Object
*gfxhidd_obj
=
53 (OOP_Object
*)GetTagData(MUIA_PropertyWin_Object
, 0, msg
->ops_AttrList
);
55 OOP_GetAttr(gfxhidd_obj
, aHidd_HardwareName
, &name
);
56 OOP_GetAttr(gfxhidd_obj
, aHidd_Name
, &driver
);
58 self
= (Object
*) DoSuperNewTags
61 MUIA_Window_Title
, name
,
62 MUIA_Window_ID
, MAKE_ID('G', 'F', 'X', 'D'),
63 WindowContents
, (IPTR
)(RegisterObject
,
64 MUIA_Register_Titles
, (IPTR
) pagetitles
,
67 GroupFrameT("Details"),
69 Child
, Label("Device:"),
71 Child
, Label("Manufacturer:"),
73 Child
, Label("Driver:"),
74 Child
, LLabel(driver
),
78 GroupFrameT("Memory Information"),
81 Child
, Label("Video RAM"),
85 Child
, Label("Total"),
87 Child
, (IPTR
)(memTotal
= TextObject
, TextFrame
, MUIA_Background
, MUII_TextBack
,
88 MUIA_Text_PreParse
, (IPTR
)"\33r", MUIA_Text_Contents
, (IPTR
)"N/A",
90 Child
, (IPTR
)(memFree
= TextObject
, TextFrame
, MUIA_Background
, MUII_TextBack
,
91 MUIA_Text_PreParse
, (IPTR
)"\33r", MUIA_Text_Contents
, (IPTR
)"",
93 Child
, (IPTR
)(GARTTotal
= TextObject
, TextFrame
, MUIA_Background
, MUII_TextBack
,
94 MUIA_Text_PreParse
, (IPTR
)"\33r", MUIA_Text_Contents
, (IPTR
)"N/A",
96 Child
, (IPTR
)(GARTFree
= TextObject
, TextFrame
, MUIA_Background
, MUII_TextBack
,
97 MUIA_Text_PreParse
, (IPTR
)"\33r", MUIA_Text_Contents
, (IPTR
)"",
111 struct GfxWindow_DATA
*data
= INST_DATA(cl
, self
);
113 data
->memTotal
= memTotal
;
114 data
->memFree
= memFree
;
115 data
->GARTTotal
= GARTTotal
;
116 data
->GARTFree
= GARTFree
;
118 data
->gfxMemTags
[0].ti_Tag
= vHidd_Gfx_MemTotal
;
119 data
->gfxMemTags
[1].ti_Tag
= vHidd_Gfx_MemFree
;
120 data
->gfxMemTags
[2].ti_Tag
= vHidd_Gfx_MemAddressableTotal
;
121 data
->gfxMemTags
[3].ti_Tag
= vHidd_Gfx_MemAddressableFree
;
122 data
->gfxMemTags
[4].ti_Tag
= vHidd_Gfx_MemClock
;
123 data
->gfxMemTags
[5].ti_Tag
= TAG_DONE
;
125 OOP_GetAttr(gfxhidd_obj
, aHidd_Gfx_MemoryAttribs
, &data
->gfxMemTags
);
127 if (data
->gfxMemTags
[0].ti_Data
)
129 sprintf(valBuf
, "%ld", data
->gfxMemTags
[0].ti_Data
);
130 SET(data
->memTotal
, MUIA_Text_Contents
, valBuf
);
131 sprintf(valBuf
, "%ld", data
->gfxMemTags
[1].ti_Data
);
132 SET(data
->memFree
, MUIA_Text_Contents
, valBuf
);
134 if (data
->gfxMemTags
[2].ti_Data
)
136 sprintf(valBuf
, "%ld", data
->gfxMemTags
[2].ti_Data
);
137 SET(data
->GARTTotal
, MUIA_Text_Contents
, valBuf
);
138 sprintf(valBuf
, "%ld", data
->gfxMemTags
[3].ti_Data
);
139 SET(data
->GARTFree
, MUIA_Text_Contents
, valBuf
);
145 /*** Setup ******************************************************************/
148 GfxWindow
, NULL
, MUIC_Window
, NULL
,
149 OM_NEW
, struct opSet
*