Flutter Engine
The Flutter Engine
Classes | Typedefs | Functions
flutter_windows.h File Reference
#include <dxgi.h>
#include <stddef.h>
#include <stdint.h>
#include <windows.h>
#include "flutter_export.h"
#include "flutter_messenger.h"
#include "flutter_plugin_registrar.h"

Go to the source code of this file.

Classes

struct  FlutterDesktopEngineProperties
 

Typedefs

typedef void(* VoidCallback) (void *)
 
typedef struct FlutterDesktopViewController * FlutterDesktopViewControllerRef
 
typedef struct FlutterDesktopView * FlutterDesktopViewRef
 
typedef struct FlutterDesktopEngine * FlutterDesktopEngineRef
 
typedef int64_t FlutterDesktopViewId
 
typedef bool(* FlutterDesktopWindowProcCallback) (HWND, UINT, WPARAM, LPARAM, void *, LRESULT *result)
 

Functions

FLUTTER_EXPORT FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate (int width, int height, FlutterDesktopEngineRef engine)
 
FLUTTER_EXPORT void FlutterDesktopViewControllerDestroy (FlutterDesktopViewControllerRef controller)
 
FLUTTER_EXPORT FlutterDesktopViewId FlutterDesktopViewControllerGetViewId (FlutterDesktopViewControllerRef view_controller)
 
FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopViewControllerGetEngine (FlutterDesktopViewControllerRef controller)
 
FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewControllerGetView (FlutterDesktopViewControllerRef controller)
 
FLUTTER_EXPORT void FlutterDesktopViewControllerForceRedraw (FlutterDesktopViewControllerRef controller)
 
FLUTTER_EXPORT bool FlutterDesktopViewControllerHandleTopLevelWindowProc (FlutterDesktopViewControllerRef controller, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
 
FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopEngineCreate (const FlutterDesktopEngineProperties *engine_properties)
 
FLUTTER_EXPORT bool FlutterDesktopEngineDestroy (FlutterDesktopEngineRef engine)
 
FLUTTER_EXPORT bool FlutterDesktopEngineRun (FlutterDesktopEngineRef engine, const char *entry_point)
 
FLUTTER_EXPORT uint64_t FlutterDesktopEngineProcessMessages (FlutterDesktopEngineRef engine)
 
FLUTTER_EXPORT void FlutterDesktopEngineReloadSystemFonts (FlutterDesktopEngineRef engine)
 
FLUTTER_EXPORT FlutterDesktopPluginRegistrarRef FlutterDesktopEngineGetPluginRegistrar (FlutterDesktopEngineRef engine, const char *plugin_name)
 
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger (FlutterDesktopEngineRef engine)
 
FLUTTER_EXPORT FlutterDesktopTextureRegistrarRef FlutterDesktopEngineGetTextureRegistrar (FlutterDesktopEngineRef engine)
 
FLUTTER_EXPORT void FlutterDesktopEngineSetNextFrameCallback (FlutterDesktopEngineRef engine, VoidCallback callback, void *user_data)
 
FLUTTER_EXPORT HWND FlutterDesktopViewGetHWND (FlutterDesktopViewRef view)
 
FLUTTER_EXPORT IDXGIAdapter * FlutterDesktopViewGetGraphicsAdapter (FlutterDesktopViewRef view)
 
FLUTTER_EXPORT bool FlutterDesktopEngineProcessExternalWindowMessage (FlutterDesktopEngineRef engine, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
 
FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetView (FlutterDesktopPluginRegistrarRef registrar)
 
FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetViewById (FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopViewId view_id)
 
FLUTTER_EXPORT void FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate (FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate, void *user_data)
 
FLUTTER_EXPORT void FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate (FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopWindowProcCallback delegate)
 
FLUTTER_EXPORT UINT FlutterDesktopGetDpiForHWND (HWND hwnd)
 
FLUTTER_EXPORT UINT FlutterDesktopGetDpiForMonitor (HMONITOR monitor)
 
FLUTTER_EXPORT void FlutterDesktopResyncOutputStreams ()
 

Typedef Documentation

◆ FlutterDesktopEngineRef

typedef struct FlutterDesktopEngine* FlutterDesktopEngineRef

Definition at line 33 of file flutter_windows.h.

◆ FlutterDesktopViewControllerRef

typedef struct FlutterDesktopViewController* FlutterDesktopViewControllerRef

Definition at line 25 of file flutter_windows.h.

◆ FlutterDesktopViewId

typedef int64_t FlutterDesktopViewId

Definition at line 36 of file flutter_windows.h.

◆ FlutterDesktopViewRef

typedef struct FlutterDesktopView* FlutterDesktopViewRef

Definition at line 29 of file flutter_windows.h.

◆ FlutterDesktopWindowProcCallback

typedef bool(* FlutterDesktopWindowProcCallback) (HWND, UINT, WPARAM, LPARAM, void *, LRESULT *result)

Definition at line 245 of file flutter_windows.h.

◆ VoidCallback

typedef void(* VoidCallback) (void *)

Definition at line 21 of file flutter_windows.h.

Function Documentation

◆ FlutterDesktopEngineCreate()

FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopEngineCreate ( const FlutterDesktopEngineProperties engine_properties)

Definition at line 94 of file stub_flutter_windows_api.cc.

95 {
97 return s_stub_implementation->EngineCreate(*engine_properties);
98 }
99 return nullptr;
100}
virtual FlutterDesktopEngineRef EngineCreate(const FlutterDesktopEngineProperties &engine_properties)
static flutter::testing::StubFlutterWindowsApi * s_stub_implementation

◆ FlutterDesktopEngineDestroy()

FLUTTER_EXPORT bool FlutterDesktopEngineDestroy ( FlutterDesktopEngineRef  engine)

Definition at line 102 of file stub_flutter_windows_api.cc.

102 {
105 }
106 return true;
107}

◆ FlutterDesktopEngineGetMessenger()

FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger ( FlutterDesktopEngineRef  engine)

Definition at line 145 of file stub_flutter_windows_api.cc.

146 {
147 // The stub ignores this, so just return an arbitrary non-zero value.
148 return reinterpret_cast<FlutterDesktopMessengerRef>(2);
149}

◆ FlutterDesktopEngineGetPluginRegistrar()

FLUTTER_EXPORT FlutterDesktopPluginRegistrarRef FlutterDesktopEngineGetPluginRegistrar ( FlutterDesktopEngineRef  engine,
const char *  plugin_name 
)

Definition at line 138 of file stub_flutter_windows_api.cc.

140 {
141 // The stub ignores this, so just return an arbitrary non-zero value.
142 return reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
143}

◆ FlutterDesktopEngineGetTextureRegistrar()

FLUTTER_EXPORT FlutterDesktopTextureRegistrarRef FlutterDesktopEngineGetTextureRegistrar ( FlutterDesktopEngineRef  engine)

Definition at line 151 of file stub_flutter_windows_api.cc.

152 {
153 // The stub ignores this, so just return an arbitrary non-zero value.
154 return reinterpret_cast<FlutterDesktopTextureRegistrarRef>(3);
155}
struct FlutterDesktopTextureRegistrar * FlutterDesktopTextureRegistrarRef

◆ FlutterDesktopEngineProcessExternalWindowMessage()

FLUTTER_EXPORT bool FlutterDesktopEngineProcessExternalWindowMessage ( FlutterDesktopEngineRef  engine,
HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam,
LRESULT result 
)

Definition at line 171 of file stub_flutter_windows_api.cc.

177 {
180 engine, hwnd, message, wparam, lparam, result);
181 }
182 return false;
183}
virtual bool EngineProcessExternalWindowMessage(FlutterDesktopEngineRef engine, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)
FlutterEngine engine
Definition: main.cc:68
GAsyncResult * result
Win32Message message

◆ FlutterDesktopEngineProcessMessages()

FLUTTER_EXPORT uint64_t FlutterDesktopEngineProcessMessages ( FlutterDesktopEngineRef  engine)

Definition at line 117 of file stub_flutter_windows_api.cc.

117 {
120 }
121 return 0;
122}

◆ FlutterDesktopEngineReloadSystemFonts()

FLUTTER_EXPORT void FlutterDesktopEngineReloadSystemFonts ( FlutterDesktopEngineRef  engine)

◆ FlutterDesktopEngineRun()

FLUTTER_EXPORT bool FlutterDesktopEngineRun ( FlutterDesktopEngineRef  engine,
const char *  entry_point 
)

Definition at line 109 of file stub_flutter_windows_api.cc.

110 {
112 return s_stub_implementation->EngineRun(entry_point);
113 }
114 return true;
115}
virtual bool EngineRun(const char *entry_point)

◆ FlutterDesktopEngineSetNextFrameCallback()

FLUTTER_EXPORT void FlutterDesktopEngineSetNextFrameCallback ( FlutterDesktopEngineRef  engine,
VoidCallback  callback,
void *  user_data 
)

Definition at line 124 of file stub_flutter_windows_api.cc.

126 {
129 }
130}
virtual void EngineSetNextFrameCallback(VoidCallback callback, void *user_data)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
void * user_data

◆ FlutterDesktopGetDpiForHWND()

FLUTTER_EXPORT UINT FlutterDesktopGetDpiForHWND ( HWND  hwnd)

Definition at line 316 of file flutter_windows.cc.

316 {
317 return flutter::GetDpiForHWND(hwnd);
318}
UINT GetDpiForHWND(HWND hwnd)
Definition: dpi_utils.cc:130

◆ FlutterDesktopGetDpiForMonitor()

FLUTTER_EXPORT UINT FlutterDesktopGetDpiForMonitor ( HMONITOR  monitor)

Definition at line 320 of file flutter_windows.cc.

320 {
321 return flutter::GetDpiForMonitor(monitor);
322}
UINT GetDpiForMonitor(HMONITOR monitor)
Definition: dpi_utils.cc:134

◆ FlutterDesktopPluginRegistrarGetView()

FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetView ( FlutterDesktopPluginRegistrarRef  registrar)

Definition at line 195 of file stub_flutter_windows_api.cc.

196 {
199 }
200 return nullptr;
201}
virtual FlutterDesktopViewRef PluginRegistrarGetView()

◆ FlutterDesktopPluginRegistrarGetViewById()

FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopPluginRegistrarGetViewById ( FlutterDesktopPluginRegistrarRef  registrar,
FlutterDesktopViewId  view_id 
)

Definition at line 203 of file stub_flutter_windows_api.cc.

205 {
208 }
209 return nullptr;
210}
virtual FlutterDesktopViewRef PluginRegistrarGetViewById(FlutterDesktopViewId view_id)

◆ FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate()

FLUTTER_EXPORT void FlutterDesktopPluginRegistrarRegisterTopLevelWindowProcDelegate ( FlutterDesktopPluginRegistrarRef  registrar,
FlutterDesktopWindowProcCallback  delegate,
void *  user_data 
)

Definition at line 212 of file stub_flutter_windows_api.cc.

215 {
219 user_data);
220 }
221}
virtual void PluginRegistrarRegisterTopLevelWindowProcDelegate(FlutterDesktopWindowProcCallback delegate, void *user_data)

◆ FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate()

FLUTTER_EXPORT void FlutterDesktopPluginRegistrarUnregisterTopLevelWindowProcDelegate ( FlutterDesktopPluginRegistrarRef  registrar,
FlutterDesktopWindowProcCallback  delegate 
)

Definition at line 223 of file stub_flutter_windows_api.cc.

225 {
229 }
230}
virtual void PluginRegistrarUnregisterTopLevelWindowProcDelegate(FlutterDesktopWindowProcCallback delegate)

◆ FlutterDesktopResyncOutputStreams()

FLUTTER_EXPORT void FlutterDesktopResyncOutputStreams ( )

Definition at line 324 of file flutter_windows.cc.

324 {
325 FILE* unused;
326 if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
327 _dup2(_fileno(stdout), 1);
328 }
329 if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
330 _dup2(_fileno(stdout), 2);
331 }
332 std::ios::sync_with_stdio();
333}
static bool unused

◆ FlutterDesktopViewControllerCreate()

FLUTTER_EXPORT FlutterDesktopViewControllerRef FlutterDesktopViewControllerCreate ( int  width,
int  height,
FlutterDesktopEngineRef  engine 
)

Definition at line 38 of file stub_flutter_windows_api.cc.

41 {
44 }
45 return nullptr;
46}
virtual FlutterDesktopViewControllerRef ViewControllerCreate(int width, int height, FlutterDesktopEngineRef engine)
int32_t height
int32_t width

◆ FlutterDesktopViewControllerDestroy()

FLUTTER_EXPORT void FlutterDesktopViewControllerDestroy ( FlutterDesktopViewControllerRef  controller)

◆ FlutterDesktopViewControllerForceRedraw()

FLUTTER_EXPORT void FlutterDesktopViewControllerForceRedraw ( FlutterDesktopViewControllerRef  controller)

◆ FlutterDesktopViewControllerGetEngine()

FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopViewControllerGetEngine ( FlutterDesktopViewControllerRef  controller)

Definition at line 61 of file stub_flutter_windows_api.cc.

62 {
63 // The stub ignores this, so just return an arbitrary non-zero value.
64 return reinterpret_cast<FlutterDesktopEngineRef>(1);
65}

◆ FlutterDesktopViewControllerGetView()

FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewControllerGetView ( FlutterDesktopViewControllerRef  controller)

Definition at line 67 of file stub_flutter_windows_api.cc.

68 {
69 // The stub ignores this, so just return an arbitrary non-zero value.
70 return reinterpret_cast<FlutterDesktopViewRef>(1);
71}
struct FlutterDesktopView * FlutterDesktopViewRef

◆ FlutterDesktopViewControllerGetViewId()

FLUTTER_EXPORT FlutterDesktopViewId FlutterDesktopViewControllerGetViewId ( FlutterDesktopViewControllerRef  view_controller)

Definition at line 55 of file stub_flutter_windows_api.cc.

56 {
57 // The stub ignores this, so just return an arbitrary non-zero value.
58 return static_cast<FlutterDesktopViewId>(1);
59}
int64_t FlutterDesktopViewId

◆ FlutterDesktopViewControllerHandleTopLevelWindowProc()

FLUTTER_EXPORT bool FlutterDesktopViewControllerHandleTopLevelWindowProc ( FlutterDesktopViewControllerRef  controller,
HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam,
LRESULT result 
)

Definition at line 80 of file stub_flutter_windows_api.cc.

86 {
89 hwnd, message, wparam, lparam, result);
90 }
91 return false;
92}
virtual bool ViewControllerHandleTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, LRESULT *result)

◆ FlutterDesktopViewGetGraphicsAdapter()

FLUTTER_EXPORT IDXGIAdapter * FlutterDesktopViewGetGraphicsAdapter ( FlutterDesktopViewRef  view)

Definition at line 164 of file stub_flutter_windows_api.cc.

164 {
167 }
168 return nullptr;
169}

◆ FlutterDesktopViewGetHWND()

FLUTTER_EXPORT HWND FlutterDesktopViewGetHWND ( FlutterDesktopViewRef  view)

Definition at line 157 of file stub_flutter_windows_api.cc.

157 {
160 }
161 return reinterpret_cast<HWND>(-1);
162}