2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
10 #include <exec/types.h>
11 #include <exec/memory.h>
12 #include <graphics/gfxbase.h>
13 #include <graphics/monitor.h>
14 #include <graphics/view.h>
15 #include <graphics/gfxnodes.h>
16 #include <proto/exec.h>
17 #include <proto/graphics.h>
18 #include "graphics_intern.h"
20 static LONG
dummy_init(void);
22 /*****************************************************************************
26 AROS_LH1(struct ExtendedNode
*, GfxNew
,
30 AROS_LHA( ULONG
, node_type
, D0
),
34 struct GfxBase
*, GfxBase
, 110, Graphics
)
37 Allocate a special graphics extended data structure. The type of
38 structure to be allocated is passed in the node_type identifier.
41 node_type = the type of graphics extended data structure to allocate.
42 (see gfxnodes.h for identifier definitions.)
45 A pointer to the allocated graphics node or NULL if the allocation
55 graphics/gfxnodes.h, GfxFree(), GfxAssociate(), GfxLookUp()
61 ******************************************************************************/
65 struct ExtendedNode
* Result
;
66 const ULONG GfxNew_memsizes
[] = { 0,
67 sizeof(struct ViewExtra
),
68 sizeof(struct ViewPortExtra
),
69 sizeof(struct SpecialMonitor
),
70 sizeof(struct MonitorSpec
)
74 if (node_type
>= VIEW_EXTRA_TYPE
&& node_type
<= MONITOR_SPEC_TYPE
)
76 Result
= (struct ExtendedNode
*) AllocMem(GfxNew_memsizes
[node_type
],
77 MEMF_CLEAR
| MEMF_PUBLIC
);
80 /* do some initialisation they all have in common */
81 Result
->xln_Type
= NT_GRAPHICS
;
82 Result
->xln_Subsystem
= SS_GRAPHICS
;
83 Result
->xln_Subtype
= (BYTE
)node_type
;
84 Result
->xln_Library
= GfxBase
;
86 /* the following pointer has to point to some unknown routine */
87 /* WB2.x+ native monitor drivers call it, added dummy function to prevent crash */
88 Result
->xln_Init
= dummy_init
;
91 /* lets get more specific now !*/
95 ((struct ViewExtra
*)Result
)->Monitor
= GfxBase
->natural_monitor
;
96 /* FindName() can't work here until ABI v1 release
97 FindName((struct List *)(&(GfxBase -> MonitorList)), DEFAULT_MONITOR_NAME);*/
99 case VIEWPORT_EXTRA_TYPE
:
101 case SPECIAL_MONITOR_TYPE
:
102 /* ((struct SpecialMonitor *)Result).do_monitor = */
104 case MONITOR_SPEC_TYPE
:
105 /* ((struct MonitorSpec *)Result)->ms_transform = */
106 /* ((struct MonitorSpec *)Result)->ms_translate = */
107 /* ((struct MonitorSpec *)Result)->ms_scale = */
108 /* ((struct MonitorSpec *)Result)->ms_xoffset = */
109 /* ((struct MonitorSpec *)Result)->ms_yoffset = */
110 /* ((struct MonitorSpec *)Result)->ms_maxoscan = */
111 /* ((struct MonitorSpec *)Result)->ms_videoscan = */
112 /* ((struct MonitorSpec *)Result)->ms_reserved00 = */
113 /* ((struct MonitorSpec *)Result)->ms_reserved01 = */
117 } /* could allocate requested memory */
118 } /* node_type is valid */
124 static LONG
dummy_init(void)
126 D(bug("xln_Init called\n"));