2019-08-14 15:52:52 -07:00
|
|
|
// 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_WINDOWS_FLUTTER_WINDOW_STATE_H_
|
|
|
|
|
#define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOW_STATE_H_
|
|
|
|
|
|
|
|
|
|
#include "flutter/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h"
|
|
|
|
|
#include "flutter/shell/platform/common/cpp/incoming_message_dispatcher.h"
|
|
|
|
|
#include "flutter/shell/platform/embedder/embedder.h"
|
|
|
|
|
#include "flutter/shell/platform/windows/key_event_handler.h"
|
|
|
|
|
#include "flutter/shell/platform/windows/keyboard_hook_handler.h"
|
|
|
|
|
#include "flutter/shell/platform/windows/platform_handler.h"
|
|
|
|
|
#include "flutter/shell/platform/windows/text_input_plugin.h"
|
2019-10-16 21:30:06 -07:00
|
|
|
#include "flutter/shell/platform/windows/win32_task_runner.h"
|
2019-08-14 15:52:52 -07:00
|
|
|
|
|
|
|
|
struct flutter::Win32FlutterWindow;
|
|
|
|
|
|
|
|
|
|
// Struct for storing state within an instance of the windows native (HWND or
|
|
|
|
|
// CoreWindow) Window.
|
2019-09-02 17:55:42 -07:00
|
|
|
struct FlutterDesktopViewControllerState {
|
2019-10-16 21:30:06 -07:00
|
|
|
// The win32 window that owns this state object.
|
2019-09-02 17:55:42 -07:00
|
|
|
std::unique_ptr<flutter::Win32FlutterWindow> view;
|
2019-08-14 15:52:52 -07:00
|
|
|
|
2019-10-16 21:30:06 -07:00
|
|
|
// The state associate with the engine backing the view.
|
|
|
|
|
std::unique_ptr<FlutterDesktopEngineState> engine_state;
|
2019-08-14 15:52:52 -07:00
|
|
|
|
|
|
|
|
// The window handle given to API clients.
|
2019-09-02 17:55:42 -07:00
|
|
|
std::unique_ptr<FlutterDesktopView> view_wrapper;
|
2019-08-14 15:52:52 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Opaque reference for the native windows itself. This is separate from the
|
|
|
|
|
// controller so that it can be provided to plugins without giving them access
|
|
|
|
|
// to all of the controller-based functionality.
|
2019-09-02 17:55:42 -07:00
|
|
|
struct FlutterDesktopView {
|
2019-08-14 15:52:52 -07:00
|
|
|
// The window that (indirectly) owns this state object.
|
|
|
|
|
flutter::Win32FlutterWindow* window;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Struct for storing state of a Flutter engine instance.
|
|
|
|
|
struct FlutterDesktopEngineState {
|
|
|
|
|
// The handle to the Flutter engine instance.
|
|
|
|
|
FLUTTER_API_SYMBOL(FlutterEngine) engine;
|
2019-10-16 21:30:06 -07:00
|
|
|
|
|
|
|
|
// Task runner for tasks posted from the engine.
|
|
|
|
|
std::unique_ptr<flutter::Win32TaskRunner> task_runner;
|
2019-08-14 15:52:52 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// State associated with the plugin registrar.
|
|
|
|
|
struct FlutterDesktopPluginRegistrar {
|
|
|
|
|
// The plugin messenger handle given to API clients.
|
|
|
|
|
std::unique_ptr<FlutterDesktopMessenger> messenger;
|
|
|
|
|
|
|
|
|
|
// The handle for the window associated with this registrar.
|
2019-09-02 17:55:42 -07:00
|
|
|
FlutterDesktopView* window;
|
2019-08-14 15:52:52 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// State associated with the messenger used to communicate with the engine.
|
|
|
|
|
struct FlutterDesktopMessenger {
|
|
|
|
|
// The Flutter engine this messenger sends outgoing messages to.
|
|
|
|
|
FLUTTER_API_SYMBOL(FlutterEngine) engine;
|
|
|
|
|
|
|
|
|
|
// The message dispatcher for handling incoming messages.
|
|
|
|
|
flutter::IncomingMessageDispatcher* dispatcher;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOW_STATE_H_
|