Home Download Support Development Projects My pages
 

KDE vclplug

2003-12-11

Contents

Introduction
Current status
How to get it
What has changed in the code
Contributing

 

Introduction

The second step in my KDE integration plans was to replace the OOo's VCL layer (GUI toolkit) with its Qt implementation. So far I ported just part of VCL's SAL, which basically means that you should get the same look'n'feel as before, but the drawing is done using the Qt methods and controlled by the Qt events.

Maybe you ask "Why to do it at all, if it still looks the same?" Originally, I wanted to continue with replacing the widgets one-by-one when the Qt SAL is mature enough. But VCL is going to be replaced with a brand new toolkit anyway, so it would be a waste of effort. But having Qt events working is still needed—it is important for incorporation of the standard Qt/KDE dialogs, menus, etc. Read this for more. And we still can get closer to the KDE look (not feel), read the document attached to this mail.

Some screenshots:

 

Current status

WARNING: This stuff is experimental. It is evolving, but still it is closer to unfunctionality than to functionality.

Browse the source code for TODOs and FIXMEs. Some parts are quite ugly hacks for various reasons; mostly because I wanted to see something, and wanted it quickly. Additionally the VCL code was not documented much, so I had just to guess from sources of others what should this piece of code really do. Luckily, it got better with the introduction of vclplug, thanks! :)

 

How to get it

  1. Get OOo tagged SRC680_m16 from CVS. See Detailed build guide on general information how to compile it. Additionally you have to apply patch from Issue #23056.
      ~ $ mkdir OOo && cd OOo
      ~/OOo $ export CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs
      ~/OOo $ cvs login
      ~/OOo $ cvs -q -z3 checkout -r SRC680_m16 OpenOffice
    
    
  2. Download vcl-SRC680_m16-vclplug_kde.2003-12-09.diff.bz2, bzipped diff containing the port, bunzip it and apply the patch in the vcl subdirectory. (Some people reported problems with the bzipped patch, so I provide a gzipped version as well. I do not have problems with the bzipped patch with bunzip2 version 1.0.2.)
      ~/OOo $ cd vcl
      ~/OOo/vcl $ wget http://artax.karlin.mff.cuni.cz/~kendy/cuckooo/download/vcl-SRC680_m16-vclplug_kde.2003-12-09.diff.bz2
      ~/OOo/vcl $ bunzip2 vcl-SRC680_m16-vclplug_kde.2003-12-09.diff.bz2
      ~/OOo/vcl $ patch -p0 < vcl-SRC680_m16-vclplug_kde.2003-12-09.diff
      ~/OOo/vcl $ cd ..
    
    
  3. Configure, set the KDE_INTEGRATION environment variable to TRUE and QT_HOME to the location of the Qt library, build and install OOo. Detailed build guide will help you if you get into troubles.
      ~/OOo $ cd config_office
      ~/OOo/config_office $ export CC='ccache gcc'
      ~/OOo/config_office $ export CXX='ccache g++'
      ~/OOo/config_office $ ./configure --with-gcc-home=<gcc-3.2.2>
      ~/OOo/config_office $ cd ..
      ~/OOo $ . LinuxIntelEnv.Set.sh
      ~/OOo $ export KDE_INTEGRATION=TRUE
      ~/OOo $ export QT_HOME=/usr/lib/qt3
      ~/OOo $ ./bootstrap
      ~/OOo $ dmake
    
      ... Wait several hours ...
      
      ~/OOo $ cd instsetoo/unxlngi4.pro/01/normal
      ~/OOo/instsetoo/unxlngi4.pro/01/normal $ ./setup
    
    
  4. Copy libvclplug_kde_680li.so to the OOo's program directory.
      ~/OOo $ cp vcl/unxlngi4.pro/lib/libvclplug_kde_680li.so <installed OOo>/program
    
    
  5. Hold your breath and run it:
      <installed OOo>/program $ ./soffice
    
    

If everything went fine, you should be running the Qt OOo now. Should you have any troubles with the installation instructions, please let me know; I did not have time to test all the steps.

 

What has changed in the code

First of all, I took unx VCL implementation and cut it to the bones. Then I started to add the functionality again. Then vclplug was introduced and I remade it once more:-) The most important changes are:

  • KDESalFrame is a child of QWidget and SalFrame to get the Qt events.
  • KDESalGraphics is a child of QPainter and SalGraphics to be able to paint the Qt way.
  • KDESalInstance is a child of QApplication and SalInstance to have the Qt event loop (see SalInstance::Yield()).
  • KDESalBitmap is a child of QImage and SalBitmap.
  • Font layout is replaced with own (currenty quite wrong) implementation.
  • SalDisplay, and lots of code for things that Qt is doing for me anyway, has completely vanished.
  • Sound, OpenGL, and more are currently totally unfunctional.
  • And some more things I would remember if you asked me...

The different naming conventions in OOo and in Qt are little confusing the code, but I am trying my best to be as consistent as possible.

 

Contributing

Please see the general participation info on the main page. You should have signed Sun's JCA and release your patches both under LGPL and SISSL (see Contributing To OpenOffice.org) so that they could be possibly included in the official OOo tree.