[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    A new framework for embedding ... without CORBA
From:       David Faure <faure () kde ! org>
Date:       1999-09-29 7:32:46
[Download RAW message or body]

Our master Torben has once more improved KDE's framework by ....
rewriting what used to be openparts, without using CORBA anymore,
just plain shared libraries. The benefits are huge, as you all guess,
and this is something we should consider very seriously.
Please note that this DOESN'T mean removing CORBA all together. 
We still need it for all the other cases where we use it right now :
talking to a running application (kfmclient<->konqueror/kdesktop, kmail, ...)
and scripting an application (which is the same kind of thing in fact).

Also please keep this a bit confidential for now, we all want to have
a header on slashdot like "KDE drops CORBA", which is not true.
We simply want to have a better framework for embedding, and to get rid
of the ugly duplication of kdeui/Qt widgets API in openparts 
(which created something like another toolkit, half-incompatible with 
kdeui/kdecore/Qt). With the new framework, this half-baked API
disappears and everything uses the normal KDE and Qt API.

ok, enough talking. See it for yourself :

> Please download
>  
> http://www.informatik.uni-frankfurt.de/~weis/canossa.tgz
>  
> You need latest Qt and tmake. I have written a LONG README for you
> guys.
>  
> It contains a C++ based embedding framework, plugins work, too,
> and some other fancy stuff as outlined in the README. Even if you
> dont want to compile it: Look at the sources and the README.
> And one more thing: It compiles FAST :-)
>  
> Bye
> Torben

I have added some information to the README, which I attach here.

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://www.insa-lyon.fr/People/AEDI/dfaure/index.html 
KDE, Making The Future of Computing Available Today



Technical study on embedding and plugins
----------------------------------------

To compile this sources, you need to get the latest
Qt from Trolltech CVS, 
uncomment the line with QT_BUILDER in src/qt.pro
and uncomment the QT_BUILDER line in qgolbal.h.
In addition you must compile qt/src/emoc and use this
moc instead of the standard Qt moc. This configuration
can be used for KDE developing, but you need to recompile
everything in KDE to do so.

This sources dont require any KDE!

The makefiles are generated by qt/util/scripts/makeqtmake and
the resulting *.pro files use tmake (which is free available from TT
in ftp://ftp.troll.no/freebies/tmake/).

To use it you have to set something like
export TMAKEPATH=/local/tmake/lib/linux-g++
and copy tmake/bin/* in your path
And then cd src/ ; tmake qt.pro -o Makefile

Compiling:

canossa/lib (Framework)
canossa/calc (Koffice Calculator Plugin library)
canossa/formula (KFormula library)
canossa/script (KScript library)
canossa/spread (KSpread library)
canosse/spread/test (KSpread executable)

Next you need to set your LD_LIBRARY_PATH to match all the mentioned directories

CA=/mnt/devel/kde/kde2/canossa
export LD_LIBRARY_PATH=$CA/lib:$CA/formula:$CA/calc:$CA/spread:$CA/script

You need to go to canossa/kspread so that kspread can find its kspread.rc.

Start with

./test/qspread -style=windows

Click on the calculator symbol. Do the same with KOffice and see the difference!

Click on the insert part symbol.
Select some area.
To select. click left. To activate click left again (no double click currently)
Due to a little bug you have to click again to change focus.

Nice thing to try:
Select an embedded part with left click. Click on the rotate button. Now you
can rotate, shear etc. the part. This does even work if the embedded part
has in turn an embedded and rotatet part.

The ToolBars/MenuBar are described in XML using the *.rc file.

In lib/shell.rc you can find the XML of the shell. Notice the <Part/> tag.

In spread/kspread.rc you can find the KSpread XML. Mention the
<InPlaceEditing> tag. If the embedded qspread is rotated, then no QWidget can
be created => Most functions are not available. But some actions may work
nevertheless. <InPlaceEditing> describes what appears in the menu/toolbars
if the embedded part is active but rotated.
Try like this: Embed a part, rotate it and activate it. Then you see the
reduced set of actions in the menu/toolbars.

Please notice that moving/resizing of parts does even work when they are
rotated :-)

Note that the transformation toolbox is shared among all parts in the same mainwindow.

The framework features two activation modes:
 - TriState: Selected, Active, Inactive (for KOffice)
 - Direct: This is like ClickToFocus. Only Active/Inactive. Useful in
           konqui perhaps.

The classes

Part         # A document
 - Container # A document that may have embedded documents

PartChild    # Represents an embedded part in the document and
             # does heaps of QWMatrix transformation stuff.

View         # A QWidget representation of the documents data
ViewChild    # Used for embedded childs that currently feature
             # a QWidget. The usual thing is not to use QWidgets.
             # All parts paint in the same widget. Only if an embedded
             # child is activated, a QWidget is created.

Shell        # The MainWindow. Craetes Menu/Toolbars from XML and
             # cares about activation.

Plugin       # The name says it all :-)
             # Plugins feature QActions. By putting <PluginAction> tags inside
             # the components XML they become inserted and activated.

ToolBox      # The toolbox for rotating etc.

EventHandler # New design pattern to fight bloated mouseMoveEvents, eventFilter etc.
             # implementations. Event handlers live as long as a certain action
             # (Resizing, Moving a part, inserting a new part) takes and destroy
             # themselves afterwards.


I hope you like the stuff!

And I hope you like the compilation speed :-))

Bye
Torben


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic