Flutter Windows Embedder
host_window_tooltip.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_TOOLTIP_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_TOOLTIP_H_
7 
8 #include <cstdint>
9 #include "host_window.h"
12 
13 namespace flutter {
16  public:
17  // Creates a tooltip window.
18  HostWindowTooltip(WindowManager* window_manager,
19  FlutterWindowsEngine* engine,
20  const BoxConstraints& constraints,
21  GetWindowPositionCallback get_position_callback,
22  HWND parent);
23 
24  // Update the position of the tooltip window based off the current size
25  // of the tooltip.
26  void UpdatePosition();
27 
28  protected:
29  LRESULT HandleMessage(HWND hwnd,
30  UINT message,
31  WPARAM wparam,
32  LPARAM lparam) override;
33 
34  private:
35  void DidUpdateViewSize(int32_t width, int32_t height) override;
36  WindowRect GetWorkArea() const override;
37 
38  GetWindowPositionCallback get_position_callback_;
39  HWND parent_;
40  Isolate isolate_;
41 
42  // Used to track whether the view is still in tasks scheduled from raster
43  // thread.
44  std::shared_ptr<int> view_alive_;
45 
46  // The current width of the tooltip.
47  int width_ = 0;
48 
49  // The current height of the tooltip.
50  int height_ = 0;
51 };
52 } // namespace flutter
53 
54 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_TOOLTIP_H_
LRESULT HandleMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) override
HostWindowTooltip(WindowManager *window_manager, FlutterWindowsEngine *engine, const BoxConstraints &constraints, GetWindowPositionCallback get_position_callback, HWND parent)
Win32Message message
WindowRect *(* GetWindowPositionCallback)(const WindowSize &child_size, const WindowRect &parent_rect, const WindowRect &output_rect)