1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

#include "fsICursor.h"

#include <fsCore/src/fsCUserSavedData.h>

#include "src/fsCContextualHardwareCursor.h"
#include "src/fsCEntityFactory.h"
#include "src/fsCGuiMessageDispatcher.h"
#include "src/fsCProfileManager.h"
#include "src/fsCSoftwareCursor.h"
#include "src/components/fsIComponent.h"


void fsICursor::customCursorActiveSet(fsBool pVal)
{
    fsCProfileManager::instanceGet()->userSavedDataGet()->boolSet(fsCUserSavedData::mCustomCursorsKey, pVal);
    fsCGuiMessageDispatcher::instanceGet()->messageDispatch(fsCSoftwareCursor::mSoftwarCursorToggle,
                                                            fsIMessageDispatcher::sStrMessageParam(fsStr(pVal)));
}

void fsICursor::leftHandedCursorActiveSet(fsBool pVal)
{
    fsCProfileManager::instanceGet()->userSavedDataGet()->boolSet(fsCUserSavedData::mLeftHandCursorsKey, pVal);
    fsCGuiMessageDispatcher::instanceGet()->messageDispatch(fsCSoftwareCursor::mLeftHandedCursorToggle,
                                                            fsIMessageDispatcher::sStrMessageParam(fsStr(pVal)));
}

fsBool fsICursor::customCursorActiveGet()
{
    return fsCProfileManager::instanceGet()->userSavedDataGet()->boolGet(fsCUserSavedData::mCustomCursorsKey);
}

fsBool fsICursor::leftHandedCursorActiveGet()<--- The member function 'fsICursor::leftHandedCursorActiveGet' can be static.
{
    return fsCProfileManager::instanceGet()->userSavedDataGet()->boolGet(fsCUserSavedData::mLeftHandCursorsKey);
}

fsICursor* fsICursor::instance(fsINode* const pParent, fsCEntityFactory* const pEntityFactory)
{
#if defined fsHardwareCursor
    auto hardEnt = pEntityFactory->emptyEntityCreate("hardwareCursor");
    pParent->childAdd(hardEnt);
    fsCContextualHardwareCursor::create(hardEnt);
#endif
    auto softEnt = pEntityFactory->emptyEntityCreate("softwareCursor");
    pParent->childAdd(softEnt);
    return softEnt->componentAdd<fsCSoftwareCursor>();
}

fsIComponent* fsICursor::create(fsINode* const pParent)<--- Parameter 'pParent' can be declared as pointer to const
{   // empty as we use the instance method even though we are a component
    return nullptr;
}

fsICursor::fsICursor(fsCEntity* const pParent):
fsIMessageListenerComponent(pParent, ePRIORITY_SOFTWARE_CURSOR)
{
}

fsICursor::~fsICursor()
{
}