wip prep commit in lieu of gfx subsystem update changes.
[AROS.git] / workbench / libs / gadtools / getvisualinfoa.c
blobd195c922cf1fd01579b916a11d655b4d1b444767
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include <exec/memory.h>
10 #include <proto/intuition.h>
11 #include "gadtools_intern.h"
13 /*********************************************************************
15 NAME */
16 #include <proto/gadtools.h>
17 #include <intuition/screens.h>
18 #include <utility/tagitem.h>
20 AROS_LH2(APTR, GetVisualInfoA,
22 /* SYNOPSIS */
23 AROS_LHA(struct Screen *, screen, A0),
24 AROS_LHA(struct TagItem *, tagList, A1),
26 /* LOCATION */
27 struct Library *, GadToolsBase, 21, GadTools)
29 /* FUNCTION
30 GetVisualInfoA() creates a visual info structure, which is needed
31 by several gadtools functions. When you're done using it, you have
32 to call FreeVisualInfo().
34 INPUTS
35 screen - pointer to the screen to create a visual info structure for
36 (may be NULL)
37 taglist - additional tags (none defined, yet)
39 RESULT
40 A (private) visual info structure. NULL indicates an error.
42 NOTES
44 EXAMPLE
46 BUGS
48 SEE ALSO
49 FreeVisualInfo()
51 INTERNALS
53 HISTORY
55 ***************************************************************************/
57 AROS_LIBFUNC_INIT
59 struct VisualInfo *vi;
61 if (screen == NULL)
62 return NULL;
64 vi = AllocVec(sizeof(struct VisualInfo), MEMF_ANY);
65 if (!vi)
66 return NULL;
68 vi->vi_screen = screen;
69 vi->vi_dri = GetScreenDrawInfo(screen);
71 return vi;
73 AROS_LIBFUNC_EXIT
75 } /* GetVisualInfoA */