NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
winlayout.cpp File Reference
#include "winlayout.hpp"
#include "../utils/tinyxml2.h"
#include "../io/styledtextfile.hpp"
#include "../../kernel.hpp"
#include "../procedure/includer.hpp"
#include <stack>
#include <memory>
Include dependency graph for winlayout.cpp:

Go to the source code of this file.

Functions

std::string removeQuotationMarks (const std::string &sString)
 This function simply removes the surrounding quotation marks. More...
 
static std::string parseNumOpt (const std::string &sCmd, size_t pos)
 This static function parses a numerical argument. More...
 
static std::string parseStringOpt (const std::string &sCmd, size_t pos)
 This static function parses a string option. More...
 
static std::string parseEventOpt (const std::string &sCmd, size_t pos, const std::string &sFolderName)
 This static function parses a event argument. More...
 
static void evaluateExpression (std::string &sExpr)
 This static function evaluates the expression part of each window layout command. More...
 
static void parseLayoutCommand (const std::string &sLayoutCommand, tinyxml2::XMLElement *layoutElement, const std::string &sFolderName)
 This static function parses a single layout command into a usable XML element. More...
 
static std::string parseLayoutScript (std::string &sLayoutScript, tinyxml2::XMLDocument *layout)
 This static function parses a layout script into a xml data container usable by the GUI. Returns the name of the onopen event handler, if any. More...
 
static int getItemId (const std::string &sCmd)
 This static function returns the item id from the user command string. It is also handled if the user erroneously uses "id" instead "item". More...
 
static NumeRe::WindowInformation getWindow (const std::string &sExpr)
 This static function returns the window information describing the window with the selected ID. More...
 
static void getParametersFromWindow (CommandLineParser &cmdParser, const std::string &sExpr)
 This static function handles property reads from windows. More...
 
static void setParametersInWindow (CommandLineParser &cmdParser, const std::string &sExpr)
 This static function handles property writes in windows. More...
 
void windowCommand (CommandLineParser &cmdParser)
 This function is the actual implementation of the window command. More...
 
static std::string getProcedureFileName (std::string sProc)
 Converts a full-qualified procedure name into the corresponding file name. More...
 
std::vector< std::string > getEventProcedures (const std::string &sLayoutFile)
 Examines a window layout file and searches for all event handler procedures. Returns their corresponding filenames as a vector. Might contain duplicates. More...
 
void dialogCommand (CommandLineParser &cmdParser)
 This function is the actual implementation of the dialog command. More...
 

Function Documentation

◆ dialogCommand()

◆ evaluateExpression()

static void evaluateExpression ( std::string &  sExpr)
static

This static function evaluates the expression part of each window layout command.

Parameters
sExprstd::string&
Returns
void

Definition at line 117 of file winlayout.cpp.

References FunctionDefinitionManager::call(), MemoryManager::containsTablesOrClusters(), mu::ParserBase::Eval(), NumeRe::StringParser::evalAndFormat(), SyntaxError::FUNCTION_ERROR, getDataElements(), NumeReKernel::getDefinitions(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), NumeReKernel::getParser(), NumeReKernel::getSettings(), NumeReKernel::getStringParser(), NumeRe::StringParser::isStringExpression(), mu::ParserBase::SetExpr(), NumeRe::StringParser::STRING_SUCCESS, and toString().

Referenced by parseLayoutCommand().

Here is the call graph for this function:

◆ getEventProcedures()

std::vector< std::string > getEventProcedures ( const std::string &  sLayoutFile)

Examines a window layout file and searches for all event handler procedures. Returns their corresponding filenames as a vector. Might contain duplicates.

Parameters
sLayoutFileconst std::string&
Returns
std::vector<std::string>

Definition at line 723 of file winlayout.cpp.

References findParameter(), StyledTextFile::getLinesCount(), getProcedureFileName(), StyledTextFile::getStrippedLine(), and parseEventOpt().

Referenced by PackageDialog::findLayoutDependencies(), and DocumentationGenerator::followBranch().

Here is the call graph for this function:

◆ getItemId()

static int getItemId ( const std::string &  sCmd)
static

This static function returns the item id from the user command string. It is also handled if the user erroneously uses "id" instead "item".

Parameters
sCmdconst std::string&
Returns
int

Definition at line 407 of file winlayout.cpp.

References ARGEXTRACT_ASINT, ARGEXTRACT_PARSED, ARGEXTRACT_STRIPPED, findParameter(), getArgAtPos(), and StrToInt().

Referenced by getParametersFromWindow(), and setParametersInWindow().

Here is the call graph for this function:

◆ getParametersFromWindow()

◆ getProcedureFileName()

static std::string getProcedureFileName ( std::string  sProc)
static

Converts a full-qualified procedure name into the corresponding file name.

Parameters
sProcstd::string
Returns
std::string

Definition at line 690 of file winlayout.cpp.

References NumeReKernel::getInstance(), NumeReKernel::getProcedureInterpreter(), and FileSystem::ValidFileName().

Referenced by getEventProcedures().

Here is the call graph for this function:

◆ getWindow()

static NumeRe::WindowInformation getWindow ( const std::string &  sExpr)
static

This static function returns the window information describing the window with the selected ID.

Parameters
sExprconst std::string&
Returns
NumeRe::WindowInformation

Definition at line 427 of file winlayout.cpp.

References getDataElements(), NumeReKernel::getInstance(), NumeReKernel::getParser(), NumeRe::WindowManager::getWindowInformation(), NumeReKernel::getWindowManager(), intCast(), and mu::ParserBase::SetExpr().

Referenced by getParametersFromWindow(), NumeReKernel::numberOfNumbersPerLine(), setParametersInWindow(), and windowCommand().

Here is the call graph for this function:

◆ parseEventOpt()

static std::string parseEventOpt ( const std::string &  sCmd,
size_t  pos,
const std::string &  sFolderName 
)
static

This static function parses a event argument.

Parameters
sCmdconst std::string&
possize_t
sFolderNameconst std::string&
Returns
std::string

Definition at line 79 of file winlayout.cpp.

References getArgAtPos(), NumeReKernel::getInstance(), Settings::getProcPath(), NumeReKernel::getSettings(), and replaceAll().

Referenced by getEventProcedures(), parseLayoutCommand(), and parseLayoutScript().

Here is the call graph for this function:

◆ parseLayoutCommand()

static void parseLayoutCommand ( const std::string &  sLayoutCommand,
tinyxml2::XMLElement layoutElement,
const std::string &  sFolderName 
)
static

This static function parses a single layout command into a usable XML element.

Parameters
sLayoutCommandconst std::string&
layoutElementtinyxml2::XMLElement*
sFolderNameconst std::string&
Returns
void

Definition at line 169 of file winlayout.cpp.

References evaluateExpression(), findParameter(), getArgAtPos(), min, parseEventOpt(), parseNumOpt(), parseStringOpt(), replaceAll(), tinyxml2::XMLElement::SetAttribute(), tinyxml2::XMLElement::SetText(), and StripSpaces().

Referenced by parseLayoutScript().

Here is the call graph for this function:

◆ parseLayoutScript()

static std::string parseLayoutScript ( std::string &  sLayoutScript,
tinyxml2::XMLDocument layout 
)
static

◆ parseNumOpt()

static std::string parseNumOpt ( const std::string &  sCmd,
size_t  pos 
)
static

This static function parses a numerical argument.

Parameters
sCmdconst std::string&
possize_t
Returns
std::string

Definition at line 40 of file winlayout.cpp.

References ARGEXTRACT_PARSED, ARGEXTRACT_STRIPPED, and getArgAtPos().

Referenced by parseLayoutCommand(), parseLayoutScript(), and setParametersInWindow().

Here is the call graph for this function:

◆ parseStringOpt()

static std::string parseStringOpt ( const std::string &  sCmd,
size_t  pos 
)
static

This static function parses a string option.

Parameters
sCmdconst std::string&
possize_t
Returns
std::string

Definition at line 55 of file winlayout.cpp.

References ARGEXTRACT_PARSED, getArgAtPos(), and StripSpaces().

Referenced by parseLayoutCommand(), and parseLayoutScript().

Here is the call graph for this function:

◆ removeQuotationMarks()

std::string removeQuotationMarks ( const std::string &  sString)

This function simply removes the surrounding quotation marks.

Parameters
sStringconst std::string&
Returns
std::string

Definition at line 79 of file stringfunctions.hpp.

Referenced by dialogCommand(), and windowCommand().

◆ setParametersInWindow()

◆ windowCommand()