2015-11-21 01:14:49 +00:00
|
|
|
#ifndef SPECTER_SPACE_HPP
|
|
|
|
#define SPECTER_SPACE_HPP
|
|
|
|
|
2016-01-10 06:40:23 +00:00
|
|
|
#include "View.hpp"
|
|
|
|
#include "Toolbar.hpp"
|
|
|
|
#include "SplitView.hpp"
|
2015-12-03 03:26:50 +00:00
|
|
|
|
|
|
|
namespace Specter
|
|
|
|
{
|
2016-01-10 06:40:23 +00:00
|
|
|
class Space;
|
|
|
|
struct ISplitSpaceController;
|
|
|
|
|
|
|
|
struct ISpaceController
|
|
|
|
{
|
|
|
|
virtual bool spaceSplitAllowed() const {return false;}
|
|
|
|
virtual ISplitSpaceController* spaceSplit(SplitView::Axis axis, int thisSlot) {return nullptr;}
|
|
|
|
virtual ISpaceController* spaceJoin(int keepSlot) {return nullptr;}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ISplitSpaceController
|
|
|
|
{
|
|
|
|
virtual SplitView* splitView()=0;
|
2016-01-12 00:44:54 +00:00
|
|
|
virtual void updateSplit(float split)=0;
|
2016-01-10 06:40:23 +00:00
|
|
|
};
|
2015-12-03 03:26:50 +00:00
|
|
|
|
|
|
|
class Space : public View
|
|
|
|
{
|
2016-01-10 06:40:23 +00:00
|
|
|
ISpaceController& m_controller;
|
2015-12-03 03:26:50 +00:00
|
|
|
Toolbar::Position m_tbPos;
|
2016-01-10 06:40:23 +00:00
|
|
|
ViewChild<std::unique_ptr<Toolbar>> m_toolbar;
|
|
|
|
ViewChild<View*> m_contentView;
|
|
|
|
|
|
|
|
bool m_cornerDrag = false;
|
|
|
|
int m_cornerDragPoint[2];
|
|
|
|
|
|
|
|
struct CornerView : View
|
|
|
|
{
|
|
|
|
Space& m_space;
|
|
|
|
VertexBufferBinding m_vertexBinding;
|
|
|
|
bool m_flip;
|
|
|
|
CornerView(ViewResources& res, Space& space, const Zeus::CColor& triColor);
|
|
|
|
void mouseEnter(const boo::SWindowCoord&);
|
|
|
|
void mouseLeave(const boo::SWindowCoord&);
|
|
|
|
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, bool flip);
|
|
|
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
|
|
|
};
|
|
|
|
friend struct CornerView;
|
|
|
|
ViewChild<std::unique_ptr<CornerView>> m_cornerView;
|
|
|
|
|
2015-12-03 03:26:50 +00:00
|
|
|
public:
|
2016-01-27 00:41:44 +00:00
|
|
|
Space(ViewResources& res, View& parentView, ISpaceController& controller,
|
|
|
|
Toolbar::Position toolbarPos, unsigned tbUnits);
|
2015-12-10 03:14:38 +00:00
|
|
|
View* setContentView(View* view);
|
2016-01-10 06:40:23 +00:00
|
|
|
Toolbar* toolbar() {return m_toolbar.m_view.get();}
|
2015-12-03 03:26:50 +00:00
|
|
|
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseMove(const boo::SWindowCoord&);
|
2015-12-05 00:42:46 +00:00
|
|
|
void mouseEnter(const boo::SWindowCoord&);
|
|
|
|
void mouseLeave(const boo::SWindowCoord&);
|
|
|
|
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub);
|
2015-12-03 03:26:50 +00:00
|
|
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
2016-01-04 23:58:38 +00:00
|
|
|
|
|
|
|
void setMultiplyColor(const Zeus::CColor& color)
|
|
|
|
{
|
|
|
|
View::setMultiplyColor(color);
|
2016-01-10 06:40:23 +00:00
|
|
|
if (m_contentView.m_view)
|
|
|
|
m_contentView.m_view->setMultiplyColor(color);
|
|
|
|
if (m_toolbar.m_view)
|
|
|
|
m_toolbar.m_view->setMultiplyColor(color);
|
|
|
|
}
|
2015-12-03 03:26:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-21 01:14:49 +00:00
|
|
|
#endif // SPECTER_SPACE_HPP
|