summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-06 21:46:02 +0000
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-10 07:59:13 +0100
commit7663c8802d0a8a6c8e41b0279a171724c5b0bcfb (patch)
tree92a58455d64507ff85fd7d780839a63e7e4c41b7
parenteb7b93ba28b2547b6b2e70c0f4f47e456126ce14 (diff)
vcl: outdevgrind compile it by default, and fix it up.
Change-Id: I4bdad4a0eb65991cd9faa9452485c64120b8b6dc
-rw-r--r--Repository.mk4
-rw-r--r--vcl/Module_vcl.mk3
-rw-r--r--vcl/workben/outdevgrind.cxx85
3 files changed, 52 insertions, 40 deletions
diff --git a/Repository.mk b/Repository.mk
index c5642789101a..15bc3c985f1d 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -146,6 +146,10 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,ooo, \
$(if $(filter unx-TRUE,$(GUIBASE)-$(ENABLE_TDE)),tdefilepicker) \
$(if $(filter WNT,$(OS)),,uri-encode) \
ui-previewer \
+ $(if $(filter LINUX MACOSX WNT,$(OS)), \
+ icontest \
+ outdevgrind) \
+ vcldemo \
$(if $(filter WNT,$(OS)), \
senddoc \
) \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index f61cc7b59ba0..385ac9b096d0 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -27,7 +27,8 @@ $(eval $(call gb_Module_add_targets,vcl,\
StaticLibrary_vclmain \
Executable_ui-previewer \
$(if $(filter LINUX MACOSX WNT,$(OS)), \
- Executable_icontest)) \
+ Executable_icontest \
+ Executable_outdevgrind)) \
$(if $(filter-out ANDROID IOS WNT,$(OS)), \
Executable_svdemo \
Executable_svptest \
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 9b99ee3c1fa5..2e9543716e5f 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -17,17 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-// bootstrap stuff
-#include <rtl/bootstrap.hxx>
-#include <rtl/ustring.hxx>
-#include <comphelper/processfactory.hxx>
-#include <cppuhelper/servicefactory.hxx>
+#include <sal/main.h>
+#include <tools/extendapplicationenvironment.hxx>
+
#include <cppuhelper/bootstrap.hxx>
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
#include <vcl/dialog.hxx>
#include <vcl/outdev.hxx>
#include <vcl/virdev.hxx>
@@ -137,12 +136,14 @@ void setupMethodStubs( functor_vector_type& res )
aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),true) );
aMtf.AddAction( new MetaRectAction(aRect) );
+#ifdef FIXME_NEEDS_LOVE
add(res,
"DrawTextArray",
boost::bind(
&OutputDevice::DrawTextArray,
_1,
aPt1, aString, (const sal_Int32*)0, (sal_uInt16)0, aString.getLength() ));
+#endif
/* void DrawPixel( const Point& rPt, const Color& rColor ); */
add(res,
@@ -326,6 +327,7 @@ void setupMethodStubs( functor_vector_type& res )
_1,
aPt1,aPt3,aRect2.GetSize(),(sal_uInt16)0 ));
+#ifdef NEEDS_QUALIY_PARAMTER
/* void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
*/
@@ -376,6 +378,7 @@ void setupMethodStubs( functor_vector_type& res )
_1,
aPt1,aRect.GetSize(),aBitmap ));
+#if 0
/* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap );
@@ -391,6 +394,7 @@ void setupMethodStubs( functor_vector_type& res )
&OutputDevice::DrawBitmap),
_1,
aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapAlien ));
+#endif
/* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
@@ -687,6 +691,8 @@ void setupMethodStubs( functor_vector_type& res )
_1,
aPt1,aRect.GetSize(),aImage,(sal_uInt16)0 ));
+#endif // NEEDS_QUALITY_PARAMATER
+
/* void DrawGradient( const Rectangle& rRect, const Gradient& rGradient ); */
add(res,
"DrawGradient",
@@ -721,6 +727,7 @@ void setupMethodStubs( functor_vector_type& res )
_1,
aRect2,aWallpaper ));
+#ifdef FIXME_HAVE_WAVE_NORMAL
/* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ); */
add(res,
"DrawWaveLine",
@@ -728,6 +735,7 @@ void setupMethodStubs( functor_vector_type& res )
&OutputDevice::DrawWaveLine,
_1,
aPt1,aPt2,(sal_uInt16)WAVE_NORMAL ));
+#endif
/* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */
add(res,
@@ -783,7 +791,7 @@ void grindFunc( OutputDevice& rTarget,
iter->second(&rTarget);
if( rTarget.GetOutDevType() == OUTDEV_WINDOW )
- static_cast<Window&>(rTarget).Sync();
+ static_cast< vcl::Window & >( rTarget ).Sync();
fprintf( stdout,
"Duration: %d ms (%d repetitions)\tOperation: %s\tSetup: %s\n",
@@ -824,13 +832,13 @@ void outDevGrind( OutputDevice& rTarget, sal_Int32 nTurns=100 )
rTarget.SetLineColor( Color(COL_BLACK) );
rTarget.SetFillColor( Color(COL_GREEN) );
rTarget.SetRasterOp( ROP_OVERPAINT );
- rTarget.SetClipRegion( aClipRect );
+ rTarget.SetClipRegion( vcl::Region( aClipRect ) );
grindFunc( rTarget, iter, nTurns, "with rect clip, w/o xor" );
rTarget.SetLineColor( Color(COL_BLACK) );
rTarget.SetFillColor( Color(COL_GREEN) );
rTarget.SetRasterOp( ROP_OVERPAINT );
- rTarget.SetClipRegion( aClipPoly );
+ rTarget.SetClipRegion( vcl::Region( aClipPoly ) );
grindFunc( rTarget, iter, nTurns, "with complex clip, w/o xor" );
rTarget.SetLineColor( Color(COL_BLACK) );
@@ -842,13 +850,13 @@ void outDevGrind( OutputDevice& rTarget, sal_Int32 nTurns=100 )
rTarget.SetLineColor( Color(COL_BLACK) );
rTarget.SetFillColor( Color(COL_GREEN) );
rTarget.SetRasterOp( ROP_XOR );
- rTarget.SetClipRegion( aClipRect );
+ rTarget.SetClipRegion( vcl::Region( aClipRect ) );
grindFunc( rTarget, iter, nTurns, "with rect clip, with xor" );
rTarget.SetLineColor( Color(COL_BLACK) );
rTarget.SetFillColor( Color(COL_GREEN) );
rTarget.SetRasterOp( ROP_XOR );
- rTarget.SetClipRegion( aClipPoly );
+ rTarget.SetClipRegion( vcl::Region( aClipPoly ) );
grindFunc( rTarget, iter, nTurns, "with complex clip, with xor" );
++iter;
@@ -874,11 +882,21 @@ sal_uInt16 GrindApp::Exception( sal_uInt16 nError )
int GrindApp::Main()
{
+ TestWindow aWindow;
+ aWindow.Execute();
+ return 0;
+}
+
+} // namespace
+
+
+SAL_IMPLEMENT_MAIN()
+{
bool bHelp = false;
- for( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
+ for( sal_uInt16 i = 0; i < Application::GetCommandLineParamCount(); i++ )
{
- OUString aParam = GetCommandLineParam( i );
+ OUString aParam = Application::GetCommandLineParam( i );
if( aParam == "--help" || aParam == "-h" )
bHelp = true;
@@ -890,35 +908,24 @@ int GrindApp::Main()
return EXIT_SUCCESS;
}
- // create the global service-manager
- uno::Reference< lang::XMultiServiceFactory > xFactory;
- try
- {
- uno::Reference< uno::XComponentContext > xCtx = ::cppu::defaultBootstrap_InitialComponentContext();
- xFactory = uno::Reference< lang::XMultiServiceFactory >( xCtx->getServiceManager(),
- uno::UNO_QUERY );
- if( xFactory.is() )
- ::comphelper::setProcessServiceFactory( xFactory );
- }
- catch( uno::Exception& )
- {
- }
+ tools::extendApplicationEnvironment();
- if( !xFactory.is() )
- {
- fprintf( stderr,
- "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
- exit( 1 );
- }
+ uno::Reference< uno::XComponentContext > xContext = cppu::defaultBootstrap_InitialComponentContext();
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), uno::UNO_QUERY );
- TestWindow pWindow;
- pWindow.Execute();
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
- return EXIT_SUCCESS;
-}
+ comphelper::setProcessServiceFactory( xServiceManager );
-} // namespace
+ InitVCL();
+
+ GrindApp aGrindApp;
+ aGrindApp.Main();
-GrindApp aGrindApp;
+ DeInitVCL();
+
+ return EXIT_SUCCESS;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */