~wintermute-devel/wintermute/master

« back to all changes in this revision

Viewing changes to src/Wintermute/plugin.cpp

  • Committer: Jacky Alciné
  • Date: 2013-05-08 11:22:08 UTC
  • mfrom: (299.1.31)
  • Revision ID: git-v1:736770b4615b8c7cfec6437d8a7d0c8cd95b7d25
Merge branch 'feature/extensibility' into develop

* feature/extensibility:
  Added winfo to updates.
  Updates to Wintermute::Factory.
  Licenses to Wintermute::Version.
  Updates to Wintermute::Application.
  Docs + licensing for header.
  Updated ctags git hook.
  Moved private data into source code.
  Added documentation in application.hpp
  Added changes due to logging infrastructure.
  Added shortcuts for logging to console.
  Added new temporary plugin definition data.
  Improved plugin code.
  Improved logging capability.
  Improved definitions of factory.*pp.
  Improved definitions of arguments.*pp.
  Improved definitions of arguments.*pp.
  Improved definitions in 'application.cpp'
  Added two more non-existing source files to build.
  Updated changes for CMake for extensibility.
  Define default path for extension loading.
  Update generate-ctags.
  Add post-commit hook to VCS.
  Adding logging function to Wintermute::Arguments.
  Updated Wintermute::Application with functionality.
  Added Wintermute::Factory to build.
  Updated Wintermute's global header.
  Add semantic versioning + Git to CMake.
  Updated CMake configuration and add 'Version'.
  Updated 'src/CMakeLists.txt' to reflect source.
  Add 'Wintermute::Plugin' to codebase.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 *
 
3
 * Copyright (C) 2013 Jacky Alcine <jacky.alcine@thesii.org>
 
4
 *
 
5
 * This file is part of Wintermute, the extensible AI platform.
 
6
 *
 
7
 *
 
8
 * Wintermute is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; either version 3 of the License, or
 
11
 * (at your option) any later version.
 
12
 *
 
13
 * Wintermute is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 * GNU General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with Wintermute.  If not, see <http://www.gnu.org/licenses/>.
 
20
**/
 
21
 
 
22
#include "plugin.hpp"
 
23
#include "pluginprivate.hpp"
 
24
#include "version.hpp"
 
25
#include "logging.hpp"
 
26
#include "factory.hpp"
 
27
#include "application.hpp"
 
28
#include <QtCore/QPluginLoader>
 
29
 
 
30
using Wintermute::Version;
 
31
using Wintermute::Plugin;
 
32
using Wintermute::PluginPrivate;
 
33
using Wintermute::Logging;
 
34
using Wintermute::Logger;
 
35
 
 
36
PluginPrivate::PluginPrivate(const QUuid& uuid) : id(uuid){
 
37
}
 
38
 
 
39
bool
 
40
PluginPrivate::loadBinary(){
 
41
  return false;
 
42
}
 
43
 
 
44
bool
 
45
PluginPrivate::unloadBinary(){
 
46
  return false;
 
47
}
 
48
 
 
49
bool
 
50
PluginPrivate::tryLoad(){
 
51
  return false;
 
52
}
 
53
 
 
54
bool
 
55
PluginPrivate::invokeUnload(){
 
56
  return true;
 
57
}
 
58
 
 
59
Plugin*
 
60
PluginPrivate::getPluginInstance(){
 
61
  return 0;
 
62
}
 
63
 
 
64
PluginPrivate::~PluginPrivate(){
 
65
}
 
66
 
 
67
// TODO: Check if loading in its own space, if so, load necessary data.
 
68
Plugin::Plugin(const QString& uuid) : QObject(Factory::instance()), d_ptr(new PluginPrivate(uuid)){
 
69
}
 
70
 
 
71
// TODO: Provide a means of obtaining a name for plug-ins.
 
72
QString
 
73
Plugin::name() const {
 
74
  return QString::null;
 
75
}
 
76
 
 
77
// TODO: Provide a means of determining the plugin's version.
 
78
Version
 
79
Plugin::version() const {
 
80
  return Version::Any;
 
81
}
 
82
 
 
83
// TODO: Provide a means of determining the version of Wintermute required.
 
84
Version
 
85
Plugin::systemVersion() const {
 
86
  return Version::Any;
 
87
}
 
88
 
 
89
QSettings*
 
90
Plugin::configuration() const {
 
91
  Q_D(const Plugin);
 
92
  return d->settings;
 
93
}
 
94
 
 
95
Plugin::State
 
96
Plugin::state() const {
 
97
  return Undefined;
 
98
}
 
99
 
 
100
bool
 
101
Plugin::isLoaded() const {
 
102
  return false;
 
103
}
 
104
 
 
105
Plugin::~Plugin(){
 
106
}
 
107
 
 
108
#include "plugin.moc"