Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
ef598b2e
Commit
ef598b2e
authored
Jul 09, 2010
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Amazingly the Windows code is almost identical to the Mac OS X code. :)
parent
ff0ba0af
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
6 deletions
+48
-6
SDL_VS2005.vcproj
VisualC/SDL/SDL_VS2005.vcproj
+8
-0
SDL_VS2008.vcproj
VisualC/SDL/SDL_VS2008.vcproj
+8
-0
SDL_cocoaclipboard.m
src/video/cocoa/SDL_cocoaclipboard.m
+4
-4
SDL_win32clipboard.c
src/video/win32/SDL_win32clipboard.c
+17
-0
SDL_win32clipboard.h
src/video/win32/SDL_win32clipboard.h
+4
-0
SDL_win32events.c
src/video/win32/SDL_win32events.c
+4
-1
SDL_win32video.c
src/video/win32/SDL_win32video.c
+0
-1
SDL_win32video.h
src/video/win32/SDL_win32video.h
+3
-0
No files found.
VisualC/SDL/SDL_VS2005.vcproj
View file @
ef598b2e
...
@@ -568,6 +568,14 @@
...
@@ -568,6 +568,14 @@
RelativePath=
"..\..\src\video\SDL_clipboard.c"
RelativePath=
"..\..\src\video\SDL_clipboard.c"
>
>
</File>
</File>
<File
RelativePath=
"..\..\src\events\SDL_clipboardevents.c"
>
</File>
<File
RelativePath=
"..\..\src\events\SDL_clipboardevents_c.h"
>
</File>
<File
<File
RelativePath=
"..\..\src\SDL_compat.c"
RelativePath=
"..\..\src\SDL_compat.c"
>
>
...
...
VisualC/SDL/SDL_VS2008.vcproj
View file @
ef598b2e
...
@@ -723,6 +723,14 @@
...
@@ -723,6 +723,14 @@
RelativePath=
"..\..\src\video\SDL_clipboard.c"
RelativePath=
"..\..\src\video\SDL_clipboard.c"
>
>
</File>
</File>
<File
RelativePath=
"..\..\src\events\SDL_clipboardevents.c"
>
</File>
<File
RelativePath=
"..\..\src\events\SDL_clipboardevents_c.h"
>
</File>
<File
<File
RelativePath=
"..\..\src\SDL_compat.c"
RelativePath=
"..\..\src\SDL_compat.c"
>
>
...
...
src/video/cocoa/SDL_cocoaclipboard.m
View file @
ef598b2e
src/video/win32/SDL_win32clipboard.c
View file @
ef598b2e
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "SDL_win32video.h"
#include "SDL_win32video.h"
#include "SDL_win32window.h"
#include "SDL_win32window.h"
#include "../../events/SDL_clipboardevents_c.h"
#ifdef UNICODE
#ifdef UNICODE
...
@@ -52,6 +53,7 @@ GetWindowHandle(_THIS)
...
@@ -52,6 +53,7 @@ GetWindowHandle(_THIS)
int
int
WIN_SetClipboardText
(
_THIS
,
const
char
*
text
)
WIN_SetClipboardText
(
_THIS
,
const
char
*
text
)
{
{
SDL_VideoData
*
data
=
(
SDL_VideoData
*
)
_this
->
driverdata
;
int
result
=
0
;
int
result
=
0
;
if
(
OpenClipboard
(
GetWindowHandle
(
_this
)))
{
if
(
OpenClipboard
(
GetWindowHandle
(
_this
)))
{
...
@@ -93,6 +95,7 @@ WIN_SetClipboardText(_THIS, const char *text)
...
@@ -93,6 +95,7 @@ WIN_SetClipboardText(_THIS, const char *text)
WIN_SetError
(
"Couldn't set clipboard data"
);
WIN_SetError
(
"Couldn't set clipboard data"
);
result
=
-
1
;
result
=
-
1
;
}
}
data
->
clipboard_count
=
GetClipboardSequenceNumber
();
}
}
SDL_free
(
tstr
);
SDL_free
(
tstr
);
...
@@ -141,4 +144,18 @@ WIN_HasClipboardText(_THIS)
...
@@ -141,4 +144,18 @@ WIN_HasClipboardText(_THIS)
}
}
}
}
void
WIN_CheckClipboardUpdate
(
struct
SDL_VideoData
*
data
)
{
DWORD
count
;
count
=
GetClipboardSequenceNumber
();
if
(
count
!=
data
->
clipboard_count
)
{
if
(
data
->
clipboard_count
)
{
SDL_SendClipboardUpdate
();
}
data
->
clipboard_count
=
count
;
}
}
/* vi: set ts=4 sw=4 expandtab: */
/* vi: set ts=4 sw=4 expandtab: */
src/video/win32/SDL_win32clipboard.h
View file @
ef598b2e
...
@@ -24,9 +24,13 @@
...
@@ -24,9 +24,13 @@
#ifndef _SDL_win32clipboard_h
#ifndef _SDL_win32clipboard_h
#define _SDL_win32clipboard_h
#define _SDL_win32clipboard_h
/* Forward declaration */
struct
SDL_VideoData
;
extern
int
WIN_SetClipboardText
(
_THIS
,
const
char
*
text
);
extern
int
WIN_SetClipboardText
(
_THIS
,
const
char
*
text
);
extern
char
*
WIN_GetClipboardText
(
_THIS
);
extern
char
*
WIN_GetClipboardText
(
_THIS
);
extern
SDL_bool
WIN_HasClipboardText
(
_THIS
);
extern
SDL_bool
WIN_HasClipboardText
(
_THIS
);
extern
void
WIN_CheckClipboardUpdate
(
struct
SDL_VideoData
*
data
);
#endif
/* _SDL_win32clipboard_h */
#endif
/* _SDL_win32clipboard_h */
...
...
src/video/win32/SDL_win32events.c
View file @
ef598b2e
...
@@ -162,7 +162,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
...
@@ -162,7 +162,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if
(
SDL_GetKeyboardFocus
()
!=
data
->
window
)
{
if
(
SDL_GetKeyboardFocus
()
!=
data
->
window
)
{
SDL_SetKeyboardFocus
(
data
->
window
);
SDL_SetKeyboardFocus
(
data
->
window
);
}
}
/* FIXME: Update keyboard state */
/*
* FIXME: Update keyboard state
*/
WIN_CheckClipboardUpdate
(
data
->
videodata
);
}
else
{
}
else
{
if
(
SDL_GetKeyboardFocus
()
==
data
->
window
)
{
if
(
SDL_GetKeyboardFocus
()
==
data
->
window
)
{
SDL_SetKeyboardFocus
(
NULL
);
SDL_SetKeyboardFocus
(
NULL
);
...
...
src/video/win32/SDL_win32video.c
View file @
ef598b2e
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
#include "../SDL_pixels_c.h"
#include "../SDL_pixels_c.h"
#include "SDL_win32video.h"
#include "SDL_win32video.h"
#include "SDL_win32clipboard.h"
#include "SDL_d3drender.h"
#include "SDL_d3drender.h"
#include "SDL_gdirender.h"
#include "SDL_gdirender.h"
...
...
src/video/win32/SDL_win32video.h
View file @
ef598b2e
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "ddraw.h"
#include "ddraw.h"
#endif
#endif
#include "SDL_win32clipboard.h"
#include "SDL_win32events.h"
#include "SDL_win32events.h"
#include "SDL_win32gamma.h"
#include "SDL_win32gamma.h"
#include "SDL_win32keyboard.h"
#include "SDL_win32keyboard.h"
...
@@ -75,6 +76,8 @@ typedef struct SDL_VideoData
...
@@ -75,6 +76,8 @@ typedef struct SDL_VideoData
IDirectDraw
*
ddraw
;
IDirectDraw
*
ddraw
;
#endif
#endif
DWORD
clipboard_count
;
const
SDL_scancode
*
key_layout
;
const
SDL_scancode
*
key_layout
;
}
SDL_VideoData
;
}
SDL_VideoData
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment