diff options
| author | crupest <crupest@outlook.com> | 2020-10-28 21:28:15 +0800 | 
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2020-10-28 21:28:15 +0800 | 
| commit | df4df679e157f974773dad7776b204e9d4f3009e (patch) | |
| tree | bbc1e939a6e7cf38c2b982ad071e145e3f583caa /include/cru/platform/native/Window.hpp | |
| parent | 6ce70ed4b08c7db20b6b384be26c7fc4e11c98de (diff) | |
| download | cru-df4df679e157f974773dad7776b204e9d4f3009e.tar.gz cru-df4df679e157f974773dad7776b204e9d4f3009e.tar.bz2 cru-df4df679e157f974773dad7776b204e9d4f3009e.zip  | |
...
Diffstat (limited to 'include/cru/platform/native/Window.hpp')
| -rw-r--r-- | include/cru/platform/native/Window.hpp | 16 | 
1 files changed, 3 insertions, 13 deletions
diff --git a/include/cru/platform/native/Window.hpp b/include/cru/platform/native/Window.hpp index 1fcac1fc..c8abdeac 100644 --- a/include/cru/platform/native/Window.hpp +++ b/include/cru/platform/native/Window.hpp @@ -1,6 +1,6 @@  #pragma once -#include "../Resource.hpp"  #include "Base.hpp" +  #include "cru/common/Event.hpp"  #include <string_view> @@ -8,14 +8,7 @@  namespace cru::platform::native {  // Represents a native window, which exposes some low-level events and  // operations. -// -// Usually you save an INativeWindowResolver after creating a window. Because -// window may be destroyed when user do certain actions like click the close -// button. Then the INativeWindow instance is destroyed and -// INativeWindowResolver::Resolve return nullptr to indicate the fact.  struct INativeWindow : virtual INativeResource { -  virtual std::shared_ptr<INativeWindowResolver> GetResolver() = 0; -    virtual void Close() = 0;    virtual INativeWindow* GetParent() = 0; @@ -47,6 +40,7 @@ struct INativeWindow : virtual INativeResource {    // Remember to call EndDraw on return value and destroy it.    virtual std::unique_ptr<graph::IPainter> BeginPaint() = 0; +  // Don't use this instance after receive this event.    virtual IEvent<std::nullptr_t>* DestroyEvent() = 0;    virtual IEvent<std::nullptr_t>* PaintEvent() = 0;    virtual IEvent<Size>* ResizeEvent() = 0; @@ -57,11 +51,7 @@ struct INativeWindow : virtual INativeResource {    virtual IEvent<NativeMouseButtonEventArgs>* MouseUpEvent() = 0;    virtual IEvent<NativeKeyEventArgs>* KeyDownEvent() = 0;    virtual IEvent<NativeKeyEventArgs>* KeyUpEvent() = 0; -}; -// See INativeWindow for more info. -struct INativeWindowResolver : virtual INativeResource { -  // Think twice before you save the return value. -  virtual INativeWindow* Resolve() = 0; +  virtual IInputMethodContext* GetInputMethodContext() = 0;  };  }  // namespace cru::platform::native  | 
