]> Creatis software - cpPlugins.git/blob - doc/third_party/Pluma/build/Doxygen.hpp
9b307a11223a2fbde88ebeb2824199876f619ed2
[cpPlugins.git] / doc / third_party / Pluma / build / Doxygen.hpp
1 ////////////////////////////////////////////////////////////\r
2 /// \mainpage\r
3 ///\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
9 ///\r
10 /// CSS based on <a href="http://www.sfml-dev.org/documentation/1.6/">SFML1.6 documentation</a><br>\r
11 ///\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
18 ///\r
19 /// Device hpp (shared):\r
20 /// \code\r
21 /// #include <Pluma/Pluma.hpp>\r
22 /// class Device{\r
23 /// public:\r
24 ///     virtual std::string getDescription() const = 0;\r
25 /// };\r
26 /// // create DevicedProvider class\r
27 /// PLUMA_PROVIDER_HEADER(Device);\r
28 /// \endcode\r
29 ///\r
30 /// Device cpp (shared):\r
31 /// \code\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
35 /// \endcode\r
36 ///\r
37 ///\r
38 /// <br>\r
39 /// Keyboard code on the plugin side:\r
40 /// \code\r
41 /// #include <Pluma/Pluma.hpp>\r
42 /// #include "Device.hpp"\r
43 ///\r
44 /// class Keyboard: public Device{\r
45 /// public:\r
46 ///     std::string getDescription() const{\r
47 ///         return "keyboard";\r
48 ///     }\r
49 /// };\r
50 ///\r
51 /// // create KeyboardProvider, it implements DeviceProvider\r
52 /// PLUMA_INHERIT_PROVIDER(Keyboard, Device);\r
53 /// \endcode\r
54 ///\r
55 /// plugin connector:\r
56 /// \code\r
57 /// #include <Pluma/Connector.hpp>\r
58 /// #include "Keyboard.hpp"\r
59 ///\r
60 /// PLUMA_CONNECTOR\r
61 /// bool connect(pluma::Host& host){\r
62 ///     // add a keyboard provider to host\r
63 ///     host.add( new KeyboardProvider() );\r
64 ///     return true;\r
65 /// }\r
66 /// \endcode\r
67 ///\r
68 ///\r
69 /// Host application code:\r
70 /// \code\r
71 /// #include <Pluma/Pluma.hpp>\r
72 ///\r
73 /// #include "Device.hpp"\r
74 /// #include <iostream>\r
75 /// #include <vector>\r
76 ///\r
77 /// int main(){\r
78 ///\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
84 ///\r
85 ///     // Get device providers into a vector\r
86 ///     std::vector<DeviceProvider*> providers;\r
87 ///     plugins.getProviders(providers);\r
88 ///\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
96 ///     }\r
97 ///     return 0;\r
98 /// }\r
99 /// \endcode\r
100 ///\r
101 ////////////////////////////////////////////////////////////\r