refactored to allow copying FixedImage to ios
Change-Id: Icecdae8ea2bb68c228f038758af8fb688ce9dd4a
This commit is contained in:
parent
9c253aeea1
commit
2ffb7509ec
@ -131,7 +131,7 @@ tilePosX, tilePosY, tileWidth, tileHeight address the part of the document to be
|
|||||||
context, contextHeight, contextWidth specify where to draw.
|
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_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);
|
void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state);
|
||||||
|
|
||||||
// Move the start of the selection to (x,y)
|
// Move the start of the selection to (x,y)
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* 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 <com/sun/star/accessibility/XAccessible.hpp>
|
||||||
#include <sfx2/viewfrm.hxx>
|
#include <sfx2/viewfrm.hxx>
|
||||||
#include <sfx2/progress.hxx>
|
#include <sfx2/progress.hxx>
|
||||||
@ -1761,7 +1767,7 @@ void SwViewShell::PaintTile(OutputDevice *pOut, const Rectangle &rRect)
|
|||||||
#if !HAVE_FEATURE_DESKTOP
|
#if !HAVE_FEATURE_DESKTOP
|
||||||
|
|
||||||
extern "C"
|
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
|
// 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
|
// current shell. Should it turn out that we need to have more documents
|
||||||
@ -1788,6 +1794,8 @@ void touch_lo_draw_tile(void * /*context*/, int contextWidth, int contextHeight,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern "C" void touch_ui_selection_none() {}
|
||||||
|
|
||||||
void SwViewShell::SetBrowseBorder( const Size& rNew )
|
void SwViewShell::SetBrowseBorder( const Size& rNew )
|
||||||
{
|
{
|
||||||
if( rNew != maBrowseBorder )
|
if( rNew != maBrowseBorder )
|
||||||
|
@ -345,7 +345,14 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg )
|
|||||||
CGRectIntersectsRect( invalidRect, bbox ) ) {
|
CGRectIntersectsRect( invalidRect, bbox ) ) {
|
||||||
|
|
||||||
const basebmp::BitmapDeviceSharedPtr aDevice = pFrame->getDevice();
|
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,
|
CGDataProviderCreateWithData( NULL,
|
||||||
aDevice->getBuffer().get(),
|
aDevice->getBuffer().get(),
|
||||||
aDevice->getSize().getY() * aDevice->getScanlineStride(),
|
aDevice->getSize().getY() * aDevice->getScanlineStride(),
|
||||||
@ -360,7 +367,7 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg )
|
|||||||
false,
|
false,
|
||||||
kCGRenderingIntentDefault );
|
kCGRenderingIntentDefault );
|
||||||
CGContextDrawImage( arg->context, bbox, image );
|
CGContextDrawImage( arg->context, bbox, image );
|
||||||
|
*/
|
||||||
// if current frame covers the whole invalidRect then break
|
// if current frame covers the whole invalidRect then break
|
||||||
if (CGRectEqualToRect(CGRectIntersection(invalidRect, bbox), invalidRect))
|
if (CGRectEqualToRect(CGRectIntersection(invalidRect, bbox), invalidRect))
|
||||||
{
|
{
|
||||||
@ -382,6 +389,31 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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"
|
extern "C"
|
||||||
void touch_lo_render_windows(void *context, int minX, int minY, int width, int height)
|
void touch_lo_render_windows(void *context, int minX, int minY, int width, int height)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user