st/xlib: Use more appropriate include guard
[mesa.git] / src / gallium / state_trackers / glx / xlib / xm_api.h
index 4f2c8a6e6a9a8ddf25d9a1db3e159d99f421e56e..9684b5a17e1aa8ecb870934012ee928975590db5 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.1
  * 
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  * 
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
@@ -53,20 +53,22 @@ and create a window, you must do the following to use the X/Mesa interface:
 
 
 
-#ifndef XMESA_H
-#define XMESA_H
+#ifndef XM_API_H
+#define XM_API_H
 
 
-#include "main/mtypes.h"
+#include "main/mtypes.h" /* for gl_config */
 #include "state_tracker/st_api.h"
 #include "os/os_thread.h"
 
-#include "state_tracker/xlib_sw_winsys.h"
+#include "state_tracker/xlibsw_api.h"
 
 # include <X11/Xlib.h>
 # include <X11/Xlibint.h>
 # include <X11/Xutil.h>
 
+struct hud_context;
+
 typedef struct xmesa_display *XMesaDisplay;
 typedef struct xmesa_buffer *XMesaBuffer;
 typedef struct xmesa_context *XMesaContext;
@@ -74,7 +76,7 @@ typedef struct xmesa_visual *XMesaVisual;
 
 
 struct xmesa_display {
-   pipe_mutex mutex;
+   mtx_t mutex;
 
    Display *display;
    struct pipe_screen *screen;
@@ -140,7 +142,10 @@ extern void XMesaDestroyVisual( XMesaVisual v );
  * Return:  an XMesaContext or NULL if error.
  */
 extern XMesaContext XMesaCreateContext( XMesaVisual v,
-                                       XMesaContext share_list );
+                                       XMesaContext share_list,
+                                        GLuint major, GLuint minor,
+                                        GLuint profileMask,
+                                        GLuint contextFlags);
 
 
 /*
@@ -280,7 +285,8 @@ XMesaCopyContext(XMesaContext src, XMesaContext dst, unsigned long mask);
  * Basically corresponds to an XVisualInfo.
  */
 struct xmesa_visual {
-   GLvisual mesa_visual;       /* Device independent visual parameters */
+   struct gl_config mesa_visual;/* Device independent visual parameters */
+   int screen, visualID, visualType;
    Display *display;   /* The X11 display */
    XVisualInfo * visinfo;      /* X's visual info (pointer to private copy) */
    XVisualInfo *vishandle;     /* Only used in fakeglx.c */
@@ -301,6 +307,7 @@ struct xmesa_context {
    XMesaVisual xm_visual;      /** pixel format info */
    XMesaBuffer xm_buffer;      /** current drawbuffer */
    XMesaBuffer xm_read_buffer;  /** current readbuffer */
+   struct hud_context *hud;
 };
 
 
@@ -325,7 +332,6 @@ struct xmesa_buffer {
 
    GLboolean wasCurrent;       /* was ever the current buffer? */
    XMesaVisual xm_visual;      /* the X/Mesa visual */
-   Drawable drawable;  /* Usually the X window ID */
    Colormap cmap;              /* the X colormap */
    BufferType type;             /* window, pixmap, pbuffer or glxwindow */
 
@@ -350,7 +356,10 @@ struct xmesa_buffer {
 
 
 
-extern void
+extern const char *
+xmesa_get_name(void);
+
+extern int
 xmesa_init(Display *dpy);
 
 extern XMesaBuffer
@@ -360,24 +369,30 @@ extern void
 xmesa_get_window_size(Display *dpy, XMesaBuffer b,
                       GLuint *width, GLuint *height);
 
+extern void
+xmesa_notify_invalid_buffer(XMesaBuffer b);
+
 extern void
 xmesa_check_buffer_size(XMesaBuffer b);
 
 extern void
 xmesa_destroy_buffers_on_display(Display *dpy);
 
-static INLINE GLuint
+extern void
+xmesa_close_display(Display *dpy);
+
+static inline GLuint
 xmesa_buffer_width(XMesaBuffer b)
 {
    return b->width;
 }
 
-static INLINE GLuint
+static inline GLuint
 xmesa_buffer_height(XMesaBuffer b)
 {
    return b->height;
 }
 
-
+extern boolean xmesa_strict_invalidate;
 
 #endif