summaryrefslogtreecommitdiff
path: root/source/vid_win.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-06-29 12:32:32 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-06-29 12:32:32 +0000
commite826e5f176f21cd18b3bbc22887a266835ada57c (patch)
treed25a84a84f9168b16a77fe4ed8b169c9611bbb02 /source/vid_win.c
parent491f1c100e860c45a5d2aa358d58f777cd1cf895 (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_win.c')
-rw-r--r--source/vid_win.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/source/vid_win.c b/source/vid_win.c
index cbb0573..b5bb881 100644
--- a/source/vid_win.c
+++ b/source/vid_win.c
@@ -746,7 +746,7 @@ void Win_Init( void ) {
// register variables
vid_flip_on_switch = Cvar_Get( "vid_flip_on_switch", "0", 0 );
- vid_hwgamma = Cvar_Get( "vid_hwgamma", "0", CVAR_ARCHIVE|CVAR_LATCHED );
+ vid_hwgamma = Cvar_Get( "vid_hwgamma", "0", CVAR_ARCHIVE|CVAR_REFRESH );
win_noalttab = Cvar_Get( "win_noalttab", "0", CVAR_ARCHIVE );
win_noalttab->changed = win_noalttab_changed;
win_disablewinkey = Cvar_Get( "win_disablewinkey", "0", CVAR_ARCHIVE );
@@ -1003,6 +1003,65 @@ static void Win_GrabMouse( grab_t grab ) {
}
/*
+================
+VID_GetClipboardData
+================
+*/
+char *VID_GetClipboardData( void ) {
+ HANDLE clipdata;
+ char *data = NULL;
+ char *cliptext;
+
+ if( OpenClipboard( NULL ) == FALSE ) {
+ Com_DPrintf( "Couldn't open clipboard.\n" );
+ return data;
+ }
+
+ if( ( clipdata = GetClipboardData( CF_TEXT ) ) != NULL ) {
+ if( ( cliptext = GlobalLock( clipdata ) ) != NULL ) {
+ data = Z_CopyString( cliptext );
+ GlobalUnlock( clipdata );
+ }
+ }
+ CloseClipboard();
+
+ return data;
+}
+
+/*
+================
+VID_SetClipboardData
+================
+*/
+void VID_SetClipboardData( const char *data ) {
+ HANDLE clipdata;
+ char *cliptext;
+ size_t length;
+
+ if( !data[0] ) {
+ return;
+ }
+
+ if( OpenClipboard( NULL ) == FALSE ) {
+ Com_DPrintf( "Couldn't open clipboard.\n" );
+ return;
+ }
+
+ EmptyClipboard();
+
+ length = strlen( data ) + 1;
+ if( ( clipdata = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE, length ) ) != NULL ) {
+ if( ( cliptext = GlobalLock( clipdata ) ) != NULL ) {
+ memcpy( cliptext, data, length );
+ GlobalUnlock( clipdata );
+ SetClipboardData( CF_TEXT, clipdata );
+ }
+ }
+
+ CloseClipboard();
+}
+
+/*
@@@@@@@@@@@@@@@@@@@
VID_FillInputAPI
@@@@@@@@@@@@@@@@@@@