Author: pulkomandy Date: 2010-04-15 17:57:30 +0200 (Thu, 15 Apr 2010) New Revision: 36303 Changeset: http://dev.haiku-os.org/changeset/36303/haiku Modified: haiku/trunk/headers/os/locale/Country.h haiku/trunk/src/kits/locale/Country.cpp haiku/trunk/src/kits/locale/Jamfile Log: Add a call in BCountry to get an icon for that country. Untested and not working yet since we don't provide any icon. Modified: haiku/trunk/headers/os/locale/Country.h =================================================================== --- haiku/trunk/headers/os/locale/Country.h 2010-04-15 15:51:47 UTC (rev 36302) +++ haiku/trunk/headers/os/locale/Country.h 2010-04-15 15:57:30 UTC (rev 36303) @@ -6,6 +6,9 @@ #include <LocaleStrings.h> #include <String.h> + +class BBitmap; + namespace icu_4_2 { class DateFormat; class Locale; @@ -21,13 +24,13 @@ public: BCountry(const char* languageCode, const char* countryCode); BCountry(const char* languageAndCountryCode = "en_US"); - virtual ~BCountry(); + virtual ~BCountry(); - virtual bool Name(BString&) const; - const char* Code() const; + virtual bool Name(BString&) const; + const char* Code() const; + status_t GetIcon(BBitmap* result); - // see definitions below - const char *GetString(uint32 id) const; + const char* GetString(uint32 id) const; // date & time Modified: haiku/trunk/src/kits/locale/Country.cpp =================================================================== --- haiku/trunk/src/kits/locale/Country.cpp 2010-04-15 15:51:47 UTC (rev 36302) +++ haiku/trunk/src/kits/locale/Country.cpp 2010-04-15 15:57:30 UTC (rev 36303) @@ -9,6 +9,7 @@ #include <assert.h> +#include <IconUtils.h> #include <String.h> #include <unicode/datefmt.h> @@ -86,6 +87,17 @@ } +status_t +BCountry::GetIcon(BBitmap* result) +{ + // TODO: a proper way to locate the library being used ? + BNode storage("/boot/system/lib/liblocale.so"); + if (storage.InitCheck() != B_OK) + return B_ERROR; + return BIconUtils::GetVectorIcon(&storage, Code(), result); +} + + // TODO use ICU backend keywords instead const char* BCountry::GetString(uint32 id) const Modified: haiku/trunk/src/kits/locale/Jamfile =================================================================== --- haiku/trunk/src/kits/locale/Jamfile 2010-04-15 15:51:47 UTC (rev 36302) +++ haiku/trunk/src/kits/locale/Jamfile 2010-04-15 15:57:30 UTC (rev 36303) @@ -1,8 +1,8 @@ SubDir HAIKU_TOP src kits locale ; UsePrivateHeaders libbe locale shared ; -UsePublicHeaders locale storage ; -UseLibraryHeaders icu ; +UsePublicHeaders locale storage icon ; +UseLibraryHeaders icu icon ; SharedLibrary liblocale.so : cat.cpp