Merge pull request #2 from lioncash/override

General: Use override where applicable
This commit is contained in:
Phillip Stephens 2019-08-10 19:58:47 -07:00 committed by GitHub
commit 5307ab4107
21 changed files with 306 additions and 303 deletions

View File

@ -42,10 +42,10 @@ private:
void setPressed(); void setPressed();
void setDisabled(); void setDisabled();
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
ButtonTarget(ViewResources& res, Button& button) : View(res, button), m_button(button) {} ButtonTarget(ViewResources& res, Button& button) : View(res, button), m_button(button) {}
}; };
ViewChild<std::unique_ptr<ButtonTarget>> m_buttonTarget; ViewChild<std::unique_ptr<ButtonTarget>> m_buttonTarget;
@ -61,10 +61,10 @@ private:
void setPressed(); void setPressed();
void setDisabled(); void setDisabled();
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
MenuTarget(ViewResources& res, Button& button) : View(res, button), m_button(button) {} MenuTarget(ViewResources& res, Button& button) : View(res, button), m_button(button) {}
}; };
ViewChild<std::unique_ptr<MenuTarget>> m_menuTarget; ViewChild<std::unique_ptr<MenuTarget>> m_menuTarget;
@ -80,33 +80,33 @@ public:
void destroy() {} void destroy() {}
}; };
~Button() { closeMenu({}); } ~Button() override { closeMenu({}); }
Button(ViewResources& res, View& parentView, IButtonBinding* controlBinding, std::string_view text, Button(ViewResources& res, View& parentView, IButtonBinding* controlBinding, std::string_view text,
Icon* icon = nullptr, Style style = Style::Block, const zeus::CColor& bgColor = zeus::skWhite, Icon* icon = nullptr, Style style = Style::Block, const zeus::CColor& bgColor = zeus::skWhite,
RectangleConstraint constraint = RectangleConstraint()); RectangleConstraint constraint = RectangleConstraint());
Button(ViewResources& res, View& parentView, IButtonBinding* controlBinding, std::string_view text, Button(ViewResources& res, View& parentView, IButtonBinding* controlBinding, std::string_view text,
const zeus::CColor& textColor, Icon* icon = nullptr, Style style = Style::Block, const zeus::CColor& textColor, Icon* icon = nullptr, Style style = Style::Block,
const zeus::CColor& bgColor = zeus::skWhite, RectangleConstraint constraint = RectangleConstraint()); const zeus::CColor& bgColor = zeus::skWhite, RectangleConstraint constraint = RectangleConstraint());
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void think(); void think() override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
void setText(std::string_view text, const zeus::CColor& textColor); void setText(std::string_view text, const zeus::CColor& textColor);
void setText(std::string_view text); void setText(std::string_view text);
void setIcon(Icon* icon = nullptr); void setIcon(Icon* icon = nullptr);
std::string_view getText() const { return m_textStr; } std::string_view getText() const { return m_textStr; }
void colorGlyphs(const zeus::CColor& newColor); void colorGlyphs(const zeus::CColor& newColor);
int nominalWidth() const { return m_nomWidth; } int nominalWidth() const override { return m_nomWidth; }
int nominalHeight() const { return m_nomHeight; } int nominalHeight() const override { return m_nomHeight; }
void closeMenu(const boo::SWindowCoord& coord); void closeMenu(const boo::SWindowCoord& coord);
ViewChild<std::unique_ptr<View>>& getMenu() { return m_modalMenu; } ViewChild<std::unique_ptr<View>>& getMenu() { return m_modalMenu; }
void setMultiplyColor(const zeus::CColor& color) { void setMultiplyColor(const zeus::CColor& color) override {
View::setMultiplyColor(color); View::setMultiplyColor(color);
m_viewVertBlock.m_color = color; m_viewVertBlock.m_color = color;
if (m_viewVertBlockBuf) if (m_viewVertBlockBuf)

View File

@ -15,7 +15,7 @@ struct IControlBinding {
}; };
struct IButtonBinding : IControlBinding { struct IButtonBinding : IControlBinding {
ControlType type() const { return ControlType::Button; } ControlType type() const override { return ControlType::Button; }
static IButtonBinding* castTo(IControlBinding* bind) { static IButtonBinding* castTo(IControlBinding* bind) {
return bind->type() == ControlType::Button ? static_cast<IButtonBinding*>(bind) : nullptr; return bind->type() == ControlType::Button ? static_cast<IButtonBinding*>(bind) : nullptr;
} }
@ -45,7 +45,7 @@ struct IButtonBinding : IControlBinding {
}; };
struct IFloatBinding : IControlBinding { struct IFloatBinding : IControlBinding {
ControlType type() const { return ControlType::Float; } ControlType type() const override { return ControlType::Float; }
static IFloatBinding* castTo(IControlBinding* bind) { static IFloatBinding* castTo(IControlBinding* bind) {
return bind->type() == ControlType::Float ? static_cast<IFloatBinding*>(bind) : nullptr; return bind->type() == ControlType::Float ? static_cast<IFloatBinding*>(bind) : nullptr;
} }
@ -55,7 +55,7 @@ struct IFloatBinding : IControlBinding {
}; };
struct IIntBinding : IControlBinding { struct IIntBinding : IControlBinding {
ControlType type() const { return ControlType::Int; } ControlType type() const override { return ControlType::Int; }
static IIntBinding* castTo(IControlBinding* bind) { static IIntBinding* castTo(IControlBinding* bind) {
return bind->type() == ControlType::Int ? static_cast<IIntBinding*>(bind) : nullptr; return bind->type() == ControlType::Int ? static_cast<IIntBinding*>(bind) : nullptr;
} }
@ -65,7 +65,7 @@ struct IIntBinding : IControlBinding {
}; };
struct IStringBinding : IControlBinding { struct IStringBinding : IControlBinding {
ControlType type() const { return ControlType::String; } ControlType type() const override { return ControlType::String; }
static IStringBinding* castTo(IControlBinding* bind) { static IStringBinding* castTo(IControlBinding* bind) {
return bind->type() == ControlType::String ? static_cast<IStringBinding*>(bind) : nullptr; return bind->type() == ControlType::String ? static_cast<IStringBinding*>(bind) : nullptr;
} }
@ -76,12 +76,12 @@ struct IStringBinding : IControlBinding {
struct CVarControlBinding : IControlBinding { struct CVarControlBinding : IControlBinding {
hecl::CVar* m_cvar; hecl::CVar* m_cvar;
CVarControlBinding(hecl::CVar* cvar) : m_cvar(cvar) {} CVarControlBinding(hecl::CVar* cvar) : m_cvar(cvar) {}
ControlType type() const { return ControlType::CVar; } ControlType type() const override { return ControlType::CVar; }
static CVarControlBinding* castTo(IControlBinding* bind) { static CVarControlBinding* castTo(IControlBinding* bind) {
return bind->type() == ControlType::CVar ? static_cast<CVarControlBinding*>(bind) : nullptr; return bind->type() == ControlType::CVar ? static_cast<CVarControlBinding*>(bind) : nullptr;
} }
std::string_view name(const Control* control) const { return m_cvar->name(); } std::string_view name(const Control* control) const override { return m_cvar->name(); }
std::string_view help(const Control* control) const { return m_cvar->rawHelp(); } std::string_view help(const Control* control) const override { return m_cvar->rawHelp(); }
}; };
class Control : public View { class Control : public View {

View File

@ -28,16 +28,16 @@ private:
friend class FileBrowser; friend class FileBrowser;
FileBrowser& m_fb; FileBrowser& m_fb;
LeftSide(FileBrowser& fb, ViewResources& res) : View(res, fb), m_fb(fb) {} LeftSide(FileBrowser& fb, ViewResources& res) : View(res, fb), m_fb(fb) {}
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
} m_left; } m_left;
class RightSide : public View { class RightSide : public View {
friend class FileBrowser; friend class FileBrowser;
FileBrowser& m_fb; FileBrowser& m_fb;
RightSide(FileBrowser& fb, ViewResources& res) : View(res, fb), m_fb(fb) {} RightSide(FileBrowser& fb, ViewResources& res) : View(res, fb), m_fb(fb) {}
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
} m_right; } m_right;
ViewChild<std::unique_ptr<SplitView>> m_split; ViewChild<std::unique_ptr<SplitView>> m_split;
@ -52,8 +52,8 @@ private:
new Button(res, fb, this, text, nullptr, Button::Style::Block, zeus::skWhite, new Button(res, fb, this, text, nullptr, Button::Style::Block, zeus::skWhite,
RectangleConstraint(100 * res.pixelFactor(), -1, RectangleConstraint::Test::Minimum))); RectangleConstraint(100 * res.pixelFactor(), -1, RectangleConstraint::Test::Minimum)));
} }
std::string_view name(const Control* control) const { return m_text; } std::string_view name(const Control* control) const override { return m_text; }
void activated(const Button* button, const boo::SWindowCoord&) { m_fb.okActivated(true); } void activated(const Button* button, const boo::SWindowCoord&) override { m_fb.okActivated(true); }
} m_ok; } m_ok;
void cancelActivated(); void cancelActivated();
@ -66,11 +66,11 @@ private:
res, fb, this, text, nullptr, Button::Style::Block, zeus::skWhite, res, fb, this, text, nullptr, Button::Style::Block, zeus::skWhite,
RectangleConstraint(m_fb.m_ok.m_button.m_view->nominalWidth(), -1, RectangleConstraint::Test::Minimum))); RectangleConstraint(m_fb.m_ok.m_button.m_view->nominalWidth(), -1, RectangleConstraint::Test::Minimum)));
} }
std::string_view name(const Control* control) const { return m_text; } std::string_view name(const Control* control) const override { return m_text; }
void activated(const Button* button, const boo::SWindowCoord&) { m_fb.cancelActivated(); } void activated(const Button* button, const boo::SWindowCoord&) override { m_fb.cancelActivated(); }
} m_cancel; } m_cancel;
void pathButtonActivated(size_t idx); void pathButtonActivated(size_t idx) override;
ViewChild<std::unique_ptr<PathButtons>> m_pathButtons; ViewChild<std::unique_ptr<PathButtons>> m_pathButtons;
ViewChild<std::unique_ptr<TextField>> m_fileField; ViewChild<std::unique_ptr<TextField>> m_fileField;
@ -79,8 +79,8 @@ private:
std::string m_name; std::string m_name;
FileFieldBind(FileBrowser& browser, const IViewManager& vm) FileFieldBind(FileBrowser& browser, const IViewManager& vm)
: m_browser(browser), m_name(vm.translate<locale::file_name>()) {} : m_browser(browser), m_name(vm.translate<locale::file_name>()) {}
std::string_view name(const Control* control) const { return m_name; } std::string_view name(const Control* control) const override { return m_name; }
void changed(const Control* control, std::string_view val) {} void changed(const Control* control, std::string_view val) override {}
} m_fileFieldBind; } m_fileFieldBind;
std::unique_ptr<MessageWindow> m_confirmWindow; std::unique_ptr<MessageWindow> m_confirmWindow;
@ -104,10 +104,10 @@ private:
std::string m_projStr; std::string m_projStr;
std::string m_fileStr; std::string m_fileStr;
size_t columnCount() const { return 3; } size_t columnCount() const override { return 3; }
size_t rowCount() const { return m_entries.size(); } size_t rowCount() const override { return m_entries.size(); }
std::string_view header(size_t cIdx) const { std::string_view header(size_t cIdx) const override {
switch (cIdx) { switch (cIdx) {
case 0: case 0:
return m_nameCol; return m_nameCol;
@ -121,7 +121,7 @@ private:
return {}; return {};
} }
std::string_view cell(size_t cIdx, size_t rIdx) const { std::string_view cell(size_t cIdx, size_t rIdx) const override {
switch (cIdx) { switch (cIdx) {
case 0: case 0:
return m_entries.at(rIdx).m_name; return m_entries.at(rIdx).m_name;
@ -137,11 +137,11 @@ private:
float m_columnSplits[3] = {0.0f, 0.7f, 0.9f}; float m_columnSplits[3] = {0.0f, 0.7f, 0.9f};
bool columnSplitResizeAllowed() const { return true; } bool columnSplitResizeAllowed() const override { return true; }
float getColumnSplit(size_t cIdx) const { return m_columnSplits[cIdx]; } float getColumnSplit(size_t cIdx) const override { return m_columnSplits[cIdx]; }
void setColumnSplit(size_t cIdx, float split) { m_columnSplits[cIdx] = split; } void setColumnSplit(size_t cIdx, float split) override { m_columnSplits[cIdx] = split; }
void updateListing(const hecl::DirectoryEnumerator& dEnum) { void updateListing(const hecl::DirectoryEnumerator& dEnum) {
m_entries.clear(); m_entries.clear();
@ -172,12 +172,12 @@ private:
SortDirection m_sortDir = SortDirection::Ascending; SortDirection m_sortDir = SortDirection::Ascending;
bool m_needsUpdate = false; bool m_needsUpdate = false;
SortDirection getSort(size_t& cIdx) const { SortDirection getSort(size_t& cIdx) const override {
cIdx = m_sizeSort ? 2 : 0; cIdx = m_sizeSort ? 2 : 0;
return m_sortDir; return m_sortDir;
} }
void setSort(size_t cIdx, SortDirection dir) { void setSort(size_t cIdx, SortDirection dir) override {
if (cIdx == 1) if (cIdx == 1)
return; return;
m_sizeSort = cIdx == 2; m_sizeSort = cIdx == 2;
@ -185,7 +185,7 @@ private:
m_needsUpdate = true; m_needsUpdate = true;
} }
void setSelectedRow(size_t rIdx) { void setSelectedRow(size_t rIdx) override {
if (rIdx != SIZE_MAX) if (rIdx != SIZE_MAX)
m_fb.m_fileField.m_view->setText(m_entries.at(rIdx).m_name); m_fb.m_fileField.m_view->setText(m_entries.at(rIdx).m_name);
else else
@ -193,7 +193,7 @@ private:
m_fb.m_fileField.m_view->clearErrorState(); m_fb.m_fileField.m_view->clearErrorState();
} }
void rowActivated(size_t rIdx) { m_fb.okActivated(false); } void rowActivated(size_t rIdx) override { m_fb.okActivated(false); }
FileListingDataBind(FileBrowser& fb, const IViewManager& vm) : m_fb(fb) { FileListingDataBind(FileBrowser& fb, const IViewManager& vm) : m_fb(fb) {
m_nameCol = vm.translate<locale::name>(); m_nameCol = vm.translate<locale::name>();
@ -233,17 +233,17 @@ private:
}; };
std::vector<Entry> m_entries; std::vector<Entry> m_entries;
size_t columnCount() const { return 1; } size_t columnCount() const override { return 1; }
size_t rowCount() const { return m_entries.size(); } size_t rowCount() const override { return m_entries.size(); }
std::string_view cell(size_t, size_t rIdx) const { return m_entries.at(rIdx).m_name; } std::string_view cell(size_t, size_t rIdx) const override { return m_entries.at(rIdx).m_name; }
void setSelectedRow(size_t rIdx) { void setSelectedRow(size_t rIdx) override {
if (rIdx != SIZE_MAX) if (rIdx != SIZE_MAX)
m_fb.navigateToPath(m_entries.at(rIdx).m_path); m_fb.navigateToPath(m_entries.at(rIdx).m_path);
} }
void rowActivated(size_t rIdx) { m_fb.okActivated(true); } void rowActivated(size_t rIdx) override { m_fb.okActivated(true); }
}; };
BookmarkDataBind m_systemBookmarkBind; BookmarkDataBind m_systemBookmarkBind;
@ -276,22 +276,22 @@ public:
m_showingHidden = showingHidden; m_showingHidden = showingHidden;
navigateToPath(m_path); navigateToPath(m_path);
} }
void updateContentOpacity(float opacity); void updateContentOpacity(float opacity) override;
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&); void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override;
void touchDown(const boo::STouchCoord&, uintptr_t); void touchDown(const boo::STouchCoord&, uintptr_t) override;
void touchUp(const boo::STouchCoord&, uintptr_t); void touchUp(const boo::STouchCoord&, uintptr_t) override;
void touchMove(const boo::STouchCoord&, uintptr_t); void touchMove(const boo::STouchCoord&, uintptr_t) override;
void charKeyDown(unsigned long, boo::EModifierKey, bool); void charKeyDown(unsigned long, boo::EModifierKey, bool) override;
void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool); void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void think(); void think() override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -57,8 +57,8 @@ class IconView : public View {
public: public:
IconView(ViewResources& res, View& parentView, Icon& icon); IconView(ViewResources& res, View& parentView, Icon& icon);
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -34,16 +34,16 @@ class Menu : public View {
setHighlightedItem(-1); setHighlightedItem(-1);
} }
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
int nominalWidth() const { return m_menu.m_cWidth; } int nominalWidth() const override { return m_menu.m_cWidth; }
int nominalHeight() const { return m_menu.m_cHeight; } int nominalHeight() const override { return m_menu.m_cHeight; }
}; };
std::unique_ptr<ContentView> m_content; std::unique_ptr<ContentView> m_content;
ViewChild<std::unique_ptr<ScrollView>> m_scroll; ViewChild<std::unique_ptr<ScrollView>> m_scroll;
@ -55,13 +55,13 @@ class Menu : public View {
IMenuNode* m_node; IMenuNode* m_node;
ItemView(ViewResources& res, Menu& menu, std::string_view text, size_t idx, IMenuNode* node); ItemView(ViewResources& res, Menu& menu, std::string_view text, size_t idx, IMenuNode* node);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
std::vector<ViewChild<std::unique_ptr<ItemView>>> m_items; std::vector<ViewChild<std::unique_ptr<ItemView>>> m_items;
IMenuNode* m_deferredActivation = nullptr; IMenuNode* m_deferredActivation = nullptr;
@ -72,15 +72,15 @@ public:
Menu(ViewResources& res, View& parentView, IMenuNode* rootNode); Menu(ViewResources& res, View& parentView, IMenuNode* rootNode);
void reset(IMenuNode* rootNode); void reset(IMenuNode* rootNode);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&); void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override;
void think(); void think() override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -20,8 +20,8 @@ private:
MessageWindow& m_mw; MessageWindow& m_mw;
std::string m_name; std::string m_name;
OKBinding(MessageWindow& mw, std::string_view name) : m_mw(mw), m_name(name) {} OKBinding(MessageWindow& mw, std::string_view name) : m_mw(mw), m_name(name) {}
std::string_view name(const Control* control) const { return m_name; } std::string_view name(const Control* control) const override { return m_name; }
void activated(const Button* button, const boo::SWindowCoord& coord) { m_mw.m_func(true); } void activated(const Button* button, const boo::SWindowCoord& coord) override { m_mw.m_func(true); }
} m_okBind; } m_okBind;
ViewChild<std::unique_ptr<Button>> m_ok; ViewChild<std::unique_ptr<Button>> m_ok;
@ -29,8 +29,8 @@ private:
MessageWindow& m_mw; MessageWindow& m_mw;
std::string m_name; std::string m_name;
CancelBinding(MessageWindow& mw, std::string_view name) : m_mw(mw), m_name(name) {} CancelBinding(MessageWindow& mw, std::string_view name) : m_mw(mw), m_name(name) {}
std::string_view name(const Control* control) const { return m_name; } std::string_view name(const Control* control) const override { return m_name; }
void activated(const Button* button, const boo::SWindowCoord& coord) { m_mw.m_func(false); } void activated(const Button* button, const boo::SWindowCoord& coord) override { m_mw.m_func(false); }
} m_cancelBind; } m_cancelBind;
ViewChild<std::unique_ptr<Button>> m_cancel; ViewChild<std::unique_ptr<Button>> m_cancel;
@ -38,7 +38,7 @@ public:
MessageWindow(ViewResources& res, View& parentView, Type type, std::string_view message, MessageWindow(ViewResources& res, View& parentView, Type type, std::string_view message,
std::function<void(bool ok)> func); std::function<void(bool ok)> func);
void updateContentOpacity(float opacity) { void updateContentOpacity(float opacity) override {
zeus::CColor color = zeus::CColor::lerp({1, 1, 1, 0}, {1, 1, 1, 1}, opacity); zeus::CColor color = zeus::CColor::lerp({1, 1, 1, 0}, {1, 1, 1, 1}, opacity);
ModalWindow::setMultiplyColor(color); ModalWindow::setMultiplyColor(color);
m_text->setMultiplyColor(color); m_text->setMultiplyColor(color);
@ -46,14 +46,14 @@ public:
m_cancel.m_view->setMultiplyColor(color); m_cancel.m_view->setMultiplyColor(color);
} }
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -55,14 +55,14 @@ protected:
public: public:
ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint, const zeus::CColor& bgColor); ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint, const zeus::CColor& bgColor);
ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint); ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint);
void think(); void think() override;
bool skipBuildInAnimation(); bool skipBuildInAnimation();
void close(bool skipAnimation = false); void close(bool skipAnimation = false);
bool closed() const { return m_phase >= Phase::BuildOut; } bool closed() const { return m_phase >= Phase::BuildOut; }
ModalWindow::Phase phase() const { return m_phase; } ModalWindow::Phase phase() const { return m_phase; }
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -31,16 +31,16 @@ public:
void colorGlyphs(const zeus::CColor& newColor); void colorGlyphs(const zeus::CColor& newColor);
void setMultiplyColor(const zeus::CColor& color) { void setMultiplyColor(const zeus::CColor& color) override {
for (std::unique_ptr<TextView>& l : m_lines) for (std::unique_ptr<TextView>& l : m_lines)
l->setMultiplyColor(color); l->setMultiplyColor(color);
} }
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
int nominalWidth() const { return m_width; } int nominalWidth() const override { return m_width; }
int nominalHeight() const { return (int(m_lineHeight * m_fontAtlas.FT_LineHeight()) >> 6) * m_lines.size(); } int nominalHeight() const override { return (int(m_lineHeight * m_fontAtlas.FT_LineHeight()) >> 6) * m_lines.size(); }
}; };
} // namespace specter } // namespace specter

View File

@ -34,16 +34,16 @@ public:
}; };
NumericField(ViewResources& res, View& parentView, std::string_view text); NumericField(ViewResources& res, View& parentView, std::string_view text);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
void setText(std::string_view text); void setText(std::string_view text);
int nominalWidth() const { return m_nomWidth; } int nominalWidth() const override { return m_nomWidth; }
int nominalHeight() const { return m_nomHeight; } int nominalHeight() const override { return m_nomHeight; }
}; };
} // namespace specter } // namespace specter

View File

@ -24,13 +24,13 @@ class Outliner {
}; };
Node(ViewResources& res, View& parentView, std::string_view description); Node(ViewResources& res, View& parentView, std::string_view description);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
void think(); void think() override;
}; };
}; };
} // namespace specter } // namespace specter

View File

@ -14,23 +14,23 @@ class PathButtons : public ScrollView {
PathButtons& m_pb; PathButtons& m_pb;
boo::SWindowRect m_scissorRect; boo::SWindowRect m_scissorRect;
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
int nominalWidth() const { int nominalWidth() const override {
int ret = 0; int ret = 0;
for (PathButton& b : m_pb.m_pathButtons) for (PathButton& b : m_pb.m_pathButtons)
ret += b.m_button.m_view->nominalWidth() + 2; ret += b.m_button.m_view->nominalWidth() + 2;
return ret; return ret;
} }
int nominalHeight() const { int nominalHeight() const override {
return m_pb.m_pathButtons.size() ? m_pb.m_pathButtons[0].m_button.m_view->nominalHeight() : 0; return m_pb.m_pathButtons.size() ? m_pb.m_pathButtons[0].m_button.m_view->nominalHeight() : 0;
} }
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
ContentView(ViewResources& res, PathButtons& pb) : View(res, pb), m_pb(pb) {} ContentView(ViewResources& res, PathButtons& pb) : View(res, pb), m_pb(pb) {}
}; };
@ -46,8 +46,8 @@ class PathButtons : public ScrollView {
PathButton(PathButtons& pb, ViewResources& res, size_t idx, const hecl::SystemString& str) : m_pb(pb), m_idx(idx) { PathButton(PathButtons& pb, ViewResources& res, size_t idx, const hecl::SystemString& str) : m_pb(pb), m_idx(idx) {
m_button.m_view.reset(new Button(res, pb, this, hecl::SystemUTF8Conv(str).str())); m_button.m_view.reset(new Button(res, pb, this, hecl::SystemUTF8Conv(str).str()));
} }
std::string_view name(const Control* control) const { return m_button.m_view->getText(); } std::string_view name(const Control* control) const override { return m_button.m_view->getText(); }
void activated(const Button* button, const boo::SWindowCoord&) { m_pb.m_pathButtonPending = m_idx; } void activated(const Button* button, const boo::SWindowCoord&) override { m_pb.m_pathButtonPending = m_idx; }
}; };
friend struct PathButton; friend struct PathButton;
std::vector<PathButton> m_pathButtons; std::vector<PathButton> m_pathButtons;
@ -56,10 +56,10 @@ public:
PathButtons(ViewResources& res, View& parentView, IPathButtonsBinding& binding, bool fillContainer = false); PathButtons(ViewResources& res, View& parentView, IPathButtonsBinding& binding, bool fillContainer = false);
void setButtons(const std::vector<hecl::SystemString>& comps); void setButtons(const std::vector<hecl::SystemString>& comps);
void setMultiplyColor(const zeus::CColor& color); void setMultiplyColor(const zeus::CColor& color) override;
/* Fill all available space in container when requested */ /* Fill all available space in container when requested */
void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
}; };
} // namespace specter } // namespace specter

View File

@ -65,9 +65,9 @@ class RootView : public View {
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ);
SplitMenuSystem(RootView& rv, boo::IGraphicsDataFactory::Context& ctx); SplitMenuSystem(RootView& rv, boo::IGraphicsDataFactory::Context& ctx);
const std::string* text() const { return &m_text; } const std::string* text() const override { return &m_text; }
size_t subNodeCount() const { return 2; } size_t subNodeCount() const override { return 2; }
IMenuNode* subNode(size_t idx) { IMenuNode* subNode(size_t idx) override {
if (idx) if (idx)
return &m_joinActionNode; return &m_joinActionNode;
else else
@ -82,8 +82,8 @@ class RootView : public View {
SplitMenuSystem& m_smn; SplitMenuSystem& m_smn;
std::string m_text; std::string m_text;
SplitActionNode(SplitMenuSystem& smn); SplitActionNode(SplitMenuSystem& smn);
const std::string* text() const { return &m_text; } const std::string* text() const override { return &m_text; }
void activated(const boo::SWindowCoord& coord) { void activated(const boo::SWindowCoord& coord) override {
m_smn.m_deferredSplit = true; m_smn.m_deferredSplit = true;
m_smn.m_deferredCoord = coord; m_smn.m_deferredCoord = coord;
} }
@ -92,8 +92,8 @@ class RootView : public View {
SplitMenuSystem& m_smn; SplitMenuSystem& m_smn;
std::string m_text; std::string m_text;
JoinActionNode(SplitMenuSystem& smn); JoinActionNode(SplitMenuSystem& smn);
const std::string* text() const { return &m_text; } const std::string* text() const override { return &m_text; }
void activated(const boo::SWindowCoord& coord) { void activated(const boo::SWindowCoord& coord) override {
m_smn.m_deferredJoin = true; m_smn.m_deferredJoin = true;
m_smn.m_deferredCoord = coord; m_smn.m_deferredCoord = coord;
} }
@ -103,7 +103,7 @@ class RootView : public View {
public: public:
RootView(IViewManager& viewMan, ViewResources& res, boo::IWindow* window); RootView(IViewManager& viewMan, ViewResources& res, boo::IWindow* window);
~RootView(); ~RootView() override;
void destroyed(); void destroyed();
bool isDestroyed() const { return m_destroyed; } bool isDestroyed() const { return m_destroyed; }
@ -112,29 +112,29 @@ public:
#pragma GCC diagnostic ignored "-Woverloaded-virtual" #pragma GCC diagnostic ignored "-Woverloaded-virtual"
void resized(const boo::SWindowRect& rect, bool) { resized(rect, rect); } void resized(const boo::SWindowRect& rect, bool) { resized(rect, rect); }
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods); void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) override;
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods); void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) override;
void mouseMove(const boo::SWindowCoord& coord); void mouseMove(const boo::SWindowCoord& coord) override;
void mouseEnter(const boo::SWindowCoord& coord); void mouseEnter(const boo::SWindowCoord& coord) override;
void mouseLeave(const boo::SWindowCoord& coord); void mouseLeave(const boo::SWindowCoord& coord) override;
void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll); void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll) override;
void touchDown(const boo::STouchCoord& coord, uintptr_t tid); void touchDown(const boo::STouchCoord& coord, uintptr_t tid) override;
void touchUp(const boo::STouchCoord& coord, uintptr_t tid); void touchUp(const boo::STouchCoord& coord, uintptr_t tid) override;
void touchMove(const boo::STouchCoord& coord, uintptr_t tid); void touchMove(const boo::STouchCoord& coord, uintptr_t tid) override;
void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat); void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat) override;
void charKeyUp(unsigned long charCode, boo::EModifierKey mods); void charKeyUp(unsigned long charCode, boo::EModifierKey mods) override;
void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat); void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat) override;
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods); void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods) override;
void modKeyDown(boo::EModifierKey mod, bool isRepeat); void modKeyDown(boo::EModifierKey mod, bool isRepeat) override;
void modKeyUp(boo::EModifierKey mod); void modKeyUp(boo::EModifierKey mod) override;
boo::ITextInputCallback* getTextInputCallback() { return m_activeTextView; } boo::ITextInputCallback* getTextInputCallback() { return m_activeTextView; }
void internalThink(); void internalThink();
void dispatchEvents() { m_events.dispatchEvents(); } void dispatchEvents() { m_events.dispatchEvents(); }
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
const boo::SWindowRect& rootRect() const { return m_rootRect; } const boo::SWindowRect& rootRect() const { return m_rootRect; }
boo::IWindow* window() const { return m_window; } boo::IWindow* window() const { return m_window; }

View File

@ -34,17 +34,19 @@ private:
: m_sv(sv) : m_sv(sv)
, m_leftName(vm.translate<locale::scroll_left>()) , m_leftName(vm.translate<locale::scroll_left>())
, m_rightName(vm.translate<locale::scroll_right>()) {} , m_rightName(vm.translate<locale::scroll_right>()) {}
std::string_view name(const Control* control) const { std::string_view name(const Control* control) const override {
return (control == reinterpret_cast<Control*>(m_sv.m_sideButtons[0].m_view.get())) ? m_leftName.c_str() return (control == reinterpret_cast<Control*>(m_sv.m_sideButtons[0].m_view.get())) ? m_leftName.c_str()
: m_rightName.c_str(); : m_rightName.c_str();
} }
void down(const Button* button, const boo::SWindowCoord& coord) { void down(const Button* button, const boo::SWindowCoord& coord) override {
if (button == m_sv.m_sideButtons[0].m_view.get()) if (button == m_sv.m_sideButtons[0].m_view.get())
m_sv.m_sideButtonState = SideButtonState::ScrollRight; m_sv.m_sideButtonState = SideButtonState::ScrollRight;
else else
m_sv.m_sideButtonState = SideButtonState::ScrollLeft; m_sv.m_sideButtonState = SideButtonState::ScrollLeft;
} }
void up(const Button* button, const boo::SWindowCoord& coord) { m_sv.m_sideButtonState = SideButtonState::None; } void up(const Button* button, const boo::SWindowCoord& coord) override {
m_sv.m_sideButtonState = SideButtonState::None;
}
} m_sideButtonBind; } m_sideButtonBind;
ViewChild<std::unique_ptr<Button>> m_sideButtons[2]; ViewChild<std::unique_ptr<Button>> m_sideButtons[2];
@ -58,23 +60,23 @@ public:
updateSize(); updateSize();
} }
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll); void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll) override;
int getScrollX() const { return m_scroll[0]; } int getScrollX() const { return m_scroll[0]; }
int getScrollY() const { return m_scroll[1]; } int getScrollY() const { return m_scroll[1]; }
int nominalWidth() const { return subRect().size[0]; } int nominalWidth() const override { return subRect().size[0]; }
int nominalHeight() const { return subRect().size[1]; } int nominalHeight() const override { return subRect().size[1]; }
void setMultiplyColor(const zeus::CColor& color); void setMultiplyColor(const zeus::CColor& color) override;
void think(); void think() override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -34,13 +34,13 @@ class Space : public View {
VertexBufferBindingSolid m_vertexBinding; VertexBufferBindingSolid m_vertexBinding;
bool m_flip; bool m_flip;
CornerView(ViewResources& res, Space& space, const zeus::CColor& triColor); CornerView(ViewResources& res, Space& space, const zeus::CColor& triColor);
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
using View::resized; using View::resized;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, bool flip); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, bool flip);
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
friend struct CornerView; friend struct CornerView;
ViewChild<std::unique_ptr<CornerView>> m_cornerView; ViewChild<std::unique_ptr<CornerView>> m_cornerView;
@ -50,17 +50,17 @@ public:
unsigned tbUnits); unsigned tbUnits);
View* setContentView(View* view); View* setContentView(View* view);
Toolbar* toolbar() { return m_toolbar.m_view.get(); } Toolbar* toolbar() { return m_toolbar.m_view.get(); }
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
SplitView* findSplitViewOnSide(SplitView::Axis axis, int side); SplitView* findSplitViewOnSide(SplitView::Axis axis, int side);
void setMultiplyColor(const zeus::CColor& color) { void setMultiplyColor(const zeus::CColor& color) override {
View::setMultiplyColor(color); View::setMultiplyColor(color);
if (m_contentView.m_view) if (m_contentView.m_view)
m_contentView.m_view->setMultiplyColor(color); m_contentView.m_view->setMultiplyColor(color);
@ -68,7 +68,7 @@ public:
m_toolbar.m_view->setMultiplyColor(color); m_toolbar.m_view->setMultiplyColor(color);
} }
bool isSpace() const { return true; } bool isSpace() const override { return true; }
}; };
inline Space* View::castToSpace() { return isSpace() ? static_cast<Space*>(this) : nullptr; } inline Space* View::castToSpace() { return isSpace() ? static_cast<Space*>(this) : nullptr; }

View File

@ -79,15 +79,15 @@ public:
void startDragSplit(const boo::SWindowCoord& coord); void startDragSplit(const boo::SWindowCoord& coord);
void endDragSplit(); void endDragSplit();
void moveDragSplit(const boo::SWindowCoord& coord); void moveDragSplit(const boo::SWindowCoord& coord);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
void setMultiplyColor(const zeus::CColor& color) { void setMultiplyColor(const zeus::CColor& color) override {
View::setMultiplyColor(color); View::setMultiplyColor(color);
m_splitBlock.m_color = color; m_splitBlock.m_color = color;
m_splitBlockBuf.access().finalAssign(m_splitBlock); m_splitBlockBuf.access().finalAssign(m_splitBlock);
@ -98,7 +98,7 @@ public:
m_views[1].m_view->setMultiplyColor(color); m_views[1].m_view->setMultiplyColor(color);
} }
bool isSplitView() const { return true; } bool isSplitView() const override { return true; }
}; };
inline SplitView* View::castToSplitView() { return isSplitView() ? static_cast<SplitView*>(this) : nullptr; } inline SplitView* View::castToSplitView() { return isSplitView() ? static_cast<SplitView*>(this) : nullptr; }

View File

@ -56,12 +56,12 @@ class Table : public View {
bool reset(size_t c); bool reset(size_t c);
bool reset(size_t c, size_t r); bool reset(size_t c, size_t r);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
std::vector<ViewChild<std::unique_ptr<CellView>>> m_headerViews; std::vector<ViewChild<std::unique_ptr<CellView>>> m_headerViews;
using ColumnPool = std::array<std::array<ViewChild<std::unique_ptr<CellView>>, SPECTER_TABLE_MAX_ROWS>, 2>; using ColumnPool = std::array<std::array<ViewChild<std::unique_ptr<CellView>>, SPECTER_TABLE_MAX_ROWS>, 2>;
@ -93,14 +93,14 @@ class Table : public View {
void _setRowVerts(const boo::SWindowRect& rowsRect, const boo::SWindowRect& scissor); void _setRowVerts(const boo::SWindowRect& rowsRect, const boo::SWindowRect& scissor);
RowsView(Table& t, ViewResources& res); RowsView(Table& t, ViewResources& res);
int nominalHeight() const; int nominalHeight() const override;
int nominalWidth() const { return m_t.m_scroll.m_view->nominalWidth(); } int nominalWidth() const override { return m_t.m_scroll.m_view->nominalWidth(); }
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
} m_rowsView; } m_rowsView;
bool m_headerNeedsUpdate = false; bool m_headerNeedsUpdate = false;
@ -114,19 +114,19 @@ public:
void cycleSortColumn(size_t c); void cycleSortColumn(size_t c);
void selectRow(size_t r); void selectRow(size_t r);
void setMultiplyColor(const zeus::CColor& color); void setMultiplyColor(const zeus::CColor& color) override;
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&); void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override;
void think(); void think() override;
void updateData(); void updateData();
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
}; };
} // namespace specter } // namespace specter

View File

@ -64,37 +64,38 @@ public:
std::string_view getText() const { return m_textStr; } std::string_view getText() const { return m_textStr; }
void setText(std::string_view str); void setText(std::string_view str);
void clipboardCopy(); void clipboardCopy() override;
void clipboardCut(); void clipboardCut() override;
void clipboardPaste(); void clipboardPaste() override;
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord&); void mouseLeave(const boo::SWindowCoord&) override;
void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool); void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool) override;
bool hasMarkedText() const; bool hasMarkedText() const override;
std::pair<int, int> markedRange() const; std::pair<int, int> markedRange() const override;
std::pair<int, int> selectedRange() const; std::pair<int, int> selectedRange() const override;
void setMarkedText(std::string_view str, const std::pair<int, int>& selectedRange, void setMarkedText(std::string_view str, const std::pair<int, int>& selectedRange,
const std::pair<int, int>& replacementRange); const std::pair<int, int>& replacementRange) override;
void unmarkText(); void unmarkText() override;
std::string substringForRange(const std::pair<int, int>& range, std::pair<int, int>& actualRange) const; std::string substringForRange(const std::pair<int, int>& range, std::pair<int, int>& actualRange) const override;
void insertText(std::string_view str, const std::pair<int, int>& range); void insertText(std::string_view str, const std::pair<int, int>& range) override;
int characterIndexAtPoint(const boo::SWindowCoord& point) const; int characterIndexAtPoint(const boo::SWindowCoord& point) const override;
boo::SWindowRect rectForCharacterRange(const std::pair<int, int>& range, std::pair<int, int>& actualRange) const; boo::SWindowRect rectForCharacterRange(const std::pair<int, int>& range,
std::pair<int, int>& actualRange) const override;
void think(); void think() override;
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
int nominalWidth() const { return m_nomWidth; } int nominalWidth() const override { return m_nomWidth; }
int nominalHeight() const { return m_nomHeight; } int nominalHeight() const override { return m_nomHeight; }
void setActive(bool active); void setActive(bool active) override;
void setCursorPos(size_t pos); void setCursorPos(size_t pos);
void setErrorState(std::string_view message); void setErrorState(std::string_view message);
void clearErrorState(); void clearErrorState();
@ -102,7 +103,7 @@ public:
void setSelectionRange(size_t start, size_t count); void setSelectionRange(size_t start, size_t count);
void clearSelectionRange(); void clearSelectionRange();
void setMultiplyColor(const zeus::CColor& color) { void setMultiplyColor(const zeus::CColor& color) override {
View::setMultiplyColor(color); View::setMultiplyColor(color);
m_viewVertBlock.m_color = color; m_viewVertBlock.m_color = color;
if (m_viewVertBlockBuf) if (m_viewVertBlockBuf)

View File

@ -95,13 +95,13 @@ public:
void colorGlyphs(const zeus::CColor& newColor); void colorGlyphs(const zeus::CColor& newColor);
void colorGlyphsTypeOn(const zeus::CColor& newColor, float startInterval = 0.2, float fadeTime = 0.5); void colorGlyphsTypeOn(const zeus::CColor& newColor, float startInterval = 0.2, float fadeTime = 0.5);
void think(); void think() override;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
int nominalWidth() const { return m_width; } int nominalWidth() const override { return m_width; }
int nominalHeight() const { return m_fontAtlas.FT_LineHeight() >> 6; } int nominalHeight() const override { return m_fontAtlas.FT_LineHeight() >> 6; }
std::pair<int, int> queryGlyphDimensions(size_t pos) const; std::pair<int, int> queryGlyphDimensions(size_t pos) const;
size_t reverseSelectGlyph(int x) const; size_t reverseSelectGlyph(int x) const;

View File

@ -35,15 +35,15 @@ private:
public: public:
Toolbar(ViewResources& res, View& parentView, Position toolbarPos, unsigned units); Toolbar(ViewResources& res, View& parentView, Position toolbarPos, unsigned units);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
void mouseMove(const boo::SWindowCoord&); void mouseMove(const boo::SWindowCoord&) override;
void mouseEnter(const boo::SWindowCoord&); void mouseEnter(const boo::SWindowCoord&) override;
void mouseLeave(const boo::SWindowCoord& coord); void mouseLeave(const boo::SWindowCoord& coord) override;
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
int nominalHeight() const { return m_nomGauge; } int nominalHeight() const override { return m_nomGauge; }
void clear() { void clear() {
for (std::vector<ViewChild<View*>>& u : m_children) for (std::vector<ViewChild<View*>>& u : m_children)
@ -51,7 +51,7 @@ public:
} }
void push_back(View* v, unsigned unit); void push_back(View* v, unsigned unit);
void setMultiplyColor(const zeus::CColor& color) { void setMultiplyColor(const zeus::CColor& color) override {
View::setMultiplyColor(color); View::setMultiplyColor(color);
for (std::vector<ViewChild<View*>>& u : m_children) for (std::vector<ViewChild<View*>>& u : m_children)
for (ViewChild<View*>& c : u) for (ViewChild<View*>& c : u)

View File

@ -26,11 +26,11 @@ class Tooltip : public View {
public: public:
Tooltip(ViewResources& res, View& parentView, std::string_view title, std::string_view message); Tooltip(ViewResources& res, View& parentView, std::string_view title, std::string_view message);
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ) override;
int nominalWidth() const { return m_nomWidth; } int nominalWidth() const override { return m_nomWidth; }
int nominalHeight() const { return m_nomHeight; } int nominalHeight() const override { return m_nomHeight; }
}; };
} // namespace specter } // namespace specter

View File

@ -99,48 +99,48 @@ class DefaultThemeData : public IThemeData {
zeus::CColor m_spaceTriangleShading2 = {0.5725, 0.5725, 0.5725, 1.0}; zeus::CColor m_spaceTriangleShading2 = {0.5725, 0.5725, 0.5725, 1.0};
public: public:
virtual const zeus::CColor& uiText() const { return m_uiText; } const zeus::CColor& uiText() const override { return m_uiText; }
virtual const zeus::CColor& uiAltText() const { return m_uiAltText; } const zeus::CColor& uiAltText() const override { return m_uiAltText; }
virtual const zeus::CColor& fieldText() const { return m_fieldText; } const zeus::CColor& fieldText() const override { return m_fieldText; }
virtual const zeus::CColor& fieldMarkedText() const { return m_fieldMarkedText; } const zeus::CColor& fieldMarkedText() const override { return m_fieldMarkedText; }
virtual const zeus::CColor& selectedFieldText() const { return m_selectedFieldText; } const zeus::CColor& selectedFieldText() const override { return m_selectedFieldText; }
virtual const zeus::CColor& viewportBackground() const { return m_vpBg; } const zeus::CColor& viewportBackground() const override { return m_vpBg; }
virtual const zeus::CColor& toolbarBackground() const { return m_tbBg; } const zeus::CColor& toolbarBackground() const override { return m_tbBg; }
virtual const zeus::CColor& tooltipBackground() const { return m_tooltipBg; } const zeus::CColor& tooltipBackground() const override { return m_tooltipBg; }
virtual const zeus::CColor& spaceBackground() const { return m_spaceBg; } const zeus::CColor& spaceBackground() const override { return m_spaceBg; }
virtual const zeus::CColor& splashBackground() const { return m_splashBg; } const zeus::CColor& splashBackground() const override { return m_splashBg; }
virtual const zeus::CColor& splashErrorBackground() const { return m_splashErrorBg; } const zeus::CColor& splashErrorBackground() const override { return m_splashErrorBg; }
virtual const zeus::CColor& splash1() const { return m_splash1; } const zeus::CColor& splash1() const override { return m_splash1; }
virtual const zeus::CColor& splash2() const { return m_splash2; } const zeus::CColor& splash2() const override { return m_splash2; }
virtual const zeus::CColor& button1Inactive() const { return m_button1Inactive; } const zeus::CColor& button1Inactive() const override { return m_button1Inactive; }
virtual const zeus::CColor& button2Inactive() const { return m_button2Inactive; } const zeus::CColor& button2Inactive() const override { return m_button2Inactive; }
virtual const zeus::CColor& button1Hover() const { return m_button1Hover; } const zeus::CColor& button1Hover() const override { return m_button1Hover; }
virtual const zeus::CColor& button2Hover() const { return m_button2Hover; } const zeus::CColor& button2Hover() const override { return m_button2Hover; }
virtual const zeus::CColor& button1Press() const { return m_button1Press; } const zeus::CColor& button1Press() const override { return m_button1Press; }
virtual const zeus::CColor& button2Press() const { return m_button2Press; } const zeus::CColor& button2Press() const override { return m_button2Press; }
virtual const zeus::CColor& button1Disabled() const { return m_button1Disabled; } const zeus::CColor& button1Disabled() const override { return m_button1Disabled; }
virtual const zeus::CColor& button2Disabled() const { return m_button2Disabled; } const zeus::CColor& button2Disabled() const override { return m_button2Disabled; }
virtual const zeus::CColor& textfield1Inactive() const { return m_textfield1Inactive; } const zeus::CColor& textfield1Inactive() const override { return m_textfield1Inactive; }
virtual const zeus::CColor& textfield2Inactive() const { return m_textfield2Inactive; } const zeus::CColor& textfield2Inactive() const override { return m_textfield2Inactive; }
virtual const zeus::CColor& textfield1Hover() const { return m_textfield1Hover; } const zeus::CColor& textfield1Hover() const override { return m_textfield1Hover; }
virtual const zeus::CColor& textfield2Hover() const { return m_textfield2Hover; } const zeus::CColor& textfield2Hover() const override { return m_textfield2Hover; }
virtual const zeus::CColor& textfield1Disabled() const { return m_textfield1Disabled; } const zeus::CColor& textfield1Disabled() const override { return m_textfield1Disabled; }
virtual const zeus::CColor& textfield2Disabled() const { return m_textfield2Disabled; } const zeus::CColor& textfield2Disabled() const override { return m_textfield2Disabled; }
virtual const zeus::CColor& textfieldSelection() const { return m_textfieldSelection; } const zeus::CColor& textfieldSelection() const override { return m_textfieldSelection; }
virtual const zeus::CColor& textfieldMarkSelection() const { return m_textfieldMarkSelection; } const zeus::CColor& textfieldMarkSelection() const override { return m_textfieldMarkSelection; }
virtual const zeus::CColor& tableCellBg1() const { return m_tableCellBg1; } const zeus::CColor& tableCellBg1() const override { return m_tableCellBg1; }
virtual const zeus::CColor& tableCellBg2() const { return m_tableCellBg2; } const zeus::CColor& tableCellBg2() const override { return m_tableCellBg2; }
virtual const zeus::CColor& tableCellBgSelected() const { return m_tableCellBgSelected; } const zeus::CColor& tableCellBgSelected() const override { return m_tableCellBgSelected; }
virtual const zeus::CColor& scrollIndicator() const { return m_scrollIndicator; } const zeus::CColor& scrollIndicator() const override { return m_scrollIndicator; }
virtual const zeus::CColor& spaceTriangleShading1() const { return m_spaceTriangleShading1; } const zeus::CColor& spaceTriangleShading1() const override { return m_spaceTriangleShading1; }
virtual const zeus::CColor& spaceTriangleShading2() const { return m_spaceTriangleShading2; } const zeus::CColor& spaceTriangleShading2() const override { return m_spaceTriangleShading2; }
}; };
class ViewResources { class ViewResources {