src/video/x11/SDL_x11dyn.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 21 Feb 2006 08:46:50 +0000
changeset 1402 d910939febfa
parent 1361 19418e4422cb
child 1438 1f4f09641645
permissions -rw-r--r--
Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2004 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Library General Public
     7     License as published by the Free Software Foundation; either
     8     version 2 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Library General Public License for more details.
    14 
    15     You should have received a copy of the GNU Library General Public
    16     License along with this library; if not, write to the Free
    17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_x11dyn_h
    25 #define _SDL_x11dyn_h
    26 
    27 #include <X11/Xlib.h>
    28 #include <X11/Xutil.h>
    29 #include <X11/Xatom.h>
    30 #include <X11/Xlibint.h>
    31 #include <X11/Xproto.h>
    32 
    33 #include "../Xext/extensions/extutil.h"
    34 
    35 #ifndef NO_SHARED_MEMORY
    36 #include <sys/ipc.h>
    37 #include <sys/shm.h>
    38 #include <X11/extensions/XShm.h>
    39 #endif
    40 
    41 /*
    42  * Never reference Xlib directly...we might load it dynamically at runtime.
    43  *  Even if we don't, for readability, we still use the function pointers
    44  *  (although the symbol resolution will be done by the loader in that case).
    45  *
    46  * We define SDL_X11_SYM and include SDL_x11sym.h to accomplish various
    47  *  goals, without having to duplicate those function signatures.
    48  */
    49 #ifdef __cplusplus
    50 extern "C" {
    51 #endif
    52 
    53 /* evil function signatures... */
    54 typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
    55 typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
    56 typedef Status (*SDL_X11_XESetEventToWireRetType)(Display*,XEvent*,xEvent*);
    57 typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *);
    58 
    59 #define SDL_X11_SYM(req,ret,fn,params) extern ret (*p##fn) params;
    60 #include "SDL_x11sym.h"
    61 #undef SDL_X11_SYM
    62 
    63 /* Macro in the xlib headers, not an actual symbol... */
    64 #define pXDestroyImage XDestroyImage
    65 
    66 /* Workaround code in headers... */
    67 #if !__SDL_NO_REDEFINE_X11_HEADER_SYMS
    68 #define _XFlush p_XFlush
    69 #define _XFlushGCCache p_XFlushGCCache
    70 #define _XReply p_XReply
    71 #define _XSend p_XSend
    72 #define XFree pXFree
    73 #define _XData32 p_XData32
    74 
    75 #if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
    76 #define _SmtBufferOverflow p_SmtBufferOverflow
    77 #define _SmtIpError p_SmtIpError
    78 #define ipAllocateData pipAllocateData
    79 #define ipUnallocateAndSendData pipUnallocateAndSendData
    80 #endif
    81 
    82 #endif /* !__SDL_NO_REDEFINE_X11_HEADER_SYMS */
    83 
    84 int SDL_X11_LoadSymbols(void);
    85 void SDL_X11_UnloadSymbols(void);
    86 
    87 #ifdef __cplusplus
    88 }
    89 #endif
    90 
    91 #endif  /* !defined _SDL_x11dyn_h */
    92