include/touch/touch.h | 2 ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m | 1 sw/source/core/view/viewsh.cxx | 26 ++++++- vcl/ios/iosinst.cxx | 36 +++++++++- 4 files changed, 60 insertions(+), 5 deletions(-)
New commits: commit ef0d8a50f5d65ebcdc77af0749cfeaf74235f01c Author: Ptyl Dragon <p...@cloudon.com> Date: Thu Oct 24 11:28:42 2013 +0200 now showing blank tile Change-Id: I76cbf205e19ffff83bea1ebae28f5172b2fbc250 diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m index bcc2191..5dc9db1 100644 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m @@ -30,6 +30,7 @@ -(void)initScrollView{ self.scrollView = [UIScrollView new]; + self.scrollView.backgroundColor = [UIColor grayColor]; self.view = self.scrollView; } -(void)resize{ diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index bb50ea5..4cdb37d 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -55,7 +55,9 @@ #include <ndole.hxx> #include <ndindex.hxx> #include <accmap.hxx> +#include <vcl/bitmapex.hxx> #include <svtools/colorcfg.hxx> +#include <vcl/bmpacc.hxx> #include <svtools/accessibilityoptions.hxx> #include <accessibilityoptions.hxx> #include <statstr.hrc> @@ -64,6 +66,7 @@ #include <sortedobjs.hxx> #include <anchoredobject.hxx> #include <wrtsh.hxx> +#include <vcl/alpha.hxx> #include "../../ui/inc/view.hxx" #include <PostItMgr.hxx> @@ -1790,7 +1793,16 @@ void touch_lo_draw_tile(void * context, int contextWidth, int contextHeight, int aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight)); pViewShell->PaintTile(&aDevice, Rectangle(tilePosX, tilePosY, tileWidth, tileHeight)); - //TODO now get it to the 'context' + BitmapEx aBitmapEx(aDevice.GetBitmapEx(Point(0,0), aDevice.GetOutputSizePixel())); + Bitmap aBitmap = aBitmapEx.GetBitmap(); + BitmapReadAccess * readAccess = aBitmap.AcquireReadAccess(); + touch_lo_copy_buffer((void *) readAccess->GetBuffer(), + tileWidth, + tileHeight, + readAccess-> GetScanlineSize(), + context, + contextWidth, + contextHeight); } } commit 7569a946c8b9fb9bd814e4aff9f170cd92a8c30b Author: Ptyl Dragon <p...@cloudon.com> Date: Wed Oct 23 18:35:40 2013 +0200 refactored to allow copying FixedImage to ios Change-Id: Icecdae8ea2bb68c228f038758af8fb688ce9dd4a diff --git a/include/touch/touch.h b/include/touch/touch.h index 7dddaf3..979a8de 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -110,7 +110,7 @@ tilePosX, tilePosY, tileWidth, tileHeight address the part of the document to be context, contextHeight, contextWidth specify where to draw. */ void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, int tilePosX, int tilePosY, int tileWidth, int tileHeight); - +void touch_lo_copy_buffer(const void * source, size_t sourceWidth, size_t sourceHeight, size_t sourceBytesPerRow, void * target, size_t targetWidth, size_t targetHeight); void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state); // Move the start of the selection to (x,y) diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index a1a441e..bb50ea5 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -17,6 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifdef IOS + +#include <touch/touch.h> + +#endif + #include <com/sun/star/accessibility/XAccessible.hpp> #include <sfx2/viewfrm.hxx> #include <sfx2/progress.hxx> @@ -66,6 +72,8 @@ #include <vcl/svapp.hxx> #include <svx/sdrpaintwindow.hxx> + + sal_Bool ViewShell::mbLstAct = sal_False; ShellResource *ViewShell::mpShellRes = 0; Window *ViewShell::mpCareWindow = 0; @@ -1761,7 +1769,7 @@ void ViewShell::PaintTile(OutputDevice *pOut, const Rectangle &rRect) #if !HAVE_FEATURE_DESKTOP extern "C" -void touch_lo_draw_tile(void * /*context*/, int contextWidth, int contextHeight, int tilePosX, int tilePosY, int tileWidth, int tileHeight) +void touch_lo_draw_tile(void * context, int contextWidth, int contextHeight, int tilePosX, int tilePosY, int tileWidth, int tileHeight) { // Currently we expect that only one document is open, so we are using the // current shell. Should it turn out that we need to have more documents @@ -1788,6 +1796,8 @@ void touch_lo_draw_tile(void * /*context*/, int contextWidth, int contextHeight, #endif +extern "C" void touch_ui_selection_none() {} + void ViewShell::SetBrowseBorder( const Size& rNew ) { if( rNew != maBrowseBorder ) diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index c46ccce..39208f5 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -345,7 +345,14 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) CGRectIntersectsRect( invalidRect, bbox ) ) { const basebmp::BitmapDeviceSharedPtr aDevice = pFrame->getDevice(); - CGDataProviderRef provider = + touch_lo_copy_buffer(aDevice->getBuffer().get(), + aDevice->getSize().getX(), + aDevice->getSize().getY(), + aDevice->getScanlineStride(), + arg->context, + aGeom.nWidth, + aGeom.nHeight); + /*CGDataProviderRef provider = CGDataProviderCreateWithData( NULL, aDevice->getBuffer().get(), aDevice->getSize().getY() * aDevice->getScanlineStride(), @@ -360,7 +367,7 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) false, kCGRenderingIntentDefault ); CGContextDrawImage( arg->context, bbox, image ); - + */ // if current frame covers the whole invalidRect then break if (CGRectEqualToRect(CGRectIntersection(invalidRect, bbox), invalidRect)) { @@ -383,6 +390,31 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) } extern "C" +void +touch_lo_copy_buffer(const void * source, size_t sourceWidth, size_t sourceHeight, size_t sourceBytesPerRow, void * target, size_t targetWidth, size_t targetHeight){ + + CGDataProviderRef provider =CGDataProviderCreateWithData(NULL, + source, + sourceHeight * sourceBytesPerRow, + NULL ); + CGImage *sourceImage = CGImageCreate(sourceWidth, + sourceHeight, + 8, + 32, + sourceBytesPerRow, + CGColorSpaceCreateDeviceRGB(), + kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little, + provider, + NULL, + false, + kCGRenderingIntentDefault ); + CGContextRef context =(CGContextRef) target; + CGRect targetRect = CGRectMake( 0, 0, targetWidth, targetHeight ); + CGContextDrawImage( context, targetRect, sourceImage ); + CGImageRelease(sourceImage); +} + +extern "C" void touch_lo_render_windows(void *context, int minX, int minY, int width, int height) { CGContextRef cgContext = (CGContextRef) context; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits