summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindowlistener.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindowlistener.cpp')
-rw-r--r--indra/newview/llviewerwindowlistener.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp
index 317e361c80..de57788271 100644
--- a/indra/newview/llviewerwindowlistener.cpp
+++ b/indra/newview/llviewerwindowlistener.cpp
@@ -20,8 +20,9 @@
// other Linden headers
#include "llviewerwindow.h"
-LLViewerWindowListener::LLViewerWindowListener(const std::string& pumpname, LLViewerWindow* llviewerwindow):
- LLDispatchListener(pumpname, "op"),
+LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow):
+ LLEventAPI("LLViewerWindow",
+ "LLViewerWindow listener to (e.g.) save a screenshot"),
mViewerWindow(llviewerwindow)
{
// add() every method we want to be able to invoke via this event API.
@@ -34,8 +35,15 @@ LLViewerWindowListener::LLViewerWindowListener(const std::string& pumpname, LLVi
// saveSnapshotArgs["showui"] = LLSD::Boolean();
// saveSnapshotArgs["rebuild"] = LLSD::Boolean();
// saveSnapshotArgs["type"] = LLSD::String();
- add("saveSnapshot", &LLViewerWindowListener::saveSnapshot, saveSnapshotArgs);
- add("requestReshape", &LLViewerWindowListener::requestReshape);
+ add("saveSnapshot",
+ "Save screenshot: [\"filename\"], [\"width\"], [\"height\"], [\"showui\"], [\"rebuild\"], [\"type\"]\n"
+ "type: \"COLOR\", \"DEPTH\", \"OBJECT_ID\"\n"
+ "Post on [\"reply\"] an event containing [\"ok\"]",
+ &LLViewerWindowListener::saveSnapshot,
+ saveSnapshotArgs);
+ add("requestReshape",
+ "Resize the window: [\"w\"], [\"h\"]",
+ &LLViewerWindowListener::requestReshape);
}
void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
@@ -50,8 +58,8 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
#undef tp
// Our add() call should ensure that the incoming LLSD does in fact
// contain our required arguments. Deal with the optional ones.
- S32 width (mViewerWindow->getWindowDisplayWidth());
- S32 height(mViewerWindow->getWindowDisplayHeight());
+ S32 width (mViewerWindow->getWindowWidthRaw());
+ S32 height(mViewerWindow->getWindowHeightRaw());
if (event.has("width"))
width = event["width"].asInteger();
if (event.has("height"))