Flutter Engine
The Flutter Engine
event_watcher.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_EVENT_WATCHER_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_EVENT_WATCHER_H_
7
8#include <Windows.h>
9
10#include <functional>
11
12#include "flutter/fml/macros.h"
13
14namespace flutter {
15
16// A win32 `HANDLE` wrapper for use as a one-time callback.
18 public:
19 explicit EventWatcher(std::function<void()> callback);
21
22 // Returns `HANDLE`, which can be used to register an event listener.
24
25 private:
26 static VOID CALLBACK CallbackForWait(PVOID context, BOOLEAN);
27
28 std::function<void()> callback_;
29
30 HANDLE handle_;
31 HANDLE handle_for_wait_;
32
33 FML_DISALLOW_COPY_AND_ASSIGN(EventWatcher);
34};
35
36} // namespace flutter
37
38#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_EVENT_WATCHER_H_
EventWatcher(std::function< void()> callback)
Definition: event_watcher.cc:9
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Dart_NativeFunction function
Definition: fuchsia.cc:51
void * PVOID
Definition: windows_types.h:35
BYTE BOOLEAN
Definition: windows_types.h:39
#define VOID
Definition: windows_types.h:27
void * HANDLE
Definition: windows_types.h:36
#define CALLBACK