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