本文整理汇总了C++中GList::getLength方法的典型用法代码示例。如果您正苦于以下问题:C++ GList::getLength方法的具体用法?C++ GList::getLength怎么用?C++ GList::getLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GList
的用法示例。
在下文中一共展示了GList::getLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fontDirectory
void
BepdfApplication::Initialize()
{
if (!mInitialized) {
mInitialized = true;
// built in fonts
BPath fontDirectory(mAppPath);
fontDirectory.Append("fonts");
// built in encodings
BPath encodingDirectory(mAppPath);
encodingDirectory.Append("encodings");
InitXpdf(NULL, fontDirectory.Path(), encodingDirectory.Path());
// system fonts
BPath systemFontsPath;
if (find_directory(B_BEOS_FONTS_DIRECTORY, &systemFontsPath) == B_OK) {
BDirectory directory(systemFontsPath.Path());
BEntry entry;
while (directory.GetNextEntry(&entry) == B_OK) {
if (!entry.IsDirectory())
continue;
BPath fontDirectory;
if (entry.GetPath(&fontDirectory) != B_OK)
continue;
setGlobalParameter("fontDir", fontDirectory.Path());
}
}
// CID fonts
BMessage msg;
mSettings->GetDisplayCIDFonts(msg);
DisplayCIDFonts displayNames(msg);
// record new names
bool foundNewName = false;
GList* list = getCIDToUnicodeNames(globalParams);
for (int i = 0; i < list->getLength(); i ++) {
GString* name = (GString*)list->get(i);
if (displayNames.Contains(name->getCString())) {
continue;
}
// record name
displayNames.Set(name->getCString());
foundNewName = true;
}
// store in settings
if (foundNewName) {
msg.MakeEmpty();
displayNames.Archive(msg);
mSettings->SetDisplayCIDFonts(msg);
}
// set CID fonts
for (int i = 0; i < list->getLength(); i ++) {
GString* name = (GString*)list->get(i);
BString file;
DisplayCIDFonts::Type type;
displayNames.Get(name->getCString(), file, type);
if (type == DisplayCIDFonts::kUnknownType ||
file.Length() == 0) {
continue;
}
if (type == DisplayCIDFonts::kTrueType) {
setGlobalParameter("displayCIDFontTT", name->getCString(), file.String());
} else {
setGlobalParameter("displayCIDFontT1", name->getCString(), file.String());
}
}
deleteGList(list, GString);
}
}