aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-04-20 01:17:28 +0800
committercrupest <crupest@outlook.com>2020-04-20 01:17:28 +0800
commit857adcb7ee2d45b2e29d4250fa4246bb8861a8f9 (patch)
tree2ebe62c58768ded27c5c6b15d1ab04400c9ecf9b /include/cru/win
parent494d2db1c1203acc9d9f2b127b75c6df6160057a (diff)
downloadcru-857adcb7ee2d45b2e29d4250fa4246bb8861a8f9.tar.gz
cru-857adcb7ee2d45b2e29d4250fa4246bb8861a8f9.tar.bz2
cru-857adcb7ee2d45b2e29d4250fa4246bb8861a8f9.zip
...
Diffstat (limited to 'include/cru/win')
-rw-r--r--include/cru/win/graph/direct/text_layout.hpp4
-rw-r--r--include/cru/win/native/input_method.hpp2
-rw-r--r--include/cru/win/native/window.hpp4
3 files changed, 6 insertions, 4 deletions
diff --git a/include/cru/win/graph/direct/text_layout.hpp b/include/cru/win/graph/direct/text_layout.hpp
index 5f7be9f3..462a5fd3 100644
--- a/include/cru/win/graph/direct/text_layout.hpp
+++ b/include/cru/win/graph/direct/text_layout.hpp
@@ -45,8 +45,8 @@ class DWriteTextLayout : public DirectGraphResource,
std::string text_;
std::wstring w_text_;
std::shared_ptr<DWriteFont> font_;
- float max_width_ = 0.0f;
- float max_height_ = 0.0f;
+ float max_width_ = 10000.0f;
+ float max_height_ = 10000.0f;
Microsoft::WRL::ComPtr<IDWriteTextLayout> text_layout_;
};
} // namespace cru::platform::graph::win::direct
diff --git a/include/cru/win/native/input_method.hpp b/include/cru/win/native/input_method.hpp
index 566eada2..8e17abd5 100644
--- a/include/cru/win/native/input_method.hpp
+++ b/include/cru/win/native/input_method.hpp
@@ -64,6 +64,8 @@ class WinInputMethodContext : public WinNativeResource,
private:
void OnWindowNativeMessage(WindowNativeMessageEventArgs& args);
+ std::string GetResultString();
+
std::optional<AutoHIMC> TryGetHIMC();
private:
diff --git a/include/cru/win/native/window.hpp b/include/cru/win/native/window.hpp
index 45f1f16a..83497fa6 100644
--- a/include/cru/win/native/window.hpp
+++ b/include/cru/win/native/window.hpp
@@ -72,7 +72,7 @@ class WinNativeWindow : public WinNativeResource, public virtual INativeWindow {
IEvent<platform::native::NativeKeyEventArgs>* KeyUpEvent() override {
return &key_up_event_;
}
- IEvent<std::string>* CharEvent() override { return &char_event_; };
+ IEvent<std::string_view>* CharEvent() override { return &char_event_; };
IEvent<WindowNativeMessageEventArgs&>* NativeMessageEvent() {
return &native_message_event_;
@@ -146,7 +146,7 @@ class WinNativeWindow : public WinNativeResource, public virtual INativeWindow {
Event<platform::native::NativeMouseButtonEventArgs> mouse_up_event_;
Event<platform::native::NativeKeyEventArgs> key_down_event_;
Event<platform::native::NativeKeyEventArgs> key_up_event_;
- Event<std::string> char_event_;
+ Event<std::string_view> char_event_;
Event<WindowNativeMessageEventArgs&> native_message_event_;