mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
text pasting support for macosx. updated macosx error dialog procedure.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@745 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
ddfc90fd36
commit
642bb168ba
4 changed files with 29 additions and 9 deletions
|
@ -37,16 +37,36 @@ void PL_VID_Shutdown (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MAX_CLIPBOARDTXT MAXCMDLINE /* 256 */
|
||||||
char *PL_GetClipboardData (void)
|
char *PL_GetClipboardData (void)
|
||||||
{
|
{
|
||||||
/* TODO */
|
char *data = NULL;
|
||||||
return NULL;
|
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
|
||||||
|
NSArray* types = [pasteboard types];
|
||||||
|
|
||||||
|
if ([types containsObject: NSStringPboardType]) {
|
||||||
|
NSString* clipboardString = [pasteboard stringForType: NSStringPboardType];
|
||||||
|
if (clipboardString != NULL && [clipboardString length] > 0) {
|
||||||
|
size_t sz = [clipboardString length] + 1;
|
||||||
|
sz = q_min(MAX_CLIPBOARDTXT, sz);
|
||||||
|
data = (char *) Z_Malloc(sz);
|
||||||
|
#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1040) /* for ppc builds targeting 10.3 and older */
|
||||||
|
q_strlcpy (data, [clipboardString cString], sz);
|
||||||
|
#else
|
||||||
|
q_strlcpy (data, [clipboardString cStringUsingEncoding: NSASCIIStringEncoding], sz);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PL_ErrorDialog(const char *errorMsg)
|
void PL_ErrorDialog(const char *errorMsg)
|
||||||
{
|
{
|
||||||
NSRunCriticalAlertPanel(@"Quake Error",
|
#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1040) /* ppc builds targeting 10.3 and older */
|
||||||
[NSString stringWithUTF8String:errorMsg],
|
NSString* msg = [NSString stringWithCString:errorMsg];
|
||||||
@"OK", nil, nil);
|
#else
|
||||||
|
NSString* msg = [NSString stringWithCString:errorMsg encoding:NSASCIIStringEncoding];
|
||||||
|
#endif
|
||||||
|
NSRunCriticalAlertPanel (@"Quake Error", msg, @"OK", nil, nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ these patched libSDL binaries may help.
|
||||||
<LI> Made Quake shareware 1.00 and 1.01 versions to be recognized properly.</LI>
|
<LI> Made Quake shareware 1.00 and 1.01 versions to be recognized properly.</LI>
|
||||||
<LI> Fixed control-character handling in unicode mode.</LI>
|
<LI> Fixed control-character handling in unicode mode.</LI>
|
||||||
<LI> Made the keypad keys to send separate key events in game mode.</LI>
|
<LI> Made the keypad keys to send separate key events in game mode.</LI>
|
||||||
<LI> Ctrl-V text pasting support from OS clipboard to console (windows-only for now.)</LI>
|
<LI> Text pasting support from OS clipboard to console. (windows and macosx.)</LI>
|
||||||
<LI> Fixed increased (more than 32) dynamic lights.</LI>
|
<LI> Fixed increased (more than 32) dynamic lights.</LI>
|
||||||
<LI> Music playback: Made sure that the file's channels count is supported.</LI>
|
<LI> Music playback: Made sure that the file's channels count is supported.</LI>
|
||||||
<LI> Support for Solaris.</LI>
|
<LI> Support for Solaris.</LI>
|
||||||
|
|
|
@ -102,7 +102,7 @@ these patched libSDL binaries may help.
|
||||||
<item> Made Quake shareware 1.00 and 1.01 versions to be recognized properly.
|
<item> Made Quake shareware 1.00 and 1.01 versions to be recognized properly.
|
||||||
<item> Fixed control-character handling in unicode mode.
|
<item> Fixed control-character handling in unicode mode.
|
||||||
<item> Made the keypad keys to send separate key events in game mode.
|
<item> Made the keypad keys to send separate key events in game mode.
|
||||||
<item> Ctrl-V text pasting support from OS clipboard to console (windows-only for now.)
|
<item> Text pasting support from OS clipboard to console. (windows and macosx.)
|
||||||
<item> Fixed increased (more than 32) dynamic lights.
|
<item> Fixed increased (more than 32) dynamic lights.
|
||||||
<item> Music playback: Made sure that the file's channels count is supported.
|
<item> Music playback: Made sure that the file's channels count is supported.
|
||||||
<item> Support for Solaris.
|
<item> Support for Solaris.
|
||||||
|
|
|
@ -165,8 +165,8 @@
|
||||||
|
|
||||||
o Made the keypad keys to send separate key events in game mode.
|
o Made the keypad keys to send separate key events in game mode.
|
||||||
|
|
||||||
o Ctrl-V text pasting support from OS clipboard to console (windows-
|
o Text pasting support from OS clipboard to console. (windows and
|
||||||
only for now.)
|
macosx.)
|
||||||
|
|
||||||
o Fixed increased (more than 32) dynamic lights.
|
o Fixed increased (more than 32) dynamic lights.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue