[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src clipboard.cpp clipboard.hpp
From: |
Jon Daniel |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src clipboard.cpp clipboard.hpp |
Date: |
Sat, 12 Mar 2005 00:04:03 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Jon Daniel <address@hidden> 05/03/12 05:04:02
Modified files:
src : clipboard.cpp clipboard.hpp
Log message:
some fixes for the ucs2 clipboard funtions
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/clipboard.cpp.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/clipboard.hpp.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
Patches:
Index: wesnoth/src/clipboard.cpp
diff -u wesnoth/src/clipboard.cpp:1.14 wesnoth/src/clipboard.cpp:1.15
--- wesnoth/src/clipboard.cpp:1.14 Sat Mar 12 04:48:37 2005
+++ wesnoth/src/clipboard.cpp Sat Mar 12 05:04:02 2005
@@ -1,7 +1,7 @@
#include "global.hpp"
#include "clipboard.hpp"
-#include "serialization/string_utils.hpp"
+
#if defined(_X11) && !defined(__APPLE__)
#define CLIPBOARD_FUNCS_DEFINED
@@ -230,7 +230,7 @@
{
if(text.empty())
return;
- clipboard_string = ucs2_string_to_utf8_string(text);
+ clipboard_string = utils::ucs2_string_to_utf8_string(text);
UseX x11;
XSetSelectionOwner(x11->dpy(), XA_PRIMARY, x11->window(), CurrentTime);
XSetSelectionOwner(x11->dpy(), x11->XA_CLIPBOARD(), x11->window(),
CurrentTime);
@@ -310,21 +310,22 @@
//Timed out -- return empty string
return false;
}
+
ucs2_string copy_ucs2_from_clipboard()
{
- if(!clipboard_string.empty()) {
- return utf8_string_to_ucs2_string(clipboard_string);
+ if(!clipboard_string.empty())
+ return utils::utf8_string_to_ucs2_string(clipboard_string);
utf8_string text;
UseX x11;
if(try_grab_target(x11->UTF8_STRING(), text))
- return utf8_string_to_ucs2_string(text);
+ return utils::utf8_string_to_ucs2_string(text);
if(try_grab_target(x11->XA_COMPOUND_TEXT(), text))
- return utf8_string_to_ucs2_string(text);
+ return utils::utf8_string_to_ucs2_string(text);
if(try_grab_target(x11->XA_TEXT(), text))
- return utf8_string_to_ucs2_string(text);
+ return utils::utf8_string_to_ucs2_string(text);
if(try_grab_target(XA_STRING, text))
- return utf8_string_to_ucs2_string(text);
+ return utils::utf8_string_to_ucs2_string(text);
return ucs2_string();
}
Index: wesnoth/src/clipboard.hpp
diff -u wesnoth/src/clipboard.hpp:1.5 wesnoth/src/clipboard.hpp:1.6
--- wesnoth/src/clipboard.hpp:1.5 Sat Mar 12 04:48:37 2005
+++ wesnoth/src/clipboard.hpp Sat Mar 12 05:04:02 2005
@@ -3,6 +3,7 @@
#include <string>
#include "SDL.h"
+#include "serialization/string_utils.hpp"
void copy_ucs2_to_clipboard(const ucs2_string& text);
ucs2_string copy_ucs2_from_clipboard();
void copy_to_clipboard(const std::string& text);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src clipboard.cpp clipboard.hpp,
Jon Daniel <=