Update fmtlib

This commit is contained in:
Jack Andersen 2020-04-11 12:50:38 -10:00
parent 401f8b8ef5
commit 81c5d40211
9 changed files with 24 additions and 24 deletions

View File

@ -412,7 +412,7 @@ void Button::MenuTarget::mouseDown(const boo::SWindowCoord& coord, boo::EMouseBu
m_pressed = true;
setPressed();
if (m_hovered) {
Log.report(logvisor::Info, fmt("button menu '{}' activated"), m_button.m_textStr);
Log.report(logvisor::Info, FMT_STRING("button menu '{}' activated"), m_button.m_textStr);
if (m_button.m_controlBinding) {
m_button.m_modalMenu.m_view = static_cast<IButtonBinding&>(*m_button.m_controlBinding).buildMenu(&m_button);
rootView().setActiveMenuButton(&m_button);
@ -432,7 +432,7 @@ void Button::ButtonTarget::mouseUp(const boo::SWindowCoord& coord, boo::EMouseBu
if (m_button.m_controlBinding)
static_cast<IButtonBinding&>(*m_button.m_controlBinding).up(&m_button, coord);
if (m_hovered) {
Log.report(logvisor::Info, fmt("button '{}' activated"), m_button.m_textStr);
Log.report(logvisor::Info, FMT_STRING("button '{}' activated"), m_button.m_textStr);
if (m_button.m_controlBinding)
static_cast<IButtonBinding&>(*m_button.m_controlBinding).activated(&m_button, coord);
}

View File

@ -75,12 +75,12 @@ void FreeTypeGZipMemFace::open() {
return;
if (FT_Stream_OpenGzip(&m_decomp, &m_comp))
Log.report(logvisor::Fatal, fmt("unable to open FreeType gzip stream"));
Log.report(logvisor::Fatal, FMT_STRING("unable to open FreeType gzip stream"));
FT_Open_Args args = {FT_OPEN_STREAM, nullptr, 0, nullptr, &m_decomp};
if (FT_Open_Face(m_lib, &args, 0, &m_face))
Log.report(logvisor::Fatal, fmt("unable to open FreeType gzip face"));
Log.report(logvisor::Fatal, FMT_STRING("unable to open FreeType gzip face"));
}
void FreeTypeGZipMemFace::close() {
@ -596,7 +596,7 @@ boo::ObjToken<boo::ITextureSA> FontAtlas::texture(boo::IGraphicsDataFactory* gf)
FontCache::Library::Library() {
FT_Error err = FT_Init_FreeType(&m_lib);
if (err)
Log.report(logvisor::Fatal, fmt("unable to FT_Init_FreeType"));
Log.report(logvisor::Fatal, FMT_STRING("unable to FT_Init_FreeType"));
}
FontCache::Library::~Library() { FT_Done_FreeType(m_lib); }
@ -616,10 +616,10 @@ FontTag FontCache::prepCustomFont(std::string_view name, FT_Face face, FCharFilt
uint32_t dpi) {
/* Quick validation */
if (!face)
Log.report(logvisor::Fatal, fmt("invalid freetype face"));
Log.report(logvisor::Fatal, FMT_STRING("invalid freetype face"));
if (!face->charmap || face->charmap->encoding != FT_ENCODING_UNICODE)
Log.report(logvisor::Fatal, fmt("font does not contain a unicode char map"));
Log.report(logvisor::Fatal, FMT_STRING("font does not contain a unicode char map"));
/* Set size with FreeType */
FT_Set_Char_Size(face, 0, points * 64.0, 0, dpi);
@ -632,7 +632,7 @@ FontTag FontCache::prepCustomFont(std::string_view name, FT_Face face, FCharFilt
}
/* Now check filesystem cache */
hecl::SystemString cachePath = m_cacheRoot + _SYS_STR('/') + fmt::format(fmt(_SYS_STR("{:x}")), tag.hash());
hecl::SystemString cachePath = m_cacheRoot + _SYS_STR('/') + fmt::format(FMT_STRING(_SYS_STR("{:x}")), tag.hash());
hecl::Sstat st;
if (!hecl::Stat(cachePath.c_str(), &st) && S_ISREG(st.st_mode)) {
athena::io::FileReader r(cachePath);
@ -651,7 +651,7 @@ FontTag FontCache::prepCustomFont(std::string_view name, FT_Face face, FCharFilt
/* Nada, build and cache now */
athena::io::FileWriter w(cachePath);
if (w.hasError())
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to open '{}' for writing")), cachePath);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to open '{}' for writing")), cachePath);
w.writeUint32Big('FONT');
m_cachedAtlases.emplace(tag, std::make_unique<FontAtlas>(face, dpi, subpixel, filter, w));
return tag;
@ -660,7 +660,7 @@ FontTag FontCache::prepCustomFont(std::string_view name, FT_Face face, FCharFilt
const FontAtlas& FontCache::lookupAtlas(FontTag tag) const {
auto search = m_cachedAtlases.find(tag);
if (search == m_cachedAtlases.cend())
Log.report(logvisor::Fatal, fmt("invalid font"));
Log.report(logvisor::Fatal, FMT_STRING("invalid font"));
return *search->second.get();
}

View File

@ -19,7 +19,7 @@ std::string MultiLineTextView::LineWrap(std::string_view str, int wrap) {
utf8proc_int32_t ch;
utf8proc_ssize_t sz = utf8proc_iterate(it, -1, &ch);
if (sz < 0)
Log.report(logvisor::Fatal, fmt("invalid UTF-8 char"));
Log.report(logvisor::Fatal, FMT_STRING("invalid UTF-8 char"));
if (ch == '\n') {
ret += '\n';
lCh = -1;
@ -147,7 +147,7 @@ void MultiLineTextView::typesetGlyphs(std::string_view str, const zeus::CColor&
utf8proc_int32_t ch;
utf8proc_ssize_t sz = utf8proc_iterate(it, -1, &ch);
if (sz < 0)
Log.report(logvisor::Fatal, fmt("invalid UTF-8 char"));
Log.report(logvisor::Fatal, FMT_STRING("invalid UTF-8 char"));
if (ch == '\n' || ch == '\0')
++lineCount;
rem -= sz;

View File

@ -34,7 +34,7 @@ SplitView::SplitView(ViewResources& res, View& parentView, ISplitSpaceController
View* SplitView::setContentView(int slot, View* view) {
if (slot < 0 || slot > 1)
Log.report(logvisor::Fatal, fmt("out-of-range slot to RootView::SplitView::setContentView"));
Log.report(logvisor::Fatal, FMT_STRING("out-of-range slot to RootView::SplitView::setContentView"));
View* ret = m_views[slot].m_view;
m_views[slot].m_view = view;
m_views[slot].m_mouseDown = 0;

View File

@ -46,7 +46,7 @@ Table::Table(ViewResources& res, View& parentView, ITableDataBinding* data, ITab
, m_hVerts(std::make_unique<SolidShaderVert[]>(maxColumns * 6))
, m_rowsView(*this, res) {
if (maxColumns == 0) {
Log.report(logvisor::Fatal, fmt("0-column tables not supported"));
Log.report(logvisor::Fatal, FMT_STRING("0-column tables not supported"));
}
m_scroll.m_view = std::make_unique<ScrollView>(res, *this, ScrollView::Style::ThinIndicator);
@ -202,7 +202,7 @@ void Table::RowsView::_setRowVerts(const boo::SWindowRect& sub, const boo::SWind
void Table::cycleSortColumn(size_t c) {
if (c >= m_columns)
Log.report(logvisor::Fatal, fmt("cycleSortColumn out of bounds ({}, {})"), c, m_columns);
Log.report(logvisor::Fatal, FMT_STRING("cycleSortColumn out of bounds ({}, {})"), c, m_columns);
if (m_state) {
size_t cIdx;
SortDirection dir = m_state->getSort(cIdx);
@ -219,7 +219,7 @@ void Table::selectRow(size_t r) {
if (m_inSelectRow)
return;
if (r >= m_rows && r != SIZE_MAX)
Log.report(logvisor::Fatal, fmt("selectRow out of bounds ({}, {})"), r, m_rows);
Log.report(logvisor::Fatal, FMT_STRING("selectRow out of bounds ({}, {})"), r, m_rows);
if (r == m_selectedRow) {
if (m_state) {
m_inSelectRow = true;

View File

@ -48,7 +48,7 @@ void TextView::_commitResources(size_t capacity) {
TextView::TextView(ViewResources& res, View& parentView, const FontAtlas& font, Alignment align, size_t capacity)
: View(res, parentView), m_capacity(capacity), m_fontAtlas(font), m_align(align) {
if (size_t(hecl::VertexBufferPool<RenderGlyph>::bucketCapacity()) < capacity)
Log.report(logvisor::Fatal, fmt("bucket overflow [{}/{}]"), capacity,
Log.report(logvisor::Fatal, FMT_STRING("bucket overflow [{}/{}]"), capacity,
hecl::VertexBufferPool<RenderGlyph>::bucketCapacity());
_commitResources(0);
@ -105,7 +105,7 @@ void TextView::typesetGlyphs(std::string_view str, const zeus::CColor& defaultCo
for (; it.iter() < str.end(); ++it) {
utf8proc_int32_t ch = *it;
if (ch == -1) {
Log.report(logvisor::Warning, fmt("invalid UTF-8 char"));
Log.report(logvisor::Warning, FMT_STRING("invalid UTF-8 char"));
break;
}
if (ch == '\n' || ch == '\0')
@ -237,7 +237,7 @@ void TextView::draw(boo::IGraphicsCommandQueue* gfxQ) {
std::pair<int, int> TextView::queryGlyphDimensions(size_t pos) const {
if (pos >= m_glyphInfo.size())
Log.report(logvisor::Fatal, fmt("TextView::queryGlyphWidth({}) out of bounds: {}"), pos,
Log.report(logvisor::Fatal, FMT_STRING("TextView::queryGlyphWidth({}) out of bounds: {}"), pos,
m_glyphInfo.size());
return m_glyphInfo[pos].m_dims;
@ -260,7 +260,7 @@ size_t TextView::reverseSelectGlyph(int x) const {
int TextView::queryReverseAdvance(size_t idx) const {
if (idx > m_glyphInfo.size())
Log.report(logvisor::Fatal, fmt("TextView::queryReverseGlyph({}) out of inclusive bounds: {}"), idx,
Log.report(logvisor::Fatal, FMT_STRING("TextView::queryReverseGlyph({}) out of inclusive bounds: {}"), idx,
m_glyphInfo.size());
if (!idx)
return 0;
@ -269,7 +269,7 @@ int TextView::queryReverseAdvance(size_t idx) const {
std::pair<size_t, size_t> TextView::queryWholeWordRange(size_t idx) const {
if (idx > m_glyphInfo.size())
Log.report(logvisor::Fatal, fmt("TextView::queryWholeWordRange({}) out of inclusive bounds: {}"), idx,
Log.report(logvisor::Fatal, FMT_STRING("TextView::queryWholeWordRange({}) out of inclusive bounds: {}"), idx,
m_glyphInfo.size());
if (m_glyphInfo.empty())
return {0, 0};

View File

@ -114,7 +114,7 @@ void Toolbar::setVerticalVerts(int height) {
void Toolbar::push_back(View* v, unsigned unit) {
if (unit >= m_units) {
Log.report(logvisor::Fatal, fmt("unit {} out of range {}"), unit, m_units);
Log.report(logvisor::Fatal, FMT_STRING("unit {} out of range {}"), unit, m_units);
}
std::vector<ViewChild<View*>>& children = m_children[unit];

View File

@ -8,7 +8,7 @@ static logvisor::Module Log("specter::ViewResources");
void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache, const IThemeData* theme, float pf) {
if (!factory || !fcache || !theme)
Log.report(logvisor::Fatal, fmt("all arguments of ViewResources::init() must be non-null"));
Log.report(logvisor::Fatal, FMT_STRING("all arguments of ViewResources::init() must be non-null"));
m_pixelFactor = pf;
m_factory = factory;
m_theme = theme;

@ -1 +1 @@
Subproject commit ef35789909da139d77a4fd7b6fbbb9eadad10d93
Subproject commit 6c46735ab1ebe7072053c1bd3e6336ff9542ab7b