2 Copyright © 2010-2013, The AROS Development Team. All rights reserved.
5 Get a copy of monitors list
8 #include <intuition/extensions.h>
9 #include <proto/exec.h>
10 #include <proto/utility.h>
12 #include "intuition_intern.h"
13 #include "monitorclass_private.h"
15 /*****************************************************************************
19 #include <proto/intuition.h>
21 AROS_LH1(Object
**, GetMonitorList
,
24 AROS_LHA(struct TagItem
*, tags
, A1
),
27 struct IntuitionBase
*, IntuitionBase
, 161, Intuition
)
30 Obtain an array of monitorclass objects installed in the
34 tags - an optional pointer to a taglist with additional options.
35 Currently only one tag is defined:
37 GMLA_DisplayID - list only monitors matching the given
41 A pointer to a NULL-terminated array of BOOPSI object pointers.
42 This is a copy of internal list, you need to free it using
46 This function is compatible with MorphOS v2.
57 *****************************************************************************/
61 struct Library
*UtilityBase
= GetPrivIBase(IntuitionBase
)->UtilityBase
;
65 ULONG id
= GetTagData(GMLA_DisplayID
, INVALID_ID
, tags
);
67 ObtainSemaphoreShared(&GetPrivIBase(IntuitionBase
)->MonitorListSem
);
69 for (n
= GetPrivIBase(IntuitionBase
)->MonitorList
.mlh_Head
; n
->mln_Succ
; n
= n
->mln_Succ
) {
70 if ((id
== INVALID_ID
) || DoMethod((Object
*)n
, MM_CheckID
, id
))
74 res
= AllocVec(num
* sizeof(Object
*), MEMF_ANY
);
78 for (n
= GetPrivIBase(IntuitionBase
)->MonitorList
.mlh_Head
; n
->mln_Succ
; n
= n
->mln_Succ
) {
79 if ((id
== INVALID_ID
) || DoMethod((Object
*)n
, MM_CheckID
, id
))
80 res
[num
++] = (Object
*)n
;
85 ReleaseSemaphore(&GetPrivIBase(IntuitionBase
)->MonitorListSem
);