From cee23154c8ffee24a2bdcd21eedb97d4e33c847b Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 14 May 2012 11:34:09 +0000 Subject: [PATCH] Adapted to changes in GDCore. git-svn-id: svn://localhost@710 8062f311-0dae-4547-b526-b8ab9ac864a5 --- IDE/ChoixAction.cpp | 132 ++++++++++++++++----------------- IDE/ChoixAction.h | 4 +- IDE/ChoixCondition.cpp | 126 +++++++++++++++---------------- IDE/ChoixCondition.h | 4 +- IDE/ChoixTemplateEvent.cpp | 6 +- IDE/Clipboard.cpp | 4 +- IDE/Clipboard.h | 8 +- IDE/Compilation.cpp | 6 +- IDE/CreateTemplate.cpp | 14 ++-- IDE/Demarrage.cpp | 2 +- IDE/EditOptionsPosition.cpp | 4 +- IDE/EditPropJeu.cpp | 2 +- IDE/EditPropScene.cpp | 2 +- IDE/EditorLayers.cpp | 2 +- IDE/EditorObjectList.cpp | 8 +- IDE/EditorObjetsGroups.cpp | 2 +- IDE/EventsEditor.cpp | 30 ++++---- IDE/EventsRefactorer.cpp | 92 +++++++++++------------ IDE/EventsRefactorer.h | 18 ++--- IDE/Game_Develop_EditorApp.cpp | 4 +- IDE/MainAide.cpp | 2 +- IDE/PlayerUnitTests.cpp | 2 +- IDE/Preferences.cpp | 2 +- IDE/ProjectManager.cpp | 4 +- IDE/SceneCanvas.cpp | 2 +- IDE/SearchEvents.cpp | 2 +- IDE/StartHerePage.cpp | 2 +- 27 files changed, 243 insertions(+), 243 deletions(-) diff --git a/IDE/ChoixAction.cpp b/IDE/ChoixAction.cpp index 5758dfba38..5aabccd9ae 100644 --- a/IDE/ChoixAction.cpp +++ b/IDE/ChoixAction.cpp @@ -322,8 +322,8 @@ void ChoixAction::RefreshList() 0) : extensionItem; //Add each object actions - std::map allObjActions = extensions[i]->GetAllActionsForObject(objectsTypes[j]); - for(std::map::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it) + std::map allObjActions = extensions[i]->GetAllActionsForObject(objectsTypes[j]); + for(std::map::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it) { //Verify if the action match the search if ( searching && @@ -361,8 +361,8 @@ void ChoixAction::RefreshList() 0) : extensionItem; //Add each automatism actions - std::map allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismsTypes[j]); - for(std::map::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it) + std::map allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismsTypes[j]); + for(std::map::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it) { //Verify if the action match the search if ( searching @@ -393,8 +393,8 @@ void ChoixAction::RefreshList() } //Add each (free) actions - std::map allActions = extensions[i]->GetAllActions(); - for(std::map::const_iterator it = allActions.begin(); it != allActions.end(); ++it) + std::map allActions = extensions[i]->GetAllActions(); + for(std::map::const_iterator it = allActions.begin(); it != allActions.end(); ++it) { //Verify if the action match the search if ( searching && @@ -473,8 +473,8 @@ void ChoixAction::RefreshObjectActionsList() extensionItem; //Add each object actions - std::map allObjActions = extensions[i]->GetAllActionsForObject(objectType); - for(std::map::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it) + std::map allObjActions = extensions[i]->GetAllActionsForObject(objectType); + for(std::map::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it) { //Verify if the action match the search if ( searching && @@ -519,8 +519,8 @@ void ChoixAction::RefreshObjectActionsList() 0) : extensionItem; //Add each automatism actions - std::map allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismType); - for(std::map::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it) + std::map allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismType); + for(std::map::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it) { //Verify if the action match the search if ( searching && @@ -596,18 +596,18 @@ void ChoixAction::RefreshFromAction() { if ( Type.empty() ) return; - const InstructionMetadata & InstructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(Type); + const gd::InstructionMetadata & instructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(Type); //Display action main properties - NomActionTxt->SetLabel( InstructionMetadata.fullname ); + NomActionTxt->SetLabel( instructionMetadata.fullname ); NomActionTxt->Wrap( 450 ); - ActionTextTxt->SetLabel( InstructionMetadata.description ); + ActionTextTxt->SetLabel( instructionMetadata.description ); ActionTextTxt->Wrap( 450 ); - if ( InstructionMetadata.icon.IsOk() ) ActionImg->SetBitmap( InstructionMetadata.icon ); + if ( instructionMetadata.icon.IsOk() ) ActionImg->SetBitmap( instructionMetadata.icon ); else ActionImg->SetBitmap(CommonBitmapManager::GetInstance()->unknown24); //Update controls count - while ( ParaEdit.size() < InstructionMetadata.parameters.size() ) + while ( ParaEdit.size() < instructionMetadata.parameters.size() ) { const string num =ToString( ParaEdit.size() ); long id = wxNewId(); //Bitmap buttons want an unique id so as to be displayed properly @@ -635,7 +635,7 @@ void ChoixAction::RefreshFromAction() ParaSpacer1.back()->Show(false); ParaSpacer2.back()->Show(false); } - while ( ParaEdit.size() > InstructionMetadata.parameters.size() ) + while ( ParaEdit.size() > instructionMetadata.parameters.size() ) { ParaFac.back()->Destroy(); ParaFac.erase(ParaFac.begin()+ParaFac.size()-1); @@ -652,9 +652,9 @@ void ChoixAction::RefreshFromAction() } //Update parameters - for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ ) + for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ ) { - if (InstructionMetadata.parameters[i].codeOnly) + if (instructionMetadata.parameters[i].codeOnly) { ParaFac.at(i)->Show(false); ParaText.at(i)->Show(false); @@ -663,21 +663,21 @@ void ChoixAction::RefreshFromAction() } else { - ParaFac.at(i)->Show(InstructionMetadata.parameters[i].optional); + ParaFac.at(i)->Show(instructionMetadata.parameters[i].optional); ParaFac.at(i)->SetValue(!ParaEdit.at( i )->GetValue().empty()); - ParaText.at(i)->SetLabel( InstructionMetadata.parameters[i].description + _(" :") ); + ParaText.at(i)->SetLabel( instructionMetadata.parameters[i].description + _(" :") ); ParaText.at(i)->Show(); if ( i < Param.size() ) ParaEdit.at( i )->SetValue(Param[i].GetPlainString()); ParaEdit.at(i)->Show(); - ParaBmpBt.at(i)->SetBitmapLabel( TranslateAction::GetInstance()->BitmapFromType(InstructionMetadata.parameters[i].type) ); - ParaBmpBt.at(i)->SetToolTip( TranslateAction::GetInstance()->LabelFromType(InstructionMetadata.parameters[i].type) ); - ParaBmpBt.at(i)->Show( !InstructionMetadata.parameters[i].type.empty() ); + ParaBmpBt.at(i)->SetBitmapLabel( TranslateAction::GetInstance()->BitmapFromType(instructionMetadata.parameters[i].type) ); + ParaBmpBt.at(i)->SetToolTip( TranslateAction::GetInstance()->LabelFromType(instructionMetadata.parameters[i].type) ); + ParaBmpBt.at(i)->Show( !instructionMetadata.parameters[i].type.empty() ); //De/activate widgets if parameter is optional - if ( InstructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() ) + if ( instructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() ) { ParaBmpBt.at(i)->Enable(false); ParaText.at(i)->Enable(false); @@ -693,11 +693,11 @@ void ChoixAction::RefreshFromAction() } //Add defaults - if ( !InstructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) ) + if ( !instructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) ) { - if ( InstructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0"); - else if ( InstructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\""); - else if ( InstructionMetadata.parameters[i].type == "operator" ) ParaEdit.at( i )->SetValue("="); + if ( instructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0"); + else if ( instructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\""); + else if ( instructionMetadata.parameters[i].type == "operator" ) ParaEdit.at( i )->SetValue("="); } } @@ -723,29 +723,29 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) unsigned int i = ToInt(num); GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance(); - const InstructionMetadata & InstructionMetadata = extensionManager->GetActionInfos(Type); + const gd::InstructionMetadata & instructionMetadata = extensionManager->GetActionInfos(Type); - if ( i < MaxPara && i < InstructionMetadata.parameters.size()) + if ( i < MaxPara && i < instructionMetadata.parameters.size()) { - if ( InstructionMetadata.parameters[i].type == "object" ) + if ( instructionMetadata.parameters[i].type == "object" ) { - ChooseObject Dialog(this, game, scene, true, InstructionMetadata.parameters[i].supplementaryInformation); + ChooseObject Dialog(this, game, scene, true, instructionMetadata.parameters[i].supplementaryInformation); if ( Dialog.ShowModal() == 1 ) { ParaEdit.at(i)->ChangeValue(Dialog.objectChosen); } return; } - else if ( InstructionMetadata.parameters[i].type == "automatism" ) + else if ( instructionMetadata.parameters[i].type == "automatism" ) { std::string object = ParaEdit.empty() ? "" : ParaEdit[0]->GetValue().mb_str(); - ChooseAutomatismDlg dialog(this, game, scene, object, InstructionMetadata.parameters[i].supplementaryInformation); + ChooseAutomatismDlg dialog(this, game, scene, object, instructionMetadata.parameters[i].supplementaryInformation); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.automatismChosen); return; } - else if ( InstructionMetadata.parameters[i].type == "expression" ) + else if ( instructionMetadata.parameters[i].type == "expression" ) { EditExpression Dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene); if ( Dialog.ShowModal() == 1 ) @@ -754,7 +754,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) } return; } - else if ( InstructionMetadata.parameters[i].type == "string" ) + else if ( instructionMetadata.parameters[i].type == "string" ) { EditTextDialog Dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene); if ( Dialog.ShowModal() == 1 ) @@ -763,7 +763,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) } return; } - else if ( InstructionMetadata.parameters[i].type == "color" ) + else if ( instructionMetadata.parameters[i].type == "color" ) { wxColour color = wxGetColourFromUser(this, wxColour(0,0,0)); if ( color.IsOk() ) @@ -776,7 +776,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) } return; } - else if ( InstructionMetadata.parameters[i].type == "police" ) + else if ( instructionMetadata.parameters[i].type == "police" ) { wxFileDialog dialog(this, _("Choisissez une police de caractère ( fichiers ttf, ttc )"), "", "", "Polices (*.ttf, *.ttc)|*.ttf;*.ttc"); dialog.ShowModal(); @@ -788,7 +788,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "musicfile" ) + else if ( instructionMetadata.parameters[i].type == "musicfile" ) { wxFileDialog dialog(this, _("Choisissez une musique ( fichiers ogg )"), "", "", "Fichiers audio (*.ogg)|*.ogg"); dialog.ShowModal(); @@ -800,7 +800,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "soundfile" ) + else if ( instructionMetadata.parameters[i].type == "soundfile" ) { wxFileDialog dialog(this, _("Choisissez un son ( fichiers wav )"), "", "", "Fichiers audio (*.wav)|*.wav"); dialog.ShowModal(); @@ -812,7 +812,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "operator" ) + else if ( instructionMetadata.parameters[i].type == "operator" ) { SigneModification dialog(this); int retour = dialog.ShowModal(); @@ -830,7 +830,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "password" ) + else if ( instructionMetadata.parameters[i].type == "password" ) { GeneratePassword dialog(this); @@ -839,7 +839,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "yesorno" ) + else if ( instructionMetadata.parameters[i].type == "yesorno" ) { if (wxMessageBox("Choisissez Oui ou Non pour compléter ce paramètre :", "Oui ou non",wxYES_NO ) == wxYES) { @@ -852,7 +852,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "layer" ) + else if ( instructionMetadata.parameters[i].type == "layer" ) { ChooseLayer dialog(this, scene.initialLayers); if( dialog.ShowModal() == 1 ) @@ -860,7 +860,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "joyaxis" ) + else if ( instructionMetadata.parameters[i].type == "joyaxis" ) { ChoiceJoyAxis dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene, true); if( dialog.ShowModal() == 1 ) @@ -868,7 +868,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "file" ) + else if ( instructionMetadata.parameters[i].type == "file" ) { ChoiceFile dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene, true); if ( dialog.ShowModal() == 1 ) @@ -876,7 +876,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) return; } - else if ( InstructionMetadata.parameters[i].type == "objectvar" ) + else if ( instructionMetadata.parameters[i].type == "objectvar" ) { if ( ParaEdit.empty() ) return; @@ -893,23 +893,23 @@ void ChoixAction::OnABtClick(wxCommandEvent& event) else return; - ChooseVariableDialog dialog(this, object->GetVariables()); + gd::ChooseVariableDialog dialog(this, object->GetVariables()); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.selectedVariable); return; } - else if ( InstructionMetadata.parameters[i].type == "scenevar" ) + else if ( instructionMetadata.parameters[i].type == "scenevar" ) { - ChooseVariableDialog dialog(this, scene.GetVariables()); + gd::ChooseVariableDialog dialog(this, scene.GetVariables()); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.selectedVariable); return; } - else if ( InstructionMetadata.parameters[i].type == "globalvar" ) + else if ( instructionMetadata.parameters[i].type == "globalvar" ) { - ChooseVariableDialog dialog(this, game.GetVariables()); + gd::ChooseVariableDialog dialog(this, game.GetVariables()); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.selectedVariable); @@ -945,12 +945,12 @@ void ChoixAction::OnFacClicked(wxCommandEvent& event) void ChoixAction::OnOkBtClick(wxCommandEvent& event) { GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance(); - const InstructionMetadata & InstructionMetadata = extensionManager->GetActionInfos(Type); + const gd::InstructionMetadata & instructionMetadata = extensionManager->GetActionInfos(Type); if ( Type == "" ) return; - if (ParaEdit.size() < InstructionMetadata.parameters.size()) + if (ParaEdit.size() < instructionMetadata.parameters.size()) { wxLogWarning(_("Trop peu de paramètres. Ceci peut être dû à un bug de Game Develop.")); return; @@ -960,9 +960,9 @@ void ChoixAction::OnOkBtClick(wxCommandEvent& event) bool parametersHaveErrors = false; string message; size_t parameterDisplayedNb = 0; - for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ ) + for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ ) { - if (!InstructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++; + if (!instructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++; //Do not check optional parameters which are desactivated if ( !ParaFac.at(i)->IsShown() || (ParaFac.at(i)->IsShown() && ParaFac.at(i)->GetValue())) @@ -970,12 +970,12 @@ void ChoixAction::OnOkBtClick(wxCommandEvent& event) CallbacksForExpressionCorrectnessTesting callbacks(game, scene); GDExpressionParser expressionParser(string(ParaEdit.at(i)->GetValue().mb_str())) ; - if ( (InstructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks))) + if ( (instructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks))) { message = expressionParser.firstErrorStr; @@ -998,15 +998,15 @@ void ChoixAction::OnOkBtClick(wxCommandEvent& event) //On ajoute les paramètres Param.clear(); - for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ ) + for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ ) { //Si un paramètre facultatif est desactivé if ( ParaFac.at(i)->IsShown() && !ParaFac.at(i)->GetValue()) { - Param.push_back(GDExpression("")); + Param.push_back(gd::Expression("")); } else - Param.push_back(GDExpression(string(ParaEdit.at(i)->GetValue().mb_str()))); + Param.push_back(gd::Expression(string(ParaEdit.at(i)->GetValue().mb_str()))); } if ( LocaliseCheck->GetValue() ) @@ -1024,7 +1024,7 @@ void ChoixAction::OnCancelBtClick(wxCommandEvent& event) void ChoixAction::OnAideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(29); } diff --git a/IDE/ChoixAction.h b/IDE/ChoixAction.h index 1b834c35aa..6ad5512d6a 100644 --- a/IDE/ChoixAction.h +++ b/IDE/ChoixAction.h @@ -24,7 +24,7 @@ #include #include #include -#include "GDCore/Events/GDExpression.h" +#include "GDCore/Events/Expression.h" class Scene; class Game; @@ -47,7 +47,7 @@ class ChoixAction: public wxDialog bool Loc; Game & game; Scene & scene; - vector < GDExpression > Param; + vector < gd::Expression > Param; unsigned static const int MaxPara = 8; diff --git a/IDE/ChoixCondition.cpp b/IDE/ChoixCondition.cpp index f48292edf1..6fe487b6c1 100644 --- a/IDE/ChoixCondition.cpp +++ b/IDE/ChoixCondition.cpp @@ -354,8 +354,8 @@ void ChoixCondition::RefreshList() 0) : extensionItem; //Add each object conditions - std::map allConditions = extensions[i]->GetAllConditionsForObject(objectsTypes[j]); - for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) + std::map allConditions = extensions[i]->GetAllConditionsForObject(objectsTypes[j]); + for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) { //Verify if the condition match the search if ( searching && @@ -393,8 +393,8 @@ void ChoixCondition::RefreshList() 0) : extensionItem; //Add each automatism conditions - std::map allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismsTypes[j]); - for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) + std::map allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismsTypes[j]); + for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) { //Verify if the condition match the search if ( searching && @@ -425,8 +425,8 @@ void ChoixCondition::RefreshList() } //Add each (free) conditions - std::map allConditions = extensions[i]->GetAllConditions(); - for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) + std::map allConditions = extensions[i]->GetAllConditions(); + for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) { //Verify if the condition match the search if ( searching && @@ -505,8 +505,8 @@ void ChoixCondition::RefreshObjectConditionsList() extensionItem; //Add each object conditions - std::map allConditions = extensions[i]->GetAllConditionsForObject(objectType); - for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) + std::map allConditions = extensions[i]->GetAllConditionsForObject(objectType); + for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) { //Verify if the condition match the search if ( searching && @@ -551,8 +551,8 @@ void ChoixCondition::RefreshObjectConditionsList() 0) : extensionItem; //Add each automatism conditions - std::map allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismType); - for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) + std::map allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismType); + for(std::map::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it) { //Verify if the condition match the search if ( searching && @@ -627,17 +627,17 @@ void ChoixCondition::RefreshFromCondition() if ( Type.empty() ) return; //Display action main properties - const InstructionMetadata & InstructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(Type); + const gd::InstructionMetadata & instructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(Type); - NomConditionTxt->SetLabel( InstructionMetadata.fullname ); + NomConditionTxt->SetLabel( instructionMetadata.fullname ); NomConditionTxt->Wrap( 450 ); - ConditionTextTxt->SetLabel( InstructionMetadata.description ); + ConditionTextTxt->SetLabel( instructionMetadata.description ); ConditionTextTxt->Wrap( 450 ); - if ( InstructionMetadata.icon.IsOk() ) ConditionImg->SetBitmap( InstructionMetadata.icon ); + if ( instructionMetadata.icon.IsOk() ) ConditionImg->SetBitmap( instructionMetadata.icon ); else ConditionImg->SetBitmap(CommonBitmapManager::GetInstance()->unknown24); //Update controls count - while ( ParaEdit.size() < InstructionMetadata.parameters.size() ) + while ( ParaEdit.size() < instructionMetadata.parameters.size() ) { const string num =ToString( ParaEdit.size() ); long id = wxNewId(); //Bitmap buttons want an unique id so as to be displayed properly @@ -665,7 +665,7 @@ void ChoixCondition::RefreshFromCondition() ParaSpacer1.back()->Show(false); ParaSpacer2.back()->Show(false); } - while ( ParaEdit.size() > InstructionMetadata.parameters.size() ) + while ( ParaEdit.size() > instructionMetadata.parameters.size() ) { ParaFac.back()->Destroy(); ParaFac.erase(ParaFac.begin()+ParaFac.size()-1); @@ -682,9 +682,9 @@ void ChoixCondition::RefreshFromCondition() } //Update parameters - for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ ) + for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ ) { - if (InstructionMetadata.parameters[i].codeOnly) + if (instructionMetadata.parameters[i].codeOnly) { ParaFac.at(i)->Show(false); ParaText.at(i)->Show(false); @@ -693,21 +693,21 @@ void ChoixCondition::RefreshFromCondition() } else { - ParaFac.at(i)->Show(InstructionMetadata.parameters[i].optional); + ParaFac.at(i)->Show(instructionMetadata.parameters[i].optional); ParaFac.at(i)->SetValue(!ParaEdit.at( i )->GetValue().empty()); - ParaText.at(i)->SetLabel( InstructionMetadata.parameters[i].description + _(" :") ); + ParaText.at(i)->SetLabel( instructionMetadata.parameters[i].description + _(" :") ); ParaText.at( i )->Show(); if ( i < Param.size() ) ParaEdit.at( i )->SetValue(Param[i].GetPlainString()); ParaEdit.at( i )->Show(); - ParaBmpBt.at(i)->SetBitmapLabel( TranslateCondition::BitmapFromType(InstructionMetadata.parameters[i].type) ); - ParaBmpBt.at(i)->SetToolTip( TranslateCondition::LabelFromType(InstructionMetadata.parameters[i].type) ); - ParaBmpBt.at(i)->Show( !InstructionMetadata.parameters[i].type.empty() ); + ParaBmpBt.at(i)->SetBitmapLabel( TranslateCondition::BitmapFromType(instructionMetadata.parameters[i].type) ); + ParaBmpBt.at(i)->SetToolTip( TranslateCondition::LabelFromType(instructionMetadata.parameters[i].type) ); + ParaBmpBt.at(i)->Show( !instructionMetadata.parameters[i].type.empty() ); //De/activate widgets if parameter is optional - if ( InstructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() ) + if ( instructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() ) { ParaBmpBt.at(i)->Enable(false); ParaText.at(i)->Enable(false); @@ -723,11 +723,11 @@ void ChoixCondition::RefreshFromCondition() } //Add defaults - if ( !InstructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) ) + if ( !instructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) ) { - if ( InstructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0"); - else if ( InstructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\""); - else if ( InstructionMetadata.parameters[i].type == "file" ) ParaEdit.at( i )->SetValue("\"\""); + if ( instructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0"); + else if ( instructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\""); + else if ( instructionMetadata.parameters[i].type == "file" ) ParaEdit.at( i )->SetValue("\"\""); } } } @@ -779,29 +779,29 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) unsigned int i = atoi( num.c_str() ); GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance(); - const InstructionMetadata & InstructionMetadata = extensionManager->GetConditionInfos(Type); + const gd::InstructionMetadata & instructionMetadata = extensionManager->GetConditionInfos(Type); - if ( i < MaxPara && i < InstructionMetadata.parameters.size()) + if ( i < MaxPara && i < instructionMetadata.parameters.size()) { - if ( InstructionMetadata.parameters[i].type == "object" ) + if ( instructionMetadata.parameters[i].type == "object" ) { - ChooseObject dialog(this, game, scene, true, InstructionMetadata.parameters[i].supplementaryInformation); + ChooseObject dialog(this, game, scene, true, instructionMetadata.parameters[i].supplementaryInformation); if ( dialog.ShowModal() == 1 ) { ParaEdit.at(i)->ChangeValue(dialog.objectChosen); } return; } - else if ( InstructionMetadata.parameters[i].type == "automatism" ) + else if ( instructionMetadata.parameters[i].type == "automatism" ) { std::string object = ParaEdit.empty() ? "" : ParaEdit[0]->GetValue().mb_str(); - ChooseAutomatismDlg dialog(this, game, scene, object, InstructionMetadata.parameters[i].supplementaryInformation); + ChooseAutomatismDlg dialog(this, game, scene, object, instructionMetadata.parameters[i].supplementaryInformation); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.automatismChosen); return; } - else if ( InstructionMetadata.parameters[i].type == "expression" ) + else if ( instructionMetadata.parameters[i].type == "expression" ) { EditExpression dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene); if ( dialog.ShowModal() == 1 ) @@ -810,7 +810,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) } return; } - else if ( InstructionMetadata.parameters[i].type == "mouse" ) + else if ( instructionMetadata.parameters[i].type == "mouse" ) { ChoixBouton dialog(this, static_cast( ParaEdit.at(i)->GetValue() )); if ( dialog.ShowModal() == 1 ) @@ -819,7 +819,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) } return; } - else if ( InstructionMetadata.parameters[i].type == "key" ) + else if ( instructionMetadata.parameters[i].type == "key" ) { ChoixClavier dialog(this, static_cast( ParaEdit.at(i)->GetValue() )); if ( dialog.ShowModal() == 1 ) @@ -828,7 +828,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) } return; } - else if ( InstructionMetadata.parameters[i].type == "file" ) + else if ( instructionMetadata.parameters[i].type == "file" ) { ChoiceFile dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene, true); if ( dialog.ShowModal() == 1 ) @@ -836,7 +836,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) return; } - else if ( InstructionMetadata.parameters[i].type == "string" ) + else if ( instructionMetadata.parameters[i].type == "string" ) { EditTextDialog dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene); if ( dialog.ShowModal() == 1 ) @@ -845,7 +845,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) } return; } - else if ( InstructionMetadata.parameters[i].type == "relationalOperator" ) + else if ( instructionMetadata.parameters[i].type == "relationalOperator" ) { SigneTest dialog(this); int retour = dialog.ShowModal(); @@ -865,7 +865,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) return; } - else if ( InstructionMetadata.parameters[i].type == "trueorfalse" ) + else if ( instructionMetadata.parameters[i].type == "trueorfalse" ) { TrueOrFalse dialog(this, _("Choisissez Vrai ou Faux pour remplir le paramètre"), _("Vrai ou Faux")); if ( dialog.ShowModal() == 1 ) @@ -873,7 +873,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) else ParaEdit.at(i)->ChangeValue(_("Faux")); } - else if ( InstructionMetadata.parameters[i].type == "yesorno" ) + else if ( instructionMetadata.parameters[i].type == "yesorno" ) { if (wxMessageBox("Choisissez Oui ou Non pour compléter ce paramètre :", "Oui ou non",wxYES_NO ) == wxYES) ParaEdit.at(i)->ChangeValue(_("oui")); @@ -882,7 +882,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) return; } - else if ( InstructionMetadata.parameters[i].type == "layer" ) + else if ( instructionMetadata.parameters[i].type == "layer" ) { ChooseLayer dialog(this, scene.initialLayers); if( dialog.ShowModal() == 1 ) @@ -890,7 +890,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) return; } - else if ( InstructionMetadata.parameters[i].type == "joyaxis" ) + else if ( instructionMetadata.parameters[i].type == "joyaxis" ) { ChoiceJoyAxis dialog(this, static_cast( ParaEdit.at(i)->GetValue() ), game, scene, true); if( dialog.ShowModal() == 1 ) @@ -898,7 +898,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) return; } - else if ( InstructionMetadata.parameters[i].type == "objectvar" ) + else if ( instructionMetadata.parameters[i].type == "objectvar" ) { if ( ParaEdit.empty() ) return; @@ -915,23 +915,23 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) else return; - ChooseVariableDialog dialog(this, object->GetVariables()); + gd::ChooseVariableDialog dialog(this, object->GetVariables()); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.selectedVariable); return; } - else if ( InstructionMetadata.parameters[i].type == "scenevar" ) + else if ( instructionMetadata.parameters[i].type == "scenevar" ) { - ChooseVariableDialog dialog(this, scene.GetVariables()); + gd::ChooseVariableDialog dialog(this, scene.GetVariables()); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.selectedVariable); return; } - else if ( InstructionMetadata.parameters[i].type == "globalvar" ) + else if ( instructionMetadata.parameters[i].type == "globalvar" ) { - ChooseVariableDialog dialog(this, game.GetVariables()); + gd::ChooseVariableDialog dialog(this, game.GetVariables()); if ( dialog.ShowModal() == 1 ) ParaEdit.at(i)->ChangeValue(dialog.selectedVariable); @@ -943,12 +943,12 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event ) void ChoixCondition::OnOkBtClick( wxCommandEvent& event ) { GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance(); - const InstructionMetadata & InstructionMetadata = extensionManager->GetConditionInfos(Type); + const gd::InstructionMetadata & instructionMetadata = extensionManager->GetConditionInfos(Type); if ( Type == "" ) return; - if (ParaEdit.size() < InstructionMetadata.parameters.size()) + if (ParaEdit.size() < instructionMetadata.parameters.size()) { wxLogWarning(_("Trop peu de paramètres. Ceci peut être dû à un bug de Game Develop.")); return; @@ -958,9 +958,9 @@ void ChoixCondition::OnOkBtClick( wxCommandEvent& event ) bool parametersHaveErrors = false; string message; size_t parameterDisplayedNb = 0; - for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ ) + for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ ) { - if ( !InstructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++; + if ( !instructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++; //Do not check optional parameters which are desactivated if ( !ParaFac.at(i)->IsShown() || (ParaFac.at(i)->IsShown() && ParaFac.at(i)->GetValue())) @@ -968,12 +968,12 @@ void ChoixCondition::OnOkBtClick( wxCommandEvent& event ) CallbacksForExpressionCorrectnessTesting callbacks(game, scene); GDExpressionParser expressionParser(string(ParaEdit.at(i)->GetValue().mb_str())) ; - if ( (InstructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks)) - ||(InstructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks))) + if ( (instructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks)) + ||(instructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks))) { message = expressionParser.firstErrorStr; @@ -997,9 +997,9 @@ void ChoixCondition::OnOkBtClick( wxCommandEvent& event ) //On ajoute les paramètres Param.clear(); - for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ ) + for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ ) { - Param.push_back( GDExpression(string(ParaEdit.at(i)->GetValue().mb_str())) ); + Param.push_back( gd::Expression(string(ParaEdit.at(i)->GetValue().mb_str())) ); } if ( ContraireCheck->GetValue() ) @@ -1025,7 +1025,7 @@ void ChoixCondition::OnCancelBtClick( wxCommandEvent& event ) void ChoixCondition::OnAideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(23); } diff --git a/IDE/ChoixCondition.h b/IDE/ChoixCondition.h index ec8900c7cc..9d77588359 100644 --- a/IDE/ChoixCondition.h +++ b/IDE/ChoixCondition.h @@ -22,7 +22,7 @@ //*) #include #include -#include "GDCore/Events/GDExpression.h" +#include "GDCore/Events/Expression.h" class Scene; class Game; @@ -46,7 +46,7 @@ class ChoixCondition: public wxDialog bool Contraire; Game & game; Scene & scene; - vector < GDExpression > Param; + vector < gd::Expression > Param; unsigned static const int MaxPara = 8; diff --git a/IDE/ChoixTemplateEvent.cpp b/IDE/ChoixTemplateEvent.cpp index 32f2d3a3e3..1a4b5588c0 100644 --- a/IDE/ChoixTemplateEvent.cpp +++ b/IDE/ChoixTemplateEvent.cpp @@ -202,7 +202,7 @@ void ChoixTemplateEvent::ProcessEvents(vector < gd::BaseEventSPtr > & events ) //Pour chaque évènement for ( unsigned int j = 0;j < events.size() ; j++ ) { - vector < vector* > allConditionsVectors = events[j]->GetAllConditionsVectors(); + vector < vector* > allConditionsVectors = events[j]->GetAllConditionsVectors(); for ( unsigned int k = 0;k < allConditionsVectors.size() ;k++ ) { for (unsigned int l = 0;lsize();++l) @@ -220,7 +220,7 @@ void ChoixTemplateEvent::ProcessEvents(vector < gd::BaseEventSPtr > & events ) } } - vector < vector* > allActionsVectors = events[j]->GetAllActionsVectors(); + vector < vector* > allActionsVectors = events[j]->GetAllActionsVectors(); for ( unsigned int k = 0;k < allActionsVectors.size() ;k++ ) { for (unsigned int l = 0;lsize();++l) @@ -384,6 +384,6 @@ string ChoixTemplateEvent::ConvertParam( string parameter, const string & toRepl void ChoixTemplateEvent::OnAideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(151); } diff --git a/IDE/Clipboard.cpp b/IDE/Clipboard.cpp index 952c3be647..8e43a98152 100644 --- a/IDE/Clipboard.cpp +++ b/IDE/Clipboard.cpp @@ -104,14 +104,14 @@ gd::ExternalEvents * Clipboard::GetExternalEvents() return externalEventsCopied->Clone(); } -void Clipboard::SetConditions( const std::vector & conditions ) +void Clipboard::SetConditions( const std::vector & conditions ) { hasInstructions = true; instructionsAreConditions = true; instructionsCopied = conditions; } -void Clipboard::SetActions( const std::vector & actions ) +void Clipboard::SetActions( const std::vector & actions ) { hasInstructions = true; instructionsAreConditions = false; diff --git a/IDE/Clipboard.h b/IDE/Clipboard.h index 0ac9b038e4..2098fff2d2 100644 --- a/IDE/Clipboard.h +++ b/IDE/Clipboard.h @@ -39,12 +39,12 @@ public: gd::ExternalEvents * GetExternalEvents(); bool HasExternalEvents() { return hasExternalEvents; }; - void SetConditions( const std::vector & conditions ); - void SetActions( const std::vector & actions ); + void SetConditions( const std::vector & conditions ); + void SetActions( const std::vector & actions ); bool HasCondition() { return hasInstructions && instructionsAreConditions; }; bool HasAction() { return hasInstructions && !instructionsAreConditions; }; - std::vector GetInstructions() const { return instructionsCopied; }; + std::vector GetInstructions() const { return instructionsCopied; }; void SetObjectGroup( const gd::ObjectGroup & group ); gd::ObjectGroup GetObjectGroup(); @@ -64,7 +64,7 @@ private: std::vector eventsCopied; bool hasEvents; - std::vector instructionsCopied; + std::vector instructionsCopied; bool hasInstructions; bool instructionsAreConditions; diff --git a/IDE/Compilation.cpp b/IDE/Compilation.cpp index 2ce84ed575..5cd841815c 100644 --- a/IDE/Compilation.cpp +++ b/IDE/Compilation.cpp @@ -342,19 +342,19 @@ void Compilation::OnOuvrirBtClick( wxCommandEvent& event ) void Compilation::OnAideBtClick( wxCommandEvent& event ) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(125); } void Compilation::OnCGShareBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(192); } void Compilation::OnDistribuerBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(158); } diff --git a/IDE/CreateTemplate.cpp b/IDE/CreateTemplate.cpp index 3fbd89c69b..a63be2f8d2 100644 --- a/IDE/CreateTemplate.cpp +++ b/IDE/CreateTemplate.cpp @@ -287,38 +287,38 @@ void CreateTemplate::ProcessEvents(vector < gd::BaseEventSPtr > & eventsToProces //On remplace dans chaque paramètre des actions et des conditions for ( unsigned int i = 0;i < eventsToProcess.size() ;i++ ) { - vector < vector* > allConditionsVectors = eventsToProcess[i]->GetAllConditionsVectors(); + vector < vector* > allConditionsVectors = eventsToProcess[i]->GetAllConditionsVectors(); for (unsigned int c = 0;csize() ;nb++ ) { - vector < GDExpression > parametres = allConditionsVectors[c]->at( nb ).GetParameters(); + vector < gd::Expression > parametres = allConditionsVectors[c]->at( nb ).GetParameters(); for ( unsigned int j = 0;j < parametres.size() ;j++ ) { //On respecte bien l'ordre, du plus grand au plus petit for ( unsigned int k = 0; k < parameters.size() ;k++ ) { string ReplaceBy = "_PARAM" +ToString( parameters.at( k ).second ) + "_"; - parametres.at( j ) = GDExpression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) ); + parametres.at( j ) = gd::Expression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) ); } } allConditionsVectors[c]->at( nb ).SetParameters(parametres); } } - vector < vector* > allActionsVectors = eventsToProcess[i]->GetAllActionsVectors(); + vector < vector* > allActionsVectors = eventsToProcess[i]->GetAllActionsVectors(); for (unsigned int a = 0;asize() ;nb++ ) { - vector < GDExpression > parametres = allActionsVectors[a]->at( nb ).GetParameters(); + vector < gd::Expression > parametres = allActionsVectors[a]->at( nb ).GetParameters(); for ( unsigned int j = 0;j < parametres.size() ;j++ ) { //On respecte bien l'ordre, du plus grand au plus petit for ( unsigned int k = 0; k < parameters.size() ;k++ ) { string ReplaceBy = "_PARAM" +ToString( parameters.at( k ).second ) + "_"; - parametres.at( j ) = GDExpression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) ); + parametres.at( j ) = gd::Expression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) ); } } allActionsVectors[a]->at( nb ).SetParameters(parametres); @@ -349,7 +349,7 @@ string CreateTemplate::ConvertParam( string Parametre, string ToReplace, string void CreateTemplate::OnAideBtClick( wxCommandEvent& event ) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(151); } diff --git a/IDE/Demarrage.cpp b/IDE/Demarrage.cpp index 907bf23109..4e7de0cff7 100644 --- a/IDE/Demarrage.cpp +++ b/IDE/Demarrage.cpp @@ -227,7 +227,7 @@ Demarrage::~Demarrage() void Demarrage::OnGuideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(16); } diff --git a/IDE/EditOptionsPosition.cpp b/IDE/EditOptionsPosition.cpp index af250b6187..e0cbc558eb 100644 --- a/IDE/EditOptionsPosition.cpp +++ b/IDE/EditOptionsPosition.cpp @@ -361,7 +361,7 @@ void EditOptionsPosition::OnAnnulerBtClick(wxCommandEvent& event) void EditOptionsPosition::OnAideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(25); } @@ -381,7 +381,7 @@ void EditOptionsPosition::OnsizeCheckClick(wxCommandEvent& event) void EditOptionsPosition::OneditInitialVariablesClick(wxCommandEvent& event) { - ChooseVariableDialog dialog(this, initialVariables, /*editingOnly=*/true); + gd::ChooseVariableDialog dialog(this, initialVariables, /*editingOnly=*/true); if ( dialog.ShowModal() == 1 ) UpdateInitialVariablesStatus(); } diff --git a/IDE/EditPropJeu.cpp b/IDE/EditPropJeu.cpp index 319db164a4..0773ec1a04 100644 --- a/IDE/EditPropJeu.cpp +++ b/IDE/EditPropJeu.cpp @@ -504,7 +504,7 @@ void EditPropJeu::OnOkBtClick( wxCommandEvent& event ) void EditPropJeu::OnAideBtClick( wxCommandEvent& event ) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(8); } diff --git a/IDE/EditPropScene.cpp b/IDE/EditPropScene.cpp index f2ea739f92..2dbb3ad50e 100644 --- a/IDE/EditPropScene.cpp +++ b/IDE/EditPropScene.cpp @@ -249,6 +249,6 @@ void EditPropScene::OnColorBtClick(wxCommandEvent& event) void EditPropScene::OnAideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(8); } diff --git a/IDE/EditorLayers.cpp b/IDE/EditorLayers.cpp index 6b06a2c700..6153c00252 100644 --- a/IDE/EditorLayers.cpp +++ b/IDE/EditorLayers.cpp @@ -161,7 +161,7 @@ void EditorLayers::OnMoreOptions(wxCommandEvent& event) void EditorLayers::OnHelp(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(226); } diff --git a/IDE/EditorObjectList.cpp b/IDE/EditorObjectList.cpp index 34b34dd155..b339598094 100644 --- a/IDE/EditorObjectList.cpp +++ b/IDE/EditorObjectList.cpp @@ -781,8 +781,8 @@ bool EditorObjectList::CheckObjectName(std::string name) for(unsigned int j = 0;j allObjExpr = extensions[i]->GetAllExpressionsForObject(objectsTypes[j]); - for(std::map::const_iterator it = allObjExpr.begin(); it != allObjExpr.end(); ++it) + std::map allObjExpr = extensions[i]->GetAllExpressionsForObject(objectsTypes[j]); + for(std::map::const_iterator it = allObjExpr.begin(); it != allObjExpr.end(); ++it) { if ( name == it->first ) nameUsedByExpression = true; @@ -824,7 +824,7 @@ void EditorObjectList::OnChercherBtClick( wxCommandEvent& event ) //////////////////////////////////////////////////////////// void EditorObjectList::OnAideBtClick( wxCommandEvent& event ) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(10); } @@ -1062,7 +1062,7 @@ void EditorObjectList::OneditVarMenuISelected(wxCommandEvent& event) return; } - ChooseVariableDialog dialog(this, (*object)->GetVariables(), /*editingOnly=*/true); + gd::ChooseVariableDialog dialog(this, (*object)->GetVariables(), /*editingOnly=*/true); if ( dialog.ShowModal() == 1 ) if ( scene ) scene->wasModified = true; } diff --git a/IDE/EditorObjetsGroups.cpp b/IDE/EditorObjetsGroups.cpp index 535f3c0191..b88aa1b5a9 100644 --- a/IDE/EditorObjetsGroups.cpp +++ b/IDE/EditorObjetsGroups.cpp @@ -323,7 +323,7 @@ void EditorObjetsGroups::DisableAll() //////////////////////////////////////////////////////////// void EditorObjetsGroups::OnHelp(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(180); } diff --git a/IDE/EventsEditor.cpp b/IDE/EventsEditor.cpp index bf632a9d32..8205f2f14d 100644 --- a/IDE/EventsEditor.cpp +++ b/IDE/EventsEditor.cpp @@ -726,7 +726,7 @@ void EventsEditor::HandleSelectionAfterClick(int x, int y, bool allowLiveEditing liveEdit->SetFocus(); liveEditingChangesMade = false; } - //Instruction selection? + //gd::Instruction selection? else if ( itemsAreas.IsOnInstruction(x, y) ) { InstructionItem item = itemsAreas.GetInstructionAt(x, y); @@ -773,7 +773,7 @@ void EventsEditor::HandleSelectionAfterClick(int x, int y, bool allowLiveEditing void EventsEditor::OneventsPanelLeftDClick(wxMouseEvent& event) { - //Instruction selection? + //gd::Instruction selection? if ( itemsAreas.IsOnInstruction(event.GetX(), event.GetY()) ) { InstructionItem item = itemsAreas.GetInstructionAt(event.GetX(), event.GetY()); @@ -830,7 +830,7 @@ void EventsEditor::OneventsPanelLeftDClick(wxMouseEvent& event) ChoixCondition dialog(this, game, scene); if ( dialog.ShowModal() == 0) { - Instruction instruction; + gd::Instruction instruction; instruction.SetType( dialog.Type ); instruction.SetParameters( dialog.Param ); instruction.SetInverted( dialog.Contraire ); @@ -846,7 +846,7 @@ void EventsEditor::OneventsPanelLeftDClick(wxMouseEvent& event) ChoixAction dialog(this, game, scene); if ( dialog.ShowModal() == 0) { - Instruction instruction; + gd::Instruction instruction; instruction.SetType( dialog.Type ); instruction.SetParameters( dialog.Param ); @@ -933,7 +933,7 @@ void EventsEditor::OneventsPanelMouseMove(wxMouseEvent& event) selection.SetHighlighted(itemsAreas.GetParameterAt(event.GetX(), event.GetY())); } } - else if ( itemsAreas.IsOnParameter(event.GetX(), event.GetY()) ) //Parameter without list ( a simple GDExpression ) + else if ( itemsAreas.IsOnParameter(event.GetX(), event.GetY()) ) //Parameter without list ( a simple gd::Expression ) selection.SetHighlighted(itemsAreas.GetParameterAt(event.GetX(), event.GetY())); } @@ -1104,7 +1104,7 @@ void EventsEditor::EndLiveEditing() } eventsPanel->SetFocusIgnoringChildren(); - *liveEditedParameter.parameter = GDExpression(ToString(liveEdit->GetValue())); + *liveEditedParameter.parameter = gd::Expression(ToString(liveEdit->GetValue())); liveEditedParameter.event->eventHeightNeedUpdate = true; liveEditingPanel->Show(false); @@ -1151,7 +1151,7 @@ void EventsEditor::OnaddInstrBtClick(wxCommandEvent& event) ChoixCondition dialog(this, game, scene); if ( dialog.ShowModal() == 0) { - Instruction instruction; + gd::Instruction instruction; instruction.SetType(dialog.Type); instruction.SetParameters(dialog.Param); instruction.SetInverted(dialog.Contraire); @@ -1167,7 +1167,7 @@ void EventsEditor::OnaddInstrBtClick(wxCommandEvent& event) ChoixAction dialog(this, game, scene); if ( dialog.ShowModal() == 0) { - Instruction instruction; + gd::Instruction instruction; instruction.SetType(dialog.Type); instruction.SetParameters(dialog.Param); @@ -1392,7 +1392,7 @@ void EventsEditor::OneventCopyMenuSelected(wxCommandEvent& event) if ( selection.HasSelectedConditions()) { std::vector < InstructionItem > itemsSelected = selection.GetAllSelectedInstructions(); - std::vector < Instruction > instructionsToCopy; + std::vector < gd::Instruction > instructionsToCopy; for (unsigned int i = 0;i itemsSelected = selection.GetAllSelectedInstructions(); - std::vector < Instruction > instructionsToCopy; + std::vector < gd::Instruction > instructionsToCopy; for (unsigned int i = 0;iHasCondition() ) return; //Get information about list where conditions must be pasted - std::vector * instructionList = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList; + std::vector * instructionList = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList; size_t positionInThisList = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().positionInList : std::string::npos; gd::BaseEvent * event = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().event : selection.GetHighlightedInstructionList().event; if (instructionList == NULL) return; //Paste all conditions - const vector < Instruction > & instructions = Clipboard::GetInstance()->GetInstructions(); + const vector < gd::Instruction > & instructions = Clipboard::GetInstance()->GetInstructions(); for (unsigned int i = 0;isize() ) @@ -1471,13 +1471,13 @@ void EventsEditor::OneventPasteMenuSelected(wxCommandEvent& event) if ( !Clipboard::GetInstance()->HasAction() ) return; //Get information about list where actions must be pasted - std::vector * instructionList = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList; + std::vector * instructionList = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList; size_t positionInThisList = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().positionInList : std::string::npos; gd::BaseEvent * event = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().event : selection.GetHighlightedInstructionList().event; if (instructionList == NULL) return; //Paste all actions - const vector < Instruction > & instructions = Clipboard::GetInstance()->GetInstructions(); + const vector < gd::Instruction > & instructions = Clipboard::GetInstance()->GetInstructions(); for (unsigned int i = 0;isize() ) @@ -1541,7 +1541,7 @@ void EventsEditor::OnredoMenuSelected(wxCommandEvent& event) void EventsEditor::OnHelpBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(11); } diff --git a/IDE/EventsRefactorer.cpp b/IDE/EventsRefactorer.cpp index e7635aeb17..799bb0df89 100644 --- a/IDE/EventsRefactorer.cpp +++ b/IDE/EventsRefactorer.cpp @@ -34,7 +34,7 @@ class CallbacksForRenamingObject : public ParserCallbacks plainExpression += text; }; - virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const ExpressionMetadata & expressionInfo) + virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const gd::ExpressionMetadata & expressionInfo) { std::string parametersStr; for (unsigned int i = 0;i & parameters, const StrExpressionMetadata & expressionInfo) + virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const gd::StrExpressionMetadata & expressionInfo) { //Special case : Function without name is a litteral string. if ( functionName.empty() ) @@ -71,7 +71,7 @@ class CallbacksForRenamingObject : public ParserCallbacks plainExpression += functionName+"("+parametersStr+")"; }; - virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const ExpressionMetadata & expressionInfo) + virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const gd::ExpressionMetadata & expressionInfo) { if ( parameters.empty() ) return; @@ -88,7 +88,7 @@ class CallbacksForRenamingObject : public ParserCallbacks +"."+functionName+"("+parametersStr+")"; }; - virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const StrExpressionMetadata & expressionInfo) + virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const gd::StrExpressionMetadata & expressionInfo) { if ( parameters.empty() ) return; @@ -105,7 +105,7 @@ class CallbacksForRenamingObject : public ParserCallbacks +"."+functionName+"("+parametersStr+")"; }; - virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const ExpressionMetadata & expressionInfo) + virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const gd::ExpressionMetadata & expressionInfo) { if ( parameters.size() < 2 ) return; @@ -122,7 +122,7 @@ class CallbacksForRenamingObject : public ParserCallbacks +"."+parameters[1].GetPlainString()+"::"+functionName+"("+parametersStr+")"; }; - virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const StrExpressionMetadata & expressionInfo) + virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const gd::StrExpressionMetadata & expressionInfo) { if ( parameters.size() < 2 ) return; @@ -139,7 +139,7 @@ class CallbacksForRenamingObject : public ParserCallbacks +"."+parameters[1].GetPlainString()+"::"+functionName+"("+parametersStr+")"; }; - virtual bool OnSubMathExpression(const Game & game, const Scene & scene, GDExpression & expression) + virtual bool OnSubMathExpression(const Game & game, const Scene & scene, gd::Expression & expression) { std::string newExpression; @@ -149,11 +149,11 @@ class CallbacksForRenamingObject : public ParserCallbacks if ( !parser.ParseMathExpression(game, scene, callbacks) ) return false; - expression = GDExpression(newExpression); + expression = gd::Expression(newExpression); return true; } - virtual bool OnSubTextExpression(const Game & game, const Scene & scene, GDExpression & expression) + virtual bool OnSubTextExpression(const Game & game, const Scene & scene, gd::Expression & expression) { std::string newExpression; @@ -163,7 +163,7 @@ class CallbacksForRenamingObject : public ParserCallbacks if ( !parser.ParseTextExpression(game, scene, callbacks) ) return false; - expression = GDExpression(newExpression); + expression = gd::Expression(newExpression); return true; } @@ -190,43 +190,43 @@ class CallbacksForRemovingObject : public ParserCallbacks virtual void OnOperator(std::string text){}; virtual void OnNumber(std::string text){}; - virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const ExpressionMetadata & expressionInfo) + virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const gd::ExpressionMetadata & expressionInfo) { }; - virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const StrExpressionMetadata & expressionInfo) + virtual void OnStaticFunction(std::string functionName, const std::vector & parameters, const gd::StrExpressionMetadata & expressionInfo) { }; - virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const ExpressionMetadata & expressionInfo) + virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const gd::ExpressionMetadata & expressionInfo) { if ( parameters.empty() ) return; if ( parameters[0].GetPlainString() == name ) objectPresent = true; }; - virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const StrExpressionMetadata & expressionInfo) + virtual void OnObjectFunction(std::string functionName, const std::vector & parameters, const gd::StrExpressionMetadata & expressionInfo) { if ( parameters.empty() ) return; if ( parameters[0].GetPlainString() == name ) objectPresent = true; }; - virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const ExpressionMetadata & expressionInfo) + virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const gd::ExpressionMetadata & expressionInfo) { if ( parameters.empty() ) return; if ( parameters[0].GetPlainString() == name ) objectPresent = true; }; - virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const StrExpressionMetadata & expressionInfo) + virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector & parameters, const gd::StrExpressionMetadata & expressionInfo) { if ( parameters.empty() ) return; if ( parameters[0].GetPlainString() == name ) objectPresent = true; }; - virtual bool OnSubMathExpression(const Game & game, const Scene & scene, GDExpression & expression) + virtual bool OnSubMathExpression(const Game & game, const Scene & scene, gd::Expression & expression) { CallbacksForRemovingObject callbacks(name); @@ -238,7 +238,7 @@ class CallbacksForRemovingObject : public ParserCallbacks return true; } - virtual bool OnSubTextExpression(const Game & game, const Scene & scene, GDExpression & expression) + virtual bool OnSubTextExpression(const Game & game, const Scene & scene, gd::Expression & expression) { CallbacksForRemovingObject callbacks(name); @@ -255,18 +255,18 @@ class CallbacksForRemovingObject : public ParserCallbacks std::string name; }; -bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string oldName, std::string newName) +bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string oldName, std::string newName) { bool somethingModified = false; for (unsigned int aId = 0;aId < actions.size();++aId) { - InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType()); + gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType()); for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb) { //Replace object's name in parameters if ( instrInfos.parameters[pNb].type == "object" && actions[aId].GetParameter(pNb).GetPlainString() == oldName ) - actions[aId].SetParameter(pNb, GDExpression(newName)); + actions[aId].SetParameter(pNb, gd::Expression(newName)); //Replace object's name in expressions else if (instrInfos.parameters[pNb].type == "expression") { @@ -279,7 +279,7 @@ bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector if ( parser.ParseMathExpression(game, scene, callbacks) && newExpression != oldExpression ) { somethingModified = true; - actions[aId].SetParameter(pNb, GDExpression(newExpression)); + actions[aId].SetParameter(pNb, gd::Expression(newExpression)); } } //Replace object's name in text expressions @@ -294,7 +294,7 @@ bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector if ( parser.ParseTextExpression(game, scene, callbacks) && newExpression != oldExpression ) { somethingModified = true; - actions[aId].SetParameter(pNb, GDExpression(newExpression)); + actions[aId].SetParameter(pNb, gd::Expression(newExpression)); } } } @@ -306,18 +306,18 @@ bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector return somethingModified; } -bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string oldName, std::string newName) +bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string oldName, std::string newName) { bool somethingModified = false; for (unsigned int cId = 0;cId < conditions.size();++cId) { - InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType()); + gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType()); for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb) { //Replace object's name in parameters if ( instrInfos.parameters[pNb].type == "object" && conditions[cId].GetParameter(pNb).GetPlainString() == oldName ) - conditions[cId].SetParameter(pNb, GDExpression(newName)); + conditions[cId].SetParameter(pNb, gd::Expression(newName)); //Replace object's name in expressions else if (instrInfos.parameters[pNb].type == "expression") { @@ -330,7 +330,7 @@ bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vect if ( parser.ParseMathExpression(game, scene, callbacks) ) { somethingModified = true; - conditions[cId].SetParameter(pNb, GDExpression(newExpression)); + conditions[cId].SetParameter(pNb, gd::Expression(newExpression)); } } //Replace object's name in text expressions @@ -345,7 +345,7 @@ bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vect if ( parser.ParseMathExpression(game, scene, callbacks) ) { somethingModified = true; - conditions[cId].SetParameter(pNb, GDExpression(newExpression)); + conditions[cId].SetParameter(pNb, gd::Expression(newExpression)); } } } @@ -361,7 +361,7 @@ void EventsRefactorer::RenameObjectInEvents(Game & game, Scene & scene, vector < { for (unsigned int i = 0;i* > conditionsVectors = events[i]->GetAllConditionsVectors(); + vector < vector* > conditionsVectors = events[i]->GetAllConditionsVectors(); for (unsigned int j = 0;j < conditionsVectors.size();++j) { bool somethingModified = RenameObjectInConditions(game, scene, *conditionsVectors[j], oldName, newName); @@ -370,7 +370,7 @@ void EventsRefactorer::RenameObjectInEvents(Game & game, Scene & scene, vector < #endif } - vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); + vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); for (unsigned int j = 0;j < actionsVectors.size();++j) { bool somethingModified = RenameObjectInActions(game, scene, *actionsVectors[j], oldName, newName); @@ -383,7 +383,7 @@ void EventsRefactorer::RenameObjectInEvents(Game & game, Scene & scene, vector < } } -bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string name) +bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string name) { bool somethingModified = false; @@ -391,7 +391,7 @@ bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector { bool deleteMe = false; - InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType()); + gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType()); for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb) { //Replace object's name in parameters @@ -439,7 +439,7 @@ bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector return somethingModified; } -bool EventsRefactorer::RemoveObjectInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string name) +bool EventsRefactorer::RemoveObjectInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string name) { bool somethingModified = false; @@ -447,7 +447,7 @@ bool EventsRefactorer::RemoveObjectInConditions(Game & game, Scene & scene, vect { bool deleteMe = false; - InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType()); + gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType()); for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb) { //Replace object's name in parameters @@ -497,7 +497,7 @@ void EventsRefactorer::RemoveObjectInEvents(Game & game, Scene & scene, vector < { for (unsigned int i = 0;i* > conditionsVectors = events[i]->GetAllConditionsVectors(); + vector < vector* > conditionsVectors = events[i]->GetAllConditionsVectors(); for (unsigned int j = 0;j < conditionsVectors.size();++j) { bool conditionsModified = RemoveObjectInConditions(game, scene, *conditionsVectors[j], name); @@ -506,7 +506,7 @@ void EventsRefactorer::RemoveObjectInEvents(Game & game, Scene & scene, vector < #endif } - vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); + vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); for (unsigned int j = 0;j < actionsVectors.size();++j) { bool actionsModified = RemoveObjectInActions(game, scene, *actionsVectors[j], name); @@ -530,7 +530,7 @@ void EventsRefactorer::ReplaceStringInEvents(Game & game, Scene & scene, std::ve { if ( inConditions ) { - vector < vector* > conditionsVectors = events[i]->GetAllConditionsVectors(); + vector < vector* > conditionsVectors = events[i]->GetAllConditionsVectors(); for (unsigned int j = 0;j < conditionsVectors.size();++j) { bool conditionsModified = ReplaceStringInConditions(game, scene, *conditionsVectors[j], toReplace, newString, matchCase); @@ -542,7 +542,7 @@ void EventsRefactorer::ReplaceStringInEvents(Game & game, Scene & scene, std::ve if ( inActions ) { - vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); + vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); for (unsigned int j = 0;j < actionsVectors.size();++j) { bool actionsModified = ReplaceStringInActions(game, scene, *actionsVectors[j], toReplace, newString, matchCase); @@ -584,7 +584,7 @@ std::string ReplaceAllOccurencesCaseUnsensitive(string context, string from, con return context; } -bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string toReplace, std::string newString, bool matchCase) +bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string toReplace, std::string newString, bool matchCase) { bool somethingModified = false; @@ -597,7 +597,7 @@ bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector if ( newParameter != actions[aId].GetParameter(pNb).GetPlainString()) { - actions[aId].SetParameter(pNb, GDExpression(newParameter)); + actions[aId].SetParameter(pNb, gd::Expression(newParameter)); somethingModified = true; #if defined(GD_IDE_ONLY) actions[aId].renderedHeightNeedUpdate = true; @@ -611,7 +611,7 @@ bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector return somethingModified; } -bool EventsRefactorer::ReplaceStringInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase) +bool EventsRefactorer::ReplaceStringInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase) { bool somethingModified = false; @@ -624,7 +624,7 @@ bool EventsRefactorer::ReplaceStringInConditions(Game & game, Scene & scene, vec if ( newParameter != conditions[cId].GetParameter(pNb).GetPlainString()) { - conditions[cId].SetParameter(pNb, GDExpression(newParameter)); + conditions[cId].SetParameter(pNb, gd::Expression(newParameter)); somethingModified = true; #if defined(GD_IDE_ONLY) conditions[cId].renderedHeightNeedUpdate = true; @@ -652,7 +652,7 @@ vector < boost::weak_ptr > EventsRefactorer::SearchInEvents(Game if ( inConditions ) { - vector < vector* > conditionsVectors = events[i]->GetAllConditionsVectors(); + vector < vector* > conditionsVectors = events[i]->GetAllConditionsVectors(); for (unsigned int j = 0;j < conditionsVectors.size();++j) { if (!eventAddedInResults && SearchStringInConditions(game, scene, *conditionsVectors[j], search, matchCase)) @@ -664,7 +664,7 @@ vector < boost::weak_ptr > EventsRefactorer::SearchInEvents(Game if ( inActions ) { - vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); + vector < vector* > actionsVectors = events[i]->GetAllActionsVectors(); for (unsigned int j = 0;j < actionsVectors.size();++j) { if (!eventAddedInResults && SearchStringInActions(game, scene, *actionsVectors[j], search, matchCase)) @@ -684,7 +684,7 @@ vector < boost::weak_ptr > EventsRefactorer::SearchInEvents(Game return results; } -bool EventsRefactorer::SearchStringInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string search, bool matchCase) +bool EventsRefactorer::SearchStringInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string search, bool matchCase) { if ( !matchCase ) boost::to_upper(search); @@ -705,7 +705,7 @@ bool EventsRefactorer::SearchStringInActions(Game & game, Scene & scene, vector return false; } -bool EventsRefactorer::SearchStringInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string search, bool matchCase) +bool EventsRefactorer::SearchStringInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string search, bool matchCase) { if ( !matchCase ) boost::to_upper(search); diff --git a/IDE/EventsRefactorer.h b/IDE/EventsRefactorer.h index 1c6dea9e11..1d4801f325 100644 --- a/IDE/EventsRefactorer.h +++ b/IDE/EventsRefactorer.h @@ -10,7 +10,7 @@ namespace gd {class ExternalEvents; } namespace gd { class BaseEvent; } class Game; class Scene; -class Instruction; +namespace gd { class Instruction; } class ExternalEvents; namespace gd {typedef boost::shared_ptr BaseEventSPtr;} @@ -62,7 +62,7 @@ class EventsRefactorer * * \return true if something was modified. */ - static bool RenameObjectInActions(Game & game, Scene & scene, std::vector < Instruction > & instructions, std::string oldName, std::string newName); + static bool RenameObjectInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & instructions, std::string oldName, std::string newName); /** * Replace all occurences of an object name by another name in a condition @@ -70,38 +70,38 @@ class EventsRefactorer * * \return true if something was modified. */ - static bool RenameObjectInConditions(Game & game, Scene & scene, std::vector < Instruction > & instructions, std::string oldName, std::string newName); + static bool RenameObjectInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & instructions, std::string oldName, std::string newName); /** * Remove all conditions of the list using an object * * \return true if something was modified. */ - static bool RemoveObjectInConditions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string name); + static bool RemoveObjectInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string name); /** * Remove all actions of the list using an object * * \return true if something was modified. */ - static bool RemoveObjectInActions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string name); + static bool RemoveObjectInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string name); /** * Replace all occurences of a string in conditions * * \return true if something was modified. */ - static bool ReplaceStringInConditions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase); + static bool ReplaceStringInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase); /** * Replace all occurences of a string in actions * * \return true if something was modified. */ - static bool ReplaceStringInActions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase); + static bool ReplaceStringInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase); - static bool SearchStringInActions(Game & game, Scene & scene, std::vector < Instruction > & actions, std::string search, bool matchCase); - static bool SearchStringInConditions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string search, bool matchCase); + static bool SearchStringInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & actions, std::string search, bool matchCase); + static bool SearchStringInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string search, bool matchCase); /** * Fill layouts and externalEvents vector with pointers to layouts and external events linked (even indirectly) by the events. diff --git a/IDE/Game_Develop_EditorApp.cpp b/IDE/Game_Develop_EditorApp.cpp index 4050540add..3edf94095f 100644 --- a/IDE/Game_Develop_EditorApp.cpp +++ b/IDE/Game_Develop_EditorApp.cpp @@ -229,7 +229,7 @@ bool Game_Develop_EditorApp::OnInit() //Set help file { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); if ( GDpriv::LocaleManager::GetInstance()->locale->GetLanguage() == wxLANGUAGE_ENGLISH ) helpFileAccess->InitWithHelpFile("help.chm"); else if ( GDpriv::LocaleManager::GetInstance()->locale->GetLanguage() == wxLANGUAGE_FRENCH ) @@ -421,7 +421,7 @@ int Game_Develop_EditorApp::OnExit() clipboard->DestroySingleton(); FontManager * fontManager = FontManager::GetInstance(); fontManager->DestroySingleton(); - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DestroySingleton(); #if defined(LINUX) || defined(MAC) diff --git a/IDE/MainAide.cpp b/IDE/MainAide.cpp index 398990529d..30ca30e080 100644 --- a/IDE/MainAide.cpp +++ b/IDE/MainAide.cpp @@ -15,7 +15,7 @@ */ void Game_Develop_EditorFrame::OnMenuAideSelected( wxCommandEvent& event ) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplayContents(); } diff --git a/IDE/PlayerUnitTests.cpp b/IDE/PlayerUnitTests.cpp index 2929b06d45..1d487b7bbe 100644 --- a/IDE/PlayerUnitTests.cpp +++ b/IDE/PlayerUnitTests.cpp @@ -8,7 +8,7 @@ #include "GDL/Object.h" #include "GDL/RuntimeGame.h" #include "GDL/RuntimeScene.h" -#include "GDCore/Events/GDExpression.h" +#include "GDCore/Events/Expression.h" #ifdef ___WXMSW___ #include "windows.h" diff --git a/IDE/Preferences.cpp b/IDE/Preferences.cpp index 1a169824fc..2c4e87debe 100644 --- a/IDE/Preferences.cpp +++ b/IDE/Preferences.cpp @@ -1228,7 +1228,7 @@ void Preferences::OnInactifColor2PnlRightUp( wxMouseEvent& event ) void Preferences::OnAideBtClick( wxCommandEvent& event ) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplayContents(); } diff --git a/IDE/ProjectManager.cpp b/IDE/ProjectManager.cpp index beea3535c5..b882b4ce77 100644 --- a/IDE/ProjectManager.cpp +++ b/IDE/ProjectManager.cpp @@ -705,7 +705,7 @@ void ProjectManager::OnmodVarSceneMenuISelected(wxCommandEvent& event) return; } - ChooseVariableDialog dialog(this, (*scene)->GetVariables(), /*editingOnly=*/true); + gd::ChooseVariableDialog dialog(this, (*scene)->GetVariables(), /*editingOnly=*/true); if ( dialog.ShowModal() == 1 ) { (*scene)->wasModified = true; @@ -1062,7 +1062,7 @@ void ProjectManager::OneditGblVarMenuItemSelected(wxCommandEvent& event) gdTreeItemGameData * data; if ( !GetGameOfSelectedItem(game, data) ) return; - ChooseVariableDialog dialog(this, game->GetVariables(), /*editingOnly=*/true); + gd::ChooseVariableDialog dialog(this, game->GetVariables(), /*editingOnly=*/true); if ( dialog.ShowModal() == 1 ) { for (unsigned int i = 0;iGetLayouts().size();++i) diff --git a/IDE/SceneCanvas.cpp b/IDE/SceneCanvas.cpp index 8d391693cf..e115711b7c 100644 --- a/IDE/SceneCanvas.cpp +++ b/IDE/SceneCanvas.cpp @@ -395,7 +395,7 @@ void SceneCanvas::OnEditionBtClick( wxCommandEvent & event ) void SceneCanvas::OnHelpBtClick( wxCommandEvent & event ) { - HelpFileAccess::GetInstance()->DisplaySection(12); + gd::HelpFileAccess::GetInstance()->DisplaySection(12); } void SceneCanvas::OnLayersEditor( wxCommandEvent & event ) diff --git a/IDE/SearchEvents.cpp b/IDE/SearchEvents.cpp index 76171e5f19..d46655179e 100644 --- a/IDE/SearchEvents.cpp +++ b/IDE/SearchEvents.cpp @@ -300,5 +300,5 @@ void SearchEvents::OnpreviousBtClick(wxCommandEvent&) void SearchEvents::OnhelpBtClick(wxCommandEvent& event) { - HelpFileAccess::GetInstance()->DisplaySection(58); + gd::HelpFileAccess::GetInstance()->DisplaySection(58); } diff --git a/IDE/StartHerePage.cpp b/IDE/StartHerePage.cpp index 1baccbc0c0..81f76f9844 100644 --- a/IDE/StartHerePage.cpp +++ b/IDE/StartHerePage.cpp @@ -286,7 +286,7 @@ void StartHerePage::Onrecent9BtClick(wxCommandEvent& event) void StartHerePage::OnguideBtClick(wxCommandEvent& event) { - HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance(); + gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance(); helpFileAccess->DisplaySection(16); }