aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llui.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llui/llui.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/llui/llui.cpp')
-rw-r--r--linden/indra/llui/llui.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp
index f3e73fd..57ce13c 100644
--- a/linden/indra/llui/llui.cpp
+++ b/linden/indra/llui/llui.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 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 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 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -30,6 +31,7 @@
30 */ 31 */
31 32
32// Utilities functions the user interface needs 33// Utilities functions the user interface needs
34
33#include "linden_common.h" 35#include "linden_common.h"
34 36
35#include <string> 37#include <string>
@@ -65,6 +67,7 @@ std::map<std::string, std::string> gTranslation;
65std::list<std::string> gUntranslated; 67std::list<std::string> gUntranslated;
66 68
67LLControlGroup* LLUI::sConfigGroup = NULL; 69LLControlGroup* LLUI::sConfigGroup = NULL;
70LLControlGroup* LLUI::sIgnoresGroup = NULL;
68LLControlGroup* LLUI::sColorsGroup = NULL; 71LLControlGroup* LLUI::sColorsGroup = NULL;
69LLImageProviderInterface* LLUI::sImageProvider = NULL; 72LLImageProviderInterface* LLUI::sImageProvider = NULL;
70LLUIAudioCallback LLUI::sAudioCallback = NULL; 73LLUIAudioCallback LLUI::sAudioCallback = NULL;
@@ -90,7 +93,7 @@ void make_ui_sound(const char* namep)
90 LLUUID uuid(LLUI::sConfigGroup->getString(name)); 93 LLUUID uuid(LLUI::sConfigGroup->getString(name));
91 if (uuid.isNull()) 94 if (uuid.isNull())
92 { 95 {
93 if ("00000000-0000-0000-0000-000000000000" == LLUI::sConfigGroup->getString(name)) 96 if (LLUI::sConfigGroup->getString(name) == LLUUID::null.asString())
94 { 97 {
95 if (LLUI::sConfigGroup->getBOOL("UISndDebugSpamToggle")) 98 if (LLUI::sConfigGroup->getBOOL("UISndDebugSpamToggle"))
96 { 99 {
@@ -1552,6 +1555,7 @@ bool handleShowXUINamesChanged(const LLSD& newvalue)
1552} 1555}
1553 1556
1554void LLUI::initClass(LLControlGroup* config, 1557void LLUI::initClass(LLControlGroup* config,
1558 LLControlGroup* ignores,
1555 LLControlGroup* colors, 1559 LLControlGroup* colors,
1556 LLImageProviderInterface* image_provider, 1560 LLImageProviderInterface* image_provider,
1557 LLUIAudioCallback audio_callback, 1561 LLUIAudioCallback audio_callback,
@@ -1559,7 +1563,16 @@ void LLUI::initClass(LLControlGroup* config,
1559 const std::string& language) 1563 const std::string& language)
1560{ 1564{
1561 sConfigGroup = config; 1565 sConfigGroup = config;
1566 sIgnoresGroup = ignores;
1562 sColorsGroup = colors; 1567 sColorsGroup = colors;
1568
1569 if (sConfigGroup == NULL
1570 || sIgnoresGroup == NULL
1571 || sColorsGroup == NULL)
1572 {
1573 llerrs << "Failure to initialize configuration groups" << llendl;
1574 }
1575
1563 sImageProvider = image_provider; 1576 sImageProvider = image_provider;
1564 sAudioCallback = audio_callback; 1577 sAudioCallback = audio_callback;
1565 sGLScaleFactor = (scale_factor == NULL) ? LLVector2(1.f, 1.f) : *scale_factor; 1578 sGLScaleFactor = (scale_factor == NULL) ? LLVector2(1.f, 1.f) : *scale_factor;
@@ -1567,7 +1580,7 @@ void LLUI::initClass(LLControlGroup* config,
1567 LLFontGL::sShadowColor = colors->getColor("ColorDropShadow"); 1580 LLFontGL::sShadowColor = colors->getColor("ColorDropShadow");
1568 1581
1569 LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames"); 1582 LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames");
1570 LLUI::sConfigGroup->getControl("ShowXUINames")->getSignal()->connect(boost::bind(&handleShowXUINamesChanged, _1)); 1583 LLUI::sConfigGroup->getControl("ShowXUINames")->getSignal()->connect(&handleShowXUINamesChanged);
1571} 1584}
1572 1585
1573void LLUI::cleanupClass() 1586void LLUI::cleanupClass()
@@ -1645,6 +1658,18 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y)
1645 setCursorPositionScreen(screen_x, screen_y); 1658 setCursorPositionScreen(screen_x, screen_y);
1646} 1659}
1647 1660
1661//static
1662void LLUI::getCursorPositionLocal(const LLView* viewp, S32 *x, S32 *y)
1663{
1664 LLCoordWindow cursor_pos_window;
1665 LLView::getWindow()->getCursorPosition(&cursor_pos_window);
1666 LLCoordGL cursor_pos_gl;
1667 LLView::getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl);
1668 cursor_pos_gl.mX = llround((F32)cursor_pos_gl.mX / LLUI::sGLScaleFactor.mV[VX]);
1669 cursor_pos_gl.mY = llround((F32)cursor_pos_gl.mY / LLUI::sGLScaleFactor.mV[VY]);
1670 viewp->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, x, y);
1671}
1672
1648// On Windows, the user typically sets the language when they install the 1673// On Windows, the user typically sets the language when they install the
1649// app (by running it with a shortcut that sets InstallLanguage). On Mac, 1674// app (by running it with a shortcut that sets InstallLanguage). On Mac,
1650// or on Windows if the SecondLife.exe executable is run directly, the 1675// or on Windows if the SecondLife.exe executable is run directly, the