summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rwxr-xr-xindra/llwindow/CMakeLists.txt2
-rwxr-xr-xindra/llwindow/llcursortypes.cpp91
-rwxr-xr-xindra/llwindow/llcursortypes.h79
-rwxr-xr-xindra/llwindow/lldragdropwin32.cpp10
-rwxr-xr-xindra/llwindow/lldragdropwin32.h4
-rwxr-xr-xindra/llwindow/lldxhardware.cpp32
-rwxr-xr-xindra/llwindow/llkeyboard.cpp8
-rwxr-xr-xindra/llwindow/llkeyboard.h3
-rwxr-xr-xindra/llwindow/llkeyboardwin32.cpp7
-rwxr-xr-xindra/llwindow/llmousehandler.cpp4
-rwxr-xr-xindra/llwindow/llwindow.cpp9
-rwxr-xr-xindra/llwindow/llwindow.h1
-rwxr-xr-xindra/llwindow/llwindowmacosx.cpp38
-rwxr-xr-xindra/llwindow/llwindowmesaheadless.cpp4
-rwxr-xr-xindra/llwindow/llwindowsdl.cpp226
-rwxr-xr-xindra/llwindow/llwindowwin32.cpp115
-rwxr-xr-xindra/llwindow/llwindowwin32.h4
17 files changed, 403 insertions, 234 deletions
diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt
index aec6d7af4a..0743fd899f 100755
--- a/indra/llwindow/CMakeLists.txt
+++ b/indra/llwindow/CMakeLists.txt
@@ -38,6 +38,7 @@ include_directories(SYSTEM
)
set(llwindow_SOURCE_FILES
+ llcursortypes.cpp
llkeyboard.cpp
llkeyboardheadless.cpp
llwindowheadless.cpp
@@ -48,6 +49,7 @@ set(llwindow_SOURCE_FILES
set(llwindow_HEADER_FILES
CMakeLists.txt
+ llcursortypes.h
llkeyboard.h
llkeyboardheadless.h
llwindowheadless.h
diff --git a/indra/llwindow/llcursortypes.cpp b/indra/llwindow/llcursortypes.cpp
new file mode 100755
index 0000000000..ec60097195
--- /dev/null
+++ b/indra/llwindow/llcursortypes.cpp
@@ -0,0 +1,91 @@
+/**
+ * @file llcursortypes.cpp
+ * @brief Cursor types and lookup of types from a string
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llcursortypes.h"
+
+ECursorType getCursorFromString(const std::string& cursor_string)
+{
+ static std::map<std::string,U32> cursor_string_table;
+ if (cursor_string_table.empty())
+ {
+ cursor_string_table["UI_CURSOR_ARROW"] = UI_CURSOR_ARROW;
+ cursor_string_table["UI_CURSOR_WAIT"] = UI_CURSOR_WAIT;
+ cursor_string_table["UI_CURSOR_HAND"] = UI_CURSOR_HAND;
+ cursor_string_table["UI_CURSOR_IBEAM"] = UI_CURSOR_IBEAM;
+ cursor_string_table["UI_CURSOR_CROSS"] = UI_CURSOR_CROSS;
+ cursor_string_table["UI_CURSOR_SIZENWSE"] = UI_CURSOR_SIZENWSE;
+ cursor_string_table["UI_CURSOR_SIZENESW"] = UI_CURSOR_SIZENESW;
+ cursor_string_table["UI_CURSOR_SIZEWE"] = UI_CURSOR_SIZEWE;
+ cursor_string_table["UI_CURSOR_SIZENS"] = UI_CURSOR_SIZENS;
+ cursor_string_table["UI_CURSOR_NO"] = UI_CURSOR_NO;
+ cursor_string_table["UI_CURSOR_WORKING"] = UI_CURSOR_WORKING;
+ cursor_string_table["UI_CURSOR_TOOLGRAB"] = UI_CURSOR_TOOLGRAB;
+ cursor_string_table["UI_CURSOR_TOOLLAND"] = UI_CURSOR_TOOLLAND;
+ cursor_string_table["UI_CURSOR_TOOLFOCUS"] = UI_CURSOR_TOOLFOCUS;
+ cursor_string_table["UI_CURSOR_TOOLCREATE"] = UI_CURSOR_TOOLCREATE;
+ cursor_string_table["UI_CURSOR_ARROWDRAG"] = UI_CURSOR_ARROWDRAG;
+ cursor_string_table["UI_CURSOR_ARROWCOPY"] = UI_CURSOR_ARROWCOPY;
+ cursor_string_table["UI_CURSOR_ARROWDRAGMULTI"] = UI_CURSOR_ARROWDRAGMULTI;
+ cursor_string_table["UI_CURSOR_ARROWCOPYMULTI"] = UI_CURSOR_ARROWCOPYMULTI;
+ cursor_string_table["UI_CURSOR_NOLOCKED"] = UI_CURSOR_NOLOCKED;
+ cursor_string_table["UI_CURSOR_ARROWLOCKED"] = UI_CURSOR_ARROWLOCKED;
+ cursor_string_table["UI_CURSOR_GRABLOCKED"] = UI_CURSOR_GRABLOCKED;
+ cursor_string_table["UI_CURSOR_TOOLTRANSLATE"] = UI_CURSOR_TOOLTRANSLATE;
+ cursor_string_table["UI_CURSOR_TOOLROTATE"] = UI_CURSOR_TOOLROTATE;
+ cursor_string_table["UI_CURSOR_TOOLSCALE"] = UI_CURSOR_TOOLSCALE;
+ cursor_string_table["UI_CURSOR_TOOLCAMERA"] = UI_CURSOR_TOOLCAMERA;
+ cursor_string_table["UI_CURSOR_TOOLPAN"] = UI_CURSOR_TOOLPAN;
+ cursor_string_table["UI_CURSOR_TOOLZOOMIN"] = UI_CURSOR_TOOLZOOMIN;
+ cursor_string_table["UI_CURSOR_TOOLPICKOBJECT3"] = UI_CURSOR_TOOLPICKOBJECT3;
+ cursor_string_table["UI_CURSOR_TOOLPLAY"] = UI_CURSOR_TOOLPLAY;
+ cursor_string_table["UI_CURSOR_TOOLPAUSE"] = UI_CURSOR_TOOLPAUSE;
+ cursor_string_table["UI_CURSOR_TOOLMEDIAOPEN"] = UI_CURSOR_TOOLMEDIAOPEN;
+ cursor_string_table["UI_CURSOR_PIPETTE"] = UI_CURSOR_PIPETTE;
+ cursor_string_table["UI_CURSOR_TOOLSIT"] = UI_CURSOR_TOOLSIT;
+ cursor_string_table["UI_CURSOR_TOOLBUY"] = UI_CURSOR_TOOLBUY;
+ cursor_string_table["UI_CURSOR_TOOLOPEN"] = UI_CURSOR_TOOLOPEN;
+ cursor_string_table["UI_CURSOR_TOOLPATHFINDING"] = UI_CURSOR_TOOLPATHFINDING;
+ cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTART"] = UI_CURSOR_TOOLPATHFINDING_PATH_START;
+ cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTARTADD"] = UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD;
+ cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHEND"] = UI_CURSOR_TOOLPATHFINDING_PATH_END;
+ cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHENDADD"] = UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD;
+ cursor_string_table["UI_CURSOR_TOOLNO"] = UI_CURSOR_TOOLNO;
+ }
+
+ std::map<std::string,U32>::const_iterator iter = cursor_string_table.find(cursor_string);
+
+ if (iter != cursor_string_table.end())
+ {
+ return (ECursorType)iter->second;
+ }
+
+ return UI_CURSOR_ARROW;
+}
+
+
+
diff --git a/indra/llwindow/llcursortypes.h b/indra/llwindow/llcursortypes.h
new file mode 100755
index 0000000000..cb6d6636a0
--- /dev/null
+++ b/indra/llwindow/llcursortypes.h
@@ -0,0 +1,79 @@
+/**
+ * @file llcursortypes.h
+ * @brief Cursor types
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLCURSORTYPES_H
+#define LL_LLCURSORTYPES_H
+
+// If you add types here, add them in LLCursor::getCursorFromString
+enum ECursorType {
+ UI_CURSOR_ARROW,
+ UI_CURSOR_WAIT,
+ UI_CURSOR_HAND,
+ UI_CURSOR_IBEAM,
+ UI_CURSOR_CROSS,
+ UI_CURSOR_SIZENWSE,
+ UI_CURSOR_SIZENESW,
+ UI_CURSOR_SIZEWE,
+ UI_CURSOR_SIZENS,
+ UI_CURSOR_NO,
+ UI_CURSOR_WORKING,
+ UI_CURSOR_TOOLGRAB,
+ UI_CURSOR_TOOLLAND,
+ UI_CURSOR_TOOLFOCUS,
+ UI_CURSOR_TOOLCREATE,
+ UI_CURSOR_ARROWDRAG,
+ UI_CURSOR_ARROWCOPY, // drag with copy
+ UI_CURSOR_ARROWDRAGMULTI,
+ UI_CURSOR_ARROWCOPYMULTI, // drag with copy
+ UI_CURSOR_NOLOCKED,
+ UI_CURSOR_ARROWLOCKED,
+ UI_CURSOR_GRABLOCKED,
+ UI_CURSOR_TOOLTRANSLATE,
+ UI_CURSOR_TOOLROTATE,
+ UI_CURSOR_TOOLSCALE,
+ UI_CURSOR_TOOLCAMERA,
+ UI_CURSOR_TOOLPAN,
+ UI_CURSOR_TOOLZOOMIN,
+ UI_CURSOR_TOOLPICKOBJECT3,
+ UI_CURSOR_TOOLPLAY,
+ UI_CURSOR_TOOLPAUSE,
+ UI_CURSOR_TOOLMEDIAOPEN,
+ UI_CURSOR_PIPETTE,
+ UI_CURSOR_TOOLSIT,
+ UI_CURSOR_TOOLBUY,
+ UI_CURSOR_TOOLOPEN,
+ UI_CURSOR_TOOLPATHFINDING,
+ UI_CURSOR_TOOLPATHFINDING_PATH_START,
+ UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD,
+ UI_CURSOR_TOOLPATHFINDING_PATH_END,
+ UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD,
+ UI_CURSOR_TOOLNO,
+ UI_CURSOR_COUNT // Number of elements in this enum (NOT a cursor)
+};
+
+LL_COMMON_API ECursorType getCursorFromString(const std::string& cursor_string);
+
+#endif // LL_LLCURSORTYPES_H
diff --git a/indra/llwindow/lldragdropwin32.cpp b/indra/llwindow/lldragdropwin32.cpp
index 15acddd987..d00d9ab47e 100755
--- a/indra/llwindow/lldragdropwin32.cpp
+++ b/indra/llwindow/lldragdropwin32.cpp
@@ -242,11 +242,11 @@ class LLDragDropWin32Target:
LLCoordWindow cursor_coord_window( pt_client.x, pt_client.y );
LLCoordGL gl_coord(cursor_coord_window.convert());
- llinfos << "### (Drop) URL is: " << mDropUrl << llendl;
- llinfos << "### raw coords are: " << pt.x << " x " << pt.y << llendl;
- llinfos << "### client coords are: " << pt_client.x << " x " << pt_client.y << llendl;
- llinfos << "### GL coords are: " << gl_coord.mX << " x " << gl_coord.mY << llendl;
- llinfos << llendl;
+ LL_INFOS() << "### (Drop) URL is: " << mDropUrl << LL_ENDL;
+ LL_INFOS() << "### raw coords are: " << pt.x << " x " << pt.y << LL_ENDL;
+ LL_INFOS() << "### client coords are: " << pt_client.x << " x " << pt_client.y << LL_ENDL;
+ LL_INFOS() << "### GL coords are: " << gl_coord.mX << " x " << gl_coord.mY << LL_ENDL;
+ LL_INFOS() << LL_ENDL;
// no keyboard modifier option yet but we could one day
MASK mask = gKeyboard->currentMask( TRUE );
diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h
index a6824f3e90..4673242cba 100755
--- a/indra/llwindow/lldragdropwin32.h
+++ b/indra/llwindow/lldragdropwin32.h
@@ -31,7 +31,7 @@
#ifndef LL_LLDRAGDROP32_H
#define LL_LLDRAGDROP32_H
-#include <windows.h>
+#include "llwin32headerslean.h"
#include <ole2.h>
class LLDragDropWin32
@@ -54,7 +54,7 @@ class LLDragDropWin32
#ifndef LL_LLDRAGDROP32_H
#define LL_LLDRAGDROP32_H
-#include <windows.h>
+#include "llwin32headerslean.h"
#include <ole2.h>
// impostor class that does nothing
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index 3579b5d42f..f34af324ef 100755
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -120,7 +120,7 @@ BOOL LLVersion::set(const std::string &version_string)
}
if (count < 4)
{
- //llwarns << "Potentially bogus version string!" << version_string << llendl;
+ //LL_WARNS() << "Potentially bogus version string!" << version_string << LL_ENDL;
for (i = 0; i < 4; i++)
{
mFields[i] = 0;
@@ -160,10 +160,10 @@ std::string LLDXDriverFile::dump()
gWriteDebug(mDateString.c_str());
gWriteDebug("\n");
}
- llinfos << mFilepath << llendl;
- llinfos << mName << llendl;
- llinfos << mVersionString << llendl;
- llinfos << mDateString << llendl;
+ LL_INFOS() << mFilepath << LL_ENDL;
+ LL_INFOS() << mName << LL_ENDL;
+ LL_INFOS() << mVersionString << LL_ENDL;
+ LL_INFOS() << mDateString << LL_ENDL;
return "";
}
@@ -185,11 +185,11 @@ std::string LLDXDevice::dump()
gWriteDebug(mPCIString.c_str());
gWriteDebug("\n");
}
- llinfos << llendl;
- llinfos << "DeviceName:" << mName << llendl;
- llinfos << "PCIString:" << mPCIString << llendl;
- llinfos << "Drivers" << llendl;
- llinfos << "-------" << llendl;
+ LL_INFOS() << LL_ENDL;
+ LL_INFOS() << "DeviceName:" << mName << LL_ENDL;
+ LL_INFOS() << "PCIString:" << mPCIString << LL_ENDL;
+ LL_INFOS() << "Drivers" << LL_ENDL;
+ LL_INFOS() << "-------" << LL_ENDL;
for (driver_file_map_t::iterator iter = mDriverFiles.begin(),
end = mDriverFiles.end();
iter != end; iter++)
@@ -549,7 +549,7 @@ LLSD LLDXHardware::getDisplayInfo()
IDxDiagContainer *driver_containerp = NULL;
// CoCreate a IDxDiagProvider*
- llinfos << "CoCreateInstance IID_IDxDiagProvider" << llendl;
+ LL_INFOS() << "CoCreateInstance IID_IDxDiagProvider" << LL_ENDL;
hr = CoCreateInstance(CLSID_DxDiagProvider,
NULL,
CLSCTX_INPROC_SERVER,
@@ -558,7 +558,7 @@ LLSD LLDXHardware::getDisplayInfo()
if (FAILED(hr))
{
- llwarns << "No DXDiag provider found! DirectX 9 not installed!" << llendl;
+ LL_WARNS() << "No DXDiag provider found! DirectX 9 not installed!" << LL_ENDL;
gWriteDebug("No DXDiag provider found! DirectX 9 not installed!\n");
goto LCleanup;
}
@@ -576,14 +576,14 @@ LLSD LLDXHardware::getDisplayInfo()
dx_diag_init_params.bAllowWHQLChecks = TRUE;
dx_diag_init_params.pReserved = NULL;
- llinfos << "dx_diag_providerp->Initialize" << llendl;
+ LL_INFOS() << "dx_diag_providerp->Initialize" << LL_ENDL;
hr = dx_diag_providerp->Initialize(&dx_diag_init_params);
if(FAILED(hr))
{
goto LCleanup;
}
- llinfos << "dx_diag_providerp->GetRootContainer" << llendl;
+ LL_INFOS() << "dx_diag_providerp->GetRootContainer" << LL_ENDL;
hr = dx_diag_providerp->GetRootContainer( &dx_diag_rootp );
if(FAILED(hr) || !dx_diag_rootp)
{
@@ -593,7 +593,7 @@ LLSD LLDXHardware::getDisplayInfo()
HRESULT hr;
// Get display driver information
- llinfos << "dx_diag_rootp->GetChildContainer" << llendl;
+ LL_INFOS() << "dx_diag_rootp->GetChildContainer" << LL_ENDL;
hr = dx_diag_rootp->GetChildContainer(L"DxDiag_DisplayDevices", &devices_containerp);
if(FAILED(hr) || !devices_containerp)
{
@@ -601,7 +601,7 @@ LLSD LLDXHardware::getDisplayInfo()
}
// Get device 0
- llinfos << "devices_containerp->GetChildContainer" << llendl;
+ LL_INFOS() << "devices_containerp->GetChildContainer" << LL_ENDL;
hr = devices_containerp->GetChildContainer(L"0", &device_containerp);
if(FAILED(hr) || !device_containerp)
{
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index 8b356ba138..f6f6c3931c 100755
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -187,7 +187,7 @@ BOOL LLKeyboard::translateKey(const U16 os_key, KEY *out_key)
iter = mTranslateKeyMap.find(os_key);
if (iter == mTranslateKeyMap.end())
{
- //llwarns << "Unknown virtual key " << os_key << llendl;
+ //LL_WARNS() << "Unknown virtual key " << os_key << LL_ENDL;
*out_key = 0;
return FALSE;
}
@@ -258,7 +258,7 @@ BOOL LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask)
handled = mCallbacks->handleTranslatedKeyUp(translated_key, translated_mask);
}
- lldebugst(LLERR_USER_INPUT) << "keyup -" << translated_key << "-" << llendl;
+ LL_DEBUGS("UserInput") << "keyup -" << translated_key << "-" << LL_ENDL;
return handled;
}
@@ -321,7 +321,7 @@ BOOL LLKeyboard::keyFromString(const std::string& str, KEY *key)
*key = res;
return TRUE;
}
- llwarns << "keyFromString failed: " << str << llendl;
+ LL_WARNS() << "keyFromString failed: " << str << LL_ENDL;
return FALSE;
}
@@ -363,7 +363,7 @@ std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key )
if( trans == NULL )
{
- llerrs << "No mKeyStringTranslator" << llendl;
+ LL_ERRS() << "No mKeyStringTranslator" << LL_ENDL;
return res;
}
diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h
index 92449c123f..6f2dc87317 100755
--- a/indra/llwindow/llkeyboard.h
+++ b/indra/llwindow/llkeyboard.h
@@ -28,8 +28,9 @@
#define LL_LLKEYBOARD_H
#include <map>
+#include <boost/function.hpp>
-#include "string_table.h"
+#include "llstringtable.h"
#include "lltimer.h"
#include "indra_constants.h"
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index be3fe5deb0..dc40dcdde0 100755
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -28,10 +28,7 @@
#include "linden_common.h"
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
-
+#include "llwin32headerslean.h"
#include "llkeyboardwin32.h"
#include "llwindowcallbacks.h"
@@ -269,7 +266,7 @@ void LLKeyboardWin32::scanKeyboard()
// keydown in highest bit
if (!pending_key_events && !(GetAsyncKeyState(virtual_key) & 0x8000))
{
- //llinfos << "Key up event missed, resetting" << llendl;
+ //LL_INFOS() << "Key up event missed, resetting" << LL_ENDL;
mKeyLevel[key] = FALSE;
}
}
diff --git a/indra/llwindow/llmousehandler.cpp b/indra/llwindow/llmousehandler.cpp
index 8695e92f77..bea66e763c 100755
--- a/indra/llwindow/llmousehandler.cpp
+++ b/indra/llwindow/llmousehandler.cpp
@@ -39,7 +39,7 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
default:
- llwarns << "Unhandled enum." << llendl;
+ LL_WARNS() << "Unhandled enum." << LL_ENDL;
}
}
else
@@ -51,7 +51,7 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
default:
- llwarns << "Unhandled enum." << llendl;
+ LL_WARNS() << "Unhandled enum." << LL_ENDL;
}
}
return handled;
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 93b9d36939..466c3baccf 100755
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -39,7 +39,6 @@
#include "llerror.h"
#include "llkeyboard.h"
-#include "linked_lists.h"
#include "llwindowcallbacks.h"
@@ -73,7 +72,7 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
S32 result = 0;
#if LL_MESA_HEADLESS // !!! *FIX: (???)
- llwarns << "OSMessageBox: " << text << llendl;
+ LL_WARNS() << "OSMessageBox: " << text << LL_ENDL;
return OSBTN_OK;
#elif LL_WINDOWS
result = OSMessageBoxWin32(text, caption, type);
@@ -423,7 +422,7 @@ LLWindow* LLWindowManager::createWindow(
if (FALSE == new_window->isValid())
{
delete new_window;
- llwarns << "LLWindowManager::create() : Error creating window." << llendl;
+ LL_WARNS() << "LLWindowManager::create() : Error creating window." << LL_ENDL;
return NULL;
}
sWindowList.insert(new_window);
@@ -434,8 +433,8 @@ BOOL LLWindowManager::destroyWindow(LLWindow* window)
{
if (sWindowList.find(window) == sWindowList.end())
{
- llerrs << "LLWindowManager::destroyWindow() : Window pointer not valid, this window doesn't exist!"
- << llendl;
+ LL_ERRS() << "LLWindowManager::destroyWindow() : Window pointer not valid, this window doesn't exist!"
+ << LL_ENDL;
return FALSE;
}
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 78186004b8..ee1b0bbffb 100755
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -31,6 +31,7 @@
#include "llcoord.h"
#include "llstring.h"
#include "llcursortypes.h"
+#include "llinstancetracker.h"
#include "llsd.h"
class LLSplashScreen;
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 11c0b51086..b771e125f9 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -785,7 +785,7 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position)
}
else
{
- llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl;
+ LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
}
return (err == noErr);
@@ -811,7 +811,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)
}
else
{
- llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl;
+ LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
}
return (err == noErr);
@@ -837,7 +837,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size)
}
else
{
- llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl;
+ LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
}
return (err == noErr);
@@ -998,11 +998,11 @@ void LLWindowMacOSX::setMouseClipping( BOOL b )
if(b)
{
- // llinfos << "setMouseClipping(TRUE)" << llendl;
+ // LL_INFOS() << "setMouseClipping(TRUE)" << LL_ENDL;
}
else
{
- // llinfos << "setMouseClipping(FALSE)" << llendl;
+ // LL_INFOS() << "setMouseClipping(FALSE)" << LL_ENDL;
}
adjustCursorDecouple();
@@ -1020,7 +1020,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
CGPoint newPosition;
- // llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl;
+ // LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL;
newPosition.x = screen_pos.mX;
newPosition.y = screen_pos.mY;
@@ -1082,7 +1082,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse)
// The cursor should be decoupled. Make sure it is.
if(!mCursorDecoupled)
{
- // llinfos << "adjustCursorDecouple: decoupling cursor" << llendl;
+ // LL_INFOS() << "adjustCursorDecouple: decoupling cursor" << LL_ENDL;
CGAssociateMouseAndMouseCursorPosition(false);
mCursorDecoupled = true;
mCursorIgnoreNextDelta = TRUE;
@@ -1094,7 +1094,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse)
// The cursor should not be decoupled. Make sure it isn't.
if(mCursorDecoupled)
{
- // llinfos << "adjustCursorDecouple: recoupling cursor" << llendl;
+ // LL_INFOS() << "adjustCursorDecouple: recoupling cursor" << LL_ENDL;
CGAssociateMouseAndMouseCursorPosition(true);
mCursorDecoupled = false;
}
@@ -1359,7 +1359,7 @@ const char* cursorIDToName(int id)
case UI_CURSOR_TOOLNO: return "UI_CURSOR_NO";
}
- llerrs << "cursorIDToName: unknown cursor id" << id << llendl;
+ LL_ERRS() << "cursorIDToName: unknown cursor id" << id << LL_ENDL;
return "UI_CURSOR_ARROW";
}
@@ -1542,14 +1542,14 @@ void LLWindowMacOSX::hideCursor()
{
if(!mCursorHidden)
{
- // llinfos << "hideCursor: hiding" << llendl;
+ // LL_INFOS() << "hideCursor: hiding" << LL_ENDL;
mCursorHidden = TRUE;
mHideCursorPermanent = TRUE;
hideNSCursor();
}
else
{
- // llinfos << "hideCursor: already hidden" << llendl;
+ // LL_INFOS() << "hideCursor: already hidden" << LL_ENDL;
}
adjustCursorDecouple();
@@ -1559,14 +1559,14 @@ void LLWindowMacOSX::showCursor()
{
if(mCursorHidden)
{
- // llinfos << "showCursor: showing" << llendl;
+ // LL_INFOS() << "showCursor: showing" << LL_ENDL;
mCursorHidden = FALSE;
mHideCursorPermanent = FALSE;
showNSCursor();
}
else
{
- // llinfos << "showCursor: already visible" << llendl;
+ // LL_INFOS() << "showCursor: already visible" << LL_ENDL;
}
adjustCursorDecouple();
@@ -1651,14 +1651,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)
if (!found)
{
- llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl;
+ LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;
return;
}
S32 result = 0;
CFURLRef urlRef = NULL;
- llinfos << "Opening URL " << escaped_url << llendl;
+ LL_INFOS() << "Opening URL " << escaped_url << LL_ENDL;
CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8);
if (stringRef)
@@ -1678,14 +1678,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)
if (result != noErr)
{
- llinfos << "Error " << result << " on open." << llendl;
+ LL_INFOS() << "Error " << result << " on open." << LL_ENDL;
}
CFRelease(urlRef);
}
else
{
- llinfos << "Error: couldn't create URL." << llendl;
+ LL_INFOS() << "Error: couldn't create URL." << LL_ENDL;
}
}
@@ -1738,7 +1738,7 @@ LLSD LLWindowMacOSX::getNativeKeyData()
}
#endif
- lldebugs << "native key data is: " << result << llendl;
+ LL_DEBUGS() << "native key data is: " << result << LL_ENDL;
return result;
}
@@ -1849,7 +1849,7 @@ S16 LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef t
S16 result = 0;
LLWindowMacOSX *self = (LLWindowMacOSX*)handlerRefCon;
- lldebugs << "drag tracking handler, message = " << message << llendl;
+ LL_DEBUGS() << "drag tracking handler, message = " << message << LL_ENDL;
switch(message)
{
diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp
index 11c22ac94e..4b01f7a979 100755
--- a/indra/llwindow/llwindowmesaheadless.cpp
+++ b/indra/llwindow/llwindowmesaheadless.cpp
@@ -46,7 +46,7 @@ LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
{
if (use_gl)
{
- llinfos << "MESA Init" << llendl;
+ LL_INFOS() << "MESA Init" << LL_ENDL;
mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
/* Allocate the image buffer */
@@ -58,7 +58,7 @@ LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
/* Bind the buffer to the context and make it current */
if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
{
- llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
+ LL_ERRS() << "MESA: OSMesaMakeCurrent failed!" << LL_ENDL;
}
llverify(gGLManager.initGL());
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 205466e936..bb77a24590 100755
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -109,7 +109,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)
if (!done_setlocale)
{
- llinfos << "Starting GTK Initialization." << llendl;
+ LL_INFOS() << "Starting GTK Initialization." << LL_ENDL;
maybe_lock_display();
gtk_disable_setlocale();
maybe_unlock_display();
@@ -124,20 +124,20 @@ bool LLWindowSDL::ll_try_gtk_init(void)
gtk_is_good = gtk_init_check(NULL, NULL);
maybe_unlock_display();
if (!gtk_is_good)
- llwarns << "GTK Initialization failed." << llendl;
+ LL_WARNS() << "GTK Initialization failed." << LL_ENDL;
}
if (gtk_is_good && !done_gtk_diag)
{
- llinfos << "GTK Initialized." << llendl;
- llinfos << "- Compiled against GTK version "
+ LL_INFOS() << "GTK Initialized." << LL_ENDL;
+ LL_INFOS() << "- Compiled against GTK version "
<< GTK_MAJOR_VERSION << "."
<< GTK_MINOR_VERSION << "."
- << GTK_MICRO_VERSION << llendl;
- llinfos << "- Running against GTK version "
+ << GTK_MICRO_VERSION << LL_ENDL;
+ LL_INFOS() << "- Running against GTK version "
<< gtk_major_version << "."
<< gtk_minor_version << "."
- << gtk_micro_version << llendl;
+ << gtk_micro_version << LL_ENDL;
maybe_lock_display();
const gchar* gtk_warning = gtk_check_version(
GTK_MAJOR_VERSION,
@@ -146,11 +146,11 @@ bool LLWindowSDL::ll_try_gtk_init(void)
maybe_unlock_display();
if (gtk_warning)
{
- llwarns << "- GTK COMPATIBILITY WARNING: " <<
- gtk_warning << llendl;
+ LL_WARNS() << "- GTK COMPATIBILITY WARNING: " <<
+ gtk_warning << LL_ENDL;
gtk_is_good = FALSE;
} else {
- llinfos << "- GTK version is good." << llendl;
+ LL_INFOS() << "- GTK version is good." << LL_ENDL;
}
done_gtk_diag = TRUE;
@@ -278,7 +278,7 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)
char line_buf[line_buf_size];
while (fgets(line_buf, line_buf_size, fp))
{
- //lldebugs << "XLOG: " << line_buf << llendl;
+ //LL_DEBUGS() << "XLOG: " << line_buf << LL_ENDL;
// Why the ad-hoc parser instead of using a regex? Our
// favourite regex implementation - libboost_regex - is
@@ -353,8 +353,8 @@ static int x11_detect_VRAM_kb()
fp = fopen(fname.c_str(), "r");
if (fp)
{
- llinfos << "Looking in " << fname
- << " for VRAM info..." << llendl;
+ LL_INFOS() << "Looking in " << fname
+ << " for VRAM info..." << LL_ENDL;
rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: ");
fclose(fp);
if (0 == rtn)
@@ -378,8 +378,8 @@ static int x11_detect_VRAM_kb()
}
else
{
- llinfos << "Could not open " << fname
- << " - skipped." << llendl;
+ LL_INFOS() << "Could not open " << fname
+ << " - skipped." << LL_ENDL;
// Try old XFree86 log otherwise
fname = x_log_location;
fname += "XFree86.";
@@ -388,8 +388,8 @@ static int x11_detect_VRAM_kb()
fp = fopen(fname.c_str(), "r");
if (fp)
{
- llinfos << "Looking in " << fname
- << " for VRAM info..." << llendl;
+ LL_INFOS() << "Looking in " << fname
+ << " for VRAM info..." << LL_ENDL;
rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: ");
fclose(fp);
if (0 == rtn)
@@ -404,8 +404,8 @@ static int x11_detect_VRAM_kb()
}
else
{
- llinfos << "Could not open " << fname
- << " - skipped." << llendl;
+ LL_INFOS() << "Could not open " << fname
+ << " - skipped." << LL_ENDL;
}
}
return rtn;
@@ -417,8 +417,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
{
//bool glneedsinit = false;
- llinfos << "createContext, fullscreen=" << fullscreen <<
- " size=" << width << "x" << height << llendl;
+ LL_INFOS() << "createContext, fullscreen=" << fullscreen <<
+ " size=" << width << "x" << height << LL_ENDL;
// captures don't survive contexts
mGrabbyKeyFlags = 0;
@@ -426,28 +426,28 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
- llinfos << "sdl_init() failed! " << SDL_GetError() << llendl;
+ LL_INFOS() << "sdl_init() failed! " << SDL_GetError() << LL_ENDL;
setupFailure("sdl_init() failure, window creation error", "error", OSMB_OK);
return false;
}
SDL_version c_sdl_version;
SDL_VERSION(&c_sdl_version);
- llinfos << "Compiled against SDL "
+ LL_INFOS() << "Compiled against SDL "
<< int(c_sdl_version.major) << "."
<< int(c_sdl_version.minor) << "."
- << int(c_sdl_version.patch) << llendl;
+ << int(c_sdl_version.patch) << LL_ENDL;
const SDL_version *r_sdl_version;
r_sdl_version = SDL_Linked_Version();
- llinfos << " Running against SDL "
+ LL_INFOS() << " Running against SDL "
<< int(r_sdl_version->major) << "."
<< int(r_sdl_version->minor) << "."
- << int(r_sdl_version->patch) << llendl;
+ << int(r_sdl_version->patch) << LL_ENDL;
const SDL_VideoInfo *video_info = SDL_GetVideoInfo( );
if (!video_info)
{
- llinfos << "SDL_GetVideoInfo() failed! " << SDL_GetError() << llendl;
+ LL_INFOS() << "SDL_GetVideoInfo() failed! " << SDL_GetError() << LL_ENDL;
setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK);
return FALSE;
}
@@ -455,7 +455,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (video_info->current_h > 0)
{
mOriginalAspectRatio = (float)video_info->current_w / (float)video_info->current_h;
- llinfos << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << llendl;
+ LL_INFOS() << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << LL_ENDL;
}
SDL_EnableUNICODE(1);
@@ -525,7 +525,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (mFullscreen)
{
- llinfos << "createContext: setting up fullscreen " << width << "x" << height << llendl;
+ LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL;
// If the requested width or height is 0, find the best default for the monitor.
if((width == 0) || (height == 0))
@@ -543,18 +543,18 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
U32 closestWidth = 0;
int i;
- llinfos << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << llendl;
+ LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL;
for(i=0; i < resolutionCount; i++)
{
F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight;
- llinfos << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << llendl;
+ LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL;
if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) &&
(fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio)))
{
- llinfos << " (new closest mode) " << llendl;
+ LL_INFOS() << " (new closest mode) " << LL_ENDL;
// This is the closest mode we've seen yet.
closestWidth = resolutionList[i].mWidth;
@@ -590,15 +590,15 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
mFullscreenBits = mWindow->format->BitsPerPixel;
mFullscreenRefresh = -1;
- llinfos << "Running at " << mFullscreenWidth
+ LL_INFOS() << "Running at " << mFullscreenWidth
<< "x" << mFullscreenHeight
<< "x" << mFullscreenBits
<< " @ " << mFullscreenRefresh
- << llendl;
+ << LL_ENDL;
}
else
{
- llwarns << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << llendl;
+ LL_WARNS() << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << LL_ENDL;
// No fullscreen support
mFullscreen = FALSE;
mFullscreenWidth = -1;
@@ -618,7 +618,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (height == 0)
width = 768;
- llinfos << "createContext: creating window " << width << "x" << height << "x" << bits << llendl;
+ LL_INFOS() << "createContext: creating window " << width << "x" << height << "x" << bits << LL_ENDL;
mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
if (!mWindow && bits > 16)
{
@@ -628,13 +628,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (!mWindow)
{
- llwarns << "createContext: window creation failure. SDL: " << SDL_GetError() << llendl;
+ LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL;
setupFailure("Window creation error", "Error", OSMB_OK);
return FALSE;
}
} else if (!mFullscreen && (mWindow != NULL))
{
- llinfos << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << llendl;
+ LL_INFOS() << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << LL_ENDL;
}
// Detect video memory size.
@@ -642,7 +642,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024;
if (gGLManager.mVRAM != 0)
{
- llinfos << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << llendl;
+ LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;
} else
# endif // LL_X11
{
@@ -652,7 +652,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
gGLManager.mVRAM = video_info->video_mem / 1024;
if (gGLManager.mVRAM != 0)
{
- llinfos << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << llendl;
+ LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;
}
}
// If VRAM is not detected, that is handled later
@@ -670,13 +670,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
glGetIntegerv(GL_DEPTH_BITS, &depthBits);
glGetIntegerv(GL_STENCIL_BITS, &stencilBits);
- llinfos << "GL buffer:" << llendl;
- llinfos << " Red Bits " << S32(redBits) << llendl;
- llinfos << " Green Bits " << S32(greenBits) << llendl;
- llinfos << " Blue Bits " << S32(blueBits) << llendl;
- llinfos << " Alpha Bits " << S32(alphaBits) << llendl;
- llinfos << " Depth Bits " << S32(depthBits) << llendl;
- llinfos << " Stencil Bits " << S32(stencilBits) << llendl;
+ LL_INFOS() << "GL buffer:" << LL_ENDL;
+ LL_INFOS() << " Red Bits " << S32(redBits) << LL_ENDL;
+ LL_INFOS() << " Green Bits " << S32(greenBits) << LL_ENDL;
+ LL_INFOS() << " Blue Bits " << S32(blueBits) << LL_ENDL;
+ LL_INFOS() << " Alpha Bits " << S32(alphaBits) << LL_ENDL;
+ LL_INFOS() << " Depth Bits " << S32(depthBits) << LL_ENDL;
+ LL_INFOS() << " Stencil Bits " << S32(stencilBits) << LL_ENDL;
GLint colorBits = redBits + greenBits + blueBits + alphaBits;
// fixme: actually, it's REALLY important for picking that we get at
@@ -741,14 +741,14 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
}
else
{
- llwarns << "We're not running under X11? Wild."
- << llendl;
+ LL_WARNS() << "We're not running under X11? Wild."
+ << LL_ENDL;
}
}
else
{
- llwarns << "We're not running under any known WM. Wild."
- << llendl;
+ LL_WARNS() << "We're not running under any known WM. Wild."
+ << LL_ENDL;
}
#endif // LL_X11
@@ -759,7 +759,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
// We need to do this here, once video is init'd
if (-1 == SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
SDL_DEFAULT_REPEAT_INTERVAL))
- llwarns << "Couldn't enable key-repeat: " << SDL_GetError() <<llendl;
+ LL_WARNS() << "Couldn't enable key-repeat: " << SDL_GetError() <<LL_ENDL;
// Don't need to get the current gamma, since there's a call that restores it to the system defaults.
return TRUE;
@@ -772,7 +772,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL
const BOOL needsRebuild = TRUE; // Just nuke the context and start over.
BOOL result = true;
- llinfos << "switchContext, fullscreen=" << fullscreen << llendl;
+ LL_INFOS() << "switchContext, fullscreen=" << fullscreen << LL_ENDL;
stop_glerror();
if(needsRebuild)
{
@@ -795,7 +795,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL
void LLWindowSDL::destroyContext()
{
- llinfos << "destroyContext begins" << llendl;
+ LL_INFOS() << "destroyContext begins" << LL_ENDL;
#if LL_X11
mSDL_Display = NULL;
@@ -805,9 +805,9 @@ void LLWindowSDL::destroyContext()
#endif // LL_X11
// Clean up remaining GL state before blowing away window
- llinfos << "shutdownGL begins" << llendl;
+ LL_INFOS() << "shutdownGL begins" << LL_ENDL;
gGLManager.shutdownGL();
- llinfos << "SDL_QuitSS/VID begins" << llendl;
+ LL_INFOS() << "SDL_QuitSS/VID begins" << LL_ENDL;
SDL_QuitSubSystem(SDL_INIT_VIDEO); // *FIX: this might be risky...
mWindow = NULL;
@@ -1081,12 +1081,12 @@ BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position)
return FALSE;
}
- //llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl;
+ //LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL;
// do the actual forced cursor move.
SDL_WarpMouse(screen_pos.mX, screen_pos.mY);
- //llinfos << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << llendl;
+ //LL_INFOS() << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << LL_ENDL;
return result;
}
@@ -1171,7 +1171,7 @@ void LLWindowSDL::beforeDialog()
running_x11 = (mSDL_XWindowID != None);
#endif //LL_X11
- llinfos << "LLWindowSDL::beforeDialog()" << llendl;
+ LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL;
if (SDLReallyCaptureInput(FALSE)) // must ungrab input so popup works!
{
@@ -1214,7 +1214,7 @@ void LLWindowSDL::afterDialog()
running_x11 = (mSDL_XWindowID != None);
#endif //LL_X11
- llinfos << "LLWindowSDL::afterDialog()" << llendl;
+ LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL;
maybe_unlock_display();
@@ -1238,7 +1238,7 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
{
XWMHints *wm_hints;
- llinfos << "X11 hint for urgency, " << urgent << llendl;
+ LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL;
maybe_lock_display();
wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID);
@@ -1261,9 +1261,9 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
void LLWindowSDL::flashIcon(F32 seconds)
{
#if !LL_X11
- llinfos << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << llendl;
+ LL_INFOS() << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL;
#else
- llinfos << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << llendl;
+ LL_INFOS() << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL;
F32 remaining_time = mFlashTimer.getRemainingTimeF32();
if (remaining_time < seconds)
@@ -1530,7 +1530,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
if (mReallyCapturedCount < 0) // yuck, imbalance.
{
mReallyCapturedCount = 0;
- llwarns << "ReallyCapture count was < 0" << llendl;
+ LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL;
}
if (!mFullscreen) /* only bother if we're windowed anyway */
@@ -1550,7 +1550,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
int result;
if (wantmode == SDL_GRAB_ON)
{
- //llinfos << "X11 POINTER GRABBY" << llendl;
+ //LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL;
//newmode = SDL_WM_GrabInput(wantmode);
maybe_lock_display();
result = XGrabPointer(mSDL_Display, mSDL_XWindowID,
@@ -1564,7 +1564,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
newmode = SDL_GRAB_OFF;
} else if (wantmode == SDL_GRAB_OFF)
{
- //llinfos << "X11 POINTER UNGRABBY" << llendl;
+ //LL_INFOS() << "X11 POINTER UNGRABBY" << LL_ENDL;
newmode = SDL_GRAB_OFF;
//newmode = SDL_WM_GrabInput(SDL_GRAB_OFF);
@@ -1625,7 +1625,7 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain)
else
mGrabbyKeyFlags &= ~mask;
- //llinfos << "mGrabbyKeyFlags=" << mGrabbyKeyFlags << llendl;
+ //LL_INFOS() << "mGrabbyKeyFlags=" << mGrabbyKeyFlags << LL_ENDL;
/* 0 means we don't need to mousegrab, otherwise grab. */
return mGrabbyKeyFlags;
@@ -1655,7 +1655,7 @@ void check_vm_bloat()
res = getdelim(&ptr, &dummy, ' ', fp);
if (-1 == res)
{
- llwarns << "Unable to parse " << STATS_FILE << llendl;
+ LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;
goto finally;
}
free(ptr);
@@ -1666,7 +1666,7 @@ void check_vm_bloat()
llassert(ptr);
if (-1 == res)
{
- llwarns << "Unable to parse " << STATS_FILE << llendl;
+ LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;
goto finally;
}
this_vm_size = atoll(ptr);
@@ -1677,25 +1677,25 @@ void check_vm_bloat()
llassert(ptr);
if (-1 == res)
{
- llwarns << "Unable to parse " << STATS_FILE << llendl;
+ LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;
goto finally;
}
this_rss_size = getpagesize() * atoll(ptr);
free(ptr);
ptr = NULL;
- llinfos << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << llendl;
+ LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL;
if (llabs(last_vm_size - this_vm_size) >
significant_vm_difference)
{
if (this_vm_size > last_vm_size)
{
- llwarns << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
else
{
- llinfos << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
}
@@ -1704,11 +1704,11 @@ void check_vm_bloat()
{
if (this_rss_size > last_rss_size)
{
- llwarns << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
else
{
- llinfos << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
}
@@ -1905,8 +1905,8 @@ void LLWindowSDL::gatherInput()
case SDL_VIDEORESIZE: // *FIX: handle this?
{
- llinfos << "Handling a resize event: " << event.resize.w <<
- "x" << event.resize.h << llendl;
+ LL_INFOS() << "Handling a resize event: " << event.resize.w <<
+ "x" << event.resize.h << LL_ENDL;
S32 width = llmax(event.resize.w, (S32)mMinWindowWidth);
S32 height = llmax(event.resize.h, (S32)mMinWindowHeight);
@@ -1916,7 +1916,7 @@ void LLWindowSDL::gatherInput()
if (!mWindow)
{
// *FIX: More informative dialog?
- llinfos << "Could not recreate context after resize! Quitting..." << llendl;
+ LL_INFOS() << "Could not recreate context after resize! Quitting..." << LL_ENDL;
if(mCallbacks->handleCloseRequest(this))
{
// Get the app to initiate cleanup.
@@ -1957,11 +1957,11 @@ void LLWindowSDL::gatherInput()
mIsMinimized = (!event.active.gain);
mCallbacks->handleActivate(this, !mIsMinimized);
- llinfos << "SDL deiconification state switched to " << BOOL(event.active.gain) << llendl;
+ LL_INFOS() << "SDL deiconification state switched to " << BOOL(event.active.gain) << LL_ENDL;
}
else
{
- llinfos << "Ignored bogus redundant SDL deiconification state switch to " << BOOL(event.active.gain) << llendl;
+ LL_INFOS() << "Ignored bogus redundant SDL deiconification state switch to " << BOOL(event.active.gain) << LL_ENDL;
}
}
break;
@@ -1975,7 +1975,7 @@ void LLWindowSDL::gatherInput()
}
break;
default:
- //llinfos << "Unhandled SDL event type " << event.type << llendl;
+ //LL_INFOS() << "Unhandled SDL event type " << event.type << LL_ENDL;
break;
}
}
@@ -2003,8 +2003,8 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
if (bmpsurface && bmpsurface->w%8==0)
{
SDL_Surface *cursurface;
- lldebugs << "Loaded cursor file " << filename << " "
- << bmpsurface->w << "x" << bmpsurface->h << llendl;
+ LL_DEBUGS() << "Loaded cursor file " << filename << " "
+ << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL;
cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE,
bmpsurface->w,
bmpsurface->h,
@@ -2056,12 +2056,12 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
delete[] cursor_data;
delete[] cursor_mask;
} else {
- llwarns << "CURSOR BLIT FAILURE, cursurface: " << cursurface << llendl;
+ LL_WARNS() << "CURSOR BLIT FAILURE, cursurface: " << cursurface << LL_ENDL;
}
SDL_FreeSurface(cursurface);
SDL_FreeSurface(bmpsurface);
} else {
- llwarns << "CURSOR LOAD FAILURE " << filename << llendl;
+ LL_WARNS() << "CURSOR LOAD FAILURE " << filename << LL_ENDL;
}
return sdlcursor;
@@ -2087,7 +2087,7 @@ void LLWindowSDL::updateCursor()
if (sdlcursor)
SDL_SetCursor(sdlcursor);
} else {
- llwarns << "Tried to set invalid cursor number " << mNextCursor << llendl;
+ LL_WARNS() << "Tried to set invalid cursor number " << mNextCursor << LL_ENDL;
}
mCurrentCursor = mNextCursor;
}
@@ -2149,7 +2149,7 @@ void LLWindowSDL::initCursors()
mSDLCursors[UI_CURSOR_TOOLNO] = makeSDLCursorFromBMP("llno.BMP",8,8);
if (getenv("LL_ATI_MOUSE_CURSOR_BUG") != NULL) {
- llinfos << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << llendl;
+ LL_INFOS() << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << LL_ENDL;
ATIbug = true;
}
}
@@ -2170,7 +2170,7 @@ void LLWindowSDL::quitCursors()
} else {
// SDL doesn't refcount cursors, so if the window has
// already been destroyed then the cursors have gone with it.
- llinfos << "Skipping quitCursors: mWindow already gone." << llendl;
+ LL_INFOS() << "Skipping quitCursors: mWindow already gone." << LL_ENDL;
for (i=0; i<UI_CURSOR_COUNT; ++i)
mSDLCursors[i] = NULL;
}
@@ -2181,31 +2181,31 @@ void LLWindowSDL::captureMouse()
// SDL already enforces the semantics that captureMouse is
// used for, i.e. that we continue to get mouse events as long
// as a button is down regardless of whether we left the
- // window, and in a less obnoxious way than SDL_WM_GrabInput
+ // window, and in a less obnoxious way than SDL_WM_GrabInput
// which would confine the cursor to the window too.
- lldebugs << "LLWindowSDL::captureMouse" << llendl;
+ LL_DEBUGS() << "LLWindowSDL::captureMouse" << LL_ENDL;
}
void LLWindowSDL::releaseMouse()
{
// see LWindowSDL::captureMouse()
- lldebugs << "LLWindowSDL::releaseMouse" << llendl;
+ LL_DEBUGS() << "LLWindowSDL::releaseMouse" << LL_ENDL;
}
void LLWindowSDL::hideCursor()
{
if(!mCursorHidden)
{
- // llinfos << "hideCursor: hiding" << llendl;
+ // LL_INFOS() << "hideCursor: hiding" << LL_ENDL;
mCursorHidden = TRUE;
mHideCursorPermanent = TRUE;
SDL_ShowCursor(0);
}
else
{
- // llinfos << "hideCursor: already hidden" << llendl;
+ // LL_INFOS() << "hideCursor: already hidden" << LL_ENDL;
}
}
@@ -2213,14 +2213,14 @@ void LLWindowSDL::showCursor()
{
if(mCursorHidden)
{
- // llinfos << "showCursor: showing" << llendl;
+ // LL_INFOS() << "showCursor: showing" << LL_ENDL;
mCursorHidden = FALSE;
mHideCursorPermanent = FALSE;
SDL_ShowCursor(1);
}
else
{
- // llinfos << "showCursor: already visible" << llendl;
+ // LL_INFOS() << "showCursor: already visible" << LL_ENDL;
}
}
@@ -2291,7 +2291,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
{
GtkWidget *win = NULL;
- llinfos << "Creating a dialog because we're in windowed mode and GTK is happy." << llendl;
+ LL_INFOS() << "Creating a dialog because we're in windowed mode and GTK is happy." << LL_ENDL;
GtkDialogFlags flags = GTK_DIALOG_MODAL;
GtkMessageType messagetype;
@@ -2350,7 +2350,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
gtk_widget_show_all (win);
gtk_main();
- //llinfos << "response: " << response << llendl;
+ //LL_INFOS() << "response: " << response << LL_ENDL;
switch (response)
{
case GTK_RESPONSE_OK: rtn = OSBTN_OK; break;
@@ -2366,8 +2366,8 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
}
else
{
- llinfos << "MSGBOX: " << caption << ": " << text << llendl;
- llinfos << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << llendl;
+ LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL;
+ LL_INFOS() << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << LL_ENDL;
rtn = OSBTN_OK;
}
@@ -2493,7 +2493,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)
#else
S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type)
{
- llinfos << "MSGBOX: " << caption << ": " << text << llendl;
+ LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL;
return 0;
}
@@ -2521,7 +2521,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
// end ourself by running the command
execv(cmd.c_str(), argv); /* Flawfinder: ignore */
// if execv returns at all, there was a problem.
- llwarns << "execv failure when trying to start " << cmd << llendl;
+ LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL;
_exit(1); // _exit because we don't want atexit() clean-up!
} else {
if (pid > 0)
@@ -2530,7 +2530,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
int childExitStatus;
waitpid(pid, &childExitStatus, 0);
} else {
- llwarns << "fork failure." << llendl;
+ LL_WARNS() << "fork failure." << LL_ENDL;
}
}
}
@@ -2553,11 +2553,11 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
if (!found)
{
- llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl;
+ LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;
return;
}
- llinfos << "spawn_web_browser: " << escaped_url << llendl;
+ LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL;
#if LL_LINUX || LL_SOLARIS
# if LL_X11
@@ -2580,7 +2580,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
exec_cmd(cmd, arg);
#endif // LL_LINUX || LL_SOLARIS
- llinfos << "spawn_web_browser returning." << llendl;
+ LL_INFOS() << "spawn_web_browser returning." << LL_ENDL;
}
@@ -2615,7 +2615,7 @@ void LLWindowSDL::bringToFront()
{
// This is currently used when we are 'launched' to a specific
// map position externally.
- llinfos << "bringToFront" << llendl;
+ LL_INFOS() << "bringToFront" << LL_ENDL;
#if LL_X11
if (mSDL_Display && !mFullscreen)
{
@@ -2650,7 +2650,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
FcFontSet *fs = NULL;
FcPattern *sortpat = NULL;
- llinfos << "Getting system font list from FontConfig..." << llendl;
+ LL_INFOS() << "Getting system font list from FontConfig..." << LL_ENDL;
// If the user has a system-wide language preference, then favor
// fonts from that language group. This doesn't affect the types
@@ -2667,9 +2667,9 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
LL_INFOS("AppInit") << "Location " << locale->country << LL_ENDL;
LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL;
- llinfos << "Preferring fonts of language: "
+ LL_INFOS() << "Preferring fonts of language: "
<< locale->lang
- << llendl;
+ << LL_ENDL;
sort_order = "lang=" + std::string(locale->lang) + ":"
+ sort_order;
}
@@ -2678,7 +2678,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
if (!FcInit())
{
- llwarns << "FontConfig failed to initialize." << llendl;
+ LL_WARNS() << "FontConfig failed to initialize." << LL_ENDL;
rtns.push_back(final_fallback);
return rtns;
}
@@ -2715,14 +2715,14 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
FcFontSetDestroy (fs);
}
- lldebugs << "Using font list: " << llendl;
+ LL_DEBUGS() << "Using font list: " << LL_ENDL;
for (std::vector<std::string>::iterator it = rtns.begin();
it != rtns.end();
++it)
{
- lldebugs << " file: " << *it << llendl;
+ LL_DEBUGS() << " file: " << *it << LL_ENDL;
}
- llinfos << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << llendl;
+ LL_INFOS() << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << LL_ENDL;
rtns.push_back(final_fallback);
return rtns;
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 30f5526500..0637572f67 100755
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -38,6 +38,7 @@
// Linden library includes
#include "llerror.h"
+#include "llfasttimer.h"
#include "llgl.h"
#include "llstring.h"
#include "lldir.h"
@@ -202,7 +203,7 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
// the case, since it is very unusual; these APIs are available from
// the beginning, and all versions of IMM32.DLL should have them all.
// Unfortunately, this code may be executed before initialization of
- // the logging channel (llwarns), and we can't do it here... Yes, this
+ // the logging channel (LL_WARNS()), and we can't do it here... Yes, this
// is one of disadvantages to use static constraction to DLL loading.
FreeLibrary(mHImmDll);
mHImmDll = NULL;
@@ -1056,7 +1057,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
- LL_INFOS("Window") << "window is created." << llendl ;
+ LL_INFOS("Window") << "window is created." << LL_ENDL ;
//-----------------------------------------------------------------------
// Create GL drawing context
@@ -1089,7 +1090,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Device context retrieved." << llendl ;
+ LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ;
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
{
@@ -1099,7 +1100,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Pixel format chosen." << llendl ;
+ LL_INFOS("Window") << "Pixel format chosen." << LL_ENDL ;
// Verify what pixel format we actually received.
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
@@ -1112,35 +1113,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
}
// (EXP-1765) dump pixel data to see if there is a pattern that leads to unreproducible crash
- LL_INFOS("Window") << "--- begin pixel format dump ---" << llendl ;
- LL_INFOS("Window") << "pixel_format is " << pixel_format << llendl ;
- LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << llendl ;
- LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << llendl ;
- LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << llendl ;
- LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << llendl ;
- LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << llendl ;
- LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << llendl ;
- LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << llendl ;
- LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << llendl ;
- LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << llendl ;
- LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << llendl ;
- LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << llendl ;
- LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << llendl ;
- LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << llendl ;
- LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << llendl ;
- LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << llendl ;
- LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << llendl ;
- LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << llendl ;
- LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << llendl ;
- LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << llendl ;
- LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << llendl ;
- LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << llendl ;
- LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << llendl ;
- LL_INFOS("Window") << "--- end pixel format dump ---" << llendl ;
+ LL_INFOS("Window") << "--- begin pixel format dump ---" << LL_ENDL ;
+ LL_INFOS("Window") << "pixel_format is " << pixel_format << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
+ LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
if (pfd.cColorBits < 32)
{
@@ -1182,7 +1183,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Drawing context is created." << llendl ;
+ LL_INFOS("Window") << "Drawing context is created." << LL_ENDL ;
gGLManager.initWGL();
@@ -1239,7 +1240,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
while(!result && mFSAASamples > 0)
{
- llwarns << "FSAASamples: " << mFSAASamples << " not supported." << llendl ;
+ LL_WARNS() << "FSAASamples: " << mFSAASamples << " not supported." << LL_ENDL ;
mFSAASamples /= 2 ; //try to decrease sample pixel number until to disable anti-aliasing
if(mFSAASamples < 2)
@@ -1261,13 +1262,13 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
if(result)
{
- llwarns << "Only support FSAASamples: " << mFSAASamples << llendl ;
+ LL_WARNS() << "Only support FSAASamples: " << mFSAASamples << LL_ENDL ;
}
}
if (!result)
{
- llwarns << "mFSAASamples: " << mFSAASamples << llendl ;
+ LL_WARNS() << "mFSAASamples: " << mFSAASamples << LL_ENDL ;
close();
show_window_creation_error("Error after wglChoosePixelFormatARB 32-bit");
@@ -1320,7 +1321,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
}
- LL_INFOS("Window") << "pixel formats done." << llendl ;
+ LL_INFOS("Window") << "pixel formats done." << LL_ENDL ;
S32 swap_method = 0;
S32 cur_format = num_formats-1;
@@ -1370,7 +1371,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
- LL_INFOS("Window") << "recreate window done." << llendl ;
+ LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
if (!(mhDC = GetDC(mWindowHandle)))
{
@@ -1479,8 +1480,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
}
else
{
- llinfos << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
- (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << llendl;
+ LL_INFOS() << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
+ (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL;
done = true;
if (LLRender::sGLCoreProfile)
@@ -1822,8 +1823,8 @@ void LLWindowWin32::gatherInput()
mMousePositionModified = FALSE;
}
-static LLFastTimer::DeclareTimer FTM_KEYHANDLER("Handle Keyboard");
-static LLFastTimer::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse");
+static LLTrace::BlockTimerStatHandle FTM_KEYHANDLER("Handle Keyboard");
+static LLTrace::BlockTimerStatHandle FTM_MOUSEHANDLER("Handle Mouse");
LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param)
{
@@ -1877,8 +1878,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_DEVICECHANGE");
if (gDebugWindowProc)
{
- llinfos << " WM_DEVICECHANGE: wParam=" << w_param
- << "; lParam=" << l_param << llendl;
+ LL_INFOS() << " WM_DEVICECHANGE: wParam=" << w_param
+ << "; lParam=" << l_param << LL_ENDL;
}
if (w_param == DBT_DEVNODES_CHANGED || w_param == DBT_DEVICEARRIVAL)
{
@@ -2069,7 +2070,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mKeyVirtualKey = w_param;
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYUP");
- LLFastTimer t2(FTM_KEYHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_KEYHANDLER);
if (gDebugWindowProc)
{
@@ -2089,7 +2090,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_SETCONTEXT");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_SETCONTEXT" << llendl;
+ LL_INFOS() << "WM_IME_SETCONTEXT" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2102,7 +2103,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_STARTCOMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_STARTCOMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_STARTCOMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2115,7 +2116,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_ENDCOMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_ENDCOMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_ENDCOMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2127,7 +2128,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_COMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_COMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_COMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2140,7 +2141,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_REQUEST");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_REQUEST" << llendl;
+ LL_INFOS() << "WM_IME_REQUEST" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2188,7 +2189,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONDOWN:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
sHandleLeftMouseUp = true;
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
@@ -2254,7 +2255,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (!sHandleLeftMouseUp)
{
@@ -2295,7 +2296,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONDOWN:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2329,7 +2330,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
// Because we move the cursor position in the app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
@@ -2359,7 +2360,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// case WM_MBUTTONDBLCLK:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2393,7 +2394,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_MBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
// Because we move the cursor position in the llviewer app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 54c9ac4d4d..169d264808 100755
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -28,9 +28,7 @@
#define LL_LLWINDOWWIN32_H
// Limit Windows API to small and manageable set.
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
+#include "llwin32headerslean.h"
#include "llwindow.h"
#include "llwindowcallbacks.h"