 Welcome, ladies and gentlemen. I hope you enjoyed the lunch. It would be much worse to have a talk before lunch. And so let's talk about LibreOffice on KDE Plasma. This is my vanity slide. Yes, I'm my nickname. My nickname is Bubli. I'm a LibreOffice developer, and I'm one of the people who brought LibreOffice on KDE Plasma to you. Of course, like no way I did, or I would be able to do all of this alone, and all those guys and girls worked on the project as well. They contributed the code. They tested, reported, triaged bugs, and actually very little of what I'm going to talk about today would be possible without them. Unfortunately, I don't think any of them is here, but some of them have their co-workers around. I see you, Tobias. So let's give them some small round of applause. Before we start, thank you. Okay, LibreOffice on KDE Plasma. Is there anybody in this room who doesn't know what LibreOffice is? Never heard of. Everybody sort of knows. So yeah, just to reiterate, it's the best free and open source office suite out there. I'm sorry Caligra, and I'm sorry Apache OpenOffice, but that's just how it is. The Document Foundation is a non-profit entity. It's a bit like KDE Foundation, and it's the entity behind LibreOffice. I would also like to bring this the sister project of LibreOffice, which is a document liberation project. It is a set of import filters and reverse engineering tools to import documents from various ancient binary proprietary formats and convert them to open formats. But it's a bit tangential to the rest of the talk. I just wanted you people to know that this project exists. Okay, I like telling stories, so this is a brief history of LibreOffice on one slide. It all started in 1984. Some of you have not been alive by the time yet. With BroDude, whose name was Marco Beriz, he created a word processor, a text processor for 8-bit computers, and in the course of time he built the entire company around this word processor and later added the spreadsheet processor and the presentation tool, and the company's name was Star Division, and Star Division got acquired by Sun Microsystems in 1999. Allegedly, it was for Sun, it was cheaper to buy the entire company than to buy Microsoft Office licenses for everybody. But I think it's just an urban legend. So as Star Division got acquired by Sun, the project got renamed to OpenOffice, and its first version got released in 2002, and then the second version and the third version, and then in 2009, or Sun was acquired by Oracle and two years later. What happened is that Oracle discontinued support for OpenOffice and laid off all the employees that were working on the OpenOffice. But even before this happened, some smaller group of OpenOffice developers decided to somehow do away with what they perceived as some sort of authoritative, let's say, dictatorship of Oracle and decided to do things their own way. So they forked the project and named it LibreOffice, and two years after that, finally the non-profit foundation supporting LibreOffice and its development got established. As you perhaps know, LibreOffice is a multi-platform software. What does it mean that it simply runs or is better or worse integrated into different operating systems? And which operating systems are those so officially supported by document and released by document foundation is Windows, Mac OS X and Linux. So if you had had to LibreOffice or or document foundation or those binaries are the ones for those operating systems are the ones that you can download from from the official page. Then there are, of course, like multiple Linux distribution that add bit their own sugarcoating or remove the stuff they don't like upstream. And this is what you what you can, what is shipped with your favorite Linux distribution probably. And then there is some small set of non-official meaning like not officially endorsed and supported by document foundation distributions mostly based on some Unix-like operating system like, for example, FreeBSD or Haiku. So, yeah, now I would like to move the focus to the Linux operating system. If it was like this, it would be there would be just one front-end to rule them all. That would be, of course, perfect, but Linux is all about choice, isn't it? So, on Linux you can actually pick up three different flavors of like how the front-end looks like and how well is it integrated into the desktop. The first and the oldest one of them is the generic X11 front-end. It's pretty ugly. It looks like Windows 95 and it's desktop integration sucks a big deal. Then there is integration with GNOME desktop environment based on GTK. I actually thought that this GNOME front-end is a bit older than the KDE one, but I checked GitLux this morning and they are about the same age. So, it started in 2004. It was started by Michael Meeks and in 2011 it got ported to GTK3 and brought to perfection by Quailin McNamara. About the same age, the KDE or Qt, well, it was not Qt based yet. KDE front-end was born in the same company. It was SUSE and the KDE3 based front-end was started by Jan Holaszewski and five years later it was ported to KDE4. But it was actually how to say that. So, I had this talk once or twice and whenever I started to talk about like KDE4 was not really a KDE4, but it was just some wrapper around X11. People got pretty bored. So, I'm not going to talk about that in detail, but fast-forward eight years later in 2017, two years ago, two things happened. Million Wolf created KDE-KF Plasma File Picker. It was some, I will talk about it a bit later. So, the front-end, the user interface was still GTK3 based, but as a Plasma File Picker was run over this GTK3 front-end as a separate binary. And later in 2017, first Qt 5 based proof of concept of the entirely new interface for the LibreOffice was created by Jan Marag Logowski. So, as I said, LibreOffice is a multi-platform software. So, if you want to write LibreOffice code, does it mean that well, it exists? Like, do you have to write the GTK code and at the same time a Windows API code? And if you want to write for, if you wanted to work on Mac, do you have to write Quartz code? Does the multi-platform code look like this? Well, sometimes it does, but not too often. Well, the answer is no and no. So, we have some sort of interfaces. So, on the left, there is some sort of like core library, which is like some core functionality. Do something, for example, open a dialog and set its size or open a file picker and do it in such a way that only text files will be shown. So, this is a generic functionality and it's some sort of contract between the core library and the front-end library. This will be the core, will be implemented in some generic C++ code and the front-end in some some platform-specific code. So, to open a dialog, we create a new queued dialog and then we resize it. To open a file picker, we create queued-based file picker and then we set its filter. And similarly, if you want to copy text to clipboard, we can write some generic C++ code doing that in the core and then re-implement the same functionality in using the appropriate API of queued library. So, this is some kind of like once again, like more or less the same, some kind of diagram, how it really works. I named this woman up there, cell instance, because the class actually implementing this is called cell instance and if I'm talking about some platform-dependent functionality, what exactly do I mean by that? So, I divided this functionality into the two categories, basic and extended, basic functionality that's, yeah, well, just like the basic stuff. So, create the windows, connect them to the window manager, make them look like natives. So, make LibreOffice look like any other KDE application, add some native menus to that, add some, like, make file and folder pickers behave and look like any other folder pickers on KDE platform and then comes the extended functionality. So, everything else beyond basics. So, users want to copy paste text or images. They want to drag file from file manager to the office application. They want to, just like I do right now, they want to present stuff on the whole screen and LibreOffice, just like, for example, Firefox, has, comes with some set of extensions. So, those are some extra modules you can install on top that come with some extra functionality that is not in core and one of the most famous LibreOffice extensions is Walmux, which is some sort of advanced template manager. Yes, and when you present, you of course want to sometimes embed videos and animated gifs and various media content into your slides. So, yeah, that looks like quite a lot of work, right? So, yeah, that was, I looked approximately like this when I realized how much work that's gonna be. We can do it and with it. Okay, how did we make this happen? So, the first step, the thing I did not want to talk about, KDE for LibreOffice integration, the windows you saw on the screen were not native windows, those were X11 windows and the events that were being processed were not native Q events, but those were X11 events. So, if we wanted to, like, transition between KDE 4, KDE 5, if we wanted to port this to Qt 5, it was not possible because Qt library put accessing all the X11 functionality directly to an end. So, we had to, it was obsolete in Qt 5 and we had to write it a new. So, the very first step was to do away with X11 windows and replace those with native Q windows or Q widgets. And what do we need to do with those windows? Of course, like, they need to be opened and closed. Optionally also, like, with this kind of annoying nagging dialogue, if you want to close the window, oh, you have unsafe changes, don't forget to save them. It would be also nice to be able to maximize and minimize window and set their size and also remember their size to be able to restore it later and over the main window, we can open, we can open dialogues which can be modal, like, for example, printing dialogue, which means the window underneath is blocked as long as this dialogue is open or they can be more less. For example, spell checkers. So, while I checked what's the current spelling gonna be, I can still interact with the underlying window. But not all windows are created equal. Yes, like, there are those trivial cases, the main window, the dialogue, but there are also tool windows. I guess I will, I hope I will, for example, this is a tool window, some kind of dockable thing. So, I want to be able to to dock it and undock it and similarly, I can undock the toolbar. I want to be able to dock it again. So, the next step, since we now have the windows are native and that means that nice bonus of that is that they receive queue events. So, what we simply do is that we map those queue events that come our way to the LibreOffice events and process them the LibreOffice way. Yes, and then like those pie events, I mean like keyboard presses and mouse clicks, but since not all events are user-driven, we have also some additional events dispatcher for, for, I don't know, like as you import the file, the progress bar moves, or the extensions come with their own set of events. And yes, so now we can open the windows, we can resize them, do things with them, we can process the events, and it's time to put some content into the windows. So, the way this is done is that, as I said, this is a queue main window. It has a central widget, and there is one giant central widget, which is a custom widget. And yes, and then we paint. We take a queue painter and queue style option to style the widgets in the native way and to create, to create the queue images here, for example, we have an ex, we have a button and then we simply paste the bitmap onto the custom widget and like, it's like some sort of patchwork. Like we, we compose the final bitmap in the window from, from the queue images made of like all those individual widgets. And of course, like having native windows comes with some, some nice side effects. So, for example, we can now support the native menus. So, and the nice bonus of that is that we have the integration with the global menu for free. The only thing we need to do is to map LibreOffice menu structure to Qt menu structure. And also the native tooltips are now possible. Before it was sort of misery to resize and position the tooltip correctly. We don't have to do that anymore because the Qt will do it for us now. So, here's some nice screenshot of the global menu. And while we are aware at improving look and feel, we, for example, something that we're proud of, we improve the look and feel of this, of this notebook bar. This looks like Windows 95 and this is how the native tab bar looks like. I will, I will simply quickly, quickly jump through the, because I don't have that much time left over the file breaker functionality. As I said, there was some initial work done by MillionWolf. That was a separate binary that communicated with the Core LibreOffice over, over standard in and standard out. It was a bit of a hack, but it was pretty easy to, to port it to the new code. And yeah, basically like the same principle, some like generic codes where the programmer says open a file picker and some platform-specific code that actually opens the file picker and does things with it. Things like, there are some slight differences between when you open the file or whether you want to save into the file and then you have to retrieve the URL you want to save into or you want to open switch to folders, set the filter, like what kind of, what type of files you want to see. And also, it would be nice to have some access to files on the remote shares. And since there are some things that come only with LibreOffice, like for example, there's another thing I'm personally proud of because I worked on that you can encrypt and sign the file with GPG key. So there's this nice checkbox up there where you can, upon saving the file, you can pick, check the checkbox and it will get encrypted with your GPG key. And for those with need those custom controls, those checkboxes or listboxes, and we want to be able to get and set their value. Okay, so once this is done, we can put our feet up and relax, right? Unfortunately, no, only when we, like when we got the code into this shape and then users started to report bugs and we discovered all those things that users do with their office suite. So for example, they copy and paste and they drag and drop and they use extensions and they create slideshows and it was pretty overwhelming. So yes, like I don't know, like I don't have that much time left, like to go into much, much detail that like we had to implement copy and paste. This is again like the same generic scheme, like there's some interface, the generic that like gets the content or puts the stuff into Clipboard or it's from Clipboard in a generic way in the core. And here it is reimplemented in terms of Qt API. And what's also a bit interesting is this special case, special sort of selection Clipboard on X11. So it's not like control C, control V, but like putting the stuff that's selected, that's highlighted by mouse up there into the Clipboard and for that we needed to implement some sort of lazy handling or lazy loading, which means which means not putting the data into Clipboard immediately, but only like put it there when it's available and when somebody else wants to read. More or less the same with the with drag and drop, like this internal drag and drop within one application, but also from outside, from other text editor or from file manager. And this was also quite interesting problem with the extensions. The extensions do all kinds of things, they open their own dialogues, they open another window, they execute commands and they can even add their own user interface elements. And unfortunately sometimes the extensions run in a different thread. And this presents a little bit of a problem because everything that happens in user interface in Qt has to be run in domain thread and if it isn't, all kinds of weird things happen like crashes and deadlocks. So we somehow had to to trim this interface or to get it into shape that every single user interface access happens in the main thread. Yes, and then there was like 10,000 paper cuts, lots of rendering glitches, bad access to system fonts, users that don't type with the Latin scripts like Chinese, Japanese, Korean, need support for input methods. Of course it would be nice to have the interface accessible and it is. Yes, at the end of the day there was the slide show. I have to admit that Impress was the thing we tested the least because what you usually do, you put some data into spreadsheet or you type some text in the text editor and you don't present stuff on dual screen every day, right? So we didn't really test it this and we didn't really think about those corner cases. So if you run the slide show in LibreOffice Impress, you have like two windows on two different screens. Sometimes they are the same, sometimes they aren't because you have a special presenter console. Sometimes the slides can have some multimedia content, embedded videos or as you have seen those animated GIFs. So those are handled as embedded Qt windows. And we also had to add some elementary support for OpenGL because sometimes the transitions between the slides can be implemented with OpenGL. So yeah, maybe you now think this is great. Can I try? Where can I get this nice stuff? It's all in LibreOffice Master so you can build it yourself, of course, but you don't have to. If you want the latest and greatest, you can download the Daily Builds from LibreOffice.org or you have it shipped with your Linux distribution. The first version that has this is LibreOffice 6.2, which is stable by now. It has been released in February this year. And every major Linux distribution adopted it. You just have to install an extra package, which is called KDE integration. And of course, by transitivity LibreOffice 6.3, has it as well, has been released earlier this month. And I have to say by now this stuff is relatively bug-free. So there are not many open bugs and if there are some corner cases. And with this, I'm at the very end of my talk. So if there are any questions or comments or offers of beer or criticism, I'm all ears. Offer that beer. How is the network access stuff going to work? Are you working on KIO integration for LibreOffice or how is that? Not yet, but it's planned like it doesn't work with KIO. We simply enable the URL startings with WebDAV or SMB or like those things. There is an integration with GIO, but KIO, that's a missing feature. Okay, thank you. It's planned. I think there was some GSOC project like announced for the next year. Like it's one of the possible GSOC projects to pick. More questions, way back there. So this Qt integration, could that also be used on non-unix platforms? Like Windows and Mac. Yes, people tried to build it on Windows and it compiles. But certainly it's not in the state, it compiles ship it. Other questions? Yes. Maybe you didn't even consider it, but how about the Wayland support? Does it work? It should, but at the moment it doesn't. There is some crash because of, yes, some corner case. And it's reported as a bug against one of the Qt Wayland, I don't know, libraries. And I predict an app image question from over here. You just wait. Well, not app image, but I was going to ask if there is any consideration to create a mobile version of LibreOffice. And if there is, if you are considering using Qticami for it. App image. I don't know what that is. I'm sorry. If you are considering making a mobile version. What version? A mobile version. Mobile version. Oh, yes, there is LibreOffice for Android. And that's some separate application. And there is even some integration for the iOS. But I think, I'm not involved in this, but I think the plan is more like if you want LibreOffice on mobile. There is LibreOffice online. Rather go that way, like somehow force this LibreOffice online onto the mobile platform because it's less work. So my prediction was terrible, I guess. I think to answer the first question that came along, as far as I understand LibreOffice now uses the KDE file dialogs. Yes. And so such that, at that point, my project that I worked on carrier fuse, it would be converted to a local URL. Yes, that would be, that would be like, really. And so that will kind of solve the carrier issue. We had problems with this, with writing onto WebDAV because LibreOffice is this kind of K unique application. Is that a thing? That's the correct word. So we had trouble with writing on WebDAV and we were looking into ways how to fix this problem and I was particularly looking at this KIO fuse. But it was, it was like two years ago and it was in the pretty bad shape. It's better now, sir. Woohoo! We got time for one more, if someone wants to ask a question. And otherwise, I will tell everyone. I forgot to show. Yeah. If there are no other questions, I'd like to thank Katarina again.