egl/main: no longer export internal function
[mesa.git] / src / egl / main / eglscreen.h
1 /**************************************************************************
2 *
3 * Copyright 2008 VMware, Inc.
4 * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
5 * Copyright 2010 LunarG, Inc.
6 * All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sub license, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the
17 * next paragraph) shall be included in all copies or substantial portions
18 * of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 *
28 **************************************************************************/
29
30
31 #ifndef EGLSCREEN_INCLUDED
32 #define EGLSCREEN_INCLUDED
33
34 #include "c99_compat.h"
35
36 #include "egltypedefs.h"
37
38
39 #ifdef EGL_MESA_screen_surface
40
41
42 #define _EGL_SCREEN_MAX_MODES 16
43
44
45 /**
46 * Per-screen information.
47 * Note that an EGL screen doesn't have a size. A screen may be set to
48 * one of several display modes (width/height/scanrate). The screen
49 * then displays a drawing surface. The drawing surface must be at least
50 * as large as the display mode's resolution. If it's larger, the
51 * OriginX and OriginY fields control what part of the surface is visible
52 * on the screen.
53 */
54 struct _egl_screen
55 {
56 _EGLDisplay *Display;
57
58 EGLScreenMESA Handle; /* The public/opaque handle which names this object */
59
60 _EGLMode *CurrentMode;
61 _EGLSurface *CurrentSurface;
62
63 EGLint OriginX, OriginY; /**< Origin of scan-out region w.r.t. surface */
64 EGLint StepX, StepY; /**< Screen position/origin granularity */
65
66 EGLint NumModes;
67 _EGLMode *Modes; /**< array [NumModes] */
68 };
69
70
71 extern void
72 _eglInitScreen(_EGLScreen *screen, _EGLDisplay *dpy, EGLint num_modes);
73
74
75 extern EGLScreenMESA
76 _eglLinkScreen(_EGLScreen *screen);
77
78
79 extern _EGLScreen *
80 _eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *dpy);
81
82
83 /**
84 * Return the handle of a linked screen.
85 */
86 static inline EGLScreenMESA
87 _eglGetScreenHandle(_EGLScreen *screen)
88 {
89 return (screen) ? screen->Handle : (EGLScreenMESA) 0;
90 }
91
92
93 extern EGLBoolean
94 _eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
95
96
97 extern EGLBoolean
98 _eglScreenPositionMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint x, EGLint y);
99
100
101 extern EGLBoolean
102 _eglQueryScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy,
103 _EGLScreen *scrn, _EGLSurface **surface);
104
105
106 extern EGLBoolean
107 _eglQueryScreenModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, _EGLMode **m);
108
109
110 extern EGLBoolean
111 _eglQueryScreenMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint attribute, EGLint *value);
112
113
114 #endif /* EGL_MESA_screen_surface */
115
116
117 #endif /* EGLSCREEN_INCLUDED */