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>
15 #undef HiddBitMapAttrBase
16 OOP_AttrBase HiddGfxAttrBase
;
17 OOP_AttrBase HiddBitMapAttrBase
;
18 struct Library
* OOPBase
= NULL
;
21 static BOOL
InitVideo(struct SysMonData
*smdata
)
23 struct OOP_ABDescr attrbases
[] =
25 { IID_Hidd_Gfx
, &HiddGfxAttrBase
},
26 { IID_Hidd_BitMap
, &HiddBitMapAttrBase
},
29 struct Screen
* wbscreen
;
31 OOPBase
= OpenLibrary("oop.library", 0L);
36 if (!OOP_ObtainAttrBases(attrbases
))
39 wbscreen
= LockPubScreen(NULL
);
40 OOP_GetAttr(HIDD_BM_OBJ(wbscreen
->RastPort
.BitMap
), aHidd_BitMap_GfxHidd
, (APTR
)&gfxhidd
);
41 bug("[SysMon:Video] %s: gfxhidd @ 0x%p\n", __func__
, gfxhidd
);
42 UnlockPubScreen(NULL
, wbscreen
);
47 static VOID
DeInitVideo(struct SysMonData
*smdata
)
49 OOP_ReleaseAttrBase(IID_Hidd_BitMap
);
51 CloseLibrary(OOPBase
);
54 VOID
UpdateVideoStaticInformation(struct SysMonData
* smdata
)
56 TEXT buffer
[64] = {0};
57 struct TagItem memTags
[] =
59 {vHidd_Gfx_MemTotal
, 0 },
60 {vHidd_Gfx_MemAddressableTotal
, 0 },
64 bug("[SysMon:Video] %s: memTags @ 0x%p\n", __func__
, memTags
);
65 OOP_GetAttr(gfxhidd
, aHidd_Gfx_MemoryAttribs
, (IPTR
*)memTags
);
67 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[0].ti_Data
/ 1024));
68 set(smdata
->memorysize
[MEMORY_VMEM
], MUIA_Text_Contents
, buffer
);
69 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[1].ti_Data
/ 1024));
70 set(smdata
->memorysize
[MEMORY_VMEMWINDOW
], MUIA_Text_Contents
, buffer
);
73 VOID
UpdateVideoInformation(struct SysMonData
* smdata
)
75 TEXT buffer
[64] = {0};
76 struct TagItem memTags
[] =
78 {vHidd_Gfx_MemFree
, 0 },
79 {vHidd_Gfx_MemAddressableFree
, 0 },
83 bug("[SysMon:Video] %s: memTags @ 0x%p\n", __func__
, memTags
);
84 OOP_GetAttr(gfxhidd
, aHidd_Gfx_MemoryAttribs
, (IPTR
*)memTags
);
86 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[0].ti_Data
/ 1024));
87 set(smdata
->memoryfree
[MEMORY_VMEM
], MUIA_Text_Contents
, buffer
);
88 __sprintf(buffer
, "%ld kB", (ULONG
)(memTags
[1].ti_Data
/ 1024));
89 set(smdata
->memoryfree
[MEMORY_VMEMWINDOW
], MUIA_Text_Contents
, buffer
);
92 struct SysMonModule videomodule
=
95 .DeInit
= DeInitVideo
,