Move windows to uptr. Add simple text editing.
This commit is contained in:
parent
2bcc7b3d83
commit
b99708e7d3
55 changed files with 1257 additions and 994 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "PaintEvent.h"
|
||||
#include "MouseEvent.h"
|
||||
#include "KeyboardEvent.h"
|
||||
#include "VisualLayer.h"
|
||||
#include "Widget.h"
|
||||
|
||||
|
@ -16,35 +17,37 @@ class Window
|
|||
|
||||
private:
|
||||
|
||||
WidgetPtr mWidget;
|
||||
unsigned mWidth;
|
||||
unsigned mHeight;
|
||||
std::vector<VisualLayerPtr> mLayers;
|
||||
WidgetUPtr mWidget;
|
||||
unsigned mWidth;
|
||||
unsigned mHeight;
|
||||
std::vector<VisualLayer*> mLayers;
|
||||
|
||||
public:
|
||||
|
||||
Window();
|
||||
Window();
|
||||
|
||||
~Window();
|
||||
~Window();
|
||||
|
||||
static std::shared_ptr<Window> Create();
|
||||
static std::unique_ptr<Window> Create();
|
||||
|
||||
void AddWidget(WidgetPtr widget);
|
||||
void AddWidget(WidgetUPtr widget);
|
||||
|
||||
WidgetPtr GetWidget();
|
||||
Widget* GetWidget() const;
|
||||
|
||||
std::vector<VisualLayerPtr> GetLayers();
|
||||
std::vector<VisualLayer*> GetLayers();
|
||||
|
||||
unsigned GetWidth();
|
||||
unsigned GetWidth() const;
|
||||
|
||||
unsigned GetHeight();
|
||||
unsigned GetHeight() const;
|
||||
|
||||
void SetSize(unsigned width, unsigned height);
|
||||
void SetSize(unsigned width, unsigned height);
|
||||
|
||||
void OnPaint(PaintEventPtr event);
|
||||
void OnPaint(const PaintEvent* event);
|
||||
|
||||
void OnMouseEvent(MouseEventPtr event);
|
||||
void OnMouseEvent(const MouseEvent* event);
|
||||
|
||||
void OnKeyboardEvent(const KeyboardEvent* event);
|
||||
};
|
||||
}
|
||||
|
||||
using WindowPtr = std::shared_ptr<mt::Window>;
|
||||
using WindowUPtr = std::unique_ptr<mt::Window>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue