forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds PluginRegistry to the C++ client wrapper API (flutter#12287)
Makes the plugin registration structure consistent with macOS. This will be used in generated plugin registrant files rather than a specific implemenation class, so this helps unblock the creation of generated registrants on Windows and Linux.
- Loading branch information
1 parent
d54ed1f
commit 709fc6e
Showing
5 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registry.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRY_H_ | ||
#define FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRY_H_ | ||
|
||
#include <string> | ||
|
||
#include <flutter_plugin_registrar.h> | ||
|
||
namespace flutter { | ||
|
||
// Vends PluginRegistrars for named plugins. | ||
// | ||
// Plugins are identified by unique string keys, typically the name of the | ||
// plugin's main class. | ||
class PluginRegistry { | ||
public: | ||
PluginRegistry() = default; | ||
virtual ~PluginRegistry() = default; | ||
|
||
// Prevent copying. | ||
PluginRegistry(PluginRegistry const&) = delete; | ||
PluginRegistry& operator=(PluginRegistry const&) = delete; | ||
|
||
// Returns the FlutterDesktopPluginRegistrarRef to register a plugin with the | ||
// given name. | ||
// | ||
// The name must be unique across the application. | ||
virtual FlutterDesktopPluginRegistrarRef GetRegistrarForPlugin( | ||
const std::string& plugin_name) = 0; | ||
}; | ||
|
||
} // namespace flutter | ||
|
||
#endif // FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_PLUGIN_REGISTRY_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters