* Merged weak-symbols branch.

* Fixed trivial merge conflict in src/system/libroot/posix/locale/nl_langinfo.cpp
* Fixed gcc 2 compilation of src/system/glue/init_term_dyn.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39571 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-22 13:06:36 +00:00
parent 921e955104
commit 25dc253d6a
174 changed files with 1622 additions and 1010 deletions

View File

@ -11,8 +11,13 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] {
HAIKU_BUILD_FEATURE_SSL = 1 ; HAIKU_BUILD_FEATURE_SSL = 1 ;
} }
if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0a-x86-gcc4-2010-11-12.zip ;
} else {
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0a-x86-gcc2-2010-08-29.zip ;
}
local baseURL = http://haiku-files.org/files/optional-packages ; local baseURL = http://haiku-files.org/files/optional-packages ;
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0a-x86-gcc2-2010-08-29.zip ;
HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ; HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ;
if $(HAIKU_BUILD_FEATURE_SSL) { if $(HAIKU_BUILD_FEATURE_SSL) {

View File

@ -113,12 +113,14 @@ if [ IsOptionalHaikuImagePackageAdded ABI-compliance-checker ] {
if [ IsOptionalHaikuImagePackageAdded APR ] { if [ IsOptionalHaikuImagePackageAdded APR ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package APR available for $(TARGET_ARCH)" ; Echo "No optional package APR available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage apr-1.4.2-x86-gcc4-2010-11-12.zip
: $(baseURL)/apr-1.4.2-x86-gcc4-2010-11-12.zip
: : true ;
} else { } else {
InstallOptionalHaikuImagePackage apr-1.4.2-x86-gcc2-2010-10-13.zip InstallOptionalHaikuImagePackage apr-1.4.2-x86-gcc2-2010-10-13.zip
: $(baseURL)/apr-1.4.2-x86-gcc2-2010-10-13.zip : $(baseURL)/apr-1.4.2-x86-gcc2-2010-10-13.zip
: : : true ;
: true
;
} }
} }
@ -127,13 +129,14 @@ if [ IsOptionalHaikuImagePackageAdded APR ] {
if [ IsOptionalHaikuImagePackageAdded APR-util ] { if [ IsOptionalHaikuImagePackageAdded APR-util ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package APR-util available for $(TARGET_ARCH)" ; Echo "No optional package APR-util available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage apr-util-1.3.10-x86-gcc4-2010-11-12.zip
: $(baseURL)/apr-util-1.3.10-x86-gcc4-2010-11-12.zip
: : true ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage apr-util-1.3.10-x86-gcc2-2010-10-13.zip
apr-util-1.3.10-x86-gcc2-2010-10-13.zip
: $(baseURL)/apr-util-1.3.10-x86-gcc2-2010-10-13.zip : $(baseURL)/apr-util-1.3.10-x86-gcc2-2010-10-13.zip
: : : true ;
: true
;
} }
} }
@ -391,12 +394,12 @@ if [ IsOptionalHaikuImagePackageAdded CCache ] {
if [ IsOptionalHaikuImagePackageAdded CDRecord ] { if [ IsOptionalHaikuImagePackageAdded CDRecord ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package CDRecord available for $(TARGET_ARCH)" ; Echo "No optional package CDRecord available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage cdrtools-3.00-x86-gcc4-2010-11-12.zip
: $(baseURL)/cdrtools-3.00-x86-gcc4-2010-11-12.zip ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage cdrtools-3.00-x86-gcc2-2010-08-25-1.zip
cdrtools-3.00-x86-gcc2-2010-08-25-1.zip : $(baseURL)/cdrtools-3.00-x86-gcc2-2010-08-25-1.zip ;
: $(baseURL)/cdrtools-3.00-x86-gcc2-2010-08-25-1.zip
:
;
} }
} }
@ -470,13 +473,14 @@ if [ IsOptionalHaikuImagePackageAdded CMake ] {
if [ IsOptionalHaikuImagePackageAdded Curl ] { if [ IsOptionalHaikuImagePackageAdded Curl ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Curl available for $(TARGET_ARCH)" ; Echo "No optional package Curl available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage curl-7.21.2-x86-gcc4-2010-11-12.zip
: $(baseURL)/curl-7.21.2-x86-gcc4-2010-11-12.zip
: : true ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage curl-7.21.2-x86-gcc2-2010-10-13.zip
curl-7.21.2-x86-gcc2-2010-10-13.zip
: $(baseURL)/curl-7.21.2-x86-gcc2-2010-10-13.zip : $(baseURL)/curl-7.21.2-x86-gcc2-2010-10-13.zip
: : : true ;
: true
;
} }
} }
@ -486,12 +490,18 @@ if [ IsOptionalHaikuImagePackageAdded CVS ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package CVS available for $(TARGET_ARCH)" ; Echo "No optional package CVS available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
cvs-1.12.13-r1a2-x86-gcc2-2010-04-29-a.zip InstallOptionalHaikuImagePackage
: $(baseURL)/cvs-1.12.13-r1a2-x86-gcc2-2010-04-29-a.zip cvs-1.12.13.1-x86-gcc4-2010-11-12.zip
: : $(baseURL)/cvs-1.12.13.1-x86-gcc4-2010-11-12.zip
: true : : true ;
; } else {
InstallOptionalHaikuImagePackage
cvs-1.12.13-r1a2-x86-gcc2-2010-04-29-a.zip
: $(baseURL)/cvs-1.12.13-r1a2-x86-gcc2-2010-04-29-a.zip
: : true ;
}
InstallSourceArchive cvs-1.12.13_haiku-2010-04-29.tar.xz InstallSourceArchive cvs-1.12.13_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/cvs-1.12.13_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/cvs-1.12.13_haiku-2010-04-29.tar.xz ;
} }
@ -501,27 +511,39 @@ if [ IsOptionalHaikuImagePackageAdded CVS ] {
# Development # Development
if [ IsOptionalHaikuImagePackageAdded Development ] && $(TARGET_ARCH) = x86 { if [ IsOptionalHaikuImagePackageAdded Development ] && $(TARGET_ARCH) = x86 {
# autotools # autotools
InstallOptionalHaikuImagePackage autoconf-2.68-x86-gcc2-2010-09-23.zip if $(HAIKU_GCC_VERSION[1]) >= 4 {
: $(baseURL)/autoconf-2.68-x86-gcc2-2010-09-23.zip InstallOptionalHaikuImagePackage autoconf-2.68-x86-gcc4-2010-11-12.zip
: : $(baseURL)/autoconf-2.68-x86-gcc4-2010-11-12.zip
: true : : true ;
; InstallOptionalHaikuImagePackage automake-1.11.1-x86-gcc4-2010-11-12.zip
InstallOptionalHaikuImagePackage automake-1.11.1-r1a2-x86-gcc2-2010-04-21-a.zip : $(baseURL)/automake-1.11.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/automake-1.11.1-r1a2-x86-gcc2-2010-04-21-a.zip : : true ;
: InstallOptionalHaikuImagePackage libtool-2.4-x86-gcc4-2010-11-12.zip
: true ; : $(baseURL)/libtool-2.4-x86-gcc4-2010-11-12.zip
: : true ;
InstallOptionalHaikuImagePackage texinfo-4.13a-x86-gcc4-2010-11-12.zip
: $(baseURL)/texinfo-4.13a-x86-gcc4-2010-11-12.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage autoconf-2.68-x86-gcc2-2010-09-23.zip
: $(baseURL)/autoconf-2.68-x86-gcc2-2010-09-23.zip
: : true ;
InstallOptionalHaikuImagePackage
automake-1.11.1-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/automake-1.11.1-r1a2-x86-gcc2-2010-04-21-a.zip
: : true ;
InstallOptionalHaikuImagePackage libtool-2.4-x86-gcc2-2010-09-25.zip
: $(baseURL)/libtool-2.4-x86-gcc2-2010-09-25.zip
: : true ;
InstallOptionalHaikuImagePackage
texinfo-4.13a-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/texinfo-4.13a-r1a2-x86-gcc2-2010-04-21-a.zip
: : true ;
}
InstallSourceArchive automake-1.11.1_haiku-2010-04-29.tar.xz InstallSourceArchive automake-1.11.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/automake-1.11.1_haiku-2010-04-29.tar.xz : $(baseSourceURL)/2010/automake-1.11.1_haiku-2010-04-29.tar.xz
; ;
InstallOptionalHaikuImagePackage libtool-2.4-x86-gcc2-2010-09-25.zip
: $(baseURL)/libtool-2.4-x86-gcc2-2010-09-25.zip
:
: true
;
InstallOptionalHaikuImagePackage texinfo-4.13a-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/texinfo-4.13a-r1a2-x86-gcc2-2010-04-21-a.zip
:
: true ;
InstallSourceArchive texinfo-4.13a_haiku-2010-04-29.tar.xz InstallSourceArchive texinfo-4.13a_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/texinfo-4.13a_haiku-2010-04-29.tar.xz : $(baseSourceURL)/2010/texinfo-4.13a_haiku-2010-04-29.tar.xz
; ;
@ -546,8 +568,8 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
} }
if $(HAIKU_GCC_VERSION[1]) = 4 || $(isHybridBuild) { if $(HAIKU_GCC_VERSION[1]) = 4 || $(isHybridBuild) {
InstallOptionalHaikuImagePackage gcc-4.4.4-x86-gcc4-2010-10-09.zip InstallOptionalHaikuImagePackage gcc-4.4.4-x86-gcc4-2010-11-11.zip
: $(baseURL)/gcc-4.4.4-x86-gcc4-2010-10-09.zip ; : $(baseURL)/gcc-4.4.4-x86-gcc4-2010-11-11.zip ;
} }
if $(HAIKU_GCC_VERSION[1]) = 4 { if $(HAIKU_GCC_VERSION[1]) = 4 {
@ -559,30 +581,51 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
local libs = libstdc++.so libsupc++.so ; local libs = libstdc++.so libsupc++.so ;
for lib in $(libs) { for lib in $(libs) {
AddSymlinkToHaikuHybridImage AddSymlinkToHaikuHybridImage
develop abi x86 gcc4 tools gcc-4.4.4-haiku-100705 lib develop abi x86 gcc4 tools gcc-4.4.4-haiku-101111 lib
: /system/lib $(lib) : : true ; : /system/lib $(lib) : : true ;
} }
} }
# other commonly used tools # other commonly used tools
InstallOptionalHaikuImagePackage bison-2.4.1-r1a2-x86-gcc2-2010-04-21-a.zip if $(HAIKU_GCC_VERSION[1]) >= 4 {
: $(baseURL)/bison-2.4.1-r1a2-x86-gcc2-2010-04-21-a.zip ; InstallOptionalHaikuImagePackage
bison-2.4.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/bison-2.4.1-x86-gcc4-2010-11-12.zip ;
InstallOptionalHaikuImagePackage
m4-1.4.14-x86-gcc4-2010-11-12.zip
: $(baseURL)/m4-1.4.14-x86-gcc4-2010-11-12.zip ;
InstallOptionalHaikuImagePackage flex-2.5.35-x86-gcc4-2010-11-12.zip
: $(baseURL)/flex-2.5.35-x86-gcc4-2010-11-12.zip ;
InstallOptionalHaikuImagePackage jam-2.5-x86-gcc4-2010-11-12.zip
: $(baseURL)/jam-2.5-x86-gcc4-2010-11-12.zip ;
InstallOptionalHaikuImagePackage mkdepend-1.7-x86-gcc4-2010-11-12.zip
: $(baseURL)/mkdepend-1.7-x86-gcc4-2010-11-12.zip ;
InstallOptionalHaikuImagePackage make-3.82-x86-gcc4-2010-11-12.zip
: $(baseURL)/make-3.82-x86-gcc4-2010-11-12.zip ;
} else {
InstallOptionalHaikuImagePackage
bison-2.4.1-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/bison-2.4.1-r1a2-x86-gcc2-2010-04-21-a.zip ;
InstallOptionalHaikuImagePackage
m4-1.4.14-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/m4-1.4.14-r1a2-x86-gcc2-2010-04-21-a.zip ;
InstallOptionalHaikuImagePackage
flex-2.5.35-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/flex-2.5.35-r1a2-x86-gcc2-2010-04-21-a.zip ;
InstallOptionalHaikuImagePackage jam-2.5-r1a2-x86-gcc2-2010-04-21.zip
: $(baseURL)/jam-2.5-r1a2-x86-gcc2-2010-04-21.zip ;
InstallOptionalHaikuImagePackage mkdepend-1.7-x86-gcc2-2010-09-24.zip
: $(baseURL)/mkdepend-1.7-x86-gcc2-2010-09-24.zip ;
InstallOptionalHaikuImagePackage make-3.82-x86-gcc2-2010-09-25.zip
: $(baseURL)/make-3.82-x86-gcc2-2010-09-25.zip ;
}
InstallSourceArchive bison-2.4.1_haiku-2010-04-29.tar.xz InstallSourceArchive bison-2.4.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/bison-2.4.1_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/bison-2.4.1_haiku-2010-04-29.tar.xz ;
InstallOptionalHaikuImagePackage m4-1.4.14-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/m4-1.4.14-r1a2-x86-gcc2-2010-04-21-a.zip ;
InstallSourceArchive m4-1.4.14_haiku-2010-04-29.tar.xz InstallSourceArchive m4-1.4.14_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/m4-1.4.14_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/m4-1.4.14_haiku-2010-04-29.tar.xz ;
InstallOptionalHaikuImagePackage flex-2.5.35-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/flex-2.5.35-r1a2-x86-gcc2-2010-04-21-a.zip ;
InstallSourceArchive flex-2.5.35_haiku-2010-04-29.tar.xz InstallSourceArchive flex-2.5.35_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/flex-2.5.35_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/flex-2.5.35_haiku-2010-04-29.tar.xz ;
InstallOptionalHaikuImagePackage jam-2.5-r1a2-x86-gcc2-2010-04-21.zip
: $(baseURL)/jam-2.5-r1a2-x86-gcc2-2010-04-21.zip ;
InstallOptionalHaikuImagePackage mkdepend-1.7-x86-gcc2-2010-09-24.zip
: $(baseURL)/mkdepend-1.7-x86-gcc2-2010-09-24.zip ;
InstallOptionalHaikuImagePackage make-3.82-x86-gcc2-2010-09-25.zip
: $(baseURL)/make-3.82-x86-gcc2-2010-09-25.zip ;
} }
@ -724,13 +767,19 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Expat available for $(TARGET_ARCH)" ; Echo "No optional package Expat available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage
expat-2.0.1-r1a2-x86-gcc2-2010-04-22-a.zip if $(HAIKU_GCC_VERSION[1]) >= 4 {
: $(baseURL)/expat-2.0.1-r1a2-x86-gcc2-2010-04-22-a.zip InstallOptionalHaikuImagePackage
: expat-2.0.1-x86-gcc4-2010-11-12.zip
: true : $(baseURL)/expat-2.0.1-x86-gcc4-2010-11-12.zip
: true : : true ;
; } else {
InstallOptionalHaikuImagePackage
expat-2.0.1-r1a2-x86-gcc2-2010-04-22-a.zip
: $(baseURL)/expat-2.0.1-r1a2-x86-gcc2-2010-04-22-a.zip
: : true ;
}
InstallSourceArchive expat-2.0.1_haiku-2010-04-29.tar.xz InstallSourceArchive expat-2.0.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/expat-2.0.1_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/expat-2.0.1_haiku-2010-04-29.tar.xz ;
} }
@ -956,13 +1005,16 @@ if [ IsOptionalHaikuImagePackageAdded LibIconv ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package LibIconv available for $(TARGET_ARCH)" ; Echo "No optional package LibIconv available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21-a.zip InstallOptionalHaikuImagePackage
: $(baseURL)/libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21-a.zip libiconv-1.13.1-x86-gcc4-2010-11-12.zip
: : $(baseURL)/libiconv-1.13.1-x86-gcc4-2010-11-12.zip ;
: } else {
: true InstallOptionalHaikuImagePackage
; libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21-a.zip
: $(baseURL)/libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21-a.zip ;
}
InstallSourceArchive libiconv-1.13.1_haiku-2010-04-29.tar.xz InstallSourceArchive libiconv-1.13.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/libiconv-1.13.1_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/libiconv-1.13.1_haiku-2010-04-29.tar.xz ;
} }
@ -1007,13 +1059,16 @@ if [ IsOptionalHaikuImagePackageAdded LibXML2 ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ; Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22-a.zip InstallOptionalHaikuImagePackage
: $(baseURL)/libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22-a.zip libxml2-2.7.7-x86-gcc4-2010-11-12.zip
: : $(baseURL)/libxml2-2.7.7-x86-gcc4-2010-11-12.zip ;
: } else {
: true InstallOptionalHaikuImagePackage
; libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22-a.zip
: $(baseURL)/libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22-a.zip ;
}
InstallSourceArchive libxml2-2.7.7_haiku-2010-04-29.tar.xz InstallSourceArchive libxml2-2.7.7_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/libxml2-2.7.7_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/libxml2-2.7.7_haiku-2010-04-29.tar.xz ;
} }
@ -1103,12 +1158,17 @@ if [ IsOptionalHaikuImagePackageAdded Mercurial ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Mercurial available for $(TARGET_ARCH)" ; Echo "No optional package Mercurial available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
mercurial-1.6-x86-gcc2-2010-07-01.zip InstallOptionalHaikuImagePackage
: $(baseURL)/mercurial-1.6-x86-gcc2-2010-07-01.zip mercurial-1.6-x86-gcc4-2010-11-12.zip
: : $(baseURL)/mercurial-1.6-x86-gcc4-2010-11-12.zip
: true : : true ;
; } else {
InstallOptionalHaikuImagePackage
mercurial-1.6-x86-gcc2-2010-07-01.zip
: $(baseURL)/mercurial-1.6-x86-gcc2-2010-07-01.zip
: : true ;
}
} }
} }
@ -1118,11 +1178,15 @@ if [ IsOptionalHaikuImagePackageAdded Nano ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Nano available for $(TARGET_ARCH)" ; Echo "No optional package Nano available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
nano-2.2.5-x86-gcc2-2010-10-16.zip InstallOptionalHaikuImagePackage
: $(baseURL)/nano-2.2.5-x86-gcc2-2010-10-16.zip nano-2.2.5-x86-gcc4-2010-11-13.zip
: : $(baseURL)/nano-2.2.5-x86-gcc4-2010-11-13.zip ;
; } else {
InstallOptionalHaikuImagePackage
nano-2.2.5-x86-gcc2-2010-10-16.zip
: $(baseURL)/nano-2.2.5-x86-gcc2-2010-10-16.zip ;
}
} }
} }
@ -1132,11 +1196,15 @@ if [ IsOptionalHaikuImagePackageAdded Neon ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Neon available for $(TARGET_ARCH)" ; Echo "No optional package Neon available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
neon-0.29.5-x86-gcc2-2010-10-16.zip InstallOptionalHaikuImagePackage
: $(baseURL)/neon-0.29.5-x86-gcc2-2010-10-16.zip neon-0.29.5-x86-gcc4-2010-11-12.zip
: : $(baseURL)/neon-0.29.5-x86-gcc4-2010-11-12.zip ;
; } else {
InstallOptionalHaikuImagePackage
neon-0.29.5-x86-gcc2-2010-10-16.zip
: $(baseURL)/neon-0.29.5-x86-gcc2-2010-10-16.zip ;
}
} }
} }
@ -1232,11 +1300,16 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSH ] {
Exit "Optional package OpenSSH requires the HAIKU_IMAGE_HOST_NAME" Exit "Optional package OpenSSH requires the HAIKU_IMAGE_HOST_NAME"
"variable to be set!" ; "variable to be set!" ;
} }
InstallOptionalHaikuImagePackage
openssh-5.6p1-x86-gcc2-2010-11-03.zip if $(HAIKU_GCC_VERSION[1]) >= 4 {
: $(baseURL)/openssh-5.6p1-x86-gcc2-2010-11-03.zip InstallOptionalHaikuImagePackage
: openssh-5.6p1-x86-gcc4-2010-11-12.zip
; : $(baseURL)/openssh-5.6p1-x86-gcc4-2010-11-12.zip ;
} else {
InstallOptionalHaikuImagePackage
openssh-5.6p1-x86-gcc2-2010-11-03.zip
: $(baseURL)/openssh-5.6p1-x86-gcc2-2010-11-03.zip ;
}
AddUserToHaikuImage sshd : 1001 : 100 : /var/empty : /bin/true AddUserToHaikuImage sshd : 1001 : 100 : /var/empty : /bin/true
: "sshd user" ; : "sshd user" ;
@ -1249,12 +1322,13 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package OpenSSL available for $(TARGET_ARCH)" ; Echo "No optional package OpenSSL available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage $(HAIKU_OPENSSL_PACKAGE) if $(HAIKU_GCC_VERSION[1]) >= 4 {
: $(HAIKU_OPENSSL_URL) InstallOptionalHaikuImagePackage $(HAIKU_OPENSSL_PACKAGE)
: : $(HAIKU_OPENSSL_URL) ;
: } else {
: true InstallOptionalHaikuImagePackage $(HAIKU_OPENSSL_PACKAGE)
; : $(HAIKU_OPENSSL_URL) ;
}
} }
} }
@ -1266,10 +1340,8 @@ if [ IsOptionalHaikuImagePackageAdded P7zip ] {
} else { } else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
p7zip-9.04-r1a2-x86-gcc4-2010-05-06.zip p7zip-9.04-x86-gcc4-2010-11-13.zip
: $(baseURL)/p7zip-9.04-r1a2-x86-gcc4-2010-05-06.zip : $(baseURL)/p7zip-9.04-x86-gcc4-2010-11-13.zip ;
:
;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
p7zip-9.04-x86-gcc2-2010-09-01.zip p7zip-9.04-x86-gcc2-2010-09-01.zip
@ -1337,9 +1409,9 @@ if [ IsOptionalHaikuImagePackageAdded Pe ] {
Echo "No optional package Pe available for $(TARGET_ARCH)" ; Echo "No optional package Pe available for $(TARGET_ARCH)" ;
} else { } else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage pe-2.4.3-600-x86-gcc4-2010-09-28.zip InstallOptionalHaikuImagePackage
: $(baseURL)/pe-2.4.3-600-x86-gcc4-2010-09-28.zip pe-2.4.3-600-x86-gcc4-2010-11-14.zip
; : $(baseURL)/pe-2.4.3-600-x86-gcc4-2010-11-14.zip ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
pe-2.4.3-600-x86-gcc2-2010-09-28.zip pe-2.4.3-600-x86-gcc2-2010-09-28.zip
@ -1360,13 +1432,18 @@ if [ IsOptionalHaikuImagePackageAdded Perl ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Perl available for $(TARGET_ARCH)" ; Echo "No optional package Perl available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
perl-5.10.1-r1a2-x86-gcc2-2010-04-25-a.zip InstallOptionalHaikuImagePackage
: $(baseURL)/perl-5.10.1-r1a2-x86-gcc2-2010-04-25-a.zip perl-5.10.1-x86-gcc4-2010-11-12.zip
: : $(baseURL)/perl-5.10.1-x86-gcc4-2010-11-12.zip
: true : : true ;
: true } else {
; InstallOptionalHaikuImagePackage
perl-5.10.1-r1a2-x86-gcc2-2010-04-25-a.zip
: $(baseURL)/perl-5.10.1-r1a2-x86-gcc2-2010-04-25-a.zip
: : true ;
}
InstallSourceArchive perl-5.10.1_haiku-2010-04-29.tar.xz InstallSourceArchive perl-5.10.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/perl-5.10.1_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/perl-5.10.1_haiku-2010-04-29.tar.xz ;
} }
@ -1378,13 +1455,17 @@ if [ IsOptionalHaikuImagePackageAdded Python ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Python available for $(TARGET_ARCH)" ; Echo "No optional package Python available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
python-2.6.6-x86-gcc2-2010-08-30.zip InstallOptionalHaikuImagePackage
: $(baseURL)/python-2.6.6-x86-gcc2-2010-08-30.zip python-2.6.6-x86-gcc4-2010-11-12.zip
: : $(baseURL)/python-2.6.6-x86-gcc4-2010-11-12.zip
: true : : true ;
: true } else {
; InstallOptionalHaikuImagePackage
python-2.6.6-x86-gcc2-2010-08-30.zip
: $(baseURL)/python-2.6.6-x86-gcc2-2010-08-30.zip
: : true ;
}
} }
} }
@ -1441,12 +1522,17 @@ if [ IsOptionalHaikuImagePackageAdded SQLite ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package SQLite available for $(TARGET_ARCH)" ; Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
sqlite-3.7.3-x86-gcc2-2010-10-13.zip InstallOptionalHaikuImagePackage
: $(baseURL)/sqlite-3.7.3-x86-gcc2-2010-10-13.zip sqlite-3.7.3-x86-gcc4-2010-11-12.zip
: : $(baseURL)/sqlite-3.7.3-x86-gcc4-2010-11-12.zip
: true : : true ;
; } else {
InstallOptionalHaikuImagePackage
sqlite-3.7.3-x86-gcc2-2010-10-13.zip
: $(baseURL)/sqlite-3.7.3-x86-gcc2-2010-10-13.zip
: : true ;
}
} }
} }
@ -1456,12 +1542,17 @@ if [ IsOptionalHaikuImagePackageAdded Subversion ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Subversion available for $(TARGET_ARCH)" ; Echo "No optional package Subversion available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
subversion-1.6.13-x86-gcc2-2010-10-13.zip InstallOptionalHaikuImagePackage
: $(baseURL)/subversion-1.6.13-x86-gcc2-2010-10-13.zip subversion-1.6.13-x86-gcc4-2010-11-12.zip
: : $(baseURL)/subversion-1.6.13-x86-gcc4-2010-11-12.zip
: true : : true ;
; } else {
InstallOptionalHaikuImagePackage
subversion-1.6.13-x86-gcc2-2010-10-13.zip
: $(baseURL)/subversion-1.6.13-x86-gcc2-2010-10-13.zip
: : true ;
}
} }
} }
@ -1489,11 +1580,16 @@ if [ IsOptionalHaikuImagePackageAdded Tar ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Tar available for $(TARGET_ARCH)" ; Echo "No optional package Tar available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) {
tar-1.22-r1a2-x86-gcc2-2010-04-22-a.zip InstallOptionalHaikuImagePackage
: $(baseURL)/tar-1.22-r1a2-x86-gcc2-2010-04-22-a.zip tar-1.22-x86-gcc4-2010-11-13.zip
: : $(baseURL)/tar-1.22-x86-gcc4-2010-11-13.zip ;
; } else {
InstallOptionalHaikuImagePackage
tar-1.22-r1a2-x86-gcc2-2010-04-22-a.zip
: $(baseURL)/tar-1.22-r1a2-x86-gcc2-2010-04-22-a.zip ;
}
InstallSourceArchive tar-1.22_haiku-2010-04-29.tar.xz InstallSourceArchive tar-1.22_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/tar-1.22_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/tar-1.22_haiku-2010-04-29.tar.xz ;
} }
@ -1621,17 +1717,13 @@ if [ IsOptionalHaikuImagePackageAdded Vision ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package Vision available for $(TARGET_ARCH)" ; Echo "No optional package Vision available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 { } else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage vision-908-x86-gcc2-2010-10-30.zip InstallOptionalHaikuImagePackage vision-908-x86-gcc4-2010-11-14.zip
: $(baseURL)/vision-908-x86-gcc4-2010-11-04.zip : $(baseURL)/vision-908-x86-gcc4-2010-11-14.zip ;
:
;
AddSymlinkToHaikuImage home config be Applications AddSymlinkToHaikuImage home config be Applications
: /boot/apps/Vision/Vision ; : /boot/apps/Vision/Vision ;
} else { } else {
InstallOptionalHaikuImagePackage vision-908-x86-gcc2-2010-10-30.zip InstallOptionalHaikuImagePackage vision-908-x86-gcc2-2010-10-30.zip
: $(baseURL)/vision-908-x86-gcc2-2010-10-30.zip : $(baseURL)/vision-908-x86-gcc2-2010-10-30.zip ;
:
;
AddSymlinkToHaikuImage home config be Applications AddSymlinkToHaikuImage home config be Applications
: /boot/apps/Vision/Vision ; : /boot/apps/Vision/Vision ;
} }
@ -1665,8 +1757,8 @@ if [ IsOptionalHaikuImagePackageAdded WebPositive ] {
Echo "No optional package WebPositive available for gcc2" ; Echo "No optional package WebPositive available for gcc2" ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
WebPositive-gcc4-x86-r545-2010-08-31.zip WebPositive-gcc4-x86-r547-2010-11-16.zip
: $(baseURL)/WebPositive-gcc4-x86-r545-2010-08-31.zip : $(baseURL)/WebPositive-gcc4-x86-r547-2010-11-16.zip
: :
; ;
AddSymlinkToHaikuImage home config be Applications AddSymlinkToHaikuImage home config be Applications
@ -1759,13 +1851,16 @@ if [ IsOptionalHaikuImagePackageAdded XZ-Utils ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) != x86 {
Echo "No optional package XZ-Utils available for $(TARGET_ARCH)" ; Echo "No optional package XZ-Utils available for $(TARGET_ARCH)" ;
} else { } else {
InstallOptionalHaikuImagePackage if $(HAIKU_GCC_VERSION[1]) >= 4 {
xz-utils-4.999.9-r1a2-x86-gcc4-2010-04-25-a.zip InstallOptionalHaikuImagePackage
: $(baseURL)/xz-utils-4.999.9-r1a2-x86-gcc4-2010-04-25-a.zip xz-utils-4.999.9-x86-gcc4-2010-11-13.zip
: : $(baseURL)/xz-utils-4.999.9-x86-gcc4-2010-11-13.zip ;
: } else {
: true InstallOptionalHaikuImagePackage
; xz-utils-4.999.9-r1a2-x86-gcc4-2010-04-25-a.zip
: $(baseURL)/xz-utils-4.999.9-r1a2-x86-gcc4-2010-04-25-a.zip ;
}
InstallSourceArchive xz-utils-4.999.9_haiku-2010-04-29.tar.xz InstallSourceArchive xz-utils-4.999.9_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/xz-utils-4.999.9_haiku-2010-04-29.tar.xz ; : $(baseSourceURL)/2010/xz-utils-4.999.9_haiku-2010-04-29.tar.xz ;
AddExpanderRuleToHaikuImage "application/x-xz" : .tar.xz AddExpanderRuleToHaikuImage "application/x-xz" : .tar.xz

1
configure vendored
View File

@ -478,6 +478,7 @@ if [ $targetArch = "x86" ]; then
0.[0-6].*) ;; 0.[0-6].*) ;;
*) versionOK=1 ;; *) versionOK=1 ;;
esac esac
versionOK=1
if [ $versionOK = 0 ]; then if [ $versionOK = 0 ]; then
echo "The yasm assembler version 0.7.0 or later must be installed." echo "The yasm assembler version 0.7.0 or later must be installed."

View File

@ -93,24 +93,26 @@ private:
// Translation macros which may be used to shorten translation requests: // Translation macros which may be used to shorten translation requests:
#undef B_TRANSLATE #undef B_TRANSLATE
#define B_TRANSLATE(string) \ #define B_TRANSLATE(string) \
be_locale_roster->GetCatalog()->GetString((string), B_TRANSLATE_CONTEXT) BLocaleRoster::Default()->GetCatalog()->GetString((string), \
B_TRANSLATE_CONTEXT)
#undef B_TRANSLATE_WITH_CONTEXT #undef B_TRANSLATE_WITH_CONTEXT
#define B_TRANSLATE_WITH_CONTEXT(string, context) \ #define B_TRANSLATE_WITH_CONTEXT(string, context) \
be_locale_roster->GetCatalog()->GetString((string), (context)) BLocaleRoster::Default()->GetCatalog()->GetString((string), (context))
#undef B_TRANSLATE_COMMENT #undef B_TRANSLATE_COMMENT
#define B_TRANSLATE_COMMENT(string, comment) \ #define B_TRANSLATE_COMMENT(string, comment) \
be_locale_roster->GetCatalog()->GetString((string), B_TRANSLATE_CONTEXT, \ BLocaleRoster::Default()->GetCatalog()->GetString((string), \
(comment)) B_TRANSLATE_CONTEXT, (comment))
#undef B_TRANSLATE_ALL #undef B_TRANSLATE_ALL
#define B_TRANSLATE_ALL(string, context, comment) \ #define B_TRANSLATE_ALL(string, context, comment) \
be_locale_roster->GetCatalog()->GetString((string), (context), (comment)) BLocaleRoster::Default()->GetCatalog()->GetString((string), (context), \
(comment))
#undef B_TRANSLATE_ID #undef B_TRANSLATE_ID
#define B_TRANSLATE_ID(id) \ #define B_TRANSLATE_ID(id) \
be_locale_roster->GetCatalog()->GetString((id)) BLocaleRoster::Default()->GetCatalog()->GetString((id))
// Translation markers which can be used to mark static strings/IDs which // Translation markers which can be used to mark static strings/IDs which
// are used as key for translation requests (at other places in the code): // are used as key for translation requests (at other places in the code):

View File

@ -49,6 +49,8 @@ public:
BLocale(const BLocale& other); BLocale(const BLocale& other);
~BLocale(); ~BLocale();
static const BLocale* Default();
BLocale& operator=(const BLocale& other); BLocale& operator=(const BLocale& other);
status_t GetCollator(BCollator* collator) const; status_t GetCollator(BCollator* collator) const;
@ -155,10 +157,6 @@ private:
}; };
// global locale object
extern const BLocale* be_locale;
//--- collator short-hands inlines --- //--- collator short-hands inlines ---
// #pragma mark - // #pragma mark -

View File

@ -30,6 +30,8 @@ public:
BLocaleRoster(); BLocaleRoster();
~BLocaleRoster(); ~BLocaleRoster();
static BLocaleRoster* Default();
status_t GetDefaultTimeZone(BTimeZone* timezone) const; status_t GetDefaultTimeZone(BTimeZone* timezone) const;
status_t GetLanguage(const char* languageCode, status_t GetLanguage(const char* languageCode,
@ -76,7 +78,4 @@ private:
}; };
extern BLocaleRoster* be_locale_roster;
#endif // _LOCALE_ROSTER_H_ #endif // _LOCALE_ROSTER_H_

View File

@ -406,7 +406,7 @@ const char * loc_ntoa(const u_char *, char *);
int dn_skipname(const u_char *, const u_char *); int dn_skipname(const u_char *, const u_char *);
void putlong(u_int32_t, u_char *); void putlong(u_int32_t, u_char *);
void putshort(u_int16_t, u_char *); void putshort(u_int16_t, u_char *);
#ifndef __ultrix__ #if !defined(__ultrix__) && !defined(__HAIKU__)
u_int16_t _getshort(const u_char *); u_int16_t _getshort(const u_char *);
u_int32_t _getlong(const u_char *); u_int32_t _getlong(const u_char *);
#endif #endif

View File

@ -14,6 +14,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUCategoryData { class ICUCategoryData {
@ -47,6 +48,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -12,6 +12,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUCollateData : public ICUCategoryData { class ICUCollateData : public ICUCategoryData {
@ -37,6 +38,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -11,6 +11,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUCtypeData : public ICUCategoryData { class ICUCtypeData : public ICUCategoryData {
@ -49,6 +50,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -21,6 +21,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICULocaleBackend : public LocaleBackend { class ICULocaleBackend : public LocaleBackend {
@ -77,6 +78,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -12,6 +12,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
typedef DecimalFormatSymbols::ENumberFormatSymbol FormatSymbol; typedef DecimalFormatSymbols::ENumberFormatSymbol FormatSymbol;
@ -27,6 +28,7 @@ protected:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -11,6 +11,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUMessagesData : public ICUCategoryData { class ICUMessagesData : public ICUCategoryData {
@ -33,6 +34,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -13,6 +13,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUMonetaryData : public ICULocaleconvData { class ICUMonetaryData : public ICULocaleconvData {
@ -63,6 +64,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -11,6 +11,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUNumericData : public ICULocaleconvData { class ICUNumericData : public ICULocaleconvData {
@ -37,6 +38,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -15,6 +15,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUTimeConversion { class ICUTimeConversion {
@ -45,6 +46,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -15,6 +15,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
class ICUTimeData : public ICUCategoryData { class ICUTimeData : public ICUCategoryData {
@ -60,6 +61,7 @@ private:
}; };
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -18,6 +18,7 @@ struct locale_data; // glibc
namespace BPrivate { namespace BPrivate {
namespace Libroot {
struct LocaleCtypeDataBridge { struct LocaleCtypeDataBridge {
@ -144,6 +145,7 @@ public:
extern LocaleBackend* gLocaleBackend; extern LocaleBackend* gLocaleBackend;
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -7,6 +7,7 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
/* /*
@ -22,6 +23,7 @@ extern const int gPosixToLowerMap[384];
extern const int gPosixToUpperMap[384]; extern const int gPosixToUpperMap[384];
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -7,11 +7,13 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
extern const char* gPosixLanginfo[]; extern const char* gPosixLanginfo[];
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -10,11 +10,13 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
extern struct lconv gPosixLocaleConv; extern struct lconv gPosixLocaleConv;
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -10,11 +10,13 @@
namespace BPrivate { namespace BPrivate {
namespace Libroot {
extern const struct lc_time_t gPosixLCTimeInfo; extern const struct lc_time_t gPosixLCTimeInfo;
} // namespace Libroot
} // namespace BPrivate } // namespace BPrivate

View File

@ -34,6 +34,8 @@ public:
MutableLocaleRoster(); MutableLocaleRoster();
~MutableLocaleRoster(); ~MutableLocaleRoster();
static MutableLocaleRoster* Default();
status_t SetDefaultFormattingConventions( status_t SetDefaultFormattingConventions(
const BFormattingConventions& conventions); const BFormattingConventions& conventions);
status_t SetDefaultTimeZone(const BTimeZone& zone); status_t SetDefaultTimeZone(const BTimeZone& zone);
@ -57,9 +59,6 @@ public:
}; };
extern MutableLocaleRoster* gMutableLocaleRoster;
typedef BCatalogAddOn* (*InstantiateCatalogFunc)(const char* name, typedef BCatalogAddOn* (*InstantiateCatalogFunc)(const char* name,
const char* language, uint32 fingerprint); const char* language, uint32 fingerprint);
@ -116,8 +115,12 @@ struct RosterData {
BResources fResources; BResources fResources;
RosterData(); RosterData();
RosterData(const BLanguage& language,
const BFormattingConventions& conventions);
~RosterData(); ~RosterData();
static RosterData* Default();
void InitializeCatalogAddOns(); void InitializeCatalogAddOns();
void CleanupCatalogAddOns(); void CleanupCatalogAddOns();
status_t Refresh(); status_t Refresh();
@ -150,9 +153,6 @@ private:
}; };
extern RosterData gRosterData;
} // namespace BPrivate } // namespace BPrivate

View File

@ -228,30 +228,40 @@ struct Elf32_Dyn {
} d_un; } d_un;
}; };
#define DT_NULL 0 #define DT_NULL 0
#define DT_NEEDED 1 #define DT_NEEDED 1
#define DT_PLTRELSZ 2 #define DT_PLTRELSZ 2
#define DT_PLTGOT 3 #define DT_PLTGOT 3
#define DT_HASH 4 #define DT_HASH 4
#define DT_STRTAB 5 #define DT_STRTAB 5
#define DT_SYMTAB 6 #define DT_SYMTAB 6
#define DT_RELA 7 #define DT_RELA 7
#define DT_RELASZ 8 #define DT_RELASZ 8
#define DT_RELAENT 9 #define DT_RELAENT 9
#define DT_STRSZ 10 #define DT_STRSZ 10
#define DT_SYMENT 11 #define DT_SYMENT 11
#define DT_INIT 12 #define DT_INIT 12
#define DT_FINI 13 #define DT_FINI 13
#define DT_SONAME 14 #define DT_SONAME 14
#define DT_RPATH 15 #define DT_RPATH 15
#define DT_SYMBOLIC 16 #define DT_SYMBOLIC 16
#define DT_REL 17 #define DT_REL 17
#define DT_RELSZ 18 #define DT_RELSZ 18
#define DT_RELENT 19 #define DT_RELENT 19
#define DT_PLTREL 20 #define DT_PLTREL 20
#define DT_DEBUG 21 #define DT_DEBUG 21
#define DT_TEXTREL 22 #define DT_TEXTREL 22
#define DT_JMPREL 23 #define DT_JMPREL 23
#define DT_BIND_NOW 24 /* no lazy binding */
#define DT_INIT_ARRAY 25 /* init function array */
#define DT_FINI_ARRAY 26 /* termination function array */
#define DT_INIT_ARRAYSZ 27 /* init function array size */
#define DT_FINI_ARRAYSZ 28 /* termination function array size */
#define DT_RUNPATH 29 /* library search path (supersedes DT_RPATH) */
#define DT_FLAGS 30 /* flags (see below) */
#define DT_ENCODING 32
#define DT_PREINIT_ARRAY 32 /* preinitialization array */
#define DT_PREINIT_ARRAYSZ 33 /* preinitialization array size */
#define DT_VERSYM 0x6ffffff0 /* symbol version table */ #define DT_VERSYM 0x6ffffff0 /* symbol version table */
#define DT_VERDEF 0x6ffffffc /* version definition table */ #define DT_VERDEF 0x6ffffffc /* version definition table */
@ -263,6 +273,14 @@ struct Elf32_Dyn {
#define DT_HIPROC 0x7fffffff #define DT_HIPROC 0x7fffffff
/* DT_FLAGS values */
#define DF_ORIGIN 0x01
#define DF_SYMBOLIC 0x02
#define DF_TEXTREL 0x04
#define DF_BIND_NOW 0x08
#define DF_STATIC_TLS 0x10
/* version definition section */ /* version definition section */
struct Elf32_Verdef { struct Elf32_Verdef {

View File

@ -180,23 +180,23 @@ TranslationComparator(const void* left, const void* right)
BLanguage* language; BLanguage* language;
BString leftName; BString leftName;
if (be_locale_roster->GetLanguage(leftTranslation->languageCode, &language) if (BLocaleRoster::Default()->GetLanguage(leftTranslation->languageCode,
== B_OK) { &language) == B_OK) {
language->GetName(leftName); language->GetName(leftName);
delete language; delete language;
} else } else
leftName = leftTranslation->languageCode; leftName = leftTranslation->languageCode;
BString rightName; BString rightName;
if (be_locale_roster->GetLanguage(rightTranslation->languageCode, &language) if (BLocaleRoster::Default()->GetLanguage(rightTranslation->languageCode,
== B_OK) { &language) == B_OK) {
language->GetName(rightName); language->GetName(rightName);
delete language; delete language;
} else } else
rightName = rightTranslation->languageCode; rightName = rightTranslation->languageCode;
BCollator collator; BCollator collator;
be_locale->GetCollator(&collator); BLocale::Default()->GetCollator(&collator);
return collator.Compare(leftName.String(), rightName.String()); return collator.Compare(leftName.String(), rightName.String());
} }
@ -1105,8 +1105,8 @@ AboutView::_CreateCreditsView()
= *(const Translation*)sortedTranslations.ItemAt(i); = *(const Translation*)sortedTranslations.ItemAt(i);
langName.Truncate(0); langName.Truncate(0);
if (be_locale_roster->GetLanguage(translation.languageCode, &lang) if (BLocaleRoster::Default()->GetLanguage(translation.languageCode,
== B_OK) { &lang) == B_OK) {
lang->GetName(langName); lang->GetName(langName);
delete lang; delete lang;
} else { } else {

View File

@ -515,7 +515,7 @@ TBarApp::MessageReceived(BMessage* message)
case B_LOCALE_CHANGED: case B_LOCALE_CHANGED:
{ {
be_locale_roster->Refresh(); BLocaleRoster::Default()->Refresh();
BMessenger(fBarWindow->FindView("_deskbar_tv_")).SendMessage( BMessenger(fBarWindow->FindView("_deskbar_tv_")).SendMessage(
message); message);

View File

@ -89,7 +89,7 @@ CalendarMenuWindow::CalendarMenuWindow(BPoint where)
fSuppressFirstClose(true) fSuppressFirstClose(true)
{ {
BPrivate::week_start startOfWeek BPrivate::week_start startOfWeek
= (BPrivate::week_start)be_locale->StartOfWeek(); = (BPrivate::week_start)BLocale::Default()->StartOfWeek();
RemoveShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY); RemoveShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY);
AddShortcut('W', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); AddShortcut('W', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED));

View File

@ -84,7 +84,7 @@ TTimeView::TTimeView(float maxWidth, float height, bool showSeconds,
fLastDateStr[0] = 0; fLastDateStr[0] = 0;
fNeedToUpdate = true; fNeedToUpdate = true;
fLocale = *be_locale; fLocale = *BLocale::Default();
} }
@ -96,7 +96,7 @@ TTimeView::TTimeView(BMessage* data)
data->FindBool("seconds", &fShowSeconds); data->FindBool("seconds", &fShowSeconds);
data->FindBool("interval", &fInterval); data->FindBool("interval", &fInterval);
fLocale = *be_locale; fLocale = *BLocale::Default();
} }
#endif #endif
@ -357,7 +357,7 @@ TTimeView::ShowSeconds(bool on)
void void
TTimeView::Update() TTimeView::Update()
{ {
fLocale = *be_locale; fLocale = *BLocale::Default();
GetCurrentTime(); GetCurrentTime();
GetCurrentDate(); GetCurrentDate();

View File

@ -16,12 +16,12 @@
class BBitmap; class BBitmap;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class IconRenderer; class IconRenderer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
enum { enum {
SNAPPING_OFF = 0, SNAPPING_OFF = 0,

View File

@ -4,10 +4,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
AddSubDirSupportedPlatforms libbe_test ; AddSubDirSupportedPlatforms libbe_test ;
# defines (get all the extra stuff in from libicon.a classes) # defines (get all the extra stuff in from libicon.a classes)
local defines = [ FDefines ICON_O_MATIC=1 ] ; DEFINES = ICON_O_MATIC=1 ;
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ;
# libicon.a source directories # libicon.a source directories
local iconSourceDirs = local iconSourceDirs =

View File

@ -12,8 +12,10 @@
#include <Entry.h> #include <Entry.h>
#include <Window.h> #include <Window.h>
#include "IconBuild.h"
#include "Observer.h" #include "Observer.h"
class BMenu; class BMenu;
class BMenuBar; class BMenuBar;
class BMenuItem; class BMenuItem;
@ -29,12 +31,12 @@ class StyleView;
class SwatchGroup; class SwatchGroup;
class TransformerListView; class TransformerListView;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Icon; class Icon;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class MultipleManipulatorState; class MultipleManipulatorState;

View File

@ -11,19 +11,20 @@
#include <GraphicsDefs.h> #include <GraphicsDefs.h>
#include "IconBuild.h"
class AddPathsCommand; class AddPathsCommand;
class AddStylesCommand; class AddStylesCommand;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class PathContainer; class PathContainer;
class Style; class Style;
class StyleContainer; class StyleContainer;
class VectorPath; class VectorPath;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
void new_style(rgb_color color, StyleContainer* container, void new_style(rgb_color color, StyleContainer* container,

View File

@ -24,13 +24,13 @@
using std::nothrow; using std::nothrow;
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
// constructor // constructor
Document::Document(const char* name) Document::Document(const char* name)
: RWLocker("document rw lock"), : RWLocker("document rw lock"),
fIcon(new (nothrow) BPrivate::Icon::Icon()), fIcon(new (nothrow) _ICON_NAMESPACE Icon()),
fCommandStack(new (nothrow) ::CommandStack()), fCommandStack(new (nothrow) ::CommandStack()),
fSelection(new (nothrow) ::Selection()), fSelection(new (nothrow) ::Selection()),
@ -87,7 +87,7 @@ Document::SetExportSaver(::DocumentSaver* saver)
// SetIcon // SetIcon
void void
Document::SetIcon(BPrivate::Icon::Icon* icon) Document::SetIcon(_ICON_NAMESPACE Icon* icon)
{ {
if (fIcon == icon) if (fIcon == icon)
return; return;

View File

@ -9,20 +9,18 @@
#define DOCUMENT_H #define DOCUMENT_H
#include "IconBuild.h"
#include "Observable.h" #include "Observable.h"
#include "RWLocker.h" #include "RWLocker.h"
#include <String.h> #include <String.h>
struct entry_ref; struct entry_ref;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon { class Icon;
_END_ICON_NAMESPACE
class Icon;
} // namespace Icon
} // namespace BPrivate
class CommandStack; class CommandStack;
class DocumentSaver; class DocumentSaver;
@ -51,8 +49,8 @@ class Document : public RWLocker,
inline ::DocumentSaver* ExportSaver() const inline ::DocumentSaver* ExportSaver() const
{ return fExportSaver; } { return fExportSaver; }
void SetIcon(BPrivate::Icon::Icon* icon); void SetIcon(_ICON_NAMESPACE Icon* icon);
inline BPrivate::Icon::Icon* Icon() const inline _ICON_NAMESPACE Icon* Icon() const
{ return fIcon; } { return fIcon; }
void MakeEmpty(bool includingSavers = true); void MakeEmpty(bool includingSavers = true);
@ -60,7 +58,7 @@ class Document : public RWLocker,
bool IsEmpty() const; bool IsEmpty() const;
private: private:
BPrivate::Icon::Icon* fIcon; _ICON_NAMESPACE Icon* fIcon;
::CommandStack* fCommandStack; ::CommandStack* fCommandStack;
::Selection* fSelection; ::Selection* fSelection;

View File

@ -11,18 +11,17 @@
#include <View.h> #include <View.h>
#if LIB_LAYOUT #if LIB_LAYOUT
# include <layout.h> # include <layout.h>
#endif #endif
namespace BPrivate { #include "IconBuild.h"
namespace Icon {
class Gradient;
} // namespace Icon _BEGIN_ICON_NAMESPACE
} // namespace BPrivate class Gradient;
_END_ICON_NAMESPACE
enum { enum {
MSG_GRADIENT_CONTROL_FOCUS_CHANGED = 'gcfc', MSG_GRADIENT_CONTROL_FOCUS_CHANGED = 'gcfc',
@ -61,9 +60,9 @@ class GradientControl :
virtual void FrameResized(float width, float height); virtual void FrameResized(float width, float height);
// GradientControl // GradientControl
void SetGradient(const BPrivate::Icon::Gradient* void SetGradient(const _ICON_NAMESPACE Gradient*
gradient); gradient);
BPrivate::Icon::Gradient* Gradient() const _ICON_NAMESPACE Gradient* Gradient() const
{ return fGradient; } { return fGradient; }
void SetCurrentStop(const rgb_color& color); void SetCurrentStop(const rgb_color& color);
@ -81,7 +80,7 @@ class GradientControl :
float _OffsetFor(BPoint where) const; float _OffsetFor(BPoint where) const;
void _UpdateCurrentColor() const; void _UpdateCurrentColor() const;
BPrivate::Icon::Gradient* fGradient; _ICON_NAMESPACE Gradient* fGradient;
BBitmap* fGradientBitmap; BBitmap* fGradientBitmap;
int32 fDraggingStepIndex; int32 fDraggingStepIndex;
int32 fCurrentStepIndex; int32 fCurrentStepIndex;

View File

@ -16,12 +16,11 @@
class BBitmap; class BBitmap;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class IconRenderer; class IconRenderer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class IconView : public BView, class IconView : public BView,
public IconListener { public IconListener {

View File

@ -12,23 +12,24 @@
#include "ListViews.h" #include "ListViews.h"
#include "PathContainer.h" #include "PathContainer.h"
class BMenu; class BMenu;
class BMenuItem; class BMenuItem;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
class Shape; class Shape;
class ShapeContainer; class ShapeContainer;
} _END_ICON_NAMESPACE
}
class CommandStack; class CommandStack;
class PathListItem; class PathListItem;
class Selection; class Selection;
class ShapePathListener; class ShapePathListener;
using namespace BPrivate::Icon;
_USING_ICON_NAMESPACE
class PathListView : public SimpleListView, class PathListView : public SimpleListView,
public PathContainerListener { public PathContainerListener {

View File

@ -19,12 +19,12 @@ class CommandStack;
class ShapeListItem; class ShapeListItem;
class Selection; class Selection;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
enum { enum {
MSG_ADD_SHAPE = 'adsh', MSG_ADD_SHAPE = 'adsh',

View File

@ -20,15 +20,15 @@ class Selection;
class ShapeStyleListener; class ShapeStyleListener;
class StyleListItem; class StyleListItem;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class ShapeContainer; class ShapeContainer;
class ShapeListener; class ShapeListener;
class Style; class Style;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class StyleListView : public SimpleListView, class StyleListView : public SimpleListView,
public StyleContainerListener { public StyleContainerListener {

View File

@ -9,6 +9,7 @@
#define STYLE_VIEW_H #define STYLE_VIEW_H
#include "IconBuild.h"
#include "Observer.h" #include "Observer.h"
#include <View.h> #include <View.h>
@ -20,13 +21,13 @@ class CommandStack;
class CurrentColor; class CurrentColor;
class GradientControl; class GradientControl;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Gradient; class Gradient;
class Style; class Style;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
// TODO: write lock the document when changing something... // TODO: write lock the document when changing something...

View File

@ -18,11 +18,10 @@ class CommandStack;
class TransformerItem; class TransformerItem;
class Selection; class Selection;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Transformer; class Transformer;
} _END_ICON_NAMESPACE
}
class TransformerListView : public SimpleListView, class TransformerListView : public SimpleListView,
public ShapeListener { public ShapeListener {

View File

@ -12,18 +12,19 @@
#include <Entry.h> #include <Entry.h>
#include <OS.h> #include <OS.h>
#include "IconBuild.h"
class BPositionIO; class BPositionIO;
class Document; class Document;
namespace BPrivate {
namespace Icon {
class Icon; _BEGIN_ICON_NAMESPACE
class Icon;
_END_ICON_NAMESPACE
} // namespace Icon _USING_ICON_NAMESPACE
} // namespace BPrivate
using namespace BPrivate::Icon;
class Exporter { class Exporter {
public: public:

View File

@ -11,16 +11,15 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include "IconBuild.h"
namespace BPrivate {
namespace Icon {
class Icon; _BEGIN_ICON_NAMESPACE
class Icon;
_END_ICON_NAMESPACE
} // namespace Icon _USING_ICON_NAMESPACE
} // namespace BPrivate
using namespace BPrivate::Icon;
class Importer { class Importer {
public: public:

View File

@ -16,18 +16,15 @@ class BMessage;
class BNode; class BNode;
class BPositionIO; class BPositionIO;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon { class Gradient;
class LittleEndianBuffer;
class PathContainer;
class ShapeContainer;
class StyleContainer;
class VectorPath;
_END_ICON_NAMESPACE
class Gradient;
class LittleEndianBuffer;
class PathContainer;
class ShapeContainer;
class StyleContainer;
class VectorPath;
} // namespace Icon
} // namespace BPrivate
#define PRINT_STATISTICS 1 #define PRINT_STATISTICS 1

View File

@ -14,8 +14,7 @@
class BMessage; class BMessage;
class BPositionIO; class BPositionIO;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Icon; class Icon;
class PathContainer; class PathContainer;
class Shape; class Shape;
@ -23,8 +22,8 @@ namespace Icon {
class StyleContainer; class StyleContainer;
class Transformer; class Transformer;
class VectorPath; class VectorPath;
} _END_ICON_NAMESPACE
}
class MessageExporter : public Exporter { class MessageExporter : public Exporter {
public: public:

View File

@ -17,16 +17,14 @@ class BShape;
struct text_run; struct text_run;
struct text_run_array; struct text_run_array;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Icon; class Icon;
class Style; class Style;
class VectorPath; class VectorPath;
class PathContainer; class PathContainer;
class ShapeContainer; class ShapeContainer;
class StyleContainer; class StyleContainer;
} _END_ICON_NAMESPACE
}
struct style_map { struct style_map {
text_run *run; text_run *run;

View File

@ -39,17 +39,18 @@
#include <agg_path_storage.h> #include <agg_path_storage.h>
#include <agg_rasterizer_scanline_aa.h> #include <agg_rasterizer_scanline_aa.h>
#include "IconBuild.h"
#include "PathTokenizer.h" #include "PathTokenizer.h"
class SVGImporter; class SVGImporter;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Icon; class Icon;
class Transformable; class Transformable;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
namespace agg { namespace agg {
namespace svg { namespace svg {

View File

@ -14,15 +14,15 @@
#include <String.h> #include <String.h>
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Gradient; class Gradient;
class Shape; class Shape;
class Style; class Style;
class Transformable; class Transformable;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class SVGExporter : public Exporter { class SVGExporter : public Exporter {
public: public:

View File

@ -15,11 +15,12 @@
#include <Message.h> #include <Message.h>
#include <String.h> #include <String.h>
namespace BPrivate { #include "IconBuild.h"
namespace Icon {
_BEGIN_ICON_NAMESPACE
class Gradient; class Gradient;
} _END_ICON_NAMESPACE
}
namespace agg { namespace agg {
namespace svg { namespace svg {

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
class PathContainer; class PathContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class AddPathsCommand : public Command { class AddPathsCommand : public Command {
public: public:

View File

@ -10,17 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
class Selection; class Selection;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class ShapeContainer; class ShapeContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class AddShapesCommand : public Command { class AddShapesCommand : public Command {
public: public:

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class Transformer; class Transformer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
// TODO: make a templated "add items" command? // TODO: make a templated "add items" command?

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class Transformable; class Transformable;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class FreezeTransformationCommand : public Command { class FreezeTransformationCommand : public Command {
public: public:

View File

@ -10,16 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
// TODO: make a templated "move items" command? // TODO: make a templated "move items" command?
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
class PathContainer; class PathContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class MovePathsCommand : public Command { class MovePathsCommand : public Command {
public: public:

View File

@ -10,17 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
// TODO: make a templated "move items" command? // TODO: make a templated "move items" command?
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class ShapeContainer; class ShapeContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class MoveShapesCommand : public Command { class MoveShapesCommand : public Command {
public: public:

View File

@ -10,16 +10,19 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
// TODO: make a templated "move items" command? // TODO: make a templated "move items" command?
namespace BPrivate {
namespace Icon { _BEGIN_ICON_NAMESPACE
class Shape; class Shape;
class Transformer; class Transformer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class MoveTransformersCommand : public Command { class MoveTransformersCommand : public Command {
public: public:

View File

@ -9,18 +9,19 @@
#define NUDGE_POINTS_ACTION_H #define NUDGE_POINTS_ACTION_H
#include "IconBuild.h"
#include "TransformCommand.h" #include "TransformCommand.h"
#include <String.h> #include <String.h>
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
struct control_point; struct control_point;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class NudgePointsCommand : public TransformCommand { class NudgePointsCommand : public TransformCommand {
public: public:

View File

@ -10,14 +10,15 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class PathCommand : public Command { class PathCommand : public Command {
public: public:

View File

@ -10,17 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
#include <List.h> #include <List.h>
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
class PathContainer; class PathContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class RemovePathsCommand : public Command { class RemovePathsCommand : public Command {
public: public:

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class ShapeContainer; class ShapeContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class RemoveShapesCommand : public Command { class RemoveShapesCommand : public Command {
public: public:

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class Transformer; class Transformer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
// TODO: make a templated "remove items" command? // TODO: make a templated "remove items" command?

View File

@ -9,18 +9,19 @@
#define TRANSFORM_POINTS_COMMAND_H #define TRANSFORM_POINTS_COMMAND_H
#include "IconBuild.h"
#include "TransformBox.h" #include "TransformBox.h"
#include "TransformCommand.h" #include "TransformCommand.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
struct control_point; struct control_point;
class Transformable; class Transformable;
class VectorPath; class VectorPath;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class TransformPointsCommand : public TransformCommand, class TransformPointsCommand : public TransformCommand,
public TransformBoxListener { public TransformBoxListener {

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class VectorPath; class VectorPath;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class UnassignPathCommand : public Command { class UnassignPathCommand : public Command {
public: public:

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Style; class Style;
class StyleContainer; class StyleContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class AddStylesCommand : public Command { class AddStylesCommand : public Command {
public: public:

View File

@ -10,17 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
#include <InterfaceDefs.h> #include <InterfaceDefs.h>
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
class Style; class Style;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class AssignStyleCommand : public Command { class AssignStyleCommand : public Command {
public: public:

View File

@ -10,16 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
// TODO: make a templated "move items" command? // TODO: make a templated "move items" command?
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Style; class Style;
class StyleContainer; class StyleContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class MoveStylesCommand : public Command { class MoveStylesCommand : public Command {
public: public:

View File

@ -10,17 +10,18 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
#include <List.h> #include <List.h>
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Style; class Style;
class StyleContainer; class StyleContainer;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class RemoveStylesCommand : public Command { class RemoveStylesCommand : public Command {
public: public:

View File

@ -10,16 +10,17 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
#include <InterfaceDefs.h> #include <InterfaceDefs.h>
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Style; class Style;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class SetColorCommand : public Command { class SetColorCommand : public Command {
public: public:

View File

@ -10,15 +10,16 @@
#include "Command.h" #include "Command.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Gradient; class Gradient;
class Style; class Style;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class SetGradientCommand : public Command { class SetGradientCommand : public Command {
public: public:

View File

@ -9,14 +9,17 @@
#ifndef RESET_TRANSFORM_COMMAND_H #ifndef RESET_TRANSFORM_COMMAND_H
#define RESET_TRANSFORM_COMMAND_H #define RESET_TRANSFORM_COMMAND_H
#include "Command.h"
namespace BPrivate { #include "Command.h"
namespace Icon { #include "IconBuild.h"
_BEGIN_ICON_NAMESPACE
class Transformable; class Transformable;
} _END_ICON_NAMESPACE
}
using BPrivate::Icon::Transformable; _USING_ICON_NAMESPACE
class ResetTransformationCommand : public Command { class ResetTransformationCommand : public Command {
public: public:

View File

@ -9,18 +9,19 @@
#define TRANSFORM_GRADIENT_BOX_H #define TRANSFORM_GRADIENT_BOX_H
#include "IconBuild.h"
#include "TransformBox.h" #include "TransformBox.h"
class CanvasView; class CanvasView;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Gradient; class Gradient;
class Shape; class Shape;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class TransformGradientBox : public TransformBox { class TransformGradientBox : public TransformBox {
public: public:

View File

@ -6,16 +6,16 @@
#define TRANSFORM_GRADIENT_COMMAND_H #define TRANSFORM_GRADIENT_COMMAND_H
#include "IconBuild.h"
#include "TransformBox.h" #include "TransformBox.h"
#include "TransformCommand.h" #include "TransformCommand.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Gradient; class Gradient;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class TransformGradientCommand : public TransformCommand, class TransformGradientCommand : public TransformCommand,

View File

@ -9,16 +9,17 @@
#define TRANSFORM_OBJECTS_COMMAND_H #define TRANSFORM_OBJECTS_COMMAND_H
#include "IconBuild.h"
#include "TransformBox.h" #include "TransformBox.h"
#include "TransformCommand.h" #include "TransformCommand.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Transformable; class Transformable;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class TransformObjectsCommand : public TransformCommand, class TransformObjectsCommand : public TransformCommand,
public TransformBoxListener { public TransformBoxListener {

View File

@ -10,18 +10,19 @@
#include "CanvasTransformBox.h" #include "CanvasTransformBox.h"
#include "IconBuild.h"
class CanvasView; class CanvasView;
class PathManipulator; class PathManipulator;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
struct control_point; struct control_point;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class TransformPointsBox : public CanvasTransformBox { class TransformPointsBox : public CanvasTransformBox {
public: public:

View File

@ -10,14 +10,15 @@
#include "CanvasTransformBox.h" #include "CanvasTransformBox.h"
#include "IconBuild.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Shape; class Shape;
} _END_ICON_NAMESPACE
}
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE
class TransformShapesBox : public CanvasTransformBox { class TransformShapesBox : public CanvasTransformBox {
public: public:

View File

@ -39,7 +39,7 @@
#include "KeymapListItem.h" #include "KeymapListItem.h"
using BPrivate::gMutableLocaleRoster; using BPrivate::MutableLocaleRoster;
enum { enum {
@ -59,8 +59,8 @@ public:
fLanguage(language) fLanguage(language)
{ {
fIcon = new(std::nothrow) BBitmap(BRect(0, 0, 15, 15), B_RGBA32); fIcon = new(std::nothrow) BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
if (fIcon != NULL && be_locale_roster->GetFlagIconForCountry(fIcon, if (fIcon != NULL && BLocaleRoster::Default()->GetFlagIconForCountry(
language) != B_OK) { fIcon, language) != B_OK) {
delete fIcon; delete fIcon;
fIcon = NULL; fIcon = NULL;
} }
@ -247,7 +247,7 @@ BootPromptWindow::BootPromptWindow()
| B_AUTO_UPDATE_SIZE_LIMITS) | B_AUTO_UPDATE_SIZE_LIMITS)
{ {
// Get the list of all known languages (suffice to do it only once) // Get the list of all known languages (suffice to do it only once)
be_locale_roster->GetAvailableLanguages(&fInstalledLanguages); BLocaleRoster::Default()->GetAvailableLanguages(&fInstalledLanguages);
fInfoTextView = new TextBitmapView(BSize(480, 140)); fInfoTextView = new TextBitmapView(BSize(480, 140));
static_cast<TextBitmapView*>(fInfoTextView)->SetInsets(5, 5, 5, 5); static_cast<TextBitmapView*>(fInfoTextView)->SetInsets(5, 5, 5, 5);
@ -333,7 +333,7 @@ BootPromptWindow::MessageReceived(BMessage* message)
BMessage preferredLanguages; BMessage preferredLanguages;
preferredLanguages.AddString("language", preferredLanguages.AddString("language",
languageItem->Language()); languageItem->Language());
gMutableLocaleRoster->SetPreferredLanguages( MutableLocaleRoster::Default()->SetPreferredLanguages(
&preferredLanguages); &preferredLanguages);
_InitCatalog(true); _InitCatalog(true);
} }
@ -368,14 +368,14 @@ BootPromptWindow::_InitCatalog(bool saveSettings)
BMessage settings; BMessage settings;
BString language; BString language;
if (be_locale_roster->GetCatalog()->GetLanguage(&language) == B_OK) { if (BLocaleRoster::Default()->GetCatalog()->GetLanguage(&language) == B_OK)
settings.AddString("language", language.String()); settings.AddString("language", language.String());
}
gMutableLocaleRoster->SetPreferredLanguages(&settings); MutableLocaleRoster::Default()->SetPreferredLanguages(&settings);
BFormattingConventions conventions(language.String()); BFormattingConventions conventions(language.String());
gMutableLocaleRoster->SetDefaultFormattingConventions(conventions); MutableLocaleRoster::Default()->SetDefaultFormattingConventions(
conventions);
} }
@ -422,7 +422,7 @@ BootPromptWindow::_PopulateLanguages()
// Get current first preferred language of the user // Get current first preferred language of the user
BMessage preferredLanguages; BMessage preferredLanguages;
be_locale_roster->GetPreferredLanguages(&preferredLanguages); BLocaleRoster::Default()->GetPreferredLanguages(&preferredLanguages);
const char* firstPreferredLanguage; const char* firstPreferredLanguage;
if (preferredLanguages.FindString("language", &firstPreferredLanguage) if (preferredLanguages.FindString("language", &firstPreferredLanguage)
!= B_OK) { != B_OK) {
@ -431,7 +431,7 @@ BootPromptWindow::_PopulateLanguages()
} }
BMessage installedCatalogs; BMessage installedCatalogs;
be_locale_roster->GetAvailableCatalogs(&installedCatalogs, BLocaleRoster::Default()->GetAvailableCatalogs(&installedCatalogs,
"x-vnd.Haiku-ReadOnlyBootPrompt"); "x-vnd.Haiku-ReadOnlyBootPrompt");
BFont font; BFont font;
@ -446,7 +446,8 @@ BootPromptWindow::_PopulateLanguages()
for (int32 i = 0; installedCatalogs.FindString("language", i, &languageID) for (int32 i = 0; installedCatalogs.FindString("language", i, &languageID)
== B_OK; i++) { == B_OK; i++) {
BLanguage* language; BLanguage* language;
if (be_locale_roster->GetLanguage(languageID, &language) == B_OK) { if (BLocaleRoster::Default()->GetLanguage(languageID, &language)
== B_OK) {
BString name; BString name;
language->GetNativeName(name); language->GetNativeName(name);

View File

@ -205,7 +205,7 @@ StaticLibrary libfetish.a :
# strtoull.c # strtoull.c
# strtoumax.c # strtoumax.c
tempname.c tempname.c
time_r.c # time_r.c
trim.c trim.c
u8-uctomb.c u8-uctomb.c
u8-uctomb-aux.c u8-uctomb-aux.c

View File

@ -83,7 +83,7 @@ TimedAlert::GetLabel(BString &string)
time(&t); time(&t);
localtime_r(&t, &tm); localtime_r(&t, &tm);
be_locale->FormatTime(timestring, 15, t, B_SHORT_TIME_FORMAT); BLocale::Default()->FormatTime(timestring, 15, t, B_SHORT_TIME_FORMAT);
string += " "; string += " ";
string += timestring; string += timestring;

View File

@ -15,7 +15,7 @@
#include <Roster.h> #include <Roster.h>
using BPrivate::gMutableLocaleRoster; using BPrivate::MutableLocaleRoster;
//#pragma mark - BCatalog //#pragma mark - BCatalog
@ -29,14 +29,14 @@ BCatalog::BCatalog()
BCatalog::BCatalog(const char *signature, const char *language, BCatalog::BCatalog(const char *signature, const char *language,
uint32 fingerprint) uint32 fingerprint)
{ {
fCatalog fCatalog = MutableLocaleRoster::Default()->LoadCatalog(signature, language,
= gMutableLocaleRoster->LoadCatalog(signature, language, fingerprint); fingerprint);
} }
BCatalog::~BCatalog() BCatalog::~BCatalog()
{ {
gMutableLocaleRoster->UnloadCatalog(fCatalog); MutableLocaleRoster::Default()->UnloadCatalog(fCatalog);
} }
@ -102,8 +102,9 @@ BCatalog::SetCatalog(const char* signature, uint32 fingerprint)
{ {
// This is not thread safe. It is used only in ReadOnlyBootPrompt and should // This is not thread safe. It is used only in ReadOnlyBootPrompt and should
// not do harm there, but not sure what to do about it… // not do harm there, but not sure what to do about it…
gMutableLocaleRoster->UnloadCatalog(fCatalog); MutableLocaleRoster::Default()->UnloadCatalog(fCatalog);
fCatalog = gMutableLocaleRoster->LoadCatalog(signature, NULL, fingerprint); fCatalog = MutableLocaleRoster::Default()->LoadCatalog(signature, NULL,
fingerprint);
return B_OK; return B_OK;
} }
@ -268,7 +269,8 @@ namespace BPrivate {
EditableCatalog::EditableCatalog(const char *type, const char *signature, EditableCatalog::EditableCatalog(const char *type, const char *signature,
const char *language) const char *language)
{ {
fCatalog = gMutableLocaleRoster->CreateCatalog(type, signature, language); fCatalog = MutableLocaleRoster::Default()->CreateCatalog(type, signature,
language);
} }

View File

@ -83,7 +83,7 @@ BCountry::GetName(BString& name, const BLanguage* displayLanguage) const
BString appLanguage; BString appLanguage;
if (displayLanguage == NULL) { if (displayLanguage == NULL) {
BMessage preferredLanguage; BMessage preferredLanguage;
be_locale_roster->GetPreferredLanguages(&preferredLanguage); BLocaleRoster::Default()->GetPreferredLanguages(&preferredLanguage);
preferredLanguage.FindString("language", 0, &appLanguage); preferredLanguage.FindString("language", 0, &appLanguage);
} else { } else {
appLanguage = displayLanguage->Code(); appLanguage = displayLanguage->Code();
@ -112,13 +112,14 @@ BCountry::GetIcon(BBitmap* result) const
const char* code = fICULocale->getCountry(); const char* code = fICULocale->getCountry();
if (code == NULL) if (code == NULL)
return B_ERROR; return B_ERROR;
return be_locale_roster->GetFlagIconForCountry(result, code); return BLocaleRoster::Default()->GetFlagIconForCountry(result, code);
} }
status_t status_t
BCountry::GetAvailableTimeZones(BMessage* timeZones) const BCountry::GetAvailableTimeZones(BMessage* timeZones) const
{ {
return be_locale_roster->GetAvailableTimeZonesForCountry(timeZones, Code()); return BLocaleRoster::Default()->GetAvailableTimeZonesForCountry(timeZones,
Code());
} }

View File

@ -116,7 +116,7 @@ BDurationFormat::SetTimeZone(const BTimeZone* timeZone)
if (timeZone == NULL) { if (timeZone == NULL) {
BTimeZone defaultTimeZone; BTimeZone defaultTimeZone;
status_t result status_t result
= be_locale_roster->GetDefaultTimeZone(&defaultTimeZone); = BLocaleRoster::Default()->GetDefaultTimeZone(&defaultTimeZone);
if (result != B_OK) if (result != B_OK)
return result; return result;
zonePrivate.SetTo(&defaultTimeZone); zonePrivate.SetTo(&defaultTimeZone);

View File

@ -362,7 +362,7 @@ BFormattingConventions::GetName(BString& name,
BString displayLanguageID; BString displayLanguageID;
if (displayLanguage == NULL) { if (displayLanguage == NULL) {
BLanguage defaultLanguage; BLanguage defaultLanguage;
be_locale->GetLanguage(&defaultLanguage); BLocale::Default()->GetLanguage(&defaultLanguage);
displayLanguageID = defaultLanguage.Code(); displayLanguageID = defaultLanguage.Code();
} else { } else {
displayLanguageID = displayLanguage->Code(); displayLanguageID = displayLanguage->Code();

View File

@ -130,7 +130,7 @@ BLanguage::GetName(BString& name, const BLanguage* displayLanguage) const
BString appLanguage; BString appLanguage;
if (displayLanguage == NULL) { if (displayLanguage == NULL) {
BMessage preferredLanguage; BMessage preferredLanguage;
be_locale_roster->GetPreferredLanguages(&preferredLanguage); BLocaleRoster::Default()->GetPreferredLanguages(&preferredLanguage);
preferredLanguage.FindString("language", 0, &appLanguage); preferredLanguage.FindString("language", 0, &appLanguage);
} else { } else {
appLanguage = displayLanguage->Code(); appLanguage = displayLanguage->Code();

View File

@ -25,7 +25,7 @@ CreateLocaleBackendInstance()
LibbeLocaleBackend::LibbeLocaleBackend() LibbeLocaleBackend::LibbeLocaleBackend()
{ {
gMutableLocaleRoster->GetSystemCatalog(&systemCatalog); MutableLocaleRoster::Default()->GetSystemCatalog(&systemCatalog);
} }

View File

@ -42,12 +42,12 @@ BLocale::BLocale(const BLanguage* language,
if (conventions != NULL) if (conventions != NULL)
fConventions = *conventions; fConventions = *conventions;
else else
be_locale->GetFormattingConventions(&fConventions); BLocale::Default()->GetFormattingConventions(&fConventions);
if (language != NULL) if (language != NULL)
fLanguage = *language; fLanguage = *language;
else else
be_locale->GetLanguage(&fLanguage); BLocale::Default()->GetLanguage(&fLanguage);
} }
@ -59,6 +59,13 @@ BLocale::BLocale(const BLocale& other)
} }
/*static*/ const BLocale*
BLocale::Default()
{
return &BPrivate::RosterData::Default()->fDefaultLocale;
}
BLocale& BLocale&
BLocale::operator=(const BLocale& other) BLocale::operator=(const BLocale& other)
{ {

View File

@ -75,10 +75,17 @@ BLocaleRoster::~BLocaleRoster()
} }
/*static*/ BLocaleRoster*
BLocaleRoster::Default()
{
return MutableLocaleRoster::Default();
}
status_t status_t
BLocaleRoster::Refresh() BLocaleRoster::Refresh()
{ {
return gRosterData.Refresh(); return RosterData::Default()->Refresh();
} }
@ -88,11 +95,12 @@ BLocaleRoster::GetDefaultTimeZone(BTimeZone* timezone) const
if (!timezone) if (!timezone)
return B_BAD_VALUE; return B_BAD_VALUE;
BAutolock lock(gRosterData.fLock); RosterData* rosterData = RosterData::Default();
BAutolock lock(rosterData->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return B_ERROR; return B_ERROR;
*timezone = gRosterData.fDefaultTimeZone; *timezone = rosterData->fDefaultTimeZone;
return B_OK; return B_OK;
} }
@ -120,11 +128,12 @@ BLocaleRoster::GetPreferredLanguages(BMessage* languages) const
if (!languages) if (!languages)
return B_BAD_VALUE; return B_BAD_VALUE;
BAutolock lock(gRosterData.fLock); RosterData* rosterData = RosterData::Default();
BAutolock lock(rosterData->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return B_ERROR; return B_ERROR;
*languages = gRosterData.fPreferredLanguages; *languages = rosterData->fPreferredLanguages;
return B_OK; return B_OK;
} }
@ -234,20 +243,21 @@ BLocaleRoster::GetFlagIconForCountry(BBitmap* flagIcon, const char* countryCode)
if (countryCode == NULL) if (countryCode == NULL)
return B_BAD_DATA; return B_BAD_DATA;
BAutolock lock(gRosterData.fLock); RosterData* rosterData = RosterData::Default();
BAutolock lock(rosterData->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return B_ERROR; return B_ERROR;
if (!gRosterData.fAreResourcesLoaded) { if (!rosterData->fAreResourcesLoaded) {
status_t result = gRosterData.fResources.SetToImage(&gRosterData); status_t result = rosterData->fResources.SetToImage(rosterData);
if (result != B_OK) if (result != B_OK)
return result; return result;
result = gRosterData.fResources.PreloadResourceType(); result = rosterData->fResources.PreloadResourceType();
if (result != B_OK) if (result != B_OK)
return result; return result;
gRosterData.fAreResourcesLoaded = true; rosterData->fAreResourcesLoaded = true;
} }
size_t size; size_t size;
@ -262,8 +272,8 @@ BLocaleRoster::GetFlagIconForCountry(BBitmap* flagIcon, const char* countryCode)
normalizedCode[0] = toupper(countryCode[codeLength - 2]); normalizedCode[0] = toupper(countryCode[codeLength - 2]);
normalizedCode[1] = toupper(countryCode[codeLength - 1]); normalizedCode[1] = toupper(countryCode[codeLength - 1]);
const void* buffer = gRosterData.fResources.LoadResource(B_VECTOR_ICON_TYPE, const void* buffer = rosterData->fResources.LoadResource(
normalizedCode, &size); B_VECTOR_ICON_TYPE, normalizedCode, &size);
if (buffer == NULL || size == 0) if (buffer == NULL || size == 0)
return B_NAME_NOT_FOUND; return B_NAME_NOT_FOUND;
@ -279,14 +289,15 @@ BLocaleRoster::GetAvailableCatalogs(BMessage* languageList,
if (languageList == NULL) if (languageList == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
BAutolock lock(gRosterData.fLock); RosterData* rosterData = RosterData::Default();
BAutolock lock(rosterData->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return B_ERROR; return B_ERROR;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems(); int32 count = rosterData->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) { for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info CatalogAddOnInfo* info
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i); = (CatalogAddOnInfo*)rosterData->fCatalogAddOnInfos.ItemAt(i);
if (!info->MakeSureItsLoaded() || !info->fLanguagesFunc) if (!info->MakeSureItsLoaded() || !info->fLanguagesFunc)
continue; continue;

View File

@ -18,6 +18,7 @@
#include <Autolock.h> #include <Autolock.h>
#include <Catalog.h> #include <Catalog.h>
#include <Collator.h> #include <Collator.h>
#include <Debug.h>
#include <DefaultCatalog.h> #include <DefaultCatalog.h>
#include <Directory.h> #include <Directory.h>
#include <Entry.h> #include <Entry.h>
@ -125,8 +126,6 @@ CatalogAddOnInfo::UnloadIfPossible()
// #pragma mark - RosterData // #pragma mark - RosterData
RosterData gRosterData;
static const char* kPriorityAttr = "ADDON:priority"; static const char* kPriorityAttr = "ADDON:priority";
static const char* kLanguageField = "language"; static const char* kLanguageField = "language";
@ -134,6 +133,9 @@ static const char* kLanguageField = "language";
static const char* kTimezoneField = "timezone"; static const char* kTimezoneField = "timezone";
static const char* kOffsetField = "offset"; static const char* kOffsetField = "offset";
static RosterData sRosterData(BLanguage("en_US"),
BFormattingConventions("en_US"));
RosterData::RosterData() RosterData::RosterData()
: :
@ -151,6 +153,24 @@ RosterData::RosterData()
} }
RosterData::RosterData(const BLanguage& language,
const BFormattingConventions& conventions)
:
fLock("LocaleRosterData"),
fDefaultLocale(&language, &conventions),
fAreResourcesLoaded(false)
{
openlog_team("liblocale.so", LOG_PID, LOG_USER);
#ifndef DEBUG
setlogmask_team(LOG_UPTO(LOG_WARNING));
#endif
InitializeCatalogAddOns();
Refresh();
}
RosterData::~RosterData() RosterData::~RosterData()
{ {
BAutolock lock(fLock); BAutolock lock(fLock);
@ -160,6 +180,13 @@ RosterData::~RosterData()
} }
/*static*/ RosterData*
RosterData::Default()
{
return &sRosterData;
}
int int
RosterData::CompareInfos(const void* left, const void* right) RosterData::CompareInfos(const void* left, const void* right)
{ {
@ -626,8 +653,7 @@ RosterData::_AddPreferredLanguagesToMessage(BMessage* message) const
// #pragma mark - MutableLocaleRoster // #pragma mark - MutableLocaleRoster
static MutableLocaleRoster gLocaleRoster; static MutableLocaleRoster sLocaleRoster;
MutableLocaleRoster* gMutableLocaleRoster = &gLocaleRoster;
MutableLocaleRoster::MutableLocaleRoster() MutableLocaleRoster::MutableLocaleRoster()
@ -640,24 +666,32 @@ MutableLocaleRoster::~MutableLocaleRoster()
} }
/*static*/ MutableLocaleRoster*
MutableLocaleRoster::Default()
{
return &sLocaleRoster;
}
status_t status_t
MutableLocaleRoster::SetDefaultFormattingConventions(const BFormattingConventions& newFormattingConventions) MutableLocaleRoster::SetDefaultFormattingConventions(const BFormattingConventions& newFormattingConventions)
{ {
return gRosterData.SetDefaultFormattingConventions(newFormattingConventions); return RosterData::Default()->SetDefaultFormattingConventions(
newFormattingConventions);
} }
status_t status_t
MutableLocaleRoster::SetDefaultTimeZone(const BTimeZone& newZone) MutableLocaleRoster::SetDefaultTimeZone(const BTimeZone& newZone)
{ {
return gRosterData.SetDefaultTimeZone(newZone); return RosterData::Default()->SetDefaultTimeZone(newZone);
} }
status_t status_t
MutableLocaleRoster::SetPreferredLanguages(const BMessage* languages) MutableLocaleRoster::SetPreferredLanguages(const BMessage* languages)
{ {
return gRosterData.SetPreferredLanguages(languages); return RosterData::Default()->SetPreferredLanguages(languages);
} }
@ -686,14 +720,14 @@ MutableLocaleRoster::CreateCatalog(const char* type, const char* signature,
if (!type || !signature || !language) if (!type || !signature || !language)
return NULL; return NULL;
BAutolock lock(gRosterData.fLock); BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return NULL; return NULL;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems(); int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) { for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info CatalogAddOnInfo* info = (CatalogAddOnInfo*)
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i); RosterData::Default()->fCatalogAddOnInfos.ItemAt(i);
if (info->fName.ICompare(type)!=0 || !info->MakeSureItsLoaded() if (info->fName.ICompare(type)!=0 || !info->MakeSureItsLoaded()
|| !info->fCreateFunc) || !info->fCreateFunc)
continue; continue;
@ -727,14 +761,14 @@ MutableLocaleRoster::LoadCatalog(const char* signature, const char* language,
if (!signature) if (!signature)
return NULL; return NULL;
BAutolock lock(gRosterData.fLock); BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return NULL; return NULL;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems(); int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) { for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info CatalogAddOnInfo* info = (CatalogAddOnInfo*)
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i); RosterData::Default()->fCatalogAddOnInfos.ItemAt(i);
if (!info->MakeSureItsLoaded() || !info->fInstantiateFunc) if (!info->MakeSureItsLoaded() || !info->fInstantiateFunc)
continue; continue;
@ -801,14 +835,14 @@ MutableLocaleRoster::LoadEmbeddedCatalog(entry_ref* appOrAddOnRef)
if (!appOrAddOnRef) if (!appOrAddOnRef)
return NULL; return NULL;
BAutolock lock(gRosterData.fLock); BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return NULL; return NULL;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems(); int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) { for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info CatalogAddOnInfo* info = (CatalogAddOnInfo*)
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i); RosterData::Default()->fCatalogAddOnInfos.ItemAt(i);
if (!info->MakeSureItsLoaded() || !info->fInstantiateEmbeddedFunc) if (!info->MakeSureItsLoaded() || !info->fInstantiateEmbeddedFunc)
continue; continue;
@ -837,7 +871,7 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
if (!catalog) if (!catalog)
return B_BAD_VALUE; return B_BAD_VALUE;
BAutolock lock(gRosterData.fLock); BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked()) if (!lock.IsLocked())
return B_ERROR; return B_ERROR;
@ -846,10 +880,10 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
while (catalog) { while (catalog) {
nextCatalog = catalog->Next(); nextCatalog = catalog->Next();
int32 count = gRosterData.fCatalogAddOnInfos.CountItems(); int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) { for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info = static_cast<CatalogAddOnInfo*>( CatalogAddOnInfo* info = static_cast<CatalogAddOnInfo*>(
gRosterData.fCatalogAddOnInfos.ItemAt(i)); RosterData::Default()->fCatalogAddOnInfos.ItemAt(i));
if (info->fLoadedCatalogs.HasItem(catalog)) { if (info->fLoadedCatalogs.HasItem(catalog)) {
info->fLoadedCatalogs.RemoveItem(catalog); info->fLoadedCatalogs.RemoveItem(catalog);
delete catalog; delete catalog;
@ -864,8 +898,3 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
} // namespace BPrivate } // namespace BPrivate
BLocaleRoster* be_locale_roster = &BPrivate::gLocaleRoster;
const BLocale* be_locale = &BPrivate::gRosterData.fDefaultLocale;

View File

@ -90,7 +90,7 @@ BTimeUnitFormat::SetLocale(const BLocale* locale)
if (fLocale != NULL) if (fLocale != NULL)
fLocale->GetLanguage(&language); fLocale->GetLanguage(&language);
else else
be_locale->GetLanguage(&language); BLocale::Default()->GetLanguage(&language);
Locale icuLocale(language.Code()); Locale icuLocale(language.Code());
UErrorCode icuStatus = U_ZERO_ERROR; UErrorCode icuStatus = U_ZERO_ERROR;

View File

@ -190,12 +190,12 @@ TruncTimeBase(BString* result, int64 value, const View* view, float width)
time_t timeValue = (time_t)value; time_t timeValue = (time_t)value;
if (be_locale->FormatDateTime(buffer, 256, timeValue, B_FULL_DATE_FORMAT, if (BLocale::Default()->FormatDateTime(buffer, 256, timeValue,
B_MEDIUM_TIME_FORMAT) == B_OK) B_FULL_DATE_FORMAT, B_MEDIUM_TIME_FORMAT) == B_OK)
resultWidth = view->StringWidth(buffer); resultWidth = view->StringWidth(buffer);
if (resultWidth > width if (resultWidth > width
&& be_locale->FormatDateTime(buffer, 256, timeValue, && BLocale::Default()->FormatDateTime(buffer, 256, timeValue,
B_SHORT_DATE_FORMAT, B_SHORT_TIME_FORMAT) == B_OK) { B_SHORT_DATE_FORMAT, B_SHORT_TIME_FORMAT) == B_OK) {
resultWidth = view->StringWidth(buffer); resultWidth = view->StringWidth(buffer);
} }

View File

@ -9,6 +9,7 @@
#define ICON_H #define ICON_H
#include "IconBuild.h"
#include "ShapeContainer.h" #include "ShapeContainer.h"
#ifdef ICON_O_MATIC #ifdef ICON_O_MATIC
@ -23,8 +24,8 @@
class BRect; class BRect;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class PathContainer; class PathContainer;
class StyleContainer; class StyleContainer;
@ -90,7 +91,8 @@ class Icon {
#endif #endif
}; };
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE
#endif // ICON_H #endif // ICON_H

22
src/libs/icon/IconBuild.h Normal file
View File

@ -0,0 +1,22 @@
/*
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#ifndef ICON_BUILD_H
#define ICON_BUILD_H
#ifdef ICON_O_MATIC
# define _BEGIN_ICON_NAMESPACE
# define _END_ICON_NAMESPACE
# define _ICON_NAMESPACE ::
# define _USING_ICON_NAMESPACE
#else
# define _BEGIN_ICON_NAMESPACE namespace BPrivate { namespace Icon {
# define _END_ICON_NAMESPACE } }
# define _ICON_NAMESPACE BPrivate::Icon::
# define _USING_ICON_NAMESPACE using namespace BPrivate::Icon;
#endif
#endif // ICON_BUILD_H

View File

@ -19,12 +19,15 @@
#include <agg_span_allocator.h> #include <agg_span_allocator.h>
#include <agg_trans_affine.h> #include <agg_trans_affine.h>
#include "IconBuild.h"
class BBitmap; class BBitmap;
class BRect; class BRect;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class Icon; class Icon;
@ -66,7 +69,7 @@ class IconRenderer {
// used when no background bitmap // used when no background bitmap
// is set // is set
const BPrivate::Icon::GammaTable& GammaTable() const const _ICON_NAMESPACE GammaTable& GammaTable() const
{ return fGammaTable; } { return fGammaTable; }
void Demultiply(); void Demultiply();
@ -83,7 +86,7 @@ class IconRenderer {
agg::rgba8 fBackgroundColor; agg::rgba8 fBackgroundColor;
const Icon* fIcon; const Icon* fIcon;
BPrivate::Icon::GammaTable fGammaTable; _ICON_NAMESPACE GammaTable fGammaTable;
RenderingBuffer fRenderingBuffer; RenderingBuffer fRenderingBuffer;
PixelFormat fPixelFormat; PixelFormat fPixelFormat;
@ -100,7 +103,8 @@ class IconRenderer {
Transformation fGlobalTransform; Transformation fGlobalTransform;
}; };
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE
#endif // ICON_RENDERER_H #endif // ICON_RENDERER_H

View File

@ -30,7 +30,7 @@
# define B_LARGE_ICON_TYPE 'ICON' # define B_LARGE_ICON_TYPE 'ICON'
#endif #endif
using namespace BPrivate::Icon; _USING_ICON_NAMESPACE;
using std::nothrow; using std::nothrow;

View File

@ -12,8 +12,8 @@
#include "LittleEndianBuffer.h" #include "LittleEndianBuffer.h"
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
const uint32 FLAT_ICON_MAGIC = 'ficn'; const uint32 FLAT_ICON_MAGIC = 'ficn';
@ -126,5 +126,5 @@ write_float_24(LittleEndianBuffer& buffer, float _value)
&& buffer.Write((uint8)(shortValue & 0xff)); && buffer.Write((uint8)(shortValue & 0xff));
} }
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE

View File

@ -11,9 +11,11 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include "IconBuild.h"
_BEGIN_ICON_NAMESPACE
namespace BPrivate {
namespace Icon {
extern const uint32 FLAT_ICON_MAGIC; extern const uint32 FLAT_ICON_MAGIC;
@ -73,7 +75,8 @@ bool write_coord(LittleEndianBuffer& buffer, float coord);
bool read_float_24(LittleEndianBuffer& buffer, float& value); bool read_float_24(LittleEndianBuffer& buffer, float& value);
bool write_float_24(LittleEndianBuffer& buffer, float value); bool write_float_24(LittleEndianBuffer& buffer, float value);
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE
#endif // FLAT_ICON_FORMAT_H #endif // FLAT_ICON_FORMAT_H

View File

@ -15,11 +15,15 @@
# include <SupportDefs.h> # include <SupportDefs.h>
#endif #endif
#include "IconBuild.h"
class BMessage; class BMessage;
class BPositionIO; class BPositionIO;
namespace BPrivate {
namespace Icon { _BEGIN_ICON_NAMESPACE
class Icon; class Icon;
class LittleEndianBuffer; class LittleEndianBuffer;
@ -62,7 +66,8 @@ class FlatIconImporter {
ShapeContainer* shapes); ShapeContainer* shapes);
}; };
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE
#endif // FLAT_ICON_IMPORTER_H #endif // FLAT_ICON_IMPORTER_H

View File

@ -15,7 +15,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
using namespace BPrivate::Icon;
_USING_ICON_NAMESPACE
#define CHUNK_SIZE 256 #define CHUNK_SIZE 256

View File

@ -11,9 +11,11 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include "IconBuild.h"
_BEGIN_ICON_NAMESPACE
namespace BPrivate {
namespace Icon {
class LittleEndianBuffer { class LittleEndianBuffer {
public: public:
@ -58,7 +60,8 @@ class LittleEndianBuffer {
bool fOwnsBuffer; bool fOwnsBuffer;
}; };
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE
#endif // LITTLE_ENDIAN_BUFFER_H #endif // LITTLE_ENDIAN_BUFFER_H

View File

@ -9,13 +9,15 @@
#define PATH_COMMAND_QUEUE_H #define PATH_COMMAND_QUEUE_H
#include "IconBuild.h"
#include "LittleEndianBuffer.h" #include "LittleEndianBuffer.h"
class BPoint; class BPoint;
namespace BPrivate { _BEGIN_ICON_NAMESPACE
namespace Icon {
class VectorPath; class VectorPath;
@ -55,7 +57,8 @@ class PathCommandQueue {
uint8 fCommandCount; uint8 fCommandCount;
}; };
} // namespace Icon
} // namespace BPrivate _END_ICON_NAMESPACE
#endif // PATH_COMMAND_QUEUE_H #endif // PATH_COMMAND_QUEUE_H

View File

@ -5,7 +5,16 @@
* Authors: * Authors:
* Stephan Aßmus <superstippi@gmx.de> * Stephan Aßmus <superstippi@gmx.de>
*/ */
#include "Defines.h" #include "Defines.h"
_BEGIN_ICON_NAMESPACE
const uint32 kNativeIconMagicNumber = 'IMSG'; const uint32 kNativeIconMagicNumber = 'IMSG';
const char* kNativeIconMimeType = "application/x-vnd.Haiku-icon"; const char* kNativeIconMimeType = "application/x-vnd.Haiku-icon";
_END_ICON_NAMESPACE

Some files were not shown because too many files have changed in this diff Show More