blob: 1a1dd5d78b170b62ea5da99d403bae04f43b2afe [file] [log] [blame] [view]
Adolfo Jayme Barrientosb9630862015-05-24 19:42:51 -05001# LibreOffice
Adolfo Jayme Barrientos72bb0692019-10-31 09:27:57 -06002[![Coverity Scan Build Status](https://scan.coverity.com/projects/211/badge.svg)](https://scan.coverity.com/projects/211) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/307/badge)](https://bestpractices.coreinfrastructure.org/projects/307) [![Translation status](https://weblate.documentfoundation.org/widgets/libo_ui-master/-/svg-badge.svg)](https://weblate.documentfoundation.org/engage/libo_ui-master/?utm_source=widget)
Adolfo Jayme Barrientosb9630862015-05-24 19:42:51 -05003
David Ostrovsky700f0802015-11-28 09:08:56 +01004LibreOffice is an integrated office suite based on copyleft licenses
5and compatible with most document formats and standards. Libreoffice
6is backed by The Document Foundation, which represents a large
7independent community of enterprises, developers and other volunteers
8moved by the common goal of bringing to the market the best software
9for personal productivity. LibreOffice is open source, and free to
10download, use and distribute.
11
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060012A quick overview of the LibreOffice code structure.
13
14## Overview
15
16You can develop for LibreOffice in one of two ways, one
17recommended and one much less so. First the somewhat less recommended
Michael Stahldeec9bd2015-03-31 14:55:56 +020018way: it is possible to use the SDK to develop an extension,
Ilmari Lauhakangas51cb2e62018-02-09 14:19:29 +020019for which you can read the API docs [here](https://api.libreoffice.org/)
20and [here](https://wiki.openoffice.org/wiki/Documentation/DevGuide).
Michael Stahldeec9bd2015-03-31 14:55:56 +020021This re-uses the (extremely generic) UNO APIs that are also used by
22macro scripting in StarBasic.
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060023
24The best way to add a generally useful feature to LibreOffice
25is to work on the code base however. Overall this way makes it easier
26to compile and build your code, it avoids any arbitrary limitations of
27our scripting APIs, and in general is far more simple and intuitive -
28if you are a reasonably able C++ programmer.
29
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020030## The build chain and runtime baselines
31
32These are the current minimal operating system and compiler versions to
33run and compile LibreOffice, also used by the TDF builds:
34
35* Windows:
Korrawit Pruegsanusakbeff2512017-10-23 19:37:10 +070036 * Runtime: Windows 7
Stephan Bergmannb40039f2019-08-15 09:57:18 +020037 * Build: Cygwin + Visual Studio 2017 version 15.7
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020038* macOS:
Tor Lillqvista7f57d82018-11-23 12:07:40 +020039 * Runtime: 10.10
Stephan Bergmann58904bb2018-11-28 16:30:03 +010040 * Build: 10.13.2 + Xcode 9.3
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020041* Linux:
Christian Lohmaierb1a17c22019-06-05 12:17:14 +020042 * Runtime: RHEL 7 or CentOS 7
Stephan Bergmann65b9c622018-11-24 12:27:37 +010043 * Build: either GCC 7.0.0; or Clang 5.0.2 with libstdc++ 7.3.0
jan Iversen79c392a2017-10-04 12:07:58 +020044* iOS (only for LibreOfficeKit):
Tor Lillqvist6961b752018-06-07 17:15:07 +030045 * Runtime: 11.4 (only support for newer i devices == 64 bit)
46 * Build: Xcode 9.3 and iPhone SDK 11.4
Miklos Vajna77f633a2019-08-26 12:34:53 +020047* Android:
Miklos Vajna7ab680182019-10-28 17:40:51 +010048 * Build: NDK r19c and SDK 22.6.2
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020049
50If you want to use Clang with the LibreOffice compiler plugins, the minimal
Stephan Bergmannf23aa1a2018-11-22 19:57:38 +010051version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020052headers, you have to compile your own Clang to use them on macOS.
53
54You can find the TDF configure switches in the distro-configs/ directory.
55
56To setup your initial build environment on Windows and macOS, we provide
57the LibreOffice Development Environment
58([LODE](https://wiki.documentfoundation.org/Development/lode)) scripts.
59
60For more information see the build instructions for your platform in the
61[TDF wiki](https://wiki.documentfoundation.org/Development).
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060062
63## The important bits of code
64
65Each module should have a `README` file inside it which has some
66degree of documentation for that module; patches are most welcome to
67improve those. We have those turned into a web page here:
68
Ilmari Lauhakangas51cb2e62018-02-09 14:19:29 +020069https://docs.libreoffice.org/
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060070
71However, there are two hundred modules, many of them of only
72peripheral interest for a specialist audience. So - where is the
73good stuff, the code that is most useful. Here is a quick overview of
74the most important ones:
75
76Module | Description
77----------|-------------------------------------------------
78sal/ | this provides a simple System Abstraction Layer
79tools/ | this provides basic internal types: 'Rectangle', 'Color' etc.
80vcl/ | this is the widget toolkit library and one rendering abstraction
Michael Stahldeec9bd2015-03-31 14:55:56 +020081framework | 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
82sfx2/ | legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc.
83svx/ | drawing model related helper code, including much of Draw/Impress
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060084
85Then applications
86
87Module | Description
88----------|-------------------------------------------------
89desktop/ | 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 Stahldeec9bd2015-03-31 14:55:56 +020090sw/ | Writer
91sc/ | Calc
92sd/ | Draw / Impress
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060093
94There are several other libraries that are helpful from a graphical perspective:
95
96Module | Description
97----------|-------------------------------------------------
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060098basegfx/ | algorithms and data-types for graphics as used in the canvas
99canvas/ | new (UNO) canvas rendering model with various backends
100cppcanvas/ | C++ helper classes for using the UNO canvas
Michael Stahldeec9bd2015-03-31 14:55:56 +0200101drawinglayer/ | View code to render drawable objects and break them down into primitives we can render more easily.
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600102
Mike Kaganski646448d2017-10-27 15:39:12 +0300103## Rules for #include directives (C/C++)
104
105Use the `"..."` form if and only if the included file is found next to the
106including file. Otherwise, use the `<...>` form. (For further details, see the
107mail [Re: C[++]: Normalizing include syntax ("" vs
108<>)](https://lists.freedesktop.org/archives/libreoffice/2017-November/078778.html).)
109
110The UNO API include files should consistently use double quotes, for the
111benefit of external users of this API.
112
Stephan Bergmannb0eab4b2018-10-01 09:10:07 +0200113loplugin:includeform (compilerplugins/clang/includeform.cxx) enforces these rules.
114
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600115
116## Finding out more
117
118Beyond this, you can read the `README` files, send us patches, ask
119on the mailing list libreoffice@lists.freedesktop.org (no subscription
120required) or poke people on IRC `#libreoffice-dev` on irc.freenode.net -
121we're a friendly and generally helpful mob. We know the code can be
122hard to get into at first, and so there are no silly questions.