2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
10 #include <exec/memory.h>
11 #include <graphics/gfxbase.h>
12 #include <graphics/monitor.h>
13 #include <graphics/view.h>
14 #include <graphics/gfxnodes.h>
15 #include <proto/exec.h>
16 #include <proto/graphics.h>
17 #include "graphics_intern.h"
19 /*****************************************************************************
23 AROS_LH1(struct ExtendedNode
*, GfxNew
,
27 AROS_LHA( ULONG
, node_type
, D0
),
31 struct GfxBase
*, GfxBase
, 110, Graphics
)
34 Allocate a special graphics extended data structure. The type of
35 structure to be allocated is passed in the node_type identifier.
38 node_type = the type of graphics extended data structure to allocate.
39 (see gfxnodes.h for identifier definitions.)
42 A pointer to the allocated graphics node or NULL if the allocation
52 graphics/gfxnodes.h GfxFree(), GfxAssociate(), GfxLookUp()
58 ******************************************************************************/
62 struct ExtendedNode
* Result
;
63 const ULONG GfxNew_memsizes
[] = { 0,
64 sizeof(struct ViewExtra
),
65 sizeof(struct ViewPortExtra
),
66 sizeof(struct SpecialMonitor
),
67 sizeof(struct MonitorSpec
)
71 if (node_type
>= VIEW_EXTRA_TYPE
&& node_type
<= MONITOR_SPEC_TYPE
)
73 Result
= (struct ExtendedNode
*) AllocMem(GfxNew_memsizes
[node_type
],
74 MEMF_CLEAR
| MEMF_PUBLIC
);
77 /* do some initialisation they all have in common */
78 Result
->xln_Type
= NT_GRAPHICS
;
79 Result
->xln_Subsystem
= SS_GRAPHICS
;
80 Result
->xln_Subtype
= (BYTE
)node_type
;
81 /* Result->xln_Library = (APTR)GfxBase; */
83 /* the following pointer has to point to some unknown routine */
84 /* Result->xln_Init = ???; */
86 /* lets get more specific now !*/
90 ((struct ViewExtra
*)Result
)->Monitor
= (struct MonitorSpec
*)
91 FindName((struct List
*)(&(GfxBase
-> MonitorList
)), DEFAULT_MONITOR_NAME
);
93 case VIEWPORT_EXTRA_TYPE
:
95 case SPECIAL_MONITOR_TYPE
:
96 /* ((struct SpecialMonitor *)Result).do_monitor = */
98 case MONITOR_SPEC_TYPE
:
99 /* ((struct MonitorSpec *)Result)->ms_transform = */
100 /* ((struct MonitorSpec *)Result)->ms_translate = */
101 /* ((struct MonitorSpec *)Result)->ms_scale = */
102 /* ((struct MonitorSpec *)Result)->ms_xoffset = */
103 /* ((struct MonitorSpec *)Result)->ms_yoffset = */
104 /* ((struct MonitorSpec *)Result)->ms_maxoscan = */
105 /* ((struct MonitorSpec *)Result)->ms_videoscan = */
106 /* ((struct MonitorSpec *)Result)->ms_reserved00 = */
107 /* ((struct MonitorSpec *)Result)->ms_reserved01 = */
111 } /* could allocate requested memory */
112 } /* node_type is valid */