| Adolfo Jayme Barrientos | b963086 | 2015-05-24 19:42:51 -0500 | [diff] [blame] | 1 | # LibreOffice |
| Adolfo Jayme Barrientos | 65f2d6b | 2016-10-10 03:22:53 -0500 | [diff] [blame] | 2 | [](https://scan.coverity.com/projects/211) [](https://bestpractices.coreinfrastructure.org/projects/307) |
| Adolfo Jayme Barrientos | b963086 | 2015-05-24 19:42:51 -0500 | [diff] [blame] | 3 | |
| David Ostrovsky | 700f080 | 2015-11-28 09:08:56 +0100 | [diff] [blame] | 4 | LibreOffice is an integrated office suite based on copyleft licenses |
| 5 | and compatible with most document formats and standards. Libreoffice |
| 6 | is backed by The Document Foundation, which represents a large |
| 7 | independent community of enterprises, developers and other volunteers |
| 8 | moved by the common goal of bringing to the market the best software |
| 9 | for personal productivity. LibreOffice is open source, and free to |
| 10 | download, use and distribute. |
| 11 | |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 12 | A quick overview of the LibreOffice code structure. |
| 13 | |
| 14 | ## Overview |
| 15 | |
| 16 | You can develop for LibreOffice in one of two ways, one |
| 17 | recommended and one much less so. First the somewhat less recommended |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 18 | way: it is possible to use the SDK to develop an extension, |
| 19 | for which you can read the API docs [here](http://api.libreoffice.org/) |
| 20 | and [here](http://wiki.services.openoffice.org/wiki/Documentation/DevGuide). |
| 21 | This re-uses the (extremely generic) UNO APIs that are also used by |
| 22 | macro scripting in StarBasic. |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 23 | |
| 24 | The best way to add a generally useful feature to LibreOffice |
| 25 | is to work on the code base however. Overall this way makes it easier |
| 26 | to compile and build your code, it avoids any arbitrary limitations of |
| 27 | our scripting APIs, and in general is far more simple and intuitive - |
| 28 | if you are a reasonably able C++ programmer. |
| 29 | |
| Jan-Marek Glogowski | 1079893 | 2017-09-07 12:09:25 +0200 | [diff] [blame] | 30 | ## The build chain and runtime baselines |
| 31 | |
| 32 | These are the current minimal operating system and compiler versions to |
| 33 | run and compile LibreOffice, also used by the TDF builds: |
| 34 | |
| 35 | * Windows: |
| Korrawit Pruegsanusak | beff251 | 2017-10-23 19:37:10 +0700 | [diff] [blame] | 36 | * Runtime: Windows 7 |
| 37 | * Build: Cygwin + Visual Studio 2015 Update 3 |
| Jan-Marek Glogowski | 1079893 | 2017-09-07 12:09:25 +0200 | [diff] [blame] | 38 | * macOS: |
| Korrawit Pruegsanusak | beff251 | 2017-10-23 19:37:10 +0700 | [diff] [blame] | 39 | * Runtime: 10.9 |
| 40 | * Build: 10.12 + Xcode 8 |
| Jan-Marek Glogowski | 1079893 | 2017-09-07 12:09:25 +0200 | [diff] [blame] | 41 | * Linux: |
| Korrawit Pruegsanusak | beff251 | 2017-10-23 19:37:10 +0700 | [diff] [blame] | 42 | * Runtime: RHEL 6 or CentOS 6 |
| 43 | * Build: GCC 4.8.1 or Clang |
| jan Iversen | 79c392a | 2017-10-04 12:07:58 +0200 | [diff] [blame] | 44 | * iOS (only for LibreOfficeKit): |
| Korrawit Pruegsanusak | beff251 | 2017-10-23 19:37:10 +0700 | [diff] [blame] | 45 | * Runtime: 11.0 (only support for newer i devices == 64 bit) |
| jan Iversen | 930efab | 2017-11-13 07:58:43 +0100 | [diff] [blame] | 46 | * Build: Xcode 9.0 and iPhone SDK 11.1 |
| Jan-Marek Glogowski | 1079893 | 2017-09-07 12:09:25 +0200 | [diff] [blame] | 47 | |
| 48 | If you want to use Clang with the LibreOffice compiler plugins, the minimal |
| 49 | version of Clang is 3.4. Since Xcode doesn't provide the compiler plugin |
| 50 | headers, you have to compile your own Clang to use them on macOS. |
| 51 | |
| 52 | You can find the TDF configure switches in the distro-configs/ directory. |
| 53 | |
| 54 | To setup your initial build environment on Windows and macOS, we provide |
| 55 | the LibreOffice Development Environment |
| 56 | ([LODE](https://wiki.documentfoundation.org/Development/lode)) scripts. |
| 57 | |
| 58 | For more information see the build instructions for your platform in the |
| 59 | [TDF wiki](https://wiki.documentfoundation.org/Development). |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 60 | |
| 61 | ## The important bits of code |
| 62 | |
| 63 | Each module should have a `README` file inside it which has some |
| 64 | degree of documentation for that module; patches are most welcome to |
| 65 | improve those. We have those turned into a web page here: |
| 66 | |
| 67 | http://docs.libreoffice.org/ |
| 68 | |
| 69 | However, there are two hundred modules, many of them of only |
| 70 | peripheral interest for a specialist audience. So - where is the |
| 71 | good stuff, the code that is most useful. Here is a quick overview of |
| 72 | the most important ones: |
| 73 | |
| 74 | Module | Description |
| 75 | ----------|------------------------------------------------- |
| 76 | sal/ | this provides a simple System Abstraction Layer |
| 77 | tools/ | this provides basic internal types: 'Rectangle', 'Color' etc. |
| 78 | vcl/ | this is the widget toolkit library and one rendering abstraction |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 79 | 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 |
| 80 | sfx2/ | legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc. |
| 81 | svx/ | drawing model related helper code, including much of Draw/Impress |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 82 | |
| 83 | Then applications |
| 84 | |
| 85 | Module | Description |
| 86 | ----------|------------------------------------------------- |
| 87 | 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] | 88 | sw/ | Writer |
| 89 | sc/ | Calc |
| 90 | sd/ | Draw / Impress |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 91 | |
| 92 | There are several other libraries that are helpful from a graphical perspective: |
| 93 | |
| 94 | Module | Description |
| 95 | ----------|------------------------------------------------- |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 96 | basegfx/ | algorithms and data-types for graphics as used in the canvas |
| 97 | canvas/ | new (UNO) canvas rendering model with various backends |
| 98 | cppcanvas/ | C++ helper classes for using the UNO canvas |
| Michael Stahl | deec9bd | 2015-03-31 14:55:56 +0200 | [diff] [blame] | 99 | 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] | 100 | |
| Mike Kaganski | 646448d | 2017-10-27 15:39:12 +0300 | [diff] [blame] | 101 | ## Rules for #include directives (C/C++) |
| 102 | |
| 103 | Use the `"..."` form if and only if the included file is found next to the |
| 104 | including file. Otherwise, use the `<...>` form. (For further details, see the |
| 105 | mail [Re: C[++]: Normalizing include syntax ("" vs |
| 106 | <>)](https://lists.freedesktop.org/archives/libreoffice/2017-November/078778.html).) |
| 107 | |
| 108 | The UNO API include files should consistently use double quotes, for the |
| 109 | benefit of external users of this API. |
| 110 | |
| Adolfo Jayme Barrientos | 89d825c | 2015-03-22 21:21:57 -0600 | [diff] [blame] | 111 | |
| 112 | ## Finding out more |
| 113 | |
| 114 | Beyond this, you can read the `README` files, send us patches, ask |
| 115 | on the mailing list libreoffice@lists.freedesktop.org (no subscription |
| 116 | required) or poke people on IRC `#libreoffice-dev` on irc.freenode.net - |
| 117 | we're a friendly and generally helpful mob. We know the code can be |
| 118 | hard to get into at first, and so there are no silly questions. |