1 ////////////////////////////////////////////////////////////
\r
4 /// \section welcome Welcome
\r
5 /// Welcome to Pluma documentation. Here you will find a detailed
\r
6 /// view of all Pluma <a href="./annotated.htm">classes</a>.<br>
\r
7 /// If you are looking for support, you can visit the official website
\r
8 /// at <a href="http://pluma-framework.sourceforge.net/">http://pluma-framework.sourceforge.net/</a>.<br><br>
\r
10 /// CSS based on <a href="http://www.sfml-dev.org/documentation/1.6/">SFML1.6 documentation</a><br>
\r
12 /// \section example Short Example
\r
13 /// A short example to demonstrate Pluma usage:<br>
\r
14 /// A host application define a Device interface. A certain plugin
\r
15 /// defines a Keyboard, witch is a Device.
\r
16 /// The host will use DeviceProviders to create objects of type Device.
\r
17 /// The plugin will provide host specifically with a KeyboardProvider.<br>
\r
19 /// Device hpp (shared):
\r
21 /// #include <Pluma/Pluma.hpp>
\r
24 /// virtual std::string getDescription() const = 0;
\r
26 /// // create DevicedProvider class
\r
27 /// PLUMA_PROVIDER_HEADER(Device);
\r
30 /// Device cpp (shared):
\r
32 /// #include "Device.hpp"
\r
33 /// generate DevicedProvider with version 6, and compatible with at least v.3
\r
34 /// PLUMA_PROVIDER_SOURCE(Device, 6, 3);
\r
39 /// Keyboard code on the plugin side:
\r
41 /// #include <Pluma/Pluma.hpp>
\r
42 /// #include "Device.hpp"
\r
44 /// class Keyboard: public Device{
\r
46 /// std::string getDescription() const{
\r
47 /// return "keyboard";
\r
51 /// // create KeyboardProvider, it implements DeviceProvider
\r
52 /// PLUMA_INHERIT_PROVIDER(Keyboard, Device);
\r
55 /// plugin connector:
\r
57 /// #include <Pluma/Connector.hpp>
\r
58 /// #include "Keyboard.hpp"
\r
61 /// bool connect(pluma::Host& host){
\r
62 /// // add a keyboard provider to host
\r
63 /// host.add( new KeyboardProvider() );
\r
69 /// Host application code:
\r
71 /// #include <Pluma/Pluma.hpp>
\r
73 /// #include "Device.hpp"
\r
74 /// #include <iostream>
\r
75 /// #include <vector>
\r
79 /// pluma::Pluma plugins;
\r
80 /// // Tell plugins manager to accept providers of the type DeviceProvider
\r
81 /// plugins.acceptProviderType<DeviceProvider>();
\r
82 /// // Load library "standard_devices" from folder "plugins"
\r
83 /// plugins.load("plugins", "standard_devices");
\r
85 /// // Get device providers into a vector
\r
86 /// std::vector<DeviceProvider*> providers;
\r
87 /// plugins.getProviders(providers);
\r
89 /// // create a Device from the first provider
\r
90 /// if (!providers.empty()){
\r
91 /// Device* myDevice = providers.first()->create();
\r
92 /// // do something with myDevice
\r
93 /// std::cout << device->getDescription() << std::endl;
\r
94 /// // and delete it in the end
\r
95 /// delete myDevice;
\r
101 ////////////////////////////////////////////////////////////
\r