1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2009 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_vcl.hxx"
31 #define Region QtXRegion
32 #include <QApplication>
35 #include "KDEData.hxx"
36 #include "KDESalInstance.hxx"
38 #if OSL_DEBUG_LEVEL > 1
42 #include <rtl/string.hxx>
44 /// entry point for the KDE4 VCL plugin
46 VCL_DLLPUBLIC SalInstance
* create_SalInstance( oslModule
)
48 #if QT_VERSION < 0x050000
49 // Qt 4.x support needs >= 4.1.0
50 rtl::OString
aVersion( qVersion() );
51 #if OSL_DEBUG_LEVEL > 1
52 fprintf( stderr
, "qt version string is \"%s\"\n", aVersion
.getStr() );
54 sal_Int32 nIndex
= 0, nMajor
= 0, nMinor
= 0, nMicro
= 0;
55 nMajor
= aVersion
.getToken( 0, '.', nIndex
).toInt32();
57 nMinor
= aVersion
.getToken( 0, '.', nIndex
).toInt32();
59 nMicro
= aVersion
.getToken( 0, '.', nIndex
).toInt32();
60 if( nMajor
!= 4 || nMinor
< 1 )
62 #if OSL_DEBUG_LEVEL > 1
63 fprintf( stderr
, "unsuitable qt version %d.%d.%d\n", nMajor
, nMinor
, nMicro
);
69 KDESalInstance
* pInstance
= new KDESalInstance( new SalYieldMutex() );
70 #if OSL_DEBUG_LEVEL > 1
71 fprintf( stderr
, "created KDESalInstance 0x%p\n", pInstance
);
75 KDEData
*salData
= new KDEData();
77 salData
->m_pInstance
= pInstance
;