comparison Sphinx/source/developers/creating-plugins.rst @ 24:25fa874803ab

plugins inside book
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 18 Jul 2016 17:36:02 +0200
parents
children 669ea65ba7fb
comparison
equal deleted inserted replaced
23:f99aa6a6f0c9 24:25fa874803ab
1 Creating new plugins
2 ====================
3
4 The recommended way of :ref:`contributing to the Orthanc code <contributing>`
5 is by extending it by :ref:`creating new plugins <plugins>`.
6
7 Overview
8 --------
9
10 Orthanc plugins must use the `plugin SDK
11 <https://orthanc.chu.ulg.ac.be/sdk/index.html>`__ and must be written
12 in C or C++. They must also fullfil the terms of the `GPLv3 license
13 <http://www.gnu.org/licenses/quick-guide-gplv3.en.html>`__ that is
14 used by the core of Orthanc. Sample code for plugins can be found `in
15 the official Orthanc repository
16 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/>`__
17 (in the ``Plugins/Samples`` folder of the ``plugins`` branch). A
18 tutorial showing how to implement a basic WADO server is `available on
19 CodeProject
20 <http://codeproject.com/Articles/797118/Implementing-a-WADO-Server-using-Orthanc>`__.
21
22 A plugin takes the form of a shared library (``.DLL`` under Windows,
23 ``.so`` under Linux, ``.dylib`` under Apple OS X...) that must declare 4
24 public functions/symbols:
25
26 * ``int32_t OrthancPluginInitialize(OrthancPluginContext* context)``. This
27 callback function is responsible for initializing the plugin. The
28 ``context`` argument gives access to the API of Orthanc.
29 * ``void OrthancPluginFinalize()``. This function is responsible
30 for finalizing the plugin, releasing all the allocated resources.
31 * ``const char* OrthancPluginGetName()``. This function must give a
32 name to the plugin.
33 * ``const char* OrthancPluginGetVersion()``. This function must
34 provide the version of the plugin.
35
36 We suggest developers to adopt the :ref:`coding style of the Orthanc
37 core <coding-style>`, although this is of course not required.
38
39 Do not hesitate to `contact us
40 <http://www.orthanc-server.com/static.php?page=contact>`__ if you wish
41 your plugin to be **indexed** in :ref:`this part of the Orthanc Book
42 <plugins-contributed>`!
43