Calligra, me and you
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Alternative Title |
| |
Title of Series | ||
Number of Parts | 64 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/45915 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
FOSDEM 201134 / 64
3
7
10
11
17
19
21
28
33
34
35
37
40
44
48
49
52
55
57
59
62
63
64
00:00
Suite (music)Web 2.0Cartesian coordinate systemSoftware development kitSoftware developerForm (programming)CodeInternet service providerComponent-based software engineeringFunctional (mathematics)Tablet computerProduct (business)Office suiteComputer architectureCommunications protocolProjective planeSoftwareSoftware maintenanceSet (mathematics)BitQuicksortSoftware suiteFlow separationTextsystemDivisorSoftware testingContrast (vision)Presentation of a groupInformation managementMorley's categoricity theoremWeightComputer animationXML
03:14
Scripting languageWeb pageOffice suiteExistenceFreewareSoftwareEinbettung <Mathematik>TextsystemCartesian coordinate systemEmailNetwork topologyOcean currentStability theoryComputer animation
04:30
WordLevel (video gaming)DataflowTable (information)Mobile WebSpeech synthesisPresentation of a groupProjective planeProcess (computing)Mobile WebDataflowDiagramQueue (abstract data type)Cartesian coordinate systemGroup actionTable (information)Computing platformOffice suiteStress (mechanics)TouchscreenWorkstation <Musikinstrument>UsabilityLevel (video gaming)PlanningMultiplication signCore dumpWordSoftware maintenanceSlide ruleSoftware developerDatabaseComputer animation
06:02
TouchscreenCodeCartesian coordinate systemPressureWeb pageTrailElectronic mailing listAreaTable (information)MereologyPresentation of a groupDifferent (Kate Ryan album)Object (grammar)Stress (mechanics)Mobile WebProcess (computing)Instance (computer science)Office suiteUniform resource locatorComputer architectureEscape characterEinbettung <Mathematik>Plug-in (computing)Slide ruleDivisorSpreadsheetSet (mathematics)Flow separationInteractive televisionWordRaster graphicsEmailOrdinary differential equationMilitary baseTextsystemComputer animation
09:03
AbstractionComputer networkPlug-in (computing)Graphical user interfaceComputing platformScripting languageMobile WebUser profileCartesian coordinate systemInsertion lossBasis <Mathematik>Library (computing)Computer configurationComplete metric spaceMobile appTrailComponent-based software engineeringInstance (computer science)Computing platformInstallation artLetterpress printingLie groupDifferent (Kate Ryan album)Profil (magazine)Ocean currentAbstractionRegular graphCASE <Informatik>Reading (process)ArmPerturbation theoryMereologyGraph (mathematics)Translation (relic)QuicksortComputer architectureDampingGame theoryUser interfaceGroup actionFunctional (mathematics)Office suiteSound effectSet (mathematics)Table (information)DivisorSpacetimeScripting languageSelf-organizationStandard deviationForceFormal languageSource codeMobile WebFlow separationZustandsgrößeMedical imagingStress (mechanics)StatisticsFingerprintLimit (category theory)State of matterLine (geometry)File viewerForm (programming)NumberThread (computing)Process (computing)Lipschitz-StetigkeitTouch typingWindowType theoryDistribution (mathematics)PlastikkarteBitJava appletRaster graphicsCodeSinc functionInternationalization and localizationIntegrated development environmentRight anglePlug-in (computing)Computer animation
15:06
Mobile appModule (mathematics)Cartesian coordinate systemLibrary (computing)Office suiteSolid geometryGraph (mathematics)SpreadsheetMereologyQueue (abstract data type)Pattern recognitionCore dumpFood energyMarginal distributionSoftwareIndependence (probability theory)
15:55
Library (computing)Open setObject (grammar)Computer iconComputing platformCodeBitMedical imagingPlug-in (computing)Library (computing)Graph coloringCodeShape (magazine)Open setTable (information)Repository (publishing)File formatServer (computing)Computer configurationPixelWritingComponent-based software engineeringProjective planeCartesian coordinate systemTransformation (genetics)Color managementTwitterFilter <Stochastik>10 (number)AbstractionLine (geometry)MereologyObject (grammar)User interfaceData conversionMobile appWeb pagePresentation of a groupCanadian Mathematical SocietySpreadsheetGraphical user interfaceStructural loadSoftware testingScripting languageForm (programming)Directory serviceGroup actionGoodness of fitTraffic reportingGame theorySet (mathematics)Latent heatNetwork topologyCore dumpState of matterOffice suiteReal numberVideo gameExpert systemImplementationSystem callCharge carrierAngleIRIS-TGraphics tabletBit rateWindowDesign by contractTheory of relativityPower (physics)Carry (arithmetic)Independence (probability theory)Equaliser (mathematics)Game controllerForcing (mathematics)Metropolitan area networkStatisticsComputer animation
21:07
ImplementationDigital filteroutputStylus (computing)Data managementFactory (trading post)Cartesian coordinate systemTrailContent (media)Instance (computer science)MereologyCuboidShape (magazine)DivisoroutputType theoryLevel (video gaming)Computer fileFunctional (mathematics)Parameter (computer programming)Open setRight anglePhysical systemDefault (computer science)Chaos (cosmogony)ChainRevision controlSelectivity (electronic)Filter <Stochastik>Function (mathematics)Musical ensembleUser interfaceArithmetic progressionComputer configurationStructural loadAbstractionFile formatOffice suiteFile systemBitCodeImplementationData conversionEvent horizonOrder (biology)GUI widgetTablet computerGroup actionMassCellular automatonShared memoryFilm editingDirection (geometry)Theory of relativityCore dumpReplication (computing)Drag (physics)Multiplication signHamiltonian (quantum mechanics)SpacetimeHand fanStatisticsCheat <Computerspiel>Crash (computing)Mobile appData storage deviceDecision theoryTouchscreenOperator (mathematics)MathematicsComputer animation
27:26
Limit (category theory)WindowSoftware developerSoftware testingPower (physics)LaptopCartesian coordinate systemRow (database)Compilation albumRight angleComputer animation
28:27
Table (information)MereologyLevel (video gaming)WordComputer configurationCentralizer and normalizerForcing (mathematics)Inheritance (object-oriented programming)Office suiteCartesian coordinate systemArithmetic meanScaling (geometry)AreaMappingDifferenz <Mathematik>Order (biology)WindowRootMusical ensembleCuboidGroup actionMereologyFreewareBoss CorporationBlogWeb 2.0DialectMathematicsMultiplication signBlock (periodic table)WritingBitLevel (video gaming)Point (geometry)Software developerType theoryNichtlineares GleichungssystemUser interfacePhysical systemMobile appOscillationPlug-in (computing)Hacker (term)Direction (geometry)Einbettung <Mathematik>SimulationTable (information)Touch typingGUI widgetMilitary baseComponent-based software engineeringLibrary (computing)View (database)Web browserEndliche ModelltheoriePresentation of a groupControl systemCode2 (number)AbstractionStrategy gameComputer animation
34:34
MereologyLevel (video gaming)WordPiDigital filterUser interfaceView (database)Open setEinbettung <Mathematik>Software testingCartesian coordinate systemKinematicsTable (information)Zoom lensCategory of beingPhysical systemSocial classGraphical user interfaceUser interfaceInstance (computer science)MereologyComputer fileGame controllerSet (mathematics)Event horizonComputing platformPlug-in (computing)Personal area networkText editorNumerical integrationImplementationHard disk driveSoftwareUniform resource locatorMoment (mathematics)Structural loadMobile WebPresentation of a groupComponent-based software engineeringTablet computerDivisorVariety (linguistics)GUI widgetNetbookWindowMathematicsBounded variationLimit (category theory)View (database)Type theoryFunctional (mathematics)BitGroup actionElectronic mailing listPower (physics)UsabilityLaptopWebsiteWater vaporOffice suiteFreewareProcess (computing)Picture archiving and communication systemReplication (computing)Information securityMatching (graph theory)CASE <Informatik>QuicksortQueue (abstract data type)Computer iconLoginComputer animation
41:26
User interfaceOffice suite10 (number)Mobile appCartesian coordinate systemMenu (computing)Computer animation
42:44
Graphical user interfaceCapability Maturity ModelDigital filterGoodness of fitINTEGRALProgramming paradigmScherbeanspruchungDecision theoryTable (information)Multiplication signLattice (order)Graph coloringCartesian coordinate systemComponent-based software engineeringDifferent (Kate Ryan album)Level (video gaming)Decision tree learningFilter <Stochastik>SurfacePresentation of a groupBinary codeForm (programming)Power (physics)Queue (abstract data type)Point (geometry)Projective planeUser interfaceOffice suiteHacker (term)SummierbarkeitImplementationData conversionWeb 2.0File formatWritingGoogolUser interfaceAuthorizationBinary fileCodeDampingWindowSoftware maintenanceView (database)Type theoryComputer animation
47:18
XML
Transcript: English(auto-generated)
00:07
Yes, that sounds like my microphone is working. Welcome to this last main track talk. I am going to speak about Kalegra, and I was asked to make this talk as technical as possible, so you will see C++ code on these slides.
00:23
Let me first introduce Kalegra. The name Kalegra might be rather new to you, because it's a new name, but it's a name for a project that's already quite old. It started over ten years ago under the name of K-Office. Kalegra is an application suite that comprises both productivity applications
00:42
as well as creativity applications. That's how I came in. I'm not one of the maintainers of the productivity applications. I maintain the painting application, Krita, which is just one of the many applications in this suite. Kalegra is being developed by 30 to 70 people.
01:03
It depends a bit on how you count, who you count. Additionally, several companies are interested in the development of this software. My own company, KOGMBH, was founded by me, by another guy from the K-Office community,
01:21
and some other people. Nokia is interested, Nokia is using Kalegra in their mobile devices to provide office document functionality. And there are other companies around the world that use Kalegra. There's a Vietnamese company I've heard about because they joined us on IRC and asked a couple of questions, and they are doing something tablet related,
01:44
but we are not exactly allowed to know what. There's a German company which uses the word processor inside a medical protocol application. Doctors walking around in a hospital and taking notes on their patient
02:01
forms using Kalegra. There's a company in London which integrates its center financial application. The thing is, and this is what Kalegra can do for you, if you are developing software that needs office document compatibility, editing and viewing, then embedding Kalegra as a component can give you a head start.
02:23
In our community we often say what we are aiming for is not just a set of really cool desktop applications. That's one thing we are doing. We are making desktop applications there quite cool. We are also trying to sort of become the web kit in the office document arena,
02:40
where if you have an office document and you want to do something with it in your application, on your device, your form factor, you can just use this component and go. And that's what I'm going to show in this presentation. First I will give you a short overview of the architecture of Kalegra and then we will
03:04
look at different ways to embed a Kalegra component in your application. So some history to start with because it's often said that we are often asked,
03:24
why are you working on yet another office software application? There are others and there are already three. I think the very first three office applications was the Andrew Suite by the Carnegie Mellon Institute. It's on the top left.
03:44
I'd actually supported embedding pictures, tables, embedded email, was quite cool but as software goes, it was really really hard to use. Then we had something called C-AG Office with a word processor called Pathetic Writer
04:02
and that software, it sort of petered out. Those applications were already in existence when around 1997, 1996, people inside the KDE community started thinking about creating a full featured free office solution.
04:26
A couple of years later, open office was freed. What do we have in Kalegra? The screenshot you see is really cool. That is the office application running on an N900 mobile phone.
04:42
Nokia would like me to call it a mobile computing platform. It supports presentations, spreadsheets, word processing documents you can edit. It's got all kinds of fun features like being able to use your phone while giving a presentation and shaking it and then you will go to the next slide.
05:02
I didn't dare do that here. The other applications in Kalegra are Word Stage and Tables. Those are word processing, presentation. I'm using Stage here to give my presentation and it hasn't crashed yet. Tables, spreadsheet, plan, it's a project planner.
05:23
Flow, a diagramming application which has been dead for a long time. When we moved from KDE 3 to KDE 4, from KFS 1 to 2, a couple of applications really fell by the wayside. The maintainer was too busy, no development done anymore.
05:42
But these days we've got a new guy working on Flow. He's from Beijing and he will join us at our next Kalegra developer sprint. So there's a really good chance that this application will be back in the next release. And then Skeksi, it's a database application. It's kind of like Microsoft Access but cool.
06:03
So what's the basic architecture of a Kalegra application? I'm going to use this screenshot of our factor art application, Carmen, to show you the basics as they are shown to the user on the desktop. We've got a canvas. The big difference between applications in Kalegra are not the individual code bases
06:24
because we share a lot of code. All the objects you see on screen are small, fine-grained objects implemented in plugins that every application can use. This factor graphic, you can embed it in a Word document, you can embed it in your
06:41
presentation, you can embed it in your spreadsheet, you can embed it in your raster graphics art in Krita. The difference between these applications is the canvas. So for instance, a word processing application has this long, long, long, long list of pages
07:01
and every page has text and a header and a footer. On the canvas it's shown as a long list. A presentation is slides so you have lots of different slides and they are all shown separately. A spreadsheet has got sheets, possibly infinite in size, although that's not really practical
07:21
at the moment, and those sheets can be stacked as well. Those are the real big differences between the canvases and so between the applications. Manipulation in Kalegra, we have tried, and this is one area where we are still looking for the really, really correct user interaction design, but we've tried to make
07:44
it similar for all applications. You've got your canvas, you have a bunch of tools with which you manipulate the objects on your canvas, and then you've got a list of panels that show you the current settings of your tools and of your objects.
08:02
Finally, all Kalegra applications are still K parts. The K parts technology is close to what LibreOffice has, as you know, what Microsoft Office has as ODE and deading. What it used to be was we embed a whole application canvas inside the canvas of another
08:23
document. Everyone will probably have seen this screenshot of a Microsoft Word document with a Microsoft Excel document embedded as a table. That principle we've dropped, so you do not embed whole documents in documents anymore.
08:42
That does not mean that the K part embedding technology has been lost. Every document is a K part, so you can embed your canvas as a K part in another application, and we will discuss that some more later on.
09:07
So what is Kalegra based on? Kalegra, as an application, is not written from scratch using just C++ and standard library. Because we are using, as our foundation, some great platforms, we were able to reach
09:25
the current state of functionality with all these applications included in under one million lines of C++, and I'm quite sure we can even get rid of a number of those as well, because if your application is ten years old, you are going to have some cruft.
09:42
So what are we using Qt for? Qt is our main GUI platform, but Qt is more than just a widget library. It provides our platform abstractions. It provides us with threading. We use threading a lot. It provides our XML handling, and this is quite unique, our text document architecture.
10:04
What Qt provides is a complete rich text document abstraction, where you can add paragraph by paragraph, style by style, table by table, a complete and long text document. And that's the basis of what we use in our text component, which is again shared
10:24
among all applications. The work process uses the same text component as the raster image editor. This text document can then be layouted, and there's an abstract layout engine which we have sub-classed in Kelegra to provide more precise layout.
10:44
Qt is the lowest basis we use. On top of Qt we have KDE, and KDE is not optional. We use KDE for instance for plugin loading, and Kelegra is heavily based on plugins. Even the text layout component, the text component you type text in, even that is a plugin.
11:03
If anyone thinks I can make a better text layout plugin, it just has to implement the interface and then the functionality, which is a bit more work. Scripting is done using the cross library, which means that if you want to extend a Kelegra application with a script, you can use any language with cross supports, which
11:24
is Python and Ruby and Perl and Java and JavaScript and even something called Falcon. We use it for job queue, which is another form of threading. For instance, printing is done in the background using threading.
11:41
Then we use it for settings, which is sort of a hot topic these days, since Ubuntu is busy writing yet a lot of settings library for Qt. We'll see what happens to that. For now, we use kconfig and are happy with the performance of that. And we use it for the translations, the internationalization.
12:03
So KDE, everyone has an opinion on KDE, but if you go and talk to a mobile device manufacturer, their opinion of KDE is it's too big. So, initially, what we did when Nokia wanted to put a KOffice-based mobile office viewer
12:23
on MIMO was to cut down KDE and cut away all the code that wasn't directly used. So most of it is just stubs. It's a fork. It's MIMO specific. If you want to use Kelegra in your application, your device, your form factor, whatever you
12:41
want, my advice is do not touch lip clock with a very large barge pole. Keep away from it. Then there are two other possibilities. Just use plain KDE, like your Linux distribution packages it, like it's packaged for Windows. People complain and tell you it's big.
13:01
It's really just 40 megabytes. Just compare that to the size of your SD card in your camera or your phone. Using plain KDE has the advantage that you're binary compatible with the official releases. However, there's another option.
13:20
That's the KDE MOLAD profile. It was created by KDAB and KO people. KDAB is a German company focusing on KDE technology, and KO is also a German company focusing on KDE technology. What we did together was go off KDE and remove everything that's deprecated,
13:42
that's still there to be compatible with source code written in KDE in three days, that's still there to be compatible with ideas that we've long since discarded. KDE mobile profile is also KDE cut up into smaller parts. Big libraries have been split up in small functional components.
14:02
So you only need to take what you need for your application. And that's surprisingly little for Caligra. Caligra is a big, big KDE application. It uses a lot of technologies. And still we only need 11 megabytes of supporting libraries. What we use this for is platforms like MeeGo.
14:23
MeeGo for netbooks, MeeGo for handsets. This is really suitable as a platform to build on for the future. And if you are making a Windows application and that's Caligra technology and want to create an installer, and I know of at least two separate cases
14:43
where that happens in a big environment with many hundreds of users, then I'd also compile the mobile profile of KDE. The mobile profile of KDE is not a fork. It's right inside the KDE Git repository, which was created last week
15:04
when KDE moved from subversion to Git. This is the dependency graph for the Caligra mobile application. The Caligra mobile application is the same as FreeOffice for MIMO. The top half is what Caligra uses. The other half are the KDE libraries we actually really need.
15:22
KDE Core, Keio for IO, which is network-independent. K-parts for embedding, because still every Caligra application is a K-part. If you use a document in Caligra, an Office document, then you have a K-part.
15:46
And some other stuff like solid for hardware, recognition, KCM utils for settings, notifications, mainly for the spreadsheet module. And then there's a host of other dependencies, most of them optional, fortunately.
16:04
Some of them used by only one or two applications, like Open Shiva, which is a really, really cool technology to write pixel transformations by pet project. Twitter uses that. But this is to show that this is not a huge standalone application
16:23
with tens of millions of lines of code, where everything that was not invented here is invented here after all. We are not afraid to use other people's technology. And I think that's a good thing. It does give some headaches when packaging for Windows, though.
16:43
So, these are the four big, big parts that make a Caligra. And I will be discussing them here. We have what we call shapes. Shapes are really small, fine-grained objects that combine data,
17:01
a way to represent the data, and a way to load and save the data. We have a canvas. A canvas represents your pages for the particular kind of document you need. All these are shapes, and actually, this is two shapes in one, the chart and the labels. Then we have the filters.
17:21
The situation there is getting a little bit unclear these days, but one firm principle was that a filter in Caligra is independent of the application it filters to. So if you filter from a Microsoft Office document, what you get is an ODF document, and the ODF document is what the Caligra application reads.
17:41
That works fine for presentations. It works totally fine for text. But we were running into performance problems for spreadsheets, for really big spreadsheets. So we had to let go of that principle a bit. And then there's plugins. Plugins is just a big basket of things that we don't code into the core,
18:05
like color management. Color management is, even for text documents, quite important these days. If you create a text document, you want to have it professionally printed. You have to have a color-managed image. So we have a color management library based on little CMS.
18:21
But the dependency on little CMS is optional. That's encapsulated in a plugin, a color engine plugin. Our tools are plugins. Our shapes are plugins. Most of the user interface is plugins. If you look at an application like Caligra tables, you will see options for sorting
18:41
and filtering and data handling. And most of those are plugins that use the KDE component technology, KPAT, which Michael Meek said does no longer exist. But it does use that specific technology to combine those plugins into the GUI that make Caligra tables for you.
19:02
Code layout. What I hope is that all of you will be checking out our Git repository, Strathacking. So I'm going to tell you where to find which bits of code. There's the libraries. The libraries contain the Flake library, which handles those shapes. It contains the text library, which loads ODF text and styles.
19:23
It contains some supporting widgets, and it contains the main document application, fewer controller abstractions. Then there are all the applications in their own directory, and most of those applications have subdirectory called part, which implements the kpart.
19:40
Then there are tools. Tools are right now, but that's just an accident. One of the tools is the Caligra mobile application. It should be moved. But it contains scripts to handle our test document repository, to find test documents on the web, to do stand-alone conversion.
20:02
Caligra has a huge repository of real-life documents that we test against every commit until we break the build server. Plugins. That's where you find all those plugins. And filters is where you find all the filters that create an open document,
20:23
or give an open document, create an export for it. This is something I have to be quite honest about. Our import filters really are good these days. They have improved a lot. We have good support mainly for the Microsoft Office document file formats.
20:41
We also have good support for some other file formats. We don't really have export filters anymore. Most of them got broken and they haven't been repaired, and that's going to take a really huge effort. And we haven't embarked on that effort yet, because mostly people are interested in loading their documents and reading them.
21:06
Who knows what will happen in six months. So let's look at what a filter looks like. A filter is really simple. You have a desktop file, and a desktop file defines which MIME type you go from, which MIME type you go to. And then in your implementation, you implement a convert function that creates,
21:25
that takes as arguments those two MIME types, from and to, and then now and then you tell the application that you've made progress in your conversion, otherwise the user will think your application will hang. This is more or less a filter. So be defensive.
21:42
Check that you indeed got documents of the right MIME type. That's the first part. Then get your input and output files. Chaos and Caligar can chain filters. So you can go, if there is no direct conversion from one MIME type to another,
22:02
but there is an intermediate format, we can go through the intermediate format, that's called the chain. We get the input file, and we get the output file, the file we have to read, the name of the file we have to write to. We create a chaos store, which is a file system abstraction on that file,
22:21
which we are going to write to. Then we write the interesting bit of code. I've put it in a comment here. That can be really complicated, especially if you look at the older established office formats. And then we close the file. If that succeeds, we return OK, and everything is OK.
22:42
We've just converted the document. The bit that I've commented out is really the interesting bit, of course, but that you will have to do for your own filters. Shapes, documents made up out of all these small shapes.
23:00
Because you don't know when you start out which shapes you will have, which shapes you will need, shapes are plug-ins. In order to make it possible for the system to find which shape to load for which part of open documents, we have this support function in a shape factory.
23:23
The shape factory will create shapes. So what happens is we will go through all the factories that are registered in the system one by one and check, are you supporting this type of ODF element? And then one factory says, yes, I do, I do, I do, I do, give me a chance.
23:41
Then we call create default shape, which is just an empty version of that shape. And then on the shape we call load ODF. And the shape populates itself with the data and is now ready to be used, shown or edited. So what does a shape do? A shape loads itself, paints itself, and then when asked, it will save itself to ODF.
24:07
That's what we do in our core. When all these shapes are loaded, your document is created and you see your document, you want to do some stuff to it, remove text, add text, paint on it.
24:25
And it can get quite complicated because these days people have a mouse. We have to send mouse events. We have to send stylus events if you've got a graphics tablet.
24:41
We also got creativity applications. And then if you've got a graphics tablet, you might as well have two input devices. You might have an art pen and a stylus. And we keep track of all those. So what happens is the events the system sends to your application window, they go to a widget or a graphics item.
25:01
They send it on to your canvas. Your canvas sends the event to a tool manager and the tool manager checks, wait, this was a mouse with this ID. Okay, and I haven't seen it before, so I create a new tool instance and then the tool can handle the event. So we keep track of all the input devices the user has used. And for every input device, we create all the tools the user has wanted to use.
25:25
Now, what is a tool? A tool is not just something to manipulate a factor with. A tool is also a thing you use to enter and delete text. So our text component, which is again a plugin, is a shape, has its own tool, the text tool.
25:43
And when you activate your text box on screen, the text tool gets activated. You can type and select styles and create both an italic text and delete text and search, etc. So the whole concept of tool is really, really quite wide here.
26:08
And that also means that the interface of a tool is really big. This is just a subset. Again, a tool can paint itself on the canvas.
26:21
Because if, for instance, you want to drag a box on screen, you want to show those rubber bands. If you want to select something, you want to show rubber bands. If you want to paint a factor, you want to show something. If you manipulate a grid, you want to show the grid. All that is tool decorations.
26:40
Then a tool has option widgets because the action of the tool is sometimes different. Something like that. And a tool has to accept all these mouse events. Mouse press event, tablet event, and so on and so on and so on. I've just put the mouse press event in there and all the other events.
27:02
And then the tool knows about the data that's inside the shape. So sometimes tools are really quite specific to particular shapes. Text tool can't do anything to a path shape or a chart shape. So a tool is also used to implement cut, copy, and paste from the content of a shape.
27:22
Cut, copy, and paste of the shape itself is handled on a higher level. So, where are we? Right. Caligra in your application. I just couldn't resist including the screenshot because this is cool. Someone finally managed to fix all the Linux systems, all the GCC systems,
27:43
today managed to make Caligra compile on Windows again. We're all working on Linux. We don't really care much about Windows. Or OS X. But there's this guy and his Linux laptop broke down so he had to use his work laptop and he wanted to hack on Caligra anyway.
28:05
So this works. I also know a company that uses Caligra embedded in their own Windows application. They also develop on Linux because what self-respecting developer would want to develop directly on Windows these days.
28:21
But then they have to build it for Windows. So I'm really happy for them that we managed to fix this. If you want to embed a Caligra component, a Caligra canvas, in your own application, there are basically three strategies.
28:40
At this point I have to admit that there is something wrong in the realm of KPart. KPart embedding is the oldest component technology in KDE. It's what used to be used when you were running Konquer and you would browse the web and click on a document and then the document would be shown embedded in your browser.
29:02
I still think that was way cool. It still works fine for Caligra Works but when I tried for this presentation I'm afraid it was really broken for tables and it was mostly broken for stage. That it is broken doesn't mean it won't get fixed.
29:23
I think we should fix it. That's your first embedding strategy. What happens if you do that? You have to have a K application, you have to have a K main window and then your whole central area of your window will be taken by the Caligra application.
29:41
The Caligra application will merge all the menus in the menus of the hosting application. It will try to merge the toolbars. It won't merge unless you use a K main window the dockers and the toolbox. So editing will be tricky. You will have to do some work for that. You will have to use a lower level interface
30:02
to access the tool or even the document directly and perform changes if you want to have reading and writing. The second embedding strategy is a bit of a hack. A really cool hack. But it's a hack. It's Qt widget based.
30:20
I don't know how many of you guys are Qt developers and are up to date on what Nokia is doing these days to Qt. Basically Qt used to be based on widgets. Widgets are on Windows. They have a window handle.
30:41
On X11 there are widgets. That somehow doesn't scale for creating nice, animated, flipping, all dancing applications like we like to see these days. So what did they do? They took a perfectly fine Canvas abstraction
31:02
Qt GraphicsView which was originally created to create huge Canvases mostly for industrial applications. Like if you were going to create a mapping application that would implement a map of say
31:20
all of the Netherlands with all the streets and wanted to do traffic simulation on that Qt GraphicsView was the perfect solution. But it could also animate widgets for traffic simulation which is also quite nice. But they then created a widget library on top of Qt GraphicsView. They called it Let Me Go Touch.
31:41
It's deprecated by now but it's still based on Qt GraphicsView. So by now Qt has two ways to handle widgets. They have the ordinary Qt widget
32:01
and they have the newfangled already deprecated Let Me Go Touch widgets. The very first time we tried to embed Kalegra into a mobile application we used QWidgets because this was for MIMO, for Fremantle. It didn't have the fancy Q GraphicsView widgets yet.
32:22
So what did we do? We grabbed our Kalegra application we grabbed the main view it's a model view controller system so we grabbed the view widget and in the view widget we grabbed its child widget, the Canvas so we would lose all the decorations manual bars, toolbars
32:40
around the main Canvas widget we would hide the parent view widget take this Canvas widget which we were really happy to have and put it right in a new parent. That's what FreeOffice uses on MIMO Fremantle. It's really easy to do.
33:01
And it's a hack. But it works. It's totally OK to do it that way. Last summer Nokia had more than a dozen interns in Bangalore working on extending FreeOffice for MIMO with way cool plugins and editing capabilities.
33:21
And these guys, they were really brilliant, really good guys. They took this codebase and took it to places where never expected it. Like the shaking thing I mentioned but also direct blog support you type in your FreeOffice on Calico Mobile, your blog entry
33:40
press a button and it's there on Blogger Blogger.com Anyway, this is what we used for FreeOffice Then came LibNico Touch and Qt Quick, QML for that we really needed to have a Canvas that supported Qt graphics items
34:02
So what did we do? We abstracted away the widget hardcoded widget dependencies of the Calico Canvas code and we created another Canvas type based on Qt graphics widget And that you can embed in a Qt graphics
34:21
view or in a QML QDeclarative application That has the advantage that it's really flexible You can do nice animations with your documents now Let me see whether I can show it This is just a test application Kinetic scrolling
34:41
stuff like that Zoom in Zoom out That's a category tables application But it's got a complete new UI And this by the way This Not this
35:00
Where did my application go? This one FreeOffice That's my presentation in FreeOffice Uses exactly the same presentation component But in a user interface This is running on my desktop I've just compiled it on my desktop
35:20
But if you compile this on a tablet or for your mobile phone You can scroll and flick with your finger The buttons are big enough to be finger usable So across all these four factors Mobile devices, tablets netbooks
35:42
desktop applications A huge variety of desktop applications You can still use the same engine And that's a really unique capability Of course It's early days We are learning as we go
36:01
The interfaces haven't really really been set in stone yet There are still some problems Where you really have some Difficult issues to fix To work with For instance if you don't want to use the text tool To manipulate text You have to use the text document
36:22
The text editor interface That can be tricky If you want to implement your Qt Quick Calendar application You have to have a way to tell the canvas When to zoom and when to scroll That can be tricky as well So The main integration point for your application
36:41
And the Caligra Engine is the canvas A canvas shows what's in a document Right here you see one limitation Almost immediately One document can have more than one view And one view can be shown on a widget Right now it's not possible to show
37:00
your document in more than one Qt Graphics View So start with the document You've got a file you want to load A simple text file Then we check What the MIME type of the text file is
37:21
And we ask the KDE plugin system Which is very sophisticated To give us An instance of the document class That can load this file All Caligra documents are based on KO documents
37:40
So that's the class we are going to get We haven't opened the document yet We just have an instance of a class Which comes from a plugin So The list, the set of documents We can read Is extensible
38:01
We just have a document, it's empty Now we want to load it We load it from a URL Loading from a URL means we are loading it Networked transparently Whether you want to load from the hard disk of your laptop Or whether you want to load from
38:21
a website It will work When we have the document At the moment when we have the document And have the document loaded We are still completely free in what we want to do Want to go for kparts? That's possible Create a main window Which is a kpart main window You have to
38:40
subclass that, you have to implement Some methods They are all quite clearly described in the API documentation Then Create a GUI From your parts The KDE kparts technology Is smart enough To have a generic create GUI That takes your part Which is our document
39:01
And creates a GUI from that And embed it This technology has worked since KDE 2 With minor variations And API changes If you want a few instead And you have got to load a document Then you tell your document
39:21
Create a few And then you have got A widget Which for now is invisible You also need a cute Main window or a K main window Or an M main window Depending on Particular variety of platform you are using
39:40
You simply grab the canvas Widget out of the few And set it as your central widget And then you have got your document It's shown It will even scroll already It will even zoom Although you might have to implement some actions In your application to connect
40:00
To the zooming functionality In kl-few QML, QF graphics view Is a bit more complicated You get your canvas item From the document Same as you would get a few And then you have to You have to implement The kl-canvas controller class The kl-canvas controller class
40:22
Is quite big It's a huge interface It's relatively new So it's not entirely well documented yet And it is responsible For all your scrolling Panning and zooming needs
40:42
And it needs to be The thing that is shown in your application Because your kl-canvas controller Is the first thing that gets the event It needs to know somehow Which events have to go to the canvas And which events it needs to do the scrolling and zooming So kl-canvas controller You set your canvas
41:00
Which we just got from the few on the canvas controller And then you have to integrate Implement these methods And integrate them With your applications User interface Scrolling, panning, zooming The proliferation of zoom methods Is a wart in our API
41:20
Which we really should fix But that's what you get When you develop software iteratively These are two examples I've already shown them live Of how to Of Applications where you can use
41:41
Your Where you can Take your need for an application Your need for a user interface And create a custom application Weirdliness In the menu bar is because this is A mobile application compiled for my desktop So where do I want to go
42:14
From here I think it is already quite
42:20
Quite successful There are Tens of thousands of people who have used This on their N900 I'm fairly confident We will see it on other mobile devices We will see it on other desktops But what are the problems that are left That we need to solve To make this really The webkit for the office
42:43
Document world It's still really quite difficult To really dig in This presentation Just scratches the surface Of what you need to do To implement your own Kelegra based application On the other hand, that's good
43:02
It's good that our APIs Are not yet finalized That there is still Wiggle room For people with special needs Which makes this the perfect time To actually join this effort And take Kelegra Places that I haven't thought of yet
43:23
Televisions could be good Other desktop applications I'm sure that if someone Feels that Oh no, this whole tools, dockers Paradigm, that sucks for desktop It's totally fine with us
43:40
If someone takes the Kelegra engine And builds a different Paradigm on top of it That's what the engine Is for, to make it possible We actually didn't Realize that when we started working on Kelegra in 2006 When we had a meeting in my place In the Netherlands There's four or five
44:01
We sat down What do we want to make We want to make something flexible We want to make it possible to create different user interfaces But at that point We cut too high We thought if you create A different user interface You're going to create different tools Different dockers
44:21
Within the same basic applications Now we know we have to be Flexible at all levels Even Our filters are reusable If web ODF Gets integrated In a good many places And people want to use it to view Microsoft's binary format documents
44:41
They can use KL converter To convert to ODF Read the ODF in web ODF Write the ODF back When the OS is done with its write Editing implementation And then convert it back When somebody else is done with our Microsoft format export filters Because those are not done
45:01
We used to have an RTF export filter There is rudimentary XLS export filter But this is something that needs to be done right When we started Again looking at the import filters We started with the PowerPoint Import filter PowerPoint is used a lot And
45:20
We wanted to have good support for it The PowerPoint import filter Was written during the Google Sum of Code project In 2007 And it was Not easily salvageable The original author had left The code base was
45:41
While not too large Not flexible enough So we Grabbed the bull by the horns And Took the decision to rewrite it from scratch Well when I say rewrite To generate most of it from scratch Back then good documentation Was rare These days Microsoft provides good documentation
46:00
And While personally you don't have much use for Windows I have to commend Microsoft in a way They have cooperated with us In the past year They have invited people from our community To Seattle And have discussions with Their implementers And we've been able to help them in a small way Maureen Kraus will bring our Kelleker tables maintainer
46:21
Managed to fix a book in Excel In the import for all the type Excel filters So that's where we are these days The future is hugely Exciting I think Kelleker can spread And can become A really ubiquitous component
46:43
And that's Going to be fun Thank you We have some time left for questions
47:01
Are there any questions? I don't see anyone raising their hand Well I guess there are no questions then Well thank you again I hope I wasn't too technical And next up