diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-29 07:43:28 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-29 07:56:09 +0300 |
commit | 1b68f71348ecf3983b76b40d7940da8377f049b7 (patch) | |
tree | 2974eddaef130a067c26033d60a59fc790365b3d /indra/llui/llviewereventrecorder.cpp | |
parent | af4ea94efc1999f3b19fd8d643d0331f0b77e265 (diff) |
#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed
Diffstat (limited to 'indra/llui/llviewereventrecorder.cpp')
-rw-r--r-- | indra/llui/llviewereventrecorder.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index cb000aef74..8154a98b85 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -3,22 +3,22 @@ * @brief Viewer event recording and playback support for mouse and keyboard events * * $LicenseInfo:firstyear=2013&license=viewerlgpl$ - * + * * Copyright (c) 2013, 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$ */ @@ -35,7 +35,7 @@ LLViewerEventRecorder::LLViewerEventRecorder() { // Remove any previous event log file std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old"); LLFile::remove(old_log_ui_events_to_llsd_file, ENOENT); - + mLogFilename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.llsd"); LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file, ENOENT); @@ -52,7 +52,7 @@ void LLViewerEventRecorder::setEventLoggingOn() { if (! mLog.is_open()) { mLog.open(mLogFilename.c_str(), std::ios_base::out); } - logEvents=true; + logEvents=true; LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << LL_ENDL; } @@ -83,7 +83,7 @@ void LLViewerEventRecorder::clear(S32 r) { global_x=r; global_y=r; - + } @@ -115,9 +115,9 @@ void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 g this->global_y=global_y; // ONLY record deepest xui path for hierarchy searches - or first/only xui for floaters/panels reached via mouse captor - and llmousehandler - if (mName!="" && mName!="/" && xui=="") { - // xui=std::string("/")+mName+xui; - //xui=mName+xui; + if (mName!="" && mName!="/" && xui=="") { + // xui=std::string("/")+mName+xui; + //xui=mName+xui; xui = mName; // TODO review confirm we never call with partial path - also cAN REMOVE CHECK FOR "" - ON OTHER HAND IT'S PRETTY HARMLESS } @@ -148,7 +148,7 @@ void LLViewerEventRecorder::logVisibilityChange(std::string xui, std::string nam event.insert("path",LLSD(xui)); } - event.insert("timestamp",LLSD(LLDate::now().asString())); + event.insert("timestamp",LLSD(LLDate::now().asString())); recordEvent(event); } @@ -181,7 +181,7 @@ void LLViewerEventRecorder::logKeyEvent(KEY key, MASK mask) { // path (optional) - for now we are not recording path for key events during record - should not be needed for full record and playback of recorded steps // as a vita script - it does become useful if you edit the resulting vita script and wish to remove some steps leading to a key event - that sort of edit might // break the test script and it would be useful to have more context to make these sorts of edits safer - + // TODO replace this with a call which extracts to an array of names of masks (just like vita expects during playback) // This is looking more and more like an object is a good idea, for this part a handy method call to setMask(mask) would be nice :-) // call the func - llkeyboard::llsdStringarrayFromMask @@ -193,11 +193,11 @@ void LLViewerEventRecorder::logKeyEvent(KEY key, MASK mask) { if (mask & MASK_SHIFT) { key_mask.append(LLSD("SHIFT")); } if (mask & MASK_MAC_CONTROL) { key_mask.append(LLSD("MAC_CONTROL")); } - event.insert("mask",key_mask); - event.insert("timestamp",LLSD(LLDate::now().asString())); + event.insert("mask",key_mask); + event.insert("timestamp",LLSD(LLDate::now().asString())); - // Although vita has keyDown and keyUp requests it does not have type as a high-level concept - // (maybe it should) - instead it has a convenience method that generates the keydown and keyup events + // Although vita has keyDown and keyUp requests it does not have type as a high-level concept + // (maybe it should) - instead it has a convenience method that generates the keydown and keyup events // Here we will use "type" as our event type LL_DEBUGS() << "LLVIewerEventRecorder::logKeyEvent Serialized LLSD for event " << event.asString() << "\n" << LL_ENDL; @@ -217,17 +217,17 @@ void LLViewerEventRecorder::playbackRecording() { // ivita sets this on startup, it also sends commands to the viewer to make start, stop, and playback menu items visible in viewer LeapCommand =LLUI::getInstance()->mSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand"); - + LL_DEBUGS() << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << LL_ENDL; LLLeap::create("", LeapCommand, false); // exception=false - + } void LLViewerEventRecorder::recordEvent(LLSD event) { LL_DEBUGS() << "LLViewerEventRecorder::recordEvent event written to log: " << LLSDXMLStreamer(event) << LL_ENDL; mLog << event << std::endl; - + } void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) { if (! logEvents) return; @@ -238,16 +238,16 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) { event.insert("timestamp",LLSD(LLDate::now().asString())); - + // keysym ...or // keycode...or // char LL_DEBUGS() << "Wrapped in conversion to wstring " << wstring_to_utf8str(LLWString( 1, uni_char)) << "\n" << LL_ENDL; - + event.insert("char", - LLSD( wstring_to_utf8str(LLWString( 1,uni_char)) ) - ); + LLSD( wstring_to_utf8str(LLWString( 1,uni_char)) ) + ); // path (optional) - for now we are not recording path for key events during record - should not be needed for full record and playback of recorded steps // as a vita script - it does become useful if you edit the resulting vita script and wish to remove some steps leading to a key event - that sort of edit might @@ -255,7 +255,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) { // TODO need to consider mask keys too? Doesn't seem possible - at least not easily at this point - event.insert("event",LLSD("keyDown")); + event.insert("event",LLSD("keyDown")); LL_DEBUGS() << "[VITA] unicode key: " << uni_char << LL_ENDL; LL_DEBUGS() << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << LL_ENDL; @@ -267,7 +267,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) { void LLViewerEventRecorder::logMouseEvent(std::string button_state,std::string button_name) { - if (! logEvents) return; + if (! logEvents) return; LLSD event=LLSD::emptyMap(); @@ -286,11 +286,11 @@ void LLViewerEventRecorder::logMouseEvent(std::string button_state,std::string b event.insert("global_x",LLSD(global_x)); event.insert("global_y",LLSD(global_y)); } - event.insert("timestamp",LLSD(LLDate::now().asString())); + event.insert("timestamp",LLSD(LLDate::now().asString())); recordEvent(event); clear(UNDEFINED); - + } |