1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibGUI: Put all classes in the GUI namespace and remove the leading G

This took me a moment. Welcome to the new world of GUI::Widget! :^)
This commit is contained in:
Andreas Kling 2020-02-02 15:07:41 +01:00
parent 2d39da5405
commit c5bd9d4ed1
337 changed files with 5400 additions and 4816 deletions

View file

@ -29,18 +29,20 @@
#include <AK/HashTable.h>
#include <LibGUI/GModelIndex.h>
class GAbstractView;
namespace GUI {
class GModelSelection {
class AbstractView;
class ModelSelection {
public:
GModelSelection(GAbstractView& view)
ModelSelection(AbstractView& view)
: m_view(view)
{
}
int size() const { return m_indexes.size(); }
bool is_empty() const { return m_indexes.is_empty(); }
bool contains(const GModelIndex& index) const { return m_indexes.contains(index); }
bool contains(const ModelIndex& index) const { return m_indexes.contains(index); }
bool contains_row(int row) const
{
for (auto& index : m_indexes) {
@ -50,10 +52,10 @@ public:
return false;
}
void set(const GModelIndex&);
void add(const GModelIndex&);
void toggle(const GModelIndex&);
bool remove(const GModelIndex&);
void set(const ModelIndex&);
void add(const ModelIndex&);
void toggle(const ModelIndex&);
bool remove(const ModelIndex&);
void clear();
template<typename Callback>
@ -70,9 +72,9 @@ public:
callback(index);
}
Vector<GModelIndex> indexes() const
Vector<ModelIndex> indexes() const
{
Vector<GModelIndex> selected_indexes;
Vector<ModelIndex> selected_indexes;
for (auto& index : m_indexes)
selected_indexes.append(index);
@ -81,7 +83,7 @@ public:
}
// FIXME: This doesn't guarantee that what you get is the lowest or "first" index selected..
GModelIndex first() const
ModelIndex first() const
{
if (m_indexes.is_empty())
return {};
@ -89,6 +91,8 @@ public:
}
private:
GAbstractView& m_view;
HashTable<GModelIndex> m_indexes;
AbstractView& m_view;
HashTable<ModelIndex> m_indexes;
};
}