forked from mirrors/0ad
Mass rename CxPrivate to CmptPrivate.
As part of the SM45->52 migration, a ScriptInterface becomes a wrapper around a JSCompartment, not a JSContext, thus we ought to store private data for the compartment and not the context. This is a mass rename of CxPrivate to CmptPrivate to match that before the actual changes. Part of the SM52 migration, stage: SM45 compatible Patch by: Itms Tested By: Freagarach Refs #4893 Differential Revision: https://code.wildfiregames.com/D3089 This was SVN commit r24177.
This commit is contained in:
@@ -27,31 +27,31 @@
|
||||
|
||||
// Note that the initData argument may only contain clonable data.
|
||||
// Functions aren't supported for example!
|
||||
void JSI_GUIManager::PushGuiPage(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& name, JS::HandleValue initData, JS::HandleValue callbackFunction)
|
||||
void JSI_GUIManager::PushGuiPage(ScriptInterface::CmptPrivate* pCmptPrivate, const std::wstring& name, JS::HandleValue initData, JS::HandleValue callbackFunction)
|
||||
{
|
||||
g_GUI->PushPage(name, pCxPrivate->pScriptInterface->WriteStructuredClone(initData), callbackFunction);
|
||||
g_GUI->PushPage(name, pCmptPrivate->pScriptInterface->WriteStructuredClone(initData), callbackFunction);
|
||||
}
|
||||
|
||||
void JSI_GUIManager::SwitchGuiPage(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& name, JS::HandleValue initData)
|
||||
void JSI_GUIManager::SwitchGuiPage(ScriptInterface::CmptPrivate* pCmptPrivate, const std::wstring& name, JS::HandleValue initData)
|
||||
{
|
||||
g_GUI->SwitchPage(name, pCxPrivate->pScriptInterface, initData);
|
||||
g_GUI->SwitchPage(name, pCmptPrivate->pScriptInterface, initData);
|
||||
}
|
||||
|
||||
void JSI_GUIManager::PopGuiPage(ScriptInterface::CxPrivate* pCxPrivate, JS::HandleValue args)
|
||||
void JSI_GUIManager::PopGuiPage(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue args)
|
||||
{
|
||||
if (g_GUI->GetPageCount() < 2)
|
||||
{
|
||||
ScriptInterface::Request rq(pCxPrivate);
|
||||
ScriptInterface::Request rq(pCmptPrivate);
|
||||
JS_ReportError(rq.cx, "Can't pop GUI pages when less than two pages are opened!");
|
||||
return;
|
||||
}
|
||||
|
||||
g_GUI->PopPage(pCxPrivate->pScriptInterface->WriteStructuredClone(args));
|
||||
g_GUI->PopPage(pCmptPrivate->pScriptInterface->WriteStructuredClone(args));
|
||||
}
|
||||
|
||||
JS::Value JSI_GUIManager::GetGUIObjectByName(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name)
|
||||
JS::Value JSI_GUIManager::GetGUIObjectByName(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& name)
|
||||
{
|
||||
CGUI* guiPage = static_cast<CGUI*>(pCxPrivate->pCBData);
|
||||
CGUI* guiPage = static_cast<CGUI*>(pCmptPrivate->pCBData);
|
||||
|
||||
IGUIObject* guiObj = guiPage->FindObjectByName(name);
|
||||
if (!guiObj)
|
||||
@@ -60,36 +60,36 @@ JS::Value JSI_GUIManager::GetGUIObjectByName(ScriptInterface::CxPrivate* pCxPriv
|
||||
return JS::ObjectValue(*guiObj->GetJSObject());
|
||||
}
|
||||
|
||||
void JSI_GUIManager::SetGlobalHotkey(ScriptInterface::CxPrivate* pCxPrivate, const std::string& hotkeyTag, const std::string& eventName, JS::HandleValue function)
|
||||
void JSI_GUIManager::SetGlobalHotkey(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& hotkeyTag, const std::string& eventName, JS::HandleValue function)
|
||||
{
|
||||
CGUI* guiPage = static_cast<CGUI*>(pCxPrivate->pCBData);
|
||||
CGUI* guiPage = static_cast<CGUI*>(pCmptPrivate->pCBData);
|
||||
guiPage->SetGlobalHotkey(hotkeyTag, eventName, function);
|
||||
}
|
||||
|
||||
void JSI_GUIManager::UnsetGlobalHotkey(ScriptInterface::CxPrivate* pCxPrivate, const std::string& hotkeyTag, const std::string& eventName)
|
||||
void JSI_GUIManager::UnsetGlobalHotkey(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& hotkeyTag, const std::string& eventName)
|
||||
{
|
||||
CGUI* guiPage = static_cast<CGUI*>(pCxPrivate->pCBData);
|
||||
CGUI* guiPage = static_cast<CGUI*>(pCmptPrivate->pCBData);
|
||||
guiPage->UnsetGlobalHotkey(hotkeyTag, eventName);
|
||||
}
|
||||
|
||||
std::wstring JSI_GUIManager::SetCursor(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& name)
|
||||
std::wstring JSI_GUIManager::SetCursor(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate), const std::wstring& name)
|
||||
{
|
||||
std::wstring old = g_CursorName;
|
||||
g_CursorName = name;
|
||||
return old;
|
||||
}
|
||||
|
||||
void JSI_GUIManager::ResetCursor(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
void JSI_GUIManager::ResetCursor(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate))
|
||||
{
|
||||
g_CursorName = g_DefaultCursor;
|
||||
}
|
||||
|
||||
bool JSI_GUIManager::TemplateExists(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& templateName)
|
||||
bool JSI_GUIManager::TemplateExists(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate), const std::string& templateName)
|
||||
{
|
||||
return g_GUI->TemplateExists(templateName);
|
||||
}
|
||||
|
||||
CParamNode JSI_GUIManager::GetTemplate(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& templateName)
|
||||
CParamNode JSI_GUIManager::GetTemplate(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate), const std::string& templateName)
|
||||
{
|
||||
return g_GUI->GetTemplate(templateName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user