Flutter Windows Embedder
flutter_view.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_CLIENT_WRAPPER_INCLUDE_FLUTTER_FLUTTER_VIEW_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_CLIENT_WRAPPER_INCLUDE_FLUTTER_FLUTTER_VIEW_H_
7 
8 #include <flutter_windows.h>
9 
10 namespace flutter {
11 
12 // The unique identifier for a view.
13 typedef int64_t FlutterViewId;
14 
15 // A view displaying Flutter content.
16 class FlutterView {
17  public:
18  explicit FlutterView(FlutterDesktopViewRef view) : view_(view) {}
19 
20  virtual ~FlutterView() = default;
21 
22  // Prevent copying.
23  FlutterView(FlutterView const&) = delete;
24  FlutterView& operator=(FlutterView const&) = delete;
25 
26  // Returns the backing HWND for the view.
27  HWND GetNativeWindow() { return FlutterDesktopViewGetHWND(view_); }
28 
29  // Returns the DXGI adapter used for rendering or nullptr in case of error.
30  IDXGIAdapter* GetGraphicsAdapter() {
32  }
33 
34  private:
35  // Handle for interacting with the C API's view.
36  FlutterDesktopViewRef view_ = nullptr;
37 };
38 
39 } // namespace flutter
40 
41 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_CLIENT_WRAPPER_INCLUDE_FLUTTER_FLUTTER_VIEW_H_
FlutterDesktopViewGetHWND
HWND FlutterDesktopViewGetHWND(FlutterDesktopViewRef view)
Definition: flutter_windows.cc:218
flutter::FlutterView::operator=
FlutterView & operator=(FlutterView const &)=delete
flutter::FlutterView::FlutterView
FlutterView(FlutterDesktopViewRef view)
Definition: flutter_view.h:18
FlutterDesktopViewRef
struct FlutterDesktopView * FlutterDesktopViewRef
Definition: flutter_windows.h:29
flutter::FlutterView::GetGraphicsAdapter
IDXGIAdapter * GetGraphicsAdapter()
Definition: flutter_view.h:30
flutter::FlutterViewId
int64_t FlutterViewId
Definition: flutter_view.h:13
flutter
Definition: accessibility_bridge_windows.cc:11
flutter::FlutterView
Definition: flutter_view.h:16
flutter::FlutterView::~FlutterView
virtual ~FlutterView()=default
flutter::FlutterView::GetNativeWindow
HWND GetNativeWindow()
Definition: flutter_view.h:27
flutter_windows.h
FlutterDesktopViewGetGraphicsAdapter
IDXGIAdapter * FlutterDesktopViewGetGraphicsAdapter(FlutterDesktopViewRef view)
Definition: flutter_windows.cc:222