| Flutter Windows Embedder |

flutter_windows_internal.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_FLUTTER_WINDOWS_INTERNAL_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_INTERNAL_H_
7
8 #include "flutter/shell/platform/windows/public/flutter_windows.h"
9
10 #if defined(__cplusplus)
11 extern "C" {
12 #endif
13
14 // Declare functions that are currently in-progress and shall be exposed to the
15 // public facing API upon completion.
16
17 // Properties for configuring a Flutter view controller.
18 typedef struct {
19 // The view's initial width.
20 int width;
21
22 // The view's initial height.
23 int height;
24 } FlutterDesktopViewControllerProperties;
25
26 // Creates a view for the given engine.
27 //
28 // The |engine| will be started if it is not already running.
29 //
30 // The caller owns the returned reference, and is responsible for calling
31 // |FlutterDesktopViewControllerDestroy|. Returns a null pointer in the event of
32 // an error.
33 //
34 // Unlike |FlutterDesktopViewControllerCreate|, this does *not* take ownership
35 // of |engine| and |FlutterDesktopEngineDestroy| must be called to destroy
36 // the engine.
37 FLUTTER_EXPORT FlutterDesktopViewControllerRef
38 FlutterDesktopEngineCreateViewController(
39 FlutterDesktopEngineRef engine,
40 const FlutterDesktopViewControllerProperties* properties);
41
42 typedef int64_t PlatformViewId;
43
44 typedef struct {
45 size_t struct_size;
46 HWND parent_window;
47 const char* platform_view_type;
48 // user_data may hold any necessary additional information for creating a new
49 // platform view. For example, an instance of FlutterWindow.
50 void* user_data;
51 PlatformViewId platform_view_id;
52 } FlutterPlatformViewCreationParameters;
53
54 typedef HWND (*FlutterPlatformViewFactory)(
55 const FlutterPlatformViewCreationParameters*);
56
57 typedef struct {
58 size_t struct_size;
59 FlutterPlatformViewFactory factory;
60 void* user_data; // Arbitrary user data supplied to the creation struct.
61 } FlutterPlatformViewTypeEntry;
62
63 FLUTTER_EXPORT void FlutterDesktopEngineRegisterPlatformViewType(
64 FlutterDesktopEngineRef engine,
65 const char* view_type_name,
66 FlutterPlatformViewTypeEntry view_type);
67
68 // Returns the engine associated with the given identifier. Engine identifier
69 // must be valid and for a running engine, otherwise the behavior is undefined.
70 //
71 // Identifier can be obtained from PlatformDispatcher.instance.engineId.
72 //
73 // This method must be called from the platform thread.
74 FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopEngineForId(
75 int64_t engine_id);
76
77 #if defined(__cplusplus)
78 }
79 #endif
80
81 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_INTERNAL_H_
FLUTTER_EXPORT
#define FLUTTER_EXPORT
Definition: flutter_export.h:23
flutter_windows.h
FlutterDesktopViewControllerRef
struct FlutterDesktopViewController * FlutterDesktopViewControllerRef
Definition: flutter_windows.h:25
FlutterDesktopEngineRef
struct FlutterDesktopEngine * FlutterDesktopEngineRef
Definition: flutter_windows.h:33
FlutterDesktopEngineCreateViewController
FLUTTER_EXPORT FlutterDesktopViewControllerRef FlutterDesktopEngineCreateViewController(FlutterDesktopEngineRef engine, const FlutterDesktopViewControllerProperties *properties)
Definition: flutter_windows.cc:128
FlutterDesktopEngineRegisterPlatformViewType
FLUTTER_EXPORT void FlutterDesktopEngineRegisterPlatformViewType(FlutterDesktopEngineRef engine, const char *view_type_name, FlutterPlatformViewTypeEntry view_type)
Definition: flutter_windows.cc:288
FlutterDesktopEngineForId
FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopEngineForId(int64_t engine_id)
Definition: flutter_windows.cc:200
FlutterPlatformViewFactory
HWND(* FlutterPlatformViewFactory)(const FlutterPlatformViewCreationParameters *)
Definition: flutter_windows_internal.h:54
PlatformViewId
int64_t PlatformViewId
Definition: flutter_windows_internal.h:42
FlutterDesktopViewControllerProperties
Definition: flutter_windows_internal.h:18
FlutterDesktopViewControllerProperties::width
int width
Definition: flutter_windows_internal.h:20
FlutterDesktopViewControllerProperties::height
int height
Definition: flutter_windows_internal.h:23
FlutterPlatformViewCreationParameters
Definition: flutter_windows_internal.h:44
FlutterPlatformViewCreationParameters::platform_view_id
PlatformViewId platform_view_id
Definition: flutter_windows_internal.h:51
FlutterPlatformViewCreationParameters::user_data
void * user_data
Definition: flutter_windows_internal.h:50
FlutterPlatformViewCreationParameters::parent_window
HWND parent_window
Definition: flutter_windows_internal.h:46
FlutterPlatformViewCreationParameters::platform_view_type
const char * platform_view_type
Definition: flutter_windows_internal.h:47
FlutterPlatformViewCreationParameters::struct_size
size_t struct_size
Definition: flutter_windows_internal.h:45
FlutterPlatformViewTypeEntry
Definition: flutter_windows_internal.h:57
FlutterPlatformViewTypeEntry::struct_size
size_t struct_size
Definition: flutter_windows_internal.h:58
FlutterPlatformViewTypeEntry::user_data
void * user_data
Definition: flutter_windows_internal.h:60
FlutterPlatformViewTypeEntry::factory
FlutterPlatformViewFactory factory
Definition: flutter_windows_internal.h:59