-
Notifications
You must be signed in to change notification settings - Fork 349
Pluginsystem #569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Pluginsystem #569
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cd41c45
Fixes #563, adds the ability to open a file directly in the IDE (with...
eda3589
First steps to implement a plugin system: *New Plugin Resource, *Plug...
4497246
Further steps to implement plugin system: *Loading and saving of the ...
8c32c3e
Rather final changes for loading plugins, props and sheets.
e840e75
Final changes for Sheets, added a Editor to create plugins (for now P...
deb6764
Some improvements with the PluginEdior for long prop names.
6e6f310
Made prop names clearer, little rewrite of the plugin information sav...
9927988
Implemented ComboProps, added removeItem funtions to UIComboBox. Enti...
c0558d7
Added ability to remove props from a plugin in the Plugin Editor
efe3819
Got rid of the arrayVal in EntityProps.
e5396d8
(Re-)adding pluginEditor icons, Fixing problems with more than one pl...
ef6149e
(Re-)adding pluginEditor icons, Fixing problems with more than one pl...
6691834
Cleaned up a bit, added correct implementation of slider props (min a...
5845081
Added Plugin folder to IDE Resources, including PhysicsModul.plugin, ...
ac31c12
Fix last commit: forgot to add PhysicsModul.plugin.
0c011ae
Fixed some issues, added addPhysicsChildEntity and addCollisionChildE...
39d0ad1
Hopefully (not tested) add the function to Linux IDE to open files di...
f6fad7e
Fix PolycodeIDEApp::openFilePicker() to be able to use PolycodeUI fil...
6da87cd
Fix rebase issue.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
Core/Contents/Include/PolyPlugin.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /* | ||
| Copyright (C) 2014 by Joachim Meyer | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "PolyGlobals.h" | ||
| #include "PolyString.h" | ||
| #include "PolyResource.h" | ||
|
|
||
| namespace Polycode { | ||
| class ObjectEntry; | ||
|
|
||
| class _PolyExport Prop : public PolyBase { | ||
| public: | ||
| Prop(const String& name, const int type = Prop::PROP_STRING); | ||
| Prop(ObjectEntry *entry); | ||
| ~Prop(); | ||
|
|
||
| Prop *loadPropFromEntry(ObjectEntry* entry); | ||
|
|
||
| int type; | ||
| String name; | ||
| int value; | ||
|
|
||
| std::vector<Prop*> children; | ||
|
|
||
| static const int PROP_VECTOR3 = 0; | ||
| static const int PROP_VECTOR2 = 1; | ||
| static const int PROP_SLIDER = 2; | ||
| static const int PROP_BUTTON = 3; | ||
| static const int PROP_NUMBER = 4; | ||
| static const int PROP_TARGET_BINDING = 5; | ||
| static const int PROP_RENDER_TARGET = 6; | ||
| static const int PROP_SHADER_PASS = 7; | ||
| static const int PROP_REMOVABLE_STRING = 8; | ||
| static const int PROP_LAYER = 9; | ||
| static const int PROP_CUSTOM = 10; | ||
| static const int PROP_STRING = 11; | ||
| static const int PROP_COLOR = 12; | ||
| static const int PROP_COMBO = 13; | ||
| static const int PROP_BOOL = 14; | ||
| static const int PROP_SOUND = 15; | ||
| static const int PROP_BEZIER_RGBA_CURVE = 16; | ||
| static const int PROP_BEZIER_CURVE = 17; | ||
| static const int PROP_MATERIAL = 18; | ||
| static const int PROP_MATERIAL_PREVIEW = 19; | ||
| static const int PROP_TEXTURE = 20; | ||
| static const int PROP_SCENE_SPRITE = 21; | ||
| static const int PROP_SCENE_ENTITY_INSTANCE = 22; }; | ||
|
|
||
| class _PolyExport Plugin : public Resource { | ||
| public: | ||
| Plugin(const String& name); | ||
| Plugin(ObjectEntry *entry); | ||
| ~Plugin(); | ||
|
|
||
| Plugin* loadPluginFromEntry(ObjectEntry *entry); | ||
|
|
||
| void setProp(Prop* prop); | ||
|
|
||
| void removeProp(Prop* prop); | ||
| void removeProp(const String& propName); | ||
|
|
||
| std::vector<Prop*> getProps() const; | ||
| unsigned int getNumProps() const; | ||
|
|
||
| unsigned int pluginType; | ||
|
|
||
| static const unsigned int PLUGIN_ENTITY = 0; | ||
|
|
||
| String ext; | ||
| String author; | ||
|
|
||
| protected: | ||
| std::vector<Prop*> props; | ||
| }; | ||
| } |
47 changes: 47 additions & 0 deletions
Core/Contents/Include/PolyPluginManager.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| Copyright (C) 2014 by Joachim Meyer | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "PolyGlobals.h" | ||
| #include "PolyPlugin.h" | ||
|
|
||
| namespace Polycode { | ||
|
|
||
| class ResourcePool; | ||
| class String; | ||
|
|
||
| class PluginManager : public PolyBase { | ||
| public: | ||
| PluginManager(); | ||
| ~PluginManager(); | ||
|
|
||
| std::vector<Plugin*> loadPluginsFromFile(ResourcePool* pool, const String &fileName); | ||
| void loadPluginLibraryIntoPool(ResourcePool *pool, const String &pluginFile); | ||
|
|
||
| void addPlugin(Plugin* plugin); | ||
|
|
||
| protected: | ||
| Number version; | ||
| std::vector<Plugin*> plugins; | ||
| }; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.