Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

dtkComposer.cpp 3.65 KB
Newer Older
1 2 3
// Version: $Id$
//
//
KLOCZKO Thibaud's avatar
KLOCZKO Thibaud committed
4

5 6 7
// Commentary:
//
//
KLOCZKO Thibaud's avatar
KLOCZKO Thibaud committed
8

9 10 11 12 13
// Change Log:
//
//

// Code:
14 15 16

#include <dtkConfig.h>

17
#include "dtkComposer.h"
KLOCZKO Thibaud's avatar
KLOCZKO Thibaud committed
18
#include "dtkComposerNodeFactory.h"
19
#include "dtkComposerExtension.h"
20
#include "dtkComposerSettings.h"
21
#include "dtkComposerDefaultExtensions.h"
KLOCZKO Thibaud's avatar
KLOCZKO Thibaud committed
22

23 24
#include <dtkCore/dtkArray.h>

25 26 27 28
#if defined(DTK_BUILD_DISTRIBUTED)
#include <dtkDistributed/dtkDistributed.h>
#endif

29 30 31 32
namespace dtkComposer
{
    namespace node
    {
33
        namespace _private {
34
            dtkComposerNodeFactory factory;
35
        }
WINTZ Julien's avatar
WINTZ Julien committed
36

37 38
        dtkComposerNodeFactory& factory(void)
        {
39
            return _private::factory;
40
        }
WINTZ Julien's avatar
WINTZ Julien committed
41

42 43
        void initialize(void)
        {
44 45
            dtkComposerBaseExtension baseExt;
            baseExt.extend(&(_private::factory));
46

47 48
            dtkComposerBooleanExtension boolExt;
            boolExt.extend(&(_private::factory));
49

50 51
            dtkComposerControlExtension controlExt;
            controlExt.extend(&(_private::factory));
52

53 54
            dtkComposerConstantsExtension constantsExt;
            constantsExt.extend(&(_private::factory));
55

56 57 58 59
#if defined(DTK_BUILD_DISTRIBUTED)
            bool verbose = dtkComposer::extension::pluginManager().verboseLoading();
            dtkDistributed::communicator::setVerboseLoading(verbose);
            dtkDistributed::communicator::initialize();
60 61
            dtkComposerDistributedExtension distributedExt;
            distributedExt.extend(&(_private::factory));
62
#endif
63

64 65
            dtkComposerFileExtension fileExt;
            fileExt.extend(&(_private::factory));
66

67 68
            dtkComposerNumberExtension numberExt;
            numberExt.extend(&(_private::factory));
69

70 71
            dtkComposerStringExtension stringExt;
            stringExt.extend(&(_private::factory));
72

73 74
            dtkComposerContainerExtension containerExt;
            containerExt.extend(&(_private::factory));
75 76 77
        }
    }

78
    namespace extension {
79

80
        namespace _private {
81 82
            dtkComposerExtensionPluginFactory factory;
            dtkComposerExtensionPluginManager manager;
83
            bool activate_obj_mgr = false;
84 85
        }

86 87
        dtkComposerExtensionPluginFactory& pluginFactory(void)
        {
88
            return _private::factory;
89
        }
KLOCZKO Thibaud's avatar
KLOCZKO Thibaud committed
90

91 92
        dtkComposerExtensionPluginManager& pluginManager(void)
        {
93 94
            return _private::manager;
        }
95

96 97 98 99 100 101 102 103 104 105
        void activateObjectManager(bool val)
        {
            _private::activate_obj_mgr = val;
        }

        bool isObjectManagerActive(void)
        {
            return _private::activate_obj_mgr ;
        }

106 107
        void initialize(const QString& path)
        {
108 109 110 111 112 113 114
            QString realpath = path;

            if (realpath.isEmpty()) {
                dtkComposerSettings composer_settings;
                composer_settings.beginGroup("extension");
                realpath = composer_settings.value("plugins").toString();
                composer_settings.endGroup();
115

116 117 118 119 120 121
                if (realpath.isEmpty()) {

                    realpath = QDir(DTK_INSTALL_PREFIX).filePath("plugins/dtkComposer");
                    dtkDebug() << "no composer plugin path configured, use default:" << realpath ;
                }
                pluginManager().initialize(realpath);
122 123 124 125
            } else {
                dtkDebug() << "initialize composer plugins using path:" << path ;
                pluginManager().initialize(path);
            }
126 127 128

            // needed when the composer is run on a remote node
            // should we add more ?
129 130 131
            qMetaTypeId<dtkArray<qlonglong> *>();
            qMetaTypeId<dtkArray<double> *>();
            qRegisterMetaTypeStreamOperators<QStringList *>("QStringList *");
132
        }
KLOCZKO Thibaud's avatar
KLOCZKO Thibaud committed
133 134
    }
}
135 136 137

//
// dtkComposer.cpp ends here