From 79f14b7febf512e96a7d63eff8e6db895a7e72cf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 25 Aug 2011 14:54:38 -0400 Subject: CHOP-763: Move llwindowlistener.{h,cpp} from llwindow to newview. Instantiate LLWindowListener on LLViewerWindow instead of on LLWindow. This permits LLWindowListener to use machinery from llui, e.g. LLUI::resolvePath(). Document planned new ["path"], ["reply"] params to "keyDown", "keyUp", "mouseDown", "mouseUp", "mouseMove" operations; document relationship between ["path"] and ["x"] and ["y"]. NEW PARAMS NOT YET IMPLEMENTED. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llviewerwindow.cpp | 9 +- indra/newview/llviewerwindow.h | 4 +- indra/newview/llwindowlistener.cpp | 247 +++++++++++++++++++++++++++++++++++++ indra/newview/llwindowlistener.h | 55 +++++++++ 5 files changed, 315 insertions(+), 2 deletions(-) create mode 100644 indra/newview/llwindowlistener.cpp create mode 100644 indra/newview/llwindowlistener.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 935dd2e887..bd080f2ac4 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -599,6 +599,7 @@ set(viewer_SOURCE_FILES llweb.cpp llwebsharing.cpp llwind.cpp + llwindowlistener.cpp llwlanimator.cpp llwldaycycle.cpp llwlhandlers.cpp @@ -1153,6 +1154,7 @@ set(viewer_HEADER_FILES llweb.h llwebsharing.h llwind.h + llwindowlistener.h llwlanimator.h llwldaycycle.h llwlhandlers.h diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 988c4ed1a2..0501b61592 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include "llagent.h" #include "llagentcamera.h" @@ -198,6 +199,7 @@ #include "llfloaternotificationsconsole.h" #include "llnearbychat.h" +#include "llwindowlistener.h" #include "llviewerwindowlistener.h" #include "llpaneltopinfobar.h" @@ -1552,7 +1554,12 @@ LLViewerWindow::LLViewerWindow( mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mViewerWindowListener(new LLViewerWindowListener(this)), + // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to + // pass its value right now. Instead, pass it a nullary function that + // will, when we later need it, return the value of gKeyboard. + // boost::lambda::var() constructs such a functor on the fly. + mWindowListener(new LLWindowListener(this, boost::lambda::var(gKeyboard))), + mViewerWindowListener(new LLViewerWindowListener(this)), mProgressView(NULL) { LLNotificationChannel::buildChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "alert")); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ff49ed1f62..48599ebb00 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -62,6 +62,7 @@ class LLImageFormatted; class LLHUDIcon; class LLWindow; class LLRootView; +class LLWindowListener; class LLViewerWindowListener; class LLPopupView; @@ -455,7 +456,8 @@ protected: bool mStatesDirty; U32 mCurrResolutionIndex; - boost::scoped_ptr mViewerWindowListener; + boost::scoped_ptr mWindowListener; + boost::scoped_ptr mViewerWindowListener; protected: static std::string sSnapshotBaseName; diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp new file mode 100644 index 0000000000..e5deaa42cf --- /dev/null +++ b/indra/newview/llwindowlistener.cpp @@ -0,0 +1,247 @@ +/** + * @file llwindowlistener.cpp + * @brief EventAPI interface for injecting input into LLWindow + * + * $LicenseInfo:firstyear=2001&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 "llwindowlistener.h" + +#include "llcoord.h" +#include "llkeyboard.h" +#include "llwindowcallbacks.h" +#include "llui.h" +#include + +LLWindowListener::LLWindowListener(LLWindowCallbacks *window, const KeyboardGetter& kbgetter) + : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), + mWindow(window), + mKbGetter(kbgetter) +{ + std::string keySomething = + "Given [\"keysym\"], [\"keycode\"] or [\"char\"], inject the specified "; + std::string keyExplain = + "(integer keycode values, or keysym string from any addKeyName() call in\n" + "http://hg.secondlife.com/viewer-development/src/tip/indra/llwindow/llkeyboard.cpp )\n"; + std::string mask = + "Specify optional [\"mask\"] as an array containing any of \"CTL\", \"ALT\",\n" + "\"SHIFT\" or \"MAC_CONTROL\"; the corresponding modifier bits will be combined\n" + "to form the mask used with the event."; + + std::string given = "Given "; + std::string mouseParams = + "optional [\"path\"], optional [\"x\"] and [\"y\"], inject the requested mouse "; + std::string buttonParams = + std::string("[\"button\"], ") + mouseParams; + std::string buttonExplain = + "(button values \"LEFT\", \"MIDDLE\", \"RIGHT\")\n"; + std::string paramsExplain = + "[\"path\"] is as for LLUI::resolvePath(), described in\n" + "http://hg.secondlife.com/viewer-development/src/tip/indra/llui/llui.h\n" + "If you omit [\"path\"], you must specify both [\"x\"] and [\"y\"].\n" + "If you specify [\"path\"] without both [\"x\"] and [\"y\"], will synthesize (x, y)\n" + "in the center of the LLView selected by [\"path\"].\n" + "You may specify [\"path\"] with both [\"x\"] and [\"y\"], will use your (x, y).\n" + "This may cause the LLView selected by [\"path\"] to reject the event.\n" + "Optional [\"reply\"] requests a reply event on the named LLEventPump.\n" + "reply[\"error\"] isUndefined (None) on success, else an explanatory message.\n"; + + add("keyDown", + keySomething + "keypress event.\n" + keyExplain + mask, + &LLWindowListener::keyDown); + add("keyUp", + keySomething + "key release event.\n" + keyExplain + mask, + &LLWindowListener::keyUp); + add("mouseDown", + given + buttonParams + "click event.\n" + buttonExplain + paramsExplain + mask, + &LLWindowListener::mouseDown); + add("mouseUp", + given + buttonParams + "release event.\n" + buttonExplain + paramsExplain + mask, + &LLWindowListener::mouseUp); + add("mouseMove", + given + mouseParams + "movement event.\n" + paramsExplain + mask, + &LLWindowListener::mouseMove); + add("mouseScroll", + "Given an integer number of [\"clicks\"], inject the requested mouse scroll event.\n" + "(positive clicks moves downward through typical content)", + &LLWindowListener::mouseScroll); +} + +template +class StringLookup +{ +private: + std::string mDesc; + typedef std::map Map; + Map mMap; + +public: + StringLookup(const std::string& desc): mDesc(desc) {} + + MAPPED lookup(const typename Map::key_type& key) const + { + typename Map::const_iterator found = mMap.find(key); + if (found == mMap.end()) + { + LL_WARNS("LLWindowListener") << "Unknown " << mDesc << " '" << key << "'" << LL_ENDL; + return MAPPED(); + } + return found->second; + } + +protected: + void add(const typename Map::key_type& key, const typename Map::mapped_type& value) + { + mMap.insert(typename Map::value_type(key, value)); + } +}; + +// helper for getMask() +static MASK lookupMask_(const std::string& maskname) +{ + // It's unclear to me whether MASK_MAC_CONTROL is important, but it's not + // supported by maskFromString(). Handle that specially. + if (maskname == "MAC_CONTROL") + { + return MASK_MAC_CONTROL; + } + else + { + // In case of lookup failure, return MASK_NONE, which won't affect our + // caller's OR. + MASK mask(MASK_NONE); + LLKeyboard::maskFromString(maskname, &mask); + return mask; + } +} + +static MASK getMask(const LLSD& event) +{ + LLSD masknames(event["mask"]); + if (! masknames.isArray()) + { + // If event["mask"] is a single string, perform normal lookup on it. + return lookupMask_(masknames); + } + + // Here event["mask"] is an array of mask-name strings. OR together their + // corresponding bits. + MASK mask(MASK_NONE); + for (LLSD::array_const_iterator ai(masknames.beginArray()), aend(masknames.endArray()); + ai != aend; ++ai) + { + mask |= lookupMask_(*ai); + } + return mask; +} + +static KEY getKEY(const LLSD& event) +{ + if (event.has("keysym")) + { + // Initialize to KEY_NONE; that way we can ignore the bool return from + // keyFromString() and, in the lookup-fail case, simply return KEY_NONE. + KEY key(KEY_NONE); + LLKeyboard::keyFromString(event["keysym"], &key); + return key; + } + else if (event.has("keycode")) + { + return KEY(event["keycode"].asInteger()); + } + else + { + return KEY(event["char"].asString()[0]); + } +} + +void LLWindowListener::keyDown(LLSD const & evt) +{ + mKbGetter()->handleTranslatedKeyDown(getKEY(evt), getMask(evt)); +} + +void LLWindowListener::keyUp(LLSD const & evt) +{ + mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); +} + +// for WhichButton +typedef BOOL (LLWindowCallbacks::*MouseFunc)(LLWindow *, LLCoordGL, MASK); +struct Actions +{ + Actions(const MouseFunc& d, const MouseFunc& u): down(d), up(u), valid(true) {} + Actions(): valid(false) {} + MouseFunc down, up; + bool valid; +}; + +struct WhichButton: public StringLookup +{ + WhichButton(): StringLookup("mouse button") + { + add("LEFT", Actions(&LLWindowCallbacks::handleMouseDown, + &LLWindowCallbacks::handleMouseUp)); + add("RIGHT", Actions(&LLWindowCallbacks::handleRightMouseDown, + &LLWindowCallbacks::handleRightMouseUp)); + add("MIDDLE", Actions(&LLWindowCallbacks::handleMiddleMouseDown, + &LLWindowCallbacks::handleMiddleMouseUp)); + } +}; +static WhichButton buttons; + +static LLCoordGL getPos(const LLSD& event) +{ + return LLCoordGL(event["x"].asInteger(), event["y"].asInteger()); +} + +void LLWindowListener::mouseDown(LLSD const & evt) +{ + Actions actions(buttons.lookup(evt["button"])); + if (actions.valid) + { + (mWindow->*(actions.down))(NULL, getPos(evt), getMask(evt)); + } +} + +void LLWindowListener::mouseUp(LLSD const & evt) +{ + Actions actions(buttons.lookup(evt["button"])); + if (actions.valid) + { + (mWindow->*(actions.up))(NULL, getPos(evt), getMask(evt)); + } +} + +void LLWindowListener::mouseMove(LLSD const & evt) +{ + mWindow->handleMouseMove(NULL, getPos(evt), getMask(evt)); +} + +void LLWindowListener::mouseScroll(LLSD const & evt) +{ + S32 clicks = evt["clicks"].asInteger(); + + mWindow->handleScrollWheel(NULL, clicks); +} + diff --git a/indra/newview/llwindowlistener.h b/indra/newview/llwindowlistener.h new file mode 100644 index 0000000000..74e577ff93 --- /dev/null +++ b/indra/newview/llwindowlistener.h @@ -0,0 +1,55 @@ +/** + * @file llwindowlistener.h + * @brief EventAPI interface for injecting input into LLWindow + * + * $LicenseInfo:firstyear=2001&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_LLWINDOWLISTENER_H +#define LL_LLWINDOWLISTENER_H + +#include "lleventapi.h" +#include + +class LLKeyboard; +class LLWindowCallbacks; + +class LLWindowListener : public LLEventAPI +{ +public: + typedef boost::function KeyboardGetter; + LLWindowListener(LLWindowCallbacks * window, const KeyboardGetter& kbgetter); + + void keyDown(LLSD const & evt); + void keyUp(LLSD const & evt); + void mouseDown(LLSD const & evt); + void mouseUp(LLSD const & evt); + void mouseMove(LLSD const & evt); + void mouseScroll(LLSD const & evt); + +private: + LLWindowCallbacks * mWindow; + KeyboardGetter mKbGetter; +}; + + +#endif // LL_LLWINDOWLISTENER_H -- cgit v1.2.3 From 1d31559b30a32c4ebfde7dc2c42baef840be7c4d Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Fri, 26 Aug 2011 15:06:14 -0500 Subject: implement path option for key events. --- indra/newview/llwindowlistener.cpp | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index e5deaa42cf..3d756ef9b9 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -29,9 +29,13 @@ #include "llwindowlistener.h" #include "llcoord.h" +#include "llfocusmgr.h" #include "llkeyboard.h" #include "llwindowcallbacks.h" #include "llui.h" +#include "llview.h" +#include "llviewerwindow.h" +#include "llrootview.h" #include LLWindowListener::LLWindowListener(LLWindowCallbacks *window, const KeyboardGetter& kbgetter) @@ -117,8 +121,10 @@ protected: } }; +namespace { + // helper for getMask() -static MASK lookupMask_(const std::string& maskname) +MASK lookupMask_(const std::string& maskname) { // It's unclear to me whether MASK_MAC_CONTROL is important, but it's not // supported by maskFromString(). Handle that specially. @@ -136,7 +142,7 @@ static MASK lookupMask_(const std::string& maskname) } } -static MASK getMask(const LLSD& event) +MASK getMask(const LLSD& event) { LLSD masknames(event["mask"]); if (! masknames.isArray()) @@ -156,7 +162,7 @@ static MASK getMask(const LLSD& event) return mask; } -static KEY getKEY(const LLSD& event) +KEY getKEY(const LLSD& event) { if (event.has("keysym")) { @@ -176,13 +182,36 @@ static KEY getKEY(const LLSD& event) } } +} // namespace + void LLWindowListener::keyDown(LLSD const & evt) { - mKbGetter()->handleTranslatedKeyDown(getKEY(evt), getMask(evt)); + if (evt.has("path")) + { + LLView * target_view = + LLUI::resolvePath(gViewerWindow->getRootView(), evt["path"]); + if ((target_view != 0) && target_view->isAvailable()) + { + gFocusMgr.setKeyboardFocus(target_view); + KEY key = getKEY(evt); + MASK mask = getMask(evt); + if (!target_view->handleKey(key, mask, true)) target_view->handleUnicodeChar(key, true); + } + else + { + ; // TODO: Don't silently fail if target not available. + } + } + else + { + mKbGetter()->handleTranslatedKeyDown(getKEY(evt), getMask(evt)); + } } void LLWindowListener::keyUp(LLSD const & evt) { + if (evt.has("path")) return; // LLView only handles key down. + mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); } -- cgit v1.2.3 From 34a620523a7f4511c8f008f2e9a9428f41281480 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 29 Aug 2011 13:27:17 -0500 Subject: a better way to inject key events. --- indra/newview/llwindowlistener.cpp | 27 ++++++++++++++++++++++----- indra/newview/llwindowlistener.h | 6 +++--- 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 3d756ef9b9..4cadc8773d 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -35,10 +35,11 @@ #include "llui.h" #include "llview.h" #include "llviewerwindow.h" +#include "llviewerkeyboard.h" #include "llrootview.h" #include -LLWindowListener::LLWindowListener(LLWindowCallbacks *window, const KeyboardGetter& kbgetter) +LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), mWindow(window), mKbGetter(kbgetter) @@ -195,7 +196,8 @@ void LLWindowListener::keyDown(LLSD const & evt) gFocusMgr.setKeyboardFocus(target_view); KEY key = getKEY(evt); MASK mask = getMask(evt); - if (!target_view->handleKey(key, mask, true)) target_view->handleUnicodeChar(key, true); + gViewerKeyboard.handleKey(key, mask, false); + if(key < 0x80) mWindow->handleUnicodeChar(key, mask); } else { @@ -210,9 +212,24 @@ void LLWindowListener::keyDown(LLSD const & evt) void LLWindowListener::keyUp(LLSD const & evt) { - if (evt.has("path")) return; // LLView only handles key down. - - mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); + if (evt.has("path")) + { + LLView * target_view = + LLUI::resolvePath(gViewerWindow->getRootView(), evt["path"]); + if ((target_view != 0) && target_view->isAvailable()) + { + gFocusMgr.setKeyboardFocus(target_view); + mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); + } + else + { + ; // TODO: Don't silently fail if target not available. + } + } + else + { + mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); + } } // for WhichButton diff --git a/indra/newview/llwindowlistener.h b/indra/newview/llwindowlistener.h index 74e577ff93..26adff35ff 100644 --- a/indra/newview/llwindowlistener.h +++ b/indra/newview/llwindowlistener.h @@ -31,13 +31,13 @@ #include class LLKeyboard; -class LLWindowCallbacks; +class LLViewerWindow; class LLWindowListener : public LLEventAPI { public: typedef boost::function KeyboardGetter; - LLWindowListener(LLWindowCallbacks * window, const KeyboardGetter& kbgetter); + LLWindowListener(LLViewerWindow * window, const KeyboardGetter& kbgetter); void keyDown(LLSD const & evt); void keyUp(LLSD const & evt); @@ -47,7 +47,7 @@ public: void mouseScroll(LLSD const & evt); private: - LLWindowCallbacks * mWindow; + LLViewerWindow * mWindow; KeyboardGetter mKbGetter; }; -- cgit v1.2.3 From f08d7fba9f2134a687169d8da478a44bdbe16955 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 29 Aug 2011 15:57:32 -0400 Subject: CHOP-763: Implement widget-pathname-based routing for mouse events. Send mouseDown(), mouseUp(), mouseMove() through static mouseEvent() helper function. Process new optional ["path"] param, validating corresponding LLView and capturing certain information about it for caller. Synthesize (x, y) pos if need be. Use LLView::TemporaryDrilldownFunc and llview::TargetEvent to temporarily hijack normal LLView mouse-event propagation. Define Response helper class to capture LLSD blob about the current request and ensure it gets sent on return. --- indra/newview/llwindowlistener.cpp | 199 ++++++++++++++++++++++++++++++++++--- 1 file changed, 183 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 4cadc8773d..84126b7738 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -34,10 +34,19 @@ #include "llwindowcallbacks.h" #include "llui.h" #include "llview.h" +#include "llviewinject.h" #include "llviewerwindow.h" #include "llviewerkeyboard.h" #include "llrootview.h" +#include "llsdutil.h" +#include "stringize.h" +#include #include +#include +#include +#include + +namespace bll = boost::lambda; LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), @@ -233,12 +242,12 @@ void LLWindowListener::keyUp(LLSD const & evt) } // for WhichButton -typedef BOOL (LLWindowCallbacks::*MouseFunc)(LLWindow *, LLCoordGL, MASK); +typedef BOOL (LLWindowCallbacks::*MouseMethod)(LLWindow *, LLCoordGL, MASK); struct Actions { - Actions(const MouseFunc& d, const MouseFunc& u): down(d), up(u), valid(true) {} + Actions(const MouseMethod& d, const MouseMethod& u): down(d), up(u), valid(true) {} Actions(): valid(false) {} - MouseFunc down, up; + MouseMethod down, up; bool valid; }; @@ -256,38 +265,196 @@ struct WhichButton: public StringLookup }; static WhichButton buttons; -static LLCoordGL getPos(const LLSD& event) +struct Response +{ + Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey="reply"): + mResp(seed), + mReq(request), + mKey(replyKey) + {} + + ~Response() + { + // When you instantiate a stack Response object, if the original + // request requested a reply, send it when we leave this block, no + // matter how. + sendReply(mResp, mReq, mKey); + } + + void warn(const std::string& warning) + { + LL_WARNS("LLWindowListener") << warning << LL_ENDL; + mResp["warnings"].append(warning); + } + + void error(const std::string& error) + { + // Use LL_WARNS rather than LL_ERROR: we don't want the viewer to shut + // down altogether. + LL_WARNS("LLWindowListener") << error << LL_ENDL; + + mResp["error"] = error; + } + + // set other keys... + LLSD& operator[](const LLSD::String& key) { return mResp[key]; } + + LLSD mResp, mReq; + LLSD::String mKey; +}; + +typedef boost::function MouseFunc; + +static void mouseEvent(const MouseFunc& func, const LLSD& request) { - return LLCoordGL(event["x"].asInteger(), event["y"].asInteger()); + // Ensure we send response + Response response(LLSD(), request); + // We haven't yet established whether the incoming request has "x" and "y", + // but capture this anyway, with 0 for omitted values. + LLCoordGL pos(request["x"].asInteger(), request["y"].asInteger()); + bool has_pos(request.has("x") && request.has("y")); + + boost::scoped_ptr tempfunc; + + // Documentation for mouseDown(), mouseUp() and mouseMove() claims you + // must either specify ["path"], or both of ["x"] and ["y"]. You MAY + // specify all. Let's say that passing "path" as an empty string is + // equivalent to not passing it at all. + std::string path(request["path"]); + if (path.empty()) + { + // Without "path", you must specify both "x" and "y". + if (! has_pos) + { + return response.error(STRINGIZE(request["op"].asString() << " request " + "without \"path\" must specify both \"x\" and \"y\": " + << request)); + } + } + else // ! path.empty() + { + LLView* root = LLUI::getRootView(); + LLView* target = LLUI::resolvePath(root, path); + if (! target) + { + return response.error(STRINGIZE(request["op"].asString() << " request " + "specified invalid \"path\": '" << path << "'")); + return; + } + + // Get info about this LLView* for when we send response. + response["path"] = target->getPathname(); + response["class"] = typeid(*target).name(); + bool visible_chain(target->isInVisibleChain()); + bool enabled_chain(target->isInEnabledChain()); + response["visible"] = target->getVisible(); + response["visible_chain"] = visible_chain; + response["enabled"] = target->getEnabled(); + response["enabled_chain"] = enabled_chain; + response["available"] = target->isAvailable(); + // Don't show caller the LLView's own relative rectangle; that only + // tells its dimensions. Provide actual location on screen. + LLRect rect(target->calcScreenRect()); + response["rect"] = LLSDMap("left", rect.mLeft)("top", rect.mTop)("right", rect.mRight)("bottom", rect.mBottom); + + // The intent of this test is to prevent trying to drill down to a + // widget in a hidden floater, or on a tab that's not current, etc. + if (! visible_chain) + { + return response.error(STRINGIZE(request["op"].asString() << " request " + "specified \"path\" not currently visible: '" + << path << "'")); + } + + // This test isn't folded in with the above error case since you can + // (e.g.) pop up a tooltip even for a disabled widget. + if (! enabled_chain) + { + response.warn(STRINGIZE(request["op"].asString() << " request " + "specified \"path\" not currently enabled: '" + << path << "'")); + } + + if (! has_pos) + { + pos.set(rect.getCenterX(), rect.getCenterY()); + // nonstandard warning tactic: probably usual case; we want event + // sender to know synthesized (x, y), but maybe don't need to log? + response["warnings"].append(STRINGIZE("using center point (" + << pos.mX << ", " << pos.mY << ")")); + } + + // recursive childFromPoint() should give us the frontmost, leafmost + // widget at the specified (x, y). + LLView* frontmost = root->childFromPoint(pos.mX, pos.mY, true); + if (frontmost != target) + { + response.warn(STRINGIZE(request["op"].asString() << " request " + "specified \"path\" = '" << path + << "', but frontmost LLView at (" << pos.mX << ", " << pos.mY + << ") is '" << frontmost->getPathname() << "'")); + } + + // Instantiate a TemporaryDrilldownFunc to route incoming mouse events + // to the target LLView*. But put it on the heap since "path" is + // optional. Nonetheless, manage it with a boost::scoped_ptr so it + // will be destroyed when we leave. + tempfunc.reset(new LLView::TemporaryDrilldownFunc(llview::TargetEvent(target))); + } + + // The question of whether the requested LLView actually handled the + // specified event is important enough, and its handling unclear enough, + // to warrant a separate response attribute. Instead of deciding here to + // make it a warning, or an error, let caller decide. + response["handled"] = func(pos, getMask(request)); + + // On exiting this scope, response will send, tempfunc will restore the + // normal pointInView(x, y) containment logic, etc. } -void LLWindowListener::mouseDown(LLSD const & evt) +void LLWindowListener::mouseDown(LLSD const & request) { - Actions actions(buttons.lookup(evt["button"])); + Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - (mWindow->*(actions.down))(NULL, getPos(evt), getMask(evt)); + // Normally you can pass NULL to an LLWindow* without compiler + // complaint, but going through boost::lambda::bind() evidently + // bypasses that special case: it only knows you're trying to pass an + // int to a pointer. Explicitly cast NULL to the desired pointer type. + mouseEvent(bll::bind(actions.down, mWindow, + static_cast(NULL), bll::_1, bll::_2), + request); } } -void LLWindowListener::mouseUp(LLSD const & evt) +void LLWindowListener::mouseUp(LLSD const & request) { - Actions actions(buttons.lookup(evt["button"])); + Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - (mWindow->*(actions.up))(NULL, getPos(evt), getMask(evt)); + mouseEvent(bll::bind(actions.up, mWindow, + static_cast(NULL), bll::_1, bll::_2), + request); } } -void LLWindowListener::mouseMove(LLSD const & evt) +void LLWindowListener::mouseMove(LLSD const & request) { - mWindow->handleMouseMove(NULL, getPos(evt), getMask(evt)); + // We want to call the same central mouseEvent() routine for + // handleMouseMove() as for button clicks. But handleMouseMove() returns + // void, whereas mouseEvent() accepts a function returning bool -- and + // uses that bool return. Use (void-lambda-expression, true) to construct + // a callable that returns bool anyway. Pass 'true' because we expect that + // our caller will usually treat 'false' as a problem. + mouseEvent((bll::bind(&LLWindowCallbacks::handleMouseMove, mWindow, + static_cast(NULL), bll::_1, bll::_2), + true), + request); } -void LLWindowListener::mouseScroll(LLSD const & evt) +void LLWindowListener::mouseScroll(LLSD const & request) { - S32 clicks = evt["clicks"].asInteger(); + S32 clicks = request["clicks"].asInteger(); mWindow->handleScrollWheel(NULL, clicks); } - -- cgit v1.2.3 From 12dbf4c7b4a7bf64acaa7207c8bceffb64f021b3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 30 Aug 2011 11:30:51 -0400 Subject: CHOP-763: Add Windows magic precompiled header #include. --- indra/newview/llwindowlistener.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 84126b7738..8d794e5380 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -24,6 +24,7 @@ * $/LicenseInfo$ */ +#include "llviewerprecompiledheaders.h" #include "linden_common.h" #include "llwindowlistener.h" -- cgit v1.2.3 From 713aa42f61d6d5791b26f56a73bd7cf7abb76f0d Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 30 Aug 2011 13:37:10 -0500 Subject: add responses to key events. --- indra/newview/llwindowlistener.cpp | 142 ++++++++++++++++++++++--------------- 1 file changed, 85 insertions(+), 57 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 8d794e5380..84a490f661 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -134,6 +134,57 @@ protected: namespace { +class Response +{ +public: + Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey="reply"): + mResp(seed), + mReq(request), + mKey(replyKey) + {} + + ~Response() + { + // When you instantiate a stack Response object, if the original + // request requested a reply, send it when we leave this block, no + // matter how. + sendReply(mResp, mReq, mKey); + } + + void warn(const std::string& warning) + { + LL_WARNS("LLWindowListener") << warning << LL_ENDL; + mResp["warnings"].append(warning); + } + + void error(const std::string& error) + { + // Use LL_WARNS rather than LL_ERROR: we don't want the viewer to shut + // down altogether. + LL_WARNS("LLWindowListener") << error << LL_ENDL; + + mResp["error"] = error; + } + + // set other keys... + LLSD& operator[](const LLSD::String& key) { return mResp[key]; } + + LLSD mResp, mReq; + LLSD::String mKey; +}; + +void insertViewInformation(Response & response, LLView * target) +{ + // Get info about this LLView* for when we send response. + response["path"] = target->getPathname(); + response["class"] = typeid(*target).name(); + response["visible"] = target->getVisible(); + response["visible_chain"] = target->isInVisibleChain(); + response["enabled"] = target->getEnabled(); + response["enabled_chain"] = target->isInEnabledChain(); + response["available"] = target->isAvailable(); +} + // helper for getMask() MASK lookupMask_(const std::string& maskname) { @@ -197,12 +248,22 @@ KEY getKEY(const LLSD& event) void LLWindowListener::keyDown(LLSD const & evt) { + Response response(LLSD(), evt); + if (evt.has("path")) { + std::string path(evt["path"]); LLView * target_view = - LLUI::resolvePath(gViewerWindow->getRootView(), evt["path"]); - if ((target_view != 0) && target_view->isAvailable()) + LLUI::resolvePath(gViewerWindow->getRootView(), path); + if (target_view == 0) + { + response.error(STRINGIZE(evt["op"].asString() << " request " + "specified invalid \"path\": '" << path << "'")); + } + else if(target_view->isAvailable()) { + insertViewInformation(response, target_view); + gFocusMgr.setKeyboardFocus(target_view); KEY key = getKEY(evt); MASK mask = getMask(evt); @@ -211,7 +272,9 @@ void LLWindowListener::keyDown(LLSD const & evt) } else { - ; // TODO: Don't silently fail if target not available. + response.error(STRINGIZE(evt["op"].asString() << " request " + "element specified byt \"path\": '" << path << "'" + << " is not visible")); } } else @@ -222,18 +285,30 @@ void LLWindowListener::keyDown(LLSD const & evt) void LLWindowListener::keyUp(LLSD const & evt) { + Response response(LLSD(), evt); + if (evt.has("path")) { + std::string path(evt["path"]); LLView * target_view = - LLUI::resolvePath(gViewerWindow->getRootView(), evt["path"]); - if ((target_view != 0) && target_view->isAvailable()) + LLUI::resolvePath(gViewerWindow->getRootView(), path); + if (target_view == 0 ) + { + response.error(STRINGIZE(evt["op"].asString() << " request " + "specified invalid \"path\": '" << path << "'")); + } + else if (target_view->isAvailable()) { + insertViewInformation(response, target_view); + gFocusMgr.setKeyboardFocus(target_view); mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); } else { - ; // TODO: Don't silently fail if target not available. + response.error(STRINGIZE(evt["op"].asString() << " request " + "element specified byt \"path\": '" << path << "'" + << " is not visible")); } } else @@ -266,44 +341,6 @@ struct WhichButton: public StringLookup }; static WhichButton buttons; -struct Response -{ - Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey="reply"): - mResp(seed), - mReq(request), - mKey(replyKey) - {} - - ~Response() - { - // When you instantiate a stack Response object, if the original - // request requested a reply, send it when we leave this block, no - // matter how. - sendReply(mResp, mReq, mKey); - } - - void warn(const std::string& warning) - { - LL_WARNS("LLWindowListener") << warning << LL_ENDL; - mResp["warnings"].append(warning); - } - - void error(const std::string& error) - { - // Use LL_WARNS rather than LL_ERROR: we don't want the viewer to shut - // down altogether. - LL_WARNS("LLWindowListener") << error << LL_ENDL; - - mResp["error"] = error; - } - - // set other keys... - LLSD& operator[](const LLSD::String& key) { return mResp[key]; } - - LLSD mResp, mReq; - LLSD::String mKey; -}; - typedef boost::function MouseFunc; static void mouseEvent(const MouseFunc& func, const LLSD& request) @@ -340,19 +377,10 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) { return response.error(STRINGIZE(request["op"].asString() << " request " "specified invalid \"path\": '" << path << "'")); - return; } - // Get info about this LLView* for when we send response. - response["path"] = target->getPathname(); - response["class"] = typeid(*target).name(); - bool visible_chain(target->isInVisibleChain()); - bool enabled_chain(target->isInEnabledChain()); - response["visible"] = target->getVisible(); - response["visible_chain"] = visible_chain; - response["enabled"] = target->getEnabled(); - response["enabled_chain"] = enabled_chain; - response["available"] = target->isAvailable(); + insertViewInformation(response, target); + // Don't show caller the LLView's own relative rectangle; that only // tells its dimensions. Provide actual location on screen. LLRect rect(target->calcScreenRect()); @@ -360,7 +388,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) // The intent of this test is to prevent trying to drill down to a // widget in a hidden floater, or on a tab that's not current, etc. - if (! visible_chain) + if (! target->isInVisibleChain()) { return response.error(STRINGIZE(request["op"].asString() << " request " "specified \"path\" not currently visible: '" @@ -369,7 +397,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) // This test isn't folded in with the above error case since you can // (e.g.) pop up a tooltip even for a disabled widget. - if (! enabled_chain) + if (! target->isInEnabledChain()) { response.warn(STRINGIZE(request["op"].asString() << " request " "specified \"path\" not currently enabled: '" -- cgit v1.2.3 From 71aec7439c1a8027880ac06d99f923ab8fa7111b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 30 Aug 2011 15:22:44 -0400 Subject: CHOP-763: Introduce static LLView::getPathname(LLView*). Use it for LLWindowListener to safely report an LLView* which might be NULL. --- indra/newview/llwindowlistener.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 84a490f661..05cb798732 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -273,7 +273,7 @@ void LLWindowListener::keyDown(LLSD const & evt) else { response.error(STRINGIZE(evt["op"].asString() << " request " - "element specified byt \"path\": '" << path << "'" + "element specified by \"path\": '" << path << "'" << " is not visible")); } } @@ -421,7 +421,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) response.warn(STRINGIZE(request["op"].asString() << " request " "specified \"path\" = '" << path << "', but frontmost LLView at (" << pos.mX << ", " << pos.mY - << ") is '" << frontmost->getPathname() << "'")); + << ") is '" << LLView::getPathname(frontmost) << "'")); } // Instantiate a TemporaryDrilldownFunc to route incoming mouse events -- cgit v1.2.3 From 3ddf3aef9b2f2bb85932bd33b9daac5e59d3018a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 1 Sep 2011 13:12:23 -0400 Subject: CHOP-763: Promote Response class from llwindowlistener.cpp to LLEventAPI. This is a generally-useful idiom, extending the sendReply() convenience function -- it shouldn't remain buried in a single .cpp file. --- indra/newview/llwindowlistener.cpp | 43 ++------------------------------------ 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 05cb798732..3e3287032c 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -134,46 +134,7 @@ protected: namespace { -class Response -{ -public: - Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey="reply"): - mResp(seed), - mReq(request), - mKey(replyKey) - {} - - ~Response() - { - // When you instantiate a stack Response object, if the original - // request requested a reply, send it when we leave this block, no - // matter how. - sendReply(mResp, mReq, mKey); - } - - void warn(const std::string& warning) - { - LL_WARNS("LLWindowListener") << warning << LL_ENDL; - mResp["warnings"].append(warning); - } - - void error(const std::string& error) - { - // Use LL_WARNS rather than LL_ERROR: we don't want the viewer to shut - // down altogether. - LL_WARNS("LLWindowListener") << error << LL_ENDL; - - mResp["error"] = error; - } - - // set other keys... - LLSD& operator[](const LLSD::String& key) { return mResp[key]; } - - LLSD mResp, mReq; - LLSD::String mKey; -}; - -void insertViewInformation(Response & response, LLView * target) +void insertViewInformation(LLEventAPI::Response & response, LLView * target) { // Get info about this LLView* for when we send response. response["path"] = target->getPathname(); @@ -346,7 +307,7 @@ typedef boost::function MouseFunc; static void mouseEvent(const MouseFunc& func, const LLSD& request) { // Ensure we send response - Response response(LLSD(), request); + LLEventAPI::Response response(LLSD(), request); // We haven't yet established whether the incoming request has "x" and "y", // but capture this anyway, with 0 for omitted values. LLCoordGL pos(request["x"].asInteger(), request["y"].asInteger()); -- cgit v1.2.3 From 7215d1a9a9e6220d8744b662ab96feb41fc66ec8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 1 Sep 2011 14:05:37 -0400 Subject: CHOP-763: Extend LLEventAPI "LLViewerControl" API; add queries. This is a significant refactoring of planned (but as yet unimplemented) work, though in fact it's almost completely compatible with the only implemented operation. The set() operation now requires op="set", where before that was inferred because set() was the only possibility. Whereas before LLViewerControlListener dispatched to different bound methods on the "group" key, with four known "group" string values, it now dispatches on the "op" key, supporting "set", "toggle", "get", "groups", "vars" -- the last two exposing query functionality. LLControlGroup is actually derived from LLInstanceTracker, keyed on string names, so we can look up instances using LLControlGroup::getInstance(const std::string&), or enumerate all such names. LLControlGroup similarly permits iterating over all defined LLControlVariables. The static LLViewerControlListener instance has been wrapped in an unnamed namespace and removed from llviewercontrollistener.h. The availability of the API depends on LLEventPumps::obtain(), rather than normal C++ visibility. --- indra/newview/llviewercontrollistener.cpp | 231 +++++++++++++++++++++--------- indra/newview/llviewercontrollistener.h | 10 +- 2 files changed, 169 insertions(+), 72 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewercontrollistener.cpp b/indra/newview/llviewercontrollistener.cpp index 8bc25fa281..361b96221c 100644 --- a/indra/newview/llviewercontrollistener.cpp +++ b/indra/newview/llviewercontrollistener.cpp @@ -31,99 +31,196 @@ #include "llviewercontrollistener.h" #include "llviewercontrol.h" +#include "llcontrol.h" +#include "llerror.h" +#include "llsdutil.h" +#include "stringize.h" +#include -LLViewerControlListener gSavedSettingsListener; +namespace { + +LLViewerControlListener sSavedSettingsListener; + +} // unnamed namespace LLViewerControlListener::LLViewerControlListener() : LLEventAPI("LLViewerControl", - "LLViewerControl listener: set, toggle or set default for various controls", - "group") + "LLViewerControl listener: set, toggle or set default for various controls") { - add("Global", - "Set gSavedSettings control [\"key\"] to value [\"value\"]", - boost::bind(&LLViewerControlListener::set, &gSavedSettings, _1)); - add("PerAccount", - "Set gSavedPerAccountSettings control [\"key\"] to value [\"value\"]", - boost::bind(&LLViewerControlListener::set, &gSavedPerAccountSettings, _1)); - add("Warning", - "Set gWarningSettings control [\"key\"] to value [\"value\"]", - boost::bind(&LLViewerControlListener::set, &gWarningSettings, _1)); - add("Crash", - "Set gCrashSettings control [\"key\"] to value [\"value\"]", - boost::bind(&LLViewerControlListener::set, &gCrashSettings, _1)); - -#if 0 - add(/*"toggleControl",*/ "Global", boost::bind(&LLViewerControlListener::toggleControl, &gSavedSettings, _1)); - add(/*"toggleControl",*/ "PerAccount", boost::bind(&LLViewerControlListener::toggleControl, &gSavedPerAccountSettings, _1)); - add(/*"toggleControl",*/ "Warning", boost::bind(&LLViewerControlListener::toggleControl, &gWarningSettings, _1)); - add(/*"toggleControl",*/ "Crash", boost::bind(&LLViewerControlListener::toggleControl, &gCrashSettings, _1)); - - add(/*"setDefault",*/ "Global", boost::bind(&LLViewerControlListener::setDefault, &gSavedSettings, _1)); - add(/*"setDefault",*/ "PerAccount", boost::bind(&LLViewerControlListener::setDefault, &gSavedPerAccountSettings, _1)); - add(/*"setDefault",*/ "Warning", boost::bind(&LLViewerControlListener::setDefault, &gWarningSettings, _1)); - add(/*"setDefault",*/ "Crash", boost::bind(&LLViewerControlListener::setDefault, &gCrashSettings, _1)); -#endif // 0 + std::ostringstream groupnames; + groupnames << "[\"group\"] is one of "; + const char* delim = ""; + for (LLControlGroup::key_iter cgki(LLControlGroup::beginKeys()), + cgkend(LLControlGroup::endKeys()); + cgki != cgkend; ++cgki) + { + groupnames << delim << '"' << *cgki << '"'; + delim = ", "; + } + groupnames << '\n'; + std::string grouphelp(groupnames.str()); + std::string replyhelp("If [\"reply\"] requested, send new [\"value\"] on specified LLEventPump\n"); + + add("set", + std::string("Set [\"group\"] control [\"key\"] to optional value [\"value\"]\n" + "If [\"value\"] omitted, set to control's defined default value\n") + + grouphelp + replyhelp, + &LLViewerControlListener::set, + LLSDMap("group", LLSD())("key", LLSD())); + add("toggle", + std::string("Toggle [\"group\"] control [\"key\"], if boolean\n") + grouphelp + replyhelp, + &LLViewerControlListener::toggle, + LLSDMap("group", LLSD())("key", LLSD())); + add("get", + std::string("Query [\"group\"] control [\"key\"], replying on LLEventPump [\"reply\"]\n") + + grouphelp, + &LLViewerControlListener::get, + LLSDMap("group", LLSD())("key", LLSD())("reply", LLSD())); + add("groups", + "Send on LLEventPump [\"reply\"] an array [\"groups\"] of valid group names", + &LLViewerControlListener::groups, + LLSDMap("reply", LLSD())); + add("vars", + std::string("For [\"group\"], send on LLEventPump [\"reply\"] an array [\"vars\"],\n" + "each of whose entries looks like:\n" + " [\"name\"], [\"type\"], [\"value\"], [\"comment\"]\n") + grouphelp, + &LLViewerControlListener::vars, + LLSDMap("group", LLSD())("reply", LLSD())); } -//static -void LLViewerControlListener::set(LLControlGroup * controls, LLSD const & event_data) +struct Info { - if(event_data.has("key")) + Info(const LLSD& request): + response(LLSD(), request), + groupname(request["group"]), + group(LLControlGroup::getInstance(groupname)), + key(request["key"]), + control(NULL) { - std::string key(event_data["key"]); + if (! group) + { + response.error(STRINGIZE("Unrecognized group '" << groupname << "'")); + return; + } - if(controls->controlExists(key)) + control = group->getControl(key); + if (! control) { - controls->setUntypedValue(key, event_data["value"]); + response.error(STRINGIZE("In group '" << groupname + << "', unrecognized control key '" << key << "'")); } - else + } + + ~Info() + { + // If in fact the request passed to our constructor names a valid + // group and key, grab the final value of the indicated control and + // stuff it in our response. Since this outer destructor runs before + // the contained Response destructor, this data will go into the + // response we send. + if (control) { - llwarns << "requested unknown control: \"" << key << '\"' << llendl; + response["name"] = control->getName(); + response["type"] = group->typeEnumToString(control->type()); + response["value"] = control->get(); + response["comment"] = control->getComment(); } } + + LLEventAPI::Response response; + std::string groupname; + LLControlGroup* group; + std::string key; + LLControlVariable* control; +}; + +//static +void LLViewerControlListener::set(LLSD const & request) +{ + Info info(request); + if (! info.control) + return; + + if (request.has("value")) + { + info.control->setValue(request["value"]); + } + else + { + info.control->resetToDefault(); + } } //static -void LLViewerControlListener::toggleControl(LLControlGroup * controls, LLSD const & event_data) +void LLViewerControlListener::toggle(LLSD const & request) { - if(event_data.has("key")) + Info info(request); + if (! info.control) + return; + + if (info.control->isType(TYPE_BOOLEAN)) + { + info.control->set(! info.control->get().asBoolean()); + } + else { - std::string key(event_data["key"]); + info.response.error(STRINGIZE("toggle of non-boolean '" << info.groupname + << "' control '" << info.key + << "', type is " + << info.group->typeEnumToString(info.control->type()))); + } +} - if(controls->controlExists(key)) - { - LLControlVariable * control = controls->getControl(key); - if(control->isType(TYPE_BOOLEAN)) - { - control->set(!control->get().asBoolean()); - } - else - { - llwarns << "requested toggle of non-boolean control: \"" << key << "\", type is " << control->type() << llendl; - } - } - else - { - llwarns << "requested unknown control: \"" << key << '\"' << llendl; - } +void LLViewerControlListener::get(LLSD const & request) +{ + // The Info constructor and destructor actually do all the work here. + Info info(request); +} + +void LLViewerControlListener::groups(LLSD const & request) +{ + // No Info, we're not looking up either a group or a control name. + Response response(LLSD(), request); + for (LLControlGroup::key_iter cgki(LLControlGroup::beginKeys()), + cgkend(LLControlGroup::endKeys()); + cgki != cgkend; ++cgki) + { + response["groups"].append(*cgki); } } -//static -void LLViewerControlListener::setDefault(LLControlGroup * controls, LLSD const & event_data) +struct CollectVars: public LLControlGroup::ApplyFunctor { - if(event_data.has("key")) + CollectVars(LLControlGroup* g): + mGroup(g) + {} + + virtual void apply(const std::string& name, LLControlVariable* control) { - std::string key(event_data["key"]); + vars.append(LLSDMap + ("name", name) + ("type", mGroup->typeEnumToString(control->type())) + ("value", control->get()) + ("comment", control->getComment())); + } - if(controls->controlExists(key)) - { - LLControlVariable * control = controls->getControl(key); - control->resetToDefault(); - } - else - { - llwarns << "requested unknown control: \"" << key << '\"' << llendl; - } + LLControlGroup* mGroup; + LLSD vars; +}; + +void LLViewerControlListener::vars(LLSD const & request) +{ + // This method doesn't use Info, because we're not looking up a specific + // control name. + Response response(LLSD(), request); + std::string groupname(request["group"]); + LLControlGroup* group(LLControlGroup::getInstance(groupname)); + if (! group) + { + return response.error(STRINGIZE("Unrecognized group '" << groupname << "'")); } + + CollectVars collector(group); + group->applyToAll(&collector); + response["vars"] = collector.vars; } diff --git a/indra/newview/llviewercontrollistener.h b/indra/newview/llviewercontrollistener.h index fd211b97af..2e72046924 100644 --- a/indra/newview/llviewercontrollistener.h +++ b/indra/newview/llviewercontrollistener.h @@ -40,11 +40,11 @@ public: LLViewerControlListener(); private: - static void set(LLControlGroup *controls, LLSD const & event_data); - static void toggleControl(LLControlGroup *controls, LLSD const & event_data); - static void setDefault(LLControlGroup *controls, LLSD const & event_data); + static void set(LLSD const & event_data); + static void toggle(LLSD const & event_data); + static void get(LLSD const & event_data); + static void groups(LLSD const & event_data); + static void vars(LLSD const & event_data); }; -extern LLViewerControlListener gSavedSettingsListener; - #endif // LL_LLVIEWERCONTROLLISTENER_H -- cgit v1.2.3 From 7a47afc89cd0aec9eeb5eeaaa256ecf890036432 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 7 Sep 2011 14:36:39 -0500 Subject: add getInfo command to get state information about a ui element --- indra/newview/llwindowlistener.cpp | 30 ++++++++++++++++++++++++++++++ indra/newview/llwindowlistener.h | 1 + 2 files changed, 31 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 05cb798732..eb44a702a4 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -82,6 +82,7 @@ LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& "Optional [\"reply\"] requests a reply event on the named LLEventPump.\n" "reply[\"error\"] isUndefined (None) on success, else an explanatory message.\n"; + add("getInfo", "Get information about the ui element specified by [\"path\"]", &LLWindowListener::getInfo); add("keyDown", keySomething + "keypress event.\n" + keyExplain + mask, &LLWindowListener::keyDown); @@ -246,6 +247,35 @@ KEY getKEY(const LLSD& event) } // namespace +void LLWindowListener::getInfo(LLSD const & evt) +{ + Response response(LLSD(), evt); + + if (evt.has("path")) + { + std::string path(evt["path"]); + LLView * target_view = + LLUI::resolvePath(gViewerWindow->getRootView(), path); + if (target_view != 0) + { + insertViewInformation(response, target_view); + LLRect rect(target_view->calcScreenRect()); + response["rect"] = LLSDMap("left", rect.mLeft)("top", rect.mTop) + ("right", rect.mRight)("bottom", rect.mBottom); + } + else + { + response.error(STRINGIZE(evt["op"].asString() << " request " + "specified invalid \"path\": '" << path << "'")); + } + } + else + { + response.error( + STRINGIZE(evt["op"].asString() << "request did not provide a path" )); + } +} + void LLWindowListener::keyDown(LLSD const & evt) { Response response(LLSD(), evt); diff --git a/indra/newview/llwindowlistener.h b/indra/newview/llwindowlistener.h index 26adff35ff..29c3575258 100644 --- a/indra/newview/llwindowlistener.h +++ b/indra/newview/llwindowlistener.h @@ -39,6 +39,7 @@ public: typedef boost::function KeyboardGetter; LLWindowListener(LLViewerWindow * window, const KeyboardGetter& kbgetter); + void getInfo(LLSD const & evt); void keyDown(LLSD const & evt); void keyUp(LLSD const & evt); void mouseDown(LLSD const & evt); -- cgit v1.2.3 From 616a7b549d21624e6667218efe29c1e552f9b375 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 7 Sep 2011 23:23:08 -0600 Subject: fix for VWR-26864: Recent commit to Snowstorm project introduces frequent errors and crashes associated with private memory pool. --- indra/newview/app_settings/settings.xml | 11 +++++++ indra/newview/llappviewer.cpp | 58 ++++++--------------------------- indra/newview/llviewerdisplay.cpp | 2 +- 3 files changed, 22 insertions(+), 49 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6ebb0162a4..3699dbc3ec 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5646,6 +5646,17 @@ Value 1 + MemoryPrivatePoolSize + + Comment + Size of the private memory pool in MB (min. value is 256) + Persist + 1 + Type + U32 + Value + 512 + MemProfiling Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7e597fe5dc..e6942971f3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -722,7 +722,7 @@ bool LLAppViewer::init() //set the max heap size. initMaxHeapSize() ; - LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled")) ; + LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled"), (U32)gSavedSettings.getU32("MemoryPrivatePoolSize")) ; // write Google Breakpad minidump files to our log directory std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); @@ -1122,63 +1122,25 @@ void LLAppViewer::checkMemory() { const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second //const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds - const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB - //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ; - static void* last_reserved_address = NULL ; + //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ; - if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32()) + if(!gGLManager.mDebugGPU) { return ; } - mMemCheckTimer.reset() ; - - if(gGLManager.mDebugGPU) - { - //update the availability of memory - LLMemory::updateMemoryInfo() ; - } - //check the virtual address space fragmentation - if(!last_reserved_address) - { - last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ; - } - else + if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32()) { - last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ; - if(!last_reserved_address) //failed, try once more - { - last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ; - } + return ; } + mMemCheckTimer.reset() ; - S32 is_low = !last_reserved_address || LLMemory::isMemoryPoolLow() ; - - //if(is_low < 0) //to force quit - //{ - // if(force_quit_timer > MAX_QUIT_WAIT_TIME) //just hit the limit for the first time - // { - // //send out the notification to tell the viewer is about to quit in 30 seconds. - // LLNotification::Params params("ForceQuitDueToLowMemory"); - // LLNotifications::instance().add(params); + //update the availability of memory + LLMemory::updateMemoryInfo() ; - // force_quit_timer = MAX_QUIT_WAIT_TIME - MEMORY_CHECK_INTERVAL ; - // } - // else - // { - // force_quit_timer -= MEMORY_CHECK_INTERVAL ; - // if(force_quit_timer < 0.f) - // { - // forceQuit() ; //quit - // } - // } - //} - //else - //{ - // force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ; - //} + bool is_low = LLMemory::isMemoryPoolLow() ; - LLPipeline::throttleNewMemoryAllocation(!is_low ? FALSE : TRUE) ; + LLPipeline::throttleNewMemoryAllocation(is_low) ; if(is_low) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 6142ee0dd6..19326c4e30 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -202,7 +202,7 @@ void display_stats() gMemoryAllocated = LLMemory::getCurrentRSS(); U32 memory = (U32)(gMemoryAllocated / (1024*1024)); llinfos << llformat("MEMORY: %d MB", memory) << llendl; - LLMemory::logMemoryInfo() ; + LLMemory::logMemoryInfo(TRUE) ; gRecentMemoryTime.reset(); } } -- cgit v1.2.3 From 2d19a2002501d44ce18080b6f26ceaf2dbf796e9 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Thu, 8 Sep 2011 09:46:04 -0500 Subject: add getInfo to LLView to get state information about ui elements. --- indra/newview/llwindowlistener.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index d497964f6c..ac8e981c4e 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -135,18 +135,6 @@ protected: namespace { -void insertViewInformation(LLEventAPI::Response & response, LLView * target) -{ - // Get info about this LLView* for when we send response. - response["path"] = target->getPathname(); - response["class"] = typeid(*target).name(); - response["visible"] = target->getVisible(); - response["visible_chain"] = target->isInVisibleChain(); - response["enabled"] = target->getEnabled(); - response["enabled_chain"] = target->isInEnabledChain(); - response["available"] = target->isAvailable(); -} - // helper for getMask() MASK lookupMask_(const std::string& maskname) { @@ -219,10 +207,7 @@ void LLWindowListener::getInfo(LLSD const & evt) LLUI::resolvePath(gViewerWindow->getRootView(), path); if (target_view != 0) { - insertViewInformation(response, target_view); - LLRect rect(target_view->calcScreenRect()); - response["rect"] = LLSDMap("left", rect.mLeft)("top", rect.mTop) - ("right", rect.mRight)("bottom", rect.mBottom); + response.setResponse(target_view->getInfo()); } else { @@ -253,7 +238,7 @@ void LLWindowListener::keyDown(LLSD const & evt) } else if(target_view->isAvailable()) { - insertViewInformation(response, target_view); + response.setResponse(target_view->getInfo()); gFocusMgr.setKeyboardFocus(target_view); KEY key = getKEY(evt); @@ -290,7 +275,7 @@ void LLWindowListener::keyUp(LLSD const & evt) } else if (target_view->isAvailable()) { - insertViewInformation(response, target_view); + response.setResponse(target_view->getInfo()); gFocusMgr.setKeyboardFocus(target_view); mKbGetter()->handleTranslatedKeyUp(getKEY(evt), getMask(evt)); @@ -370,12 +355,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) "specified invalid \"path\": '" << path << "'")); } - insertViewInformation(response, target); - - // Don't show caller the LLView's own relative rectangle; that only - // tells its dimensions. Provide actual location on screen. - LLRect rect(target->calcScreenRect()); - response["rect"] = LLSDMap("left", rect.mLeft)("top", rect.mTop)("right", rect.mRight)("bottom", rect.mBottom); + response.setResponse(target->getInfo()); // The intent of this test is to prevent trying to drill down to a // widget in a hidden floater, or on a tab that's not current, etc. @@ -397,6 +377,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) if (! has_pos) { + LLRect rect(target->calcScreenRect()); pos.set(rect.getCenterX(), rect.getCenterY()); // nonstandard warning tactic: probably usual case; we want event // sender to know synthesized (x, y), but maybe don't need to log? -- cgit v1.2.3 From 6c253482a610ae98dfd900c29d6c6ee12708b17e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 12 Sep 2011 16:27:58 -0400 Subject: VWR-25897: remove regexp subexpressions that cause backtracking (recursion) without changing what is recognized --- indra/newview/gpu_table.txt | 188 ++++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 94 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 6ed4e3b7f7..80d193d2a7 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -205,20 +205,20 @@ ATI Radeon X800 .*ATI.*(Radeon|RADEON) X8.* 2 1 ATI Radeon X900 .*ATI.*(Radeon|RADEON) X9.* 2 1 ATI Radeon Xpress .*ATI.*(Radeon|RADEON) (Xpress|XPRESS).* 0 1 ATI Rage 128 .*ATI.*Rage 128.* 0 1 -ATI R350 (9800) .*(ATI)?.*R350.* 1 1 -ATI R580 (X1900) .*(ATI)?.*R580.* 3 1 -ATI RC410 (Xpress 200) .*(ATI)?.*RC410.* 0 0 -ATI RS48x (Xpress 200x) .*(ATI)?.*RS48.* 0 0 -ATI RS600 (Xpress 3200) .*(ATI)?.*RS600.* 0 0 -ATI RV350 (9600) .*(ATI)?.*RV350.* 0 1 -ATI RV370 (X300) .*(ATI)?.*RV370.* 0 1 -ATI RV410 (X700) .*(ATI)?.*RV410.* 1 1 -ATI RV515 .*(ATI)?.*RV515.* 1 1 -ATI RV570 (X1900 GT/PRO) .*(ATI)?.*RV570.* 3 1 -ATI RV380 .*(ATI)?.*RV380.* 0 1 -ATI RV530 .*(ATI)?.*RV530.* 1 1 -ATI RX480 (Xpress 200P) .*(ATI)?.*RX480.* 0 1 -ATI RX700 .*(ATI)?.*RX700.* 1 1 +ATI R350 (9800) .*R350.* 1 1 +ATI R580 (X1900) .*R580.* 3 1 +ATI RC410 (Xpress 200) .*RC410.* 0 0 +ATI RS48x (Xpress 200x) .*RS48.* 0 0 +ATI RS600 (Xpress 3200) .*RS600.* 0 0 +ATI RV350 (9600) .*RV350.* 0 1 +ATI RV370 (X300) .*RV370.* 0 1 +ATI RV410 (X700) .*RV410.* 1 1 +ATI RV515 .*RV515.* 1 1 +ATI RV570 (X1900 GT/PRO) .*RV570.* 3 1 +ATI RV380 .*RV380.* 0 1 +ATI RV530 .*RV530.* 1 1 +ATI RX480 (Xpress 200P) .*RX480.* 0 1 +ATI RX700 .*RX700.* 1 1 AMD ANTILLES (HD 6990) .*(AMD|ATI).*(Antilles|ANTILLES).* 3 1 AMD BARTS (HD 6800) .*(AMD|ATI).*(Barts|BARTS).* 3 1 AMD CAICOS (HD 6400) .*(AMD|ATI).*(Caicos|CAICOS).* 3 1 @@ -230,20 +230,20 @@ AMD JUNIPER (HD 5700) .*(AMD|ATI).*(Juniper|JUNIPER).* 3 1 AMD PARK .*(AMD|ATI).*(Park|PARK).* 3 1 AMD REDWOOD (HD 5500/5600) .*(AMD|ATI).*(Redwood|REDWOOD).* 3 1 AMD TURKS (HD 6500/6600) .*(AMD|ATI).*(Turks|TURKS).* 3 1 -AMD RS780 (HD 3200) .*(AMD|ATI)?.*RS780.* 0 1 -AMD RS880 (HD 4200) .*(AMD|ATI)?.*RS880.* 1 1 -AMD RV610 (HD 2400) .*(AMD|ATI)?.*RV610.* 1 1 -AMD RV620 (HD 3400) .*(AMD|ATI)?.*RV620.* 1 1 -AMD RV630 (HD 2600) .*(AMD|ATI)?.*RV630.* 2 1 -AMD RV635 (HD 3600) .*(AMD|ATI)?.*RV635.* 3 1 -AMD RV670 (HD 3800) .*(AMD|ATI)?.*RV670.* 3 1 -AMD R680 (HD 3870 X2) .*(AMD|ATI)?.*R680.* 3 1 -AMD R700 (HD 4800 X2) .*(AMD|ATI)?.*R700.* 3 1 -AMD RV710 (HD 4300) .*(AMD|ATI)?.*RV710.* 1 1 -AMD RV730 (HD 4600) .*(AMD|ATI)?.*RV730.* 3 1 -AMD RV740 (HD 4700) .*(AMD|ATI)?.*RV740.* 3 1 -AMD RV770 (HD 4800) .*(AMD|ATI)?.*RV770.* 3 1 -AMD RV790 (HD 4800) .*(AMD|ATI)?.*RV790.* 3 1 +AMD RS780 (HD 3200) .*RS780.* 0 1 +AMD RS880 (HD 4200) .*RS880.* 1 1 +AMD RV610 (HD 2400) .*RV610.* 1 1 +AMD RV620 (HD 3400) .*RV620.* 1 1 +AMD RV630 (HD 2600) .*RV630.* 2 1 +AMD RV635 (HD 3600) .*RV635.* 3 1 +AMD RV670 (HD 3800) .*RV670.* 3 1 +AMD R680 (HD 3870 X2) .*R680.* 3 1 +AMD R700 (HD 4800 X2) .*R700.* 3 1 +AMD RV710 (HD 4300) .*RV710.* 1 1 +AMD RV730 (HD 4600) .*RV730.* 3 1 +AMD RV740 (HD 4700) .*RV740.* 3 1 +AMD RV770 (HD 4800) .*RV770.* 3 1 +AMD RV790 (HD 4800) .*RV790.* 3 1 ATI 760G/Radeon 3000 .*ATI.*AMD 760G.* 1 1 ATI 780L/Radeon 3000 .*ATI.*AMD 780L.* 1 1 ATI Radeon DDR .*ATI.*(Radeon|RADEON) ?DDR.* 0 1 @@ -255,7 +255,7 @@ ATI FirePro 7000 .*ATI.*FirePro V7.* 3 1 ATI FirePro M .*ATI.*FirePro M.* 3 1 ATI Technologies .*ATI *Technologies.* 0 1 // This entry is last to work around the "R300" driver problem. -ATI R300 (9700) .*(ATI)?.*R300.* 1 1 +ATI R300 (9700) .*R300.* 1 1 ATI Radeon .*ATI.*Radeon.* 0 1 Intel X3100 .*Intel.*X3100.* 0 1 Intel 830M .*Intel.*830M 0 0 @@ -311,70 +311,70 @@ NVIDIA G 315 .*NVIDIA *(GeForce)? *(G)? ?315(M)?.* 2 1 NVIDIA G 320M .*NVIDIA *(GeForce)? *(G)? ?320(M)?.* 2 1 NVIDIA G 405 .*NVIDIA *(GeForce)? *(G)? ?405(M)?.* 1 1 NVIDIA G 410M .*NVIDIA *(GeForce)? *(G)? ?410(M)?.* 1 1 -NVIDIA GT 120M .*NVIDIA.*(GeForce)? *GT *120(M)?.* 2 1 +NVIDIA GT 120M .*NVIDIA *(GeForce)? *GT *120(M)?.* 2 1 NVIDIA GT 120 .*NVIDIA.*GT.*120 2 1 -NVIDIA GT 130M .*NVIDIA.*(GeForce)? *GT *130(M)?.* 2 1 -NVIDIA GT 140M .*NVIDIA.*(GeForce)? *GT *140(M)?.* 2 1 -NVIDIA GT 150M .*NVIDIA.*(GeForce)? *GT(S)? *150(M)?.* 2 1 -NVIDIA GT 160M .*NVIDIA.*(GeForce)? *GT *160(M)?.* 2 1 -NVIDIA GT 220M .*NVIDIA.*(GeForce)? *GT *220(M)?.* 2 1 -NVIDIA GT 230M .*NVIDIA.*(GeForce)? *GT *230(M)?.* 2 1 -NVIDIA GT 240M .*NVIDIA.*(GeForce)? *GT *240(M)?.* 2 1 -NVIDIA GT 250M .*NVIDIA.*(GeForce)? *GT *250(M)?.* 2 1 -NVIDIA GT 260M .*NVIDIA.*(GeForce)? *GT *260(M)?.* 2 1 -NVIDIA GT 320M .*NVIDIA.*(GeForce)? *GT *320(M)?.* 2 1 -NVIDIA GT 325M .*NVIDIA.*(GeForce)? *GT *325(M)?.* 0 1 -NVIDIA GT 330M .*NVIDIA.*(GeForce)? *GT *330(M)?.* 3 1 -NVIDIA GT 335M .*NVIDIA.*(GeForce)? *GT *335(M)?.* 1 1 -NVIDIA GT 340M .*NVIDIA.*(GeForce)? *GT *340(M)?.* 2 1 -NVIDIA GT 415M .*NVIDIA.*(GeForce)? *GT *415(M)?.* 2 1 -NVIDIA GT 420M .*NVIDIA.*(GeForce)? *GT *420(M)?.* 2 1 -NVIDIA GT 425M .*NVIDIA.*(GeForce)? *GT *425(M)?.* 3 1 -NVIDIA GT 430M .*NVIDIA.*(GeForce)? *GT *430(M)?.* 3 1 -NVIDIA GT 435M .*NVIDIA.*(GeForce)? *GT *435(M)?.* 3 1 -NVIDIA GT 440M .*NVIDIA.*(GeForce)? *GT *440(M)?.* 3 1 -NVIDIA GT 445M .*NVIDIA.*(GeForce)? *GT *445(M)?.* 3 1 -NVIDIA GT 450M .*NVIDIA.*(GeForce)? *GT *450(M)?.* 3 1 -NVIDIA GT 520M .*NVIDIA.*(GeForce)? *GT *520(M)?.* 3 1 -NVIDIA GT 525M .*NVIDIA.*(GeForce)? *GT *525(M)?.* 3 1 -NVIDIA GT 540M .*NVIDIA.*(GeForce)? *GT *540(M)?.* 3 1 -NVIDIA GT 550M .*NVIDIA.*(GeForce)? *GT *550(M)?.* 3 1 -NVIDIA GT 555M .*NVIDIA.*(GeForce)? *GT *555(M)?.* 3 1 -NVIDIA GTS 160M .*NVIDIA.*(GeForce)? *GT(S)? *160(M)?.* 2 1 -NVIDIA GTS 240 .*NVIDIA.*(GeForce)? *GTS *24.* 3 1 -NVIDIA GTS 250 .*NVIDIA.*(GeForce)? *GTS *25.* 3 1 -NVIDIA GTS 350M .*NVIDIA.*(GeForce)? *GTS *350M.* 3 1 -NVIDIA GTS 360M .*NVIDIA.*(GeForce)? *GTS *360M.* 3 1 -NVIDIA GTS 360 .*NVIDIA.*(GeForce)? *GTS *360.* 3 1 -NVIDIA GTS 450 .*NVIDIA.*(GeForce)? *GTS *45.* 3 1 -NVIDIA GTX 260 .*NVIDIA.*(GeForce)? *GTX *26.* 3 1 -NVIDIA GTX 275 .*NVIDIA.*(GeForce)? *GTX *275.* 3 1 -NVIDIA GTX 270 .*NVIDIA.*(GeForce)? *GTX *27.* 3 1 -NVIDIA GTX 285 .*NVIDIA.*(GeForce)? *GTX *285.* 3 1 -NVIDIA GTX 280 .*NVIDIA.*(GeForce)? *GTX *280.* 3 1 -NVIDIA GTX 290 .*NVIDIA.*(GeForce)? *GTX *290.* 3 1 -NVIDIA GTX 295 .*NVIDIA.*(GeForce)? *GTX *295.* 3 1 -NVIDIA GTX 460M .*NVIDIA.*(GeForce)? *GTX *460M.* 3 1 -NVIDIA GTX 465 .*NVIDIA.*(GeForce)? *GTX *465.* 3 1 -NVIDIA GTX 460 .*NVIDIA.*(GeForce)? *GTX *46.* 3 1 -NVIDIA GTX 470M .*NVIDIA.*(GeForce)? *GTX *470M.* 3 1 -NVIDIA GTX 470 .*NVIDIA.*(GeForce)? *GTX *47.* 3 1 -NVIDIA GTX 480M .*NVIDIA.*(GeForce)? *GTX *480M.* 3 1 -NVIDIA GTX 485M .*NVIDIA.*(GeForce)? *GTX *485M.* 3 1 -NVIDIA GTX 480 .*NVIDIA.*(GeForce)? *GTX *48.* 3 1 -NVIDIA GTX 530 .*NVIDIA.*(GeForce)? *GTX *53.* 3 1 -NVIDIA GTX 550 .*NVIDIA.*(GeForce)? *GTX *55.* 3 1 -NVIDIA GTX 560 .*NVIDIA.*(GeForce)? *GTX *56.* 3 1 -NVIDIA GTX 570 .*NVIDIA.*(GeForce)? *GTX *57.* 3 1 -NVIDIA GTX 580M .*NVIDIA.*(GeForce)? *GTX *580M.* 3 1 -NVIDIA GTX 580 .*NVIDIA.*(GeForce)? *GTX *58.* 3 1 -NVIDIA GTX 590 .*NVIDIA.*(GeForce)? *GTX *59.* 3 1 -NVIDIA C51 .*NVIDIA.*(GeForce)? *C51.* 0 1 -NVIDIA G72 .*NVIDIA.*(GeForce)? *G72.* 1 1 -NVIDIA G73 .*NVIDIA.*(GeForce)? *G73.* 1 1 -NVIDIA G84 .*NVIDIA.*(GeForce)? *G84.* 2 1 -NVIDIA G86 .*NVIDIA.*(GeForce)? *G86.* 3 1 -NVIDIA G92 .*NVIDIA.*(GeForce)? *G92.* 3 1 +NVIDIA GT 130M .*NVIDIA *(GeForce)? *GT *130(M)?.* 2 1 +NVIDIA GT 140M .*NVIDIA *(GeForce)? *GT *140(M)?.* 2 1 +NVIDIA GT 150M .*NVIDIA *(GeForce)? *GT(S)? *150(M)?.* 2 1 +NVIDIA GT 160M .*NVIDIA *(GeForce)? *GT *160(M)?.* 2 1 +NVIDIA GT 220M .*NVIDIA *(GeForce)? *GT *220(M)?.* 2 1 +NVIDIA GT 230M .*NVIDIA *(GeForce)? *GT *230(M)?.* 2 1 +NVIDIA GT 240M .*NVIDIA *(GeForce)? *GT *240(M)?.* 2 1 +NVIDIA GT 250M .*NVIDIA *(GeForce)? *GT *250(M)?.* 2 1 +NVIDIA GT 260M .*NVIDIA *(GeForce)? *GT *260(M)?.* 2 1 +NVIDIA GT 320M .*NVIDIA *(GeForce)? *GT *320(M)?.* 2 1 +NVIDIA GT 325M .*NVIDIA *(GeForce)? *GT *325(M)?.* 0 1 +NVIDIA GT 330M .*NVIDIA *(GeForce)? *GT *330(M)?.* 3 1 +NVIDIA GT 335M .*NVIDIA *(GeForce)? *GT *335(M)?.* 1 1 +NVIDIA GT 340M .*NVIDIA *(GeForce)? *GT *340(M)?.* 2 1 +NVIDIA GT 415M .*NVIDIA *(GeForce)? *GT *415(M)?.* 2 1 +NVIDIA GT 420M .*NVIDIA *(GeForce)? *GT *420(M)?.* 2 1 +NVIDIA GT 425M .*NVIDIA *(GeForce)? *GT *425(M)?.* 3 1 +NVIDIA GT 430M .*NVIDIA *(GeForce)? *GT *430(M)?.* 3 1 +NVIDIA GT 435M .*NVIDIA *(GeForce)? *GT *435(M)?.* 3 1 +NVIDIA GT 440M .*NVIDIA *(GeForce)? *GT *440(M)?.* 3 1 +NVIDIA GT 445M .*NVIDIA *(GeForce)? *GT *445(M)?.* 3 1 +NVIDIA GT 450M .*NVIDIA *(GeForce)? *GT *450(M)?.* 3 1 +NVIDIA GT 520M .*NVIDIA *(GeForce)? *GT *520(M)?.* 3 1 +NVIDIA GT 525M .*NVIDIA *(GeForce)? *GT *525(M)?.* 3 1 +NVIDIA GT 540M .*NVIDIA *(GeForce)? *GT *540(M)?.* 3 1 +NVIDIA GT 550M .*NVIDIA *(GeForce)? *GT *550(M)?.* 3 1 +NVIDIA GT 555M .*NVIDIA *(GeForce)? *GT *555(M)?.* 3 1 +NVIDIA GTS 160M .*NVIDIA *(GeForce)? *GT(S)? *160(M)?.* 2 1 +NVIDIA GTS 240 .*NVIDIA *(GeForce)? *GTS *24.* 3 1 +NVIDIA GTS 250 .*NVIDIA *(GeForce)? *GTS *25.* 3 1 +NVIDIA GTS 350M .*NVIDIA *(GeForce)? *GTS *350M.* 3 1 +NVIDIA GTS 360M .*NVIDIA *(GeForce)? *GTS *360M.* 3 1 +NVIDIA GTS 360 .*NVIDIA *(GeForce)? *GTS *360.* 3 1 +NVIDIA GTS 450 .*NVIDIA *(GeForce)? *GTS *45.* 3 1 +NVIDIA GTX 260 .*NVIDIA *(GeForce)? *GTX *26.* 3 1 +NVIDIA GTX 275 .*NVIDIA *(GeForce)? *GTX *275.* 3 1 +NVIDIA GTX 270 .*NVIDIA *(GeForce)? *GTX *27.* 3 1 +NVIDIA GTX 285 .*NVIDIA *(GeForce)? *GTX *285.* 3 1 +NVIDIA GTX 280 .*NVIDIA *(GeForce)? *GTX *280.* 3 1 +NVIDIA GTX 290 .*NVIDIA *(GeForce)? *GTX *290.* 3 1 +NVIDIA GTX 295 .*NVIDIA *(GeForce)? *GTX *295.* 3 1 +NVIDIA GTX 460M .*NVIDIA *(GeForce)? *GTX *460M.* 3 1 +NVIDIA GTX 465 .*NVIDIA *(GeForce)? *GTX *465.* 3 1 +NVIDIA GTX 460 .*NVIDIA *(GeForce)? *GTX *46.* 3 1 +NVIDIA GTX 470M .*NVIDIA *(GeForce)? *GTX *470M.* 3 1 +NVIDIA GTX 470 .*NVIDIA *(GeForce)? *GTX *47.* 3 1 +NVIDIA GTX 480M .*NVIDIA *(GeForce)? *GTX *480M.* 3 1 +NVIDIA GTX 485M .*NVIDIA *(GeForce)? *GTX *485M.* 3 1 +NVIDIA GTX 480 .*NVIDIA *(GeForce)? *GTX *48.* 3 1 +NVIDIA GTX 530 .*NVIDIA *(GeForce)? *GTX *53.* 3 1 +NVIDIA GTX 550 .*NVIDIA *(GeForce)? *GTX *55.* 3 1 +NVIDIA GTX 560 .*NVIDIA *(GeForce)? *GTX *56.* 3 1 +NVIDIA GTX 570 .*NVIDIA *(GeForce)? *GTX *57.* 3 1 +NVIDIA GTX 580M .*NVIDIA *(GeForce)? *GTX *580M.* 3 1 +NVIDIA GTX 580 .*NVIDIA *(GeForce)? *GTX *58.* 3 1 +NVIDIA GTX 590 .*NVIDIA *(GeForce)? *GTX *59.* 3 1 +NVIDIA C51 .*NVIDIA *(GeForce)? *C51.* 0 1 +NVIDIA G72 .*NVIDIA *(GeForce)? *G72.* 1 1 +NVIDIA G73 .*NVIDIA *(GeForce)? *G73.* 1 1 +NVIDIA G84 .*NVIDIA *(GeForce)? *G84.* 2 1 +NVIDIA G86 .*NVIDIA *(GeForce)? *G86.* 3 1 +NVIDIA G92 .*NVIDIA *(GeForce)? *G92.* 3 1 NVIDIA GeForce .*GeForce 256.* 0 0 NVIDIA GeForce 2 .*GeForce ?2 ?.* 0 1 NVIDIA GeForce 3 .*GeForce ?3 ?.* 0 1 @@ -477,10 +477,10 @@ NVIDIA nForce .*NVIDIA *nForce.* 0 0 NVIDIA MCP78 .*NVIDIA *MCP78.* 1 1 NVIDIA Quadro2 .*Quadro2.* 0 1 NVIDIA Quadro 1000M .*Quadro.*1000M.* 2 1 -NVIDIA Quadro 2000 M/D .*Quadro.*2000(M|D)?.* 3 1 +NVIDIA Quadro 2000 M/D .*Quadro.*2000.* 3 1 NVIDIA Quadro 4000M .*Quadro.*4000M.* 3 1 NVIDIA Quadro 4000 .*Quadro *4000.* 3 1 -NVIDIA Quadro 50x0 M .*Quadro.*50.0(M)?.* 3 1 +NVIDIA Quadro 50x0 M .*Quadro.*50.0.* 3 1 NVIDIA Quadro 6000 .*Quadro.*6000.* 3 1 NVIDIA Quadro 400 .*Quadro.*400.* 2 1 NVIDIA Quadro 600 .*Quadro.*600.* 2 1 -- cgit v1.2.3 From 74c8c5c6aff988ca75753936ca70abad05bf99d3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 12 Sep 2011 23:09:51 -0400 Subject: CHOP-763: Turn off simulated-mouse-event childFromPoint() warnings. Initial implementation of "LLWindow" operations "mouseDown" etc. would always produce a warning in the response to the effect that the target LLView wasn't frontmost. These warnings were spurious; conversation with Richard makes it seem unlikely that the warning can be made real. Suppressing. --- indra/newview/llwindowlistener.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index ac8e981c4e..6b3ae98ffc 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -385,6 +385,11 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) << pos.mX << ", " << pos.mY << ")")); } +/*==========================================================================*| + // NEVER MIND: the LLView tree defines priority handler layers in + // front of the normal widget set, so this has never yet produced + // anything but spam warnings. (sigh) + // recursive childFromPoint() should give us the frontmost, leafmost // widget at the specified (x, y). LLView* frontmost = root->childFromPoint(pos.mX, pos.mY, true); @@ -395,6 +400,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) << "', but frontmost LLView at (" << pos.mX << ", " << pos.mY << ") is '" << LLView::getPathname(frontmost) << "'")); } +|*==========================================================================*/ // Instantiate a TemporaryDrilldownFunc to route incoming mouse events // to the target LLView*. But put it on the heap since "path" is -- cgit v1.2.3 From b937096c4eb9580fbeea9573acd4736f46da04b8 Mon Sep 17 00:00:00 2001 From: "Tank@Tank_PC.ftrdhcpuser.net" Date: Mon, 12 Sep 2011 23:57:49 -0700 Subject: Fix typo in textures.xml --- indra/newview/skins/default/textures/textures.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 799cd907dc..6360b8cb5a 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -119,7 +119,7 @@ with the same filename but different name - + -- cgit v1.2.3 From 0665d3f2e65b75db55134b5ad3fc1c8182b05f9e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 13 Sep 2011 10:51:31 -0400 Subject: lowercase gpu string and recognizers in gpu_table_tester to match the behavior of the real code --- indra/newview/tests/gpus_results.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/tests/gpus_results.txt b/indra/newview/tests/gpus_results.txt index 7e9a064921..280952e7c5 100644 --- a/indra/newview/tests/gpus_results.txt +++ b/indra/newview/tests/gpus_results.txt @@ -26,7 +26,7 @@ ATI All-in-Wonder X1900 ATI All-in-Wonder X600 supported 1 ATI All-in-Wonder X600 ATI All-in-Wonder X800 supported 2 ATI All-in-Wonder X800 ATI Diamond X1xxx supported 0 ATI Radeon X1xxx -ATI Display Adapter UNRECOGNIZED +ATI Display Adapter supported 0 ATI Display Adapter ATI FireGL supported 0 ATI FireGL ATI FireGL 5200 supported 0 ATI FireGL ATI FireGL 5xxx supported 0 ATI FireGL @@ -502,9 +502,9 @@ ATI Technologies Inc. HIGHTECH EXCALIBUR RADEON 9550SE Series ATI Technologies Inc. HIGHTECH EXCALIBUR X700 PRO supported 0 ATI Technologies ATI Technologies Inc. M21 x86/MMX/3DNow!/SSE2 supported 0 ATI Technologies ATI Technologies Inc. M76M supported 3 ATI M76 -ATI Technologies Inc. MOBILITY RADEON 7500 DDR x86/SSE2 supported 0 ATI Mobility Radeon -ATI Technologies Inc. MOBILITY RADEON 9000 DDR x86/SSE2 supported 0 ATI Mobility Radeon -ATI Technologies Inc. MOBILITY RADEON 9000 IGPRADEON 9100 IGP DDR x86/SSE2 supported 0 ATI Mobility Radeon +ATI Technologies Inc. MOBILITY RADEON 7500 DDR x86/SSE2 supported 0 ATI Mobility Radeon 7xxx +ATI Technologies Inc. MOBILITY RADEON 9000 DDR x86/SSE2 supported 0 ATI Mobility Radeon Xxxx +ATI Technologies Inc. MOBILITY RADEON 9000 IGPRADEON 9100 IGP DDR x86/SSE2 supported 0 ATI Mobility Radeon Xxxx ATI Technologies Inc. MOBILITY RADEON 9600 x86/SSE2 supported 0 ATI Mobility Radeon 9600 ATI Technologies Inc. MOBILITY RADEON 9700 x86/SSE2 supported 1 ATI Mobility Radeon 9700 ATI Technologies Inc. MOBILITY RADEON X300 x86/SSE2 supported 1 ATI Mobility Radeon X3xx @@ -1453,9 +1453,9 @@ NVIDIA RIVA TNT NVIDIA RIVA TNT2/AGP/SSE2 unsupported 0 NVIDIA RIVA TNT NVIDIA RIVA TNT2/PCI/3DNOW! unsupported 0 NVIDIA RIVA TNT NVIDIA nForce unsupported 0 NVIDIA nForce -NVIDIA unknown board/AGP/SSE2 UNRECOGNIZED -NVIDIA unknown board/PCI/SSE2 UNRECOGNIZED -NVIDIA unknown board/PCI/SSE2/3DNOW! UNRECOGNIZED +NVIDIA unknown board/AGP/SSE2 unsupported 0 NVIDIA Generic +NVIDIA unknown board/PCI/SSE2 unsupported 0 NVIDIA Generic +NVIDIA unknown board/PCI/SSE2/3DNOW! unsupported 0 NVIDIA Generic Parallels and ATI Technologies Inc. Parallels using ATI Radeon HD 5670 OpenGL Engine supported 3 ATI Radeon HD 5600 Parallels and ATI Technologies Inc. Parallels using ATI Radeon HD 5750 OpenGL Engine supported 3 ATI Radeon HD 5700 Parallels and ATI Technologies Inc. Parallels using ATI Radeon HD 5770 OpenGL Engine supported 3 ATI Radeon HD 5700 -- cgit v1.2.3 From 95774ade55e83b834add4a8cfe055dcaac2d65a9 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 13 Sep 2011 18:02:48 +0300 Subject: STORM-1597 FIXED Back button int the object profile panel now sticks to the left. --- indra/newview/skins/default/xui/en/sidepanel_task_info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index c2394a3fa2..6600339ad7 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -55,7 +55,7 @@ Mixed Sale