mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:57: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
43
Libraries/LibGUI/GIcon.h
Normal file
43
Libraries/LibGUI/GIcon.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <SharedGraphics/GraphicsBitmap.h>
|
||||
|
||||
class GIconImpl : public RefCounted<GIconImpl> {
|
||||
public:
|
||||
static NonnullRefPtr<GIconImpl> create() { return adopt(*new GIconImpl); }
|
||||
~GIconImpl() {}
|
||||
|
||||
const GraphicsBitmap* bitmap_for_size(int) const;
|
||||
void set_bitmap_for_size(int, RefPtr<GraphicsBitmap>&&);
|
||||
|
||||
private:
|
||||
GIconImpl() {}
|
||||
HashMap<int, RefPtr<GraphicsBitmap>> m_bitmaps;
|
||||
};
|
||||
|
||||
class GIcon {
|
||||
public:
|
||||
GIcon();
|
||||
explicit GIcon(RefPtr<GraphicsBitmap>&&);
|
||||
explicit GIcon(RefPtr<GraphicsBitmap>&&, RefPtr<GraphicsBitmap>&&);
|
||||
explicit GIcon(const GIconImpl&);
|
||||
GIcon(const GIcon&);
|
||||
~GIcon() {}
|
||||
|
||||
static GIcon default_icon(const StringView&);
|
||||
|
||||
GIcon& operator=(const GIcon& other)
|
||||
{
|
||||
m_impl = other.m_impl.copy_ref();
|
||||
return *this;
|
||||
}
|
||||
|
||||
const GraphicsBitmap* bitmap_for_size(int size) const { return m_impl->bitmap_for_size(size); }
|
||||
void set_bitmap_for_size(int size, RefPtr<GraphicsBitmap>&& bitmap) { m_impl->set_bitmap_for_size(size, move(bitmap)); }
|
||||
|
||||
const GIconImpl& impl() const { return *m_impl; }
|
||||
|
||||
private:
|
||||
NonnullRefPtr<GIconImpl> m_impl;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue