comparison Sphinx/source/developers/creating-plugins.rst @ 250:540c2884cdf4

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Jun 2019 09:21:09 +0200
parents 19dd28b3a541
children 974d97395060
comparison
equal deleted inserted replaced
249:19dd28b3a541 250:540c2884cdf4
1 .. _creating-plugins: 1 .. _creating-plugins:
2 2
3 Creating new plugins 3 Creating new plugins
4 ==================== 4 ====================
5 5
6 .. contents::
7
8 Overview
9 --------
10
6 The recommended way of :ref:`contributing to the Orthanc code 11 The recommended way of :ref:`contributing to the Orthanc code
7 <contributing>` consists in extending it by creating new :ref:`plugins 12 <contributing>` consists in extending it by creating new :ref:`plugins
8 <plugins>`. 13 <plugins>`.
9
10 Overview
11 --------
12 14
13 Orthanc plugins must use the `plugin SDK 15 Orthanc plugins must use the `plugin SDK
14 <http://sdk.orthanc-server.com/>`__ and must be written 16 <http://sdk.orthanc-server.com/>`__ and must be written
15 in C or C++. They must also fullfil the terms of the `GPLv3 license 17 in C or C++. They must also fullfil the terms of the `GPLv3 license
16 <http://www.gnu.org/licenses/quick-guide-gplv3.en.html>`__ that is 18 <http://www.gnu.org/licenses/quick-guide-gplv3.en.html>`__ that is
27 29
28 Do not hesitate to `contact us 30 Do not hesitate to `contact us
29 <http://www.orthanc-server.com/static.php?page=contact>`__ if you wish 31 <http://www.orthanc-server.com/static.php?page=contact>`__ if you wish
30 your plugin to be **indexed** in :ref:`the dedicated part of the 32 your plugin to be **indexed** in :ref:`the dedicated part of the
31 Orthanc Book <plugins-contributed>`! 33 Orthanc Book <plugins-contributed>`!
32
33 **Note for C++ developers**: Convenience C++ wrappers around the plain
34 C API are available in the source Orthanc distribution. The following
35 three files can be used in your projects, and only depend on `Boost
36 <https://www.boost.org/>`__ and `JsonCpp
37 <https://github.com/open-source-parsers/jsoncpp>`__ if macro
38 ``HAS_ORTHANC_EXCEPTION`` is set to ``0``:
39
40 * `Plugins/Samples/Common/OrthanPluginCppWrapper.h
41 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/Common/OrthancPluginCppWrapper.h>`__
42 * `Plugins/Samples/Common/OrthanPluginCppWrapper.cpp
43 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp>`__
44 * `Plugins/Samples/Common/OrthanPluginException.h
45 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/Common/OrthancPluginException.h>`__
46
47
48 34
49 Structure of the plugins 35 Structure of the plugins
50 ------------------------ 36 ------------------------
51 37
52 A plugin takes the form of a shared library (``.DLL`` under Windows, 38 A plugin takes the form of a shared library (``.DLL`` under Windows,
67 53
68 *Remark:* The size of the memory buffers that are exchanged between 54 *Remark:* The size of the memory buffers that are exchanged between
69 the Orthanc core and the plugins must be below 4GB. This is a 55 the Orthanc core and the plugins must be below 4GB. This is a
70 consequence of the fact that the Orthanc plugin SDK uses ``uint32_t`` 56 consequence of the fact that the Orthanc plugin SDK uses ``uint32_t``
71 to encode the size of a memory buffer. We might extend the SDK in 57 to encode the size of a memory buffer. We might extend the SDK in
72 the future to deal with buffers whose size if above 4GB. 58 the future to deal with buffers whose size is above 4GB.
59
60 Plugin SDK
61 ----------
62
63 Any plugin project should include the **official C header** file
64 that is part of the Orthanc source distribution:
65
66 * `Plugins/Include/orthanc/OrthancCPlugin.h
67 <https://bitbucket.org/sjodogne/orthanc/src/Orthanc-1.5.6/Plugins/Include/orthanc/OrthancCPlugin.h>`__
68
69 `Online documentation <http://sdk.orthanc-server.com/>`__ for this C
70 header is available, as generated by `Doxygen
71 <https://en.wikipedia.org/wiki/Doxygen>`__.
72
73 **Convenience C++ wrappers** around the plain C API are available in
74 the Orthanc source distribution. The following three files can be used
75 in your projects, and only depend on `Boost
76 <https://www.boost.org/>`__ and `JsonCpp
77 <https://github.com/open-source-parsers/jsoncpp>`__ if macro
78 ``HAS_ORTHANC_EXCEPTION`` is set to ``0``:
79
80 * `Plugins/Samples/Common/OrthanPluginCppWrapper.h
81 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/Common/OrthancPluginCppWrapper.h>`__
82 * `Plugins/Samples/Common/OrthanPluginCppWrapper.cpp
83 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp>`__
84 * `Plugins/Samples/Common/OrthanPluginException.h
85 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/Common/OrthancPluginException.h>`__