summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2014-07-09 15:22:12 -0700
committerdolphin <dolphin@lindenlab.com>2014-07-09 15:22:12 -0700
commit487fce4afaed69268db4fb996e420ba8984101d3 (patch)
tree365a4d16f511c083334b5315c6ffc882c558a300 /indra/llwindow/llwindowmacosx.cpp
parente414dfad51b3747fa20c0023820980f23f1cad2c (diff)
parent226929f8f5b8bc1080d0082b2595d689238df2b8 (diff)
Merge with 3.7.11-release
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rwxr-xr-xindra/llwindow/llwindowmacosx.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index b771e125f9..18d5152015 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -39,6 +39,7 @@
#include "indra_constants.h"
#include <OpenGL/OpenGL.h>
+#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
extern BOOL gDebugWindowProc;
@@ -1743,16 +1744,34 @@ LLSD LLWindowMacOSX::getNativeKeyData()
return result;
}
-
BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b)
{
- // Is this even used anywhere? Do we really need an OS color picker?
BOOL retval = FALSE;
- //S32 error = 0;
+ OSErr error = noErr;
+ NColorPickerInfo info;
+
+ memset(&info, 0, sizeof(info));
+ info.theColor.color.rgb.red = (UInt16)(*r * 65535.f);
+ info.theColor.color.rgb.green = (UInt16)(*g * 65535.f);
+ info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f);
+ info.placeWhere = kCenterOnMainScreen;
+
+ error = NPickColor(&info);
+
+ if (error == noErr)
+ {
+ retval = info.newColorChosen;
+ if (info.newColorChosen)
+ {
+ *r = ((float) info.theColor.color.rgb.red) / 65535.0;
+ *g = ((float) info.theColor.color.rgb.green) / 65535.0;
+ *b = ((float) info.theColor.color.rgb.blue) / 65535.0;
+ }
+ }
+
return (retval);
}
-
void *LLWindowMacOSX::getPlatformWindow()
{
// NOTE: this will be NULL in fullscreen mode. Plan accordingly.