egl_dri2: Fix initialization with EGL_DEFAULT_DISPLAY
[mesa.git] / src / glx / mini / miniglxP.h
index a32429a677cc09ed933c91269fca339a0550e09f..96ed0e81cd78a44675d09dfa0b0cd5756c1bfc46 100644 (file)
@@ -18,7 +18,7 @@
 #include "mtypes.h"
 
 #include "driver.h"
-#include "dri.h"
+#include "GL/internal/dri_interface.h"
 
 /**
  * \brief Supported pixel formats.
@@ -71,7 +71,7 @@ struct MiniGLXWindowRec {
    GLubyte *frontBottom;           /**< \brief pointer to last row */
    GLubyte *backBottom;            /**< \brief pointer to last row */
    GLubyte *curBottom;             /**<  = frontBottom or backBottom */
-   __DRIdrawable *driDrawable;
+   __DRIdrawable driDrawable;
    GLuint ismapped;
 };
 
@@ -85,7 +85,7 @@ struct MiniGLXContextRec {
    Window drawBuffer;       /**< \brief drawing buffer */
    Window curBuffer;        /**< \brief current buffer */
    VisualID vid;            /**< \brief visual ID */
-   __DRIcontext *driContext; /**< \brief context dependent methods */
+   __DRIcontext driContext; /**< \brief context dependent methods */
 };
 
 #define MINIGLX_BUF_SIZE 512
@@ -139,6 +139,8 @@ struct MiniGLXDisplayRec {
    int clientID;
    int nrFds;          /**< \brief number of connections (usually just one for the clients) */
    struct MiniGLXConnection *fd;       /**< \brief connections */
+   int drmFd;           /**< \brief handle to drm device */
+   int authorized;      /**< \brief has server authorized this process? */
 
    struct {
       int nr, head, tail;
@@ -151,16 +153,15 @@ struct MiniGLXDisplayRec {
     * Visuals (configs) in this screen.
     */
    /*@{*/
-   int numModes;               /**< \brief Number of modes. */
-   const __GLcontextModes *modes;      /**< \brief Modes list pointer. */
+   const __GLcontextModes *driver_modes; /**< \brief Modes filtered by driver. */
    /*@}*/
     
    /**
    * \name From __GLXdisplayPrivate
    */
    /*@{*/
-   driCreateScreenFunc *createScreen; /**< \brief \e __driCreateScreen hook */
-   __DRIscreen *driScreen;         /**< \brief Screen dependent methods */
+   PFNCREATENEWSCREENFUNC createNewScreen; /**< \brief \e __driCreateScreen hook */
+   __DRIscreen driScreen;         /**< \brief Screen dependent methods */
    void *dlHandle;                /**<
                                   * \brief handle to the client dynamic
                                   * library 
@@ -184,9 +185,19 @@ struct MiniGLXDisplayRec {
    /*@}*/
 };
 
-extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn);
-
-extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
+/** Character messages. */
+enum msgs {
+   _CanIHaveFocus,
+   _IDontWantFocus,
+   _YouveGotFocus,
+   _YouveLostFocus,
+   _RepaintPlease,
+   _Authorize,
+};
+extern int send_msg( Display *dpy, int i, const void *msg, size_t sz );
+extern int send_char_msg( Display *dpy, int i, char msg );
+extern int blocking_read( Display *dpy, int connection, char *msg, size_t msg_size );
+extern int handle_fd_events( Display *dpy, int nonblock );
 
 extern int __miniglx_open_connections( Display *dpy );
 extern void __miniglx_close_connections( Display *dpy );