blob: bd1528f321eec175763002a23fd549bd0e493013 [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
Thorsten Behrens8ff280a2020-02-05 10:16:04 +01004<img align="right" width="150" height="200" src="https://opensource.org/files/OSIApproved.png">
5
David Ostrovsky700f0802015-11-28 09:08:56 +01006LibreOffice is an integrated office suite based on copyleft licenses
7and compatible with most document formats and standards. Libreoffice
8is backed by The Document Foundation, which represents a large
9independent community of enterprises, developers and other volunteers
10moved by the common goal of bringing to the market the best software
11for personal productivity. LibreOffice is open source, and free to
12download, use and distribute.
13
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060014A quick overview of the LibreOffice code structure.
15
16## Overview
17
18You can develop for LibreOffice in one of two ways, one
19recommended and one much less so. First the somewhat less recommended
Michael Stahldeec9bd2015-03-31 14:55:56 +020020way: it is possible to use the SDK to develop an extension,
Hossein622b92d2022-04-15 12:46:24 +020021for which you can read the [API docs](https://api.libreoffice.org/)
22and [Developers Guide](https://wiki.documentfoundation.org/Documentation/DevGuide).
Michael Stahldeec9bd2015-03-31 14:55:56 +020023This re-uses the (extremely generic) UNO APIs that are also used by
24macro scripting in StarBasic.
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060025
26The best way to add a generally useful feature to LibreOffice
27is to work on the code base however. Overall this way makes it easier
28to compile and build your code, it avoids any arbitrary limitations of
29our scripting APIs, and in general is far more simple and intuitive -
30if you are a reasonably able C++ programmer.
31
Hosseinea5641b2021-03-29 21:55:26 +043032## The Build Chain and Runtime Baselines
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020033
34These are the current minimal operating system and compiler versions to
35run and compile LibreOffice, also used by the TDF builds:
36
37* Windows:
Korrawit Pruegsanusakbeff2512017-10-23 19:37:10 +070038 * Runtime: Windows 7
Hossein7fe75652022-04-24 12:04:33 +020039 * Build: Cygwin + Visual Studio 2019 version 16.10
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020040* macOS:
Ilmari Lauhakangas0c965612022-06-14 11:22:13 +030041 * Runtime: 10.14
Stephan Bergmann3469f692022-01-13 16:54:33 +010042 * Build: 11.0 + Xcode 12.5
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020043* Linux:
Christian Lohmaierb1a17c22019-06-05 12:17:14 +020044 * Runtime: RHEL 7 or CentOS 7
Stephan Bergmannfe604312022-02-16 17:16:55 +010045 * Build: either GCC 7.0.0; or Clang 8.0.1 with libstdc++ 7.3.0
jan Iversen79c392a2017-10-04 12:07:58 +020046* iOS (only for LibreOfficeKit):
Tor Lillqvist6961b752018-06-07 17:15:07 +030047 * Runtime: 11.4 (only support for newer i devices == 64 bit)
48 * Build: Xcode 9.3 and iPhone SDK 11.4
Miklos Vajna77f633a2019-08-26 12:34:53 +020049* Android:
Miklos Vajna7ab680182019-10-28 17:40:51 +010050 * Build: NDK r19c and SDK 22.6.2
Jan-Marek Glogowski8a417392021-04-23 13:45:05 +020051* Emscripten / WASM:
52 * Runtime: a browser with SharedMemory support (threads + atomics)
53 * Build: Qt 5.15 with Qt supported Emscripten 1.39.8
Hossein622b92d2022-04-15 12:46:24 +020054 * See [README.wasm](static/README.wasm.md)
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020055
Hosseind0e50ba2022-06-09 15:48:11 +020056Java is required for building many parts of LibreOffice. In TDF Wiki article
57[Development/Java](https://wiki.documentfoundation.org/Development/Java), the
58exact modules that depend on Java are listed.
59
60The baseline for Java is Java Development Kit (JDK) Version 11 or later. It is
61possible to build LibreOffice with JDK version 9, but it is no longer supported
62by the JDK vendors, thus it should be avoided.
63
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020064If you want to use Clang with the LibreOffice compiler plugins, the minimal
Stephan Bergmannd1a2b802022-02-15 15:03:24 +010065version of Clang is 12.0.1. Since Xcode doesn't provide the compiler plugin
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020066headers, you have to compile your own Clang to use them on macOS.
67
Hossein628c1c32021-04-12 22:29:51 +043068You can find the TDF configure switches in the `distro-configs/` directory.
Jan-Marek Glogowski10798932017-09-07 12:09:25 +020069
70To setup your initial build environment on Windows and macOS, we provide
71the LibreOffice Development Environment
72([LODE](https://wiki.documentfoundation.org/Development/lode)) scripts.
73
74For more information see the build instructions for your platform in the
Hosseind0e50ba2022-06-09 15:48:11 +020075[TDF wiki](https://wiki.documentfoundation.org/Development/How_to_build).
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060076
Hosseinea5641b2021-03-29 21:55:26 +043077## The Important Bits of Code
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060078
Hosseinea5641b2021-03-29 21:55:26 +043079Each module should have a `README.md` file inside it which has some
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060080degree of documentation for that module; patches are most welcome to
81improve those. We have those turned into a web page here:
82
Hosseinea5641b2021-03-29 21:55:26 +043083<https://docs.libreoffice.org/>
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060084
85However, there are two hundred modules, many of them of only
86peripheral interest for a specialist audience. So - where is the
87good stuff, the code that is most useful. Here is a quick overview of
88the most important ones:
89
90Module | Description
91----------|-------------------------------------------------
Hosseinea5641b2021-03-29 21:55:26 +043092[sal/](sal) | this provides a simple System Abstraction Layer
93[tools/](tools) | this provides basic internal types: `Rectangle`, `Color` etc.
94[vcl/](vcl) | this is the widget toolkit library and one rendering abstraction
95[framework/](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
96[sfx2/](sfx2) | legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc.
97[svx/](svx) | drawing model related helper code, including much of Draw/Impress
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -060098
99Then applications
100
101Module | Description
102----------|-------------------------------------------------
Hosseinea5641b2021-03-29 21:55:26 +0430103[desktop/](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
104[sw/](sw/) | Writer
105[sc/](sc/) | Calc
106[sd/](sd/) | Draw / Impress
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600107
108There are several other libraries that are helpful from a graphical perspective:
109
110Module | Description
111----------|-------------------------------------------------
Hosseinea5641b2021-03-29 21:55:26 +0430112[basegfx/](basegfx) | algorithms and data-types for graphics as used in the canvas
113[canvas/](canvas) | new (UNO) canvas rendering model with various backends
114[cppcanvas/](cppcanvas) | C++ helper classes for using the UNO canvas
115[drawinglayer/](drawinglayer) | 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 -0600116
Hosseinea5641b2021-03-29 21:55:26 +0430117## Rules for #include Directives (C/C++)
Mike Kaganski646448d2017-10-27 15:39:12 +0300118
119Use the `"..."` form if and only if the included file is found next to the
120including file. Otherwise, use the `<...>` form. (For further details, see the
121mail [Re: C[++]: Normalizing include syntax ("" vs
122<>)](https://lists.freedesktop.org/archives/libreoffice/2017-November/078778.html).)
123
124The UNO API include files should consistently use double quotes, for the
125benefit of external users of this API.
126
Hosseinea5641b2021-03-29 21:55:26 +0430127`loplugin:includeform (compilerplugins/clang/includeform.cxx)` enforces these rules.
Stephan Bergmannb0eab4b2018-10-01 09:10:07 +0200128
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600129
Hosseinea5641b2021-03-29 21:55:26 +0430130## Finding Out More
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600131
Hosseinea5641b2021-03-29 21:55:26 +0430132Beyond this, you can read the `README.md` files, send us patches, ask
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600133on the mailing list libreoffice@lists.freedesktop.org (no subscription
Christian Lohmaieref0d1502021-06-02 15:57:31 +0200134required) or poke people on IRC `#libreoffice-dev` on irc.libera.chat -
Adolfo Jayme Barrientos89d825c2015-03-22 21:21:57 -0600135we're a friendly and generally helpful mob. We know the code can be
136hard to get into at first, and so there are no silly questions.