2 Copyright © 1995-2019, The AROS Development Team. All rights reserved.
6 #include "sysmon_intern.h"
8 #include <clib/alib_protos.h>
10 /* Video information */
11 #include <proto/graphics.h>
12 #include <proto/oop.h>
17 #undef HiddBitMapAttrBase
18 OOP_AttrBase HiddGfxAttrBase
;
19 OOP_AttrBase HiddBitMapAttrBase
;
21 struct Library
* OOPBase
= NULL
;
25 static BOOL
InitVideo(struct SysMonData
*smdata
)
27 struct OOP_ABDescr attrbases
[] =
29 { IID_Hidd_Gfx
, &HiddGfxAttrBase
},
30 { IID_Hidd_BitMap
, &HiddBitMapAttrBase
},
33 struct Screen
* wbscreen
;
35 OOPBase
= OpenLibrary("oop.library", 0L);
40 if (!OOP_ObtainAttrBases(attrbases
))
43 wbscreen
= LockPubScreen(NULL
);
44 OOP_GetAttr(HIDD_BM_OBJ(wbscreen
->RastPort
.BitMap
), aHidd_BitMap_GfxHidd
, (APTR
)&gfxhidd
);
45 D(bug("[SysMon:Video] %s: gfxhidd @ 0x%p\n", __func__
, gfxhidd
);)
46 UnlockPubScreen(NULL
, wbscreen
);
51 static VOID
DeInitVideo(struct SysMonData
*smdata
)
53 OOP_ReleaseAttrBase(IID_Hidd_BitMap
);
55 CloseLibrary(OOPBase
);
58 VOID
UpdateVideoStaticInformation(struct SysMonData
* smdata
)
60 TEXT buffer
[64] = {0};
61 struct TagItem memTags
[] =
63 {tHidd_Gfx_MemTotal
, 0 },
64 {tHidd_Gfx_MemAddressableTotal
, 0 },
68 DVMEM(bug("[SysMon:Video] %s: memTags @ 0x%p\n", __func__
, memTags
);)
69 OOP_GetAttr(gfxhidd
, aHidd_Gfx_MemoryAttribs
, (IPTR
*)memTags
);
71 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[0].ti_Data
/ 1024));
72 set(smdata
->memorysize
[MEMORY_VMEM
], MUIA_Text_Contents
, buffer
);
73 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[1].ti_Data
/ 1024));
74 set(smdata
->memorysize
[MEMORY_VMEMWINDOW
], MUIA_Text_Contents
, buffer
);
77 VOID
UpdateVideoInformation(struct SysMonData
* smdata
)
79 TEXT buffer
[64] = {0};
80 struct TagItem memTags
[] =
82 {tHidd_Gfx_MemFree
, 0 },
83 {tHidd_Gfx_MemAddressableFree
, 0 },
87 DVMEM(bug("[SysMon:Video] %s: memTags @ 0x%p\n", __func__
, memTags
);)
88 OOP_GetAttr(gfxhidd
, aHidd_Gfx_MemoryAttribs
, (IPTR
*)memTags
);
90 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[0].ti_Data
/ 1024));
91 set(smdata
->memoryfree
[MEMORY_VMEM
], MUIA_Text_Contents
, buffer
);
92 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[1].ti_Data
/ 1024));
93 set(smdata
->memoryfree
[MEMORY_VMEMWINDOW
], MUIA_Text_Contents
, buffer
);
96 struct SysMonModule videomodule
=
99 .DeInit
= DeInitVideo
,