summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp86
1 files changed, 59 insertions, 27 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index c0cc6596a2..fa0816c457 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -28,6 +28,7 @@
#include "llwindowmacosx.h"
+#include "llgamecontrol.h"
#include "llkeyboardmacosx.h"
#include "llwindowcallbacks.h"
#include "llpreeditor.h"
@@ -390,7 +391,7 @@ void callLeftMouseUp(float *pos, MASK mask)
}
-void callDoubleClick(float *pos, MASK mask)
+void callLeftDoubleClick(float* pos, MASK mask)
{
if (!gWindowImplementation)
{
@@ -404,7 +405,41 @@ void callDoubleClick(float *pos, MASK mask)
LLCoordGL outCoords;
outCoords.mX = ll_round(pos[0]);
outCoords.mY = ll_round(pos[1]);
- gWindowImplementation->getCallbacks()->handleDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(true));
+ gWindowImplementation->getCallbacks()->handleLeftMouseDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(true));
+}
+
+void callRightDoubleClick(float* pos, MASK mask)
+{
+ if (!gWindowImplementation)
+ {
+ return;
+ }
+ if (gWindowImplementation->allowsLanguageInput())
+ {
+ gWindowImplementation->interruptLanguageTextInput();
+ }
+
+ LLCoordGL outCoords;
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
+ gWindowImplementation->getCallbacks()->handleRightMouseDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(true));
+}
+
+void callMiddleDoubleClick(float* pos, MASK mask)
+{
+ if (!gWindowImplementation)
+ {
+ return;
+ }
+ if (gWindowImplementation->allowsLanguageInput())
+ {
+ gWindowImplementation->interruptLanguageTextInput();
+ }
+
+ LLCoordGL outCoords;
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
+ gWindowImplementation->getCallbacks()->handleMiddleMouseDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(true));
}
void callResize(unsigned int width, unsigned int height)
@@ -740,7 +775,7 @@ void LLWindowMacOSX::updateMouseDeltas(float* deltas)
}
}
-void LLWindowMacOSX::getMouseDeltas(float* delta)
+void LLWindowMacOSX::getMouseDeltas(float* delta) const
{
delta[0] = mCursorLastEventDeltaX;
delta[1] = mCursorLastEventDeltaY;
@@ -945,7 +980,7 @@ bool LLWindowMacOSX::isValid()
return (mWindow != NULL);
}
-bool LLWindowMacOSX::getVisible()
+bool LLWindowMacOSX::getVisible() const
{
bool result = false;
@@ -961,12 +996,12 @@ bool LLWindowMacOSX::getVisible()
return(result);
}
-bool LLWindowMacOSX::getMinimized()
+bool LLWindowMacOSX::getMinimized() const
{
return mMinimized;
}
-bool LLWindowMacOSX::getMaximized()
+bool LLWindowMacOSX::getMaximized() const
{
return mMaximized;
}
@@ -980,17 +1015,13 @@ bool LLWindowMacOSX::maximize()
return mMaximized;
}
-bool LLWindowMacOSX::getFullscreen()
-{
- return mFullscreen;
-}
-
-void LLWindowMacOSX::gatherInput()
+void LLWindowMacOSX::gatherInput(bool app_has_focus)
{
updateCursor();
+ LLGameControl::processEvents(app_has_focus);
}
-bool LLWindowMacOSX::getPosition(LLCoordScreen *position)
+bool LLWindowMacOSX::getPosition(LLCoordScreen *position) const
{
S32 err = -1;
@@ -1017,7 +1048,7 @@ bool LLWindowMacOSX::getPosition(LLCoordScreen *position)
return (err == noErr);
}
-bool LLWindowMacOSX::getSize(LLCoordScreen *size)
+bool LLWindowMacOSX::getSize(LLCoordScreen *size) const
{
S32 err = -1;
@@ -1043,7 +1074,7 @@ bool LLWindowMacOSX::getSize(LLCoordScreen *size)
return (err == noErr);
}
-bool LLWindowMacOSX::getSize(LLCoordWindow *size)
+bool LLWindowMacOSX::getSize(LLCoordWindow *size) const
{
S32 err = -1;
@@ -1117,7 +1148,7 @@ void LLWindowMacOSX::restoreGLContext()
CGLSetCurrentContext(mContext);
}
-F32 LLWindowMacOSX::getGamma()
+F32 LLWindowMacOSX::getGamma() const
{
F32 result = 2.2; // Default to something sane
@@ -1151,7 +1182,7 @@ F32 LLWindowMacOSX::getGamma()
return result;
}
-U32 LLWindowMacOSX::getFSAASamples()
+U32 LLWindowMacOSX::getFSAASamples() const
{
return mFSAASamples;
}
@@ -1484,21 +1515,21 @@ LLWindow::LLWindowResolution* LLWindowMacOSX::getSupportedResolutions(S32 &num_r
return mSupportedResolutions;
}
-bool LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordWindow *to)
+bool LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordWindow *to) const
{
to->mX = from.mX;
to->mY = from.mY;
return true;
}
-bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordGL* to)
+bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordGL* to) const
{
to->mX = from.mX;
to->mY = from.mY;
return true;
}
-bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to)
+bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) const
{
if(mWindow)
{
@@ -1518,7 +1549,7 @@ bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to)
return false;
}
-bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to)
+bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) const
{
if(mWindow)
{
@@ -1537,14 +1568,14 @@ bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to)
return false;
}
-bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordGL *to)
+bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordGL *to) const
{
LLCoordWindow window_coord;
return(convertCoords(from, &window_coord) && convertCoords(window_coord, to));
}
-bool LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordScreen *to)
+bool LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordScreen *to) const
{
LLCoordWindow window_coord;
@@ -2430,7 +2461,7 @@ bool LLWindowMacOSX::getInputDevices(U32 device_type_filter,
return return_value;
}
-LLSD LLWindowMacOSX::getNativeKeyData()
+LLSD LLWindowMacOSX::getNativeKeyData() const
{
LLSD result = LLSD::emptyMap();
@@ -2477,7 +2508,7 @@ bool LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b)
return (retval);
}
-void *LLWindowMacOSX::getPlatformWindow()
+void *LLWindowMacOSX::getPlatformWindow() const
{
// NOTE: this will be NULL in fullscreen mode. Plan accordingly.
return (void*)mWindow;
@@ -2614,6 +2645,7 @@ void LLWindowMacOSX::interruptLanguageTextInput()
commitCurrentPreedit(mGLView);
}
+// static
std::vector<std::string> LLWindowMacOSX::getDisplaysResolutionList()
{
std::vector<std::string> resolution_list;
@@ -2643,7 +2675,7 @@ std::vector<std::string> LLWindowMacOSX::getDisplaysResolutionList()
return resolution_list;
}
-//static
+// static
std::vector<std::string> LLWindowMacOSX::getDynamicFallbackFontList()
{
// Fonts previously in getFontListSans() have moved to fonts.xml.
@@ -2666,7 +2698,7 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers)
return mask;
}
-F32 LLWindowMacOSX::getSystemUISize()
+F32 LLWindowMacOSX::getSystemUISize() const
{
return ::getDeviceUnitSize(mGLView);
}