summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-11-02 20:55:56 +0800
committerErik Kundiman <erik@megapahit.org>2024-11-03 19:33:18 +0800
commit3f72f9a202bed628f838cc24fe58a0511ca0d161 (patch)
tree0684cfff91551d9b6aabdb825981b46a5cb53fe8 /indra/llwindow/llwindowmacosx.cpp
parentd302bf3c96666cfd46d7585cb3d8b6ec27bb83bf (diff)
parent9c0a6d1b0e5e9d6da6a63ff367f40ab08c064bbe (diff)
Merge remote-tracking branch 'secondlife/release/maint-c' into maint-c
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp73
1 files changed, 38 insertions, 35 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 3cfc9d7c84..20281c2ab7 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"
@@ -222,14 +223,14 @@ bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask, wch
{
//if (mask!=MASK_NONE)
{
- if((key == gKeyboard->inverseTranslateKey('Z')) && (character == 'y'))
- {
- key = gKeyboard->inverseTranslateKey('Y');
- }
- else if ((key == gKeyboard->inverseTranslateKey('Y')) && (character == 'z'))
- {
- key = gKeyboard->inverseTranslateKey('Z');
- }
+ if((key == gKeyboard->inverseTranslateKey('Z')) && (character == 'y'))
+ {
+ key = gKeyboard->inverseTranslateKey('Y');
+ }
+ else if ((key == gKeyboard->inverseTranslateKey('Y')) && (character == 'z'))
+ {
+ key = gKeyboard->inverseTranslateKey('Z');
+ }
}
mRawKeyEvent = event;
@@ -626,7 +627,7 @@ void LLWindowMacOSX::updateMouseDeltas(float* deltas)
}
}
-void LLWindowMacOSX::getMouseDeltas(float* delta)
+void LLWindowMacOSX::getMouseDeltas(float* delta) const
{
delta[0] = mCursorLastEventDeltaX;
delta[1] = mCursorLastEventDeltaY;
@@ -846,7 +847,7 @@ bool LLWindowMacOSX::isValid()
return (mWindow != NULL);
}
-bool LLWindowMacOSX::getVisible()
+bool LLWindowMacOSX::getVisible() const
{
bool result = false;
@@ -861,12 +862,12 @@ bool LLWindowMacOSX::getVisible()
return(result);
}
-bool LLWindowMacOSX::getMinimized()
+bool LLWindowMacOSX::getMinimized() const
{
return mMinimized;
}
-bool LLWindowMacOSX::getMaximized()
+bool LLWindowMacOSX::getMaximized() const
{
return mMaximized;
}
@@ -880,17 +881,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;
@@ -917,7 +914,7 @@ bool LLWindowMacOSX::getPosition(LLCoordScreen *position)
return (err == noErr);
}
-bool LLWindowMacOSX::getSize(LLCoordScreen *size)
+bool LLWindowMacOSX::getSize(LLCoordScreen *size) const
{
S32 err = -1;
@@ -943,7 +940,7 @@ bool LLWindowMacOSX::getSize(LLCoordScreen *size)
return (err == noErr);
}
-bool LLWindowMacOSX::getSize(LLCoordWindow *size)
+bool LLWindowMacOSX::getSize(LLCoordWindow *size) const
{
S32 err = -1;
@@ -1017,7 +1014,7 @@ void LLWindowMacOSX::restoreGLContext()
CGLSetCurrentContext(mContext);
}
-F32 LLWindowMacOSX::getGamma()
+F32 LLWindowMacOSX::getGamma() const
{
F32 result = 2.2; // Default to something sane
@@ -1041,7 +1038,7 @@ F32 LLWindowMacOSX::getGamma()
&greenGamma,
&blueMin,
&blueMax,
- &blueGamma) == noErr)
+ &blueGamma) == static_cast<CGError>(noErr))
{
// So many choices...
// Let's just return the green channel gamma for now.
@@ -1051,7 +1048,7 @@ F32 LLWindowMacOSX::getGamma()
return result;
}
-U32 LLWindowMacOSX::getFSAASamples()
+U32 LLWindowMacOSX::getFSAASamples() const
{
return mFSAASamples;
}
@@ -1092,7 +1089,7 @@ bool LLWindowMacOSX::setGamma(const F32 gamma)
&greenGamma,
&blueMin,
&blueMax,
- &blueGamma) != noErr)
+ &blueGamma) != static_cast<CGError>(noErr))
{
return false;
}
@@ -1107,7 +1104,7 @@ bool LLWindowMacOSX::setGamma(const F32 gamma)
gamma,
blueMin,
blueMax,
- gamma) != noErr)
+ gamma) != static_cast<CGError>(noErr))
{
return false;
}
@@ -1159,7 +1156,7 @@ bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
newPosition.y = screen_pos.mY;
CGSetLocalEventsSuppressionInterval(0.0);
- if(CGWarpMouseCursorPosition(newPosition) == noErr)
+ if(CGWarpMouseCursorPosition(newPosition) == static_cast<CGError>(noErr))
{
result = true;
}
@@ -1377,21 +1374,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)
{
@@ -1410,7 +1407,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)
{
@@ -1429,14 +1426,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;
@@ -2322,7 +2319,7 @@ bool LLWindowMacOSX::getInputDevices(U32 device_type_filter,
return return_value;
}
-LLSD LLWindowMacOSX::getNativeKeyData()
+LLSD LLWindowMacOSX::getNativeKeyData() const
{
LLSD result = LLSD::emptyMap();
@@ -2506,6 +2503,7 @@ void LLWindowMacOSX::interruptLanguageTextInput()
commitCurrentPreedit(mGLView);
}
+// static
std::vector<std::string> LLWindowMacOSX::getDisplaysResolutionList()
{
std::vector<std::string> resolution_list;
@@ -2535,7 +2533,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.
@@ -2557,6 +2555,11 @@ F32 LLWindowMacOSX::getSystemUISize()
return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getSystemUISize();
}
+void LLWindowMacOSX::openFolder(const std::string &path)
+{
+ openFolderWithFinder(path.c_str());
+}
+
#if LL_OS_DRAGDROP_ENABLED
/*
S16 LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow,