2016-01-10 21:03:45 +00:00
|
|
|
extern "C"
|
|
|
|
|
{
|
|
|
|
|
#include "../interface/screenshot.h"
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-10 19:41:09 +00:00
|
|
|
#include "CommandLine.hpp"
|
|
|
|
|
|
2016-01-10 21:03:45 +00:00
|
|
|
static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator);
|
|
|
|
|
|
2016-01-10 19:41:09 +00:00
|
|
|
const CommandLineCommand CommandLine::ScreenshotCommands[]
|
|
|
|
|
{
|
|
|
|
|
// Main commands
|
2016-01-10 21:03:45 +00:00
|
|
|
DefineCommand("", "<file> <output_image> <width> <height> [<x> <y> <zoom> <rotation>]", nullptr, HandleScreenshot),
|
|
|
|
|
DefineCommand("", "<file> <output_image> giant <zoom> <rotation>", nullptr, HandleScreenshot),
|
2016-01-10 19:41:09 +00:00
|
|
|
CommandTableEnd
|
|
|
|
|
};
|
2016-01-10 21:03:45 +00:00
|
|
|
|
|
|
|
|
static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator)
|
|
|
|
|
{
|
|
|
|
|
const char * * argv = (const char * *)argEnumerator->GetArguments() + argEnumerator->GetIndex() - 1;
|
|
|
|
|
int argc = argEnumerator->GetCount() - argEnumerator->GetIndex() + 1;
|
|
|
|
|
int result = cmdline_for_screenshot(argv, argc);
|
|
|
|
|
if (result < 0) {
|
|
|
|
|
return EXITCODE_FAIL;
|
|
|
|
|
}
|
|
|
|
|
return EXITCODE_OK;
|
|
|
|
|
}
|