diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-06-29 12:32:32 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-06-29 12:32:32 +0000 |
commit | e826e5f176f21cd18b3bbc22887a266835ada57c (patch) | |
tree | d25a84a84f9168b16a77fe4ed8b169c9611bbb02 /source/vid_sdl.c | |
parent | 491f1c100e860c45a5d2aa358d58f777cd1cf895 (diff) |
Added client and server side support for 32-bit solids.
New R1Q2 and Q2PRO minor protocol versions, 1905 and 1014.
Use environment variables for game and server features negotiation.
Relax restrictions on quake paths when searching inside pak files.
Made OSS subsystem cvar names consistent with core sound system conventions.
Misc latched cvar handling changes.
Diffstat (limited to 'source/vid_sdl.c')
-rw-r--r-- | source/vid_sdl.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/source/vid_sdl.c b/source/vid_sdl.c index 68872c3..74d5cb1 100644 --- a/source/vid_sdl.c +++ b/source/vid_sdl.c @@ -91,6 +91,79 @@ static void SetHints( void ) { #endif } +/* +================= +VID_GetClipboardData +================= +*/ +char *VID_GetClipboardData( void ) { +#if USE_SDL && USE_X11 + SDL_SysWMinfo info; + Display *dpy; + Window sowner, win; + Atom type, property; + unsigned long len, bytes_left; + unsigned char *data; + int format, result; + char *ret; + + if( SDL_WasInit( SDL_INIT_VIDEO ) != SDL_INIT_VIDEO ) { + return NULL; + } + SDL_VERSION( &info.version ); + if( !SDL_GetWMInfo( &info ) ) { + return NULL; + } + if( info.subsystem != SDL_SYSWM_X11 ) { + return NULL; + } + + dpy = info.info.x11.display; + win = info.info.x11.window; + + sowner = XGetSelectionOwner( dpy, XA_PRIMARY ); + if( sowner == None ) { + return NULL; + } + + property = XInternAtom( dpy, "GETCLIPBOARDDATA_PROP", False ); + + XConvertSelection( dpy, XA_PRIMARY, XA_STRING, property, win, CurrentTime ); + + XSync( dpy, False ); + + result = XGetWindowProperty( dpy, win, property, 0, 0, False, + AnyPropertyType, &type, &format, &len, &bytes_left, &data ); + + if( result != Success ) { + return NULL; + } + + ret = NULL; + if( bytes_left ) { + result = XGetWindowProperty( dpy, win, property, 0, bytes_left, True, + AnyPropertyType, &type, &format, &len, &bytes_left, &data ); + if( result == Success ) { + ret = Z_CopyString( ( char * )data ); + } + } + + XFree( data ); + + return ret; +#else + return NULL; +#endif +} + +/* +================= +VID_SetClipboardData +================= +*/ +void VID_SetClipboardData( const char *data ) { +} + static qboolean SetMode( int flags, int forcedepth ) { SDL_Surface *surf; vrect_t rc; @@ -143,6 +216,12 @@ void VID_ModeChanged( void ) { } } +void VID_FatalShutdown( void ) { + SDL_ShowCursor( SDL_ENABLE ); + SDL_WM_GrabInput( SDL_GRAB_OFF ); + SDL_Quit(); +} + static qboolean InitVideo( void ) { SDL_Color color; byte *dst; |