diff options
author | McCabe Maxsted | 2009-10-18 17:58:27 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-10-18 17:58:27 -0700 |
commit | e4b0e7c82d670081c071d8a3da31b5ec407b8e07 (patch) | |
tree | 9410962bbb582eedbec448139e217f2714050777 /linden/indra/llwindow/llwindowsdl.cpp | |
parent | Started 1.3.0 branch (diff) | |
parent | Updated and added some Linux libs. (diff) | |
download | meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.zip meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.gz meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.bz2 meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.xz |
Merged working branch of 1.2 into LL 1.23 merge
Diffstat (limited to 'linden/indra/llwindow/llwindowsdl.cpp')
-rw-r--r-- | linden/indra/llwindow/llwindowsdl.cpp | 66 |
1 files changed, 61 insertions, 5 deletions
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index f9c170e..4dd0550 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp | |||
@@ -1230,7 +1230,6 @@ void LLWindowSDL::flashIcon(F32 seconds) | |||
1230 | #endif // LL_X11 | 1230 | #endif // LL_X11 |
1231 | } | 1231 | } |
1232 | 1232 | ||
1233 | |||
1234 | #if LL_GTK | 1233 | #if LL_GTK |
1235 | BOOL LLWindowSDL::isClipboardTextAvailable() | 1234 | BOOL LLWindowSDL::isClipboardTextAvailable() |
1236 | { | 1235 | { |
@@ -1274,22 +1273,80 @@ BOOL LLWindowSDL::copyTextToClipboard(const LLWString &text) | |||
1274 | return FALSE; // failure | 1273 | return FALSE; // failure |
1275 | } | 1274 | } |
1276 | 1275 | ||
1277 | #else | 1276 | BOOL LLWindowSDL::isPrimaryTextAvailable() |
1277 | { | ||
1278 | if (ll_try_gtk_init()) | ||
1279 | { | ||
1280 | GtkClipboard * const clipboard = | ||
1281 | gtk_clipboard_get(GDK_SELECTION_PRIMARY); | ||
1282 | return gtk_clipboard_wait_is_text_available(clipboard) ? | ||
1283 | TRUE : FALSE; | ||
1284 | } | ||
1285 | return FALSE; // failure | ||
1286 | } | ||
1287 | |||
1288 | BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &text) | ||
1289 | { | ||
1290 | if (ll_try_gtk_init()) | ||
1291 | { | ||
1292 | GtkClipboard * const clipboard = | ||
1293 | gtk_clipboard_get(GDK_SELECTION_PRIMARY); | ||
1294 | gchar * const data = gtk_clipboard_wait_for_text(clipboard); | ||
1295 | if (data) | ||
1296 | { | ||
1297 | text = LLWString(utf8str_to_wstring(data)); | ||
1298 | g_free(data); | ||
1299 | return TRUE; | ||
1300 | } | ||
1301 | } | ||
1302 | return FALSE; // failure | ||
1303 | } | ||
1278 | 1304 | ||
1305 | BOOL LLWindowSDL::copyTextToPrimary(const LLWString &text) | ||
1306 | { | ||
1307 | if (ll_try_gtk_init()) | ||
1308 | { | ||
1309 | const std::string utf8 = wstring_to_utf8str(text); | ||
1310 | GtkClipboard * const clipboard = | ||
1311 | gtk_clipboard_get(GDK_SELECTION_PRIMARY); | ||
1312 | gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length()); | ||
1313 | return TRUE; | ||
1314 | } | ||
1315 | return FALSE; // failure | ||
1316 | } | ||
1317 | |||
1318 | #else | ||
1319 | |||
1279 | BOOL LLWindowSDL::isClipboardTextAvailable() | 1320 | BOOL LLWindowSDL::isClipboardTextAvailable() |
1280 | { | 1321 | { |
1281 | return FALSE; // unsupported | 1322 | return FALSE; // unsupported |
1282 | } | 1323 | } |
1283 | 1324 | ||
1284 | BOOL LLWindowSDL::pasteTextFromClipboard(LLWString &dst) | 1325 | BOOL LLWindowSDL::pasteTextFromClipboard(LLWString &dst) |
1285 | { | 1326 | { |
1286 | return FALSE; // unsupported | 1327 | return FALSE; // unsupported |
1287 | } | 1328 | } |
1329 | |||
1288 | 1330 | ||
1289 | BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s) | 1331 | BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s) |
1290 | { | 1332 | { |
1291 | return FALSE; // unsupported | 1333 | return FALSE; // unsupported |
1292 | } | 1334 | } |
1335 | |||
1336 | BOOL LLWindowSDL::isPrimaryTextAvailable() | ||
1337 | { | ||
1338 | return FALSE; // unsupported | ||
1339 | } | ||
1340 | |||
1341 | BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &dst) | ||
1342 | { | ||
1343 | return FALSE; // unsupported | ||
1344 | } | ||
1345 | |||
1346 | BOOL LLWindowSDL::copyTextToPrimary(const LLWString &s) | ||
1347 | { | ||
1348 | return FALSE; // unsupported | ||
1349 | } | ||
1293 | #endif // LL_GTK | 1350 | #endif // LL_GTK |
1294 | 1351 | ||
1295 | LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions) | 1352 | LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions) |
@@ -2092,8 +2149,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ | |||
2092 | buttons = GTK_BUTTONS_YES_NO; | 2149 | buttons = GTK_BUTTONS_YES_NO; |
2093 | break; | 2150 | break; |
2094 | } | 2151 | } |
2095 | win = gtk_message_dialog_new(NULL, flags, messagetype, buttons, "%s", | 2152 | win = gtk_message_dialog_new(NULL,flags, messagetype, buttons, "%s", text.c_str()); |
2096 | text.c_str()); | ||
2097 | 2153 | ||
2098 | # if LL_X11 | 2154 | # if LL_X11 |
2099 | // Make GTK tell the window manager to associate this | 2155 | // Make GTK tell the window manager to associate this |