luiscubal
|
|
Posted on: January 22, 2011, 05:34:42 pm |
|
|
Joined: Jun 2009
Posts: 452
|
I propose an extension API for ENIGMA based on the following concepts:
1. Each extension will typically have a Java/LGM part and an "execution" part(C++/ENIGMA or whatever the backend is) 3. Each execution component has a part of it that describes its function. This might be in Java, XML or any other cross-platform language that LGM can understand.
-------------------------------------
Core Extension API
LGM.requestRestart(String msg); //If the extension requires a restart LGM.installExtension(String path, Object params); //Install "with args" LGM.installExtension(String path); //Same as installExtension(path, null) LGM.uninstallExtension(Extension extension);
class Extension public String getName() public String getDescription() public String[] getAuthors() public java.awt.Image getIcon() public boolean getEnabled() public void setEnabled(boolean enabled); public ExtensionContent load();
interface or class ExtensionContent public void install(); public void load(); //Extension code and resources were loaded, now handle the load logic public void enable(); //Enable the extension
This is the barebones, now the interesting part:
void LGM.registerResourceType(ResourceType resource); void LGM.unregisterResourceType(ResourceType resource); GameFolder LGM.createGameFolder(String folderName, ResourceType resource, boolean canRename); void LGM.renameGameFolder(GameFolder folder); void LGM.deleteGameFolder(GameFolder folder);
class or interface ResourceType public String getName(); public Image getIcon(); public Designer createDesigner(Object resource); //Missing is the serialization API for loading/saving. I don't think I can properly design this without also designing a file format, which is not within the scope of this topic, so someone else will have to do this part.
class Designer extends JPanel //Stuff like designer window title, etc.
Now for the "execution" part:
LGM.registerExecutionPlugin(ExecutionPlugin plugin);
class or interface BackendInfo public String getName(); //return "enigma"; public String getLanguage(); //return "cpp"; public boolean isDebugMode(); public String getFullInfo(); //something like "enigma/cpp debug windows+opengl+openal" //Possibly more functions
class or interface ExecutionPlugin public String getName(); public boolean acceptsBackend(BackendInfo info); //Whether the execution plugin was made for this backend public Script[] getScripts(); //Creates GML scripts for the plugin, useful for pure GML plugins //The rest would be backend-specific. For instance, ENIGMA could provide a EnigmaExecutionPlugin. //Do note that even if a plugin was not EnigmaExecutionPlugin, ENIGMA would accept it based ONLY on the acceptsBackend function, in order to allow pure GML extensions.
I am not sure how to allow pure GML scripts to handle custom resources, though.
This is just a proposal. Feel free to use, modify and/or ignore it. I release this proposal under the WTFPL.
|
|
|
Logged
|
|
|
|
|
|
Post made January 23, 2011, 07:04:08 am was deleted at the author's request.
|
|
Josh @ Dreamland
|
|
Reply #5 Posted on: January 23, 2011, 06:22:24 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
He's proposing a solution to an issue from another thread, being allowing adding resources to LGM. Simple extensions or static parts of extensions could potentially be released as object files on a per-platform basis. That said, this system would be for users who are wise enough to stay open source. Hence, I doubt that this will be requested, but I don't mind allowing for it.
I can see how this would allow adding resources, but not how it would allow modifying existing ones. I'd like Ism's opinion on it.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
IsmAvatar
|
|
Reply #6 Posted on: January 23, 2011, 11:57:24 pm |
|
|
LateralGM Developer
Location: Pennsylvania/USA Joined: Apr 2008
Posts: 877
|
As I said in the other thread, I do like the idea, and was expecting it to come sooner or later. This is especially helpful for LGM, as it's very bundled currently, making it hard to modify/extend, so this is a welcome change. I'm not a fan of luis's proposal, but it kinda gives us an idea of where to start.
We could provide official extensions which will maintain the ENIGMA license so that users don't have to worry about "boohoo, all the good stuff forces me to go open source."
This seems already pretty much compatible with LGM's existing plugin system for the most part, which is another part of my concern with Luis's suggestion - it's not revolutionary enough to change the internals of LGM yet, which is what I'd really like to do. I'm sure as it evolves that will become more readily available.
Also, luis should consider joining the IRC from time to time.
|
|
« Last Edit: January 24, 2011, 12:14:40 am by IsmAvatar »
|
Logged
|
|
|
|
Post made January 24, 2011, 10:30:15 am was deleted at the author's request.
|
Josh @ Dreamland
|
|
Reply #8 Posted on: January 24, 2011, 09:33:31 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Making it easy for users to distribute compiled extensions on a per-platform basis is easily in our power and will probably be implemented. It will not be compatible with GM. It's also not relevant to this topic. This thread is basically dead; I'm considering closing it in favor of the other topic, but I'm generally opposed to closing things, so.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|