diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfloaterreglistener.cpp | 10 | ||||
-rw-r--r-- | indra/llui/llfloaterreglistener.h | 10 | ||||
-rw-r--r-- | indra/llui/llluafloater.cpp | 80 | ||||
-rw-r--r-- | indra/llui/llluafloater.h | 10 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 2 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 2 |
6 files changed, 57 insertions, 57 deletions
diff --git a/indra/llui/llfloaterreglistener.cpp b/indra/llui/llfloaterreglistener.cpp index e17f9f4dd6..b0dceb55c8 100644 --- a/indra/llui/llfloaterreglistener.cpp +++ b/indra/llui/llfloaterreglistener.cpp @@ -3,25 +3,25 @@ * @author Nat Goodspeed * @date 2009-08-12 * @brief Implementation for llfloaterreglistener. - * + * * $LicenseInfo:firstyear=2009&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$ */ diff --git a/indra/llui/llfloaterreglistener.h b/indra/llui/llfloaterreglistener.h index 2165b1b62f..42e7178cbc 100644 --- a/indra/llui/llfloaterreglistener.h +++ b/indra/llui/llfloaterreglistener.h @@ -3,25 +3,25 @@ * @author Nat Goodspeed * @date 2009-08-12 * @brief Wrap (subset of) LLFloaterReg API with an event API - * + * * $LicenseInfo:firstyear=2009&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$ */ diff --git a/indra/llui/llluafloater.cpp b/indra/llui/llluafloater.cpp index b08508bf9b..ca80a2c451 100644 --- a/indra/llui/llluafloater.cpp +++ b/indra/llui/llluafloater.cpp @@ -1,24 +1,24 @@ -/** +/** * @file llluafloater.cpp * * $LicenseInfo:firstyear=2024&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2024, 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$ * @@ -68,25 +68,25 @@ LLLuaFloater::LLLuaFloater(const LLSD &key) : }; LLSD requiredParams = llsd::map("ctrl_name", LLSD(), "value", LLSD()); - mDispatchListener.add("set_enabled", "", [ctrl_lookup](const LLSD &event) - { + mDispatchListener.add("set_enabled", "", [ctrl_lookup](const LLSD &event) + { return ctrl_lookup(event, [](LLUICtrl *ctrl, const LLSD &event) { ctrl->setEnabled(event["value"].asBoolean()); return LLSD(); }); }, requiredParams); - mDispatchListener.add("set_visible", "", [ctrl_lookup](const LLSD &event) - { + mDispatchListener.add("set_visible", "", [ctrl_lookup](const LLSD &event) + { return ctrl_lookup(event, [](LLUICtrl *ctrl, const LLSD &event) { ctrl->setVisible(event["value"].asBoolean()); return LLSD(); }); }, requiredParams); - mDispatchListener.add("set_value", "", [ctrl_lookup](const LLSD &event) - { + mDispatchListener.add("set_value", "", [ctrl_lookup](const LLSD &event) + { return ctrl_lookup(event, [](LLUICtrl *ctrl, const LLSD &event) { ctrl->setValue(event["value"]); return LLSD(); }); }, requiredParams); - mDispatchListener.add("add_list_element", "", [this](const LLSD &event) - { + mDispatchListener.add("add_list_element", "", [this](const LLSD &event) + { LLScrollListCtrl *ctrl = getChild<LLScrollListCtrl>(event["ctrl_name"].asString()); - if(ctrl) + if(ctrl) { - LLSD element_data = event["value"]; + LLSD element_data = event["value"]; if (element_data.isArray()) { for (const auto &row : llsd::inArray(element_data)) @@ -94,34 +94,34 @@ LLLuaFloater::LLLuaFloater(const LLSD &key) : ctrl->addElement(row); } } - else + else { ctrl->addElement(element_data); } } }, requiredParams); - mDispatchListener.add("clear_list", "", [this](const LLSD &event) - { + mDispatchListener.add("clear_list", "", [this](const LLSD &event) + { LLScrollListCtrl *ctrl = getChild<LLScrollListCtrl>(event["ctrl_name"].asString()); - if(ctrl) + if(ctrl) { ctrl->deleteAllItems(); } }, llsd::map("ctrl_name", LLSD())); - mDispatchListener.add("add_text", "", [this](const LLSD &event) - { + mDispatchListener.add("add_text", "", [this](const LLSD &event) + { LLTextEditor *editor = getChild<LLTextEditor>(event["ctrl_name"].asString()); - if (editor) + if (editor) { editor->pasteTextWithLinebreaks(stringize(event["value"])); editor->addLineBreakChar(true); } }, requiredParams); - mDispatchListener.add("set_label", "", [this](const LLSD &event) - { + mDispatchListener.add("set_label", "", [this](const LLSD &event) + { LLButton *btn = getChild<LLButton>(event["ctrl_name"].asString()); if (btn) { @@ -129,17 +129,17 @@ LLLuaFloater::LLLuaFloater(const LLSD &key) : } }, requiredParams); - mDispatchListener.add("set_title", "", [this](const LLSD &event) - { + mDispatchListener.add("set_title", "", [this](const LLSD &event) + { setTitle(event["value"].asString()); }, llsd::map("value", LLSD())); - - mDispatchListener.add("get_value", "", [ctrl_lookup](const LLSD &event) - { + + mDispatchListener.add("get_value", "", [ctrl_lookup](const LLSD &event) + { return ctrl_lookup(event, [](LLUICtrl *ctrl, const LLSD &event) { return llsd::map("value", ctrl->getValue()); }); }, llsd::map("ctrl_name", LLSD(), "reqid", LLSD())); - mDispatchListener.add("get_selected_id", "", [this](const LLSD &event) + mDispatchListener.add("get_selected_id", "", [this](const LLSD &event) { LLScrollListCtrl *ctrl = getChild<LLScrollListCtrl>(event["ctrl_name"].asString()); if (!ctrl) @@ -157,7 +157,7 @@ LLLuaFloater::~LLLuaFloater() post(LLSD()); } -BOOL LLLuaFloater::postBuild() +BOOL LLLuaFloater::postBuild() { for (LLView *view : *getChildList()) { @@ -217,10 +217,10 @@ void LLLuaFloater::registerCallback(const std::string &ctrl_name, const std::str auto mouse_event_cb = [this, data](LLUICtrl *ctrl, const LLSD ¶m) { post(data); }; - auto mouse_event_coords_cb = [this, data](LLUICtrl *ctrl, S32 x, S32 y, MASK mask) - { + auto mouse_event_coords_cb = [this, data](LLUICtrl *ctrl, S32 x, S32 y, MASK mask) + { LLSD event(data); - post(event.with("x", x).with("y", y)); + post(event.with("x", x).with("y", y)); }; auto post_with_value = [this, data](LLSD value) @@ -260,12 +260,12 @@ void LLLuaFloater::registerCallback(const std::string &ctrl_name, const std::str { list->setDoubleClickCallback( [post_with_value, list](){ post_with_value(LLSD(list->getCurrentID())); }); } - else + else { ctrl->setDoubleClickCallback(mouse_event_coords_cb); } } - else if (event_is(event, "keystroke")) + else if (event_is(event, "keystroke")) { LLTextEditor* text_editor = dynamic_cast<LLTextEditor*>(ctrl); if (text_editor) @@ -278,7 +278,7 @@ void LLLuaFloater::registerCallback(const std::string &ctrl_name, const std::str line_editor->setKeystrokeCallback([post_with_value](LLLineEditor *editor, void* userdata) { post_with_value(editor->getValue()); }, NULL); } } - else + else { LL_WARNS("LuaFloater") << "Can't register callback for unknown event: " << event << " , control: " << ctrl_name << LL_ENDL; } @@ -292,7 +292,7 @@ void LLLuaFloater::post(const LLSD &data) LLEventPumps::instance().obtain(mReplyPumpName).post(stamped_data); } -void LLLuaFloater::postEvent(LLSD data, const std::string &event_name) +void LLLuaFloater::postEvent(LLSD data, const std::string &event_name) { llassert(EVENT_LIST.find(event_name) != EVENT_LIST.end()); post(data.with("event", event_name)); @@ -302,12 +302,12 @@ void LLLuaFloater::showLuaFloater(const LLSD &data) { fsyspath fs_path(data["xml_path"].asString()); std::string path = fs_path.lexically_normal().u8string(); - if (!fs_path.is_absolute()) + if (!fs_path.is_absolute()) { std::string lib_path = gDirUtilp->getExpandedFilename(LL_PATH_SCRIPTS, "lua"); path = (fsyspath(lib_path) / path).u8string(); } - + LLLuaFloater *floater = new LLLuaFloater(data); floater->buildFromFile(path); floater->openFloater(floater->getKey()); diff --git a/indra/llui/llluafloater.h b/indra/llui/llluafloater.h index ccc3ccb39b..d0641d41b0 100644 --- a/indra/llui/llluafloater.h +++ b/indra/llui/llluafloater.h @@ -1,24 +1,24 @@ -/** +/** * @file llluafloater.h * * $LicenseInfo:firstyear=2024&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2024, 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$ */ diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index b6b83c4716..65211bf122 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -953,7 +953,7 @@ public: typedef LLUICtrl::CommitCallbackInfo cb_info; static void addCommit(view_listener_t *listener, const std::string &name, cb_info::EUntrustedCall handle_untrusted = cb_info::UNTRUSTED_ALLOW) { - LLUICtrl::CommitCallbackRegistry::currentRegistrar().add(name, + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add(name, cb_info([listener](LLUICtrl*, const LLSD& param){ return listener->handleEvent(param); }, handle_untrusted)); } diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index d6631a9cd9..f1dc3d7c08 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -284,7 +284,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa std::string function_name = cb.function_name; setFunctionName(function_name); LLUICtrl::CommitCallbackInfo *info = (CommitCallbackRegistry::getValue(function_name)); - if (info && info->callback_func) + if (info && info->callback_func) { if (cb.parameter.isProvided()) return boost::bind((info->callback_func), _1, cb.parameter); |