[Libreoffice-commits] .: vcl/inc vcl/ios

2013-01-19 Thread Libreoffice Gerrit user
 vcl/inc/ios/salcoretextfontutils.hxx|   12 -
 vcl/inc/ios/salcoretextstyle.hxx|6 
 vcl/inc/ios/salgdi.h|2 
 vcl/ios/source/gdi/salcoretextfontutils.cxx |  228 ++--
 vcl/ios/source/gdi/salcoretextlayout.cxx|   81 +
 vcl/ios/source/gdi/salcoretextstyle.cxx |   31 ++-
 vcl/ios/source/gdi/salgdi.cxx   |   25 ++-
 7 files changed, 201 insertions(+), 184 deletions(-)

New commits:
commit 0d816467302dae89fd2e326e97364d1d4db47e8e
Author: Tor Lillqvist t...@iki.fi
Date:   Tue Jan 15 22:23:07 2013 +0200

Fix iOS bit-rot and unify with OS X CoreText code

Adapt to the fairly pointless privatisations here, too. Unify with the
OS X CoreText code. Yeah, probably should unify physically, i.e. use
the same source files for both, with as little ifdefs as possible.

Change-Id: I63bc477f0c979769bb995db37a3c4194e8091b30

diff --git a/vcl/inc/ios/salcoretextfontutils.hxx 
b/vcl/inc/ios/salcoretextfontutils.hxx
index d1ee1b8..6293392 100644
--- a/vcl/inc/ios/salcoretextfontutils.hxx
+++ b/vcl/inc/ios/salcoretextfontutils.hxx
@@ -20,7 +20,7 @@
 #ifndef _VCL_IOS_CORETEXT_SALCORETEXTFONTUTILS_HXX
 #define _VCL_IOS_CORETEXT_SALCORETEXTFONTUTILS_HXX
 
-class ImplCoreTextFontData;
+class CoreTextPhysicalFontFace;
 class ImplDevFontList;
 
 #include boost/unordered_map.hpp
@@ -30,11 +30,11 @@ class ImplDevFontList;
 #include outfont.hxx
 #include impfont.hxx
 
-class ImplCoreTextFontData : public PhysicalFontFace
+class CoreTextPhysicalFontFace : public PhysicalFontFace
 {
 public:
-ImplCoreTextFontData(const ImplDevFontAttributes, CTFontRef font);
-virtual ~ImplCoreTextFontData();
+CoreTextPhysicalFontFace(const ImplDevFontAttributes, CTFontRef font);
+virtual ~CoreTextPhysicalFontFace();
 virtual PhysicalFontFace* Clone() const;
 virtual ImplFontEntry* CreateFontInstance( FontSelectPattern ) const;
 virtual sal_IntPtr GetFontId() const { return (sal_IntPtr)m_CTFontRef;};
@@ -70,10 +70,10 @@ public:
 ~SystemFontList();
 
 void AnnounceFonts( ImplDevFontList ) const;
-ImplCoreTextFontData* GetFontDataFromRef( CTFontRef ) const;
+CoreTextPhysicalFontFace* GetFontDataFromRef( CTFontRef ) const;
 
 private:
-typedef boost::unordered_mapCTFontRef,ImplCoreTextFontData* 
CoreTextFontContainer;
+typedef boost::unordered_mapCTFontRef,CoreTextPhysicalFontFace* 
CoreTextFontContainer;
 CoreTextFontContainer m_aFontContainer;
 
 void InitGlyphFallbacks();
diff --git a/vcl/inc/ios/salcoretextstyle.hxx b/vcl/inc/ios/salcoretextstyle.hxx
index 37a8de3..eafba51 100644
--- a/vcl/inc/ios/salcoretextstyle.hxx
+++ b/vcl/inc/ios/salcoretextstyle.hxx
@@ -23,7 +23,7 @@
 #include ios/salgdicommon.hxx
 
 class FontSelectPattern;
-class ImplCoreTextFontData;
+class CoreTextPhysicalFontFace;
 
 class CoreTextStyleInfo
 {
@@ -31,6 +31,7 @@ public:
 CoreTextStyleInfo();
 ~CoreTextStyleInfo();
 CTFontRef GetFont() const { return m_CTFont; };
+CoreTextPhysicalFontFace* GetFontFace() const { return m_font_face; };
 long GetFontStretchedSize() const;
 float GetFontStretchFactor() const { return m_stretch_factor; };
 CTParagraphStyleRef GetParagraphStyle() const { return m_CTParagraphStyle; 
} ;
@@ -50,8 +51,7 @@ private:
 CTParagraphStyleRef m_CTParagraphStyle;
 CTFontRef m_CTFont;
 CGColorRef m_color;
-const ImplCoreTextFontData* m_font_data;
-
+CoreTextPhysicalFontFace* m_font_face;
 };
 
 #endif // _VCL_AQUA_CORETEXT_SALCORETEXTSTYLE_HXX
diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h
index 51099be..ac00f8c 100644
--- a/vcl/inc/ios/salgdi.h
+++ b/vcl/inc/ios/salgdi.h
@@ -62,8 +62,6 @@ protected:
 RGBAColor maLineColor; // pen color RGBA
 RGBAColor maFillColor; // brush color RGBA
 
-ImplCoreTextFontData* m_pCoreTextFontData; // Device Font settings
-
 bool mbNonAntialiasedText; // allows text to be rendered without 
antialiasing
 
 // Graphics types
diff --git a/vcl/ios/source/gdi/salcoretextfontutils.cxx 
b/vcl/ios/source/gdi/salcoretextfontutils.cxx
index ade5711..06e2cfc 100644
--- a/vcl/ios/source/gdi/salcoretextfontutils.cxx
+++ b/vcl/ios/source/gdi/salcoretextfontutils.cxx
@@ -28,24 +28,24 @@
 
 static bool GetDevFontAttributes( CTFontDescriptorRef font_descriptor, 
ImplDevFontAttributes rDFA  )
 {
+int value = 0;
 
 // reset the attributes
-rDFA.meFamily = FAMILY_DONTKNOW;
-rDFA.mePitch  = PITCH_VARIABLE;
-rDFA.meWidthType  = WIDTH_NORMAL;
-rDFA.meWeight = WEIGHT_NORMAL;
-rDFA.meItalic = ITALIC_NONE;
-rDFA.mbSymbolFlag = false;
+rDFA.SetFamilyType( FAMILY_DONTKNOW );
+rDFA.SetPitch( PITCH_VARIABLE );
+rDFA.SetWidthType( WIDTH_NORMAL );
+rDFA.SetWeight( WEIGHT_NORMAL );
+rDFA.SetItalic( ITALIC_NONE );
+rDFA.SetSymbolFlag( false );
 rDFA.mbOrientation = true;
 rDFA.mbDevice  = true;
 rDFA.mnQuality = 

[Libreoffice-commits] .: vcl/inc vcl/ios

2012-11-06 Thread Libreoffice Gerrit user
 vcl/inc/ios/salgdi.h|8 ++--
 vcl/ios/source/gdi/salgdicommon.cxx |   26 +-
 2 files changed, 31 insertions(+), 3 deletions(-)

New commits:
commit f354ba7a3aba1301f3951fdd9f74a38bd94255af
Author: Tor Lillqvist t...@iki.fi
Date:   Tue Nov 6 16:39:47 2012 +0200

Unbreak compilation of the iOS vcl code

Note that this is code basically copy-pasted from the MacOSX (aqua)
back-end with some small edits, and it is not clear at all that it
will eventually be used in this form at all. But until then, let's
keep it compiling.

Change-Id: Ia1bd63f2ecc621cd4ce699ffc754cab423321d42

diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h
index 4743c88..9456d71 100644
--- a/vcl/inc/ios/salgdi.h
+++ b/vcl/inc/ios/salgdi.h
@@ -123,8 +123,12 @@ public:
 virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry );
 virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* 
pPoints,
 const SalPoint* const* pPtAry, 
const sal_uInt8* const* pFlgAry );
-virtual bool drawPolyLine( const ::basegfx::B2DPolygon, double 
fTransparency,
-   const ::basegfx::B2DVector rLineWidths, 
basegfx::B2DLineJoin );
+virtual booldrawPolyLine(
+const ::basegfx::B2DPolygon,
+double fTransparency,
+const ::basegfx::B2DVector rLineWidths,
+basegfx::B2DLineJoin,
+com::sun::star::drawing::LineCap eLineCap);
 
 // CopyArea -- No RasterOp, but ClipRegion
 virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, 
long nSrcWidth,
diff --git a/vcl/ios/source/gdi/salgdicommon.cxx 
b/vcl/ios/source/gdi/salgdicommon.cxx
index bba5735..8642a35 100644
--- a/vcl/ios/source/gdi/salgdicommon.cxx
+++ b/vcl/ios/source/gdi/salgdicommon.cxx
@@ -662,7 +662,8 @@ void IosSalGraphics::drawPixel( long nX, long nY, SalColor 
nSalColor )
 bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon rPolyLine,
 double fTransparency,
 const ::basegfx::B2DVector rLineWidths,
-basegfx::B2DLineJoin eLineJoin )
+basegfx::B2DLineJoin eLineJoin,
+com::sun::star::drawing::LineCap eLineCap )
 {
 // short circuit if there is nothing to do
 const int nPointCount = rPolyLine.count();
@@ -694,6 +695,28 @@ bool IosSalGraphics::drawPolyLine( const 
::basegfx::B2DPolygon rPolyLine,
 case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break;
 }
 
+// setup cap attribute
+CGLineCap aCGLineCap(kCGLineCapButt);
+
+switch(eLineCap)
+{
+default: // com::sun::star::drawing::LineCap_BUTT:
+{
+aCGLineCap = kCGLineCapButt;
+break;
+}
+case com::sun::star::drawing::LineCap_ROUND:
+{
+aCGLineCap = kCGLineCapRound;
+break;
+}
+case com::sun::star::drawing::LineCap_SQUARE:
+{
+aCGLineCap = kCGLineCapSquare;
+break;
+}
+}
+
 // setup poly-polygon path
 CGMutablePathRef xPath = CGPathCreateMutable();
 AddPolygonToPath( xPath, rPolyLine, rPolyLine.isClosed(), 
!getAntiAliasB2DDraw(), true );
@@ -711,6 +734,7 @@ bool IosSalGraphics::drawPolyLine( const 
::basegfx::B2DPolygon rPolyLine,
 CGContextSetShouldAntialias( mrContext, true );
 CGContextSetAlpha( mrContext, 1.0 - fTransparency );
 CGContextSetLineJoin( mrContext, aCGLineJoin );
+CGContextSetLineCap( mrContext, aCGLineCap );
 CGContextSetLineWidth( mrContext, rLineWidths.getX() );
 CGContextDrawPath( mrContext, kCGPathStroke );
 CGContextRestoreGState( mrContext );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: vcl/inc vcl/ios

2011-09-26 Thread Tor Lillqvist
 vcl/inc/ios/vcluiapp.h |1 
 vcl/ios/source/app/salinst.cxx |   69 +
 vcl/ios/source/app/salsys.cxx  |2 +
 vcl/ios/source/app/vcluiapp.mm |3 +
 vcl/ios/source/gdi/salgdi.cxx  |   58 ++-
 vcl/ios/source/window/salframe.cxx |   26 ++---
 vcl/ios/source/window/salmenu.cxx  |4 +-
 vcl/ios/source/window/salobj.cxx   |2 -
 8 files changed, 43 insertions(+), 122 deletions(-)

New commits:
commit 36e4ca307cb9f282f72231ae05c210469c31dfc2
Author: Tor Lillqvist t...@iki.fi
Date:   Mon Sep 26 21:31:28 2011 +0300

WaE: Silence warnings for the iOS code

No semantic changes, the iOS code still is mostly dummy.

diff --git a/vcl/inc/ios/vcluiapp.h b/vcl/inc/ios/vcluiapp.h
index df4a01e..7707b2b 100644
--- a/vcl/inc/ios/vcluiapp.h
+++ b/vcl/inc/ios/vcluiapp.h
@@ -43,7 +43,6 @@ class IosSalFrame;
 -(void)sendSuperEvent:(UIEvent*)pEvent;
 -(BOOL)application: (UIApplication*) app openFile: (NSString*)file;
 -(void)application: (UIApplication*) app openFiles: (NSArray*)files;
--(void)applicationWillTerminate: (UIApplication *) app;
 -(void)addFallbackMenuItem: (UIMenuItem*)pNewItem;
 -(void)removeFallbackMenuItem: (UIMenuItem*)pOldItem;
 @end
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
index f95930b..fb5bfb9 100644
--- a/vcl/ios/source/app/salinst.cxx
+++ b/vcl/ios/source/app/salinst.cxx
@@ -74,7 +74,6 @@ extern sal_Bool ImplSVMain();
 
 static int* gpnInit = 0;
 static bool bNoSVMain = true;
-static bool bLeftMain = false;
 // ---
 
 class IosDelayedSettingsChanged : public Timer
@@ -129,12 +128,13 @@ static void initUIApp()
 
 sal_Bool ImplSVMainHook( int * pnInit )
 {
+char sMain[] = main;
 gpnInit = pnInit;
 
 bNoSVMain = false;
 initUIApp();
 
-char* pArgv[] = { main, NULL };
+char* pArgv[] = { sMain, NULL };
 UIApplicationMain( 1, pArgv, NULL, NULL );
 
 return TRUE;   // indicate that ImplSVMainHook is implemented
@@ -588,6 +588,7 @@ void IosSalInstance::DestroyObject( SalObject* pObject )
 
 SalPrinter* IosSalInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter )
 {
+(void) pInfoPrinter;
 return NULL;
 }
 
@@ -603,6 +604,7 @@ void IosSalInstance::DestroyPrinter( SalPrinter* pPrinter )
 void IosSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
 {
 // ???
+(void) pList;
 }
 
 // ---
@@ -633,13 +635,18 @@ XubString IosSalInstance::GetDefaultPrinter()
 // ---
 
 SalInfoPrinter* IosSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* 
pQueueInfo,
-ImplJobSetup* pSetupData )
+   ImplJobSetup* pSetupData )
 {
+(void) pQueueInfo;
+(void) pSetupData;
+
 // #i113170# may not be the main thread if called from UNO API
 SalData::ensureThreadAutoreleasePool();
 
 SalInfoPrinter* pNewInfoPrinter = NULL;
+
 // ???
+
 return pNewInfoPrinter;
 }
 
@@ -688,61 +695,7 @@ void* IosSalInstance::GetConnectionIdentifier( 
ConnectionIdentifierType rReturn
 return (void*);
 }
 
-// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
-// to UTF-8 before encoding non ascii characters, which is not what other apps 
expect.
-static rtl::OUString translateToExternalUrl(const rtl::OUString internalUrl)
-{
-rtl::OUString extUrl;
-
-uno::Reference lang::XMultiServiceFactory  sm = 
comphelper::getProcessServiceFactory();
-if (sm.is())
-{
-uno::Reference beans::XPropertySet  pset;
-sm-queryInterface( getCppuType( pset )) = pset;
-if (pset.is())
-{
-uno::Reference uno::XComponentContext  context;
-static const rtl::OUString DEFAULT_CONTEXT( 
RTL_CONSTASCII_USTRINGPARAM( DefaultContext ) );
-pset-getPropertyValue(DEFAULT_CONTEXT) = context;
-if (context.is())
-extUrl = 
uri::ExternalUriReferenceTranslator::create(context)-translateToExternal(internalUrl);
-}
-}
-return extUrl;
-}
-
-// #i104525# many versions of OSX have problems with some URLs:
-// when an app requests OSX to add one of these URLs to the Recent Items list
-// then this app gets killed (TextEdit, Preview, etc. and also OOo)
-static bool isDangerousUrl( const rtl::OUString rUrl )
-{
-// use a heuristic that detects all known cases since there is no official 
comment
-// on the exact impact and root cause of the OSX bug
-const int nLen = rUrl.getLength();
-const sal_Unicode* p = rUrl.getStr();
-for( int i = 0; i  nLen-3; ++i, ++p ) {
-if( p[0] != '%' )
-continue;
-// escaped percent?
-if( (p[1] == '2')  (p[2] == '5') )
-return