Flutter Engine
plugin_registrar_glfw.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_GLFW_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_GLFW_H_
6 #define FLUTTER_SHELL_PLATFORM_GLFW_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_GLFW_H_
7 
8 #include <flutter_glfw.h>
9 
10 #include <memory>
11 
12 #include "flutter_window.h"
13 #include "plugin_registrar.h"
14 
15 namespace flutter {
16 
17 // An extension to PluginRegistrar providing access to GLFW-shell-specific
18 // functionality.
20  public:
21  // Creates a new PluginRegistrar. |core_registrar| and the messenger it
22  // provides must remain valid as long as this object exists.
24  : PluginRegistrar(core_registrar) {
25  window_ = std::make_unique<FlutterWindow>(
27  }
28 
30  // Must be the first call.
31  ClearPlugins();
32  // Explicitly cleared to facilitate destruction order testing.
33  window_.reset();
34  }
35 
36  // Prevent copying.
39 
40  FlutterWindow* window() { return window_.get(); }
41 
42  // Enables input blocking on the given channel name.
43  //
44  // If set, then the parent window should disable input callbacks
45  // while waiting for the handler for messages on that channel to run.
46  void EnableInputBlockingForChannel(const std::string& channel) {
48  channel.c_str());
49  }
50 
51  private:
52  // The owned FlutterWindow, if any.
53  std::unique_ptr<FlutterWindow> window_;
54 };
55 
56 } // namespace flutter
57 
58 #endif // FLUTTER_SHELL_PLATFORM_GLFW_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRAR_GLFW_H_
PluginRegistrarGlfw & operator=(PluginRegistrarGlfw const &)=delete
void FlutterDesktopPluginRegistrarEnableInputBlocking(FlutterDesktopPluginRegistrarRef registrar, const char *channel)
FlutterDesktopWindowRef FlutterDesktopPluginRegistrarGetWindow(FlutterDesktopPluginRegistrarRef registrar)
void EnableInputBlockingForChannel(const std::string &channel)
PluginRegistrarGlfw(FlutterDesktopPluginRegistrarRef core_registrar)
FlutterDesktopPluginRegistrarRef registrar()