2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
10 #include <graphics/gfxnodes.h>
11 #include <graphics/monitor.h>
12 #include <graphics/view.h>
13 #include <graphics/gfxbase.h>
14 #include <proto/exec.h>
15 #include <proto/graphics.h>
16 #include "graphics_intern.h"
18 /*****************************************************************************
22 AROS_LH1( struct ExtendedNode
*, GfxLookUp
,
26 AROS_LHA( void *, pointer
, A0
),
30 struct GfxBase
*, GfxBase
, 117, Graphics
)
33 Finds a special graphics extended data structure (if an) associated
34 with the pointer to a data structure (e.g.: ViewExtra associated with
38 pointer = a pointer to a data structure which may have an
39 ExtendedNode associated with it (typically a View)
42 result = a pointer to the ExtendedNode that has previously been
43 associated with the pointer
52 graphics/gfxnodes.h, GfxNew(), GfxAssociate(), GfxFree()
58 ******************************************************************************/
62 IPTR
*Hash
= GfxBase
-> hash_table
;
63 ULONG Index
= CalcHashIndex((IPTR
)pointer
, GFXASSOCIATE_HASHSIZE
);
65 /* Whatever structure we get as node we put the pointer in the space
66 following immediately after the ExtendedNode structure.
68 ViewPortExtra -> ViewPort
71 ObtainSemaphoreShared(GfxBase
->HashTableSemaphore
);
73 struct ExtendedNode
* node
= (struct ExtendedNode
*)(Hash
[Index
]);
76 if (pointer
== (void *) ((struct ViewExtra
*)node
)->View
)
79 /* examine the next element */
80 node
= (struct ExtendedNode
*)node
-> xln_Succ
;
83 ReleaseSemaphore(GfxBase
->HashTableSemaphore
);