[Libreoffice-commits] core.git: desktop/source ios/CustomTarget_Viewer_app.mk ios/Executable_Viewer.mk ios/experimental sal/inc sal/osl toolkit/source vcl/aqua vcl/coretext vcl/headless vcl/inc vcl/ios vcl/Library_vcl.mk vcl/quartz vcl/source

Tor Lillqvist tml at iki.fi
Thu Mar 21 04:30:07 PDT 2013


 desktop/source/app/sofficemain.cxx                    |   12 
 desktop/source/app/userinstall.cxx                    |   12 
 ios/CustomTarget_Viewer_app.mk                        |    2 
 ios/Executable_Viewer.mk                              |   10 
 ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h  |   19 
 ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm |   31 
 ios/experimental/Viewer/Viewer/LOViewerWindow.h       |   17 
 ios/experimental/Viewer/Viewer/LOViewerWindow.m       |   26 
 ios/experimental/Viewer/Viewer/lo-viewer.h            |    1 
 ios/experimental/Viewer/Viewer/lo-viewer.mm           |   69 
 ios/experimental/Viewer/Viewer/main.mm                |    1 
 sal/inc/osl/detail/ios-bootstrap.h                    |   54 
 sal/osl/unx/security.c                                |    4 
 toolkit/source/awt/vclxsystemdependentwindow.cxx      |   15 
 toolkit/source/awt/vclxtoolkit.cxx                    |   10 
 toolkit/source/awt/vclxtopwindow.cxx                  |   11 
 toolkit/source/awt/vclxwindow1.cxx                    |    6 
 vcl/Library_vcl.mk                                    |   50 
 vcl/aqua/source/a11y/aqua11yactionwrapper.mm          |    1 
 vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm       |    2 
 vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm  |    1 
 vcl/aqua/source/a11y/aqua11ytextwrapper.mm            |    2 
 vcl/aqua/source/a11y/aqua11ywrapper.mm                |    2 
 vcl/aqua/source/app/salinst.cxx                       |   44 
 vcl/aqua/source/app/salsys.cxx                        |    1 
 vcl/aqua/source/app/vclnsapp.mm                       |    1 
 vcl/aqua/source/gdi/aquaprintaccessoryview.mm         |    1 
 vcl/aqua/source/gdi/salprn.cxx                        |    1 
 vcl/aqua/source/window/salframe.cxx                   |    1 
 vcl/aqua/source/window/salframeview.mm                |    1 
 vcl/aqua/source/window/salmenu.cxx                    |    1 
 vcl/coretext/salcoretextfontutils.cxx                 |    6 
 vcl/coretext/salcoretextlayout.cxx                    |    5 
 vcl/coretext/salgdi.cxx                               |   43 
 vcl/headless/svpgdi.cxx                               |    9 
 vcl/inc/aqua/atsui/salgdi.h                           |    2 
 vcl/inc/aqua/salgdicommon.hxx                         |   79 
 vcl/inc/aqua/salinst.h                                |    5 
 vcl/inc/coretext/salcoretextfontutils.hxx             |    1 
 vcl/inc/coretext/salcoretextstyle.hxx                 |    6 
 vcl/inc/coretext/salgdi.h                             |   46 
 vcl/inc/headless/svpgdi.hxx                           |   29 
 vcl/inc/ios/iosinst.hxx                               |   60 
 vcl/inc/ios/saldata.hxx                               |  100 -
 vcl/inc/ios/salframe.h                                |  206 --
 vcl/inc/ios/salframeview.h                            |   60 
 vcl/inc/ios/salgdicommon.hxx                          |   79 
 vcl/inc/ios/salinst.h                                 |  172 -
 vcl/inc/ios/salmathutils.hxx                          |   81 
 vcl/inc/ios/salmenu.h                                 |   44 
 vcl/inc/ios/salnstimer.h                              |   34 
 vcl/inc/ios/salobj.h                                  |   72 
 vcl/inc/ios/salprn.h                                  |  164 -
 vcl/inc/ios/salsys.h                                  |   45 
 vcl/inc/ios/saltimer.h                                |   45 
 vcl/inc/ios/saluimenu.h                               |   53 
 vcl/inc/ios/salvd.h                                   |   67 
 vcl/inc/ios/vcluiapp.h                                |   43 
 vcl/inc/quartz/salbmp.h                               |    2 
 vcl/inc/quartz/salgdicommon.hxx                       |   87 
 vcl/inc/quartz/utils.h                                |   37 
 vcl/inc/saldatabasic.hxx                              |    9 
 vcl/inc/vcl/sysdata.hxx                               |   10 
 vcl/ios/dummies.cxx                                   |  146 +
 vcl/ios/iosinst.cxx                                   |  312 +++
 vcl/ios/source/app/saldata.cxx                        |   72 
 vcl/ios/source/app/salinst.cxx                        |  806 ---------
 vcl/ios/source/app/salnstimer.mm                      |   48 
 vcl/ios/source/app/salsys.cxx                         |  239 --
 vcl/ios/source/app/saltimer.cxx                       |   93 -
 vcl/ios/source/app/vcluiapp.mm                        |   90 -
 vcl/ios/source/dtrans/iOSTransferable.cxx             |  179 --
 vcl/ios/source/dtrans/iOSTransferable.hxx             |   86 
 vcl/ios/source/dtrans/ios_clipboard.cxx               |  377 ----
 vcl/ios/source/dtrans/ios_clipboard.hxx               |  173 -
 vcl/ios/source/dtrans/service_entry.cxx               |   62 
 vcl/ios/source/gdi/salgdicommon.cxx                   | 1599 ------------------
 vcl/ios/source/gdi/salgdiutils.cxx                    |  304 ---
 vcl/ios/source/gdi/salnativewidgets.cxx               |  249 --
 vcl/ios/source/gdi/salvd.cxx                          |  249 --
 vcl/ios/source/window/salframe.cxx                    | 1106 ------------
 vcl/ios/source/window/salframeview.mm                 |  263 --
 vcl/ios/source/window/salmenu.cxx                     |   62 
 vcl/ios/source/window/salobj.cxx                      |  201 --
 vcl/quartz/salbmp.cxx                                 |    9 
 vcl/quartz/utils.cxx                                  |   67 
 vcl/source/window/syschild.cxx                        |    3 
 vcl/source/window/window.cxx                          |   14 
 88 files changed, 1012 insertions(+), 7907 deletions(-)

New commits:
commit 63dcca42cebd3cb6f020ec75c0d225e1d7232e1c
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Mar 20 09:07:52 2013 +0200

    Re-work the vcl aspects of the iOS port
    
    Don't try to use similar code as for OS X to manage windows, events
    etc. I.e. don't use UIKit in vcl to do that. Instead, just do as in
    the Android port, use the "headless" vcl backend. Do keep using
    CoreText, though, not FreeType & fontconfig.
    
    Start changing the iOS "Viewer" app to correspond to the Android
    "desktop" app (so it should be renamed).
    
    Work in progress since a long time, several crucial details still
    missing, but committing for now.
    
    Change-Id: Iac5fbf8def415e4d0d21e5200450a373420ad7ee

diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 6bd67fb..f1ca802 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -89,16 +89,24 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
 #endif
 }
 
-#ifdef ANDROID
+#if defined(ANDROID) || defined(IOS)
 
+#ifdef ANDROID
 extern "C" SAL_JNI_EXPORT void JNICALL
 Java_org_libreoffice_experimental_desktop_Desktop_runMain(JNIEnv* /* env */,
                                                           jobject /* clazz */)
+#else
+extern "C"
+void
+lo_runMain()
+#endif
 {
     int nRet;
     do {
         nRet = soffice_main();
-        LOGI("soffice_main returned %d", nRet );
+#ifdef ANDROID
+        LOGI("soffice_main returned %d", nRet);
+#endif
     } while (nRet == EXITHELPER_NORMAL_RESTART ||
              nRet == EXITHELPER_CRASH_WITH_RESTART); // pretend to re-start.
 
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 612a804..1ae05ce 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -116,6 +116,7 @@ namespace desktop {
         }
     }
 
+#if !defined(ANDROID) && !defined(IOS)
     static osl::FileBase::RC copy_recursive( const rtl::OUString& srcUnqPath, const rtl::OUString& dstUnqPath)
     {
         FileBase::RC err;
@@ -166,14 +167,9 @@ namespace desktop {
             err = File::copy( srcUnqPath,dstUnqPath );
         }
 
-#ifdef ANDROID
-        fprintf (stderr, "copy_recursive '%s' to '%s' returns (%d)0x%x\n",
-                 rtl::OUStringToOString(srcUnqPath, RTL_TEXTENCODING_UTF8).getStr(),
-                 rtl::OUStringToOString(dstUnqPath, RTL_TEXTENCODING_UTF8).getStr(),
-                 (int)err, (int)err);
-#endif
         return err;
     }
+#endif
 
     static UserInstall::UserInstallStatus create_user_install(OUString& aUserPath)
     {
@@ -185,12 +181,12 @@ namespace desktop {
         FileBase::RC rc = Directory::createPath(aUserPath);
         if ((rc != FileBase::E_None) && (rc != FileBase::E_EXIST)) return UserInstall::E_Creation;
 
-#ifdef UNIX
+#if defined(UNIX) && !defined(ANDROID) && !defined(IOS)
         // Set safer permissions for the user directory by default:
         File::setAttributes(aUserPath, osl_File_Attribute_OwnWrite| osl_File_Attribute_OwnRead| osl_File_Attribute_OwnExe);
 #endif
 
-#ifndef ANDROID
+#if !defined(ANDROID) && !defined(IOS)
         // as of now osl_copyFile does not work on Android => don't do this.
 
         // Copy data from shared data directory of base installation:
diff --git a/ios/CustomTarget_Viewer_app.mk b/ios/CustomTarget_Viewer_app.mk
index 03daa6a..cd79db1 100644
--- a/ios/CustomTarget_Viewer_app.mk
+++ b/ios/CustomTarget_Viewer_app.mk
@@ -114,7 +114,7 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer)
 		echo '[Bootstrap]' && \
 		echo 'InstallMode=<installmode>' && \
 		echo 'ProductKey=LibreOffice Viewer $(PRODUCTVERSION)' && \
-		echo 'UserInstallation=file://$$APP_DATA_DIR' && \
+		echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
 	: ) > $(appdir)/program/bootstraprc
 #
 # Is this really needed?
diff --git a/ios/Executable_Viewer.mk b/ios/Executable_Viewer.mk
index d529621..edfc498 100644
--- a/ios/Executable_Viewer.mk
+++ b/ios/Executable_Viewer.mk
@@ -27,6 +27,10 @@ $(eval $(call gb_Executable_add_objcxxobjects,Viewer,\
     ios/experimental/Viewer/Viewer/main \
 ))
 
+$(eval $(call gb_Executable_add_objcobjects,Viewer,\
+    ios/experimental/Viewer/Viewer/LOViewerWindow \
+))
+
 # The executables built for iOS link to all LO libs statically. The
 # link command just uses the wildcard function to list all of them.
 # Instead of tediously here declare dependencies on the transitive
@@ -41,4 +45,10 @@ $(eval $(call gb_Executable_use_libraries,Viewer,\
 	swui \
 ))
 
+# Mark the executable as depending on all libraries so that it gets
+# rebuilt if any library has been rebuilt. Avoids need for "make
+# ios.clean".
+
+$(call gb_LinkTarget_get_target,Executable/Viewer) : $(wildcard $(OUTDIR)/lib/lib*.a)
+
 # vim: set ts=4 sw=4 et:
diff --git a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h
index 7f4b724..c1737a0 100644
--- a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h
+++ b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h
@@ -1,16 +1,23 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 //
-//  LOViewerAppDelegate.h
-//  Viewer
-//
-//  Created by Tor Lillqvist on 2012-11-27.
-//  Copyright (c) 2012 Tor Lillqvist. All rights reserved.
+// This file is part of the LibreOffice project.
 //
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #import <UIKit/UIKit.h>
 
+#import "LOViewerWindow.h"
+
 @interface LOViewerAppDelegate : UIResponder <UIApplicationDelegate>
+{
+  int nbytes;
+  char *pixelBuffer;
+  CGImageRef image;
+}
 
- at property (strong, nonatomic) UIWindow *window;
+ at property (strong, nonatomic) LOViewerWindow *window;
 
 - (void) threadMainMethod: (id) argument;
 
diff --git a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm
index cc1e8d2..f9678c4 100644
--- a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm
+++ b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm
@@ -5,16 +5,20 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
 
 #include <stdlib.h>
 
 #import <UIKit/UIKit.h>
 
+#include <osl/detail/ios-bootstrap.h>
+
 #import "LOViewerAppDelegate.h"
+#import "LOViewerWindow.h"
 
 #include "lo-viewer.h"
 
+static UIWindow *theWindow;
+
 @implementation LOViewerAppDelegate
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
@@ -22,10 +26,25 @@
     (void) application;
     (void) launchOptions;
 
-    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    CGRect bounds = [[UIScreen mainScreen] bounds];
+    self.window = [[LOViewerWindow alloc] initWithFrame:bounds];
+
+    theWindow = self.window;
 
     self.window.backgroundColor = [UIColor whiteColor];
 
+    nbytes = bounds.size.width * bounds.size.height * 4;
+
+    pixelBuffer = (char *) malloc(nbytes);
+    memset(pixelBuffer, 0xFF, nbytes);
+
+    CGDataProviderRef provider = CGDataProviderCreateWithData( NULL, pixelBuffer, nbytes, NULL);
+    image = CGImageCreate(bounds.size.width, bounds.size.height, 8, 32, bounds.size.width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaFirst, provider, NULL, false, kCGRenderingIntentDefault);
+
+    self.window.bounds = bounds;
+    self.window.pixelBuffer = pixelBuffer;
+    self.window.image = image;
+
     [self.window makeKeyAndVisible];
 
     NSThread* thread = [[NSThread alloc] initWithTarget:self
@@ -41,9 +60,8 @@
     (void) argument;
 
     @autoreleasepool {
-
         lo_initialize();
-
+        lo_runMain();
     }
 }
 
@@ -86,4 +104,9 @@
 
 @end
 
+extern "C" void lo_damaged()
+{
+    [theWindow performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:YES];
+}
+
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/experimental/Viewer/Viewer/LOViewerWindow.h b/ios/experimental/Viewer/Viewer/LOViewerWindow.h
new file mode 100644
index 0000000..b8f509f
--- /dev/null
+++ b/ios/experimental/Viewer/Viewer/LOViewerWindow.h
@@ -0,0 +1,17 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
+#import <UIKit/UIKit.h>
+
+ at interface LOViewerWindow : UIWindow
+ at property CGRect bounds;
+ at property char *pixelBuffer;
+ at property CGImageRef image;
+- (void)drawRect:(CGRect)rect;
+ at end
diff --git a/ios/experimental/Viewer/Viewer/LOViewerWindow.m b/ios/experimental/Viewer/Viewer/LOViewerWindow.m
new file mode 100644
index 0000000..1ce9103
--- /dev/null
+++ b/ios/experimental/Viewer/Viewer/LOViewerWindow.m
@@ -0,0 +1,26 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#import "LOViewerWindow.h"
+
+#include <osl/detail/ios-bootstrap.h>
+
+ at implementation LOViewerWindow
+
+- (void)drawRect:(CGRect)rect
+{
+    (void) rect;
+
+    lo_render_windows([self pixelBuffer], [self bounds].size.width, [self bounds].size.height);
+
+    CGContextRef context = UIGraphicsGetCurrentContext();
+
+    CGContextDrawImage(context, [self bounds], [self image]);
+}
+
+ at end
diff --git a/ios/experimental/Viewer/Viewer/lo-viewer.h b/ios/experimental/Viewer/Viewer/lo-viewer.h
index 1ce2031..9d08e3a 100644
--- a/ios/experimental/Viewer/Viewer/lo-viewer.h
+++ b/ios/experimental/Viewer/Viewer/lo-viewer.h
@@ -5,7 +5,6 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
 
 #ifndef LO_VIEWER_H
 #define LO_VIEWER_H
diff --git a/ios/experimental/Viewer/Viewer/lo-viewer.mm b/ios/experimental/Viewer/Viewer/lo-viewer.mm
index ff543fc..97669f1 100644
--- a/ios/experimental/Viewer/Viewer/lo-viewer.mm
+++ b/ios/experimental/Viewer/Viewer/lo-viewer.mm
@@ -5,7 +5,6 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
 
 #include <stdlib.h>
 
@@ -72,6 +71,7 @@ extern "C" {
     extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
     extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
     extern void * unordf_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+    extern void * uui_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
     extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
     extern void * xmlsecurity_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
     extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -108,6 +108,7 @@ lo_get_libmap(void)
         { "libsdlo.a", sd_component_getFactory },
         { "libsmdlo.a", smd_component_getFactory },
         { "libsmlo.a", sm_component_getFactory },
+        { "libspelllo.a", spell_component_getFactory },
         { "libsvgfilterlo.a", svgfilter_component_getFactory },
         { "libswdlo.a", swd_component_getFactory },
         { "libswlo.a", sw_component_getFactory },
@@ -115,6 +116,7 @@ lo_get_libmap(void)
         { "libtextfdlo.a", textfd_component_getFactory },
         { "libunordflo.a", unordf_component_getFactory },
         { "libunoxmllo.a", unoxml_component_getFactory },
+        { "libuuilo.a", uui_component_getFactory },
         { "libxmlfdlo.a", xmlfd_component_getFactory },
         { "libxmlsecurity.a", xmlsecurity_component_getFactory },
         { "libxoflo.a", xof_component_getFactory },
@@ -134,7 +136,8 @@ lo_initialize(void)
         "placeholder-exe",
         "-env:URE_INTERNAL_LIB_DIR=file:///",
         "placeholder-uno-types",
-        "placeholder-uno-services"
+        "placeholder-uno-services",
+        "placeholder-document"
     };
 
     const int argc = sizeof(argv)/sizeof(*argv);
@@ -154,8 +157,8 @@ lo_initialize(void)
     uno_types = [uno_types stringByAppendingString: @" file://"];
     uno_types = [uno_types stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: @"offapi.rdb"]];
 
-    assert(strcmp(argv[argc-2], "placeholder-uno-types") == 0);
-    argv[argc-2] = [uno_types UTF8String];
+    assert(strcmp(argv[2], "placeholder-uno-types") == 0);
+    argv[2] = [uno_types UTF8String];
 
     NSString *uno_services = @"-env:UNO_SERVICES=";
 
@@ -165,59 +168,11 @@ lo_initialize(void)
     uno_services = [uno_services stringByAppendingString: @" file://"];
     uno_services = [uno_services stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: @"services.rdb"]];
 
-    assert(strcmp(argv[argc-1], "placeholder-uno-services") == 0);
-    argv[argc-1] = [uno_services UTF8String];
-
-    osl_setCommandArgs(argc, (char **) argv);
-
-    try {
-
-        // Should start a background thread to do all this UNO
-        // initialisation crap
-
-        uno::Reference< uno::XComponentContext > xContext(::cppu::defaultBootstrap_InitialComponentContext());
-
-        uno::Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager() );
-
-        uno::Reference< lang::XMultiServiceFactory > xSM( xFactory, uno::UNO_QUERY_THROW );
-
-        comphelper::setProcessServiceFactory( xSM );
+    assert(strcmp(argv[3], "placeholder-uno-services") == 0);
+    argv[3] = [uno_services UTF8String];
 
-        InitVCL();
+    assert(strcmp(argv[4], "placeholder-document") == 0);
+    argv[4] = [[app_root_escaped stringByAppendingPathComponent: @"test1.odt"] UTF8String];
 
-        // Yes, this code does of course not belong here. Once this
-        // turns into something that actually displays something and
-        // has a proper app lifecycle etc that willl be fixed. But for
-        // now this is just a test, not supposed to work in any sane
-        // way from a "user" POV, and it doesn't matter that we do
-        // this here.
-
-        uno::Reference< uno::XInterface > xDesktop =
-            xFactory->createInstanceWithContext( "com.sun.star.frame.Desktop", xContext );
-        uno::Reference< frame::XComponentLoader > xComponentLoader( xDesktop, uno::UNO_QUERY_THROW );
-
-        uno::Reference< uno::XInterface > xToolkitService =
-            xFactory->createInstanceWithContext( "com.sun.star.awt.Toolkit", xContext );
-
-        uno::Reference< awt::XToolkitExperimental > xToolkit( xToolkitService, uno::UNO_QUERY_THROW );
-
-        char *smallbb = new char[ SMALLSIZE*SMALLSIZE*4 ];
-
-        uno::Reference< awt::XDevice > xDummyDevice = xToolkit->createScreenCompatibleDeviceUsingBuffer( SMALLSIZE, SMALLSIZE, 1, 1, 0, 0, (sal_Int64) (intptr_t) smallbb);
-
-        uno::Sequence< beans::PropertyValue > loadProps(3);
-
-        loadProps[0].Name = "Hidden";
-        loadProps[0].Value <<= sal_True;
-        loadProps[1].Name = "ReadOnly";
-        loadProps[1].Value <<= sal_True;
-        loadProps[2].Name = "Preview";
-        loadProps[2].Value <<= sal_True;
-
-        OUString test1_odt( OUString( "file://" ) + OUString::createFromAscii( [[app_root_escaped stringByAppendingPathComponent: @"test1.odt"] UTF8String] ));
-        uno::Reference< lang::XComponent > xDoc = xComponentLoader->loadComponentFromURL ( test1_odt, "_blank", 0, loadProps );
-    }
-    catch ( uno::Exception e ) {
-        SAL_WARN("Viewer", e.Message);
-    }
+    osl_setCommandArgs(argc, (char **) argv);
 }
diff --git a/ios/experimental/Viewer/Viewer/main.mm b/ios/experimental/Viewer/Viewer/main.mm
index 247c2dc..401cda5 100644
--- a/ios/experimental/Viewer/Viewer/main.mm
+++ b/ios/experimental/Viewer/Viewer/main.mm
@@ -5,7 +5,6 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
 
 #import <UIKit/UIKit.h>
 
diff --git a/sal/inc/osl/detail/ios-bootstrap.h b/sal/inc/osl/detail/ios-bootstrap.h
index 5e4ced7..d5fd947 100644
--- a/sal/inc/osl/detail/ios-bootstrap.h
+++ b/sal/inc/osl/detail/ios-bootstrap.h
@@ -1,30 +1,10 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ * This file is part of the LibreOffice project.
  *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License or as specified alternatively below. You may obtain a copy of
- * the License at http: *www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Major Contributor(s):
- * Copyright (C) 2011 Tor Lillqvist <tml at iki.fi> (initial developer)
- * Copyright (C) 2011 SUSE Linux http://suse.com (initial developer's employer)
- *
- * All Rights Reserved.
- *
- * For minor contributions see the git repository.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 #ifndef IOS_BOOSTRAP_H
@@ -38,6 +18,32 @@ extern "C" {
 
 #include <osl/detail/component-mapping.h>
 
+/* These functions are the interface between the upper GUI layers of a
+ * LibreOffice-based iOS app and the lower "core" layers, used in cases
+ * where the core parts need to call functions in the upper parts or
+ * vice versa.
+ *
+ * Thus there are two classes of functions here:
+ *
+ * 1) Those to be implemented in the upper layer and called by the
+ * lower layer
+ *
+ * 2) Those implmented in the lower layers to be called by the upper
+ * layer, in cases where we don't want to include a bunch of the
+ * "normal" LibreOffice C++ headers in an otherwise purely Objective-C
+ * CocoaTouch-based source file. Of course it depends on the case
+ * where that is wanted, and this all is work in progress.
+ */
+
+/* 1) */
+
+void lo_damaged();
+
+/* 2) */
+
+void lo_runMain();
+void lo_render_windows(char *pixelBuffer, int width, int height);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.c
index 7cb3fc0..82f97a9 100644
--- a/sal/osl/unx/security.c
+++ b/sal/osl/unx/security.c
@@ -389,7 +389,7 @@ sal_Bool SAL_CALL osl_getConfigDir(oslSecurity Security, rtl_uString **pustrDire
     return bRet;
 }
 
-#ifndef MACOSX
+#if !defined(MACOSX) && !defined(IOS)
 
 #define DOT_CONFIG "/.config"
 
@@ -431,7 +431,7 @@ static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* ps
  * support for Objective-C in the build environment
  */
 
-#define MACOSX_CONFIG_DIR "/Library/Application Support"
+#define MACOSX_CONFIG_DIR "/Library/Application Support" /* Used on iOS, too */
 static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax)
 {
     if( osl_psz_getHomeDir(Security, pszDirectory, nMax - sizeof(MACOSX_CONFIG_DIR) + 1) )
diff --git a/toolkit/source/awt/vclxsystemdependentwindow.cxx b/toolkit/source/awt/vclxsystemdependentwindow.cxx
index d05eacf..e156879 100644
--- a/toolkit/source/awt/vclxsystemdependentwindow.cxx
+++ b/toolkit/source/awt/vclxsystemdependentwindow.cxx
@@ -33,12 +33,6 @@
 #include "postmac.h"
 #endif
 
-#ifdef IOS
-#include "premac.h"
-#include <UIKit/UIKit.h>
-#include "postmac.h"
-#endif
-
 #include <vcl/svapp.hxx>
 #include <vcl/syschild.hxx>
 #include <vcl/sysdata.hxx>
@@ -90,11 +84,6 @@ IMPL_XTYPEPROVIDER_END
             {
                  aRet <<= (sal_IntPtr)pSysData->pView;
             }
-#elif (defined IOS)
-            if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_IOS )
-            {
-                 aRet <<= (sal_IntPtr)pSysData->pView;
-            }
 #elif (defined UNX)
             if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
             {
@@ -109,8 +98,4 @@ IMPL_XTYPEPROVIDER_END
     return aRet;
 }
 
-
-
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index e0e62b0..31fdb3a 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -59,12 +59,6 @@
 using org::libreoffice::touch::ByteBufferWrapper;
 #endif
 
-#ifdef IOS
-#include "premac.h"
-#include <UIKit/UIKit.h>
-#include "postmac.h"
-#endif
-
 #include <vcl/sysdata.hxx>
 
 #include <toolkit/awt/vclxwindows.hxx>
@@ -942,8 +936,6 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
                                     aParentData.nSize   = sizeof( aParentData );
                                     #if defined MACOSX
                                     aParentData.pView   = reinterpret_cast<NSView*>(nWindowHandle);
-                                    #elif defined IOS
-                                    aParentData.pView   = reinterpret_cast<UIView*>(nWindowHandle);
                                     #elif defined UNX
                                     aParentData.aWindow = nWindowHandle;
                                     aParentData.bXEmbedSupport = bXEmbed;
@@ -1189,8 +1181,6 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
             aParentData.nSize   = sizeof( aParentData );
             #if defined MACOSX
             aParentData.pView   = reinterpret_cast<NSView*>(nWindowHandle);
-            #elif defined IOS
-            aParentData.pView   = reinterpret_cast<UIView*>(nWindowHandle);
             #elif defined UNX
             aParentData.aWindow = nWindowHandle;
             aParentData.bXEmbedSupport = bXEmbed;
diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx
index dc80565..a4758ac 100644
--- a/toolkit/source/awt/vclxtopwindow.cxx
+++ b/toolkit/source/awt/vclxtopwindow.cxx
@@ -26,12 +26,6 @@
 #include "postmac.h"
 #endif
 
-#if defined ( IOS )
-#include "premac.h"
-#include <UIKit/UIKit.h>
-#include "postmac.h"
-#endif
-
 #include <vcl/syschild.hxx>
 #include <vcl/sysdata.hxx>
 #include <cppuhelper/typeprovider.hxx>
@@ -102,11 +96,6 @@ Sequence< Type > VCLXTopWindow_Base::getTypes() throw(RuntimeException)
             {
                  aRet <<= (sal_IntPtr)pSysData->pView;
             }
-#elif (defined IOS)
-            if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_IOS )
-            {
-                 aRet <<= (sal_IntPtr)pSysData->pView;
-            }
 #elif (defined UNX)
             if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
             {
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index ffea1f6..029c3bc 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -32,10 +32,6 @@
 #include "premac.h"
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
-#elif defined ( IOS )
-#include "premac.h"
-#include <UIKit/UIKit.h>
-#include "postmac.h"
 #endif
 #include <vcl/sysdata.hxx>
 
@@ -89,8 +85,6 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle )
     aSysParentData.hWnd = (HWND) nHandle;
 #elif defined( MACOSX )
     aSysParentData.pView = reinterpret_cast<NSView*>(nHandle);
-#elif defined( IOS )
-    aSysParentData.pView = reinterpret_cast<UIView*>(nHandle);
 #elif defined( UNX )
     aSysParentData.aWindow = (long)nHandle;
     aSysParentData.bXEmbedSupport = bXEmbed;
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 71f8da8..64456e1 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -346,11 +346,15 @@ $(eval $(call gb_Library_use_packages,vcl,\
 	basebmp_inc \
 ))
 
-vcl_coretext_code=\
+vcl_quartz_code= \
+    vcl/quartz/salbmp \
+    vcl/quartz/utils \
+
+vcl_coretext_code= \
     vcl/coretext/salcoretextfontutils \
     vcl/coretext/salcoretextlayout \
     vcl/coretext/salcoretextstyle \
-    vcl/coretext/salgdi
+    vcl/coretext/salgdi \
 
 # GUIBASE specific stuff
 
@@ -442,7 +446,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/aqua/source/dtrans/PictToBmpFlt \
     vcl/aqua/source/dtrans/aqua_clipboard \
     vcl/aqua/source/dtrans/service_entry \
-    vcl/quartz/salbmp \
+    $(vcl_quartz_code) \
     vcl/aqua/source/gdi/salgdicommon \
     vcl/aqua/source/gdi/salgdiutils \
     vcl/aqua/source/gdi/salmathutils \
@@ -468,9 +472,12 @@ $(eval $(call gb_Library_use_libraries,vcl,\
 ))
 endif
 
-vcl_generic_code=\
+vcl_really_generic_code= \
     vcl/generic/app/gensys \
     vcl/generic/app/geninst \
+
+vcl_generic_code= \
+	$(vcl_really_generic_code) \
     vcl/generic/app/gendisp \
     vcl/generic/print/bitmap_gfx \
     vcl/generic/print/common_gfx \
@@ -489,9 +496,9 @@ vcl_generic_code=\
     vcl/generic/fontmanager/fontconfig \
     vcl/generic/fontmanager/fontmanager \
     vcl/generic/fontmanager/helper \
-    vcl/generic/fontmanager/parseAFM
+    vcl/generic/fontmanager/parseAFM \
 
-vcl_headless_code=\
+vcl_headless_code= \
     vcl/headless/svpbmp \
     vcl/headless/svpdummies \
     vcl/headless/svpelement \
@@ -499,9 +506,11 @@ vcl_headless_code=\
     vcl/headless/svpgdi \
     vcl/headless/svpinst \
     vcl/headless/svpdata \
+    vcl/headless/svpvd \
+
+vcl_headless_freetype_code=\
     vcl/headless/svpprn \
     vcl/headless/svptext \
-    vcl/headless/svpvd
 
 ifeq ($(GUIBASE),unx)
 $(eval $(call gb_Library_add_defs,vcl,\
@@ -544,6 +553,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/null/printerinfomanager \
     vcl/headless/headlessinst \
 	$(vcl_headless_code) \
+	$(vcl_headless_freetype_code) \
 ))
 
 $(eval $(call gb_Library_use_libraries,vcl,\
@@ -574,6 +584,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/null/printerinfomanager \
     vcl/android/androidinst \
 	$(vcl_headless_code) \
+	$(vcl_headless_freetype_code) \
 ))
 
 $(eval $(call gb_Library_use_static_libraries,vcl,\
@@ -591,28 +602,13 @@ ifeq ($(OS),IOS)
 $(eval $(call gb_Library_add_cxxflags,vcl,\
     $(gb_OBJCXXFLAGS) \
 ))
-$(eval $(call gb_Library_add_objcxxobjects,vcl,\
-    vcl/ios/source/app/salnstimer \
-    vcl/ios/source/app/vcluiapp \
-    vcl/ios/source/window/salframeview \
-))
 $(eval $(call gb_Library_add_exception_objects,vcl,\
-    vcl/ios/source/app/saldata \
-    vcl/ios/source/app/salinst \
-    vcl/ios/source/app/salsys \
-    vcl/ios/source/app/saltimer \
-    vcl/ios/source/dtrans/iOSTransferable \
-    vcl/ios/source/dtrans/ios_clipboard \
-    vcl/ios/source/dtrans/service_entry \
+    vcl/ios/iosinst \
+    vcl/ios/dummies \
+    $(vcl_really_generic_code) \
     $(vcl_coretext_code) \
-    vcl/quartz/salbmp \
-    vcl/ios/source/gdi/salgdicommon \
-    vcl/ios/source/gdi/salnativewidgets \
-    vcl/ios/source/gdi/salgdiutils \
-    vcl/ios/source/gdi/salvd \
-    vcl/ios/source/window/salframe \
-    vcl/ios/source/window/salmenu \
-    vcl/ios/source/window/salobj \
+	$(vcl_quartz_code) \
+	$(vcl_headless_code) \
 ))
 $(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
 	UIKit \
diff --git a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm
index 210ea8e..d9842a8 100644
--- a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm
@@ -19,6 +19,7 @@
 
 
 #include "aqua/salinst.h"
+#include "quartz/utils.h"
 
 #include "aqua11yactionwrapper.h"
 
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
index eb48a17..41df52b 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
+#include "quartz/utils.h"
 #include "aqua11ycomponentwrapper.h"
 #include "aqua11yrolehelper.h"
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index 9ac7876..f53170f 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -19,6 +19,7 @@
 
 
 #include "aqua/salinst.h"
+#include "quartz/utils.h"
 
 #include "aqua11ytextattributeswrapper.h"
 
diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
index 2ae1d5a..4d4b75c 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
@@ -19,7 +19,7 @@
 
 
 #include "aqua/salinst.h"
-
+#include "quartz/utils.h"
 #include "aqua11ytextwrapper.h"
 #include "aqua11ytextattributeswrapper.h"
 #include "aqua11yutil.h"
diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm
index 0e0ad50..04c29ad 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm
@@ -26,6 +26,8 @@
 #include "aqua/aqua11yfactory.h"
 #include "aqua/aqua11yfocustracker.hxx"
 
+#include "quartz/utils.h"
+
 #include "aqua11yfocuslistener.hxx"
 #include "aqua11yactionwrapper.h"
 #include "aqua11ycomponentwrapper.h"
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 40a0e55..0c10400 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -38,6 +38,7 @@
 #include "aqua/salsys.h"
 #include "aqua/salvd.h"
 #include "quartz/salbmp.h"
+#include "quartz/utils.h"
 #include "aqua/salprn.h"
 #include "aqua/saltimer.h"
 #include "aqua/vclnsapp.h"
@@ -1139,49 +1140,6 @@ YieldMutexReleaser::~YieldMutexReleaser()
         GetSalData()->mpFirstInstance->AcquireYieldMutex( mnCount );
 }
 
-//////////////////////////////////////////////////////////////
-rtl::OUString GetOUString( CFStringRef rStr )
-{
-    if( rStr == 0 )
-        return rtl::OUString();
-    CFIndex nLength = CFStringGetLength( rStr );
-    if( nLength == 0 )
-        return rtl::OUString();
-    const UniChar* pConstStr = CFStringGetCharactersPtr( rStr );
-    if( pConstStr )
-        return rtl::OUString( pConstStr, nLength );
-    UniChar* pStr = reinterpret_cast<UniChar*>( rtl_allocateMemory( sizeof(UniChar)*nLength ) );
-    CFRange aRange = { 0, nLength };
-    CFStringGetCharacters( rStr, aRange, pStr );
-    rtl::OUString aRet( pStr, nLength );
-    rtl_freeMemory( pStr );
-    return aRet;
-}
-
-rtl::OUString GetOUString( NSString* pStr )
-{
-    if( ! pStr )
-        return rtl::OUString();
-    int nLen = [pStr length];
-    if( nLen == 0 )
-        return rtl::OUString();
-
-    rtl::OUStringBuffer aBuf( nLen+1 );
-    aBuf.setLength( nLen );
-    [pStr getCharacters: const_cast<sal_Unicode*>(aBuf.getStr())];
-    return aBuf.makeStringAndClear();
-}
-
-CFStringRef CreateCFString( const rtl::OUString& rStr )
-{
-    return CFStringCreateWithCharacters(kCFAllocatorDefault, rStr.getStr(), rStr.getLength() );
-}
-
-NSString* CreateNSString( const rtl::OUString& rStr )
-{
-    return [[NSString alloc] initWithCharacters: rStr.getStr() length: rStr.getLength()];
-}
-
 CGImageRef CreateCGImage( const Image& rImage )
 {
     BitmapEx aBmpEx( rImage.GetBitmapEx() );
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 7cf724c..e849f01 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -25,6 +25,7 @@
 #include "aqua/salsys.h"
 #include "aqua/saldata.hxx"
 #include "aqua/salinst.h"
+#include "quartz/utils.h"
 
 #include "svids.hrc"
 
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index db73663..5a8ed35 100644
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -28,6 +28,7 @@
 #include "aqua/saldata.hxx"
 #include "aqua/salframe.h"
 #include "aqua/salframeview.h"
+#include "quartz/utils.h"
 
 #include "impimagetree.hxx"
 
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 190e16e..67714ba 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -28,6 +28,7 @@
 
 #include "aqua/aquaprintview.h"
 #include "aqua/salinst.h"
+#include "quartz/utils.h"
 
 #include "svdata.hxx"
 #include "svids.hrc"
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index d27361a..d32c6d9 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -29,6 +29,7 @@
 #include "aqua/aquaprintview.h"
 #include "aqua/salgdi.h"
 #include "aqua/saldata.hxx"
+#include "quartz/utils.h"
 
 #include "jobset.h"
 #include "salptype.hxx"
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 10eb3c2..2d5bb47 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -36,6 +36,7 @@
 #include "aqua/salinst.h"
 #include "aqua/salframeview.h"
 #include "aqua/aqua11yfactory.h"
+#include "quartz/utils.h"
 
 #include "salwtype.hxx"
 
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index d6861a4..aea29a4 100644
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -29,6 +29,7 @@
 #include "aqua/salframe.h"
 #include "aqua/salframeview.h"
 #include "aqua/aqua11yfactory.h"
+#include "quartz/utils.h"
 
 #define WHEEL_EVENT_FACTOR 1.5
 
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index 72cd828..8f37ddc 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -32,6 +32,7 @@
 #include "aqua/salnsmenu.h"
 #include "aqua/salframe.h"
 #include "aqua/aqua11ywrapper.h"
+#include "quartz/utils.h"
 
 #include "svids.hrc"
 #include "window.h"
diff --git a/vcl/coretext/salcoretextfontutils.cxx b/vcl/coretext/salcoretextfontutils.cxx
index 0bdb2d4..3f64d3b 100644
--- a/vcl/coretext/salcoretextfontutils.cxx
+++ b/vcl/coretext/salcoretextfontutils.cxx
@@ -18,16 +18,16 @@
  */
 
 #include "coretext/common.h"
-
 #include "coretext/salcoretextfontutils.hxx"
-#include "coretext/salgdi.h"
+#include "quartz/utils.h"
 
 #include "sft.hxx"
 
 #ifdef MACOSX
+#include "coretext/salgdi.h"
 #include "aqua/salinst.h"
 #else // IOS
-#include "ios/salinst.h"
+#include "headless/svpinst.hxx"
 #endif
 
 static bool GetDevFontAttributes( CTFontDescriptorRef font_descriptor, ImplDevFontAttributes& rDFA  )
diff --git a/vcl/coretext/salcoretextlayout.cxx b/vcl/coretext/salcoretextlayout.cxx
index 0183c66..d435630 100644
--- a/vcl/coretext/salcoretextlayout.cxx
+++ b/vcl/coretext/salcoretextlayout.cxx
@@ -22,7 +22,12 @@
 
 #include "coretext/common.h"
 #include "coretext/salcoretextstyle.hxx"
+
+#ifdef MACOSX
 #include "coretext/salgdi.h"
+#else
+#include "headless/svpgdi.hxx"
+#endif
 
 class CoreTextLayout : public SalLayout
 {
diff --git a/vcl/coretext/salgdi.cxx b/vcl/coretext/salgdi.cxx
index 05a93a5..71abf43 100644
--- a/vcl/coretext/salgdi.cxx
+++ b/vcl/coretext/salgdi.cxx
@@ -20,14 +20,26 @@
 #include "coretext/common.h"
 
 #ifdef MACOSX
+
 #include "aqua/salframe.h"
+#include "coretext/salgdi.h"
+
 #else
-#include "ios/salframe.h"
+
+#include <premac.h>
+#include <UIKit/UIKit.h>
+#include <postmac.h>
+
+#include "saldatabasic.hxx"
+#include "headless/svpframe.hxx"
+#include "headless/svpgdi.hxx"
+
 #endif
 
-#include "coretext/salgdi.h"
 #include "coretext/salcoretextstyle.hxx"
 
+#ifdef MACOSX
+
 QuartzSalGraphics::QuartzSalGraphics()
     : mpFrame( NULL )
     , mxLayer( NULL )
@@ -64,6 +76,8 @@ QuartzSalGraphics::~QuartzSalGraphics()
     }
 }
 
+#endif
+
 inline bool QuartzSalGraphics::AddTempDevFont( ImplDevFontList*,
                                              const rtl::OUString& ,
                                              const rtl::OUString& )
@@ -200,6 +214,8 @@ const ImplFontCharMap* QuartzSalGraphics::GetImplFontCharMap() const
     return font_face->GetImplFontCharMap();
 }
 
+#ifndef IOS
+
 bool QuartzSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
                      std::vector<unsigned char>& rBuffer, bool* pJustCFF )
 {
@@ -208,6 +224,8 @@ bool QuartzSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
     return font_face->GetRawFontData(rBuffer, pJustCFF);
 }
 
+#endif
+
 SystemFontData QuartzSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
 {
     SystemFontData aSysFontData;
@@ -257,4 +275,25 @@ void QuartzSalGraphics::SetTextColor( SalColor nSalColor )
     m_style->SetColor(nSalColor);
 }
 
+#ifdef IOS
+
+// Note that "QuartzSalGraphics" *is* SvpSalGraphics for iOS
+
+bool SvpSalGraphics::CheckContext()
+{
+    SAL_WARN_IF( mrContext == NULL, "vcl.ios", "CheckContext() failed" );
+
+    return (mrContext != NULL);
+}
+
+CGContextRef SvpSalGraphics::GetContext()
+{
+    if (!mrContext)
+        CheckContext();
+
+    return mrContext;
+}
+
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 7aa8167..58f496e 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -87,6 +87,11 @@ SvpSalGraphics::SvpSalGraphics() :
 {
     for( int i = 0; i < MAX_FALLBACK; ++i )
         m_pServerFont[i] = NULL;
+#ifdef IOS
+    mrContext = nil;
+    mfFakeDPIScale = 1.0;
+    m_style = new CoreTextStyleInfo();
+#endif
 }
 
 SvpSalGraphics::~SvpSalGraphics()
@@ -690,8 +695,12 @@ SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
     if (nFallbacklevel < 0 ) nFallbacklevel = 0;
 
     aSysFontData.nSize = sizeof( SystemFontData );
+#ifdef IOS
+    aSysFontData.rCTFont = NULL;
+#else
     aSysFontData.nFontId = 0;
     aSysFontData.nFontFlags = 0;
+#endif
     aSysFontData.bFakeBold = false;
     aSysFontData.bFakeItalic = false;
     aSysFontData.bAntialias = true;
diff --git a/vcl/inc/aqua/atsui/salgdi.h b/vcl/inc/aqua/atsui/salgdi.h
index ddda552..2faf8462 100644
--- a/vcl/inc/aqua/atsui/salgdi.h
+++ b/vcl/inc/aqua/atsui/salgdi.h
@@ -35,7 +35,7 @@
 #include "aqua/salframe.h"
 #include "salgdi.hxx"
 
-#include "aqua/salgdicommon.hxx"
+#include "quartz/salgdicommon.hxx"
 
 class AquaSalFrame;
 class ImplDevFontAttributes;
diff --git a/vcl/inc/aqua/salgdicommon.hxx b/vcl/inc/aqua/salgdicommon.hxx
deleted file mode 100644
index 2d4f611..0000000
--- a/vcl/inc/aqua/salgdicommon.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_AQUA_SALGDICOMMON_H
-#define _VCL_AQUA_SALGDICOMMON_H
-
-#include <vcl/salgtype.hxx>
-
-// abstracting quartz color instead of having to use an CGFloat[] array
-class RGBAColor
-{
-public:
-    RGBAColor( SalColor );
-    RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET
-    const CGFloat* AsArray() const { return m_fRGBA; }
-    bool IsVisible() const { return m_fRGBA[3] > 0; }
-    void SetAlpha( float fAlpha ) { m_fRGBA[3] = fAlpha; }
-private:
-    CGFloat m_fRGBA[4]; // red, green, blue, alpha
-};
-
-inline RGBAColor::RGBAColor( SalColor nSalColor )
-{
-    m_fRGBA[0] = SALCOLOR_RED(nSalColor) * (1.0/255);
-    m_fRGBA[1] = SALCOLOR_GREEN(nSalColor) * (1.0/255);
-    m_fRGBA[2] = SALCOLOR_BLUE(nSalColor) * (1.0/255);
-    m_fRGBA[3] = 1.0; // opaque
-}
-
-inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha )
-{
-    m_fRGBA[0] = fRed;
-    m_fRGBA[1] = fGreen;
-    m_fRGBA[2] = fBlue;
-    m_fRGBA[3] = fAlpha;
-}
-
-class XorEmulation
-{
-public:
-    XorEmulation();
-    ~XorEmulation();
-
-    void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef );
-    bool UpdateTarget();
-    void Enable() { m_bIsEnabled = true; }
-    void Disable() { m_bIsEnabled = false; }
-    bool IsEnabled() const { return m_bIsEnabled; }
-    CGContextRef GetTargetContext() const { return m_xTargetContext; }
-    CGContextRef GetMaskContext() const { return (m_bIsEnabled ? m_xMaskContext : NULL); }
-
-private:
-    CGLayerRef m_xTargetLayer;
-    CGContextRef m_xTargetContext;
-    CGContextRef m_xMaskContext;
-    CGContextRef m_xTempContext;
-    sal_uLong* m_pMaskBuffer;
-    sal_uLong* m_pTempBuffer;
-    int m_nBufferLongs;
-    bool m_bIsEnabled;
-};
-
-#endif /* _VCL_AQUA_SALGDICOMMON_H */
diff --git a/vcl/inc/aqua/salinst.h b/vcl/inc/aqua/salinst.h
index a295e06..7498d57 100644
--- a/vcl/inc/aqua/salinst.h
+++ b/vcl/inc/aqua/salinst.h
@@ -167,11 +167,6 @@ class YieldMutexReleaser
     ~YieldMutexReleaser();
 };
 
-rtl::OUString GetOUString( CFStringRef );
-rtl::OUString GetOUString( NSString* );
-CFStringRef CreateCFString( const rtl::OUString& );
-NSString* CreateNSString( const rtl::OUString& );
-
 CGImageRef CreateCGImage( const Image& );
 NSImage*   CreateNSImage( const Image& );
 
diff --git a/vcl/inc/coretext/salcoretextfontutils.hxx b/vcl/inc/coretext/salcoretextfontutils.hxx
index 00c61aa..bfd3d76 100644
--- a/vcl/inc/coretext/salcoretextfontutils.hxx
+++ b/vcl/inc/coretext/salcoretextfontutils.hxx
@@ -24,6 +24,7 @@
 
 #include <vcl/fontcapabilities.hxx>
 
+#include "coretext/common.h"
 #include "outfont.hxx"
 #include "impfont.hxx"
 
diff --git a/vcl/inc/coretext/salcoretextstyle.hxx b/vcl/inc/coretext/salcoretextstyle.hxx
index 245e08f..f05d6d5 100644
--- a/vcl/inc/coretext/salcoretextstyle.hxx
+++ b/vcl/inc/coretext/salcoretextstyle.hxx
@@ -20,11 +20,7 @@
 #ifndef _VCL_CORETEXT_SALCORETEXTSTYLE_HXX
 #define _VCL_CORETEXT_SALCORETEXTSTYLE_HXX
 
-#ifdef MACOSX
-#include "aqua/salgdicommon.hxx"
-#else // IOS
-#include "ios/salgdicommon.hxx"
-#endif
+#include "quartz/salgdicommon.hxx"
 
 #include "coretext/salcoretextfontutils.hxx"
 #include "outfont.hxx"
diff --git a/vcl/inc/coretext/salgdi.h b/vcl/inc/coretext/salgdi.h
index c93894a..4ca5eb6 100644
--- a/vcl/inc/coretext/salgdi.h
+++ b/vcl/inc/coretext/salgdi.h
@@ -20,27 +20,20 @@
 #ifndef _VCL_CORETEXT_SALGDI_H
 #define _VCL_CORETEXT_SALGDI_H
 
-#ifdef MACOSX
+#ifndef MACOSX
+#error This file should be included only for OS X
+#endif
+
 #include "premac.h"
 #include <ApplicationServices/ApplicationServices.h>
 #include "postmac.h"
-#endif
 
-#ifdef MACOSX
 #include "aqua/aquavcltypes.h"
-#else
-#include "ios/iosvcltypes.h"
-#endif
 
 #include "coretext/salcoretextfontutils.hxx"
 
-#ifdef MACOSX
 #include "aqua/salframe.h"
-#include "aqua/salgdicommon.hxx"
-#else
-#include "ios/salframe.h"
-#include "ios/salgdicommon.hxx"
-#endif
+#include "quartz/salgdicommon.hxx"
 
 #include "salgdi.hxx"
 
@@ -50,19 +43,13 @@ class CoreTextStyleInfo;
 // - QuartzSalGraphics -
 // -------------------
 
-#ifdef MACOSX
 #define QuartzSalGraphics AquaSalGraphics
-#endif
 
 class QuartzSalGraphics : public SalGraphics
 {
     friend class CoreTextLayout;
 protected:
-#ifdef MACOSX
     AquaSalFrame* mpFrame;
-#else
-    IosSalFrame* mpFrame;
-#endif
     CGLayerRef mxLayer;    //< Quartz graphics layer
     CGContextRef mrContext;  //< Quartz drawing context
     class XorEmulation* mpXorEmulation;
@@ -93,9 +80,7 @@ protected:
     bool mbVirDev; //< is this a virtual device graphics
     bool mbWindow; //< is this a window graphics
 
-#ifdef MACOSX
     RGBColor m_TextColor;
-#endif
 
 public:
     QuartzSalGraphics();
@@ -104,17 +89,10 @@ public:
     bool IsPenVisible() const { return maLineColor.IsVisible(); }
     bool IsBrushVisible() const { return maFillColor.IsVisible(); }
 
-#ifdef MACOSX
     void SetWindowGraphics( AquaSalFrame* pFrame );
     AquaSalFrame* getGraphicsFrame() const { return mpFrame; }
     void setGraphicsFrame( AquaSalFrame* pFrame ) { mpFrame = pFrame; }
     void initResolution( NSWindow* );
-#else
-    void SetWindowGraphics( IosSalFrame* pFrame );
-    IosSalFrame* getGraphicsFrame() const { return mpFrame; }
-    void setGraphicsFrame( IosSalFrame* pFrame ) { mpFrame = pFrame; }
-    void initResolution( UIWindow* );
-#endif
 
     void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale );
     void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
@@ -129,19 +107,13 @@ public:
     bool CheckContext();
     CGContextRef GetContext();
 
-#ifdef MACOSX
     void UpdateWindow( NSRect& ); // delivered in NSView coordinates
-#else
-    void UpdateWindow( CGRect& ); // delivered in UIView coordinates
-#endif
 
-#if (defined(MACOSX) && !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)) || defined(IOS)
+#if !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)
     void RefreshRect( const CGRect& );
 #endif
 
-#ifdef MACOSX
     void RefreshRect( const NSRect& );
-#endif
     void RefreshRect(float lX, float lY, float lWidth, float lHeight);
 
     void SetState();
@@ -342,7 +314,7 @@ private:
                          bool* pJustCFF );
 };
 
-#if (defined(MACOSX) && !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)) || defined(IOS)
+#if !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)
 
 inline void QuartzSalGraphics::RefreshRect( const CGRect& rRect )
 {
@@ -351,15 +323,11 @@ inline void QuartzSalGraphics::RefreshRect( const CGRect& rRect )
 
 #endif
 
-#ifdef MACOSX
-
 inline void QuartzSalGraphics::RefreshRect( const NSRect& rRect )
 {
     RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height );
 }
 
-#endif
-
 #endif /*  _VCL_CORETEXT_SALGDI_H */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index fbceb7d..ad544df 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -23,11 +23,19 @@
 #include <basebmp/bitmapdevice.hxx>
 #include <basebmp/color.hxx>
 
-#include <salgdi.hxx>
-#include <sallayout.hxx>
+#include "salgdi.hxx"
+#include "sallayout.hxx"
+
+#ifdef IOS
+#include "coretext/salcoretextstyle.hxx"
+#endif
 
 class ServerFont;
 
+#ifdef IOS
+#define QuartzSalGraphics SvpSalGraphics
+#endif
+
 class SvpSalGraphics : public SalGraphics
 {
     basebmp::BitmapDeviceSharedPtr       m_aDevice;
@@ -49,6 +57,7 @@ class SvpSalGraphics : public SalGraphics
 protected:
     Region                               m_aClipRegion;
     basegfx::B2IVector                   GetSize() { return m_aOrigDevice->getSize(); }
+
 private:
     bool                                 m_bClipSetup;
     struct ClipUndoHandle {
@@ -61,6 +70,16 @@ private:
     void ensureClip();
 
 protected:
+
+#ifdef IOS
+    friend class CoreTextLayout;
+
+    CGContextRef                         mrContext;
+    CoreTextStyleInfo*                   m_style;
+    double                               mfFakeDPIScale;
+    bool                                 mbNonAntialiasedText;
+#endif
+
     virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
     virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
 
@@ -71,7 +90,6 @@ public:
     const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
     void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
 
-    // overload all pure virtual methods
     virtual void            GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
     virtual sal_uInt16      GetBitCount() const;
     virtual long            GetGraphicsWidth() const;
@@ -178,6 +196,11 @@ public:
 
     virtual SystemGraphicsData GetGraphicsData() const;
     virtual SystemFontData  GetSysFontData( int nFallbacklevel ) const;
+
+#ifdef IOS
+    bool CheckContext();
+    CGContextRef GetContext();
+#endif
 };
 
 #endif
diff --git a/vcl/inc/ios/iosinst.hxx b/vcl/inc/ios/iosinst.hxx
new file mode 100644
index 0000000..0884ff1
--- /dev/null
+++ b/vcl/inc/ios/iosinst.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef IOS_SALINST_H
+#define IOS_SALINST_H
+
+#include "headless/svpinst.hxx"
+#include "headless/svpframe.hxx"
+
+class IosSalFrame;
+class IosSalInstance : public SvpSalInstance
+{
+    void BlitFrameToBuffer(char *pPixelBuffer,
+                           int nPBWidth, int nPBHeight,
+                           int destX, int nDestY,
+                           int nDestWidth, int nDestHeight,
+                           const basebmp::BitmapDeviceSharedPtr& aDev);
+
+public:
+    IosSalInstance( SalYieldMutex *pMutex );
+    virtual ~IosSalInstance();
+    static IosSalInstance *getInstance();
+
+    virtual SalSystem* CreateSalSystem();
+
+    void GetWorkArea( Rectangle& rRect );
+    SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+    SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+
+    virtual bool AnyInput( sal_uInt16 nType );
+
+    SalFrame *getFocusFrame() const;
+
+    void RedrawWindows(char *pPixelBuffer,
+                       int nPBWidth, int nPBHeight,
+                       int destX, int nDestY,
+                       int nDestWidth, int nDestHeight);
+
+    void damaged(IosSalFrame *frame);
+};
+
+#endif // IOS_SALINST_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/saldata.hxx b/vcl/inc/ios/saldata.hxx
deleted file mode 100644
index 8163a6d..0000000
--- a/vcl/inc/ios/saldata.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALDATA_HXX
-#define _SV_SALDATA_HXX
-
-#include "premac.h"
-#include <UIKit/UIKit.h>
-#include "postmac.h"
-
-#include "com/sun/star/uno/Reference.hxx"
-
-#include "vcl/ptrstyle.hxx"
-
-#include "svdata.hxx"
-#include "salwtype.hxx"
-
-#include <list>
-#include <vector>
-#include <map>
-#include <boost/unordered_set.hpp>
-
-#include <cstdio>
-#include <cstdarg>
-
-class IosSalInstance;
-class SalObject;
-class SalFrame;
-class SalVirtualDevice;
-class SalPrinter;
-class SystemFontList;
-
-#define SAL_CLIPRECT_COUNT 16
-
-class IosSalFrame;
-struct FrameHash : public boost::hash<sal_IntPtr>
-{
-    size_t operator()(const IosSalFrame* frame) const
-    { return boost::hash<sal_IntPtr>::operator()( reinterpret_cast<const sal_IntPtr>(frame) ); }
-};
-
-class SalData
-{
-public:
-    SALTIMERPROC                                 mpTimerProc;       // timer callback proc
-    IosSalInstance                              *mpFirstInstance;   // pointer of first instance
-    std::list<IosSalFrame*>                      maFrames;          // pointer of first frame
-    boost::unordered_set<const IosSalFrame*,FrameHash>  maFrameCheck;     // for fast check of frame existance
-    SalObject                                    *mpFirstObject;    // pointer of first object window
-    SalVirtualDevice                             *mpFirstVD;        // first VirDev
-    SalPrinter                                   *mpFirstPrinter;   // first printing printer
-    SystemFontList                               *mpFontList;
-
-    CGColorSpaceRef                               mxRGBSpace;
-    CGColorSpaceRef                               mxGraySpace;
-    CGColorSpaceRef                               mxP50Space;
-    CGPatternRef                                  mxP50Pattern;
-
-    std::vector< UIMenuItem* >                    maFallbackMenu;
-
-    static oslThreadKey                           s_aAutoReleaseKey;
-
-    long                                          mnDPIX;           // #i100617# read DPI only once per office life
-    long                                          mnDPIY;           // #i100617# read DPI only once per office life
-
-    com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-                                                  mxClipboard;
-
-    SalData();
-    ~SalData();
-
-    static void ensureThreadAutoreleasePool();
-};
-
-inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
-inline SalData *GetSalData() { return ImplGetSVData()->mpSalData; }
-
-sal_Bool ImplSalYieldMutexTryToAcquire();
-void ImplSalYieldMutexAcquire();
-void ImplSalYieldMutexRelease();
-
-#endif  // _SV_SALDATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salframe.h b/vcl/inc/ios/salframe.h
deleted file mode 100644
index 9ca4fe7..0000000
--- a/vcl/inc/ios/salframe.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALFRAME_H
-#define _SV_SALFRAME_H
-
-#include "vcl/sysdata.hxx"
-
-#include "ios/salmenu.h"
-#include "ios/saldata.hxx"
-#include "ios/iosvcltypes.h"
-
-#include "salframe.hxx"
-
-#include <vector>
-#include <utility>
-#include <stdexcept>
-
-#include <boost/shared_ptr.hpp>
-
-class QuartzSalGraphics;
-class IosSalFrame;
-class IosSalTimer;
-class IosSalInstance;
-class IosSalMenu;
-class IosBlinker;
-
-typedef struct SalFrame::SalPointerState SalPointerState;
-
-// ----------------
-// - IosSalFrame -
-// ----------------
-
-class IosSalFrame : public SalFrame
-{
-public:
-    UIWindow*                       mpWindow;
-    UIView*                         mpView;
-    CGRect                          maScreenRect;           // for mirroring purposes
-    QuartzSalGraphics*      mpGraphics;
-    IosSalFrame*            mpParent;
-    SystemEnvData           maSysData;
-    int                             mnMinWidth;             // min. client width in pixels
-    int                             mnMinHeight;            // min. client height in pixels
-    int                             mnMaxWidth;             // max. client width in pixels
-    int                             mnMaxHeight;            // max. client height in pixels
-    CGRect                          maFullScreenRect;       // old window size when in FullScreen
-    bool                mbGraphics:1;           // is Graphics used?
-    bool                            mbShown:1;
-    bool                            mbInitShow:1;
-    bool                            mbPositioned:1;
-    bool                            mbSized:1;
-    bool                            mbPresentation:1;
-
-    sal_uLong                       mnStyle;
-    unsigned int                    mnStyleMask;            // our style mask from UIWindow creation
-
-    sal_uLong                       mnLastEventTime;
-    unsigned int                    mnLastModifierFlags;
-    IosSalMenu*                     mpMenu;
-
-    SalExtStyle                     mnExtStyle;             // currently document frames are marked this way
-
-    PointerStyle                    mePointerStyle;         // currently active pointer style
-
-    CGMutablePathRef                mrClippingPath;         // used for "shaping"
-    std::vector< CGRect >           maClippingRects;
-
-    std::list<IosBlinker*>          maBlinkers;
-
-    Rectangle                       maInvalidRect;
-
-    sal_uLong                       mnICOptions;
-
-    boost::shared_ptr< Timer >      mpActivityTimer; // Timer to prevent system sleep during presentation
-public:
-    /** Constructor
-
-        Creates a system window and connects this frame with it.
-
-        @throws std::runtime_error in case window creation fails
-    */
-    IosSalFrame( SalFrame* pParent, sal_uLong salFrameStyle );
-
-    virtual ~IosSalFrame();
-
-    virtual SalGraphics*        GetGraphics();
-    virtual void                ReleaseGraphics( SalGraphics* pGraphics );
-    virtual sal_Bool                PostEvent( void* pData );
-    virtual void                SetTitle( const rtl::OUString& rTitle );
-    virtual void                SetIcon( sal_uInt16 nIcon );
-    virtual void                SetRepresentedURL( const rtl::OUString& );
-    virtual void                SetMenu( SalMenu* pSalMenu );
-    virtual void                DrawMenuBar();
-    virtual void                Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
-    virtual void                Enable( sal_Bool bEnable );
-    virtual void                SetMinClientSize( long nWidth, long nHeight );
-    virtual void                SetMaxClientSize( long nWidth, long nHeight );
-    virtual void                SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
-    virtual void                GetClientSize( long& rWidth, long& rHeight );
-    virtual void                GetWorkArea( Rectangle& rRect );
-    virtual SalFrame*           GetParent() const;
-    virtual void                SetWindowState( const SalFrameState* pState );
-    virtual sal_Bool                GetWindowState( SalFrameState* pState );
-    virtual void                ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
-    virtual void                StartPresentation( sal_Bool bStart );
-    virtual void                SetAlwaysOnTop( sal_Bool bOnTop );
-    virtual void                ToTop( sal_uInt16 nFlags );
-    virtual void                SetPointer( PointerStyle ePointerStyle );
-    virtual void                CaptureMouse( sal_Bool bMouse );
-    virtual void                SetPointerPos( long nX, long nY );
-    virtual void                Flush( void );
-    virtual void                Flush( const Rectangle& );
-    virtual void                Sync();
-    virtual void                SetInputContext( SalInputContext* pContext );
-    virtual void                EndExtTextInput( sal_uInt16 nFlags );
-    virtual rtl::OUString       GetKeyName( sal_uInt16 nKeyCode );
-    virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
-    virtual LanguageType        GetInputLanguage();
-    virtual void                UpdateSettings( AllSettings& rSettings );
-    virtual const SystemEnvData*    GetSystemData() const;
-    virtual SalPointerState     GetPointerState();
-    virtual SalIndicatorState   GetIndicatorState();
-    virtual void                SimulateKeyPress( sal_uInt16 nKeyCode );
-    virtual void                SetParent( SalFrame* pNewParent );
-    virtual bool                SetPluginParent( SystemParentData* pNewParent );
-    virtual void                SetExtendedFrameStyle( SalExtStyle );
-    virtual void                SetScreenNumber(unsigned int);
-    virtual void                SetApplicationID( const rtl::OUString &rApplicationID );
-
-    // shaped system windows
-    // set clip region to none (-> rectangular windows, normal state)
-    virtual void ResetClipRegion();
-    // start setting the clipregion consisting of nRects rectangles
-    virtual void BeginSetClipRegion( sal_uLong nRects );
-    // add a rectangle to the clip region
-    virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
-    // done setting up the clipregion
-    virtual void EndSetClipRegion();
-
-    virtual void SetClientSize( long nWidth, long nHeight );
-
-    void UpdateFrameGeometry();
-
-    // trigger painting of the window
-    void SendPaintEvent( const Rectangle* pRect = NULL );
-
-    static bool isAlive( const IosSalFrame* pFrame )
-    { return GetSalData()->maFrameCheck.find( pFrame ) != GetSalData()->maFrameCheck.end(); }
-
-    static IosSalFrame* GetCaptureFrame() { return s_pCaptureFrame; }
-
-    UIWindow* getWindow() const { return mpWindow; }
-    UIView* getView() const { return mpView; }
-    unsigned int getStyleMask() const { return mnStyleMask; }
-
-    void getResolution( long& o_rDPIX, long& o_rDPIY );
-
-    // actually the follwing methods do the same thing: flipping y coordinates
-    // but having two of them makes clearer what the coordinate system
-    // is supposed to be before and after
-    void VCLToCocoaTouch( CGRect& io_rRect, bool bRelativeToScreen = true );
-    void CocoaTouchToVCL( CGRect& io_rRect, bool bRelativeToScreen = true );
-
-    void VCLToCocoaTouch( CGPoint& io_rPoint, bool bRelativeToScreen = true );
-    void CocoaTouchToVCL( CGPoint& io_Point, bool bRelativeToScreen = true );
-
-    CGMutablePathRef getClipPath() const { return mrClippingPath; }
-
-    // called by VCL_UIApplication to indicate screen settings have changed
-    void screenParametersChanged();
-
- private: // methods
-    /** do things on initial show (like centering on parent or on screen)
-    */
-    void initShow();
-
-    void initWindowAndView();
-
- private: // data
-    static IosSalFrame*                   s_pCaptureFrame;
-
-    // make IosSalFrame non copyable
-    IosSalFrame( const IosSalFrame& );
-    IosSalFrame& operator=(const IosSalFrame&);
-};
-
-#endif // _SV_SALFRAME_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salframeview.h b/vcl/inc/ios/salframeview.h
deleted file mode 100644
index 4c82480..0000000
--- a/vcl/inc/ios/salframeview.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_SALFRAMEVIEW_H
-#define _VCL_SALFRAMEVIEW_H
-
- at interface SalFrameWindow : UIWindow
-{
-    IosSalFrame*       mpFrame;
-    id mDraggingDestinationHandler;
-}
--(id)initWithSalFrame: (IosSalFrame*)pFrame;
--(BOOL)canBecomeKeyWindow;
--(void)displayIfNeeded;
--(IosSalFrame*)getSalFrame;
- at end
-
- at interface SalFrameView : UIView
-{
-    IosSalFrame*       mpFrame;
-
-    // for UITextInput
-    UIEvent*        mpLastEvent;
-    BOOL            mbNeedSpecialKeyHandle;
-    BOOL            mbInKeyInput;
-    BOOL            mbKeyHandled;
-    NSRange         mMarkedRange;
-    NSRange         mSelectedRange;
-    id              mDraggingDestinationHandler;
-    UIEvent*        mpLastSuperEvent;
-
-    NSTimeInterval  mfLastMagnifyTime;
-    float       mfMagnifyDeltaSum;
-}
--(id)initWithSalFrame: (IosSalFrame*)pFrame;
--(IosSalFrame*)getSalFrame;
--(BOOL)acceptsFirstResponder;
--(BOOL)isOpaque;
--(void)drawRect: (CGRect)aRect;
- at end
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salgdicommon.hxx b/vcl/inc/ios/salgdicommon.hxx
deleted file mode 100644
index 6d8edcf..0000000
--- a/vcl/inc/ios/salgdicommon.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_IOS_SALGDICOMMON_H
-#define _VCL_IOS_SALGDICOMMON_H
-
-#include <vcl/salgtype.hxx>
-
-// abstracting quartz color instead of having to use an CGFloat[] array
-class RGBAColor
-{
-public:
-    RGBAColor( SalColor );
-    RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET
-    const CGFloat* AsArray() const { return m_fRGBA; }
-    bool IsVisible() const { return m_fRGBA[3] > 0; }
-    void SetAlpha( float fAlpha ) { m_fRGBA[3] = fAlpha; }
-private:
-    CGFloat m_fRGBA[4]; // red, green, blue, alpha
-};
-
-inline RGBAColor::RGBAColor( SalColor nSalColor )
-{
-    m_fRGBA[0] = SALCOLOR_RED(nSalColor) * (1.0/255);
-    m_fRGBA[1] = SALCOLOR_GREEN(nSalColor) * (1.0/255);
-    m_fRGBA[2] = SALCOLOR_BLUE(nSalColor) * (1.0/255);
-    m_fRGBA[3] = 1.0; // opaque
-}
-
-inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha )
-{
-    m_fRGBA[0] = fRed;
-    m_fRGBA[1] = fGreen;
-    m_fRGBA[2] = fBlue;
-    m_fRGBA[3] = fAlpha;
-}
-
-class XorEmulation
-{
-public:
-    XorEmulation();
-    ~XorEmulation();
-
-    void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef );
-    bool UpdateTarget();
-    void Enable() { m_bIsEnabled = true; }
-    void Disable() { m_bIsEnabled = false; }
-    bool IsEnabled() const { return m_bIsEnabled; }
-    CGContextRef GetTargetContext() const { return m_xTargetContext; }
-    CGContextRef GetMaskContext() const { return (m_bIsEnabled ? m_xMaskContext : NULL); }
-
-private:
-    CGLayerRef m_xTargetLayer;
-    CGContextRef m_xTargetContext;
-    CGContextRef m_xMaskContext;
-    CGContextRef m_xTempContext;
-    sal_uLong* m_pMaskBuffer;
-    sal_uLong* m_pTempBuffer;
-    int m_nBufferLongs;
-    bool m_bIsEnabled;
-};
-
-#endif /* _VCL_IOS_SALGDICOMMON_H */
diff --git a/vcl/inc/ios/salinst.h b/vcl/inc/ios/salinst.h
deleted file mode 100644
index f7ff822..0000000
--- a/vcl/inc/ios/salinst.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALINST_H
-#define _SV_SALINST_H
-
-#include "osl/mutex.hxx"
-#include "osl/thread.hxx"
-#include "osl/conditn.h"
-#include <vcl/solarmutex.hxx>
-
-#include "ios/iosvcltypes.h"
-
-#include "salinst.hxx"
-
-#include <list>
-
-class IosSalFrame;
-class ApplicationEvent;
-class Image;
-
-class SalYieldMutex : public vcl::SolarMutexObject
-{
-    sal_uLong                                   mnCount;
-    oslThreadIdentifier                         mnThreadId;
-
-public:
-                                                SalYieldMutex();
-    virtual void                                acquire();
-    virtual void                                release();
-    virtual sal_Bool                            tryToAcquire();
-    sal_uLong                                   GetAcquireCount() const { return mnCount; }
-    oslThreadIdentifier                         GetThreadId() const { return mnThreadId; }
-};
-
-#define YIELD_GUARD osl::SolarGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
-
-
-class IosSalInstance : public SalInstance
-{
-    struct SalUserEvent
-    {
-        IosSalFrame*    mpFrame;
-        void*           mpData;
-        sal_uInt16      mnType;
-
-        SalUserEvent( IosSalFrame* pFrame, void* pData, sal_uInt16 nType ) :
-            mpFrame( pFrame ), mpData( pData ), mnType( nType )
-        {}
-    };
-
-public:
-    SalYieldMutex*                          mpSalYieldMutex;
-    rtl::OUString                           maDefaultPrinter;
-    oslThreadIdentifier                     maMainThread;
-    bool                                    mbWaitingYield;
-    int                                     mnActivePrintJobs;
-    std::list< SalUserEvent >               maUserEvents;
-    oslMutex                                maUserEventListMutex;
-    oslCondition                            maWaitingYieldCond;
-
-    typedef std::list<const ApplicationEvent*> AppEventList;
-    static AppEventList aAppEventList;
-
-public:
-    IosSalInstance();
-    virtual ~IosSalInstance();
-
-    virtual SalSystem*      CreateSystem();
-    virtual void            DestroySystem(SalSystem*);
-    virtual SalFrame*       CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
-    virtual SalFrame*       CreateFrame( SalFrame* pParent, sal_uLong nStyle );
-    virtual void            DestroyFrame( SalFrame* pFrame );
-    virtual SalObject*      CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
-    virtual void            DestroyObject( SalObject* pObject );
-    virtual SalVirtualDevice*   CreateVirtualDevice( SalGraphics* pGraphics,
-                                                     long nDX, long nDY,
-                                                     sal_uInt16 nBitCount, const SystemGraphicsData *pData );
-    virtual void            DestroyVirtualDevice( SalVirtualDevice* pDevice );
-
-    virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
-                                               ImplJobSetup* pSetupData );
-    virtual void            DestroyInfoPrinter( SalInfoPrinter* pPrinter );
-    virtual SalPrinter*     CreatePrinter( SalInfoPrinter* pInfoPrinter );
-    virtual void            DestroyPrinter( SalPrinter* pPrinter );
-    virtual void            GetPrinterQueueInfo( ImplPrnQueueList* pList );
-    virtual void            GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
-    virtual void            DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
-    virtual rtl::OUString       GetDefaultPrinter();
-    virtual SalTimer*           CreateSalTimer();
-    virtual SalI18NImeStatus*   CreateI18NImeStatus();
-    virtual SalSystem*          CreateSalSystem();
-    virtual SalBitmap*          CreateSalBitmap();
-    virtual osl::SolarMutex*    GetYieldMutex();
-    virtual sal_uLong               ReleaseYieldMutex();
-    virtual void                AcquireYieldMutex( sal_uLong nCount );
-    virtual bool                CheckYieldMutex();
-    virtual void                Yield( bool bWait, bool bHandleAllCurrentEvents );
-    virtual bool                AnyInput( sal_uInt16 nType );
-    virtual SalMenu*            CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu );
-    virtual void                DestroyMenu( SalMenu* );
-    virtual SalMenuItem*        CreateMenuItem( const SalItemParams* pItemData );
-    virtual void                DestroyMenuItem( SalMenuItem* );
-    virtual SalSession*         CreateSalSession();
-    virtual void*               GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
-    virtual void                AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
-    virtual void            SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
-    virtual void            SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
-
-    // dtrans implementation
-    virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-        CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments );
-    virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource();
-    virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
-
-    void wakeupYield();
-
- public:
-    friend class IosSalFrame;
-
-    void PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData );
-    void delayedSettingsChanged( bool bInvalidate );
-
-    bool isUIAppThread() const;
-
-    void startedPrintJob() { mnActivePrintJobs++; }
-    void endedPrintJob() { mnActivePrintJobs--; }
-
-    // event subtypes for NSApplicationDefined events
-    static const short AppExecuteSVMain   = 0x7fff;
-    static const short AppEndLoopEvent    = 1;
-    static const short AppStartTimerEvent = 10;
-    static const short AppleRemoteEvent   = 15;
-    static const short YieldWakeupEvent   = 20;
-};
-
-// helper class: inverted solar guard
-class YieldMutexReleaser
-{
-    sal_uLong mnCount;
-    public:
-    YieldMutexReleaser();
-    ~YieldMutexReleaser();
-};
-
-rtl::OUString GetOUString( CFStringRef );
-rtl::OUString GetOUString( NSString* );
-CFStringRef CreateCFString( const rtl::OUString& );
-NSString* CreateNSString( const rtl::OUString& );
-
-CGImageRef CreateCGImage( const Image& );
-UIImage*   CreateUIImage( const Image& );
-
-#endif // _SV_SALINST_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salmathutils.hxx b/vcl/inc/ios/salmathutils.hxx
deleted file mode 100644
index a4f2427..0000000
--- a/vcl/inc/ios/salmathutils.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALMATHUTILS_HXX
-#define _SV_SALMATHUTILS_HXX
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ------------------------------------------------------------------
-//
-//                            Structures
-//
-// ------------------------------------------------------------------
-
-// LRectCoor is an abreviation for rectangular coordinates
-// represented as long integers
-
-struct LRectCoor
-{
-    long  x;
-    long  y;
-    long  z;
-};
-
-// ------------------------------------------------------------------
-//
-//                       Type Definitions
-//
-// ------------------------------------------------------------------
-
-// LRectCoorVec is an abreviation for vectors in rectangular
-// coordinates represented as long integers
-
-typedef struct LRectCoor   LRectCoor;
-typedef LRectCoor         *LRectCoorVector;
-typedef LRectCoorVector   *LRectCoorTensor;
-
-// ------------------------------------------------------------------
-//
-//                      Function Headers
-//
-// ------------------------------------------------------------------
-
-void CSwap  ( char            &rX, char            &rY );
-void UCSwap ( unsigned char   &rX, unsigned char   &rY );
-void SSwap  ( short           &rX, short           &rY );
-void USSwap ( unsigned short  &rX, unsigned short  &rY );
-void LSwap  ( long            &rX, long            &rY );
-void ULSwap ( unsigned long   &rX, unsigned long   &rY );
-
-// ------------------------------------------------------------------
-
-unsigned long  Euclidian2Norm ( const LRectCoorVector  pVec );
-
-// ------------------------------------------------------------------
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  // _SV_SALMATHUTILS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salmenu.h b/vcl/inc/ios/salmenu.h
deleted file mode 100644
index 1e1648d..0000000
--- a/vcl/inc/ios/salmenu.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALMENU_H
-#define _SV_SALMENU_H
-
-#include "premac.h"
-#include <UIKit/UIKit.h>
-#include "postmac.h"
-
-#include "salmenu.hxx"
-
-#include <vector>
-
-class IosSalFrame;
-class IosSalMenuItem;
-
-class IosSalMenu : public SalMenu
-{
-};
-
-class IosSalMenuItem : public SalMenuItem
-{
-};
-
-#endif // _SV_SALMENU_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salnstimer.h b/vcl/inc/ios/salnstimer.h
deleted file mode 100644
index 7a65d6f..0000000
--- a/vcl/inc/ios/salnstimer.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _VCL_SALNSTIMER_H
-#define _VCL_SALNSTIMER_H
-
-#include "premac.h"
-#include <Foundation/Foundation.h>
-#include "postmac.h"
-
- at interface TimerCallbackCaller : NSObject
-{
-}
--(void)timerElapsed:(NSTimer*)pTimer;
- at end
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salobj.h b/vcl/inc/ios/salobj.h
deleted file mode 100644
index b3966ec..0000000
--- a/vcl/inc/ios/salobj.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALOBJ_H
-#define _SV_SALOBJ_H
-
-#include "vcl/sysdata.hxx"
-#include "salobj.hxx"
-
-class IosSalFrame;
-class IosSalObject;
-
-
-// -----------------
-// - SalObjectData -
-// -----------------
-
-struct SalObjectData
-{
-};
-
-class IosSalObject : public SalObject
-{
-public:
-    IosSalFrame*        mpFrame;                // parent frame
-    SystemEnvData               maSysData;
-
-    long                        mnClipX;
-    long                        mnClipY;
-    long                        mnClipWidth;
-    long                        mnClipHeight;
-    bool                        mbClip;
-
-    long                        mnX;
-    long                        mnY;
-    long                        mnWidth;
-    long                        mnHeight;
-
-    void setClippedPosSize();
-
-    IosSalObject( IosSalFrame* pFrame );
-    virtual ~IosSalObject();
-
-    virtual void                    ResetClipRegion();
-    virtual sal_uInt16                      GetClipRegionType();
-    virtual void                    BeginSetClipRegion( sal_uLong nRects );
-    virtual void                    UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
-    virtual void                    EndSetClipRegion();
-    virtual void                    SetPosSize( long nX, long nY, long nWidth, long nHeight );
-    virtual void                    Show( sal_Bool bVisible );
-    virtual const SystemEnvData*    GetSystemData() const;
-};
-
-#endif // _SV_SALOBJ_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salprn.h b/vcl/inc/ios/salprn.h
deleted file mode 100644
index c383af4..0000000
--- a/vcl/inc/ios/salprn.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALPRN_H
-#define _SV_SALPRN_H
-
-#include "ios/iosvcltypes.h"
-
-#include "salprn.hxx"
-
-#include <boost/shared_array.hpp>
-
-
-// ---------------------
-// - IosSalInfoPrinter -
-// ---------------------
-
-class IosSalGraphics;
-
-class IosSalInfoPrinter : public SalInfoPrinter
-{
-    /// Printer graphics
-    IosSalGraphics*     mpGraphics;
-    /// is Graphics used
-    bool                    mbGraphics;
-    /// job active ?
-    bool                    mbJob;
-
-    UIPrintFormatter*              mpPrinter;
-    /// cocoa print info object
-    UIPrintInfo*            mpPrintInfo;
-
-    /// FIXME: get real printer context for infoprinter if possible
-    /// fake context for info printer
-    /// graphics context for Quartz 2D
-    CGContextRef                            mrContext;
-    /// memory for graphics bitmap context for querying metrics
-    boost::shared_array< sal_uInt8 >        maContextMemory;
-
-    // since changes to UIPrintInfo during a job are ignored
-    // we have to care for some settings ourselves
-    // currently we do this for orientation;
-    // really needed however is a solution for paper formats
-    Orientation               mePageOrientation;
-
-    int                       mnStartPageOffsetX;
-    int                       mnStartPageOffsetY;
-    sal_Int32                 mnCurPageRangeStart;
-    sal_Int32                 mnCurPageRangeCount;
-
-    public:
-    IosSalInfoPrinter( const SalPrinterQueueInfo& pInfo );
-    virtual ~IosSalInfoPrinter();
-
-    void                        SetupPrinterGraphics( CGContextRef i_xContext ) const;
-
-    virtual SalGraphics*        GetGraphics();
-    virtual void                ReleaseGraphics( SalGraphics* i_pGraphics );
-    virtual sal_Bool                Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData );
-    virtual sal_Bool                SetPrinterData( ImplJobSetup* pSetupData );
-    virtual sal_Bool                SetData( sal_uLong i_nFlags, ImplJobSetup* i_pSetupData );
-    virtual void                GetPageInfo( const ImplJobSetup* i_pSetupData,
-                                             long& o_rOutWidth, long& o_rOutHeight,
-                                             long& o_rPageOffX, long& o_rPageOffY,
-                                             long& o_rPageWidth, long& o_rPageHeight );
-    virtual sal_uLong               GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType );
-    virtual sal_uLong               GetPaperBinCount( const ImplJobSetup* i_pSetupData );
-    virtual rtl::OUString       GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin );
-    virtual void                InitPaperFormats( const ImplJobSetup* i_pSetupData );
-    virtual int                 GetLandscapeAngle( const ImplJobSetup* i_pSetupData );
-
-    // the artificial separation between InfoPrinter and Printer
-    // is not really useful for us
-    // so let's make IosSalPrinter just a forwarder to IosSalInfoPrinter
-    // and concentrate the real work in one class
-    // implement pull model print system
-    sal_Bool                        StartJob( const String* i_pFileName,
-                                          const String& rJobName,
-                                          const String& i_rAppName,
-                                          ImplJobSetup* i_pSetupData,
-                                          vcl::PrinterController& i_rController );
-    sal_Bool                        EndJob();
-    sal_Bool                        AbortJob();
-    SalGraphics*                StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
-    sal_Bool                        EndPage();
-    sal_uLong                       GetErrorCode() const;
-
-    UIPrintInfo* getPrintInfo() const { return mpPrintInfo; }
-    void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; }
-    sal_Int32 getCurPageRangeStart() const { return mnCurPageRangeStart; }
-    sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; }
-
-    // match width/height against known paper formats, possibly switching orientation
-    const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const;
-    void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation );
-
-    private:
-    IosSalInfoPrinter( const IosSalInfoPrinter& );
-    IosSalInfoPrinter& operator=(const IosSalInfoPrinter&);
-};
-
-// -----------------
-// - IosSalPrinter -
-// -----------------
-
-class IosSalPrinter : public SalPrinter
-{
-    IosSalInfoPrinter*      mpInfoPrinter;          // pointer to the compatible InfoPrinter
-    public:
-    IosSalPrinter( IosSalInfoPrinter* i_pInfoPrinter );
-    virtual ~IosSalPrinter();
-
-    virtual sal_Bool                    StartJob( const rtl::OUString* pFileName,
-                                              const rtl::OUString& rJobName,
-                                              const rtl::OUString& rAppName,
-                                              sal_uLong i_nCopies,
-                                              bool i_bCollate,
-                                              bool i_bDirect,
-                                              ImplJobSetup* i_pSetupData );
-    // implement pull model print system
-    virtual sal_Bool                    StartJob( const rtl::OUString* pFileName,
-                                              const rtl::OUString& rJobName,
-                                              const rtl::OUString& rAppName,
-                                              ImplJobSetup* i_pSetupData,
-                                              vcl::PrinterController& i_rListener );
-
-    virtual sal_Bool                    EndJob();
-    virtual sal_Bool                    AbortJob();
-    virtual SalGraphics*            StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
-    virtual sal_Bool                    EndPage();
-    virtual sal_uLong                   GetErrorCode();
-
-    private:
-    IosSalPrinter( const IosSalPrinter& );
-    IosSalPrinter& operator=(const IosSalPrinter&);
-};
-
-const double fPtTo100thMM = 35.27777778;
-
-inline int PtTo10Mu( double nPoints ) { return (int)(((nPoints)*fPtTo100thMM)+0.5); }
-
-inline double TenMuToPt( double nUnits ) { return floor(((nUnits)/fPtTo100thMM)+0.5); }
-
-
-
-#endif // _SV_SALPRN_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h
deleted file mode 100644
index b8b48cc..0000000
--- a/vcl/inc/ios/salsys.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALSYS_H
-#define _SV_SALSYS_H
-
-#include "salsys.hxx"
-
-class VCL_DLLPUBLIC IosSalSystem : public SalSystem
-{
-public:
-    IosSalSystem() {}
-    virtual ~IosSalSystem();
-
-    // get info about the display
-    virtual unsigned int GetDisplayScreenCount();
-    virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
-    virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
-
-    virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen );
-    virtual int ShowNativeMessageBox( const rtl::OUString& rTitle,
-                                      const rtl::OUString& rMessage,
-                                      int nButtonCombination,
-                                      int nDefaultButton, bool bUseResources);
-};
-
-#endif // _SV_SALSYS_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/saltimer.h b/vcl/inc/ios/saltimer.h
deleted file mode 100644
index d9bfc37..0000000
--- a/vcl/inc/ios/saltimer.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SALTIMER_H
-#define _SV_SALTIMER_H
-
-#include "premac.h"
-#include <Foundation/Foundation.h>
-#include "postmac.h"
-
-#include "saltimer.hxx"
-
-class IosSalTimer : public SalTimer
-{
-  public:
-
-    IosSalTimer();
-    virtual ~IosSalTimer();
-
-    void Start( sal_uLong nMS );
-    void Stop();
-
-    static NSTimer* pRunningTimer;
-    static bool bDispatchTimer;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/saluimenu.h b/vcl/inc/ios/saluimenu.h
deleted file mode 100644
index bb9a341..0000000
--- a/vcl/inc/ios/saluimenu.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_SALUIMENU_H
-#define _VCL_SALUIMENU_H
-
-class IosSalMenu;
-class IosSalMenuItem;
-
- at interface SalUIMenu : UIMenuController
-{
-    /* Caution: SalNSMenu instances occasionally are binary copied
-       in IosSalMenu::ShowNativePopupMenu. If any members are added,
-       please take this into account !
-    */
-    IosSalMenu*        mpMenu;
-}
--(id)initWithMenu: (IosSalMenu*)pMenu;
--(void)menuNeedsUpdate: (UIMenuController*)pMenu;
--(void)setSalMenu: (IosSalMenu*)pMenu;
- at end
-
- at interface SalUIMenuItem : UIMenuItem
-{
-    /* Caution: SalUIMenuItem instances occasionally are binary copied
-       in IosSalMenu::ShowNativePopupMenu. If any members are added,
-       please take this into account !
-    */
-    IosSalMenuItem*    mpMenuItem;
-}
--(id)initWithMenuItem: (IosSalMenuItem*)pMenuItem;
--(void)menuItemTriggered: (id)aSender;
- at end
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salvd.h b/vcl/inc/ios/salvd.h
deleted file mode 100644
index 83c9d45..0000000
--- a/vcl/inc/ios/salvd.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list