2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 17:47:42 +00:00

General: Include headers where applicable

Ensures necessary dependencies are always included where applicable, as
well as avoiding including dependencies where they aren't necessary.
This commit is contained in:
Lioncash
2019-08-30 05:55:46 -04:00
parent 50a7f7a860
commit 21dece5b1e
41 changed files with 726 additions and 359 deletions

View File

@@ -1,13 +1,39 @@
#include "specter/Table.hpp"
#include "specter/ViewResources.hpp"
#include "specter/RootView.hpp"
#include "specter/ScrollView.hpp"
#include "specter/TextView.hpp"
#include "specter/ViewResources.hpp"
namespace specter {
static logvisor::Module Log("specter::Table");
#define ROW_HEIGHT 18
#define CELL_MARGIN 1
struct Table::CellView : public View {
Table& m_t;
std::unique_ptr<TextView> m_text;
size_t m_c = SIZE_MAX, m_r = SIZE_MAX;
boo::SWindowRect m_scissorRect;
uint64_t m_textHash = 0;
bool m_selected = false;
CellView(Table& t, ViewResources& res);
void select();
void deselect();
void reset();
bool reset(size_t c);
bool reset(size_t c, size_t r);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override;
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
};
Table::Table(ViewResources& res, View& parentView, ITableDataBinding* data, ITableStateBinding* state,
size_t maxColumns)
: View(res, parentView)
@@ -31,6 +57,8 @@ Table::Table(ViewResources& res, View& parentView, ITableDataBinding* data, ITab
updateData();
}
Table::~Table() = default;
Table::RowsView::RowsView(Table& t, ViewResources& res)
: View(res, t), m_t(t), m_verts(new SolidShaderVert[SPECTER_TABLE_MAX_ROWS * t.m_maxColumns * 6]) {
commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool {
@@ -659,6 +687,8 @@ int Table::RowsView::nominalHeight() const {
return rows * (ROW_HEIGHT + CELL_MARGIN * 2) * pf;
}
int Table::RowsView::nominalWidth() const { return m_t.m_scroll.m_view->nominalWidth(); }
void Table::RowsView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub,
const boo::SWindowRect& scissor) {
View::resized(root, sub);