2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
10 #include <graphics/gfxbase.h>
11 #include <graphics/gfxnodes.h>
12 #include <graphics/monitor.h>
13 #include <graphics/view.h>
14 #include <proto/exec.h>
15 #include <proto/graphics.h>
16 #include "graphics_intern.h"
18 /*****************************************************************************
22 AROS_LH1( void , GfxFree
,
25 AROS_LHA(struct ExtendedNode
*, node
, A0
),
29 struct GfxBase
*, GfxBase
, 111, Graphics
)
32 Free a special graphics extended data structure which was preciously
36 node = pointer to a graphics extended data structure obtained by
40 The node will be deallocated from memory. Graphics will disassociate
41 this special graphics extended node from any associated data
42 structure, if necessary, before freeing it (see GfxAssociate())
51 graphics/gfxnodes.h, GfxNew(), GfxAssociate(), GfxLookUp()
57 ******************************************************************************/
61 const ULONG GfxNew_memsizes
[] = { 0,
62 sizeof(struct ViewExtra
),
63 sizeof(struct ViewPortExtra
),
64 sizeof(struct SpecialMonitor
),
65 sizeof(struct MonitorSpec
)
68 if ( SS_GRAPHICS
== node
->xln_Subsystem
&&
69 NT_GRAPHICS
== node
->xln_Type
)
71 /* take the element out of the hashlist, if it is in the
74 /* if the element has a Successor */
75 if (NULL
!= node
-> xln_Succ
)
76 ((struct ExtendedNode
*)(node
-> xln_Succ
)) -> xln_Pred
= (struct Node
*) (node
-> xln_Pred
);
78 /* if the previous Element is not the hashlist itself */
79 /* (the same code works also if the previous entry is the hashlist ) */
80 ((struct ExtendedNode
*)(node
-> xln_Pred
)) -> xln_Succ
= (struct Node
*) (node
-> xln_Succ
);
82 FreeMem((void *) node
, GfxNew_memsizes
[node
->xln_Subtype
]);