2 Copyright © 2010, 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
, 163, 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.
59 *****************************************************************************/
66 ULONG id
= GetTagData(GMLA_DisplayID
, INVALID_ID
, tags
);
68 ObtainSemaphoreShared(&GetPrivIBase(IntuitionBase
)->MonitorListSem
);
70 for (n
= GetPrivIBase(IntuitionBase
)->MonitorList
.mlh_Head
; n
->mln_Succ
; n
= n
->mln_Succ
) {
71 if ((id
== INVALID_ID
) || DoMethod((Object
*)n
, MM_CheckID
, id
))
75 res
= AllocVec(num
* sizeof(Object
*), MEMF_ANY
);
79 for (n
= GetPrivIBase(IntuitionBase
)->MonitorList
.mlh_Head
; n
->mln_Succ
; n
= n
->mln_Succ
) {
80 if ((id
== INVALID_ID
) || DoMethod((Object
*)n
, MM_CheckID
, id
))
81 res
[num
++] = (Object
*)n
;
86 ReleaseSemaphore(&GetPrivIBase(IntuitionBase
)->MonitorListSem
);