本文整理汇总了C++中BFont::IsFullAndHalfFixed方法的典型用法代码示例。如果您正苦于以下问题:C++ BFont::IsFullAndHalfFixed方法的具体用法?C++ BFont::IsFullAndHalfFixed怎么用?C++ BFont::IsFullAndHalfFixed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFont
的用法示例。
在下文中一共展示了BFont::IsFullAndHalfFixed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msgr
status_t
TerminalThemesAddon::ApplyThemeHaiku(BMessage &theme, uint32 flags)
{
BMessage termpref;
BMessage lines;
status_t err;
int32 ival;
rgb_color color;
BString s;
int i;
err = MyMessage(theme, termpref);
if (err)
return err;
for (i = 0; i < NENTS(sHaikuPrefsMapInt32); i++) {
if (termpref.FindInt32(sHaikuPrefsMapInt32[i].name, &ival) < B_OK)
ival = sHaikuPrefsMapInt32[i].def;
s = "";
s << ival;
lines.AddString(sHaikuPrefsMapInt32[i].pref, s.String());
}
for (i = 0; i < NENTS(sHaikuPrefsMapColors); i++) {
if (FindRGBColor(termpref, sHaikuPrefsMapColors[i].name, 0, &color) != B_OK)
color = sHaikuPrefsMapColors[i].def;
s = "";
s << color.red << ", " << color.green << ", " << color.blue;
lines.AddString(sHaikuPrefsMapColors[i].pref, s.String());
}
BFont tFont;
for (i = 0; FindFont(termpref, TP_FONT, i, &tFont) == B_OK; i++) {
// at least set the size
s = "";
s << (int32)tFont.Size();
lines.AddString(PREF_HALF_FONT_SIZE, s.String());
//tFont.PrintToStream();
//printf("fixed: %d\n", tFont.IsFixed());
//printf("f&h fixed: %d\n", tFont.IsFullAndHalfFixed());
// don't even try to set the font if it's not there or not fixed
if (!tFont.IsFixed() && !tFont.IsFullAndHalfFixed())
continue;
font_family ff;
font_style fs;
tFont.GetFamilyAndStyle(&ff, &fs);
s = "";
s << ff;
lines.AddString(PREF_HALF_FONT_FAMILY, s.String());
s = "";
s << fs;
lines.AddString(PREF_HALF_FONT_STYLE, s.String());
}
if (flags & UI_THEME_SETTINGS_SAVE && AddonFlags() & Z_THEME_ADDON_DO_SAVE) {
SaveHaikuTerminalSettings(lines);
}
if (flags & UI_THEME_SETTINGS_APPLY && AddonFlags() & Z_THEME_ADDON_DO_APPLY) {
BList teamList;
app_info ainfo;
int32 count, i;
be_roster->GetAppList(&teamList);
count = teamList.CountItems();
for (i = 0; i < count; i++) {
if (be_roster->GetRunningAppInfo((team_id)((addr_t)teamList.ItemAt(i)), &ainfo) == B_OK) {
if (!strcmp(ainfo.signature, kHaikuTerminalAppSig)) {
err = B_OK;
//XXX: WRITEME
/* BMessage msg(MSG_R5_SET_PREF);
BMessenger msgr(NULL, ainfo.team);
tp.x = 0;
tp.y = 0;
//msg.AddData("", 'UBYT', &(tp.p), sizeof(struct tpref));
msg.AddData("", 'UBYT', &(tp), sizeof(struct termprefs));
msg.AddSpecifier("Window", 0L);
err = msgr.SendMessage(&msg);
*/
}
}
}
}
return B_OK;
}