~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Tools/EditorFramework/ScopeManager.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
        @file
 
3
        @author         Albert Semenov
 
4
        @date           07/2012
 
5
*/
 
6
 
 
7
#include "Precompiled.h"
 
8
#include "ScopeManager.h"
 
9
#include "CommandManager.h"
 
10
#include "SettingsManager.h"
 
11
 
 
12
template <> tools::ScopeManager* MyGUI::Singleton<tools::ScopeManager>::msInstance = nullptr;
 
13
template <> const char* MyGUI::Singleton<tools::ScopeManager>::mClassTypeName = "ScopeManager";
 
14
 
 
15
namespace tools
 
16
{
 
17
 
 
18
        ScopeManager::ScopeManager()
 
19
        {
 
20
        }
 
21
 
 
22
        ScopeManager::~ScopeManager()
 
23
        {
 
24
        }
 
25
 
 
26
        void ScopeManager::initialise()
 
27
        {
 
28
                CommandManager::getInstance().getEvent("Command_ChangeScope")->connect(this, &ScopeManager::commandChangeScope);
 
29
 
 
30
                mCurrentScope = SettingsManager::getInstance().getValue("Editor/DefaultScope");
 
31
        }
 
32
 
 
33
        void ScopeManager::shutdown()
 
34
        {
 
35
        }
 
36
 
 
37
        void ScopeManager::commandChangeScope(const MyGUI::UString& _commandName, bool& _result)
 
38
        {
 
39
                if (CommandManager::getInstance().getCommandData() != mCurrentScope)
 
40
                {
 
41
                        mCurrentScope = CommandManager::getInstance().getCommandData();
 
42
                        eventChangeScope(mCurrentScope);
 
43
                }
 
44
 
 
45
                _result = true;
 
46
        }
 
47
 
 
48
        const std::string& ScopeManager::getCurrentScope() const
 
49
        {
 
50
                return mCurrentScope;
 
51
        }
 
52
 
 
53
}