diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llwindow | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
35 files changed, 509 insertions, 2011 deletions
diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llrender/llgl.cpp index debf2e3..843bc79 100644 --- a/linden/indra/llwindow/llgl.cpp +++ b/linden/indra/llrender/llgl.cpp | |||
@@ -60,6 +60,8 @@ BOOL gClothRipple = FALSE; | |||
60 | BOOL gNoRender = FALSE; | 60 | BOOL gNoRender = FALSE; |
61 | LLMatrix4 gGLObliqueProjectionInverse; | 61 | LLMatrix4 gGLObliqueProjectionInverse; |
62 | 62 | ||
63 | #define LL_GL_NAME_POOLING 0 | ||
64 | |||
63 | LLGLNamePool::pool_list_t LLGLNamePool::sInstances; | 65 | LLGLNamePool::pool_list_t LLGLNamePool::sInstances; |
64 | 66 | ||
65 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS | 67 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS |
@@ -284,6 +286,7 @@ LLGLManager::LLGLManager() : | |||
284 | mIsGF3(FALSE), | 286 | mIsGF3(FALSE), |
285 | mIsGFFX(FALSE), | 287 | mIsGFFX(FALSE), |
286 | mATIOffsetVerticalLines(FALSE), | 288 | mATIOffsetVerticalLines(FALSE), |
289 | mATIOldDriver(FALSE), | ||
287 | 290 | ||
288 | mHasRequirements(TRUE), | 291 | mHasRequirements(TRUE), |
289 | 292 | ||
@@ -350,11 +353,11 @@ bool LLGLManager::initGL() | |||
350 | 353 | ||
351 | // Extract video card strings and convert to upper case to | 354 | // Extract video card strings and convert to upper case to |
352 | // work around driver-to-driver variation in capitalization. | 355 | // work around driver-to-driver variation in capitalization. |
353 | mGLVendor = LLString((const char *)glGetString(GL_VENDOR)); | 356 | mGLVendor = std::string((const char *)glGetString(GL_VENDOR)); |
354 | LLString::toUpper(mGLVendor); | 357 | LLStringUtil::toUpper(mGLVendor); |
355 | 358 | ||
356 | mGLRenderer = LLString((const char *)glGetString(GL_RENDERER)); | 359 | mGLRenderer = std::string((const char *)glGetString(GL_RENDERER)); |
357 | LLString::toUpper(mGLRenderer); | 360 | LLStringUtil::toUpper(mGLRenderer); |
358 | 361 | ||
359 | parse_gl_version( &mDriverVersionMajor, | 362 | parse_gl_version( &mDriverVersionMajor, |
360 | &mDriverVersionMinor, | 363 | &mDriverVersionMinor, |
@@ -369,7 +372,7 @@ bool LLGLManager::initGL() | |||
369 | { | 372 | { |
370 | mGLVendorShort = "ATI"; | 373 | mGLVendorShort = "ATI"; |
371 | BOOL mobile = FALSE; | 374 | BOOL mobile = FALSE; |
372 | if (mGLRenderer.find("MOBILITY") != LLString::npos) | 375 | if (mGLRenderer.find("MOBILITY") != std::string::npos) |
373 | { | 376 | { |
374 | mobile = TRUE; | 377 | mobile = TRUE; |
375 | } | 378 | } |
@@ -381,37 +384,48 @@ bool LLGLManager::initGL() | |||
381 | mATIOffsetVerticalLines = TRUE; | 384 | mATIOffsetVerticalLines = TRUE; |
382 | } | 385 | } |
383 | #endif // LL_WINDOWS | 386 | #endif // LL_WINDOWS |
387 | |||
388 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS | ||
389 | // release 7277 is a point at which we verify that ATI OpenGL | ||
390 | // drivers get pretty stable with SL, ~Catalyst 8.2, | ||
391 | // for both Win32 and Linux. | ||
392 | if (mDriverVersionRelease < 7277 && | ||
393 | mDriverVersionRelease != 0) // 0 == Undetectable driver version - these get to pretend to be new ATI drivers, though that decision may be revisited. | ||
394 | { | ||
395 | mATIOldDriver = TRUE; | ||
396 | } | ||
397 | #endif // (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS | ||
384 | } | 398 | } |
385 | else if (mGLVendor.find("NVIDIA ") != LLString::npos) | 399 | else if (mGLVendor.find("NVIDIA ") != std::string::npos) |
386 | { | 400 | { |
387 | mGLVendorShort = "NVIDIA"; | 401 | mGLVendorShort = "NVIDIA"; |
388 | mIsNVIDIA = TRUE; | 402 | mIsNVIDIA = TRUE; |
389 | if ( mGLRenderer.find("GEFORCE4 MX") != LLString::npos | 403 | if ( mGLRenderer.find("GEFORCE4 MX") != std::string::npos |
390 | || mGLRenderer.find("GEFORCE2") != LLString::npos | 404 | || mGLRenderer.find("GEFORCE2") != std::string::npos |
391 | || mGLRenderer.find("GEFORCE 2") != LLString::npos | 405 | || mGLRenderer.find("GEFORCE 2") != std::string::npos |
392 | || mGLRenderer.find("GEFORCE4 460 GO") != LLString::npos | 406 | || mGLRenderer.find("GEFORCE4 460 GO") != std::string::npos |
393 | || mGLRenderer.find("GEFORCE4 440 GO") != LLString::npos | 407 | || mGLRenderer.find("GEFORCE4 440 GO") != std::string::npos |
394 | || mGLRenderer.find("GEFORCE4 420 GO") != LLString::npos) | 408 | || mGLRenderer.find("GEFORCE4 420 GO") != std::string::npos) |
395 | { | 409 | { |
396 | mIsGF2or4MX = TRUE; | 410 | mIsGF2or4MX = TRUE; |
397 | } | 411 | } |
398 | else if (mGLRenderer.find("GEFORCE FX") != LLString::npos | 412 | else if (mGLRenderer.find("GEFORCE FX") != std::string::npos |
399 | || mGLRenderer.find("QUADRO FX") != LLString::npos | 413 | || mGLRenderer.find("QUADRO FX") != std::string::npos |
400 | || mGLRenderer.find("NV34") != LLString::npos) | 414 | || mGLRenderer.find("NV34") != std::string::npos) |
401 | { | 415 | { |
402 | mIsGFFX = TRUE; | 416 | mIsGFFX = TRUE; |
403 | } | 417 | } |
404 | else if(mGLRenderer.find("GEFORCE3") != LLString::npos) | 418 | else if(mGLRenderer.find("GEFORCE3") != std::string::npos) |
405 | { | 419 | { |
406 | mIsGF3 = TRUE; | 420 | mIsGF3 = TRUE; |
407 | } | 421 | } |
408 | 422 | ||
409 | } | 423 | } |
410 | else if (mGLVendor.find("INTEL") != LLString::npos | 424 | else if (mGLVendor.find("INTEL") != std::string::npos |
411 | #if LL_LINUX | 425 | #if LL_LINUX |
412 | // The Mesa-based drivers put this in the Renderer string, | 426 | // The Mesa-based drivers put this in the Renderer string, |
413 | // not the Vendor string. | 427 | // not the Vendor string. |
414 | || mGLRenderer.find("INTEL") != LLString::npos | 428 | || mGLRenderer.find("INTEL") != std::string::npos |
415 | #endif //LL_LINUX | 429 | #endif //LL_LINUX |
416 | ) | 430 | ) |
417 | { | 431 | { |
@@ -452,12 +466,12 @@ bool LLGLManager::initGL() | |||
452 | 466 | ||
453 | void LLGLManager::getGLInfo(LLSD& info) | 467 | void LLGLManager::getGLInfo(LLSD& info) |
454 | { | 468 | { |
455 | info["GLInfo"]["GLVendor"] = LLString((const char *)glGetString(GL_VENDOR)); | 469 | info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR)); |
456 | info["GLInfo"]["GLRenderer"] = LLString((const char *)glGetString(GL_RENDERER)); | 470 | info["GLInfo"]["GLRenderer"] = std::string((const char *)glGetString(GL_RENDERER)); |
457 | info["GLInfo"]["GLVersion"] = LLString((const char *)glGetString(GL_VERSION)); | 471 | info["GLInfo"]["GLVersion"] = std::string((const char *)glGetString(GL_VERSION)); |
458 | 472 | ||
459 | #if !LL_MESA_HEADLESS | 473 | #if !LL_MESA_HEADLESS |
460 | LLString all_exts = (const char *)gGLHExts.mSysExts; | 474 | std::string all_exts = ll_safe_string((const char *)gGLHExts.mSysExts); |
461 | boost::char_separator<char> sep(" "); | 475 | boost::char_separator<char> sep(" "); |
462 | boost::tokenizer<boost::char_separator<char> > tok(all_exts, sep); | 476 | boost::tokenizer<boost::char_separator<char> > tok(all_exts, sep); |
463 | for(boost::tokenizer<boost::char_separator<char> >::iterator i = tok.begin(); i != tok.end(); ++i) | 477 | for(boost::tokenizer<boost::char_separator<char> >::iterator i = tok.begin(); i != tok.end(); ++i) |
@@ -467,19 +481,19 @@ void LLGLManager::getGLInfo(LLSD& info) | |||
467 | #endif | 481 | #endif |
468 | } | 482 | } |
469 | 483 | ||
470 | LLString LLGLManager::getGLInfoString() | 484 | std::string LLGLManager::getGLInfoString() |
471 | { | 485 | { |
472 | LLString info_str; | 486 | std::string info_str; |
473 | LLString all_exts, line; | 487 | std::string all_exts, line; |
474 | 488 | ||
475 | info_str += LLString("GL_VENDOR ") + LLString((const char *)glGetString(GL_VENDOR)) + LLString("\n"); | 489 | info_str += std::string("GL_VENDOR ") + ll_safe_string((const char *)glGetString(GL_VENDOR)) + std::string("\n"); |
476 | info_str += LLString("GL_RENDERER ") + LLString((const char *)glGetString(GL_RENDERER)) + LLString("\n"); | 490 | info_str += std::string("GL_RENDERER ") + ll_safe_string((const char *)glGetString(GL_RENDERER)) + std::string("\n"); |
477 | info_str += LLString("GL_VERSION ") + LLString((const char *)glGetString(GL_VERSION)) + LLString("\n"); | 491 | info_str += std::string("GL_VERSION ") + ll_safe_string((const char *)glGetString(GL_VERSION)) + std::string("\n"); |
478 | 492 | ||
479 | #if !LL_MESA_HEADLESS | 493 | #if !LL_MESA_HEADLESS |
480 | all_exts = (const char *)gGLHExts.mSysExts; | 494 | all_exts = (const char *)gGLHExts.mSysExts; |
481 | LLString::replaceChar(all_exts, ' ', '\n'); | 495 | LLStringUtil::replaceChar(all_exts, ' ', '\n'); |
482 | info_str += LLString("GL_EXTENSIONS:\n") + all_exts + LLString("\n"); | 496 | info_str += std::string("GL_EXTENSIONS:\n") + all_exts + std::string("\n"); |
483 | #endif | 497 | #endif |
484 | 498 | ||
485 | return info_str; | 499 | return info_str; |
@@ -487,26 +501,24 @@ LLString LLGLManager::getGLInfoString() | |||
487 | 501 | ||
488 | void LLGLManager::printGLInfoString() | 502 | void LLGLManager::printGLInfoString() |
489 | { | 503 | { |
490 | LLString info_str; | 504 | std::string info_str; |
491 | LLString all_exts, line; | 505 | std::string all_exts, line; |
492 | 506 | ||
493 | LL_INFOS("RenderInit") << "GL_VENDOR: " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL; | 507 | LL_INFOS("RenderInit") << "GL_VENDOR: " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL; |
494 | LL_INFOS("RenderInit") << "GL_RENDERER: " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL; | 508 | LL_INFOS("RenderInit") << "GL_RENDERER: " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL; |
495 | LL_INFOS("RenderInit") << "GL_VERSION: " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL; | 509 | LL_INFOS("RenderInit") << "GL_VERSION: " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL; |
496 | 510 | ||
497 | #if !LL_MESA_HEADLESS | 511 | #if !LL_MESA_HEADLESS |
498 | all_exts = (const char *)gGLHExts.mSysExts; | 512 | all_exts = std::string(gGLHExts.mSysExts); |
499 | LLString::replaceChar(all_exts, ' ', '\n'); | 513 | LLStringUtil::replaceChar(all_exts, ' ', '\n'); |
500 | LL_DEBUGS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; | 514 | LL_DEBUGS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; |
501 | #endif | 515 | #endif |
502 | } | 516 | } |
503 | 517 | ||
504 | LLString LLGLManager::getRawGLString() | 518 | std::string LLGLManager::getRawGLString() |
505 | { | 519 | { |
506 | LLString gl_string; | 520 | std::string gl_string; |
507 | gl_string.assign((char*)glGetString(GL_VENDOR)); | 521 | gl_string = ll_safe_string((char*)glGetString(GL_VENDOR)) + " " + ll_safe_string((char*)glGetString(GL_RENDERER)); |
508 | gl_string.append(" "); | ||
509 | gl_string.append((char*)glGetString(GL_RENDERER)); | ||
510 | return gl_string; | 522 | return gl_string; |
511 | } | 523 | } |
512 | 524 | ||
@@ -991,11 +1003,12 @@ void LLGLState::initClass() | |||
991 | sStateMap[GL_DITHER] = GL_TRUE; | 1003 | sStateMap[GL_DITHER] = GL_TRUE; |
992 | sStateMap[GL_TEXTURE_2D] = GL_TRUE; | 1004 | sStateMap[GL_TEXTURE_2D] = GL_TRUE; |
993 | 1005 | ||
994 | //make sure vertex arrays are enabled | 1006 | //make sure multisample defaults to disabled |
995 | glEnableClientState(GL_VERTEX_ARRAY); | 1007 | sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE; |
996 | |||
997 | //make sure multi sampling is disabled by default | ||
998 | glDisable(GL_MULTISAMPLE_ARB); | 1008 | glDisable(GL_MULTISAMPLE_ARB); |
1009 | |||
1010 | //default vertex arrays to enabled. | ||
1011 | glEnableClientState(GL_VERTEX_ARRAY); | ||
999 | } | 1012 | } |
1000 | 1013 | ||
1001 | //static | 1014 | //static |
@@ -1031,7 +1044,7 @@ void LLGLState::dumpStates() | |||
1031 | } | 1044 | } |
1032 | } | 1045 | } |
1033 | 1046 | ||
1034 | void LLGLState::checkStates() | 1047 | void LLGLState::checkStates(const std::string& msg) |
1035 | { | 1048 | { |
1036 | if (!gDebugGL) | 1049 | if (!gDebugGL) |
1037 | { | 1050 | { |
@@ -1055,7 +1068,7 @@ void LLGLState::checkStates() | |||
1055 | 1068 | ||
1056 | if (src != GL_SRC_ALPHA || dst != GL_ONE_MINUS_SRC_ALPHA) | 1069 | if (src != GL_SRC_ALPHA || dst != GL_ONE_MINUS_SRC_ALPHA) |
1057 | { | 1070 | { |
1058 | LL_GL_ERRS << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << LL_ENDL; | 1071 | LL_GL_ERRS << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << " " << msg << LL_ENDL; |
1059 | } | 1072 | } |
1060 | 1073 | ||
1061 | for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); | 1074 | for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); |
@@ -1074,7 +1087,7 @@ void LLGLState::checkStates() | |||
1074 | stop_glerror(); | 1087 | stop_glerror(); |
1075 | } | 1088 | } |
1076 | 1089 | ||
1077 | void LLGLState::checkTextureChannels() | 1090 | void LLGLState::checkTextureChannels(const std::string& msg) |
1078 | { | 1091 | { |
1079 | if (!gDebugGL) | 1092 | if (!gDebugGL) |
1080 | { | 1093 | { |
@@ -1175,11 +1188,11 @@ void LLGLState::checkTextureChannels() | |||
1175 | 1188 | ||
1176 | if (error) | 1189 | if (error) |
1177 | { | 1190 | { |
1178 | LL_GL_ERRS << "GL texture state corruption detected." << LL_ENDL; | 1191 | LL_GL_ERRS << "GL texture state corruption detected. " << msg << LL_ENDL; |
1179 | } | 1192 | } |
1180 | } | 1193 | } |
1181 | 1194 | ||
1182 | void LLGLState::checkClientArrays(U32 data_mask) | 1195 | void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) |
1183 | { | 1196 | { |
1184 | if (!gDebugGL) | 1197 | if (!gDebugGL) |
1185 | { | 1198 | { |
@@ -1291,7 +1304,7 @@ void LLGLState::checkClientArrays(U32 data_mask) | |||
1291 | 1304 | ||
1292 | if (error) | 1305 | if (error) |
1293 | { | 1306 | { |
1294 | LL_GL_ERRS << "GL client array corruption detected." << LL_ENDL; | 1307 | LL_GL_ERRS << "GL client array corruption detected. " << msg << LL_ENDL; |
1295 | } | 1308 | } |
1296 | } | 1309 | } |
1297 | 1310 | ||
@@ -1456,7 +1469,7 @@ void set_palette(U8 *palette_data) | |||
1456 | } | 1469 | } |
1457 | 1470 | ||
1458 | 1471 | ||
1459 | void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_specific ) | 1472 | void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor_specific ) |
1460 | { | 1473 | { |
1461 | // GL_VERSION returns a null-terminated string with the format: | 1474 | // GL_VERSION returns a null-terminated string with the format: |
1462 | // <major>.<minor>[.<release>] [<vendor specific>] | 1475 | // <major>.<minor>[.<release>] [<vendor specific>] |
@@ -1472,7 +1485,7 @@ void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_sp | |||
1472 | return; | 1485 | return; |
1473 | } | 1486 | } |
1474 | 1487 | ||
1475 | LLString ver_copy( version ); | 1488 | std::string ver_copy( version ); |
1476 | S32 len = (S32)strlen( version ); /* Flawfinder: ignore */ | 1489 | S32 len = (S32)strlen( version ); /* Flawfinder: ignore */ |
1477 | S32 i = 0; | 1490 | S32 i = 0; |
1478 | S32 start; | 1491 | S32 start; |
@@ -1485,8 +1498,8 @@ void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_sp | |||
1485 | break; | 1498 | break; |
1486 | } | 1499 | } |
1487 | } | 1500 | } |
1488 | LLString major_str = ver_copy.substr(start,i-start); | 1501 | std::string major_str = ver_copy.substr(start,i-start); |
1489 | LLString::convertToS32(major_str, *major); | 1502 | LLStringUtil::convertToS32(major_str, *major); |
1490 | 1503 | ||
1491 | if( '.' == version[i] ) | 1504 | if( '.' == version[i] ) |
1492 | { | 1505 | { |
@@ -1502,8 +1515,8 @@ void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_sp | |||
1502 | break; | 1515 | break; |
1503 | } | 1516 | } |
1504 | } | 1517 | } |
1505 | LLString minor_str = ver_copy.substr(start,i-start); | 1518 | std::string minor_str = ver_copy.substr(start,i-start); |
1506 | LLString::convertToS32(minor_str, *minor); | 1519 | LLStringUtil::convertToS32(minor_str, *minor); |
1507 | 1520 | ||
1508 | // Find the release number (optional) | 1521 | // Find the release number (optional) |
1509 | if( '.' == version[i] ) | 1522 | if( '.' == version[i] ) |
@@ -1519,8 +1532,8 @@ void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_sp | |||
1519 | } | 1532 | } |
1520 | } | 1533 | } |
1521 | 1534 | ||
1522 | LLString release_str = ver_copy.substr(start,i-start); | 1535 | std::string release_str = ver_copy.substr(start,i-start); |
1523 | LLString::convertToS32(release_str, *release); | 1536 | LLStringUtil::convertToS32(release_str, *release); |
1524 | } | 1537 | } |
1525 | 1538 | ||
1526 | // Skip over any white space | 1539 | // Skip over any white space |
@@ -1616,6 +1629,7 @@ void LLGLNamePool::cleanup() | |||
1616 | 1629 | ||
1617 | GLuint LLGLNamePool::allocate() | 1630 | GLuint LLGLNamePool::allocate() |
1618 | { | 1631 | { |
1632 | #if LL_GL_NAME_POOLING | ||
1619 | for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter) | 1633 | for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter) |
1620 | { | 1634 | { |
1621 | if (!iter->used) | 1635 | if (!iter->used) |
@@ -1631,18 +1645,33 @@ GLuint LLGLNamePool::allocate() | |||
1631 | mNameList.push_back(entry); | 1645 | mNameList.push_back(entry); |
1632 | 1646 | ||
1633 | return entry.name; | 1647 | return entry.name; |
1648 | #else | ||
1649 | return allocateName(); | ||
1650 | #endif | ||
1634 | } | 1651 | } |
1635 | 1652 | ||
1636 | void LLGLNamePool::release(GLuint name) | 1653 | void LLGLNamePool::release(GLuint name) |
1637 | { | 1654 | { |
1655 | #if LL_GL_NAME_POOLING | ||
1638 | for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter) | 1656 | for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter) |
1639 | { | 1657 | { |
1640 | if (iter->name == name) | 1658 | if (iter->name == name) |
1641 | { | 1659 | { |
1642 | iter->used = FALSE; | 1660 | if (iter->used) |
1643 | return; | 1661 | { |
1662 | iter->used = FALSE; | ||
1663 | return; | ||
1664 | } | ||
1665 | else | ||
1666 | { | ||
1667 | llerrs << "Attempted to release a pooled name that is not in use!" << llendl; | ||
1668 | } | ||
1644 | } | 1669 | } |
1645 | } | 1670 | } |
1671 | llerrs << "Attempted to release a non pooled name!" << llendl; | ||
1672 | #else | ||
1673 | releaseName(name); | ||
1674 | #endif | ||
1646 | } | 1675 | } |
1647 | 1676 | ||
1648 | //static | 1677 | //static |
diff --git a/linden/indra/llwindow/llgl.h b/linden/indra/llrender/llgl.h index 2618dca..cb368d7 100644 --- a/linden/indra/llwindow/llgl.h +++ b/linden/indra/llrender/llgl.h | |||
@@ -65,7 +65,7 @@ public: | |||
65 | 65 | ||
66 | void initWGL(); // Initializes stupid WGL extensions | 66 | void initWGL(); // Initializes stupid WGL extensions |
67 | 67 | ||
68 | LLString getRawGLString(); // For sending to simulator | 68 | std::string getRawGLString(); // For sending to simulator |
69 | 69 | ||
70 | BOOL mInited; | 70 | BOOL mInited; |
71 | BOOL mIsDisabled; | 71 | BOOL mIsDisabled; |
@@ -100,6 +100,7 @@ public: | |||
100 | BOOL mIsGF3; | 100 | BOOL mIsGF3; |
101 | BOOL mIsGFFX; | 101 | BOOL mIsGFFX; |
102 | BOOL mATIOffsetVerticalLines; | 102 | BOOL mATIOffsetVerticalLines; |
103 | BOOL mATIOldDriver; | ||
103 | 104 | ||
104 | // Whether this version of GL is good enough for SL to use | 105 | // Whether this version of GL is good enough for SL to use |
105 | BOOL mHasRequirements; | 106 | BOOL mHasRequirements; |
@@ -111,7 +112,7 @@ public: | |||
111 | S32 mDriverVersionMinor; | 112 | S32 mDriverVersionMinor; |
112 | S32 mDriverVersionRelease; | 113 | S32 mDriverVersionRelease; |
113 | F32 mGLVersion; // e.g = 1.4 | 114 | F32 mGLVersion; // e.g = 1.4 |
114 | LLString mDriverVersionVendorString; | 115 | std::string mDriverVersionVendorString; |
115 | 116 | ||
116 | S32 mVRAM; // VRAM in MB | 117 | S32 mVRAM; // VRAM in MB |
117 | S32 mGLMaxVertexRange; | 118 | S32 mGLMaxVertexRange; |
@@ -119,16 +120,16 @@ public: | |||
119 | 120 | ||
120 | void getPixelFormat(); // Get the best pixel format | 121 | void getPixelFormat(); // Get the best pixel format |
121 | 122 | ||
122 | LLString getGLInfoString(); | 123 | std::string getGLInfoString(); |
123 | void printGLInfoString(); | 124 | void printGLInfoString(); |
124 | void getGLInfo(LLSD& info); | 125 | void getGLInfo(LLSD& info); |
125 | 126 | ||
126 | // In ALL CAPS | 127 | // In ALL CAPS |
127 | LLString mGLVendor; | 128 | std::string mGLVendor; |
128 | LLString mGLVendorShort; | 129 | std::string mGLVendorShort; |
129 | 130 | ||
130 | // In ALL CAPS | 131 | // In ALL CAPS |
131 | LLString mGLRenderer; | 132 | std::string mGLRenderer; |
132 | 133 | ||
133 | private: | 134 | private: |
134 | void initExtensions(); | 135 | void initExtensions(); |
@@ -222,9 +223,9 @@ public: | |||
222 | 223 | ||
223 | static void resetTextureStates(); | 224 | static void resetTextureStates(); |
224 | static void dumpStates(); | 225 | static void dumpStates(); |
225 | static void checkStates(); | 226 | static void checkStates(const std::string& msg = ""); |
226 | static void checkTextureChannels(); | 227 | static void checkTextureChannels(const std::string& msg = ""); |
227 | static void checkClientArrays(U32 data_mask = 0x0001); | 228 | static void checkClientArrays(const std::string& msg = "", U32 data_mask = 0x0001); |
228 | 229 | ||
229 | protected: | 230 | protected: |
230 | static std::map<LLGLenum, LLGLboolean> sStateMap; | 231 | static std::map<LLGLenum, LLGLboolean> sStateMap; |
@@ -370,7 +371,7 @@ void set_vertex_weights(const S32 index, const U32 stride, const F32 *weights); | |||
370 | void set_vertex_clothing_weights(const S32 index, const U32 stride, const LLVector4 *weights); | 371 | void set_vertex_clothing_weights(const S32 index, const U32 stride, const LLVector4 *weights); |
371 | void set_binormals(const S32 index, const U32 stride, const LLVector3 *binormals); | 372 | void set_binormals(const S32 index, const U32 stride, const LLVector3 *binormals); |
372 | void set_palette(U8* palette_data); | 373 | void set_palette(U8* palette_data); |
373 | void parse_gl_version( S32* major, S32* minor, S32* release, LLString* vendor_specific ); | 374 | void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor_specific ); |
374 | 375 | ||
375 | extern BOOL gClothRipple; | 376 | extern BOOL gClothRipple; |
376 | extern BOOL gNoRender; | 377 | extern BOOL gNoRender; |
diff --git a/linden/indra/llwindow/llglheaders.h b/linden/indra/llrender/llglheaders.h index d66fbe4..f047262 100644 --- a/linden/indra/llwindow/llglheaders.h +++ b/linden/indra/llrender/llglheaders.h | |||
@@ -32,15 +32,6 @@ | |||
32 | #ifndef LL_LLGLHEADERS_H | 32 | #ifndef LL_LLGLHEADERS_H |
33 | #define LL_LLGLHEADERS_H | 33 | #define LL_LLGLHEADERS_H |
34 | 34 | ||
35 | #if LL_LINUX | ||
36 | # ifndef LL_MESA | ||
37 | # define LL_MESA 1 // force MESA | ||
38 | # endif | ||
39 | # ifndef LL_MESA_HEADLESS | ||
40 | # define LL_MESA_HEADLESS 1 // force MESA HEADLESS | ||
41 | # endif | ||
42 | #endif | ||
43 | |||
44 | #if LL_MESA | 35 | #if LL_MESA |
45 | //---------------------------------------------------------------------------- | 36 | //---------------------------------------------------------------------------- |
46 | // MESA headers | 37 | // MESA headers |
diff --git a/linden/indra/llwindow/llglstates.h b/linden/indra/llrender/llglstates.h index e53640c..e53640c 100644 --- a/linden/indra/llwindow/llglstates.h +++ b/linden/indra/llrender/llglstates.h | |||
diff --git a/linden/indra/llwindow/llgltypes.h b/linden/indra/llrender/llgltypes.h index d22d5fa..d22d5fa 100644 --- a/linden/indra/llwindow/llgltypes.h +++ b/linden/indra/llrender/llgltypes.h | |||
diff --git a/linden/indra/llwindow/CMakeLists.txt b/linden/indra/llwindow/CMakeLists.txt new file mode 100644 index 0000000..95e315f --- /dev/null +++ b/linden/indra/llwindow/CMakeLists.txt | |||
@@ -0,0 +1,147 @@ | |||
1 | # -*- cmake -*- | ||
2 | # | ||
3 | # Compared to other libraries, compiling this one is a mess. The | ||
4 | # reason is that we have several source files that have two different | ||
5 | # sets of behaviour, depending on whether they're intended to be part | ||
6 | # of the viewer or the map server. | ||
7 | # | ||
8 | # Unfortunately, the affected code is a rat's nest of #ifdefs, so it's | ||
9 | # easier to play compilation tricks than to actually fix the problem. | ||
10 | |||
11 | project(llwindow) | ||
12 | |||
13 | include(00-Common) | ||
14 | include(DirectX) | ||
15 | include(LLCommon) | ||
16 | include(LLImage) | ||
17 | include(LLMath) | ||
18 | include(LLRender) | ||
19 | include(LLVFS) | ||
20 | include(LLWindow) | ||
21 | include(LLXML) | ||
22 | include(Mozlib) | ||
23 | include(UI) | ||
24 | |||
25 | include_directories( | ||
26 | ${LLCOMMON_INCLUDE_DIRS} | ||
27 | ${LLIMAGE_INCLUDE_DIRS} | ||
28 | ${LLMATH_INCLUDE_DIRS} | ||
29 | ${LLRENDER_INCLUDE_DIRS} | ||
30 | ${LLVFS_INCLUDE_DIRS} | ||
31 | ${LLWINDOW_INCLUDE_DIRS} | ||
32 | ${LLXML_INCLUDE_DIRS} | ||
33 | ) | ||
34 | |||
35 | set(llwindow_SOURCE_FILES | ||
36 | llkeyboard.cpp | ||
37 | llwindowheadless.cpp | ||
38 | ) | ||
39 | |||
40 | set(llwindows_HEADER_FILES | ||
41 | CMakeLists.txt | ||
42 | |||
43 | llkeyboard.h | ||
44 | llwindowheadless.h | ||
45 | ) | ||
46 | |||
47 | set(viewer_SOURCE_FILES | ||
48 | llwindow.cpp | ||
49 | ) | ||
50 | |||
51 | set(viewer_HEADER_FILES | ||
52 | llwindow.h | ||
53 | llpreeditor.h | ||
54 | llmousehandler.h | ||
55 | ) | ||
56 | |||
57 | if (DARWIN) | ||
58 | list(APPEND llwindow_SOURCE_FILES | ||
59 | llkeyboardmacosx.cpp | ||
60 | llwindowmacosx.cpp | ||
61 | llwindowmacosx-objc.mm | ||
62 | ) | ||
63 | list(APPEND llwindow_HEADER_FILES | ||
64 | llkeyboardmacosx.h | ||
65 | llwindowmacosx.h | ||
66 | llwindowmacosx-objc.h | ||
67 | ) | ||
68 | |||
69 | # We use a bunch of deprecated system APIs. | ||
70 | set_source_files_properties( | ||
71 | llkeyboardmacosx.cpp | ||
72 | llwindowmacosx.cpp | ||
73 | PROPERTIES | ||
74 | COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings" | ||
75 | ) | ||
76 | endif (DARWIN) | ||
77 | |||
78 | if (LINUX) | ||
79 | list(APPEND viewer_SOURCE_FILES | ||
80 | llkeyboardsdl.cpp | ||
81 | llwindowsdl.cpp | ||
82 | ) | ||
83 | list(APPEND viewer_HEADER_FILES | ||
84 | llkeyboardsdl.h | ||
85 | llwindowsdl.h | ||
86 | ) | ||
87 | endif (LINUX) | ||
88 | |||
89 | if (WINDOWS) | ||
90 | list(APPEND llwindow_SOURCE_FILES | ||
91 | llwindowwin32.cpp | ||
92 | lldxhardware.cpp | ||
93 | llkeyboardwin32.cpp | ||
94 | ) | ||
95 | list(APPEND llwindow_HEADER_FILES | ||
96 | llwindowwin32.h | ||
97 | lldxhardware.h | ||
98 | llkeyboardwin32.h | ||
99 | ) | ||
100 | endif (WINDOWS) | ||
101 | |||
102 | if (SOLARIS) | ||
103 | list(APPEND llwindow_SOURCE_FILES | ||
104 | llwindowsolaris.cpp | ||
105 | ) | ||
106 | list(APPEND llwindow_HEADER_FILES | ||
107 | llwindowsolaris.h | ||
108 | ) | ||
109 | endif (SOLARIS) | ||
110 | |||
111 | set_source_files_properties(${llwindow_HEADER_FILES} | ||
112 | PROPERTIES HEADER_FILE_ONLY TRUE) | ||
113 | |||
114 | if (SERVER AND NOT WINDOWS AND NOT DARWIN) | ||
115 | set(server_SOURCE_FILES | ||
116 | llwindowmesaheadless.cpp | ||
117 | ) | ||
118 | set(server_HEADER_FILES | ||
119 | llwindowmesaheadless.h | ||
120 | ) | ||
121 | copy_server_sources( | ||
122 | llwindow | ||
123 | ) | ||
124 | |||
125 | |||
126 | set_source_files_properties( | ||
127 | ${server_SOURCE_FILES} | ||
128 | PROPERTIES | ||
129 | COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1" | ||
130 | ) | ||
131 | add_library (llwindowheadless | ||
132 | ${llwindow_SOURCE_FILES} | ||
133 | ${server_SOURCE_FILES} | ||
134 | ) | ||
135 | endif (SERVER AND NOT WINDOWS AND NOT DARWIN) | ||
136 | |||
137 | if (llwindow_HEADER_FILES) | ||
138 | list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES}) | ||
139 | endif (llwindow_HEADER_FILES) | ||
140 | list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) | ||
141 | |||
142 | if (VIEWER) | ||
143 | add_library (llwindow | ||
144 | ${llwindow_SOURCE_FILES} | ||
145 | ${viewer_SOURCE_FILES} | ||
146 | ) | ||
147 | endif (VIEWER) | ||
diff --git a/linden/libraries/include/GL/glh_extensions.h b/linden/indra/llwindow/GL/glh_extensions.h index b936b5d..b936b5d 100644 --- a/linden/libraries/include/GL/glh_extensions.h +++ b/linden/indra/llwindow/GL/glh_extensions.h | |||
diff --git a/linden/libraries/include/GL/glh_genext.h b/linden/indra/llwindow/GL/glh_genext.h index 8d42025..8d42025 100644 --- a/linden/libraries/include/GL/glh_genext.h +++ b/linden/indra/llwindow/GL/glh_genext.h | |||
diff --git a/linden/indra/llwindow/files.darwin.lst b/linden/indra/llwindow/files.darwin.lst deleted file mode 100644 index e8eca9b..0000000 --- a/linden/indra/llwindow/files.darwin.lst +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | llwindow/llkeyboardmacosx.cpp | ||
2 | llwindow/llwindowmacosx.cpp | ||
diff --git a/linden/indra/llwindow/files.linux.lst b/linden/indra/llwindow/files.linux.lst deleted file mode 100644 index a2dfa07..0000000 --- a/linden/indra/llwindow/files.linux.lst +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | llwindow/llkeyboardsdl.cpp | ||
2 | llwindow/llwindowsdl.cpp | ||
3 | llwindow/llwindowmesaheadless.cpp | ||
diff --git a/linden/indra/llwindow/files.lst b/linden/indra/llwindow/files.lst deleted file mode 100644 index 1c16b09..0000000 --- a/linden/indra/llwindow/files.lst +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | llwindow/lldxhardware.cpp | ||
2 | llwindow/llgl.cpp | ||
3 | llwindow/llkeyboard.cpp | ||
4 | llwindow/llwindow.cpp | ||
5 | llwindow/llwindowheadless.cpp | ||
diff --git a/linden/indra/llwindow/files.sunos5.lst b/linden/indra/llwindow/files.sunos5.lst deleted file mode 100644 index a2dfa07..0000000 --- a/linden/indra/llwindow/files.sunos5.lst +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | llwindow/llkeyboardsdl.cpp | ||
2 | llwindow/llwindowsdl.cpp | ||
3 | llwindow/llwindowmesaheadless.cpp | ||
diff --git a/linden/indra/llwindow/files.win32.lst b/linden/indra/llwindow/files.win32.lst deleted file mode 100644 index 1abcb6e..0000000 --- a/linden/indra/llwindow/files.win32.lst +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | llwindow/llkeyboardwin32.cpp | ||
2 | llwindow/llwindowwin32.cpp | ||
diff --git a/linden/indra/llwindow/lldxhardware.cpp b/linden/indra/llwindow/lldxhardware.cpp index c2d94c3..ec4230c 100644 --- a/linden/indra/llwindow/lldxhardware.cpp +++ b/linden/indra/llwindow/lldxhardware.cpp | |||
@@ -150,7 +150,7 @@ S32 LLVersion::getField(const S32 field_num) | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | LLString LLDXDriverFile::dump() | 153 | std::string LLDXDriverFile::dump() |
154 | { | 154 | { |
155 | if (gWriteDebug) | 155 | if (gWriteDebug) |
156 | { | 156 | { |
@@ -237,7 +237,7 @@ void LLDXHardware::cleanup() | |||
237 | } | 237 | } |
238 | 238 | ||
239 | /* | 239 | /* |
240 | LLString LLDXHardware::dumpDevices() | 240 | std::string LLDXHardware::dumpDevices() |
241 | { | 241 | { |
242 | if (gWriteDebug) | 242 | if (gWriteDebug) |
243 | { | 243 | { |
diff --git a/linden/indra/llwindow/lldxhardware.h b/linden/indra/llwindow/lldxhardware.h index 12d106a..d63120c 100644 --- a/linden/indra/llwindow/lldxhardware.h +++ b/linden/indra/llwindow/lldxhardware.h | |||
@@ -53,7 +53,7 @@ protected: | |||
53 | class LLDXDriverFile | 53 | class LLDXDriverFile |
54 | { | 54 | { |
55 | public: | 55 | public: |
56 | LLString dump(); | 56 | std::string dump(); |
57 | 57 | ||
58 | public: | 58 | public: |
59 | std::string mFilepath; | 59 | std::string mFilepath; |
@@ -103,7 +103,7 @@ public: | |||
103 | // ANY of them to match and return. | 103 | // ANY of them to match and return. |
104 | // LLDXDevice *findDevice(const std::string &vendor, const std::string &devices); | 104 | // LLDXDevice *findDevice(const std::string &vendor, const std::string &devices); |
105 | 105 | ||
106 | // LLString dumpDevices(); | 106 | // std::string dumpDevices(); |
107 | public: | 107 | public: |
108 | typedef std::map<std::string, LLDXDevice *> device_map_t; | 108 | typedef std::map<std::string, LLDXDevice *> device_map_t; |
109 | // device_map_t mDevices; | 109 | // device_map_t mDevices; |
diff --git a/linden/indra/llwindow/llkeyboard.cpp b/linden/indra/llwindow/llkeyboard.cpp index c6502ed..cc6f73b 100644 --- a/linden/indra/llwindow/llkeyboard.cpp +++ b/linden/indra/llwindow/llkeyboard.cpp | |||
@@ -43,8 +43,8 @@ | |||
43 | LLKeyboard *gKeyboard = NULL; | 43 | LLKeyboard *gKeyboard = NULL; |
44 | 44 | ||
45 | //static | 45 | //static |
46 | std::map<KEY,LLString> LLKeyboard::sKeysToNames; | 46 | std::map<KEY,std::string> LLKeyboard::sKeysToNames; |
47 | std::map<LLString,KEY> LLKeyboard::sNamesToKeys; | 47 | std::map<std::string,KEY> LLKeyboard::sNamesToKeys; |
48 | 48 | ||
49 | // | 49 | // |
50 | // Class Implementation | 50 | // Class Implementation |
@@ -67,6 +67,7 @@ LLKeyboard::LLKeyboard() : mCallbacks(NULL), mNumpadDistinct(ND_NUMLOCK_OFF) | |||
67 | 67 | ||
68 | mInsertMode = LL_KIM_INSERT; | 68 | mInsertMode = LL_KIM_INSERT; |
69 | mCurTranslatedKey = KEY_NONE; | 69 | mCurTranslatedKey = KEY_NONE; |
70 | mCurScanKey = KEY_NONE; | ||
70 | 71 | ||
71 | addKeyName(' ', "Space" ); | 72 | addKeyName(' ', "Space" ); |
72 | addKeyName(KEY_RETURN, "Enter" ); | 73 | addKeyName(KEY_RETURN, "Enter" ); |
@@ -143,11 +144,11 @@ LLKeyboard::~LLKeyboard() | |||
143 | // nothing | 144 | // nothing |
144 | } | 145 | } |
145 | 146 | ||
146 | void LLKeyboard::addKeyName(KEY key, const LLString& name) | 147 | void LLKeyboard::addKeyName(KEY key, const std::string& name) |
147 | { | 148 | { |
148 | sKeysToNames[key] = name; | 149 | sKeysToNames[key] = name; |
149 | LLString nameuc = name; | 150 | std::string nameuc = name; |
150 | LLString::toUpper(nameuc); | 151 | LLStringUtil::toUpper(nameuc); |
151 | sNamesToKeys[nameuc] = key; | 152 | sNamesToKeys[nameuc] = key; |
152 | } | 153 | } |
153 | 154 | ||
@@ -293,9 +294,9 @@ S32 LLKeyboard::getKeyElapsedFrameCount(KEY key) | |||
293 | } | 294 | } |
294 | 295 | ||
295 | // static | 296 | // static |
296 | BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) | 297 | BOOL LLKeyboard::keyFromString(const std::string& str, KEY *key) |
297 | { | 298 | { |
298 | LLString instring(str); | 299 | std::string instring(str); |
299 | size_t length = instring.size(); | 300 | size_t length = instring.size(); |
300 | 301 | ||
301 | if (length < 1) | 302 | if (length < 1) |
@@ -317,7 +318,7 @@ BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) | |||
317 | } | 318 | } |
318 | } | 319 | } |
319 | 320 | ||
320 | LLString::toUpper(instring); | 321 | LLStringUtil::toUpper(instring); |
321 | KEY res = get_if_there(sNamesToKeys, instring, (KEY)0); | 322 | KEY res = get_if_there(sNamesToKeys, instring, (KEY)0); |
322 | if (res != 0) | 323 | if (res != 0) |
323 | { | 324 | { |
@@ -330,15 +331,15 @@ BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) | |||
330 | 331 | ||
331 | 332 | ||
332 | // static | 333 | // static |
333 | LLString LLKeyboard::stringFromKey(KEY key) | 334 | std::string LLKeyboard::stringFromKey(KEY key) |
334 | { | 335 | { |
335 | LLString res = get_if_there(sKeysToNames, key, LLString::null); | 336 | std::string res = get_if_there(sKeysToNames, key, std::string()); |
336 | if (res.empty()) | 337 | if (res.empty()) |
337 | { | 338 | { |
338 | char buffer[2]; /* Flawfinder: ignore */ | 339 | char buffer[2]; /* Flawfinder: ignore */ |
339 | buffer[0] = key; | 340 | buffer[0] = key; |
340 | buffer[1] = '\0'; | 341 | buffer[1] = '\0'; |
341 | res = LLString(buffer); | 342 | res = std::string(buffer); |
342 | } | 343 | } |
343 | return res; | 344 | return res; |
344 | } | 345 | } |
@@ -346,9 +347,9 @@ LLString LLKeyboard::stringFromKey(KEY key) | |||
346 | 347 | ||
347 | 348 | ||
348 | //static | 349 | //static |
349 | BOOL LLKeyboard::maskFromString(const LLString& str, MASK *mask) | 350 | BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask) |
350 | { | 351 | { |
351 | LLString instring(str); | 352 | std::string instring(str); |
352 | if (instring == "NONE") | 353 | if (instring == "NONE") |
353 | { | 354 | { |
354 | *mask = MASK_NONE; | 355 | *mask = MASK_NONE; |
diff --git a/linden/indra/llwindow/llkeyboard.h b/linden/indra/llwindow/llkeyboard.h index d9ce376..4d0b86d 100644 --- a/linden/indra/llwindow/llkeyboard.h +++ b/linden/indra/llwindow/llkeyboard.h | |||
@@ -107,9 +107,9 @@ public: | |||
107 | EKeyboardInsertMode getInsertMode() { return mInsertMode; } | 107 | EKeyboardInsertMode getInsertMode() { return mInsertMode; } |
108 | void toggleInsertMode(); | 108 | void toggleInsertMode(); |
109 | 109 | ||
110 | static BOOL maskFromString(const LLString& str, MASK *mask); // False on failure | 110 | static BOOL maskFromString(const std::string& str, MASK *mask); // False on failure |
111 | static BOOL keyFromString(const LLString& str, KEY *key); // False on failure | 111 | static BOOL keyFromString(const std::string& str, KEY *key); // False on failure |
112 | static LLString stringFromKey(KEY key); | 112 | static std::string stringFromKey(KEY key); |
113 | 113 | ||
114 | e_numpad_distinct getNumpadDistinct() { return mNumpadDistinct; } | 114 | e_numpad_distinct getNumpadDistinct() { return mNumpadDistinct; } |
115 | void setNumpadDistinct(e_numpad_distinct val) { mNumpadDistinct = val; } | 115 | void setNumpadDistinct(e_numpad_distinct val) { mNumpadDistinct = val; } |
@@ -119,7 +119,7 @@ public: | |||
119 | S32 getKeyElapsedFrameCount( KEY key ); // Returns time in frames since key was pressed. | 119 | S32 getKeyElapsedFrameCount( KEY key ); // Returns time in frames since key was pressed. |
120 | 120 | ||
121 | protected: | 121 | protected: |
122 | void addKeyName(KEY key, const LLString& name); | 122 | void addKeyName(KEY key, const std::string& name); |
123 | 123 | ||
124 | protected: | 124 | protected: |
125 | std::map<U16, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs | 125 | std::map<U16, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs |
@@ -139,8 +139,8 @@ protected: | |||
139 | 139 | ||
140 | EKeyboardInsertMode mInsertMode; | 140 | EKeyboardInsertMode mInsertMode; |
141 | 141 | ||
142 | static std::map<KEY,LLString> sKeysToNames; | 142 | static std::map<KEY,std::string> sKeysToNames; |
143 | static std::map<LLString,KEY> sNamesToKeys; | 143 | static std::map<std::string,KEY> sNamesToKeys; |
144 | }; | 144 | }; |
145 | 145 | ||
146 | extern LLKeyboard *gKeyboard; | 146 | extern LLKeyboard *gKeyboard; |
diff --git a/linden/indra/llwindow/lllogitechlcd.cpp b/linden/indra/llwindow/lllogitechlcd.cpp deleted file mode 100644 index 81e97a0..0000000 --- a/linden/indra/llwindow/lllogitechlcd.cpp +++ /dev/null | |||
@@ -1,296 +0,0 @@ | |||
1 | /** | ||
2 | * @file lcd.cpp | ||
3 | * @brief cLcd panel class | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #include "linden_common.h" | ||
33 | |||
34 | #if LL_LCD_COMPILE | ||
35 | |||
36 | #include "EZ_LCD.h" | ||
37 | #include "../newview/res/resource.h" | ||
38 | #include "llcontrol.h" | ||
39 | extern LLControlGroup gSavedSettings; | ||
40 | |||
41 | #ifndef LL_LOGITECH_LCD_H | ||
42 | #include "lllogitechlcd.h" | ||
43 | #endif | ||
44 | |||
45 | #define WAIT_DURATION 7 | ||
46 | #define DEBOUNCE_DURATION 0.3f | ||
47 | |||
48 | LLLCDPageGroup::LLLCDPageGroup(CEzLcd *LCD, int type, HICON SLIcon): | ||
49 | mType(type), | ||
50 | mHandle(NULL), | ||
51 | mSLIcon(SLIcon), | ||
52 | mDisplayPage(false), | ||
53 | mLCD(LCD) | ||
54 | { | ||
55 | mPageArray.clear(); | ||
56 | } | ||
57 | |||
58 | LLLCDPageGroup::~LLLCDPageGroup() | ||
59 | { | ||
60 | mPageArray.clear(); | ||
61 | } | ||
62 | |||
63 | void llDefaultPageGroup::UpdateDetails() | ||
64 | { | ||
65 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
66 | } | ||
67 | |||
68 | void llDefaultPageGroup::GetDisplayable() | ||
69 | { | ||
70 | |||
71 | } | ||
72 | |||
73 | llDefaultPageGroup::llDefaultPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
74 | :LLLCDPageGroup(LCD, type, SLIcon) | ||
75 | { | ||
76 | // create a new specific page | ||
77 | LLLCDSpecificPage newPage; | ||
78 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
79 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
80 | |||
81 | // add in all the display parts for this specific page | ||
82 | |||
83 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
84 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
85 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
86 | |||
87 | // add Title | ||
88 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_MEDIUM, DT_CENTER, 128); | ||
89 | mLCD->SetOrigin(title, 32, 20); | ||
90 | mLCD->SetText(title, _T("Second Life Display")); | ||
91 | newPage.mDisplayItemArray.push_back(title); | ||
92 | |||
93 | // and then insert it | ||
94 | mPageArray.push_back(newPage); | ||
95 | } | ||
96 | |||
97 | LLLCD::LLLCD(HINSTANCE instance): | ||
98 | mInited(false), | ||
99 | mDisplayTimer(), | ||
100 | mDebounceTimer(), | ||
101 | mPageToShow(-1), | ||
102 | mInstance(instance), | ||
103 | mDestinationLCD(-1), | ||
104 | mFirstTimeThru(true), | ||
105 | mCurrentGroupBeingShown(NULL), | ||
106 | mSLIcon(NULL) | ||
107 | { | ||
108 | HRESULT res_ = S_OK; | ||
109 | |||
110 | // Create instance of EzLcd. | ||
111 | mLCD = new CEzLcd(); | ||
112 | |||
113 | // Have it initialize itself | ||
114 | res_ = mLCD->InitYourself(_T("Second Life")); | ||
115 | |||
116 | if (res_ != S_OK) | ||
117 | { | ||
118 | // Something went wrong, when connecting to the LCD Manager software. We need to get out now | ||
119 | delete mLCD; | ||
120 | return; | ||
121 | } | ||
122 | mInited = true; | ||
123 | |||
124 | // preload the Second Life Icon | ||
125 | mSLIcon = static_cast<HICON>(LoadImage(mInstance, | ||
126 | MAKEINTRESOURCE(IDI_LCD_LL_ICON), | ||
127 | IMAGE_ICON, | ||
128 | 32, | ||
129 | 32, | ||
130 | LR_MONOCHROME)); | ||
131 | |||
132 | // have to do this first so screens are added to the list and updateDisplay actually does something. | ||
133 | mLCD->Update(); | ||
134 | } | ||
135 | |||
136 | LLLCD::~LLLCD() | ||
137 | { | ||
138 | // remove the instance of the LCD controller | ||
139 | if (mInited == true) | ||
140 | { | ||
141 | delete mLCD; | ||
142 | |||
143 | // free up the used pages | ||
144 | int loopSize = mPageGroupArray.size(); | ||
145 | for(int i= 0; i<loopSize; i++) | ||
146 | { | ||
147 | free (mPageGroupArray[i]); | ||
148 | } | ||
149 | } | ||
150 | } | ||
151 | |||
152 | LLLCDPageGroup *LLLCD::GetNextPageToDisplay() | ||
153 | { | ||
154 | // find group with current page in it. | ||
155 | |||
156 | int groupSize = mPageGroupArray.size(); | ||
157 | for(int x=1; x< groupSize; x++) | ||
158 | { | ||
159 | if (mPageGroupArray[x]->mDisplayPage) | ||
160 | { | ||
161 | // now walk all the pages in the page group we are looking at | ||
162 | int numPages = mPageGroupArray[x]->mPageArray.size(); | ||
163 | for (int zx = 0; zx< numPages; zx++) | ||
164 | { | ||
165 | // found it. | ||
166 | if (mPageToShow == mPageGroupArray[x]->mPageArray[zx].mPageIndex) | ||
167 | { | ||
168 | // move to the next one | ||
169 | if (zx < numPages-1) | ||
170 | { | ||
171 | mPageToShow = mPageGroupArray[x]->mPageArray[zx+1].mPageIndex; | ||
172 | return mPageGroupArray[x]; | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | for(int y=x+1; y< groupSize; y++) | ||
177 | { | ||
178 | if (mPageGroupArray[y]->mDisplayPage) | ||
179 | { | ||
180 | mPageToShow = mPageGroupArray[y]->mPageArray[0].mPageIndex; | ||
181 | return mPageGroupArray[y]; | ||
182 | } | ||
183 | } | ||
184 | } | ||
185 | } | ||
186 | } | ||
187 | } | ||
188 | } | ||
189 | |||
190 | // ok, didn't find it. Start again at the beginning and find the first group that's enabled | ||
191 | for(int x=1; x< groupSize; x++) | ||
192 | { | ||
193 | if (mPageGroupArray[x]->mDisplayPage) | ||
194 | { | ||
195 | mPageToShow = mPageGroupArray[x]->mPageArray[0].mPageIndex; | ||
196 | return mPageGroupArray[x]; | ||
197 | } | ||
198 | } | ||
199 | // if we got this far, we should display the default screen | ||
200 | mPageToShow = mPageGroupArray[0]->mPageArray[0].mPageIndex; | ||
201 | return mPageGroupArray[0]; | ||
202 | } | ||
203 | |||
204 | void LLLCD::SetUpDisplayPages() | ||
205 | { | ||
206 | // work out if destination has changed | ||
207 | int destinationLCD = gSavedSettings.getS32("LCDDestination"); | ||
208 | switch(destinationLCD) | ||
209 | { | ||
210 | case 0: | ||
211 | destinationLCD = LGLCD_DEVICE_FAMILY_KEYBOARD_G15; | ||
212 | break; | ||
213 | case 1: | ||
214 | destinationLCD = LGLCD_DEVICE_FAMILY_SPEAKERS_Z10; | ||
215 | break; | ||
216 | } | ||
217 | // set destination if it's changed | ||
218 | if (mDestinationLCD != destinationLCD) | ||
219 | { | ||
220 | mDestinationLCD = destinationLCD; | ||
221 | mLCD->SetDeviceFamilyToUse(destinationLCD); | ||
222 | } | ||
223 | int loopSize = mPageGroupArray.size(); | ||
224 | for(int i= 0; i<loopSize; i++) | ||
225 | { | ||
226 | mPageGroupArray[i]->GetDisplayable(); | ||
227 | } | ||
228 | } | ||
229 | |||
230 | void LLLCD::UpdateDisplay() | ||
231 | { | ||
232 | if (mInited) | ||
233 | { | ||
234 | // reset pages if anything has changed | ||
235 | SetUpDisplayPages(); | ||
236 | if (mLCD->IsConnected()) | ||
237 | { | ||
238 | // Switching back and forth between the pages that we've created | ||
239 | if (mDisplayTimer.getElapsedTimeF32() > WAIT_DURATION || mFirstTimeThru) | ||
240 | { | ||
241 | mCurrentGroupBeingShown = GetNextPageToDisplay(); | ||
242 | mDisplayTimer.reset(); | ||
243 | mFirstTimeThru = false; | ||
244 | } | ||
245 | |||
246 | // Check if button 1 triggered | ||
247 | if ((mLCD->ButtonIsPressed(LG_BUTTON_1) | ||
248 | || mLCD->ButtonIsPressed(LG_BUTTON_2) | ||
249 | || mLCD->ButtonIsPressed(LG_BUTTON_3) | ||
250 | || mLCD->ButtonIsPressed(LG_BUTTON_4) | ||
251 | ) && mDebounceTimer.getElapsedTimeF32() > DEBOUNCE_DURATION) | ||
252 | { | ||
253 | // if so, move us on a page | ||
254 | mCurrentGroupBeingShown = GetNextPageToDisplay(); | ||
255 | mDisplayTimer.reset(); | ||
256 | mDebounceTimer.reset(); | ||
257 | } | ||
258 | |||
259 | // update that which is being show | ||
260 | mCurrentGroupBeingShown->UpdateDetails(); | ||
261 | |||
262 | // set which page is shown | ||
263 | mLCD->ShowPage(mPageToShow); | ||
264 | |||
265 | // Must run the following every loop. | ||
266 | mLCD->Update(); | ||
267 | } | ||
268 | } | ||
269 | } | ||
270 | |||
271 | |||
272 | // accessor functions | ||
273 | bool LLLCD::Enabled() | ||
274 | { | ||
275 | return mInited; | ||
276 | } | ||
277 | |||
278 | BOOL LLLCD::AreZ10Available() | ||
279 | { | ||
280 | if (mInited == true) | ||
281 | { | ||
282 | return mLCD->AnyDeviceOfThisFamilyPresent(LGLCD_DEVICE_FAMILY_SPEAKERS_Z10); | ||
283 | } | ||
284 | return false; | ||
285 | } | ||
286 | |||
287 | BOOL LLLCD::IsG15Available() | ||
288 | { | ||
289 | if (mInited == true) | ||
290 | { | ||
291 | return mLCD->AnyDeviceOfThisFamilyPresent(LGLCD_DEVICE_FAMILY_KEYBOARD_G15); | ||
292 | } | ||
293 | return false; | ||
294 | } | ||
295 | |||
296 | #endif | ||
diff --git a/linden/indra/llwindow/lllogitechlcd.h b/linden/indra/llwindow/lllogitechlcd.h deleted file mode 100644 index 47a6acd..0000000 --- a/linden/indra/llwindow/lllogitechlcd.h +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | /** | ||
2 | * @file lcd.h | ||
3 | * @brief Description of the LCD owner class. | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_LOGITECH_LCD_H | ||
33 | #define LL_LOGITECH_LCD_H | ||
34 | |||
35 | #include <vector> | ||
36 | #include "llFrametimer.h" | ||
37 | |||
38 | class CEzLcd; | ||
39 | |||
40 | // TO Add a new display page groups, duplicate the Region or Debug or Chat class, then modify what's actually displayed (ie how many pages and whats in them) | ||
41 | // in the constructor and update display functions. | ||
42 | // Remember to add in a new enum type for the new display type, and add in functions to actually create/update or remove this page in the SetupDisplayPages function | ||
43 | // And, of course, add the new option to the Menu in llpanelLCDoption.xml, and save details (duplicate the ones for debug or region). | ||
44 | |||
45 | // this defines one pages worth of display items. | ||
46 | class LLLCDSpecificPage | ||
47 | { | ||
48 | public: | ||
49 | int mPageIndex; | ||
50 | typedef std::vector<HANDLE> displayItemArray_t; | ||
51 | // array of indexes that come from the lcd display sdk for specific items being displayed on a given page | ||
52 | displayItemArray_t mDisplayItemArray; | ||
53 | }; | ||
54 | |||
55 | // this defines a group of pages - associated with a specific type of display, like Debug, Linden Account info, region etc | ||
56 | // NOTE this can have more than one page associated with it - so it has an array of cLCDSpecificPage for each page. | ||
57 | class LLLCDPageGroup | ||
58 | { | ||
59 | public: | ||
60 | LLLCDPageGroup(CEzLcd *LCD, int type, HICON SLIcon); | ||
61 | virtual ~LLLCDPageGroup(); | ||
62 | virtual void UpdateDetails() = 0; | ||
63 | virtual void GetDisplayable() = 0; | ||
64 | int mType; | ||
65 | HANDLE mHandle; | ||
66 | typedef std::vector<LLLCDSpecificPage> pageArray_t; | ||
67 | pageArray_t mPageArray; | ||
68 | BOOL mDisplayPage; | ||
69 | protected: | ||
70 | |||
71 | CEzLcd *mLCD; | ||
72 | HICON mSLIcon; | ||
73 | }; | ||
74 | |||
75 | |||
76 | // class that defines the Default page - used if nothing else is enabled | ||
77 | class llDefaultPageGroup : public LLLCDPageGroup | ||
78 | { | ||
79 | public: | ||
80 | llDefaultPageGroup(CEzLcd *LCD, int type, HICON SLIcon); | ||
81 | virtual void UpdateDetails(); | ||
82 | virtual void GetDisplayable(); | ||
83 | }; | ||
84 | |||
85 | // Root class - contains pointers to actual LCD display object, and arrays of page groups to be displayed | ||
86 | class LLLCD | ||
87 | { | ||
88 | public: | ||
89 | enum | ||
90 | { | ||
91 | kLCDDefault, | ||
92 | kLCDDebug, | ||
93 | kLCDChat, | ||
94 | kLCDRegion, | ||
95 | kLCDLinden, | ||
96 | kLCDIM, | ||
97 | kLCDDebugConsole, | ||
98 | kMaxLCDPageGroups | ||
99 | }; | ||
100 | LLLCD(HINSTANCE instance); | ||
101 | ~LLLCD(); | ||
102 | void UpdateDisplay(); | ||
103 | bool Enabled(); | ||
104 | BOOL AreZ10Available(); | ||
105 | BOOL IsG15Available(); | ||
106 | |||
107 | typedef std::vector<LLLCDPageGroup *> pageGroupArray_t; | ||
108 | pageGroupArray_t mPageGroupArray; | ||
109 | HICON mSLIcon; | ||
110 | CEzLcd *mLCD; | ||
111 | private: | ||
112 | |||
113 | // member functions to display data | ||
114 | void SetUpDisplayPages(); | ||
115 | LLLCDPageGroup *GetNextPageToDisplay(); | ||
116 | |||
117 | LLLCDPageGroup *mCurrentGroupBeingShown; | ||
118 | |||
119 | // members | ||
120 | bool mInited; | ||
121 | |||
122 | int mPageToShow; | ||
123 | LLFrameTimer mDisplayTimer; | ||
124 | LLFrameTimer mDebounceTimer; | ||
125 | HINSTANCE mInstance; // necessary for loading some icons for the dot matrix LCD display to use | ||
126 | bool mFirstTimeThru; | ||
127 | |||
128 | |||
129 | // actual display set up variables | ||
130 | int mDestinationLCD; | ||
131 | }; | ||
132 | |||
133 | |||
134 | |||
135 | #endif | ||
diff --git a/linden/indra/llwindow/llmousehandler.h b/linden/indra/llwindow/llmousehandler.h index b511dcd..119197f 100644 --- a/linden/indra/llwindow/llmousehandler.h +++ b/linden/indra/llwindow/llmousehandler.h | |||
@@ -43,7 +43,11 @@ class LLMouseHandler | |||
43 | public: | 43 | public: |
44 | LLMouseHandler() {} | 44 | LLMouseHandler() {} |
45 | virtual ~LLMouseHandler() {} | 45 | virtual ~LLMouseHandler() {} |
46 | 46 | typedef enum { | |
47 | SHOW_NEVER, | ||
48 | SHOW_IF_NOT_BLOCKED, | ||
49 | SHOW_ALWAYS, | ||
50 | } EShowToolTip; | ||
47 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0; | 51 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0; |
48 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) = 0; | 52 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) = 0; |
49 | virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0; | 53 | virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0; |
@@ -51,8 +55,9 @@ public: | |||
51 | virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0; | 55 | virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0; |
52 | virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) = 0; | 56 | virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) = 0; |
53 | virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) = 0; | 57 | virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) = 0; |
54 | virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) = 0; | 58 | virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) = 0; |
55 | virtual const LLString& getName() const = 0; | 59 | virtual EShowToolTip getShowToolTip() { return SHOW_IF_NOT_BLOCKED; }; |
60 | virtual const std::string& getName() const = 0; | ||
56 | 61 | ||
57 | virtual void onMouseCaptureLost() = 0; | 62 | virtual void onMouseCaptureLost() = 0; |
58 | 63 | ||
diff --git a/linden/indra/llwindow/llwindow.cpp b/linden/indra/llwindow/llwindow.cpp index ffb6393..890143d 100644 --- a/linden/indra/llwindow/llwindow.cpp +++ b/linden/indra/llwindow/llwindow.cpp | |||
@@ -58,13 +58,13 @@ BOOL gDebugClicks = FALSE; | |||
58 | BOOL gDebugWindowProc = FALSE; | 58 | BOOL gDebugWindowProc = FALSE; |
59 | 59 | ||
60 | const S32 gURLProtocolWhitelistCount = 3; | 60 | const S32 gURLProtocolWhitelistCount = 3; |
61 | const char* gURLProtocolWhitelist[] = { "file", "http", "https" }; | 61 | const std::string gURLProtocolWhitelist[] = { "file:", "http:", "https:" }; |
62 | 62 | ||
63 | // CP: added a handler list - this is what's used to open the protocol and is based on registry entry | 63 | // CP: added a handler list - this is what's used to open the protocol and is based on registry entry |
64 | // only meaningful difference currently is that file: protocols are opened using http: | 64 | // only meaningful difference currently is that file: protocols are opened using http: |
65 | // since no protocol handler exists in registry for file: | 65 | // since no protocol handler exists in registry for file: |
66 | // Important - these lists should match - protocol to handler | 66 | // Important - these lists should match - protocol to handler |
67 | const char* gURLProtocolWhitelistHandler[] = { "http", "http", "https" }; | 67 | const std::string gURLProtocolWhitelistHandler[] = { "http", "http", "https" }; |
68 | 68 | ||
69 | BOOL LLWindowCallbacks::handleTranslatedKeyDown(const KEY key, const MASK mask, BOOL repeated) | 69 | BOOL LLWindowCallbacks::handleTranslatedKeyDown(const KEY key, const MASK mask, BOOL repeated) |
70 | { | 70 | { |
@@ -203,7 +203,7 @@ BOOL LLWindowCallbacks::handleDeviceChange(LLWindow *window) | |||
203 | return FALSE; | 203 | return FALSE; |
204 | } | 204 | } |
205 | 205 | ||
206 | S32 OSMessageBox(const char* text, const char* caption, U32 type) | 206 | S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) |
207 | { | 207 | { |
208 | // Properly hide the splash screen when displaying the message box | 208 | // Properly hide the splash screen when displaying the message box |
209 | BOOL was_visible = FALSE; | 209 | BOOL was_visible = FALSE; |
@@ -285,6 +285,12 @@ void LLWindow::setCallbacks(LLWindowCallbacks *callbacks) | |||
285 | } | 285 | } |
286 | } | 286 | } |
287 | 287 | ||
288 | void *LLWindow::getMediaWindow() | ||
289 | { | ||
290 | // Default to returning the platform window. | ||
291 | return getPlatformWindow(); | ||
292 | } | ||
293 | |||
288 | // static | 294 | // static |
289 | std::string LLWindow::getFontListSans() | 295 | std::string LLWindow::getFontListSans() |
290 | { | 296 | { |
@@ -389,7 +395,7 @@ void LLSplashScreen::show() | |||
389 | } | 395 | } |
390 | 396 | ||
391 | //static | 397 | //static |
392 | void LLSplashScreen::update(const char* str) | 398 | void LLSplashScreen::update(const std::string& str) |
393 | { | 399 | { |
394 | LLSplashScreen::show(); | 400 | LLSplashScreen::show(); |
395 | if (gSplashScreenp) | 401 | if (gSplashScreenp) |
@@ -417,8 +423,8 @@ void LLSplashScreen::hide() | |||
417 | static std::set<LLWindow*> sWindowList; | 423 | static std::set<LLWindow*> sWindowList; |
418 | 424 | ||
419 | LLWindow* LLWindowManager::createWindow( | 425 | LLWindow* LLWindowManager::createWindow( |
420 | char *title, | 426 | const std::string& title, |
421 | char *name, | 427 | const std::string& name, |
422 | LLCoordScreen upper_left, | 428 | LLCoordScreen upper_left, |
423 | LLCoordScreen size, | 429 | LLCoordScreen size, |
424 | U32 flags, | 430 | U32 flags, |
@@ -434,7 +440,7 @@ LLWindow* LLWindowManager::createWindow( | |||
434 | } | 440 | } |
435 | 441 | ||
436 | LLWindow* LLWindowManager::createWindow( | 442 | LLWindow* LLWindowManager::createWindow( |
437 | char *title, char *name, S32 x, S32 y, S32 width, S32 height, U32 flags, | 443 | const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, |
438 | BOOL fullscreen, | 444 | BOOL fullscreen, |
439 | BOOL clearBg, | 445 | BOOL clearBg, |
440 | BOOL disable_vsync, | 446 | BOOL disable_vsync, |
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h index a63c8d5..82e95a8 100644 --- a/linden/indra/llwindow/llwindow.h +++ b/linden/indra/llwindow/llwindow.h | |||
@@ -32,8 +32,6 @@ | |||
32 | #ifndef LL_LLWINDOW_H | 32 | #ifndef LL_LLWINDOW_H |
33 | #define LL_LLWINDOW_H | 33 | #define LL_LLWINDOW_H |
34 | 34 | ||
35 | #include <sys/stat.h> | ||
36 | |||
37 | #include "llrect.h" | 35 | #include "llrect.h" |
38 | #include "llcoord.h" | 36 | #include "llcoord.h" |
39 | #include "llstring.h" | 37 | #include "llstring.h" |
@@ -197,10 +195,6 @@ public: | |||
197 | virtual void bringToFront() = 0; | 195 | virtual void bringToFront() = 0; |
198 | virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract | 196 | virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract |
199 | 197 | ||
200 | virtual S32 stat( const char* file_name, struct stat* stat_info ) = 0; | ||
201 | virtual BOOL sendEmail(const char* address,const char* subject,const char* body_text, const char* attachment=NULL, const char* attachment_displayed_name=NULL ) = 0; | ||
202 | |||
203 | |||
204 | // handy coordinate space conversion routines | 198 | // handy coordinate space conversion routines |
205 | // NB: screen to window and vice verse won't work on width/height coordinate pairs, | 199 | // NB: screen to window and vice verse won't work on width/height coordinate pairs, |
206 | // as the conversion must take into account left AND right border widths, etc. | 200 | // as the conversion must take into account left AND right border widths, etc. |
@@ -225,14 +219,18 @@ public: | |||
225 | // opens system default color picker | 219 | // opens system default color picker |
226 | virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b) { return FALSE; }; | 220 | virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b) { return FALSE; }; |
227 | 221 | ||
228 | // return a platform-specific window reference (HWND on Windows, WindowRef on the Mac) | 222 | // return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) |
229 | virtual void *getPlatformWindow() = 0; | 223 | virtual void *getPlatformWindow() = 0; |
224 | |||
225 | // return the platform-specific window reference we use to initialize llmozlib (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) | ||
226 | virtual void *getMediaWindow(); | ||
230 | 227 | ||
231 | // control platform's Language Text Input mechanisms. | 228 | // control platform's Language Text Input mechanisms. |
232 | virtual void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) {} | 229 | virtual void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) {} |
233 | virtual void setLanguageTextInput( const LLCoordGL & pos ) {}; | 230 | virtual void setLanguageTextInput( const LLCoordGL & pos ) {}; |
234 | virtual void updateLanguageTextInputArea() {} | 231 | virtual void updateLanguageTextInputArea() {} |
235 | virtual void interruptLanguageTextInput() {} | 232 | virtual void interruptLanguageTextInput() {} |
233 | virtual void spawnWebBrowser(const std::string& escaped_url) {}; | ||
236 | 234 | ||
237 | static std::string getFontListSans(); | 235 | static std::string getFontListSans(); |
238 | 236 | ||
@@ -293,13 +291,13 @@ public: | |||
293 | static LLSplashScreen * create(); | 291 | static LLSplashScreen * create(); |
294 | static void show(); | 292 | static void show(); |
295 | static void hide(); | 293 | static void hide(); |
296 | static void update(const char* string); | 294 | static void update(const std::string& string); |
297 | 295 | ||
298 | static bool isVisible(); | 296 | static bool isVisible(); |
299 | protected: | 297 | protected: |
300 | // These are overridden by the platform implementation | 298 | // These are overridden by the platform implementation |
301 | virtual void showImpl() = 0; | 299 | virtual void showImpl() = 0; |
302 | virtual void updateImpl(const char* string) = 0; | 300 | virtual void updateImpl(const std::string& string) = 0; |
303 | virtual void hideImpl() = 0; | 301 | virtual void hideImpl() = 0; |
304 | 302 | ||
305 | static BOOL sVisible; | 303 | static BOOL sVisible; |
@@ -307,7 +305,7 @@ protected: | |||
307 | }; | 305 | }; |
308 | 306 | ||
309 | // Platform-neutral for accessing the platform specific message box | 307 | // Platform-neutral for accessing the platform specific message box |
310 | S32 OSMessageBox(const char* text, const char* caption, U32 type); | 308 | S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type); |
311 | const U32 OSMB_OK = 0; | 309 | const U32 OSMB_OK = 0; |
312 | const U32 OSMB_OKCANCEL = 1; | 310 | const U32 OSMB_OKCANCEL = 1; |
313 | const U32 OSMB_YESNO = 2; | 311 | const U32 OSMB_YESNO = 2; |
@@ -325,8 +323,8 @@ class LLWindowManager | |||
325 | { | 323 | { |
326 | public: | 324 | public: |
327 | static LLWindow* createWindow( | 325 | static LLWindow* createWindow( |
328 | char *title, | 326 | const std::string& title, |
329 | char *name, | 327 | const std::string& name, |
330 | LLCoordScreen upper_left = LLCoordScreen(10, 10), | 328 | LLCoordScreen upper_left = LLCoordScreen(10, 10), |
331 | LLCoordScreen size = LLCoordScreen(320, 240), | 329 | LLCoordScreen size = LLCoordScreen(320, 240), |
332 | U32 flags = 0, | 330 | U32 flags = 0, |
@@ -336,7 +334,7 @@ public: | |||
336 | BOOL use_gl = TRUE, | 334 | BOOL use_gl = TRUE, |
337 | BOOL ignore_pixel_depth = FALSE); | 335 | BOOL ignore_pixel_depth = FALSE); |
338 | static LLWindow *createWindow( | 336 | static LLWindow *createWindow( |
339 | char* title, char* name, S32 x, S32 y, S32 width, S32 height, | 337 | const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, |
340 | U32 flags = 0, | 338 | U32 flags = 0, |
341 | BOOL fullscreen = FALSE, | 339 | BOOL fullscreen = FALSE, |
342 | BOOL clearBg = FALSE, | 340 | BOOL clearBg = FALSE, |
@@ -355,11 +353,8 @@ extern BOOL gDebugWindowProc; | |||
355 | 353 | ||
356 | // Protocols, like "http" and "https" we support in URLs | 354 | // Protocols, like "http" and "https" we support in URLs |
357 | extern const S32 gURLProtocolWhitelistCount; | 355 | extern const S32 gURLProtocolWhitelistCount; |
358 | extern const char* gURLProtocolWhitelist[]; | 356 | extern const std::string gURLProtocolWhitelist[]; |
359 | extern const char* gURLProtocolWhitelistHandler[]; | 357 | extern const std::string gURLProtocolWhitelistHandler[]; |
360 | |||
361 | // Loads a URL with the user's default browser | ||
362 | void spawn_web_browser(const char* escaped_url); | ||
363 | 358 | ||
364 | void simpleEscapeString ( std::string& stringIn ); | 359 | void simpleEscapeString ( std::string& stringIn ); |
365 | 360 | ||
diff --git a/linden/indra/llwindow/llwindow.vcproj b/linden/indra/llwindow/llwindow.vcproj deleted file mode 100644 index 0243c72..0000000 --- a/linden/indra/llwindow/llwindow.vcproj +++ /dev/null | |||
@@ -1,281 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="7.10" | ||
5 | Name="llwindow" | ||
6 | ProjectGUID="{B5B53617-416F-404A-BF10-22EBCCA0E4FB}" | ||
7 | Keyword="Win32Proj"> | ||
8 | <Platforms> | ||
9 | <Platform | ||
10 | Name="Win32"/> | ||
11 | </Platforms> | ||
12 | <Configurations> | ||
13 | <Configuration | ||
14 | Name="Debug|Win32" | ||
15 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
16 | IntermediateDirectory="Debug" | ||
17 | ConfigurationType="4" | ||
18 | CharacterSet="1"> | ||
19 | <Tool | ||
20 | Name="VCCLCompilerTool" | ||
21 | Optimization="0" | ||
22 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;..\..\libraries\i686-win32\include;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
23 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG" | ||
24 | MinimalRebuild="TRUE" | ||
25 | BasicRuntimeChecks="3" | ||
26 | RuntimeLibrary="1" | ||
27 | StructMemberAlignment="4" | ||
28 | ForceConformanceInForLoopScope="TRUE" | ||
29 | UsePrecompiledHeader="0" | ||
30 | WarningLevel="3" | ||
31 | WarnAsError="TRUE" | ||
32 | Detect64BitPortabilityProblems="FALSE" | ||
33 | DebugInformationFormat="4"/> | ||
34 | <Tool | ||
35 | Name="VCCustomBuildTool"/> | ||
36 | <Tool | ||
37 | Name="VCLibrarianTool" | ||
38 | OutputFile="$(OutDir)/llwindow.lib"/> | ||
39 | <Tool | ||
40 | Name="VCMIDLTool"/> | ||
41 | <Tool | ||
42 | Name="VCPostBuildEventTool"/> | ||
43 | <Tool | ||
44 | Name="VCPreBuildEventTool"/> | ||
45 | <Tool | ||
46 | Name="VCPreLinkEventTool"/> | ||
47 | <Tool | ||
48 | Name="VCResourceCompilerTool"/> | ||
49 | <Tool | ||
50 | Name="VCWebServiceProxyGeneratorTool"/> | ||
51 | <Tool | ||
52 | Name="VCXMLDataGeneratorTool"/> | ||
53 | <Tool | ||
54 | Name="VCManagedWrapperGeneratorTool"/> | ||
55 | <Tool | ||
56 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
57 | </Configuration> | ||
58 | <Configuration | ||
59 | Name="Release|Win32" | ||
60 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
61 | IntermediateDirectory="Release" | ||
62 | ConfigurationType="4" | ||
63 | CharacterSet="1"> | ||
64 | <Tool | ||
65 | Name="VCCLCompilerTool" | ||
66 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;..\..\libraries\i686-win32\include;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
67 | AdditionalOptions="/Oy-" | ||
68 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" | ||
69 | RuntimeLibrary="0" | ||
70 | StructMemberAlignment="0" | ||
71 | ForceConformanceInForLoopScope="TRUE" | ||
72 | UsePrecompiledHeader="0" | ||
73 | WarningLevel="3" | ||
74 | WarnAsError="TRUE" | ||
75 | Detect64BitPortabilityProblems="FALSE" | ||
76 | DebugInformationFormat="3"/> | ||
77 | <Tool | ||
78 | Name="VCCustomBuildTool"/> | ||
79 | <Tool | ||
80 | Name="VCLibrarianTool" | ||
81 | OutputFile="$(OutDir)/llwindow.lib"/> | ||
82 | <Tool | ||
83 | Name="VCMIDLTool"/> | ||
84 | <Tool | ||
85 | Name="VCPostBuildEventTool"/> | ||
86 | <Tool | ||
87 | Name="VCPreBuildEventTool"/> | ||
88 | <Tool | ||
89 | Name="VCPreLinkEventTool"/> | ||
90 | <Tool | ||
91 | Name="VCResourceCompilerTool"/> | ||
92 | <Tool | ||
93 | Name="VCWebServiceProxyGeneratorTool"/> | ||
94 | <Tool | ||
95 | Name="VCXMLDataGeneratorTool"/> | ||
96 | <Tool | ||
97 | Name="VCManagedWrapperGeneratorTool"/> | ||
98 | <Tool | ||
99 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
100 | </Configuration> | ||
101 | <Configuration | ||
102 | Name="DebugMesaHeadless|Win32" | ||
103 | OutputDirectory="../lib_debug/i686-win32" | ||
104 | IntermediateDirectory="$(ConfigurationName)" | ||
105 | ConfigurationType="4" | ||
106 | CharacterSet="1"> | ||
107 | <Tool | ||
108 | Name="VCCLCompilerTool" | ||
109 | Optimization="0" | ||
110 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;..\..\libraries\i686-win32\include;..\..\libraries\include\GLMESA;..\..\libraries\i686-win32\include;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
111 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" | ||
112 | MinimalRebuild="TRUE" | ||
113 | BasicRuntimeChecks="3" | ||
114 | RuntimeLibrary="1" | ||
115 | StructMemberAlignment="4" | ||
116 | ForceConformanceInForLoopScope="TRUE" | ||
117 | UsePrecompiledHeader="0" | ||
118 | WarningLevel="3" | ||
119 | WarnAsError="TRUE" | ||
120 | Detect64BitPortabilityProblems="FALSE" | ||
121 | DebugInformationFormat="4"/> | ||
122 | <Tool | ||
123 | Name="VCCustomBuildTool"/> | ||
124 | <Tool | ||
125 | Name="VCLibrarianTool" | ||
126 | OutputFile="$(OutDir)/llwindow_mesaheadless.lib"/> | ||
127 | <Tool | ||
128 | Name="VCMIDLTool"/> | ||
129 | <Tool | ||
130 | Name="VCPostBuildEventTool"/> | ||
131 | <Tool | ||
132 | Name="VCPreBuildEventTool"/> | ||
133 | <Tool | ||
134 | Name="VCPreLinkEventTool"/> | ||
135 | <Tool | ||
136 | Name="VCResourceCompilerTool"/> | ||
137 | <Tool | ||
138 | Name="VCWebServiceProxyGeneratorTool"/> | ||
139 | <Tool | ||
140 | Name="VCXMLDataGeneratorTool"/> | ||
141 | <Tool | ||
142 | Name="VCManagedWrapperGeneratorTool"/> | ||
143 | <Tool | ||
144 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
145 | </Configuration> | ||
146 | <Configuration | ||
147 | Name="ReleaseNoOpt|Win32" | ||
148 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
149 | IntermediateDirectory="$(ConfigurationName)" | ||
150 | ConfigurationType="4" | ||
151 | CharacterSet="1"> | ||
152 | <Tool | ||
153 | Name="VCCLCompilerTool" | ||
154 | AdditionalOptions="/Oy-" | ||
155 | Optimization="0" | ||
156 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
157 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" | ||
158 | RuntimeLibrary="0" | ||
159 | StructMemberAlignment="0" | ||
160 | ForceConformanceInForLoopScope="TRUE" | ||
161 | UsePrecompiledHeader="0" | ||
162 | WarningLevel="3" | ||
163 | WarnAsError="TRUE" | ||
164 | Detect64BitPortabilityProblems="FALSE" | ||
165 | DebugInformationFormat="3"/> | ||
166 | <Tool | ||
167 | Name="VCCustomBuildTool"/> | ||
168 | <Tool | ||
169 | Name="VCLibrarianTool" | ||
170 | OutputFile="$(OutDir)/llwindow.lib"/> | ||
171 | <Tool | ||
172 | Name="VCMIDLTool"/> | ||
173 | <Tool | ||
174 | Name="VCPostBuildEventTool"/> | ||
175 | <Tool | ||
176 | Name="VCPreBuildEventTool"/> | ||
177 | <Tool | ||
178 | Name="VCPreLinkEventTool"/> | ||
179 | <Tool | ||
180 | Name="VCResourceCompilerTool"/> | ||
181 | <Tool | ||
182 | Name="VCWebServiceProxyGeneratorTool"/> | ||
183 | <Tool | ||
184 | Name="VCXMLDataGeneratorTool"/> | ||
185 | <Tool | ||
186 | Name="VCManagedWrapperGeneratorTool"/> | ||
187 | <Tool | ||
188 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
189 | </Configuration> | ||
190 | </Configurations> | ||
191 | <References> | ||
192 | </References> | ||
193 | <Files> | ||
194 | <Filter | ||
195 | Name="Source Files" | ||
196 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
197 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> | ||
198 | <File | ||
199 | RelativePath=".\lldxhardware.cpp"> | ||
200 | </File> | ||
201 | <File | ||
202 | RelativePath=".\llgl.cpp"> | ||
203 | </File> | ||
204 | <File | ||
205 | RelativePath=".\llkeyboard.cpp"> | ||
206 | </File> | ||
207 | <File | ||
208 | RelativePath=".\llkeyboardwin32.cpp"> | ||
209 | </File> | ||
210 | <File | ||
211 | RelativePath=".\lllogitechlcd.cpp"> | ||
212 | </File> | ||
213 | <File | ||
214 | RelativePath=".\llwindow.cpp"> | ||
215 | </File> | ||
216 | <File | ||
217 | RelativePath=".\llwindowheadless.cpp"> | ||
218 | </File> | ||
219 | <File | ||
220 | RelativePath=".\llwindowmesaheadless.cpp"> | ||
221 | </File> | ||
222 | <File | ||
223 | RelativePath=".\llwindowwin32.cpp"> | ||
224 | </File> | ||
225 | </Filter> | ||
226 | <Filter | ||
227 | Name="Header Files" | ||
228 | Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
229 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> | ||
230 | <File | ||
231 | RelativePath=".\lldxhardware.h"> | ||
232 | </File> | ||
233 | <File | ||
234 | RelativePath=".\llgl.h"> | ||
235 | </File> | ||
236 | <File | ||
237 | RelativePath=".\llglheaders.h"> | ||
238 | </File> | ||
239 | <File | ||
240 | RelativePath=".\llglstates.h"> | ||
241 | </File> | ||
242 | <File | ||
243 | RelativePath=".\llgltypes.h"> | ||
244 | </File> | ||
245 | <File | ||
246 | RelativePath=".\llkeyboard.h"> | ||
247 | </File> | ||
248 | <File | ||
249 | RelativePath=".\llkeyboardwin32.h"> | ||
250 | </File> | ||
251 | <File | ||
252 | RelativePath=".\lllogitechlcd.h"> | ||
253 | </File> | ||
254 | <File | ||
255 | RelativePath=".\llmousehandler.h"> | ||
256 | </File> | ||
257 | <File | ||
258 | RelativePath=".\llpreeditor.h"> | ||
259 | </File> | ||
260 | <File | ||
261 | RelativePath=".\llwindow.h"> | ||
262 | </File> | ||
263 | <File | ||
264 | RelativePath=".\llwindowheadless.h"> | ||
265 | </File> | ||
266 | <File | ||
267 | RelativePath=".\llwindowmesaheadless.h"> | ||
268 | </File> | ||
269 | <File | ||
270 | RelativePath=".\llwindowwin32.h"> | ||
271 | </File> | ||
272 | </Filter> | ||
273 | <Filter | ||
274 | Name="Resource Files" | ||
275 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
276 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> | ||
277 | </Filter> | ||
278 | </Files> | ||
279 | <Globals> | ||
280 | </Globals> | ||
281 | </VisualStudioProject> | ||
diff --git a/linden/indra/llwindow/llwindow_vc8.vcproj b/linden/indra/llwindow/llwindow_vc8.vcproj deleted file mode 100644 index 69ec460..0000000 --- a/linden/indra/llwindow/llwindow_vc8.vcproj +++ /dev/null | |||
@@ -1,395 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="8.00" | ||
5 | Name="llwindow" | ||
6 | ProjectGUID="{B5B53617-416F-404A-BF10-22EBCCA0E4FB}" | ||
7 | RootNamespace="llwindow" | ||
8 | Keyword="Win32Proj" | ||
9 | > | ||
10 | <Platforms> | ||
11 | <Platform | ||
12 | Name="Win32" | ||
13 | /> | ||
14 | </Platforms> | ||
15 | <ToolFiles> | ||
16 | </ToolFiles> | ||
17 | <Configurations> | ||
18 | <Configuration | ||
19 | Name="Debug|Win32" | ||
20 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
21 | IntermediateDirectory="Debug" | ||
22 | ConfigurationType="4" | ||
23 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
24 | CharacterSet="1" | ||
25 | > | ||
26 | <Tool | ||
27 | Name="VCPreBuildEventTool" | ||
28 | /> | ||
29 | <Tool | ||
30 | Name="VCCustomBuildTool" | ||
31 | /> | ||
32 | <Tool | ||
33 | Name="VCXMLDataGeneratorTool" | ||
34 | /> | ||
35 | <Tool | ||
36 | Name="VCWebServiceProxyGeneratorTool" | ||
37 | /> | ||
38 | <Tool | ||
39 | Name="VCMIDLTool" | ||
40 | /> | ||
41 | <Tool | ||
42 | Name="VCCLCompilerTool" | ||
43 | Optimization="0" | ||
44 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
45 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" | ||
46 | MinimalRebuild="true" | ||
47 | BasicRuntimeChecks="3" | ||
48 | RuntimeLibrary="1" | ||
49 | StructMemberAlignment="4" | ||
50 | TreatWChar_tAsBuiltInType="false" | ||
51 | ForceConformanceInForLoopScope="true" | ||
52 | UsePrecompiledHeader="0" | ||
53 | WarningLevel="3" | ||
54 | Detect64BitPortabilityProblems="false" | ||
55 | DebugInformationFormat="4" | ||
56 | /> | ||
57 | <Tool | ||
58 | Name="VCManagedResourceCompilerTool" | ||
59 | /> | ||
60 | <Tool | ||
61 | Name="VCResourceCompilerTool" | ||
62 | /> | ||
63 | <Tool | ||
64 | Name="VCPreLinkEventTool" | ||
65 | /> | ||
66 | <Tool | ||
67 | Name="VCLibrarianTool" | ||
68 | OutputFile="$(OutDir)/llwindow.lib" | ||
69 | /> | ||
70 | <Tool | ||
71 | Name="VCALinkTool" | ||
72 | /> | ||
73 | <Tool | ||
74 | Name="VCXDCMakeTool" | ||
75 | /> | ||
76 | <Tool | ||
77 | Name="VCBscMakeTool" | ||
78 | /> | ||
79 | <Tool | ||
80 | Name="VCFxCopTool" | ||
81 | /> | ||
82 | <Tool | ||
83 | Name="VCPostBuildEventTool" | ||
84 | /> | ||
85 | </Configuration> | ||
86 | <Configuration | ||
87 | Name="Release|Win32" | ||
88 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
89 | IntermediateDirectory="Release" | ||
90 | ConfigurationType="4" | ||
91 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
92 | CharacterSet="1" | ||
93 | > | ||
94 | <Tool | ||
95 | Name="VCPreBuildEventTool" | ||
96 | /> | ||
97 | <Tool | ||
98 | Name="VCCustomBuildTool" | ||
99 | /> | ||
100 | <Tool | ||
101 | Name="VCXMLDataGeneratorTool" | ||
102 | /> | ||
103 | <Tool | ||
104 | Name="VCWebServiceProxyGeneratorTool" | ||
105 | /> | ||
106 | <Tool | ||
107 | Name="VCMIDLTool" | ||
108 | /> | ||
109 | <Tool | ||
110 | Name="VCCLCompilerTool" | ||
111 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
112 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
113 | TreatWChar_tAsBuiltInType="false" | ||
114 | ForceConformanceInForLoopScope="true" | ||
115 | WarningLevel="3" | ||
116 | WarnAsError="true" | ||
117 | DebugInformationFormat="3" | ||
118 | /> | ||
119 | <Tool | ||
120 | Name="VCManagedResourceCompilerTool" | ||
121 | /> | ||
122 | <Tool | ||
123 | Name="VCResourceCompilerTool" | ||
124 | /> | ||
125 | <Tool | ||
126 | Name="VCPreLinkEventTool" | ||
127 | /> | ||
128 | <Tool | ||
129 | Name="VCLibrarianTool" | ||
130 | OutputFile="$(OutDir)/llwindow.lib" | ||
131 | /> | ||
132 | <Tool | ||
133 | Name="VCALinkTool" | ||
134 | /> | ||
135 | <Tool | ||
136 | Name="VCXDCMakeTool" | ||
137 | /> | ||
138 | <Tool | ||
139 | Name="VCBscMakeTool" | ||
140 | /> | ||
141 | <Tool | ||
142 | Name="VCFxCopTool" | ||
143 | /> | ||
144 | <Tool | ||
145 | Name="VCPostBuildEventTool" | ||
146 | /> | ||
147 | </Configuration> | ||
148 | <Configuration | ||
149 | Name="DebugMesaHeadless|Win32" | ||
150 | OutputDirectory="../lib_debug/i686-win32" | ||
151 | IntermediateDirectory="$(ConfigurationName)" | ||
152 | ConfigurationType="4" | ||
153 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
154 | CharacterSet="1" | ||
155 | > | ||
156 | <Tool | ||
157 | Name="VCPreBuildEventTool" | ||
158 | /> | ||
159 | <Tool | ||
160 | Name="VCCustomBuildTool" | ||
161 | /> | ||
162 | <Tool | ||
163 | Name="VCXMLDataGeneratorTool" | ||
164 | /> | ||
165 | <Tool | ||
166 | Name="VCWebServiceProxyGeneratorTool" | ||
167 | /> | ||
168 | <Tool | ||
169 | Name="VCMIDLTool" | ||
170 | /> | ||
171 | <Tool | ||
172 | Name="VCCLCompilerTool" | ||
173 | Optimization="0" | ||
174 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\GLMESA;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
175 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" | ||
176 | MinimalRebuild="true" | ||
177 | BasicRuntimeChecks="3" | ||
178 | RuntimeLibrary="1" | ||
179 | StructMemberAlignment="4" | ||
180 | TreatWChar_tAsBuiltInType="false" | ||
181 | ForceConformanceInForLoopScope="true" | ||
182 | UsePrecompiledHeader="0" | ||
183 | WarningLevel="3" | ||
184 | Detect64BitPortabilityProblems="false" | ||
185 | DebugInformationFormat="4" | ||
186 | /> | ||
187 | <Tool | ||
188 | Name="VCManagedResourceCompilerTool" | ||
189 | /> | ||
190 | <Tool | ||
191 | Name="VCResourceCompilerTool" | ||
192 | /> | ||
193 | <Tool | ||
194 | Name="VCPreLinkEventTool" | ||
195 | /> | ||
196 | <Tool | ||
197 | Name="VCLibrarianTool" | ||
198 | OutputFile="$(OutDir)/llwindow_mesaheadless.lib" | ||
199 | /> | ||
200 | <Tool | ||
201 | Name="VCALinkTool" | ||
202 | /> | ||
203 | <Tool | ||
204 | Name="VCXDCMakeTool" | ||
205 | /> | ||
206 | <Tool | ||
207 | Name="VCBscMakeTool" | ||
208 | /> | ||
209 | <Tool | ||
210 | Name="VCFxCopTool" | ||
211 | /> | ||
212 | <Tool | ||
213 | Name="VCPostBuildEventTool" | ||
214 | /> | ||
215 | </Configuration> | ||
216 | <Configuration | ||
217 | Name="ReleaseNoOpt|Win32" | ||
218 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
219 | IntermediateDirectory="$(ConfigurationName)" | ||
220 | ConfigurationType="4" | ||
221 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
222 | CharacterSet="1" | ||
223 | > | ||
224 | <Tool | ||
225 | Name="VCPreBuildEventTool" | ||
226 | /> | ||
227 | <Tool | ||
228 | Name="VCCustomBuildTool" | ||
229 | /> | ||
230 | <Tool | ||
231 | Name="VCXMLDataGeneratorTool" | ||
232 | /> | ||
233 | <Tool | ||
234 | Name="VCWebServiceProxyGeneratorTool" | ||
235 | /> | ||
236 | <Tool | ||
237 | Name="VCMIDLTool" | ||
238 | /> | ||
239 | <Tool | ||
240 | Name="VCCLCompilerTool" | ||
241 | Optimization="0" | ||
242 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
243 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
244 | RuntimeLibrary="0" | ||
245 | StructMemberAlignment="0" | ||
246 | TreatWChar_tAsBuiltInType="false" | ||
247 | ForceConformanceInForLoopScope="true" | ||
248 | UsePrecompiledHeader="0" | ||
249 | WarningLevel="3" | ||
250 | Detect64BitPortabilityProblems="false" | ||
251 | DebugInformationFormat="3" | ||
252 | /> | ||
253 | <Tool | ||
254 | Name="VCManagedResourceCompilerTool" | ||
255 | /> | ||
256 | <Tool | ||
257 | Name="VCResourceCompilerTool" | ||
258 | /> | ||
259 | <Tool | ||
260 | Name="VCPreLinkEventTool" | ||
261 | /> | ||
262 | <Tool | ||
263 | Name="VCLibrarianTool" | ||
264 | OutputFile="$(OutDir)/llwindow.lib" | ||
265 | /> | ||
266 | <Tool | ||
267 | Name="VCALinkTool" | ||
268 | /> | ||
269 | <Tool | ||
270 | Name="VCXDCMakeTool" | ||
271 | /> | ||
272 | <Tool | ||
273 | Name="VCBscMakeTool" | ||
274 | /> | ||
275 | <Tool | ||
276 | Name="VCFxCopTool" | ||
277 | /> | ||
278 | <Tool | ||
279 | Name="VCPostBuildEventTool" | ||
280 | /> | ||
281 | </Configuration> | ||
282 | </Configurations> | ||
283 | <References> | ||
284 | </References> | ||
285 | <Files> | ||
286 | <Filter | ||
287 | Name="Source Files" | ||
288 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
289 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||
290 | > | ||
291 | <File | ||
292 | RelativePath=".\lldxhardware.cpp" | ||
293 | > | ||
294 | </File> | ||
295 | <File | ||
296 | RelativePath=".\llgl.cpp" | ||
297 | > | ||
298 | </File> | ||
299 | <File | ||
300 | RelativePath=".\llkeyboard.cpp" | ||
301 | > | ||
302 | </File> | ||
303 | <File | ||
304 | RelativePath=".\llkeyboardwin32.cpp" | ||
305 | > | ||
306 | </File> | ||
307 | <File | ||
308 | RelativePath=".\lllogitechlcd.cpp" | ||
309 | > | ||
310 | </File> | ||
311 | <File | ||
312 | RelativePath=".\llwindow.cpp" | ||
313 | > | ||
314 | </File> | ||
315 | <File | ||
316 | RelativePath=".\llwindowheadless.cpp" | ||
317 | > | ||
318 | </File> | ||
319 | <File | ||
320 | RelativePath=".\llwindowmesaheadless.cpp" | ||
321 | > | ||
322 | </File> | ||
323 | <File | ||
324 | RelativePath=".\llwindowwin32.cpp" | ||
325 | > | ||
326 | </File> | ||
327 | </Filter> | ||
328 | <Filter | ||
329 | Name="Header Files" | ||
330 | Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
331 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||
332 | > | ||
333 | <File | ||
334 | RelativePath=".\lldxhardware.h" | ||
335 | > | ||
336 | </File> | ||
337 | <File | ||
338 | RelativePath=".\llgl.h" | ||
339 | > | ||
340 | </File> | ||
341 | <File | ||
342 | RelativePath=".\llglheaders.h" | ||
343 | > | ||
344 | </File> | ||
345 | <File | ||
346 | RelativePath=".\llglstates.h" | ||
347 | > | ||
348 | </File> | ||
349 | <File | ||
350 | RelativePath=".\llgltypes.h" | ||
351 | > | ||
352 | </File> | ||
353 | <File | ||
354 | RelativePath=".\llkeyboard.h" | ||
355 | > | ||
356 | </File> | ||
357 | <File | ||
358 | RelativePath=".\llkeyboardwin32.h" | ||
359 | > | ||
360 | </File> | ||
361 | <File | ||
362 | RelativePath=".\lllogitechlcd.h" | ||
363 | > | ||
364 | </File> | ||
365 | <File | ||
366 | RelativePath=".\llmousehandler.h" | ||
367 | > | ||
368 | </File> | ||
369 | <File | ||
370 | RelativePath=".\llwindow.h" | ||
371 | > | ||
372 | </File> | ||
373 | <File | ||
374 | RelativePath=".\llwindowheadless.h" | ||
375 | > | ||
376 | </File> | ||
377 | <File | ||
378 | RelativePath=".\llwindowmesaheadless.h" | ||
379 | > | ||
380 | </File> | ||
381 | <File | ||
382 | RelativePath=".\llwindowwin32.h" | ||
383 | > | ||
384 | </File> | ||
385 | </Filter> | ||
386 | <Filter | ||
387 | Name="Resource Files" | ||
388 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
389 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||
390 | > | ||
391 | </Filter> | ||
392 | </Files> | ||
393 | <Globals> | ||
394 | </Globals> | ||
395 | </VisualStudioProject> | ||
diff --git a/linden/indra/llwindow/llwindow_vc9.vcproj b/linden/indra/llwindow/llwindow_vc9.vcproj deleted file mode 100644 index 991c296..0000000 --- a/linden/indra/llwindow/llwindow_vc9.vcproj +++ /dev/null | |||
@@ -1,398 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="9.00" | ||
5 | Name="llwindow" | ||
6 | ProjectGUID="{B5B53617-416F-404A-BF10-22EBCCA0E4FB}" | ||
7 | RootNamespace="llwindow" | ||
8 | Keyword="Win32Proj" | ||
9 | TargetFrameworkVersion="131072" | ||
10 | > | ||
11 | <Platforms> | ||
12 | <Platform | ||
13 | Name="Win32" | ||
14 | /> | ||
15 | </Platforms> | ||
16 | <ToolFiles> | ||
17 | </ToolFiles> | ||
18 | <Configurations> | ||
19 | <Configuration | ||
20 | Name="Debug|Win32" | ||
21 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
22 | IntermediateDirectory="Debug" | ||
23 | ConfigurationType="4" | ||
24 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
25 | CharacterSet="1" | ||
26 | > | ||
27 | <Tool | ||
28 | Name="VCPreBuildEventTool" | ||
29 | /> | ||
30 | <Tool | ||
31 | Name="VCCustomBuildTool" | ||
32 | /> | ||
33 | <Tool | ||
34 | Name="VCXMLDataGeneratorTool" | ||
35 | /> | ||
36 | <Tool | ||
37 | Name="VCWebServiceProxyGeneratorTool" | ||
38 | /> | ||
39 | <Tool | ||
40 | Name="VCMIDLTool" | ||
41 | /> | ||
42 | <Tool | ||
43 | Name="VCCLCompilerTool" | ||
44 | Optimization="0" | ||
45 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
46 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" | ||
47 | MinimalRebuild="true" | ||
48 | BasicRuntimeChecks="3" | ||
49 | RuntimeLibrary="1" | ||
50 | StructMemberAlignment="4" | ||
51 | TreatWChar_tAsBuiltInType="false" | ||
52 | ForceConformanceInForLoopScope="true" | ||
53 | UsePrecompiledHeader="0" | ||
54 | WarningLevel="3" | ||
55 | Detect64BitPortabilityProblems="false" | ||
56 | DebugInformationFormat="4" | ||
57 | /> | ||
58 | <Tool | ||
59 | Name="VCManagedResourceCompilerTool" | ||
60 | /> | ||
61 | <Tool | ||
62 | Name="VCResourceCompilerTool" | ||
63 | /> | ||
64 | <Tool | ||
65 | Name="VCPreLinkEventTool" | ||
66 | /> | ||
67 | <Tool | ||
68 | Name="VCLibrarianTool" | ||
69 | OutputFile="$(OutDir)/llwindow.lib" | ||
70 | /> | ||
71 | <Tool | ||
72 | Name="VCALinkTool" | ||
73 | /> | ||
74 | <Tool | ||
75 | Name="VCXDCMakeTool" | ||
76 | /> | ||
77 | <Tool | ||
78 | Name="VCBscMakeTool" | ||
79 | /> | ||
80 | <Tool | ||
81 | Name="VCFxCopTool" | ||
82 | /> | ||
83 | <Tool | ||
84 | Name="VCPostBuildEventTool" | ||
85 | /> | ||
86 | </Configuration> | ||
87 | <Configuration | ||
88 | Name="Release|Win32" | ||
89 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
90 | IntermediateDirectory="Release" | ||
91 | ConfigurationType="4" | ||
92 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
93 | CharacterSet="1" | ||
94 | > | ||
95 | <Tool | ||
96 | Name="VCPreBuildEventTool" | ||
97 | /> | ||
98 | <Tool | ||
99 | Name="VCCustomBuildTool" | ||
100 | /> | ||
101 | <Tool | ||
102 | Name="VCXMLDataGeneratorTool" | ||
103 | /> | ||
104 | <Tool | ||
105 | Name="VCWebServiceProxyGeneratorTool" | ||
106 | /> | ||
107 | <Tool | ||
108 | Name="VCMIDLTool" | ||
109 | /> | ||
110 | <Tool | ||
111 | Name="VCCLCompilerTool" | ||
112 | AdditionalOptions="/Oy-" | ||
113 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
114 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
115 | TreatWChar_tAsBuiltInType="false" | ||
116 | ForceConformanceInForLoopScope="true" | ||
117 | WarningLevel="3" | ||
118 | WarnAsError="true" | ||
119 | DebugInformationFormat="3" | ||
120 | /> | ||
121 | <Tool | ||
122 | Name="VCManagedResourceCompilerTool" | ||
123 | /> | ||
124 | <Tool | ||
125 | Name="VCResourceCompilerTool" | ||
126 | /> | ||
127 | <Tool | ||
128 | Name="VCPreLinkEventTool" | ||
129 | /> | ||
130 | <Tool | ||
131 | Name="VCLibrarianTool" | ||
132 | OutputFile="$(OutDir)/llwindow.lib" | ||
133 | /> | ||
134 | <Tool | ||
135 | Name="VCALinkTool" | ||
136 | /> | ||
137 | <Tool | ||
138 | Name="VCXDCMakeTool" | ||
139 | /> | ||
140 | <Tool | ||
141 | Name="VCBscMakeTool" | ||
142 | /> | ||
143 | <Tool | ||
144 | Name="VCFxCopTool" | ||
145 | /> | ||
146 | <Tool | ||
147 | Name="VCPostBuildEventTool" | ||
148 | /> | ||
149 | </Configuration> | ||
150 | <Configuration | ||
151 | Name="DebugMesaHeadless|Win32" | ||
152 | OutputDirectory="../lib_debug/i686-win32" | ||
153 | IntermediateDirectory="$(ConfigurationName)" | ||
154 | ConfigurationType="4" | ||
155 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
156 | CharacterSet="1" | ||
157 | > | ||
158 | <Tool | ||
159 | Name="VCPreBuildEventTool" | ||
160 | /> | ||
161 | <Tool | ||
162 | Name="VCCustomBuildTool" | ||
163 | /> | ||
164 | <Tool | ||
165 | Name="VCXMLDataGeneratorTool" | ||
166 | /> | ||
167 | <Tool | ||
168 | Name="VCWebServiceProxyGeneratorTool" | ||
169 | /> | ||
170 | <Tool | ||
171 | Name="VCMIDLTool" | ||
172 | /> | ||
173 | <Tool | ||
174 | Name="VCCLCompilerTool" | ||
175 | Optimization="0" | ||
176 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\GLMESA;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
177 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" | ||
178 | MinimalRebuild="true" | ||
179 | BasicRuntimeChecks="3" | ||
180 | RuntimeLibrary="1" | ||
181 | StructMemberAlignment="4" | ||
182 | TreatWChar_tAsBuiltInType="false" | ||
183 | ForceConformanceInForLoopScope="true" | ||
184 | UsePrecompiledHeader="0" | ||
185 | WarningLevel="3" | ||
186 | Detect64BitPortabilityProblems="false" | ||
187 | DebugInformationFormat="4" | ||
188 | /> | ||
189 | <Tool | ||
190 | Name="VCManagedResourceCompilerTool" | ||
191 | /> | ||
192 | <Tool | ||
193 | Name="VCResourceCompilerTool" | ||
194 | /> | ||
195 | <Tool | ||
196 | Name="VCPreLinkEventTool" | ||
197 | /> | ||
198 | <Tool | ||
199 | Name="VCLibrarianTool" | ||
200 | OutputFile="$(OutDir)/llwindow_mesaheadless.lib" | ||
201 | /> | ||
202 | <Tool | ||
203 | Name="VCALinkTool" | ||
204 | /> | ||
205 | <Tool | ||
206 | Name="VCXDCMakeTool" | ||
207 | /> | ||
208 | <Tool | ||
209 | Name="VCBscMakeTool" | ||
210 | /> | ||
211 | <Tool | ||
212 | Name="VCFxCopTool" | ||
213 | /> | ||
214 | <Tool | ||
215 | Name="VCPostBuildEventTool" | ||
216 | /> | ||
217 | </Configuration> | ||
218 | <Configuration | ||
219 | Name="ReleaseNoOpt|Win32" | ||
220 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
221 | IntermediateDirectory="$(ConfigurationName)" | ||
222 | ConfigurationType="4" | ||
223 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
224 | CharacterSet="1" | ||
225 | > | ||
226 | <Tool | ||
227 | Name="VCPreBuildEventTool" | ||
228 | /> | ||
229 | <Tool | ||
230 | Name="VCCustomBuildTool" | ||
231 | /> | ||
232 | <Tool | ||
233 | Name="VCXMLDataGeneratorTool" | ||
234 | /> | ||
235 | <Tool | ||
236 | Name="VCWebServiceProxyGeneratorTool" | ||
237 | /> | ||
238 | <Tool | ||
239 | Name="VCMIDLTool" | ||
240 | /> | ||
241 | <Tool | ||
242 | Name="VCCLCompilerTool" | ||
243 | AdditionalOptions="/Oy-" | ||
244 | Optimization="0" | ||
245 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\llrender;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" | ||
246 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
247 | RuntimeLibrary="0" | ||
248 | StructMemberAlignment="0" | ||
249 | TreatWChar_tAsBuiltInType="false" | ||
250 | ForceConformanceInForLoopScope="true" | ||
251 | UsePrecompiledHeader="0" | ||
252 | WarningLevel="3" | ||
253 | Detect64BitPortabilityProblems="false" | ||
254 | DebugInformationFormat="3" | ||
255 | /> | ||
256 | <Tool | ||
257 | Name="VCManagedResourceCompilerTool" | ||
258 | /> | ||
259 | <Tool | ||
260 | Name="VCResourceCompilerTool" | ||
261 | /> | ||
262 | <Tool | ||
263 | Name="VCPreLinkEventTool" | ||
264 | /> | ||
265 | <Tool | ||
266 | Name="VCLibrarianTool" | ||
267 | OutputFile="$(OutDir)/llwindow.lib" | ||
268 | /> | ||
269 | <Tool | ||
270 | Name="VCALinkTool" | ||
271 | /> | ||
272 | <Tool | ||
273 | Name="VCXDCMakeTool" | ||
274 | /> | ||
275 | <Tool | ||
276 | Name="VCBscMakeTool" | ||
277 | /> | ||
278 | <Tool | ||
279 | Name="VCFxCopTool" | ||
280 | /> | ||
281 | <Tool | ||
282 | Name="VCPostBuildEventTool" | ||
283 | /> | ||
284 | </Configuration> | ||
285 | </Configurations> | ||
286 | <References> | ||
287 | </References> | ||
288 | <Files> | ||
289 | <Filter | ||
290 | Name="Source Files" | ||
291 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
292 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||
293 | > | ||
294 | <File | ||
295 | RelativePath=".\lldxhardware.cpp" | ||
296 | > | ||
297 | </File> | ||
298 | <File | ||
299 | RelativePath=".\llgl.cpp" | ||
300 | > | ||
301 | </File> | ||
302 | <File | ||
303 | RelativePath=".\llkeyboard.cpp" | ||
304 | > | ||
305 | </File> | ||
306 | <File | ||
307 | RelativePath=".\llkeyboardwin32.cpp" | ||
308 | > | ||
309 | </File> | ||
310 | <File | ||
311 | RelativePath=".\lllogitechlcd.cpp" | ||
312 | > | ||
313 | </File> | ||
314 | <File | ||
315 | RelativePath=".\llwindow.cpp" | ||
316 | > | ||
317 | </File> | ||
318 | <File | ||
319 | RelativePath=".\llwindowheadless.cpp" | ||
320 | > | ||
321 | </File> | ||
322 | <File | ||
323 | RelativePath=".\llwindowmesaheadless.cpp" | ||
324 | > | ||
325 | </File> | ||
326 | <File | ||
327 | RelativePath=".\llwindowwin32.cpp" | ||
328 | > | ||
329 | </File> | ||
330 | </Filter> | ||
331 | <Filter | ||
332 | Name="Header Files" | ||
333 | Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
334 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||
335 | > | ||
336 | <File | ||
337 | RelativePath=".\lldxhardware.h" | ||
338 | > | ||
339 | </File> | ||
340 | <File | ||
341 | RelativePath=".\llgl.h" | ||
342 | > | ||
343 | </File> | ||
344 | <File | ||
345 | RelativePath=".\llglheaders.h" | ||
346 | > | ||
347 | </File> | ||
348 | <File | ||
349 | RelativePath=".\llglstates.h" | ||
350 | > | ||
351 | </File> | ||
352 | <File | ||
353 | RelativePath=".\llgltypes.h" | ||
354 | > | ||
355 | </File> | ||
356 | <File | ||
357 | RelativePath=".\llkeyboard.h" | ||
358 | > | ||
359 | </File> | ||
360 | <File | ||
361 | RelativePath=".\llkeyboardwin32.h" | ||
362 | > | ||
363 | </File> | ||
364 | <File | ||
365 | RelativePath=".\lllogitechlcd.h" | ||
366 | > | ||
367 | </File> | ||
368 | <File | ||
369 | RelativePath=".\llmousehandler.h" | ||
370 | > | ||
371 | </File> | ||
372 | <File | ||
373 | RelativePath=".\llwindow.h" | ||
374 | > | ||
375 | </File> | ||
376 | <File | ||
377 | RelativePath=".\llwindowheadless.h" | ||
378 | > | ||
379 | </File> | ||
380 | <File | ||
381 | RelativePath=".\llwindowmesaheadless.h" | ||
382 | > | ||
383 | </File> | ||
384 | <File | ||
385 | RelativePath=".\llwindowwin32.h" | ||
386 | > | ||
387 | </File> | ||
388 | </Filter> | ||
389 | <Filter | ||
390 | Name="Resource Files" | ||
391 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
392 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||
393 | > | ||
394 | </Filter> | ||
395 | </Files> | ||
396 | <Globals> | ||
397 | </Globals> | ||
398 | </VisualStudioProject> | ||
diff --git a/linden/indra/llwindow/llwindowheadless.cpp b/linden/indra/llwindow/llwindowheadless.cpp index 441b4e9..c8f0c5c 100644 --- a/linden/indra/llwindow/llwindowheadless.cpp +++ b/linden/indra/llwindow/llwindowheadless.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | // | 37 | // |
38 | // LLWindowHeadless | 38 | // LLWindowHeadless |
39 | // | 39 | // |
40 | LLWindowHeadless::LLWindowHeadless(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | 40 | LLWindowHeadless::LLWindowHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, |
41 | U32 flags, BOOL fullscreen, BOOL clearBg, | 41 | U32 flags, BOOL fullscreen, BOOL clearBg, |
42 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) | 42 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) |
43 | : LLWindow(fullscreen, flags) | 43 | : LLWindow(fullscreen, flags) |
diff --git a/linden/indra/llwindow/llwindowheadless.h b/linden/indra/llwindow/llwindowheadless.h index 7cef7d8..fffb2ed 100644 --- a/linden/indra/llwindow/llwindowheadless.h +++ b/linden/indra/llwindow/llwindowheadless.h | |||
@@ -77,12 +77,6 @@ public: | |||
77 | /*virtual*/ void delayInputProcessing() {}; | 77 | /*virtual*/ void delayInputProcessing() {}; |
78 | /*virtual*/ void swapBuffers(); | 78 | /*virtual*/ void swapBuffers(); |
79 | 79 | ||
80 | /*virtual*/ LLString getTempFileName() {return LLString(""); }; | ||
81 | /*virtual*/ void deleteFile( const char* file_name ) {}; | ||
82 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ) {return 0; }; | ||
83 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL) { return FALSE; }; | ||
84 | |||
85 | |||
86 | // handy coordinate space conversion routines | 80 | // handy coordinate space conversion routines |
87 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; | 81 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; |
88 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; | 82 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; |
@@ -99,7 +93,7 @@ public: | |||
99 | /*virtual*/ void *getPlatformWindow() { return 0; }; | 93 | /*virtual*/ void *getPlatformWindow() { return 0; }; |
100 | /*virtual*/ void bringToFront() {}; | 94 | /*virtual*/ void bringToFront() {}; |
101 | 95 | ||
102 | LLWindowHeadless(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | 96 | LLWindowHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, |
103 | U32 flags, BOOL fullscreen, BOOL clearBg, | 97 | U32 flags, BOOL fullscreen, BOOL clearBg, |
104 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); | 98 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); |
105 | virtual ~LLWindowHeadless(); | 99 | virtual ~LLWindowHeadless(); |
@@ -114,7 +108,7 @@ public: | |||
114 | virtual ~LLSplashScreenHeadless() {}; | 108 | virtual ~LLSplashScreenHeadless() {}; |
115 | 109 | ||
116 | /*virtual*/ void showImpl() {}; | 110 | /*virtual*/ void showImpl() {}; |
117 | /*virtual*/ void updateImpl(const char* mesg) {}; | 111 | /*virtual*/ void updateImpl(const std::string& mesg) {}; |
118 | /*virtual*/ void hideImpl() {}; | 112 | /*virtual*/ void hideImpl() {}; |
119 | 113 | ||
120 | }; | 114 | }; |
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp index 5ab0ba6..5102173 100644 --- a/linden/indra/llwindow/llwindowmacosx.cpp +++ b/linden/indra/llwindow/llwindowmacosx.cpp | |||
@@ -29,8 +29,6 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if LL_DARWIN | ||
33 | |||
34 | #include "linden_common.h" | 32 | #include "linden_common.h" |
35 | 33 | ||
36 | #include <Carbon/Carbon.h> | 34 | #include <Carbon/Carbon.h> |
@@ -42,10 +40,6 @@ | |||
42 | #include "llgl.h" | 40 | #include "llgl.h" |
43 | #include "llstring.h" | 41 | #include "llstring.h" |
44 | #include "lldir.h" | 42 | #include "lldir.h" |
45 | #include "llviewercontrol.h" | ||
46 | |||
47 | #include "llglheaders.h" | ||
48 | |||
49 | #include "indra_constants.h" | 43 | #include "indra_constants.h" |
50 | 44 | ||
51 | #include "llwindowmacosx-objc.h" | 45 | #include "llwindowmacosx-objc.h" |
@@ -66,37 +60,16 @@ const S32 MAX_NUM_RESOLUTIONS = 32; | |||
66 | // LLWindowMacOSX | 60 | // LLWindowMacOSX |
67 | // | 61 | // |
68 | 62 | ||
69 | // Cross-platform bits: | 63 | BOOL LLWindowMacOSX::sUseMultGL = FALSE; |
64 | WindowRef LLWindowMacOSX::sMediaWindow = NULL; | ||
70 | 65 | ||
71 | void show_window_creation_error(const char* title) | 66 | // Cross-platform bits: |
72 | { | ||
73 | llwarns << title << llendl; | ||
74 | /* | ||
75 | OSMessageBox( | ||
76 | "Second Life is unable to run because it can't set up your display.\n" | ||
77 | "We need to be able to make a 32-bit color window at 1024x768, with\n" | ||
78 | "an 8 bit alpha channel.\n" | ||
79 | "\n" | ||
80 | "First, be sure your monitor is set to True Color (32-bit) in\n" | ||
81 | "Start -> Control Panels -> Display -> Settings.\n" | ||
82 | "\n" | ||
83 | "Otherwise, this may be due to video card driver issues.\n" | ||
84 | "Please make sure you have the latest video card drivers installed.\n" | ||
85 | "ATI drivers are available at http://www.ati.com/\n" | ||
86 | "nVidia drivers are available at http://www.nvidia.com/\n" | ||
87 | "\n" | ||
88 | "If you continue to receive this message, contact customer service.", | ||
89 | title, | ||
90 | OSMB_OK); | ||
91 | */ | ||
92 | } | ||
93 | 67 | ||
94 | BOOL check_for_card(const char* RENDERER, const char* bad_card) | 68 | BOOL check_for_card(const char* RENDERER, const char* bad_card) |
95 | { | 69 | { |
96 | if (!strnicmp(RENDERER, bad_card, strlen(bad_card))) | 70 | if (!strnicmp(RENDERER, bad_card, strlen(bad_card))) |
97 | { | 71 | { |
98 | char buffer[1024];/* Flawfinder: ignore */ | 72 | std::string buffer = llformat( |
99 | snprintf(buffer, sizeof(buffer), | ||
100 | "Your video card appears to be a %s, which Second Life does not support.\n" | 73 | "Your video card appears to be a %s, which Second Life does not support.\n" |
101 | "\n" | 74 | "\n" |
102 | "Second Life requires a video card with 32 Mb of memory or more, as well as\n" | 75 | "Second Life requires a video card with 32 Mb of memory or more, as well as\n" |
@@ -110,7 +83,7 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card) | |||
110 | "You can try to run Second Life, but it will probably crash or run\n" | 83 | "You can try to run Second Life, but it will probably crash or run\n" |
111 | "very slowly. Try anyway?", | 84 | "very slowly. Try anyway?", |
112 | bad_card); | 85 | bad_card); |
113 | S32 button = OSMessageBox(buffer, "Unsupported video card", OSMB_YESNO); | 86 | S32 button = OSMessageBox(buffer.c_str(), "Unsupported video card", OSMB_YESNO); |
114 | if (OSBTN_YES == button) | 87 | if (OSBTN_YES == button) |
115 | { | 88 | { |
116 | return FALSE; | 89 | return FALSE; |
@@ -124,8 +97,6 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card) | |||
124 | return FALSE; | 97 | return FALSE; |
125 | } | 98 | } |
126 | 99 | ||
127 | |||
128 | |||
129 | // Switch to determine whether we capture all displays, or just the main one. | 100 | // Switch to determine whether we capture all displays, or just the main one. |
130 | // We may want to base this on the setting of _DEBUG... | 101 | // We may want to base this on the setting of _DEBUG... |
131 | 102 | ||
@@ -242,7 +213,7 @@ static LLWindowMacOSX *gWindowImplementation = NULL; | |||
242 | 213 | ||
243 | 214 | ||
244 | 215 | ||
245 | LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width, | 216 | LLWindowMacOSX::LLWindowMacOSX(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, |
246 | S32 height, U32 flags, | 217 | S32 height, U32 flags, |
247 | BOOL fullscreen, BOOL clearBg, | 218 | BOOL fullscreen, BOOL clearBg, |
248 | BOOL disable_vsync, BOOL use_gl, | 219 | BOOL disable_vsync, BOOL use_gl, |
@@ -289,10 +260,11 @@ LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width, | |||
289 | mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); | 260 | mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); |
290 | 261 | ||
291 | // Stash the window title | 262 | // Stash the window title |
292 | strcpy((char*)mWindowTitle + 1, title); /* Flawfinder: ignore */ | 263 | strcpy((char*)mWindowTitle + 1, title.c_str()); /* Flawfinder: ignore */ |
293 | mWindowTitle[0] = strlen(title); /* Flawfinder: ignore */ | 264 | mWindowTitle[0] = title.length(); |
294 | 265 | ||
295 | mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler); | 266 | mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler); |
267 | mMoveEventCampartorUPP = NewEventComparatorUPP(staticMoveEventComparator); | ||
296 | mGlobalHandlerRef = NULL; | 268 | mGlobalHandlerRef = NULL; |
297 | mWindowHandlerRef = NULL; | 269 | mWindowHandlerRef = NULL; |
298 | 270 | ||
@@ -467,8 +439,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
467 | mFullscreenBits = -1; | 439 | mFullscreenBits = -1; |
468 | mFullscreenRefresh = -1; | 440 | mFullscreenRefresh = -1; |
469 | 441 | ||
470 | char error[256]; /* Flawfinder: ignore */ | 442 | std::string error= llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); |
471 | snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); | ||
472 | OSMessageBox(error, "Error", OSMB_OK); | 443 | OSMessageBox(error, "Error", OSMB_OK); |
473 | } | 444 | } |
474 | } | 445 | } |
@@ -809,7 +780,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
809 | aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); | 780 | aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); |
810 | 781 | ||
811 | //enable multi-threaded OpenGL | 782 | //enable multi-threaded OpenGL |
812 | if (gSavedSettings.getBOOL("RenderAppleUseMultGL")) | 783 | if (sUseMultGL) |
813 | { | 784 | { |
814 | CGLError cgl_err; | 785 | CGLError cgl_err; |
815 | CGLContextObj ctx = CGLGetCurrentContext(); | 786 | CGLContextObj ctx = CGLGetCurrentContext(); |
@@ -826,9 +797,6 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
826 | } | 797 | } |
827 | } | 798 | } |
828 | 799 | ||
829 | //make sure multisample starts off disabled | ||
830 | glDisable(GL_MULTISAMPLE_ARB); | ||
831 | |||
832 | // Don't need to get the current gamma, since there's a call that restores it to the system defaults. | 800 | // Don't need to get the current gamma, since there's a call that restores it to the system defaults. |
833 | return TRUE; | 801 | return TRUE; |
834 | } | 802 | } |
@@ -1445,6 +1413,11 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) | |||
1445 | // Under certain circumstances, this will trigger us to decouple the cursor. | 1413 | // Under certain circumstances, this will trigger us to decouple the cursor. |
1446 | adjustCursorDecouple(true); | 1414 | adjustCursorDecouple(true); |
1447 | 1415 | ||
1416 | // trigger mouse move callback | ||
1417 | LLCoordGL gl_pos; | ||
1418 | convertCoords(position, &gl_pos); | ||
1419 | mCallbacks->handleMouseMove(this, gl_pos, (MASK)0); | ||
1420 | |||
1448 | return result; | 1421 | return result; |
1449 | } | 1422 | } |
1450 | 1423 | ||
@@ -1515,6 +1488,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse) | |||
1515 | // llinfos << "adjustCursorDecouple: decoupling cursor" << llendl; | 1488 | // llinfos << "adjustCursorDecouple: decoupling cursor" << llendl; |
1516 | CGAssociateMouseAndMouseCursorPosition(false); | 1489 | CGAssociateMouseAndMouseCursorPosition(false); |
1517 | mCursorDecoupled = true; | 1490 | mCursorDecoupled = true; |
1491 | FlushSpecificEventsFromQueue(GetCurrentEventQueue(), mMoveEventCampartorUPP, NULL); | ||
1518 | mCursorIgnoreNextDelta = TRUE; | 1492 | mCursorIgnoreNextDelta = TRUE; |
1519 | } | 1493 | } |
1520 | } | 1494 | } |
@@ -1610,11 +1584,6 @@ void LLWindowMacOSX::afterDialog() | |||
1610 | } | 1584 | } |
1611 | 1585 | ||
1612 | 1586 | ||
1613 | S32 LLWindowMacOSX::stat(const char* file_name, struct stat* stat_info) | ||
1614 | { | ||
1615 | return ::stat( file_name, stat_info ); | ||
1616 | } | ||
1617 | |||
1618 | void LLWindowMacOSX::flashIcon(F32 seconds) | 1587 | void LLWindowMacOSX::flashIcon(F32 seconds) |
1619 | { | 1588 | { |
1620 | // Don't do this if we're already started, since this would try to install the NMRec twice. | 1589 | // Don't do this if we're already started, since this would try to install the NMRec twice. |
@@ -1744,15 +1713,6 @@ BOOL LLWindowMacOSX::copyTextToClipboard(const LLWString &s) | |||
1744 | } | 1713 | } |
1745 | 1714 | ||
1746 | 1715 | ||
1747 | BOOL LLWindowMacOSX::sendEmail(const char* address, const char* subject, const char* body_text, | ||
1748 | const char* attachment, const char* attachment_displayed_name ) | ||
1749 | { | ||
1750 | // MBW -- XXX -- Um... yeah. I'll get to this later. | ||
1751 | |||
1752 | return false; | ||
1753 | } | ||
1754 | |||
1755 | |||
1756 | // protected | 1716 | // protected |
1757 | BOOL LLWindowMacOSX::resetDisplayResolution() | 1717 | BOOL LLWindowMacOSX::resetDisplayResolution() |
1758 | { | 1718 | { |
@@ -1949,13 +1909,30 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordScreen *to) | |||
1949 | 1909 | ||
1950 | 1910 | ||
1951 | 1911 | ||
1952 | void LLWindowMacOSX::setupFailure(const char* text, const char* caption, U32 type) | 1912 | void LLWindowMacOSX::setupFailure(const std::string& text, const std::string& caption, U32 type) |
1953 | { | 1913 | { |
1954 | destroyContext(); | 1914 | destroyContext(); |
1955 | 1915 | ||
1956 | OSMessageBox(text, caption, type); | 1916 | OSMessageBox(text, caption, type); |
1957 | } | 1917 | } |
1958 | 1918 | ||
1919 | pascal Boolean LLWindowMacOSX::staticMoveEventComparator( EventRef event, void* data) | ||
1920 | { | ||
1921 | UInt32 evtClass = GetEventClass (event); | ||
1922 | UInt32 evtKind = GetEventKind (event); | ||
1923 | |||
1924 | if ((evtClass == kEventClassMouse) && ((evtKind == kEventMouseDragged) || (evtKind == kEventMouseMoved))) | ||
1925 | { | ||
1926 | return true; | ||
1927 | } | ||
1928 | |||
1929 | else | ||
1930 | { | ||
1931 | return false; | ||
1932 | } | ||
1933 | } | ||
1934 | |||
1935 | |||
1959 | pascal OSStatus LLWindowMacOSX::staticEventHandler(EventHandlerCallRef myHandler, EventRef event, void* userData) | 1936 | pascal OSStatus LLWindowMacOSX::staticEventHandler(EventHandlerCallRef myHandler, EventRef event, void* userData) |
1960 | { | 1937 | { |
1961 | LLWindowMacOSX *self = (LLWindowMacOSX*)userData; | 1938 | LLWindowMacOSX *self = (LLWindowMacOSX*)userData; |
@@ -3020,20 +2997,13 @@ void LLSplashScreenMacOSX::showImpl() | |||
3020 | #endif | 2997 | #endif |
3021 | } | 2998 | } |
3022 | 2999 | ||
3023 | void LLSplashScreenMacOSX::updateImpl(const char* mesg) | 3000 | void LLSplashScreenMacOSX::updateImpl(const std::string& mesg) |
3024 | { | 3001 | { |
3025 | if(mWindow != NULL) | 3002 | if(mWindow != NULL) |
3026 | { | 3003 | { |
3027 | CFStringRef string = NULL; | 3004 | CFStringRef string = NULL; |
3028 | 3005 | ||
3029 | if(mesg != NULL) | 3006 | string = CFStringCreateWithCString(NULL, mesg.c_str(), kCFStringEncodingUTF8); |
3030 | { | ||
3031 | string = CFStringCreateWithCString(NULL, mesg, kCFStringEncodingUTF8); | ||
3032 | } | ||
3033 | else | ||
3034 | { | ||
3035 | string = CFStringCreateWithCString(NULL, "", kCFStringEncodingUTF8); | ||
3036 | } | ||
3037 | 3007 | ||
3038 | if(string != NULL) | 3008 | if(string != NULL) |
3039 | { | 3009 | { |
@@ -3068,7 +3038,7 @@ void LLSplashScreenMacOSX::hideImpl() | |||
3068 | 3038 | ||
3069 | 3039 | ||
3070 | 3040 | ||
3071 | S32 OSMessageBoxMacOSX(const char* text, const char* caption, U32 type) | 3041 | S32 OSMessageBoxMacOSX(const std::string& text, const std::string& caption, U32 type) |
3072 | { | 3042 | { |
3073 | S32 result = OSBTN_CANCEL; | 3043 | S32 result = OSBTN_CANCEL; |
3074 | SInt16 retval_mac = 1; | 3044 | SInt16 retval_mac = 1; |
@@ -3079,23 +3049,8 @@ S32 OSMessageBoxMacOSX(const char* text, const char* caption, U32 type) | |||
3079 | AlertType alertType = kAlertCautionAlert; | 3049 | AlertType alertType = kAlertCautionAlert; |
3080 | OSStatus err; | 3050 | OSStatus err; |
3081 | 3051 | ||
3082 | if(text != NULL) | 3052 | explanationString = CFStringCreateWithCString(NULL, text.c_str(), kCFStringEncodingUTF8); |
3083 | { | 3053 | errorString = CFStringCreateWithCString(NULL, caption.c_str(), kCFStringEncodingUTF8); |
3084 | explanationString = CFStringCreateWithCString(NULL, text, kCFStringEncodingUTF8); | ||
3085 | } | ||
3086 | else | ||
3087 | { | ||
3088 | explanationString = CFStringCreateWithCString(NULL, "", kCFStringEncodingUTF8); | ||
3089 | } | ||
3090 | |||
3091 | if(caption != NULL) | ||
3092 | { | ||
3093 | errorString = CFStringCreateWithCString(NULL, caption, kCFStringEncodingUTF8); | ||
3094 | } | ||
3095 | else | ||
3096 | { | ||
3097 | errorString = CFStringCreateWithCString(NULL, "", kCFStringEncodingUTF8); | ||
3098 | } | ||
3099 | 3054 | ||
3100 | params.version = kStdCFStringAlertVersionOne; | 3055 | params.version = kStdCFStringAlertVersionOne; |
3101 | params.movable = false; | 3056 | params.movable = false; |
@@ -3179,15 +3134,13 @@ S32 OSMessageBoxMacOSX(const char* text, const char* caption, U32 type) | |||
3179 | 3134 | ||
3180 | // Open a URL with the user's default web browser. | 3135 | // Open a URL with the user's default web browser. |
3181 | // Must begin with protocol identifier. | 3136 | // Must begin with protocol identifier. |
3182 | void spawn_web_browser(const char* escaped_url) | 3137 | void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url) |
3183 | { | 3138 | { |
3184 | bool found = false; | 3139 | bool found = false; |
3185 | S32 i; | 3140 | S32 i; |
3186 | for (i = 0; i < gURLProtocolWhitelistCount; i++) | 3141 | for (i = 0; i < gURLProtocolWhitelistCount; i++) |
3187 | { | 3142 | { |
3188 | S32 len = strlen(gURLProtocolWhitelist[i]); /* Flawfinder: ignore */ | 3143 | if (escaped_url.find(gURLProtocolWhitelist[i]) != std::string::npos) |
3189 | if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len) | ||
3190 | && escaped_url[len] == ':') | ||
3191 | { | 3144 | { |
3192 | found = true; | 3145 | found = true; |
3193 | break; | 3146 | break; |
@@ -3196,7 +3149,7 @@ void spawn_web_browser(const char* escaped_url) | |||
3196 | 3149 | ||
3197 | if (!found) | 3150 | if (!found) |
3198 | { | 3151 | { |
3199 | llwarns << "spawn_web_browser() called for url with protocol not on whitelist: " << escaped_url << llendl; | 3152 | llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl; |
3200 | return; | 3153 | return; |
3201 | } | 3154 | } |
3202 | 3155 | ||
@@ -3205,7 +3158,7 @@ void spawn_web_browser(const char* escaped_url) | |||
3205 | 3158 | ||
3206 | llinfos << "Opening URL " << escaped_url << llendl; | 3159 | llinfos << "Opening URL " << escaped_url << llendl; |
3207 | 3160 | ||
3208 | CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url, kCFStringEncodingUTF8); | 3161 | CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8); |
3209 | if (stringRef) | 3162 | if (stringRef) |
3210 | { | 3163 | { |
3211 | // This will succeed if the string is a full URL, including the http:// | 3164 | // This will succeed if the string is a full URL, including the http:// |
@@ -3268,25 +3221,34 @@ BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b) | |||
3268 | return (retval); | 3221 | return (retval); |
3269 | } | 3222 | } |
3270 | 3223 | ||
3271 | static WindowRef dummywindowref = NULL; | ||
3272 | 3224 | ||
3273 | void *LLWindowMacOSX::getPlatformWindow() | 3225 | void *LLWindowMacOSX::getPlatformWindow() |
3274 | { | 3226 | { |
3275 | if(mWindow != NULL) | 3227 | // NOTE: this will be NULL in fullscreen mode. Plan accordingly. |
3276 | return (void*)mWindow; | 3228 | return (void*)mWindow; |
3229 | } | ||
3230 | |||
3231 | void *LLWindowMacOSX::getMediaWindow() | ||
3232 | { | ||
3233 | /* | ||
3234 | Mozilla needs to be initialized with a WindowRef to function properly. | ||
3235 | (There's no good reason for this, since it shouldn't be interacting with our window in any way, but that's another issue.) | ||
3236 | If we're in windowed mode, we _could_ hand it our actual window pointer, but a subsequent switch to fullscreen will destroy that window, | ||
3237 | which trips up Mozilla. | ||
3238 | Instead of using our actual window, we create an invisible window which will persist for the lifetime of the application and pass that to Mozilla. | ||
3239 | This satisfies its deep-seated need to latch onto a WindowRef and solves the issue with switching between fullscreen and windowed modes. | ||
3277 | 3240 | ||
3278 | // If we're in fullscreen mode, there's no window pointer available. | 3241 | Note that we will never destroy this window (by design!), but since only one will ever be created per run of the application, that's okay. |
3279 | // Since Mozilla needs one to function, create a dummy window here. | 3242 | */ |
3280 | // Note that we will never destroy it, but since only one will be created per run of the application, that's okay. | ||
3281 | 3243 | ||
3282 | if(dummywindowref == NULL) | 3244 | if(sMediaWindow == NULL) |
3283 | { | 3245 | { |
3284 | Rect window_rect = {100, 100, 200, 200}; | 3246 | Rect window_rect = {100, 100, 200, 200}; |
3285 | 3247 | ||
3286 | dummywindowref = NewCWindow( | 3248 | sMediaWindow = NewCWindow( |
3287 | NULL, | 3249 | NULL, |
3288 | &window_rect, | 3250 | &window_rect, |
3289 | "\p", | 3251 | (ConstStr255Param) "\p", |
3290 | false, // Create the window invisible. | 3252 | false, // Create the window invisible. |
3291 | zoomDocProc, // Window with a grow box and a zoom box | 3253 | zoomDocProc, // Window with a grow box and a zoom box |
3292 | kLastWindowOfClass, // create it behind other windows | 3254 | kLastWindowOfClass, // create it behind other windows |
@@ -3294,7 +3256,7 @@ void *LLWindowMacOSX::getPlatformWindow() | |||
3294 | 0); | 3256 | 0); |
3295 | } | 3257 | } |
3296 | 3258 | ||
3297 | return (void*)dummywindowref; | 3259 | return (void*)sMediaWindow; |
3298 | } | 3260 | } |
3299 | 3261 | ||
3300 | void LLWindowMacOSX::stopDockTileBounce() | 3262 | void LLWindowMacOSX::stopDockTileBounce() |
@@ -3402,5 +3364,3 @@ std::string LLWindowMacOSX::getFontListSans() | |||
3402 | // The third filename is in UTF8, but it shows up in the font menu as "STHeiti Light" | 3364 | // The third filename is in UTF8, but it shows up in the font menu as "STHeiti Light" |
3403 | return "\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 Pro W3.otf;\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 ProN W3.otf;AppleGothic.dfont;AppleGothic.ttf;\xe5\x8d\x8e\xe6\x96\x87\xe7\xbb\x86\xe9\xbb\x91.ttf"; | 3365 | return "\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 Pro W3.otf;\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 ProN W3.otf;AppleGothic.dfont;AppleGothic.ttf;\xe5\x8d\x8e\xe6\x96\x87\xe7\xbb\x86\xe9\xbb\x91.ttf"; |
3404 | } | 3366 | } |
3405 | |||
3406 | #endif // LL_DARWIN | ||
diff --git a/linden/indra/llwindow/llwindowmacosx.h b/linden/indra/llwindow/llwindowmacosx.h index d8a0788..bc0b7d4 100644 --- a/linden/indra/llwindow/llwindowmacosx.h +++ b/linden/indra/llwindow/llwindowmacosx.h | |||
@@ -86,12 +86,6 @@ public: | |||
86 | /*virtual*/ void delayInputProcessing() {}; | 86 | /*virtual*/ void delayInputProcessing() {}; |
87 | /*virtual*/ void swapBuffers(); | 87 | /*virtual*/ void swapBuffers(); |
88 | 88 | ||
89 | /*virtual*/ LLString getTempFileName(); | ||
90 | /*virtual*/ void deleteFile( const char* file_name ); | ||
91 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ); | ||
92 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL); | ||
93 | |||
94 | |||
95 | // handy coordinate space conversion routines | 89 | // handy coordinate space conversion routines |
96 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); | 90 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); |
97 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); | 91 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); |
@@ -111,16 +105,18 @@ public: | |||
111 | /*virtual*/ BOOL dialog_color_picker(F32 *r, F32 *g, F32 *b); | 105 | /*virtual*/ BOOL dialog_color_picker(F32 *r, F32 *g, F32 *b); |
112 | 106 | ||
113 | /*virtual*/ void *getPlatformWindow(); | 107 | /*virtual*/ void *getPlatformWindow(); |
108 | /*virtual*/ void *getMediaWindow(); | ||
114 | /*virtual*/ void bringToFront() {}; | 109 | /*virtual*/ void bringToFront() {}; |
115 | 110 | ||
116 | /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); | 111 | /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); |
117 | /*virtual*/ void interruptLanguageTextInput(); | 112 | /*virtual*/ void interruptLanguageTextInput(); |
113 | /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); | ||
118 | 114 | ||
119 | static std::string getFontListSans(); | 115 | static std::string getFontListSans(); |
120 | 116 | ||
121 | protected: | 117 | protected: |
122 | LLWindowMacOSX( | 118 | LLWindowMacOSX( |
123 | char *title, char *name, int x, int y, int width, int height, U32 flags, | 119 | const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, |
124 | BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, | 120 | BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, |
125 | BOOL ignore_pixel_depth, | 121 | BOOL ignore_pixel_depth, |
126 | U32 fsaa_samples); | 122 | U32 fsaa_samples); |
@@ -154,8 +150,9 @@ protected: | |||
154 | // create or re-create the GL context/window. Called from the constructor and switchContext(). | 150 | // create or re-create the GL context/window. Called from the constructor and switchContext(). |
155 | BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync); | 151 | BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync); |
156 | void destroyContext(); | 152 | void destroyContext(); |
157 | void setupFailure(const char* text, const char* caption, U32 type); | 153 | void setupFailure(const std::string& text, const std::string& caption, U32 type); |
158 | static pascal OSStatus staticEventHandler (EventHandlerCallRef myHandler, EventRef event, void* userData); | 154 | static pascal OSStatus staticEventHandler (EventHandlerCallRef myHandler, EventRef event, void* userData); |
155 | static pascal Boolean staticMoveEventComparator( EventRef event, void* data); | ||
159 | OSStatus eventHandler (EventHandlerCallRef myHandler, EventRef event); | 156 | OSStatus eventHandler (EventHandlerCallRef myHandler, EventRef event); |
160 | void adjustCursorDecouple(bool warpingMouse = false); | 157 | void adjustCursorDecouple(bool warpingMouse = false); |
161 | void fixWindowSize(void); | 158 | void fixWindowSize(void); |
@@ -174,6 +171,8 @@ protected: | |||
174 | EventHandlerUPP mEventHandlerUPP; | 171 | EventHandlerUPP mEventHandlerUPP; |
175 | EventHandlerRef mGlobalHandlerRef; | 172 | EventHandlerRef mGlobalHandlerRef; |
176 | EventHandlerRef mWindowHandlerRef; | 173 | EventHandlerRef mWindowHandlerRef; |
174 | EventComparatorUPP mMoveEventCampartorUPP; | ||
175 | |||
177 | Rect mOldMouseClip; // Screen rect to which the mouse cursor was globally constrained before we changed it in clipMouse() | 176 | Rect mOldMouseClip; // Screen rect to which the mouse cursor was globally constrained before we changed it in clipMouse() |
178 | Str255 mWindowTitle; | 177 | Str255 mWindowTitle; |
179 | double mOriginalAspectRatio; | 178 | double mOriginalAspectRatio; |
@@ -203,7 +202,11 @@ protected: | |||
203 | LangCode mTSMLangCode; | 202 | LangCode mTSMLangCode; |
204 | LLPreeditor* mPreeditor; | 203 | LLPreeditor* mPreeditor; |
205 | 204 | ||
205 | static BOOL sUseMultGL; | ||
206 | |||
206 | friend class LLWindowManager; | 207 | friend class LLWindowManager; |
208 | static WindowRef sMediaWindow; | ||
209 | |||
207 | }; | 210 | }; |
208 | 211 | ||
209 | 212 | ||
@@ -214,14 +217,14 @@ public: | |||
214 | virtual ~LLSplashScreenMacOSX(); | 217 | virtual ~LLSplashScreenMacOSX(); |
215 | 218 | ||
216 | /*virtual*/ void showImpl(); | 219 | /*virtual*/ void showImpl(); |
217 | /*virtual*/ void updateImpl(const char* mesg); | 220 | /*virtual*/ void updateImpl(const std::string& mesg); |
218 | /*virtual*/ void hideImpl(); | 221 | /*virtual*/ void hideImpl(); |
219 | 222 | ||
220 | private: | 223 | private: |
221 | WindowRef mWindow; | 224 | WindowRef mWindow; |
222 | }; | 225 | }; |
223 | 226 | ||
224 | S32 OSMessageBoxMacOSX(const char* text, const char* caption, U32 type); | 227 | S32 OSMessageBoxMacOSX(const std::string& text, const std::string& caption, U32 type); |
225 | 228 | ||
226 | void load_url_external(const char* url); | 229 | void load_url_external(const char* url); |
227 | 230 | ||
diff --git a/linden/indra/llwindow/llwindowmesaheadless.cpp b/linden/indra/llwindow/llwindowmesaheadless.cpp index 01b00af..0ffd4e3 100644 --- a/linden/indra/llwindow/llwindowmesaheadless.cpp +++ b/linden/indra/llwindow/llwindowmesaheadless.cpp | |||
@@ -29,14 +29,11 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if LL_MESA_HEADLESS | ||
33 | |||
34 | #include "linden_common.h" | 32 | #include "linden_common.h" |
35 | #include "indra_constants.h" | 33 | #include "indra_constants.h" |
36 | 34 | ||
37 | #include "llwindowmesaheadless.h" | 35 | #include "llwindowmesaheadless.h" |
38 | #include "llgl.h" | 36 | #include "llgl.h" |
39 | #include "llglheaders.h" | ||
40 | 37 | ||
41 | #define MESA_CHANNEL_TYPE GL_UNSIGNED_SHORT | 38 | #define MESA_CHANNEL_TYPE GL_UNSIGNED_SHORT |
42 | #define MESA_CHANNEL_SIZE 2 | 39 | #define MESA_CHANNEL_SIZE 2 |
@@ -46,7 +43,7 @@ U16 *gMesaBuffer = NULL; | |||
46 | // | 43 | // |
47 | // LLWindowMesaHeadless | 44 | // LLWindowMesaHeadless |
48 | // | 45 | // |
49 | LLWindowMesaHeadless::LLWindowMesaHeadless(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | 46 | LLWindowMesaHeadless::LLWindowMesaHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, |
50 | U32 flags, BOOL fullscreen, BOOL clearBg, | 47 | U32 flags, BOOL fullscreen, BOOL clearBg, |
51 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) | 48 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) |
52 | : LLWindow(fullscreen, flags) | 49 | : LLWindow(fullscreen, flags) |
@@ -83,5 +80,3 @@ void LLWindowMesaHeadless::swapBuffers() | |||
83 | { | 80 | { |
84 | glFinish(); | 81 | glFinish(); |
85 | } | 82 | } |
86 | |||
87 | #endif | ||
diff --git a/linden/indra/llwindow/llwindowmesaheadless.h b/linden/indra/llwindow/llwindowmesaheadless.h index fb32e38..86d8372 100644 --- a/linden/indra/llwindow/llwindowmesaheadless.h +++ b/linden/indra/llwindow/llwindowmesaheadless.h | |||
@@ -81,12 +81,6 @@ public: | |||
81 | /*virtual*/ void delayInputProcessing() {}; | 81 | /*virtual*/ void delayInputProcessing() {}; |
82 | /*virtual*/ void swapBuffers(); | 82 | /*virtual*/ void swapBuffers(); |
83 | 83 | ||
84 | /*virtual*/ LLString getTempFileName() {return LLString(""); }; | ||
85 | /*virtual*/ void deleteFile( const char* file_name ) {}; | ||
86 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ) {return 0; }; | ||
87 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL) { return FALSE; }; | ||
88 | |||
89 | |||
90 | // handy coordinate space conversion routines | 84 | // handy coordinate space conversion routines |
91 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; | 85 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; |
92 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; | 86 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; |
@@ -103,7 +97,7 @@ public: | |||
103 | /*virtual*/ void *getPlatformWindow() { return 0; }; | 97 | /*virtual*/ void *getPlatformWindow() { return 0; }; |
104 | /*virtual*/ void bringToFront() {}; | 98 | /*virtual*/ void bringToFront() {}; |
105 | 99 | ||
106 | LLWindowMesaHeadless(char *title, char *name, S32 x, S32 y, S32 width, S32 height, | 100 | LLWindowMesaHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, |
107 | U32 flags, BOOL fullscreen, BOOL clearBg, | 101 | U32 flags, BOOL fullscreen, BOOL clearBg, |
108 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); | 102 | BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); |
109 | ~LLWindowMesaHeadless(); | 103 | ~LLWindowMesaHeadless(); |
@@ -120,7 +114,7 @@ public: | |||
120 | virtual ~LLSplashScreenMesaHeadless() {}; | 114 | virtual ~LLSplashScreenMesaHeadless() {}; |
121 | 115 | ||
122 | /*virtual*/ void showImpl() {}; | 116 | /*virtual*/ void showImpl() {}; |
123 | /*virtual*/ void updateImpl(const char* mesg) {}; | 117 | /*virtual*/ void updateImpl(const std::string& mesg) {}; |
124 | /*virtual*/ void hideImpl() {}; | 118 | /*virtual*/ void hideImpl() {}; |
125 | 119 | ||
126 | }; | 120 | }; |
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index 0d1d622..e5d15c4 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp | |||
@@ -41,8 +41,6 @@ | |||
41 | #include "lldir.h" | 41 | #include "lldir.h" |
42 | #include "llfindlocale.h" | 42 | #include "llfindlocale.h" |
43 | 43 | ||
44 | #include "llglheaders.h" | ||
45 | |||
46 | #include "indra_constants.h" | 44 | #include "indra_constants.h" |
47 | 45 | ||
48 | #if LL_GTK | 46 | #if LL_GTK |
@@ -66,7 +64,10 @@ extern "C" { | |||
66 | 64 | ||
67 | extern BOOL gDebugWindowProc; | 65 | extern BOOL gDebugWindowProc; |
68 | 66 | ||
69 | const S32 MAX_NUM_RESOLUTIONS = 32; | 67 | const S32 MAX_NUM_RESOLUTIONS = 200; |
68 | |||
69 | // static variable for ATI mouse cursor crash work-around: | ||
70 | static bool ATIbug = false; | ||
70 | 71 | ||
71 | // | 72 | // |
72 | // LLWindowSDL | 73 | // LLWindowSDL |
@@ -183,43 +184,7 @@ Display* get_SDL_Display(void) | |||
183 | #endif // LL_X11 | 184 | #endif // LL_X11 |
184 | 185 | ||
185 | 186 | ||
186 | BOOL check_for_card(const char* RENDERER, const char* bad_card) | 187 | LLWindowSDL::LLWindowSDL(const std::string& title, S32 x, S32 y, S32 width, |
187 | { | ||
188 | if (!strncasecmp(RENDERER, bad_card, strlen(bad_card))) | ||
189 | { | ||
190 | char buffer[1024]; /* Flawfinder: ignore */ | ||
191 | snprintf(buffer, sizeof(buffer), | ||
192 | "Your video card appears to be a %s, which Second Life does not support.\n" | ||
193 | "\n" | ||
194 | "Second Life requires a video card with 32 Mb of memory or more, as well as\n" | ||
195 | "multitexture support. We explicitly support nVidia GeForce 2 or better, \n" | ||
196 | "and ATI Radeon 8500 or better.\n" | ||
197 | "\n" | ||
198 | "If you own a supported card and continue to receive this message, try \n" | ||
199 | "updating to the latest video card drivers. Otherwise look in the\n" | ||
200 | "secondlife.com support section or e-mail technical support\n" | ||
201 | "\n" | ||
202 | "You can try to run Second Life, but it will probably crash or run\n" | ||
203 | "very slowly. Try anyway?", | ||
204 | bad_card); | ||
205 | S32 button = OSMessageBox(buffer, "Unsupported video card", OSMB_YESNO); | ||
206 | if (OSBTN_YES == button) | ||
207 | { | ||
208 | return FALSE; | ||
209 | } | ||
210 | else | ||
211 | { | ||
212 | return TRUE; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | return FALSE; | ||
217 | } | ||
218 | |||
219 | |||
220 | |||
221 | |||
222 | LLWindowSDL::LLWindowSDL(char *title, S32 x, S32 y, S32 width, | ||
223 | S32 height, U32 flags, | 188 | S32 height, U32 flags, |
224 | BOOL fullscreen, BOOL clearBg, | 189 | BOOL fullscreen, BOOL clearBg, |
225 | BOOL disable_vsync, BOOL use_gl, | 190 | BOOL disable_vsync, BOOL use_gl, |
@@ -260,18 +225,11 @@ LLWindowSDL::LLWindowSDL(char *title, S32 x, S32 y, S32 width, | |||
260 | // Get the original aspect ratio of the main device. | 225 | // Get the original aspect ratio of the main device. |
261 | mOriginalAspectRatio = 1024.0 / 768.0; // !!! *FIX: ? //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); | 226 | mOriginalAspectRatio = 1024.0 / 768.0; // !!! *FIX: ? //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); |
262 | 227 | ||
263 | if (!title) | 228 | if (title.empty()) |
264 | title = "SDL Window"; // *FIX: (???) | 229 | mWindowTitle = "SDL Window"; // *FIX: (???) |
265 | 230 | else | |
266 | // Stash the window title | 231 | mWindowTitle = title; |
267 | mWindowTitle = new char[strlen(title) + 1]; /* Flawfinder: ignore */ | ||
268 | if(mWindowTitle == NULL) | ||
269 | { | ||
270 | llwarns << "Memory allocation failure" << llendl; | ||
271 | return; | ||
272 | } | ||
273 | 232 | ||
274 | strcpy(mWindowTitle, title); /* Flawfinder: ignore */ | ||
275 | // Create the GL context and set it up for windowed or fullscreen, as appropriate. | 233 | // Create the GL context and set it up for windowed or fullscreen, as appropriate. |
276 | if(createContext(x, y, width, height, 32, fullscreen, disable_vsync)) | 234 | if(createContext(x, y, width, height, 32, fullscreen, disable_vsync)) |
277 | { | 235 | { |
@@ -485,7 +443,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B | |||
485 | } | 443 | } |
486 | 444 | ||
487 | SDL_EnableUNICODE(1); | 445 | SDL_EnableUNICODE(1); |
488 | SDL_WM_SetCaption(mWindowTitle, mWindowTitle); | 446 | SDL_WM_SetCaption(mWindowTitle.c_str(), mWindowTitle.c_str()); |
489 | 447 | ||
490 | // Set the application icon. | 448 | // Set the application icon. |
491 | SDL_Surface *bmpsurface; | 449 | SDL_Surface *bmpsurface; |
@@ -635,8 +593,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B | |||
635 | mFullscreenBits = -1; | 593 | mFullscreenBits = -1; |
636 | mFullscreenRefresh = -1; | 594 | mFullscreenRefresh = -1; |
637 | 595 | ||
638 | char error[256]; /* Flawfinder: ignore */ | 596 | std::string error = llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); |
639 | snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); | ||
640 | OSMessageBox(error, "Error", OSMB_OK); | 597 | OSMessageBox(error, "Error", OSMB_OK); |
641 | } | 598 | } |
642 | } | 599 | } |
@@ -826,8 +783,6 @@ LLWindowSDL::~LLWindowSDL() | |||
826 | delete []mSupportedResolutions; | 783 | delete []mSupportedResolutions; |
827 | } | 784 | } |
828 | 785 | ||
829 | delete[] mWindowTitle; | ||
830 | |||
831 | gWindowImplementation = NULL; | 786 | gWindowImplementation = NULL; |
832 | } | 787 | } |
833 | 788 | ||
@@ -1208,11 +1163,6 @@ void LLWindowSDL::afterDialog() | |||
1208 | } | 1163 | } |
1209 | 1164 | ||
1210 | 1165 | ||
1211 | S32 LLWindowSDL::stat(const char* file_name, struct stat* stat_info) | ||
1212 | { | ||
1213 | return ::stat( file_name, stat_info ); | ||
1214 | } | ||
1215 | |||
1216 | #if LL_X11 | 1166 | #if LL_X11 |
1217 | // set/reset the XWMHints flag for 'urgency' that usually makes the icon flash | 1167 | // set/reset the XWMHints flag for 'urgency' that usually makes the icon flash |
1218 | void LLWindowSDL::x11_set_urgent(BOOL urgent) | 1168 | void LLWindowSDL::x11_set_urgent(BOOL urgent) |
@@ -1777,15 +1727,6 @@ BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s) | |||
1777 | } | 1727 | } |
1778 | #endif // LL_X11 | 1728 | #endif // LL_X11 |
1779 | 1729 | ||
1780 | BOOL LLWindowSDL::sendEmail(const char* address, const char* subject, const char* body_text, | ||
1781 | const char* attachment, const char* attachment_displayed_name ) | ||
1782 | { | ||
1783 | // MBW -- XXX -- Um... yeah. I'll get to this later. | ||
1784 | |||
1785 | return FALSE; | ||
1786 | } | ||
1787 | |||
1788 | |||
1789 | LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions) | 1730 | LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions) |
1790 | { | 1731 | { |
1791 | if (!mSupportedResolutions) | 1732 | if (!mSupportedResolutions) |
@@ -1797,7 +1738,7 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso | |||
1797 | if ( (modes != NULL) && (modes != ((SDL_Rect **) -1)) ) | 1738 | if ( (modes != NULL) && (modes != ((SDL_Rect **) -1)) ) |
1798 | { | 1739 | { |
1799 | int count = 0; | 1740 | int count = 0; |
1800 | while (*modes) // they're sorted biggest to smallest, so find end... | 1741 | while (*modes && count<MAX_NUM_RESOLUTIONS) // they're sorted biggest to smallest, so find end... |
1801 | { | 1742 | { |
1802 | modes++; | 1743 | modes++; |
1803 | count++; | 1744 | count++; |
@@ -1890,7 +1831,7 @@ BOOL LLWindowSDL::convertCoords(LLCoordGL from, LLCoordScreen *to) | |||
1890 | 1831 | ||
1891 | 1832 | ||
1892 | 1833 | ||
1893 | void LLWindowSDL::setupFailure(const char* text, const char* caption, U32 type) | 1834 | void LLWindowSDL::setupFailure(const std::string& text, const std::string& caption, U32 type) |
1894 | { | 1835 | { |
1895 | destroyContext(); | 1836 | destroyContext(); |
1896 | 1837 | ||
@@ -2337,6 +2278,12 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty | |||
2337 | 2278 | ||
2338 | void LLWindowSDL::setCursor(ECursorType cursor) | 2279 | void LLWindowSDL::setCursor(ECursorType cursor) |
2339 | { | 2280 | { |
2281 | if (ATIbug) { | ||
2282 | // cursor-updating is very flaky when this bug is | ||
2283 | // present; do nothing. | ||
2284 | return; | ||
2285 | } | ||
2286 | |||
2340 | if (mCurrentCursor != cursor) | 2287 | if (mCurrentCursor != cursor) |
2341 | { | 2288 | { |
2342 | if (cursor < UI_CURSOR_COUNT) | 2289 | if (cursor < UI_CURSOR_COUNT) |
@@ -2409,6 +2356,11 @@ void LLWindowSDL::initCursors() | |||
2409 | mSDLCursors[UI_CURSOR_TOOLPAUSE] = makeSDLCursorFromBMP("toolpause.BMP",0,0); | 2356 | mSDLCursors[UI_CURSOR_TOOLPAUSE] = makeSDLCursorFromBMP("toolpause.BMP",0,0); |
2410 | mSDLCursors[UI_CURSOR_TOOLMEDIAOPEN] = makeSDLCursorFromBMP("toolmediaopen.BMP",0,0); | 2357 | mSDLCursors[UI_CURSOR_TOOLMEDIAOPEN] = makeSDLCursorFromBMP("toolmediaopen.BMP",0,0); |
2411 | mSDLCursors[UI_CURSOR_PIPETTE] = makeSDLCursorFromBMP("lltoolpipette.BMP",2,28); | 2358 | mSDLCursors[UI_CURSOR_PIPETTE] = makeSDLCursorFromBMP("lltoolpipette.BMP",2,28); |
2359 | |||
2360 | if (getenv("LL_ATI_MOUSE_CURSOR_BUG") != NULL) { | ||
2361 | llinfos << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << llendl; | ||
2362 | ATIbug = true; | ||
2363 | } | ||
2412 | } | 2364 | } |
2413 | 2365 | ||
2414 | void LLWindowSDL::quitCursors() | 2366 | void LLWindowSDL::quitCursors() |
@@ -2520,7 +2472,7 @@ void LLSplashScreenSDL::showImpl() | |||
2520 | { | 2472 | { |
2521 | } | 2473 | } |
2522 | 2474 | ||
2523 | void LLSplashScreenSDL::updateImpl(const char* mesg) | 2475 | void LLSplashScreenSDL::updateImpl(const std::string& mesg) |
2524 | { | 2476 | { |
2525 | } | 2477 | } |
2526 | 2478 | ||
@@ -2541,7 +2493,7 @@ static void response_callback (GtkDialog *dialog, | |||
2541 | gtk_main_quit(); | 2493 | gtk_main_quit(); |
2542 | } | 2494 | } |
2543 | 2495 | ||
2544 | S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | 2496 | S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type) |
2545 | { | 2497 | { |
2546 | S32 rtn = OSBTN_CANCEL; | 2498 | S32 rtn = OSBTN_CANCEL; |
2547 | 2499 | ||
@@ -2578,9 +2530,7 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | |||
2578 | buttons = GTK_BUTTONS_YES_NO; | 2530 | buttons = GTK_BUTTONS_YES_NO; |
2579 | break; | 2531 | break; |
2580 | } | 2532 | } |
2581 | win = gtk_message_dialog_new(NULL, | 2533 | win = gtk_message_dialog_new(NULL,flags, messagetype, buttons, text.c_str()); |
2582 | flags, messagetype, buttons, | ||
2583 | text); | ||
2584 | 2534 | ||
2585 | # if LL_X11 | 2535 | # if LL_X11 |
2586 | // Make GTK tell the window manager to associate this | 2536 | // Make GTK tell the window manager to associate this |
@@ -2602,8 +2552,8 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | |||
2602 | gtk_window_set_type_hint(GTK_WINDOW(win), | 2552 | gtk_window_set_type_hint(GTK_WINDOW(win), |
2603 | GDK_WINDOW_TYPE_HINT_DIALOG); | 2553 | GDK_WINDOW_TYPE_HINT_DIALOG); |
2604 | 2554 | ||
2605 | if (caption) | 2555 | if (!caption.empty()) |
2606 | gtk_window_set_title(GTK_WINDOW(win), caption); | 2556 | gtk_window_set_title(GTK_WINDOW(win), caption.c_str()); |
2607 | 2557 | ||
2608 | gint response = GTK_RESPONSE_NONE; | 2558 | gint response = GTK_RESPONSE_NONE; |
2609 | g_signal_connect (win, | 2559 | g_signal_connect (win, |
@@ -2727,7 +2677,7 @@ BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) | |||
2727 | return rtn; | 2677 | return rtn; |
2728 | } | 2678 | } |
2729 | #else | 2679 | #else |
2730 | S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | 2680 | S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type) |
2731 | { | 2681 | { |
2732 | llinfos << "MSGBOX: " << caption << ": " << text << llendl; | 2682 | llinfos << "MSGBOX: " << caption << ": " << text << llendl; |
2733 | return 0; | 2683 | return 0; |
@@ -2739,29 +2689,12 @@ BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) | |||
2739 | } | 2689 | } |
2740 | #endif // LL_GTK | 2690 | #endif // LL_GTK |
2741 | 2691 | ||
2742 | // Open a URL with the user's default web browser. | ||
2743 | // Must begin with protocol identifier. | ||
2744 | void spawn_web_browser(const char* escaped_url) | ||
2745 | { | ||
2746 | llinfos << "spawn_web_browser: " << escaped_url << llendl; | ||
2747 | |||
2748 | #if LL_LINUX || LL_SOLARIS | 2692 | #if LL_LINUX || LL_SOLARIS |
2749 | # if LL_X11 | 2693 | // extracted from spawnWebBrowser for clarity and to eliminate |
2750 | if (gWindowImplementation && gWindowImplementation->mSDL_Display) | 2694 | // compiler confusion regarding close(int fd) vs. LLWindow::close() |
2751 | { | 2695 | void exec_cmd(const std::string& cmd, const std::string& arg) |
2752 | maybe_lock_display(); | 2696 | { |
2753 | // Just in case - before forking. | 2697 | char* const argv[] = {(char*)cmd.c_str(), (char*)arg.c_str(), NULL}; |
2754 | XSync(gWindowImplementation->mSDL_Display, False); | ||
2755 | maybe_unlock_display(); | ||
2756 | } | ||
2757 | # endif // LL_X11 | ||
2758 | |||
2759 | std::string cmd; | ||
2760 | cmd = gDirUtilp->getAppRODataDir(); | ||
2761 | cmd += gDirUtilp->getDirDelimiter(); | ||
2762 | cmd += "launch_url.sh"; | ||
2763 | char* const argv[] = {(char*)cmd.c_str(), (char*)escaped_url, NULL}; | ||
2764 | |||
2765 | fflush(NULL); | 2698 | fflush(NULL); |
2766 | pid_t pid = fork(); | 2699 | pid_t pid = fork(); |
2767 | if (pid == 0) | 2700 | if (pid == 0) |
@@ -2786,6 +2719,32 @@ void spawn_web_browser(const char* escaped_url) | |||
2786 | llwarns << "fork failure." << llendl; | 2719 | llwarns << "fork failure." << llendl; |
2787 | } | 2720 | } |
2788 | } | 2721 | } |
2722 | } | ||
2723 | #endif | ||
2724 | |||
2725 | // Open a URL with the user's default web browser. | ||
2726 | // Must begin with protocol identifier. | ||
2727 | void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url) | ||
2728 | { | ||
2729 | llinfos << "spawn_web_browser: " << escaped_url << llendl; | ||
2730 | |||
2731 | #if LL_LINUX || LL_SOLARIS | ||
2732 | # if LL_X11 | ||
2733 | if (mSDL_Display) | ||
2734 | { | ||
2735 | maybe_lock_display(); | ||
2736 | // Just in case - before forking. | ||
2737 | XSync(mSDL_Display, False); | ||
2738 | maybe_unlock_display(); | ||
2739 | } | ||
2740 | # endif // LL_X11 | ||
2741 | |||
2742 | std::string cmd, arg; | ||
2743 | cmd = gDirUtilp->getAppRODataDir().c_str(); | ||
2744 | cmd += gDirUtilp->getDirDelimiter().c_str(); | ||
2745 | cmd += "launch_url.sh"; | ||
2746 | arg = escaped_url; | ||
2747 | exec_cmd(cmd, arg); | ||
2789 | #endif // LL_LINUX || LL_SOLARIS | 2748 | #endif // LL_LINUX || LL_SOLARIS |
2790 | 2749 | ||
2791 | llinfos << "spawn_web_browser returning." << llendl; | 2750 | llinfos << "spawn_web_browser returning." << llendl; |
@@ -2871,14 +2830,18 @@ std::string LLWindowSDL::getFontListSans() | |||
2871 | { | 2830 | { |
2872 | if (success >= 2 && locale->lang) // confident! | 2831 | if (success >= 2 && locale->lang) // confident! |
2873 | { | 2832 | { |
2833 | LL_INFOS("AppInit") << "Language " << locale->lang << LL_ENDL; | ||
2834 | LL_INFOS("AppInit") << "Location " << locale->country << LL_ENDL; | ||
2835 | LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL; | ||
2836 | |||
2874 | llinfos << "Preferring fonts of language: " | 2837 | llinfos << "Preferring fonts of language: " |
2875 | << locale->lang | 2838 | << locale->lang |
2876 | << llendl; | 2839 | << llendl; |
2877 | sort_order = "lang=" + std::string(locale->lang) + ":" | 2840 | sort_order = "lang=" + std::string(locale->lang) + ":" |
2878 | + sort_order; | 2841 | + sort_order; |
2879 | } | 2842 | } |
2880 | FL_FreeLocale(&locale); | ||
2881 | } | 2843 | } |
2844 | FL_FreeLocale(&locale); | ||
2882 | 2845 | ||
2883 | if (!FcInit()) | 2846 | if (!FcInit()) |
2884 | { | 2847 | { |
diff --git a/linden/indra/llwindow/llwindowsdl.h b/linden/indra/llwindow/llwindowsdl.h index 5aed4e6..a395ccd 100644 --- a/linden/indra/llwindow/llwindowsdl.h +++ b/linden/indra/llwindow/llwindowsdl.h | |||
@@ -92,11 +92,6 @@ public: | |||
92 | /*virtual*/ void gatherInput(); | 92 | /*virtual*/ void gatherInput(); |
93 | /*virtual*/ void swapBuffers(); | 93 | /*virtual*/ void swapBuffers(); |
94 | 94 | ||
95 | /*virtual*/ LLString getTempFileName(); | ||
96 | /*virtual*/ void deleteFile( const char* file_name ); | ||
97 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ); | ||
98 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL); | ||
99 | |||
100 | /*virtual*/ void delayInputProcessing() { }; | 95 | /*virtual*/ void delayInputProcessing() { }; |
101 | 96 | ||
102 | // handy coordinate space conversion routines | 97 | // handy coordinate space conversion routines |
@@ -120,6 +115,8 @@ public: | |||
120 | /*virtual*/ void *getPlatformWindow(); | 115 | /*virtual*/ void *getPlatformWindow(); |
121 | /*virtual*/ void bringToFront(); | 116 | /*virtual*/ void bringToFront(); |
122 | 117 | ||
118 | /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); | ||
119 | |||
123 | static std::string getFontListSans(); | 120 | static std::string getFontListSans(); |
124 | 121 | ||
125 | // Not great that these are public, but they have to be accessible | 122 | // Not great that these are public, but they have to be accessible |
@@ -134,7 +131,7 @@ public: | |||
134 | 131 | ||
135 | protected: | 132 | protected: |
136 | LLWindowSDL( | 133 | LLWindowSDL( |
137 | char *title, int x, int y, int width, int height, U32 flags, | 134 | const std::string& title, int x, int y, int width, int height, U32 flags, |
138 | BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, | 135 | BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, |
139 | BOOL ignore_pixel_depth, U32 fsaa_samples); | 136 | BOOL ignore_pixel_depth, U32 fsaa_samples); |
140 | ~LLWindowSDL(); | 137 | ~LLWindowSDL(); |
@@ -164,7 +161,7 @@ protected: | |||
164 | // create or re-create the GL context/window. Called from the constructor and switchContext(). | 161 | // create or re-create the GL context/window. Called from the constructor and switchContext(). |
165 | BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync); | 162 | BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync); |
166 | void destroyContext(); | 163 | void destroyContext(); |
167 | void setupFailure(const char* text, const char* caption, U32 type); | 164 | void setupFailure(const std::string& text, const std::string& caption, U32 type); |
168 | void adjustCursorDecouple(bool warpingMouse = false); | 165 | void adjustCursorDecouple(bool warpingMouse = false); |
169 | void fixWindowSize(void); | 166 | void fixWindowSize(void); |
170 | U32 SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain); | 167 | U32 SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain); |
@@ -176,7 +173,7 @@ protected: | |||
176 | U32 mGrabbyKeyFlags; | 173 | U32 mGrabbyKeyFlags; |
177 | int mReallyCapturedCount; | 174 | int mReallyCapturedCount; |
178 | SDL_Surface * mWindow; | 175 | SDL_Surface * mWindow; |
179 | char * mWindowTitle; | 176 | std::string mWindowTitle; |
180 | double mOriginalAspectRatio; | 177 | double mOriginalAspectRatio; |
181 | BOOL mCursorDecoupled; | 178 | BOOL mCursorDecoupled; |
182 | S32 mCursorLastEventDeltaX; | 179 | S32 mCursorLastEventDeltaX; |
@@ -220,11 +217,11 @@ public: | |||
220 | virtual ~LLSplashScreenSDL(); | 217 | virtual ~LLSplashScreenSDL(); |
221 | 218 | ||
222 | /*virtual*/ void showImpl(); | 219 | /*virtual*/ void showImpl(); |
223 | /*virtual*/ void updateImpl(const char* mesg); | 220 | /*virtual*/ void updateImpl(const std::string& mesg); |
224 | /*virtual*/ void hideImpl(); | 221 | /*virtual*/ void hideImpl(); |
225 | }; | 222 | }; |
226 | 223 | ||
227 | S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type); | 224 | S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type); |
228 | 225 | ||
229 | void load_url_external(const char* url); | 226 | void load_url_external(const char* url); |
230 | 227 | ||
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 2001899..047fa31 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp | |||
@@ -54,8 +54,6 @@ | |||
54 | #include "llstring.h" | 54 | #include "llstring.h" |
55 | #include "lldir.h" | 55 | #include "lldir.h" |
56 | 56 | ||
57 | #include "llglheaders.h" | ||
58 | |||
59 | #include "indra_constants.h" | 57 | #include "indra_constants.h" |
60 | 58 | ||
61 | #include "llpreeditor.h" | 59 | #include "llpreeditor.h" |
@@ -82,7 +80,7 @@ LLW32MsgCallback gAsyncMsgCallback = NULL; | |||
82 | // LLWindowWin32 | 80 | // LLWindowWin32 |
83 | // | 81 | // |
84 | 82 | ||
85 | void show_window_creation_error(const char* title) | 83 | void show_window_creation_error(const std::string& title) |
86 | { | 84 | { |
87 | LL_WARNS("Window") << title << LL_ENDL; | 85 | LL_WARNS("Window") << title << LL_ENDL; |
88 | } | 86 | } |
@@ -359,7 +357,7 @@ LLWinImm::~LLWinImm() | |||
359 | } | 357 | } |
360 | 358 | ||
361 | 359 | ||
362 | LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | 360 | LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, |
363 | S32 height, U32 flags, | 361 | S32 height, U32 flags, |
364 | BOOL fullscreen, BOOL clearBg, | 362 | BOOL fullscreen, BOOL clearBg, |
365 | BOOL disable_vsync, BOOL use_gl, | 363 | BOOL disable_vsync, BOOL use_gl, |
@@ -386,7 +384,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
386 | RECT window_rect; | 384 | RECT window_rect; |
387 | 385 | ||
388 | // Set the window title | 386 | // Set the window title |
389 | if (!title) | 387 | if (title.empty()) |
390 | { | 388 | { |
391 | mWindowTitle = new WCHAR[50]; | 389 | mWindowTitle = new WCHAR[50]; |
392 | wsprintf(mWindowTitle, L"OpenGL Window"); | 390 | wsprintf(mWindowTitle, L"OpenGL Window"); |
@@ -394,12 +392,12 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
394 | else | 392 | else |
395 | { | 393 | { |
396 | mWindowTitle = new WCHAR[256]; // Assume title length < 255 chars. | 394 | mWindowTitle = new WCHAR[256]; // Assume title length < 255 chars. |
397 | mbstowcs(mWindowTitle, title, 255); | 395 | mbstowcs(mWindowTitle, title.c_str(), 255); |
398 | mWindowTitle[255] = 0; | 396 | mWindowTitle[255] = 0; |
399 | } | 397 | } |
400 | 398 | ||
401 | // Set the window class name | 399 | // Set the window class name |
402 | if (!name) | 400 | if (name.empty()) |
403 | { | 401 | { |
404 | mWindowClassName = new WCHAR[50]; | 402 | mWindowClassName = new WCHAR[50]; |
405 | wsprintf(mWindowClassName, L"OpenGL Window"); | 403 | wsprintf(mWindowClassName, L"OpenGL Window"); |
@@ -407,7 +405,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
407 | else | 405 | else |
408 | { | 406 | { |
409 | mWindowClassName = new WCHAR[256]; // Assume title length < 255 chars. | 407 | mWindowClassName = new WCHAR[256]; // Assume title length < 255 chars. |
410 | mbstowcs(mWindowClassName, name, 255); | 408 | mbstowcs(mWindowClassName, name.c_str(), 255); |
411 | mWindowClassName[255] = 0; | 409 | mWindowClassName[255] = 0; |
412 | } | 410 | } |
413 | 411 | ||
@@ -571,8 +569,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
571 | mFullscreenBits = -1; | 569 | mFullscreenBits = -1; |
572 | mFullscreenRefresh = -1; | 570 | mFullscreenRefresh = -1; |
573 | 571 | ||
574 | char error[256]; /* Flawfinder: ignore */ | 572 | std::string error = llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); |
575 | snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */ | ||
576 | OSMessageBox(error, "Error", OSMB_OK); | 573 | OSMessageBox(error, "Error", OSMB_OK); |
577 | } | 574 | } |
578 | } | 575 | } |
@@ -1390,6 +1387,20 @@ BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position) | |||
1390 | return FALSE; | 1387 | return FALSE; |
1391 | } | 1388 | } |
1392 | 1389 | ||
1390 | // Inform the application of the new mouse position (needed for per-frame | ||
1391 | // hover/picking to function). | ||
1392 | LLCoordGL gl_pos; | ||
1393 | convertCoords(position, &gl_pos); | ||
1394 | mCallbacks->handleMouseMove(this, gl_pos, (MASK)0); | ||
1395 | |||
1396 | // DEV-18951 VWR-8524 Camera moves wildly when alt-clicking. | ||
1397 | // Because we have preemptively notified the application of the new | ||
1398 | // mouse position via handleMouseMove() above, we need to clear out | ||
1399 | // any stale mouse move events. RN/JC | ||
1400 | MSG msg; | ||
1401 | while (PeekMessage(&msg, NULL, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) | ||
1402 | { } | ||
1403 | |||
1393 | return SetCursorPos(screen_pos.mX, screen_pos.mY); | 1404 | return SetCursorPos(screen_pos.mX, screen_pos.mY); |
1394 | } | 1405 | } |
1395 | 1406 | ||
@@ -1942,6 +1953,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1942 | window_imp->convertCoords(window_coord, &gl_coord); | 1953 | window_imp->convertCoords(window_coord, &gl_coord); |
1943 | } | 1954 | } |
1944 | MASK mask = gKeyboard->currentMask(TRUE); | 1955 | MASK mask = gKeyboard->currentMask(TRUE); |
1956 | // generate move event to update mouse coordinates | ||
1957 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
1945 | if (window_imp->mCallbacks->handleMouseDown(window_imp, gl_coord, mask)) | 1958 | if (window_imp->mCallbacks->handleMouseDown(window_imp, gl_coord, mask)) |
1946 | { | 1959 | { |
1947 | return 0; | 1960 | return 0; |
@@ -1969,6 +1982,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1969 | window_imp->convertCoords(window_coord, &gl_coord); | 1982 | window_imp->convertCoords(window_coord, &gl_coord); |
1970 | } | 1983 | } |
1971 | MASK mask = gKeyboard->currentMask(TRUE); | 1984 | MASK mask = gKeyboard->currentMask(TRUE); |
1985 | // generate move event to update mouse coordinates | ||
1986 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
1972 | if (window_imp->mCallbacks->handleDoubleClick(window_imp, gl_coord, mask) ) | 1987 | if (window_imp->mCallbacks->handleDoubleClick(window_imp, gl_coord, mask) ) |
1973 | { | 1988 | { |
1974 | return 0; | 1989 | return 0; |
@@ -1999,6 +2014,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1999 | window_imp->convertCoords(window_coord, &gl_coord); | 2014 | window_imp->convertCoords(window_coord, &gl_coord); |
2000 | } | 2015 | } |
2001 | MASK mask = gKeyboard->currentMask(TRUE); | 2016 | MASK mask = gKeyboard->currentMask(TRUE); |
2017 | // generate move event to update mouse coordinates | ||
2018 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
2002 | if (window_imp->mCallbacks->handleMouseUp(window_imp, gl_coord, mask)) | 2019 | if (window_imp->mCallbacks->handleMouseUp(window_imp, gl_coord, mask)) |
2003 | { | 2020 | { |
2004 | return 0; | 2021 | return 0; |
@@ -2015,7 +2032,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2015 | window_imp->interruptLanguageTextInput(); | 2032 | window_imp->interruptLanguageTextInput(); |
2016 | } | 2033 | } |
2017 | 2034 | ||
2018 | // Because we move the cursor position in tllviewerhe app, we need to query | 2035 | // Because we move the cursor position in the llviewerapp, we need to query |
2019 | // to find out where the cursor at the time the event is handled. | 2036 | // to find out where the cursor at the time the event is handled. |
2020 | // If we don't do this, many clicks could get buffered up, and if the | 2037 | // If we don't do this, many clicks could get buffered up, and if the |
2021 | // first click changes the cursor position, all subsequent clicks | 2038 | // first click changes the cursor position, all subsequent clicks |
@@ -2031,6 +2048,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2031 | window_imp->convertCoords(window_coord, &gl_coord); | 2048 | window_imp->convertCoords(window_coord, &gl_coord); |
2032 | } | 2049 | } |
2033 | MASK mask = gKeyboard->currentMask(TRUE); | 2050 | MASK mask = gKeyboard->currentMask(TRUE); |
2051 | // generate move event to update mouse coordinates | ||
2052 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
2034 | if (window_imp->mCallbacks->handleRightMouseDown(window_imp, gl_coord, mask)) | 2053 | if (window_imp->mCallbacks->handleRightMouseDown(window_imp, gl_coord, mask)) |
2035 | { | 2054 | { |
2036 | return 0; | 2055 | return 0; |
@@ -2057,6 +2076,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2057 | window_imp->convertCoords(window_coord, &gl_coord); | 2076 | window_imp->convertCoords(window_coord, &gl_coord); |
2058 | } | 2077 | } |
2059 | MASK mask = gKeyboard->currentMask(TRUE); | 2078 | MASK mask = gKeyboard->currentMask(TRUE); |
2079 | // generate move event to update mouse coordinates | ||
2080 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
2060 | if (window_imp->mCallbacks->handleRightMouseUp(window_imp, gl_coord, mask)) | 2081 | if (window_imp->mCallbacks->handleRightMouseUp(window_imp, gl_coord, mask)) |
2061 | { | 2082 | { |
2062 | return 0; | 2083 | return 0; |
@@ -2089,6 +2110,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2089 | window_imp->convertCoords(window_coord, &gl_coord); | 2110 | window_imp->convertCoords(window_coord, &gl_coord); |
2090 | } | 2111 | } |
2091 | MASK mask = gKeyboard->currentMask(TRUE); | 2112 | MASK mask = gKeyboard->currentMask(TRUE); |
2113 | // generate move event to update mouse coordinates | ||
2114 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
2092 | if (window_imp->mCallbacks->handleMiddleMouseDown(window_imp, gl_coord, mask)) | 2115 | if (window_imp->mCallbacks->handleMiddleMouseDown(window_imp, gl_coord, mask)) |
2093 | { | 2116 | { |
2094 | return 0; | 2117 | return 0; |
@@ -2115,6 +2138,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2115 | window_imp->convertCoords(window_coord, &gl_coord); | 2138 | window_imp->convertCoords(window_coord, &gl_coord); |
2116 | } | 2139 | } |
2117 | MASK mask = gKeyboard->currentMask(TRUE); | 2140 | MASK mask = gKeyboard->currentMask(TRUE); |
2141 | // generate move event to update mouse coordinates | ||
2142 | window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask); | ||
2118 | if (window_imp->mCallbacks->handleMiddleMouseUp(window_imp, gl_coord, mask)) | 2143 | if (window_imp->mCallbacks->handleMiddleMouseUp(window_imp, gl_coord, mask)) |
2119 | { | 2144 | { |
2120 | return 0; | 2145 | return 0; |
@@ -2376,7 +2401,7 @@ BOOL LLWindowWin32::pasteTextFromClipboard(LLWString &dst) | |||
2376 | if (utf16str) | 2401 | if (utf16str) |
2377 | { | 2402 | { |
2378 | dst = utf16str_to_wstring(utf16str); | 2403 | dst = utf16str_to_wstring(utf16str); |
2379 | LLWString::removeCRLF(dst); | 2404 | LLWStringUtil::removeCRLF(dst); |
2380 | GlobalUnlock(h_data); | 2405 | GlobalUnlock(h_data); |
2381 | success = TRUE; | 2406 | success = TRUE; |
2382 | } | 2407 | } |
@@ -2399,7 +2424,7 @@ BOOL LLWindowWin32::copyTextToClipboard(const LLWString& wstr) | |||
2399 | 2424 | ||
2400 | // Provide a copy of the data in Unicode format. | 2425 | // Provide a copy of the data in Unicode format. |
2401 | LLWString sanitized_string(wstr); | 2426 | LLWString sanitized_string(wstr); |
2402 | LLWString::addCRLF(sanitized_string); | 2427 | LLWStringUtil::addCRLF(sanitized_string); |
2403 | llutf16string out_utf16 = wstring_to_utf16str(sanitized_string); | 2428 | llutf16string out_utf16 = wstring_to_utf16str(sanitized_string); |
2404 | const size_t size_utf16 = (out_utf16.length() + 1) * sizeof(WCHAR); | 2429 | const size_t size_utf16 = (out_utf16.length() + 1) * sizeof(WCHAR); |
2405 | 2430 | ||
@@ -2486,86 +2511,6 @@ BOOL LLWindowWin32::getClientRectInScreenSpace( RECT* rectp ) | |||
2486 | return success; | 2511 | return success; |
2487 | } | 2512 | } |
2488 | 2513 | ||
2489 | |||
2490 | BOOL LLWindowWin32::sendEmail(const char* address, const char* subject, const char* body_text, | ||
2491 | const char* attachment, const char* attachment_displayed_name ) | ||
2492 | { | ||
2493 | // Based on "A SendMail() DLL" by Greg Turner, Windows Developer Magazine, Nov. 1997. | ||
2494 | // See article for use of GetProcAddress | ||
2495 | // No restrictions on use. | ||
2496 | |||
2497 | enum SendResult | ||
2498 | { | ||
2499 | LL_EMAIL_SUCCESS, | ||
2500 | LL_EMAIL_MAPI_NOT_INSTALLED, // No MAPI Server (eg Microsoft Exchange) installed | ||
2501 | LL_EMAIL_MAPILOAD_FAILED, // Load of MAPI32.DLL failed | ||
2502 | LL_EMAIL_SEND_FAILED // The message send itself failed | ||
2503 | }; | ||
2504 | |||
2505 | SendResult result = LL_EMAIL_SUCCESS; | ||
2506 | |||
2507 | U32 mapi_installed = GetProfileInt(L"Mail", L"MAPI", 0); | ||
2508 | if( !mapi_installed) | ||
2509 | { | ||
2510 | result = LL_EMAIL_MAPI_NOT_INSTALLED; | ||
2511 | } | ||
2512 | else | ||
2513 | { | ||
2514 | HINSTANCE hMAPIInst = LoadLibrary(L"MAPI32.DLL"); /* Flawfinder: ignore */ | ||
2515 | if(!hMAPIInst) | ||
2516 | { | ||
2517 | result = LL_EMAIL_MAPILOAD_FAILED; | ||
2518 | } | ||
2519 | else | ||
2520 | { | ||
2521 | LPMAPISENDMAIL pMAPISendMail = (LPMAPISENDMAIL) GetProcAddress(hMAPIInst, "MAPISendMail"); | ||
2522 | |||
2523 | // Send the message | ||
2524 | MapiRecipDesc recipients[1]; | ||
2525 | recipients[0].ulReserved = 0; | ||
2526 | recipients[0].ulRecipClass = MAPI_TO; | ||
2527 | recipients[0].lpszName = (char*)address; | ||
2528 | recipients[0].lpszAddress = (char*)address; | ||
2529 | recipients[0].ulEIDSize = 0; | ||
2530 | recipients[0].lpEntryID = 0; | ||
2531 | |||
2532 | MapiFileDesc files[1]; | ||
2533 | files[0].ulReserved = 0; | ||
2534 | files[0].flFlags = 0; // non-OLE file | ||
2535 | files[0].nPosition = -1; // Leave file location in email unspecified. | ||
2536 | files[0].lpszPathName = (char*)attachment; // Must be fully qualified name, including drive letter. | ||
2537 | files[0].lpszFileName = (char*)attachment_displayed_name; // If NULL, uses attachment as displayed name. | ||
2538 | files[0].lpFileType = NULL; // Recipient will have to figure out what kind of file this is. | ||
2539 | |||
2540 | MapiMessage msg; | ||
2541 | memset(&msg, 0, sizeof(msg)); | ||
2542 | msg.lpszSubject = (char*)subject; // may be NULL | ||
2543 | msg.lpszNoteText = (char*)body_text; | ||
2544 | msg.nRecipCount = address ? 1 : 0; | ||
2545 | msg.lpRecips = address ? recipients : NULL; | ||
2546 | msg.nFileCount = attachment ? 1 : 0; | ||
2547 | msg.lpFiles = attachment ? files : NULL; | ||
2548 | |||
2549 | U32 success = pMAPISendMail(0, (U32) mWindowHandle, &msg, MAPI_DIALOG|MAPI_LOGON_UI|MAPI_NEW_SESSION, 0); | ||
2550 | if(success != SUCCESS_SUCCESS) | ||
2551 | { | ||
2552 | result = LL_EMAIL_SEND_FAILED; | ||
2553 | } | ||
2554 | |||
2555 | FreeLibrary(hMAPIInst); | ||
2556 | } | ||
2557 | } | ||
2558 | |||
2559 | return result == LL_EMAIL_SUCCESS; | ||
2560 | } | ||
2561 | |||
2562 | |||
2563 | S32 LLWindowWin32::stat(const char* file_name, struct stat* stat_info) | ||
2564 | { | ||
2565 | llassert( sizeof(struct stat) == sizeof(struct _stat) ); // They are defined identically in sys/stat.h, but I'm paranoid. | ||
2566 | return LLFile::stat( file_name, (struct _stat*) stat_info ); | ||
2567 | } | ||
2568 | |||
2569 | void LLWindowWin32::flashIcon(F32 seconds) | 2514 | void LLWindowWin32::flashIcon(F32 seconds) |
2570 | { | 2515 | { |
2571 | FLASHWINFO flash_info; | 2516 | FLASHWINFO flash_info; |
@@ -2803,12 +2748,12 @@ void LLSplashScreenWin32::showImpl() | |||
2803 | } | 2748 | } |
2804 | 2749 | ||
2805 | 2750 | ||
2806 | void LLSplashScreenWin32::updateImpl(const char *mesg) | 2751 | void LLSplashScreenWin32::updateImpl(const std::string& mesg) |
2807 | { | 2752 | { |
2808 | if (!mWindow) return; | 2753 | if (!mWindow) return; |
2809 | 2754 | ||
2810 | WCHAR w_mesg[1024]; | 2755 | WCHAR w_mesg[1024]; |
2811 | mbstowcs(w_mesg, mesg, 1024); | 2756 | mbstowcs(w_mesg, mesg.c_str(), 1024); |
2812 | 2757 | ||
2813 | SendDlgItemMessage(mWindow, | 2758 | SendDlgItemMessage(mWindow, |
2814 | 666, // HACK: text id | 2759 | 666, // HACK: text id |
@@ -2840,7 +2785,7 @@ LRESULT CALLBACK LLSplashScreenWin32::windowProc(HWND h_wnd, UINT u_msg, | |||
2840 | // Helper Funcs | 2785 | // Helper Funcs |
2841 | // | 2786 | // |
2842 | 2787 | ||
2843 | S32 OSMessageBoxWin32(const char* text, const char* caption, U32 type) | 2788 | S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 type) |
2844 | { | 2789 | { |
2845 | UINT uType; | 2790 | UINT uType; |
2846 | 2791 | ||
@@ -2861,7 +2806,7 @@ S32 OSMessageBoxWin32(const char* text, const char* caption, U32 type) | |||
2861 | } | 2806 | } |
2862 | 2807 | ||
2863 | // HACK! Doesn't properly handle wide strings! | 2808 | // HACK! Doesn't properly handle wide strings! |
2864 | int retval_win = MessageBoxA(NULL, text, caption, uType); | 2809 | int retval_win = MessageBoxA(NULL, text.c_str(), caption.c_str(), uType); |
2865 | S32 retval; | 2810 | S32 retval; |
2866 | 2811 | ||
2867 | switch(retval_win) | 2812 | switch(retval_win) |
@@ -2887,15 +2832,13 @@ S32 OSMessageBoxWin32(const char* text, const char* caption, U32 type) | |||
2887 | } | 2832 | } |
2888 | 2833 | ||
2889 | 2834 | ||
2890 | void spawn_web_browser(const char* escaped_url ) | 2835 | void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url ) |
2891 | { | 2836 | { |
2892 | bool found = false; | 2837 | bool found = false; |
2893 | S32 i; | 2838 | S32 i; |
2894 | for (i = 0; i < gURLProtocolWhitelistCount; i++) | 2839 | for (i = 0; i < gURLProtocolWhitelistCount; i++) |
2895 | { | 2840 | { |
2896 | S32 len = strlen(gURLProtocolWhitelist[i]); /* Flawfinder: ignore */ | 2841 | if (escaped_url.find(gURLProtocolWhitelist[i]) == 0) |
2897 | if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len) | ||
2898 | && escaped_url[len] == ':') | ||
2899 | { | 2842 | { |
2900 | found = true; | 2843 | found = true; |
2901 | break; | 2844 | break; |
@@ -2931,10 +2874,9 @@ void spawn_web_browser(const char* escaped_url ) | |||
2931 | // Figure out the user's default web browser | 2874 | // Figure out the user's default web browser |
2932 | // HKEY_CLASSES_ROOT\http\shell\open\command | 2875 | // HKEY_CLASSES_ROOT\http\shell\open\command |
2933 | /* | 2876 | /* |
2934 | char reg_path_str[256]; // Flawfinder: ignore | 2877 | std::string reg_path_str = gURLProtocolWhitelistHandler[i] + "\\shell\\open\\command"; |
2935 | snprintf(reg_path_str, sizeof(reg_path_str), "%s\\shell\\open\\command", gURLProtocolWhitelistHandler[i]); // Flawfinder: ignore | ||
2936 | WCHAR reg_path_wstr[256]; | 2878 | WCHAR reg_path_wstr[256]; |
2937 | mbstowcs(reg_path_wstr, reg_path_str, sizeof(reg_path_wstr)/sizeof(reg_path_wstr[0])); | 2879 | mbstowcs(reg_path_wstr, reg_path_str.c_str(), sizeof(reg_path_wstr)/sizeof(reg_path_wstr[0])); |
2938 | 2880 | ||
2939 | HKEY key; | 2881 | HKEY key; |
2940 | WCHAR browser_open_wstr[1024]; | 2882 | WCHAR browser_open_wstr[1024]; |
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index feb1c74..ebabcae 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h | |||
@@ -86,12 +86,6 @@ public: | |||
86 | /*virtual*/ void delayInputProcessing(); | 86 | /*virtual*/ void delayInputProcessing(); |
87 | /*virtual*/ void swapBuffers(); | 87 | /*virtual*/ void swapBuffers(); |
88 | 88 | ||
89 | /*virtual*/ LLString getTempFileName(); | ||
90 | /*virtual*/ void deleteFile( const char* file_name ); | ||
91 | /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ); | ||
92 | /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL); | ||
93 | |||
94 | |||
95 | // handy coordinate space conversion routines | 89 | // handy coordinate space conversion routines |
96 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); | 90 | /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); |
97 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); | 91 | /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); |
@@ -115,12 +109,13 @@ public: | |||
115 | /*virtual*/ void setLanguageTextInput( const LLCoordGL & pos ); | 109 | /*virtual*/ void setLanguageTextInput( const LLCoordGL & pos ); |
116 | /*virtual*/ void updateLanguageTextInputArea(); | 110 | /*virtual*/ void updateLanguageTextInputArea(); |
117 | /*virtual*/ void interruptLanguageTextInput(); | 111 | /*virtual*/ void interruptLanguageTextInput(); |
112 | /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); | ||
118 | 113 | ||
119 | static std::string getFontListSans(); | 114 | static std::string getFontListSans(); |
120 | 115 | ||
121 | protected: | 116 | protected: |
122 | LLWindowWin32( | 117 | LLWindowWin32( |
123 | char *title, char *name, int x, int y, int width, int height, U32 flags, | 118 | const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, |
124 | BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, | 119 | BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, |
125 | BOOL ignore_pixel_depth, U32 fsaa_samples); | 120 | BOOL ignore_pixel_depth, U32 fsaa_samples); |
126 | ~LLWindowWin32(); | 121 | ~LLWindowWin32(); |
@@ -220,7 +215,7 @@ public: | |||
220 | virtual ~LLSplashScreenWin32(); | 215 | virtual ~LLSplashScreenWin32(); |
221 | 216 | ||
222 | /*virtual*/ void showImpl(); | 217 | /*virtual*/ void showImpl(); |
223 | /*virtual*/ void updateImpl(const char* mesg); | 218 | /*virtual*/ void updateImpl(const std::string& mesg); |
224 | /*virtual*/ void hideImpl(); | 219 | /*virtual*/ void hideImpl(); |
225 | 220 | ||
226 | #if LL_WINDOWS | 221 | #if LL_WINDOWS |
@@ -239,6 +234,6 @@ extern LPWSTR gIconResource; | |||
239 | 234 | ||
240 | static void handleMessage( const MSG& msg ); | 235 | static void handleMessage( const MSG& msg ); |
241 | 236 | ||
242 | S32 OSMessageBoxWin32(const char* text, const char* caption, U32 type); | 237 | S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 type); |
243 | 238 | ||
244 | #endif //LL_LLWINDOWWIN32_H | 239 | #endif //LL_LLWINDOWWIN32_H |