Flutter Engine
The Flutter Engine
shell
platform
windows
event_watcher.cc
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
#include "flutter/shell/platform/windows/event_watcher.h"
6
7
namespace
flutter
{
8
9
EventWatcher::EventWatcher
(
std::function
<
void
()>
callback
)
10
: callback_(
callback
) {
11
handle_ =
CreateEvent
(NULL,
TRUE
,
FALSE
, NULL);
12
13
RegisterWaitForSingleObject(&handle_for_wait_, handle_, &CallbackForWait,
14
reinterpret_cast<
void
*
>
(
this
), INFINITE,
15
WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD);
16
}
17
18
EventWatcher::~EventWatcher
() {
19
UnregisterWait(handle_for_wait_);
20
CloseHandle(handle_);
21
}
22
23
HANDLE
EventWatcher::GetHandle
() {
24
return
handle_;
25
}
26
27
// static
28
VOID
CALLBACK
EventWatcher::CallbackForWait(
PVOID
context,
BOOLEAN
) {
29
EventWatcher
*
self
=
reinterpret_cast<
EventWatcher
*
>
(context);
30
ResetEvent(
self
->handle_);
31
self
->callback_();
32
}
33
34
}
// namespace flutter
self
return self
Definition:
FlutterTextureRegistryRelay.mm:19
flutter::EventWatcher
Definition:
event_watcher.h:17
flutter::EventWatcher::~EventWatcher
~EventWatcher()
Definition:
event_watcher.cc:18
flutter::EventWatcher::GetHandle
HANDLE GetHandle()
Definition:
event_watcher.cc:23
flutter::EventWatcher::EventWatcher
EventWatcher(std::function< void()> callback)
Definition:
event_watcher.cc:9
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition:
fl_key_channel_responder.cc:120
TRUE
return TRUE
Definition:
fl_pixel_buffer_texture_test.cc:53
function
Dart_NativeFunction function
Definition:
fuchsia.cc:51
FALSE
return FALSE
Definition:
mock_text_input_plugin.cc:23
flutter
Definition:
asset_manager.cc:10
PVOID
void * PVOID
Definition:
windows_types.h:35
BOOLEAN
BYTE BOOLEAN
Definition:
windows_types.h:39
CreateEvent
#define CreateEvent
Definition:
windows_types.h:250
VOID
#define VOID
Definition:
windows_types.h:27
HANDLE
void * HANDLE
Definition:
windows_types.h:36
CALLBACK
#define CALLBACK
Definition:
windows_types.h:216
Generated on Sun Jun 23 2024 21:55:18 for Flutter Engine by
1.9.4