Using Sheets as a library

Boudewijn Rempt boud at valdyas.org
Mon Nov 26 20:14:08 GMT 2012


On Monday 26 November 2012 Nov, Philip Van Hoof wrote:
> Hi guys,
> 
> For the purpose of a custom made and specialized Qt application will
> need to adapt the CMakeFile.txt of Sheets in such a way that the
> non-installed calligrasheetscommon_LIB gets installed and that its
> header files will become available.

Sounds like a cool project! Is it something you can tell us about? I love hearing about people reusing Calligra libs.
 
> Right now for demo purposes to and learn whether or not it would be
> doable what I had in mind for this Qt application, I use a link
> commandline like this:
> 
> /usr/bin/c++   -g -Wall -g    MainWindow.o MySheetItem.o  -o showsheet_qt - \
> 	-lKDToolsGui -lQtGui -lQtCore -lQtOpenGL -Wl,-Bstatic -lQtUiTools -Wl,-Bdynamic \
> 	-lQtNetwork -lKDUpdater -lKDUnitTest -lQtXml -lQtSvg -lQtWebKit -lphonon \
> 	-lQtGui -lQtCore -lQtOpenGL \
> 	/home/pvanhoof/repos/calligra/calligra-2.4.3/obj-i486-linux-gnu/lib/libcalligrasheetscommon.so \
> 	/home/pvanhoof/repos/calligra/calligra-2.4.3/obj-i486-linux-gnu/lib/libkomain.so.9.0.0 \
> 	/home/pvanhoof/repos/calligra/calligra-2.4.3/obj-i486-linux-gnu/lib/libflake.so.9.0.0 \
> 	/usr/lib/libkdecore.so.5 \
> 	/home/pvanhoof/repos/calligra/calligra-2.4.3/obj-i486-linux-gnu/lib/libcalligrasheetsodf.so.9.0.0 
> 
> This works, illustrating that my plan to use CanvasItem in my qt
> application will 'just work' (awesome).

Nice!

> My question is whether the Calligra community would be interested in my
> patches for CMakeFile.txt files of Calligra

Yes (we'd need to review them too, of course)

> and whether Calligra in
> general would be interested in transforming from a set of office suite
> application to a set of libraries and components that can be used to
> build office-like applications.

Yes, that's where we're going in many ways. After all, sheets, words and stage have already been re-used in FreOffice (using the QWidget canvas), Harmattan Documents (the QGraphicsItem canvas) and MeeGo Office (same, but this one was never released). Krita has been reused in Krita Sketch. We've seen calligra used to produce RTF documents, we've done a pilot producing layout information and there's a company re-using Words as the internal report editor, which was demoed last Calligra sprint.

Life isn't perfect, though, and there's too much close integration with qwidget-based code left.

> In particular for spreadsheets there is a rather big interested. There
> are both commercial and open source libraries like LibXL, libxls and
> xlreader, xlslib that illustrate this.
> 
> The Sheets library of Calligra goes even further that for example the
> commercial LibXL and will on top of parsing the layout also render it
> with Qt as a QGraphicsItem (The CanvasItem in Sheets does this).
> 
> Because it is a Qt library and because it is a QGraphicsItem, and not a
> QWidget which would have required the use of QGraphicsProxyWidget, it
> makes it perfect for reuse in other applications in my opinion.

Yes, that's why we added the extra canvas type.

> I also noticed that all the files under sheets/ are annotated at the top
> for the LGPL copyright. I saw two copyrights in the Calligra main
> directory, COPYING and COPYING.LIB, can I assume that what falls under
> sheets is LGPL? This is important for my application and I think for
> making it more easy to reuse sheets/ as a library too.

Yes -- if there's a file with a GPL header, it's probably an accident (unless a unittest).

> These files have the GNU General Public License instead of the GNU
> Library General Public License. Will I have to rewrite the files or is
> the Calligra team AND are the original authors OK with assuming they
> were wrongly annotated as LGPL? In that case, can I provide a patch that
> changes the license for the files from GPL to LGPL? Should I await an OK
> from every author of all the files?
> 
> pvanhoof at lors:~/repos/kde4/calligra/sheets$ grep "GNU General" * -R |
> cut -d ":" -f -1 | sort | uniq
> dialogs/ConsolidateDetailsWidget.ui
> dialogs/ConsolidateWidget.ui
> dialogs/GoalSeekWidget.ui
> dialogs/SortDetailsWidget.ui
> dialogs/SortWidget.ui
> dialogs/SpecialPasteWidget.ui
> dialogs/SubtotalsDetailsWidget.ui

I think that ui files get the gpl header automatically, so that's probably an accident. Also, if you're using the graphicsitem canvas, you probably can disable the entire dialogs directory because you don't want the qwidget-based dialogs.

> tests/BenchmarkRTree.cpp
> tests/BenchmarkRTree.h

And these are tests, so not really relevant.

> pvanhoof at lors:~/repos/kde4/calligra/sheets$ 
> 
> 
> pvanhoof at lors:~/repos/kde4/calligra/sheets$ for a in `grep "GNU General" * -R | cut -d ":" -f -1 | sort | uniq` ; do grep Copyright $a ; doneCopyright 2010 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
> Copyright 2010 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
> Copyright 2009 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
> Copyright 2010 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
> Copyright 2010 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
> Copyright (C) 2006 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
> Copyright 2010 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
>    Copyright (C) 2006 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
>    Copyright (C) 2006 Stefan Nikolaus <stefan.nikolaus at kdemail.net>
>    Copyright (C) 2010 Marijn Kruisselbrink <mkruisselbrink at kde.org>
> pvanhoof at lors:~/repos/kde4/calligra/sheets$
> 
> 
> Kind regards,
> 
> Philip
> 
> 
> 


-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl



More information about the calligra-devel mailing list