acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_directx_impact.h
1#pragma once
2
3
4namespace universal_windows
5{
6
7
8 ref class impact abstract :
9 //public ::winrt::Windows::UI::Xaml::Controls::UserControl
10 public ::winrt::Windows::ApplicationModel::Core::IFrameworkView,
11 public ::platform::system_window
12 {
13 public:
14
15 // IFrameworkView Methods
16 virtual void Initialize(_In_ ::winrt::Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
17 virtual void SetWindow(_In_ ::winrt::Windows::UI::Core::CoreWindow^ window) ;
18 virtual void Load(_In_ String^ entryPoint) = 0;
19 virtual void Run() = 0;
20 virtual void Uninitialize() = 0;
21
22 virtual ::winrt::Windows::Foundation::Rect window_rectangle() = 0;
23 virtual ::winrt::Windows::Foundation::i32_point get_cursor_position() = 0;
24
25
26 virtual ::winrt::Windows::Foundation::Rect get_input_content_rect() = 0;
27 virtual ::winrt::Windows::Foundation::Rect get_input_selection_rect() = 0;
28
29 internal:
30
31
32 bool m_bTextCompositionActive;
33 wide_string m_strText;
34 wide_string m_strNewText;
35 ::platform::system* system();
36
37 Agile < ::winrt::Windows::UI::Core::CoreWindow > m_window;
38
39 // The _editContext lets us communicate with the input system.
40 Agile < ::winrt::Windows::UI::Text::Core::CoreTextEditContext > _editContext;
41
42 // We will use a plain text string to represent the
43 // content of the custom text edit control.
44 //String^ _text;
45
46 // If the _selection starts and ends at the same point,
47 // then it represents the location of the caret (insertion point).
48 ::winrt::Windows::UI::Text::Core::CoreTextRange _selection;
49
50 // _internalFocus keeps track of whether our control acts like it has focus.
51 bool _internalFocus = false;
52
53 // If there is a nonempty selection, then _extendingLeft is true if the user
54 // is using shift+arrow to adjust the starting point of the selection,
55 // or false if the user is adjusting the ending point of the selection.
56 bool _extendingLeft = false;
57
58 // The input pane matter indicates the visibility of the on screen keyboard.
59 // Apps can also ask the keyboard to show or hide.
60 Agile < ::winrt::Windows::UI::ViewManagement::InputPane > _inputPane;
61
62 ::winrt::event_token m_tokenKeyDown;
63 ::winrt::event_token m_tokenPointerPressed;
64 //TypedEventHandler < ::winrt::Windows::UI::Core::CoreWindow^, ::winrt::Windows::UI::Core::KeyEventArgs^> m_refPointer;
65
66
67 impact();
68
69
70
71
72
73
74 void CoreWindow_PointerPressed(::winrt::Windows::UI::Core::CoreWindow^ sender, ::winrt::Windows::UI::Core::PointerEventArgs^ args);
75
76 void SetInternalFocus();
77
78 void RemoveInternalFocus();
79
80 void RemoveInternalFocusWorker();
81
82 void EditContext_FocusRemoved(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, Object^ args);
83
84 void Element_Unloaded(Object^ sender, ::winrt::Windows::UI::Xaml::RoutedEventArgs^ e);
85
86 // Replace the text in the specified range.
87 void ReplaceText(::winrt::Windows::UI::Text::Core::CoreTextRange modifiedRange, String^ text);
88 void SetText(String^ text, ::i32 iBeg, ::i32 iEnd);
89 bool HasSelection();
90
91 // Change the selection without notifying CoreTextEditContext of the aaa_primitive_new selection.
92 void SetSelection(::winrt::Windows::UI::Text::Core::CoreTextRange selection);
93 // Change the selection and notify CoreTextEditContext of the aaa_primitive_new selection.
94 void SetSelectionAndNotify(::winrt::Windows::UI::Text::Core::CoreTextRange selection);
95
96 // Return the specified range of text. Note that the system may ask for more text
97 // than exists in the text buffer.
98 void EditContext_TextRequested(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextTextRequestedEventArgs^ args);
99
100 // Return the current selection.
101 void EditContext_SelectionRequested(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextSelectionRequestedEventArgs^ args);
102
103 void EditContext_TextUpdating(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextTextUpdatingEventArgs^ args);
104
105 void EditContext_SelectionUpdating(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextSelectionUpdatingEventArgs^ args);
106
107
108 void EditContext_FormatUpdating(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextFormatUpdatingEventArgs^ args);
109
110
111
112 void EditContext_LayoutRequested(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextLayoutRequestedEventArgs^ args);
113
114 // This indicates that an IME has started composition. If there is no handler for this happening,
115 // then composition will not start.
116 void EditContext_CompositionStarted(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextCompositionStartedEventArgs^ args);
117 void EditContext_CompositionCompleted(::winrt::Windows::UI::Text::Core::CoreTextEditContext^ sender, ::winrt::Windows::UI::Text::Core::CoreTextCompositionCompletedEventArgs^ args);
118
119 void CoreWindow_KeyDown(::winrt::Windows::UI::Core::CoreWindow^ sender, ::winrt::Windows::UI::Core::KeyEventArgs^ args);
120 // Adjust the active endpoint of the selection in the specified direction.
121 void AdjustSelectionEndpoint(::i32 direction);
122
123 // Helper function to put a zero-width non-breaking space at the end of a string.
124 // This prevents TextBlock from trimming trailing spaces.
125 static String ^ PreserveTrailingSpaces(String^ s);
126
127 void UpdateFocusUI();
128
129 void UpdateTextUI();
130
131 // static Rect GetElementRect(FrameworkElement matter);
132 };
133
134
135} // namespace universal_windows
136
137
138
Definition system.h:53
Definition ___serialization_draft.h:150