mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
33
Libraries/LibGUI/GFontDatabase.h
Normal file
33
Libraries/LibGUI/GFontDatabase.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
|
||||
class Font;
|
||||
|
||||
struct Metadata {
|
||||
String path;
|
||||
bool is_fixed_width;
|
||||
int glyph_height;
|
||||
};
|
||||
|
||||
class GFontDatabase {
|
||||
public:
|
||||
static GFontDatabase& the();
|
||||
|
||||
RefPtr<Font> get_by_name(const StringView&);
|
||||
void for_each_font(Function<void(const StringView&)>);
|
||||
void for_each_fixed_width_font(Function<void(const StringView&)>);
|
||||
|
||||
Metadata get_metadata_by_name(const StringView& name) const
|
||||
{
|
||||
return m_name_to_metadata.get(name);
|
||||
};
|
||||
|
||||
private:
|
||||
GFontDatabase();
|
||||
~GFontDatabase();
|
||||
|
||||
HashMap<String, Metadata> m_name_to_metadata;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue