[Libreoffice-commits] .: 3 commits - sal/inc sal/qa
Tor Lillqvist
tml at kemper.freedesktop.org
Thu Jul 14 14:27:15 PDT 2011
sal/inc/sal/main.h | 65 +++++++++++++++++++++++++-------
sal/qa/osl/condition/makefile.mk | 2
sal/qa/osl/security/makefile.mk | 2
sal/qa/rtl/alloc/makefile.mk | 3 -
sal/qa/rtl/cipher/makefile.mk | 7 ---
sal/qa/rtl/crc32/makefile.mk | 7 ---
sal/qa/rtl/locale/makefile.mk | 8 ---
sal/qa/static/makefile.mk | 8 +++
sal/qa/static/sal_cppunittester_all.cxx | 14 ++++++
9 files changed, 75 insertions(+), 41 deletions(-)
New commits:
commit 1e301dd23a0f3957274dd72d3bd3b2aab7291342
Author: Tor Lillqvist <tml at iki.fi>
Date: Thu Jul 14 11:19:15 2011 +0300
iOS hacking, intermediate commit
diff --git a/sal/inc/sal/main.h b/sal/inc/sal/main.h
index 3ddfe0f..370cba4 100644
--- a/sal/inc/sal/main.h
+++ b/sal/inc/sal/main.h
@@ -47,31 +47,46 @@ void SAL_CALL sal_detail_deinitialize();
#import <UIKit/UIKit.h>
#include <postmac.h>
-static int sal_argc;
-static char **sal_argv;
-
#define SAL_MAIN_WITH_ARGS_IMPL \
int SAL_CALL main(int argc, char ** argv) \
{ \
- sal_argc = argc; \
- sal_argv = argv; \
sal_detail_initialize(argc, argv); \
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \
int retVal = UIApplicationMain (argc, argv, @"UIApplication", @"salAppDelegate"); \
- \
[pool release]; \
- \
sal_detail_deinitialize(); \
return retVal; \
+} \
+ \
+static int sal_main_with_args(int argc, char **argv); \
+ \
+static int \
+sal_main(void) \
+{ \
+ char *argv[] = { NULL }; \
+ return sal_main_with_args(0, argv); \
}
#define SAL_MAIN_IMPL \
-SAL_MAIN_WITH_ARGS_IMPL \
- \
-static int \
-sal_main_with_args(int argc, char ** argv) \
+int SAL_CALL main(int argc, char ** argv) \
{ \
- return sal_main(); \
+ sal_detail_initialize(argc, argv); \
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \
+ int retVal = UIApplicationMain (argc, argv, @"UIApplication", @"salAppDelegate"); \
+ [pool release]; \
+ sal_detail_deinitialize(); \
+ return retVal; \
+}
+
+#define SAL_MAIN_WITH_GUI_IMPL \
+int SAL_CALL main(int argc, char ** argv) \
+{ \
+ sal_detail_initialize(argc, argv); \
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \
+ int retVal = sal_main(); \
+ [pool release]; \
+ sal_detail_deinitialize(); \
+ return retVal; \
}
@interface salAppDelegate : NSObject <UIApplicationDelegate> {
@@ -79,7 +94,7 @@ sal_main_with_args(int argc, char ** argv) \
@property (nonatomic, retain) UIWindow *window;
@end
-static int sal_main_with_args(int argc, char **argv);
+static int sal_main(void);
@implementation salAppDelegate
@@ -92,7 +107,7 @@ static int sal_main_with_args(int argc, char **argv);
self.window = uiw;
[uiw release];
- sal_main_with_args(sal_argc, sal_argv);
+ sal_main();
[self.window makeKeyAndVisible];
return YES;
@@ -122,6 +137,8 @@ int SAL_CALL main(int argc, char ** argv) \
return ret; \
}
+#define SAL_MAIN_WITH_GUI_IMPL SAL_MAIN_IMPL
+
#endif
@@ -182,6 +199,19 @@ int WINAPI WinMain( HINSTANCE _hinst, HINSTANCE _dummy, char* _cmdline, int _nsh
SAL_WIN_WinMain \
static int SAL_CALL sal_main(void)
+/* Use SAL_IMPLEMENT_MAIN_WITH_GUI in programs that actually have a
+ * VCL GUI. The difference is meaningful only for iOS support, which
+ * of course is a highly experimental work in progress. So actually,
+ * don't bother, just let developers who care for iOS take care of it
+ * when/if necessary.
+ */
+
+#define SAL_IMPLEMENT_MAIN_WITH_GUI() \
+ static int SAL_CALL sal_main(void); \
+ SAL_MAIN_WITH_GUI_IMPL \
+ SAL_WIN_WinMain \
+ static int SAL_CALL sal_main(void)
+
/*
"How to use" Examples:
commit 210ef4c12e14a97c4097f205cf8cc4c8b73ee97b
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Jul 12 20:18:35 2011 +0300
Add a property for the UIWindow and show it
diff --git a/sal/inc/sal/main.h b/sal/inc/sal/main.h
index fdd99ac..3ddfe0f 100644
--- a/sal/inc/sal/main.h
+++ b/sal/inc/sal/main.h
@@ -76,19 +76,26 @@ sal_main_with_args(int argc, char ** argv) \
@interface salAppDelegate : NSObject <UIApplicationDelegate> {
}
+ at property (nonatomic, retain) UIWindow *window;
@end
static int sal_main_with_args(int argc, char **argv);
@implementation salAppDelegate
+ at synthesize window=_window;
+
- (BOOL)application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
UIWindow *uiw = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
uiw.backgroundColor = [UIColor redColor];
+ self.window = uiw;
[uiw release];
sal_main_with_args(sal_argc, sal_argv);
+
+ [self.window makeKeyAndVisible];
+ return YES;
}
@end
commit 916a0a7d19d59b2a093ed3e103474013580f385c
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Jul 12 17:43:23 2011 +0300
Include the rest of the active sal cppunit tests for iOS
diff --git a/sal/qa/osl/condition/makefile.mk b/sal/qa/osl/condition/makefile.mk
index 8412c68..9683f20 100644
--- a/sal/qa/osl/condition/makefile.mk
+++ b/sal/qa/osl/condition/makefile.mk
@@ -43,8 +43,6 @@ CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:Condition by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Condition.obj
diff --git a/sal/qa/osl/security/makefile.mk b/sal/qa/osl/security/makefile.mk
index 58361fb..85d9beb 100755
--- a/sal/qa/osl/security/makefile.mk
+++ b/sal/qa/osl/security/makefile.mk
@@ -43,8 +43,6 @@ CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:Security by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Security.obj
diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk
index 5ac7a79..1a015da 100755
--- a/sal/qa/rtl/alloc/makefile.mk
+++ b/sal/qa/rtl/alloc/makefile.mk
@@ -55,8 +55,7 @@ DEF1NAME =$(SHL1TARGET)
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES=$(SHL1OBJS)
+SLOFILES=$(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/rtl/cipher/makefile.mk b/sal/qa/rtl/cipher/makefile.mk
index 15639f2..fd95355 100644
--- a/sal/qa/rtl/cipher/makefile.mk
+++ b/sal/qa/rtl/cipher/makefile.mk
@@ -46,8 +46,6 @@ CXXFLAGS+= $(LFS_CFLAGS)
CFLAGSCXX += $(CPPUNIT_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_cipher.obj
@@ -60,12 +58,9 @@ SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
# DEF2EXPORTFILE= export.exp
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
-# auto generated Target:joblist
-# END ------------------------------------------------------------------
#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES=$(SHL1OBJS)
+SLOFILES=$(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk
index c868227..3820a8c 100755
--- a/sal/qa/rtl/crc32/makefile.mk
+++ b/sal/qa/rtl/crc32/makefile.mk
@@ -44,8 +44,6 @@ CXXFLAGS+= $(LFS_CFLAGS)
CFLAGSCXX += $(CPPUNIT_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:jobfile by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_crc32.obj
@@ -58,12 +56,9 @@ SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
# DEF1EXPORTFILE= export.exp
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
-# auto generated Target:jobfile
-# END ------------------------------------------------------------------
#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES=$(SHL1OBJS)
+SLOFILES=$(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk
index 984cf1a..0d1c8f8 100644
--- a/sal/qa/rtl/locale/makefile.mk
+++ b/sal/qa/rtl/locale/makefile.mk
@@ -44,8 +44,6 @@ CXXFLAGS+= $(LFS_CFLAGS)
CFLAGSCXX += $(CPPUNIT_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:locale by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_locale.obj
@@ -58,13 +56,9 @@ SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
# DEF1EXPORTFILE= export.exp
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
-# auto generated Target:locale
-# END ------------------------------------------------------------------
-
#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES=$(SHL1OBJS)
+SLOFILES=$(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/static/makefile.mk b/sal/qa/static/makefile.mk
index 0762e73..71c3085 100644
--- a/sal/qa/static/makefile.mk
+++ b/sal/qa/static/makefile.mk
@@ -54,7 +54,13 @@ APP1LIBS += \
$(SLB)/qa_ostringbuffer.lib \
$(SLB)/qa_osl_condition.lib \
$(SLB)/qa_osl_file.lib \
- $(SLB)/qa_osl_security.lib
+ $(SLB)/qa_osl_security.lib \
+ $(SLB)/qa_rtl_alloc.lib \
+ $(SLB)/qa_rtl_cipher.lib \
+ $(SLB)/qa_rtl_crc32.lib \
+ $(SLB)/qa_rtl_doublelock.lib \
+ $(SLB)/qa_rtl_locale.lib \
+ $(SLB)/qa_sal.lib
APP1STDLIBS = $(CPPUNITLIB) $(SALLIB)
APP1TARGET = $(TARGET)
diff --git a/sal/qa/static/sal_cppunittester_all.cxx b/sal/qa/static/sal_cppunittester_all.cxx
index b5fb89b..4c3d942 100644
--- a/sal/qa/static/sal_cppunittester_all.cxx
+++ b/sal/qa/static/sal_cppunittester_all.cxx
@@ -119,7 +119,13 @@ extern "C" CppUnitTestPlugIn *cppunitTest_qa_ByteSequence(void),
*cppunitTest_qa_osl_File(void),
*cppunitTest_tcwf(void),
*cppunitTest_osl_old_test_file(void),
- *cppunitTest_qa_osl_security(void);
+ *cppunitTest_qa_osl_security(void),
+ *cppunitTest_qa_rtl_alloc(void),
+ *cppunitTest_qa_rtl_cipher(void),
+ *cppunitTest_qa_rtl_crc32(void),
+ *cppunitTest_qa_rtl_doublelock(void),
+ *cppunitTest_qa_rtl_locale(void),
+ *cppunitTest_qa_sal(void);
SAL_IMPLEMENT_MAIN() {
TestPlugInSignature plugs[] = {
@@ -130,6 +136,12 @@ SAL_IMPLEMENT_MAIN() {
cppunitTest_tcwf,
cppunitTest_osl_old_test_file,
cppunitTest_qa_osl_security,
+ cppunitTest_qa_rtl_alloc,
+ cppunitTest_qa_rtl_cipher,
+ cppunitTest_qa_rtl_crc32,
+ cppunitTest_qa_rtl_doublelock,
+ cppunitTest_qa_rtl_locale,
+ cppunitTest_qa_sal,
NULL
};
CppUnit::TestResult result;
More information about the Libreoffice-commits
mailing list