acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_interaction_impl.h
1#pragma once
2
3
4namespace linux
5{
6
7
8 LRESULT CALLBACK __send_message_hook(::i32, WPARAM, LPARAM);
9 // void _::ca2::StandardSubclass(oswindow);
10 LRESULT CALLBACK __cbt_filter_hook(::i32, WPARAM, LPARAM);
11 LRESULT __call_window_procedure(::user::interaction * pWnd, oswindow hWnd, ::u32 nMsg, WPARAM wParam, LPARAM lParam);
12
13
14 class x11data;
15 class interaction_impl :
16 virtual public ::windowing::window
17 {
18 public:
19
20
21 string m_strWindowText;
22 ::user::interaction_base * m_pbasewnd;
23 bool m_bExposing;
24 ::i32 m_iDepth;
25 ::i32 m_iScreen;
26 bool m_bEnabled;
27
28 //::task_pointer m_pthreadDraw;
29 ::rect64 m_rectangleLastPos;
30 ::duration m_durationLastPos;
31
32 ::i32_point m_pointLastMove;
33 bool m_bMoveEvent;
34 ::size m_sizeLastSize;
35 bool m_bSizeEvent;
36 ::duration m_durationLastPlacementEvent;
37
38
39 interaction_impl();
40 interaction_impl(::particle * pparticle);
41 virtual ~interaction_impl();
42
43
44 void linux_interaction_impl_common_construct();
45
46
47// // void assert_ok() const override;
48// // void dump(dump_context & dumpcontext) const override;
49
50
51 //virtual void on_delete(::matter * poc);
52
53 static const MESSAGE* PASCAL GetCurrentMessage();
54
55 void install_message_routing(::channel * pchannel) override;
56
57 bool operator==(const ::windowing::window& wnd) const;
58 bool operator!=(const ::windowing::window& wnd) const;
59
60 ::u32 GetStyle() const override;
61 ::u32 GetExStyle() const override;
62 bool ModifyStyle(::u32 dwRemove, ::u32 dwAdd, ::u32 nFlags = 0) override;
63 bool ModifyStyleEx(::u32 dwRemove, ::u32 dwAdd, ::u32 nFlags = 0) override;
64
65 //virtual ::user::interaction * get_owner();
66 virtual void set_owner(::user::interaction * pOwnerWnd) override;
67
68 virtual oswindow get_handle() const override;
69
70 void route_command(::message::command * pcommand, bool bRouteToKeyDescendant = false) override;
71
72 virtual void handle(::topic * ptopic, ::handler_context * phandlercontext) override;
73
74 DECLARE_MESSAGE_HANDLER(_001OnEraseBkgnd);
75 DECLARE_MESSAGE_HANDLER(on_message_move);
76 DECLARE_MESSAGE_HANDLER(on_message_size);
77 DECLARE_MESSAGE_HANDLER(on_message_show_window);
78
79
80 virtual void window_show_change_visibility(::e_display edisplay, const ::user::activation & useractivation) override;
81
82
83 virtual ::windowing::window * from_os_data(void * pdata) override;
84 virtual void * get_os_data() const override;
85
86 static user::interaction_impl * from_handle(oswindow hWnd);
87 static user::interaction_impl * FromHandlePermanent(oswindow hWnd);
88 //static void DeleteTempMap();
89 bool Attach(oswindow hWndNew);
90 oswindow Detach();
91
92 // subclassing/unsubclassing functions
93 virtual void pre_subclass_window() override;
94// bool SubclassWindow(oswindow hWnd);
95// //bool SubclassDlgItem(::u32 nID, ::pointer<::interaction_impl>pParent);
96// oswindow UnsubclassWindow();
97
98 // handling of RT_DLGINIT resource (extension to RT_DIALOG)
99// bool ExecuteDlgInit(const ::scoped_string & scopedstrResourceName);
100//
101// bool ExecuteDlgInit(LPVOID pResource);
102
103 //virtual bool create_message_queue(::user::interaction * pinteraction, const_char_pointer pszName) override;
104
105// using ::windowing::window::create_window;
106
107 // for child windows, views, panes etc
108// virtual bool create_window(
109// ::user::interaction * pinteraction,
110// const ::scoped_string & scopedstrClassName,
111
112// const ::scoped_string & scopedstrWindowName,
113
114// ::u32 dwStyle,
115// const ::f64_rectangle & rectangle,
116// ::user::interaction * pParentWnd,
117// atom atom,
118// ::create * pContext = nullptr) override;
119//
120// // advanced creation (allows access to extended styles)
121// virtual bool create_window_ex(
122// ::user::interaction * pinteraction,
123// ::pointer<::user::system>pusersystem,
124// ::user::interaction * pParentWnd = nullptr,
125// atom atom = ::atom()) override;
126
127 virtual bool _native_create_window_ex(::pointer<::user::system>pusersystem) override;
128
129
130// virtual bool native_create_window_ex(
131// ::user::interaction * pinteraction,
132// ::pointer<::user::system>pusersystem,
133// ::user::interaction * pParentWnd = nullptr,
134// atom atom = ::atom());
135
136 virtual bool DestroyWindow() override;
137
138 // special pre-creation and ::windowing::window rectangle adjustment hooks
139 virtual bool pre_create_window(::user::system * pusersystem) override;
140
141 // Advanced: virtual AdjustWindowRect
142// enum AdjustType { adjustBorder = 0, adjustOutside = 1 };
143// virtual void CalcWindowRect(RECT32 * pClientRect, ::u32 nAdjustType = adjustBorder);
144
145
146
147
148 void _thread_delayed_placement();
149
150 void defer_delayed_placement();
151
152
153 virtual void on_start_layout_experience(enum_layout_experience elayoutexperience) override;
154 virtual void on_end_layout_experience(enum_layout_experience elayoutexperience) override;
155
156
157 virtual void on_layout(::draw2d::graphics_pointer & pgraphics) override;
158
159
160
161
162 virtual bool _is_window() const override;
163
164#if(WINVER >= 0x0500)
165
166 ::user::interaction * GetAncestor(::u32 gaFlags) const;
167
168#endif // WINVER >= 0x0500
169
170 LRESULT send_message(::enum_message emessage, ::wparam wparam = {}, ::lparam lparam = {}) override;
171
172 bool post_message(::enum_message emessage, ::wparam wparam = {}, ::lparam lparam = {}) override;
173
174
175// bool SendNotifyMessage(::enum_message emessage, ::wparam wparam, ::lparam lparam);
176//
177// bool SendChildNotifyLastMsg(LRESULT* pResult = nullptr);
178//
179// bool DragDetect(const ::i32_point & point) const;
180
181
182
183
184
185 // oswindow Text Functions
186 void set_window_text(const ::scoped_string & scopedstrString) override;
187
188 //character_count GetWindowText(char_pointer pszStringBuf, character_count nMaxCount);
189
190 void get_window_text(string & str) override;
191 //character_count GetWindowTextLength();
192 void SetFont(::write_text::font* pFont, bool bRedraw = true);
193 ::write_text::font* GetFont();
194
195
196 // oswindow size and position Functions
197 virtual bool node_is_iconic() override;
198 //virtual bool layout().is_zoomed();
199 //virtual bool layout().is_full_screen();
200 //void MoveWindow(::i32 x, ::i32 y, ::i32 nWidth, ::i32 nHeight,
201 // bool bRepaint = true);
202 //void MoveWindow(const ::f64_rectangle & rectangle, bool bRepaint = true);
203
204// ::i32 SetWindowRgn(HRGN hRgn, bool bRedraw);
205// ::i32 GetWindowRgn(HRGN hRgn);
206
207
208 virtual void _001OnExitIconic() override;
209 virtual void _001OnExitFullScreen() override;
210 virtual void _001OnExitZoomed() override;
211
212
213 //virtual bool set_window_position(iptr z, ::i32 x, ::i32 y, ::i32 cx, ::i32 cy, ::u32 nFlags);
214// virtual ::u32 ArrangeIconicWindows();
215 //virtual bool BringWindowToTop();
216// virtual bool window_rectangle(RECT64 * prect);
217
218 // virtual bool _001GetWindowRect(RECT64 * prect);
219
220 //using ::windowing::window::this->rectangle;
221 //virtual bool this->rectangle(RECT64 * prect);
222
223
224 virtual bool has_focus() override;
225 virtual bool is_active() override;
226
227 //virtual ::i32_point client_screen_top_left() override;
228
229// virtual bool client_to_screen(RECT32 * prect);
230
231// virtual bool client_to_screen(POINT32 * ppoint);
232
233// virtual bool client_to_screen(RECT64 * prect);
234
235// virtual bool client_to_screen(POINT64 * ppoint);
236
237// virtual bool screen_to_client(RECT32 * prect);
238
239// virtual bool screen_to_client(POINT32 * ppoint);
240
241// virtual bool screen_to_client(RECT64 * prect);
242
243// virtual bool screen_to_client(POINT64 * ppoint);
244
245
246 virtual bool GetWindowPlacement(WINDOWPLACEMENT* puserinteractionpl);
247
248 virtual bool SetWindowPlacement(const WINDOWPLACEMENT* puserinteractionpl);
249
250
251 // Coordinate Mapping Fufnctions
252// virtual void MapWindowPoints(::user::interaction * puserinteractionTo, POINT32 * pPoint, ::u32 nCount);
253//
254// virtual void MapWindowPoints(::user::interaction * puserinteractionTo, RECT32 * prect);
255
256
257 // Update/Painting Functions
258// virtual ::draw2d::graphics * GetDC();
259// virtual ::draw2d::graphics * GetWindowDC();
260// virtual bool ReleaseDC(::image::image *pimage);
261// virtual void Print(::draw2d::graphics_pointer & pgraphics, ::u32 dwFlags) const;
262// virtual void PrintClient(::draw2d::graphics_pointer & pgraphics, ::u32 dwFlags) const;
263
264// virtual void UpdateWindow();
265// virtual void SetRedraw(bool bRedraw = true);
266// virtual bool GetUpdateRect(RECT32 * prect, bool bErase = false);
267//
268// virtual ::i32 GetUpdateRgn(::draw2d::region* pRgn, bool bErase = false);
269// virtual void Invalidate(bool bErase = true);
270// virtual void InvalidateRect(const ::f64_rectangle & rectangle, bool bErase = true);
271//
272// virtual void InvalidateRgn(::draw2d::region* pRgn, bool bErase = true);
273// virtual void ValidateRect(const ::f64_rectangle & rectangle);
274//
275// virtual void ValidateRgn(::draw2d::region* pRgn);
276 //virtual bool display(::e_display edisplay) override;
277
278// virtual bool WfiOnStartDock();
279// virtual void WfiOnDock(edisplay edisplay);
280// virtual void prodevian_prepare_down();
281// virtual void prodevian_prepare_up();
282// virtual void WfiOnRestore();
283// virtual void WfiOnMinimize(bool bNoActivate);
284// virtual void WfiOnMaximize();
285// virtual void WfiOnFullScreen();
286// virtual void WfiOnExitFullScreen();
287// virtual void WfiOnClose();
288// virtual void WfiOnNotifyIcon();
289
290
291 //virtual bool _is_window_visible() override;
292 //virtual void ShowOwnedPopups(bool bShow = true);
293
294 //virtual ::draw2d::graphics * GetDCEx(::draw2d::region* prgnClip, ::u32 flags);
295 //virtual bool LockWindowUpdate();
296 //virtual void UnlockWindowUpdate();
297// virtual bool RedrawWindow(const ::f64_rectangle& rectangleUpdate = nullptr,
298// ::draw2d::region* prgnUpdate = nullptr,
299// ::u32 flags = RDW_INVALIDATE | RDW_ERASE);
300 // xxx virtual bool EnableScrollBar(::i32 nSBFlags, ::u32 nArrowFlags = ESB_ENABLE_BOTH);
301
302 virtual void set_context_org(::draw2d::graphics_pointer & pgraphics) override;
303
304//
305// //virtual bool DrawAnimatedRects(::i32 idAni, const LPRECTprcFrom, const LPRECTlprcTo);
306//
307// virtual bool DrawCaption(::draw2d::graphics_pointer & pgraphics, const rectangle & prc, ::u32 uFlags);
308//
309//
310//#if(WINVER >= 0x0500)
311//
312// virtual bool AnimateWindow(::u32 ::duration, ::u32 dwFlags);
313//
314//#endif // WINVER >= 0x0500
315//
316//#if(_WIN32_WINNT >= 0x0501)
317//
318// virtual bool PrintWindow(::draw2d::graphics_pointer & pgraphics, ::u32 nFlags) const;
319//
320//#endif // _WIN32_WINNT >= 0x0501
321
322
323
324// // Timer Functions
325// virtual bool set_timer(uptr uEvent, ::u32 nElapse, PFN_TIMER pfnTimer);
326// virtual bool kill_timer(uptr uEvent);
327
328 // oswindow State Functions
329 virtual bool IsWindowEnabled();
330 virtual bool EnableWindow(bool bEnable = true);
331
332 // the active ::windowing::window applies only to top-level (frame windows)
333 virtual ::user::interaction * get_active_window() override;
334 virtual ::user::interaction * set_active_window() override;
335
336 // the foreground ::windowing::window applies only to top-level windows (frame windows)
337 virtual bool set_foreground_window() override;
338
339
340
341 virtual ::user::interaction * GetFocus() override;
342 virtual bool set_keyboard_focus() override;
343
344 static::user::interaction * PASCAL get_desktop_window();
345
346
347 virtual bool prodevian_update_screen() override;
348
349
350 DECLARE_MESSAGE_HANDLER(on_message_create);
351 DECLARE_MESSAGE_HANDLER(on_message_destroy);
352 DECLARE_MESSAGE_HANDLER(_001OnPaint);
353 DECLARE_MESSAGE_HANDLER(_001OnPrint);
355
356
357
358 virtual void pre_translate_message(::message::message * pmessage) override;
359
360
361 virtual void message_handler(::user::message * pusermessage) override;
362
363 virtual void default_window_procedure(::user::message * pusermessage);
364
365 virtual void post_non_client_destroy() override;
366
367 virtual void on_final_release() override;
368
369 //static void get_app_wnda(user::oswindow_array & wnda);
370
371 virtual LONG_PTR get_window_long_ptr(::i32 nIndex) const override;
372 virtual LONG_PTR set_window_long_ptr(::i32 nIndex, LONG_PTR lValue) override;
373
374 //void _001OnTriggerMouseInside();
375
376
377 //::user::interaction * get_next(bool bIgnoreChildren, ::i32 * piLevel);
378
379 void show_task(bool bShow) override;
380
381 virtual void non_top_most_upper_window_rects(::i32_rectangle_array& recta) override;
382
383 };
384
385
386} // namespace linux
387
388
389
390
Definition handler_context.h:9
Definition lparam.h:9
Definition particle.h:95
Definition topic.h:17
Definition wparam.h:10
Definition message.h:13