Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Sep 15, 2024
1 parent aa52aa4 commit b981927
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions vstgui/uidescription-scripting/uiscripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ struct ViewScriptObject;
class ScriptContext : public IScriptContextInternal
{
public:
using OnScriptException = std::function<void (std::string_view reason)>;
using OnScriptExceptionFunc = UIScripting::OnScriptExceptionFunc;
using ReadScriptContentsFunc = UIScripting::ReadScriptContentsFunc;

ScriptContext (IUIDescription* uiDesc, const OnScriptException& onExceptionFunc,
ScriptContext (IUIDescription* uiDesc, const OnScriptExceptionFunc& onExceptionFunc,
const ReadScriptContentsFunc& readContentsFunc);
~ScriptContext () noexcept;

Expand Down Expand Up @@ -98,14 +98,14 @@ struct ScriptContext::Impl : ViewListenerAdapter,
IUIDescription* uiDesc {nullptr};

std::unique_ptr<CTinyJS> jsContext;
OnScriptException onScriptException;
OnScriptExceptionFunc onScriptException;
ReadScriptContentsFunc readScriptContents;
using ViewScriptMap = ScriptingInternal::ViewScriptMap;
ViewScriptMap viewScriptMap;

UIDescScriptObject uiDescObject;

Impl (IUIDescription* uiDesc, const OnScriptException& onExceptionFunc,
Impl (IUIDescription* uiDesc, const OnScriptExceptionFunc& onExceptionFunc,
const ReadScriptContentsFunc& readContentsFunc)
: uiDesc (uiDesc), onScriptException (onExceptionFunc), readScriptContents (readContentsFunc)
{
Expand Down Expand Up @@ -614,7 +614,7 @@ struct ScriptContext::Impl : ViewListenerAdapter,
//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------
ScriptContext::ScriptContext (IUIDescription* uiDesc, const OnScriptException& onExceptionFunc,
ScriptContext::ScriptContext (IUIDescription* uiDesc, const OnScriptExceptionFunc& onExceptionFunc,
const ReadScriptContentsFunc& readContentsFunc)
{
impl = std::make_unique<Impl> (uiDesc, onExceptionFunc, readContentsFunc);
Expand Down Expand Up @@ -668,12 +668,12 @@ struct UIScripting::Impl

std::unordered_map<const IUIDescription*, std::pair<JSViewFactoryPtr, ScriptContextPtr>> map;

static OnScriptException onScriptExceptionFunc;
static OnScriptExceptionFunc onScriptExceptionFunc;
static ReadScriptContentsFunc readScriptContentsFunc;
};

//------------------------------------------------------------------------
UIScripting::OnScriptException UIScripting::Impl::onScriptExceptionFunc =
UIScripting::OnScriptExceptionFunc UIScripting::Impl::onScriptExceptionFunc =
[] (std::string_view reason) {
std::cerr << reason << '\n';
};
Expand Down Expand Up @@ -764,7 +764,7 @@ void UIScripting::onEditingEnd (IUIDescription* desc)
}

//------------------------------------------------------------------------
void UIScripting::init (const OnScriptException& onExceptionFunc,
void UIScripting::init (const OnScriptExceptionFunc& onExceptionFunc,
const ReadScriptContentsFunc& readScriptContentsFunc)
{
if (onExceptionFunc)
Expand Down
4 changes: 2 additions & 2 deletions vstgui/uidescription-scripting/uiscripting.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace VSTGUI {
class UIScripting : public UIDescriptionAddOnAdapter
{
public:
using OnScriptException = std::function<void (std::string_view reason)>;
using OnScriptExceptionFunc = std::function<void (std::string_view reason)>;
using ReadScriptContentsFunc = std::function<std::string (std::string_view filename)>;

/** initialize the UIScripting library
Expand All @@ -33,7 +33,7 @@ class UIScripting : public UIDescriptionAddOnAdapter
* @param readScriptContentsFunc [optional] called to load the script from a filename,
* uses the resource folder as default.
*/
static void init (const OnScriptException& onExceptionFunc = {},
static void init (const OnScriptExceptionFunc& onExceptionFunc = {},
const ReadScriptContentsFunc& readScriptContentsFunc = {});

~UIScripting () noexcept;
Expand Down

0 comments on commit b981927

Please sign in to comment.