* 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 ;
}
local baseURL = http://haiku-files.org/files/optional-packages ;
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 ;
HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ;
if $(HAIKU_BUILD_FEATURE_SSL) {

View File

@ -113,12 +113,14 @@ if [ IsOptionalHaikuImagePackageAdded ABI-compliance-checker ] {
if [ IsOptionalHaikuImagePackageAdded APR ] {
if $(TARGET_ARCH) != x86 {
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 {
InstallOptionalHaikuImagePackage 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 $(TARGET_ARCH) != x86 {
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 {
InstallOptionalHaikuImagePackage
apr-util-1.3.10-x86-gcc2-2010-10-13.zip
InstallOptionalHaikuImagePackage 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 $(TARGET_ARCH) != x86 {
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 {
InstallOptionalHaikuImagePackage
cdrtools-3.00-x86-gcc2-2010-08-25-1.zip
: $(baseURL)/cdrtools-3.00-x86-gcc2-2010-08-25-1.zip
:
;
InstallOptionalHaikuImagePackage 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 $(TARGET_ARCH) != x86 {
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 {
InstallOptionalHaikuImagePackage
curl-7.21.2-x86-gcc2-2010-10-13.zip
InstallOptionalHaikuImagePackage curl-7.21.2-x86-gcc2-2010-10-13.zip
: $(baseURL)/curl-7.21.2-x86-gcc2-2010-10-13.zip
:
: true
;
: : true ;
}
}
@ -485,13 +489,19 @@ if [ IsOptionalHaikuImagePackageAdded Curl ] {
if [ IsOptionalHaikuImagePackageAdded CVS ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package CVS available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
cvs-1.12.13.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/cvs-1.12.13.1-x86-gcc4-2010-11-12.zip
: : 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
;
: : true ;
}
InstallSourceArchive 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
if [ IsOptionalHaikuImagePackageAdded Development ] && $(TARGET_ARCH) = x86 {
# autotools
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage autoconf-2.68-x86-gcc4-2010-11-12.zip
: $(baseURL)/autoconf-2.68-x86-gcc4-2010-11-12.zip
: : true ;
InstallOptionalHaikuImagePackage automake-1.11.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/automake-1.11.1-x86-gcc4-2010-11-12.zip
: : true ;
InstallOptionalHaikuImagePackage libtool-2.4-x86-gcc4-2010-11-12.zip
: $(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
: : 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 ;
: : 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
: $(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
: $(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) {
InstallOptionalHaikuImagePackage gcc-4.4.4-x86-gcc4-2010-10-09.zip
: $(baseURL)/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-11-11.zip ;
}
if $(HAIKU_GCC_VERSION[1]) = 4 {
@ -559,24 +581,37 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
local libs = libstdc++.so libsupc++.so ;
for lib in $(libs) {
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 ;
}
}
# other commonly used tools
InstallOptionalHaikuImagePackage bison-2.4.1-r1a2-x86-gcc2-2010-04-21-a.zip
if $(HAIKU_GCC_VERSION[1]) >= 4 {
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 ;
InstallSourceArchive 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
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
: $(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
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
: $(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
@ -585,6 +620,14 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
: $(baseURL)/make-3.82-x86-gcc2-2010-09-25.zip ;
}
InstallSourceArchive bison-2.4.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/bison-2.4.1_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 ;
InstallSourceArchive flex-2.5.35_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/flex-2.5.35_haiku-2010-04-29.tar.xz ;
}
# DevelopmentMin
if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
@ -724,13 +767,19 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Expat available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
expat-2.0.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/expat-2.0.1-x86-gcc4-2010-11-12.zip
: : 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
: true
;
: : true ;
}
InstallSourceArchive expat-2.0.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/expat-2.0.1_haiku-2010-04-29.tar.xz ;
}
@ -955,14 +1004,17 @@ if [ IsOptionalHaikuImagePackageAdded LibEvent ] {
if [ IsOptionalHaikuImagePackageAdded LibIconv ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package LibIconv available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libiconv-1.13.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/libiconv-1.13.1-x86-gcc4-2010-11-12.zip ;
} else {
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
:
:
: true
;
: $(baseURL)/libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21-a.zip ;
}
InstallSourceArchive libiconv-1.13.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/libiconv-1.13.1_haiku-2010-04-29.tar.xz ;
}
@ -1006,14 +1058,17 @@ if [ IsOptionalHaikuImagePackageAdded Libmng ] {
if [ IsOptionalHaikuImagePackageAdded LibXML2 ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libxml2-2.7.7-x86-gcc4-2010-11-12.zip
: $(baseURL)/libxml2-2.7.7-x86-gcc4-2010-11-12.zip ;
} else {
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
:
:
: true
;
: $(baseURL)/libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22-a.zip ;
}
InstallSourceArchive libxml2-2.7.7_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/libxml2-2.7.7_haiku-2010-04-29.tar.xz ;
}
@ -1102,13 +1157,18 @@ if [ IsOptionalHaikuImagePackageAdded MandatoryPackages ] {
if [ IsOptionalHaikuImagePackageAdded Mercurial ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Mercurial available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
mercurial-1.6-x86-gcc4-2010-11-12.zip
: $(baseURL)/mercurial-1.6-x86-gcc4-2010-11-12.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
mercurial-1.6-x86-gcc2-2010-07-01.zip
: $(baseURL)/mercurial-1.6-x86-gcc2-2010-07-01.zip
:
: true
;
: : true ;
}
}
}
@ -1117,12 +1177,16 @@ if [ IsOptionalHaikuImagePackageAdded Mercurial ] {
if [ IsOptionalHaikuImagePackageAdded Nano ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Nano available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
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
:
;
: $(baseURL)/nano-2.2.5-x86-gcc2-2010-10-16.zip ;
}
}
}
@ -1131,12 +1195,16 @@ if [ IsOptionalHaikuImagePackageAdded Nano ] {
if [ IsOptionalHaikuImagePackageAdded Neon ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Neon available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
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
:
;
: $(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"
"variable to be set!" ;
}
if $(HAIKU_GCC_VERSION[1]) >= 4 {
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
:
;
: $(baseURL)/openssh-5.6p1-x86-gcc2-2010-11-03.zip ;
}
AddUserToHaikuImage sshd : 1001 : 100 : /var/empty : /bin/true
: "sshd user" ;
@ -1249,12 +1322,13 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package OpenSSL available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage $(HAIKU_OPENSSL_PACKAGE)
: $(HAIKU_OPENSSL_URL)
:
:
: true
;
: $(HAIKU_OPENSSL_URL) ;
} else {
InstallOptionalHaikuImagePackage $(HAIKU_OPENSSL_PACKAGE)
: $(HAIKU_OPENSSL_URL) ;
}
}
}
@ -1266,10 +1340,8 @@ if [ IsOptionalHaikuImagePackageAdded P7zip ] {
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
p7zip-9.04-r1a2-x86-gcc4-2010-05-06.zip
: $(baseURL)/p7zip-9.04-r1a2-x86-gcc4-2010-05-06.zip
:
;
p7zip-9.04-x86-gcc4-2010-11-13.zip
: $(baseURL)/p7zip-9.04-x86-gcc4-2010-11-13.zip ;
} else {
InstallOptionalHaikuImagePackage
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)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage pe-2.4.3-600-x86-gcc4-2010-09-28.zip
: $(baseURL)/pe-2.4.3-600-x86-gcc4-2010-09-28.zip
;
InstallOptionalHaikuImagePackage
pe-2.4.3-600-x86-gcc4-2010-11-14.zip
: $(baseURL)/pe-2.4.3-600-x86-gcc4-2010-11-14.zip ;
} else {
InstallOptionalHaikuImagePackage
pe-2.4.3-600-x86-gcc2-2010-09-28.zip
@ -1359,14 +1431,19 @@ if [ IsOptionalHaikuImagePackageAdded Pe ] {
if [ IsOptionalHaikuImagePackageAdded Perl ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Perl available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
perl-5.10.1-x86-gcc4-2010-11-12.zip
: $(baseURL)/perl-5.10.1-x86-gcc4-2010-11-12.zip
: : 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
: true
;
: : true ;
}
InstallSourceArchive perl-5.10.1_haiku-2010-04-29.tar.xz
: $(baseSourceURL)/2010/perl-5.10.1_haiku-2010-04-29.tar.xz ;
}
@ -1377,14 +1454,18 @@ if [ IsOptionalHaikuImagePackageAdded Perl ] {
if [ IsOptionalHaikuImagePackageAdded Python ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Python available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
python-2.6.6-x86-gcc4-2010-11-12.zip
: $(baseURL)/python-2.6.6-x86-gcc4-2010-11-12.zip
: : 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
: true
;
: : true ;
}
}
}
@ -1440,13 +1521,18 @@ if [ IsOptionalHaikuImagePackageAdded Sed ] {
if [ IsOptionalHaikuImagePackageAdded SQLite ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
sqlite-3.7.3-x86-gcc4-2010-11-12.zip
: $(baseURL)/sqlite-3.7.3-x86-gcc4-2010-11-12.zip
: : 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
;
: : true ;
}
}
}
@ -1455,13 +1541,18 @@ if [ IsOptionalHaikuImagePackageAdded SQLite ] {
if [ IsOptionalHaikuImagePackageAdded Subversion ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Subversion available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
subversion-1.6.13-x86-gcc4-2010-11-12.zip
: $(baseURL)/subversion-1.6.13-x86-gcc4-2010-11-12.zip
: : 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
;
: : true ;
}
}
}
@ -1488,12 +1579,17 @@ if [ IsOptionalHaikuImagePackageAdded TagLib ] {
if [ IsOptionalHaikuImagePackageAdded Tar ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package Tar available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) {
InstallOptionalHaikuImagePackage
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
:
;
: $(baseURL)/tar-1.22-r1a2-x86-gcc2-2010-04-22-a.zip ;
}
InstallSourceArchive 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 {
Echo "No optional package Vision available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage vision-908-x86-gcc2-2010-10-30.zip
: $(baseURL)/vision-908-x86-gcc4-2010-11-04.zip
:
;
InstallOptionalHaikuImagePackage vision-908-x86-gcc4-2010-11-14.zip
: $(baseURL)/vision-908-x86-gcc4-2010-11-14.zip ;
AddSymlinkToHaikuImage home config be Applications
: /boot/apps/Vision/Vision ;
} else {
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
: /boot/apps/Vision/Vision ;
}
@ -1665,8 +1757,8 @@ if [ IsOptionalHaikuImagePackageAdded WebPositive ] {
Echo "No optional package WebPositive available for gcc2" ;
} else {
InstallOptionalHaikuImagePackage
WebPositive-gcc4-x86-r545-2010-08-31.zip
: $(baseURL)/WebPositive-gcc4-x86-r545-2010-08-31.zip
WebPositive-gcc4-x86-r547-2010-11-16.zip
: $(baseURL)/WebPositive-gcc4-x86-r547-2010-11-16.zip
:
;
AddSymlinkToHaikuImage home config be Applications
@ -1758,14 +1850,17 @@ if [ IsOptionalHaikuImagePackageAdded WonderBrush ] {
if [ IsOptionalHaikuImagePackageAdded XZ-Utils ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package XZ-Utils available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
xz-utils-4.999.9-x86-gcc4-2010-11-13.zip
: $(baseURL)/xz-utils-4.999.9-x86-gcc4-2010-11-13.zip ;
} else {
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
:
:
: true
;
: $(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
: $(baseSourceURL)/2010/xz-utils-4.999.9_haiku-2010-04-29.tar.xz ;
AddExpanderRuleToHaikuImage "application/x-xz" : .tar.xz

1
configure vendored
View File

@ -478,6 +478,7 @@ if [ $targetArch = "x86" ]; then
0.[0-6].*) ;;
*) versionOK=1 ;;
esac
versionOK=1
if [ $versionOK = 0 ]; then
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:
#undef B_TRANSLATE
#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
#define B_TRANSLATE_WITH_CONTEXT(string, context) \
be_locale_roster->GetCatalog()->GetString((string), (context))
BLocaleRoster::Default()->GetCatalog()->GetString((string), (context))
#undef B_TRANSLATE_COMMENT
#define B_TRANSLATE_COMMENT(string, comment) \
be_locale_roster->GetCatalog()->GetString((string), B_TRANSLATE_CONTEXT, \
(comment))
BLocaleRoster::Default()->GetCatalog()->GetString((string), \
B_TRANSLATE_CONTEXT, (comment))
#undef B_TRANSLATE_ALL
#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
#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
// 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();
static const BLocale* Default();
BLocale& operator=(const BLocale& other);
status_t GetCollator(BCollator* collator) const;
@ -155,10 +157,6 @@ private:
};
// global locale object
extern const BLocale* be_locale;
//--- collator short-hands inlines ---
// #pragma mark -

View File

@ -30,6 +30,8 @@ public:
BLocaleRoster();
~BLocaleRoster();
static BLocaleRoster* Default();
status_t GetDefaultTimeZone(BTimeZone* timezone) const;
status_t GetLanguage(const char* languageCode,
@ -76,7 +78,4 @@ private:
};
extern BLocaleRoster* be_locale_roster;
#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 *);
void putlong(u_int32_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_int32_t _getlong(const u_char *);
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -252,6 +252,16 @@ struct Elf32_Dyn {
#define DT_DEBUG 21
#define DT_TEXTREL 22
#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_VERDEF 0x6ffffffc /* version definition table */
@ -263,6 +273,14 @@ struct Elf32_Dyn {
#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 */
struct Elf32_Verdef {

View File

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

View File

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

View File

@ -89,7 +89,7 @@ CalendarMenuWindow::CalendarMenuWindow(BPoint where)
fSuppressFirstClose(true)
{
BPrivate::week_start startOfWeek
= (BPrivate::week_start)be_locale->StartOfWeek();
= (BPrivate::week_start)BLocale::Default()->StartOfWeek();
RemoveShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY);
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;
fNeedToUpdate = true;
fLocale = *be_locale;
fLocale = *BLocale::Default();
}
@ -96,7 +96,7 @@ TTimeView::TTimeView(BMessage* data)
data->FindBool("seconds", &fShowSeconds);
data->FindBool("interval", &fInterval);
fLocale = *be_locale;
fLocale = *BLocale::Default();
}
#endif
@ -357,7 +357,7 @@ TTimeView::ShowSeconds(bool on)
void
TTimeView::Update()
{
fLocale = *be_locale;
fLocale = *BLocale::Default();
GetCurrentTime();
GetCurrentDate();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,7 +39,7 @@
#include "KeymapListItem.h"
using BPrivate::gMutableLocaleRoster;
using BPrivate::MutableLocaleRoster;
enum {
@ -59,8 +59,8 @@ public:
fLanguage(language)
{
fIcon = new(std::nothrow) BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
if (fIcon != NULL && be_locale_roster->GetFlagIconForCountry(fIcon,
language) != B_OK) {
if (fIcon != NULL && BLocaleRoster::Default()->GetFlagIconForCountry(
fIcon, language) != B_OK) {
delete fIcon;
fIcon = NULL;
}
@ -247,7 +247,7 @@ BootPromptWindow::BootPromptWindow()
| B_AUTO_UPDATE_SIZE_LIMITS)
{
// 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));
static_cast<TextBitmapView*>(fInfoTextView)->SetInsets(5, 5, 5, 5);
@ -333,7 +333,7 @@ BootPromptWindow::MessageReceived(BMessage* message)
BMessage preferredLanguages;
preferredLanguages.AddString("language",
languageItem->Language());
gMutableLocaleRoster->SetPreferredLanguages(
MutableLocaleRoster::Default()->SetPreferredLanguages(
&preferredLanguages);
_InitCatalog(true);
}
@ -368,14 +368,14 @@ BootPromptWindow::_InitCatalog(bool saveSettings)
BMessage settings;
BString language;
if (be_locale_roster->GetCatalog()->GetLanguage(&language) == B_OK) {
if (BLocaleRoster::Default()->GetCatalog()->GetLanguage(&language) == B_OK)
settings.AddString("language", language.String());
}
gMutableLocaleRoster->SetPreferredLanguages(&settings);
MutableLocaleRoster::Default()->SetPreferredLanguages(&settings);
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
BMessage preferredLanguages;
be_locale_roster->GetPreferredLanguages(&preferredLanguages);
BLocaleRoster::Default()->GetPreferredLanguages(&preferredLanguages);
const char* firstPreferredLanguage;
if (preferredLanguages.FindString("language", &firstPreferredLanguage)
!= B_OK) {
@ -431,7 +431,7 @@ BootPromptWindow::_PopulateLanguages()
}
BMessage installedCatalogs;
be_locale_roster->GetAvailableCatalogs(&installedCatalogs,
BLocaleRoster::Default()->GetAvailableCatalogs(&installedCatalogs,
"x-vnd.Haiku-ReadOnlyBootPrompt");
BFont font;
@ -446,7 +446,8 @@ BootPromptWindow::_PopulateLanguages()
for (int32 i = 0; installedCatalogs.FindString("language", i, &languageID)
== B_OK; i++) {
BLanguage* language;
if (be_locale_roster->GetLanguage(languageID, &language) == B_OK) {
if (BLocaleRoster::Default()->GetLanguage(languageID, &language)
== B_OK) {
BString name;
language->GetNativeName(name);

View File

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

View File

@ -83,7 +83,7 @@ TimedAlert::GetLabel(BString &string)
time(&t);
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 += timestring;

View File

@ -15,7 +15,7 @@
#include <Roster.h>
using BPrivate::gMutableLocaleRoster;
using BPrivate::MutableLocaleRoster;
//#pragma mark - BCatalog
@ -29,14 +29,14 @@ BCatalog::BCatalog()
BCatalog::BCatalog(const char *signature, const char *language,
uint32 fingerprint)
{
fCatalog
= gMutableLocaleRoster->LoadCatalog(signature, language, fingerprint);
fCatalog = MutableLocaleRoster::Default()->LoadCatalog(signature, language,
fingerprint);
}
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
// not do harm there, but not sure what to do about it…
gMutableLocaleRoster->UnloadCatalog(fCatalog);
fCatalog = gMutableLocaleRoster->LoadCatalog(signature, NULL, fingerprint);
MutableLocaleRoster::Default()->UnloadCatalog(fCatalog);
fCatalog = MutableLocaleRoster::Default()->LoadCatalog(signature, NULL,
fingerprint);
return B_OK;
}
@ -268,7 +269,8 @@ namespace BPrivate {
EditableCatalog::EditableCatalog(const char *type, const char *signature,
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;
if (displayLanguage == NULL) {
BMessage preferredLanguage;
be_locale_roster->GetPreferredLanguages(&preferredLanguage);
BLocaleRoster::Default()->GetPreferredLanguages(&preferredLanguage);
preferredLanguage.FindString("language", 0, &appLanguage);
} else {
appLanguage = displayLanguage->Code();
@ -112,13 +112,14 @@ BCountry::GetIcon(BBitmap* result) const
const char* code = fICULocale->getCountry();
if (code == NULL)
return B_ERROR;
return be_locale_roster->GetFlagIconForCountry(result, code);
return BLocaleRoster::Default()->GetFlagIconForCountry(result, code);
}
status_t
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) {
BTimeZone defaultTimeZone;
status_t result
= be_locale_roster->GetDefaultTimeZone(&defaultTimeZone);
= BLocaleRoster::Default()->GetDefaultTimeZone(&defaultTimeZone);
if (result != B_OK)
return result;
zonePrivate.SetTo(&defaultTimeZone);

View File

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

View File

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

View File

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

View File

@ -42,12 +42,12 @@ BLocale::BLocale(const BLanguage* language,
if (conventions != NULL)
fConventions = *conventions;
else
be_locale->GetFormattingConventions(&fConventions);
BLocale::Default()->GetFormattingConventions(&fConventions);
if (language != NULL)
fLanguage = *language;
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::operator=(const BLocale& other)
{

View File

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

View File

@ -18,6 +18,7 @@
#include <Autolock.h>
#include <Catalog.h>
#include <Collator.h>
#include <Debug.h>
#include <DefaultCatalog.h>
#include <Directory.h>
#include <Entry.h>
@ -125,8 +126,6 @@ CatalogAddOnInfo::UnloadIfPossible()
// #pragma mark - RosterData
RosterData gRosterData;
static const char* kPriorityAttr = "ADDON:priority";
static const char* kLanguageField = "language";
@ -134,6 +133,9 @@ static const char* kLanguageField = "language";
static const char* kTimezoneField = "timezone";
static const char* kOffsetField = "offset";
static RosterData sRosterData(BLanguage("en_US"),
BFormattingConventions("en_US"));
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()
{
BAutolock lock(fLock);
@ -160,6 +180,13 @@ RosterData::~RosterData()
}
/*static*/ RosterData*
RosterData::Default()
{
return &sRosterData;
}
int
RosterData::CompareInfos(const void* left, const void* right)
{
@ -626,8 +653,7 @@ RosterData::_AddPreferredLanguagesToMessage(BMessage* message) const
// #pragma mark - MutableLocaleRoster
static MutableLocaleRoster gLocaleRoster;
MutableLocaleRoster* gMutableLocaleRoster = &gLocaleRoster;
static MutableLocaleRoster sLocaleRoster;
MutableLocaleRoster::MutableLocaleRoster()
@ -640,24 +666,32 @@ MutableLocaleRoster::~MutableLocaleRoster()
}
/*static*/ MutableLocaleRoster*
MutableLocaleRoster::Default()
{
return &sLocaleRoster;
}
status_t
MutableLocaleRoster::SetDefaultFormattingConventions(const BFormattingConventions& newFormattingConventions)
{
return gRosterData.SetDefaultFormattingConventions(newFormattingConventions);
return RosterData::Default()->SetDefaultFormattingConventions(
newFormattingConventions);
}
status_t
MutableLocaleRoster::SetDefaultTimeZone(const BTimeZone& newZone)
{
return gRosterData.SetDefaultTimeZone(newZone);
return RosterData::Default()->SetDefaultTimeZone(newZone);
}
status_t
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)
return NULL;
BAutolock lock(gRosterData.fLock);
BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked())
return NULL;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems();
int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i);
CatalogAddOnInfo* info = (CatalogAddOnInfo*)
RosterData::Default()->fCatalogAddOnInfos.ItemAt(i);
if (info->fName.ICompare(type)!=0 || !info->MakeSureItsLoaded()
|| !info->fCreateFunc)
continue;
@ -727,14 +761,14 @@ MutableLocaleRoster::LoadCatalog(const char* signature, const char* language,
if (!signature)
return NULL;
BAutolock lock(gRosterData.fLock);
BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked())
return NULL;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems();
int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i);
CatalogAddOnInfo* info = (CatalogAddOnInfo*)
RosterData::Default()->fCatalogAddOnInfos.ItemAt(i);
if (!info->MakeSureItsLoaded() || !info->fInstantiateFunc)
continue;
@ -801,14 +835,14 @@ MutableLocaleRoster::LoadEmbeddedCatalog(entry_ref* appOrAddOnRef)
if (!appOrAddOnRef)
return NULL;
BAutolock lock(gRosterData.fLock);
BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked())
return NULL;
int32 count = gRosterData.fCatalogAddOnInfos.CountItems();
int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info
= (CatalogAddOnInfo*)gRosterData.fCatalogAddOnInfos.ItemAt(i);
CatalogAddOnInfo* info = (CatalogAddOnInfo*)
RosterData::Default()->fCatalogAddOnInfos.ItemAt(i);
if (!info->MakeSureItsLoaded() || !info->fInstantiateEmbeddedFunc)
continue;
@ -837,7 +871,7 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
if (!catalog)
return B_BAD_VALUE;
BAutolock lock(gRosterData.fLock);
BAutolock lock(RosterData::Default()->fLock);
if (!lock.IsLocked())
return B_ERROR;
@ -846,10 +880,10 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
while (catalog) {
nextCatalog = catalog->Next();
int32 count = gRosterData.fCatalogAddOnInfos.CountItems();
int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
for (int32 i = 0; i < count; ++i) {
CatalogAddOnInfo* info = static_cast<CatalogAddOnInfo*>(
gRosterData.fCatalogAddOnInfos.ItemAt(i));
RosterData::Default()->fCatalogAddOnInfos.ItemAt(i));
if (info->fLoadedCatalogs.HasItem(catalog)) {
info->fLoadedCatalogs.RemoveItem(catalog);
delete catalog;
@ -864,8 +898,3 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
} // 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)
fLocale->GetLanguage(&language);
else
be_locale->GetLanguage(&language);
BLocale::Default()->GetLanguage(&language);
Locale icuLocale(language.Code());
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;
if (be_locale->FormatDateTime(buffer, 256, timeValue, B_FULL_DATE_FORMAT,
B_MEDIUM_TIME_FORMAT) == B_OK)
if (BLocale::Default()->FormatDateTime(buffer, 256, timeValue,
B_FULL_DATE_FORMAT, B_MEDIUM_TIME_FORMAT) == B_OK)
resultWidth = view->StringWidth(buffer);
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) {
resultWidth = view->StringWidth(buffer);
}

View File

@ -9,6 +9,7 @@
#define ICON_H
#include "IconBuild.h"
#include "ShapeContainer.h"
#ifdef ICON_O_MATIC
@ -23,8 +24,8 @@
class BRect;
namespace BPrivate {
namespace Icon {
_BEGIN_ICON_NAMESPACE
class PathContainer;
class StyleContainer;
@ -90,7 +91,8 @@ class Icon {
#endif
};
} // namespace Icon
} // namespace BPrivate
_END_ICON_NAMESPACE
#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_trans_affine.h>
#include "IconBuild.h"
class BBitmap;
class BRect;
namespace BPrivate {
namespace Icon {
_BEGIN_ICON_NAMESPACE
class Icon;
@ -66,7 +69,7 @@ class IconRenderer {
// used when no background bitmap
// is set
const BPrivate::Icon::GammaTable& GammaTable() const
const _ICON_NAMESPACE GammaTable& GammaTable() const
{ return fGammaTable; }
void Demultiply();
@ -83,7 +86,7 @@ class IconRenderer {
agg::rgba8 fBackgroundColor;
const Icon* fIcon;
BPrivate::Icon::GammaTable fGammaTable;
_ICON_NAMESPACE GammaTable fGammaTable;
RenderingBuffer fRenderingBuffer;
PixelFormat fPixelFormat;
@ -100,7 +103,8 @@ class IconRenderer {
Transformation fGlobalTransform;
};
} // namespace Icon
} // namespace BPrivate
_END_ICON_NAMESPACE
#endif // ICON_RENDERER_H

View File

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

View File

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

View File

@ -11,9 +11,11 @@
#include <SupportDefs.h>
#include "IconBuild.h"
_BEGIN_ICON_NAMESPACE
namespace BPrivate {
namespace Icon {
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 write_float_24(LittleEndianBuffer& buffer, float value);
} // namespace Icon
} // namespace BPrivate
_END_ICON_NAMESPACE
#endif // FLAT_ICON_FORMAT_H

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,16 @@
* Authors:
* Stephan Aßmus <superstippi@gmx.de>
*/
#include "Defines.h"
_BEGIN_ICON_NAMESPACE
const uint32 kNativeIconMagicNumber = 'IMSG';
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