| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 1 | A quick overview of the LibreOffice code structure. |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | You can develop for LibreOffice in one of two ways, one |
| 6 | recommended and one much less so. First the somewhat less recommended |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 7 | way: it is possible to use the SDK to develop an extension, |
| 8 | for which you can read the API docs [here](http://api.libreoffice.org/) |
| 9 | and [here](http://wiki.services.openoffice.org/wiki/Documentation/DevGuide). |
| 10 | This re-uses the (extremely generic) UNO APIs that are also used by |
| 11 | macro scripting in StarBasic. |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 12 | |
| 13 | The best way to add a generally useful feature to LibreOffice |
| 14 | is to work on the code base however. Overall this way makes it easier |
| 15 | to compile and build your code, it avoids any arbitrary limitations of |
| 16 | our scripting APIs, and in general is far more simple and intuitive - |
| 17 | if you are a reasonably able C++ programmer. |
| 18 | |
| 19 | |
| 20 | ## The important bits of code |
| 21 | |
| 22 | Each module should have a `README` file inside it which has some |
| 23 | degree of documentation for that module; patches are most welcome to |
| 24 | improve those. We have those turned into a web page here: |
| 25 | |
| 26 | http://docs.libreoffice.org/ |
| 27 | |
| 28 | However, there are two hundred modules, many of them of only |
| 29 | peripheral interest for a specialist audience. So - where is the |
| 30 | good stuff, the code that is most useful. Here is a quick overview of |
| 31 | the most important ones: |
| 32 | |
| 33 | Module | Description |
| 34 | ----------|------------------------------------------------- |
| 35 | sal/ | this provides a simple System Abstraction Layer |
| 36 | tools/ | this provides basic internal types: 'Rectangle', 'Color' etc. |
| 37 | vcl/ | this is the widget toolkit library and one rendering abstraction |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 38 | framework | UNO framework, responsible for building toolbars, menus, status bars, and the chrome around the document using widgets from VCL, and XML descriptions from */uiconfig/* files |
| 39 | sfx2/ | legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc. |
| 40 | svx/ | drawing model related helper code, including much of Draw/Impress |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 41 | |
| 42 | Then applications |
| 43 | |
| 44 | Module | Description |
| 45 | ----------|------------------------------------------------- |
| 46 | desktop/ | this is where the 'main' for the application lives, init / bootstrap. the name dates back to an ancient StarOffice that also drew a desktop |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 47 | sw/ | Writer |
| 48 | sc/ | Calc |
| 49 | sd/ | Draw / Impress |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 50 | |
| 51 | There are several other libraries that are helpful from a graphical perspective: |
| 52 | |
| 53 | Module | Description |
| 54 | ----------|------------------------------------------------- |
| 55 | basebmp/ | enables a VCL compatible rendering API to render to bitmaps, as used for LibreOffice Online, Android, iOS, etc. |
| 56 | basegfx/ | algorithms and data-types for graphics as used in the canvas |
| 57 | canvas/ | new (UNO) canvas rendering model with various backends |
| 58 | cppcanvas/ | C++ helper classes for using the UNO canvas |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 59 | drawinglayer/ | View code to render drawable objects and break them down into primitives we can render more easily. |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 60 | |
| 61 | |
| 62 | ## Finding out more |
| 63 | |
| 64 | Beyond this, you can read the `README` files, send us patches, ask |
| 65 | on the mailing list libreoffice@lists.freedesktop.org (no subscription |
| 66 | required) or poke people on IRC `#libreoffice-dev` on irc.freenode.net - |
| 67 | we're a friendly and generally helpful mob. We know the code can be |
| 68 | hard to get into at first, and so there are no silly questions. |