Welcome
Welcome to Pluma documentation. Here you will find a detailed view of all Pluma classes.
If you are looking for support, you can visit the official website at http://pluma-framework.sourceforge.net/.
CSS based on SFML1.6 documentation
Short Example
A short example to demonstrate Pluma usage:
A host application define a Device interface. A certain plugin defines a Keyboard, witch is a Device. The host will use DeviceProviders to create objects of type Device. The plugin will provide host specifically with a KeyboardProvider.
Device hpp (shared):
#include <Pluma/Pluma.hpp>
class Device{
public:
virtual std::string getDescription() const = 0;
};
PLUMA_PROVIDER_HEADER(Device);
Device cpp (shared):
#include "Device.hpp"
generate DevicedProvider with version 6, and compatible with at least v.3
PLUMA_PROVIDER_SOURCE(Device, 6, 3);
Keyboard code on the plugin side:
#include <Pluma/Pluma.hpp>
#include "Device.hpp"
class Keyboard: public Device{
public:
std::string getDescription() const{
return "keyboard";
}
};
PLUMA_INHERIT_PROVIDER(Keyboard, Device);
plugin connector:
#include <Pluma/Connector.hpp>
#include "Keyboard.hpp"
PLUMA_CONNECTOR
host.
add(
new KeyboardProvider() );
return true;
}
Host application code:
#include <Pluma/Pluma.hpp>
#include "Device.hpp"
#include <iostream>
#include <vector>
int main(){
plugins.
load(
"plugins",
"standard_devices");
std::vector<DeviceProvider*> providers;
if (!providers.empty()){
Device* myDevice = providers.first()->create();
std::cout << device->getDescription() << std::endl;
delete myDevice;
}
return 0;
}