diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-06-07 21:52:06 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-06-07 21:54:20 +0300 |
commit | 40c00297deadb5f19020a82520f53d02129f4852 (patch) | |
tree | 8e991ee10670865aeca0bd3a8e82555bd14cf00b /touch/source/uno | |
parent | e243a5b462408891c401f88bb3af3a661697f8f4 (diff) |
Clarify ideas a bit, DocumentRenderCallback service not needed
Change-Id: I0a91a45dace5d2a35daadf1c9233ab68bee8701e
Diffstat (limited to 'touch/source/uno')
-rw-r--r-- | touch/source/uno/Document.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/touch/source/uno/Document.cxx b/touch/source/uno/Document.cxx index 975e9ccca051..7d41698158c3 100644 --- a/touch/source/uno/Document.cxx +++ b/touch/source/uno/Document.cxx @@ -9,6 +9,7 @@ // NOTE: Work in progress, most likely makes little sense +#include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/awt/XDevice.hpp> #include <com/sun/star/awt/XToolkit.hpp> #include <com/sun/star/beans/NamedValue.hpp> @@ -40,10 +41,15 @@ private: uno::Reference< uno::XComponentContext > m_rContext; uno::Reference< lang::XComponent > m_xComponent; uno::Reference< frame::XController > m_xController; + uno::Reference< awt::XDevice > m_xDevice; uno::Reference< view::XRenderable > m_xRenderable; beans::PropertyValues m_aRenderProps; + // XRenderable.getRendererCount() and .render() need an XController in the + // properties, at least in the test Java code it seemed that a totally + // dummy one works, so try that here, too. + typedef ::cppu::WeakImplHelper1< frame::XController > MyXController_Base; class MyXController: @@ -160,9 +166,9 @@ protected: uno::Reference< awt::XToolkit > toolkit( m_rContext->getServiceManager()->createInstanceWithContext( "com.sun.star.awt.Toolkit", m_rContext ), uno::UNO_QUERY_THROW ); - uno::Reference< awt::XDevice > device( toolkit->createScreenCompatibleDevice( 1024, 1024 ) ); + m_xDevice = toolkit->createScreenCompatibleDevice( 1024, 1024 ); - m_xRenderable = uno::Reference< view::XRenderable >(m_rContext->getServiceManager()->createInstanceWithContext( "com.sun.star.view.Renderable", m_rContext ), uno::UNO_QUERY_THROW ); + m_xRenderable = uno::Reference< view::XRenderable >( m_rContext->getServiceManager()->createInstanceWithContext( "com.sun.star.view.Renderable", m_rContext ), uno::UNO_QUERY_THROW ); m_xController = new MyXController(); @@ -170,7 +176,7 @@ protected: m_aRenderProps[0].Name = "IsPrinter"; m_aRenderProps[0].Value <<= sal_Bool(true); m_aRenderProps[1].Name = "RenderDevice"; - m_aRenderProps[1].Value <<= device; + m_aRenderProps[1].Value <<= m_xDevice; m_aRenderProps[2].Name = "View"; m_aRenderProps[2].Value <<= m_xController; } @@ -197,13 +203,20 @@ protected: sal_Int32 y ) throw ( lang::IllegalArgumentException, uno::RuntimeException) { + uno::Any selection; + (void) buffer; (void) bufferSize; (void) listener; - (void) pageNo; (void) zoomLevel; (void) x; - (void) y ; + (void) y; + + selection <<= m_xComponent; + + m_xRenderable->render( pageNo, selection, m_aRenderProps ); + + uno::Reference< awt::XBitmap> bitmap( m_xDevice->createBitmap( 0, 0, 1024, 1024 ) ); } }; |