Flutter Engine
The Flutter Engine
windows_proc_table.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/windows_proc_table.h"
6
7#include <WinUser.h>
8#include <dwmapi.h>
9
10namespace flutter {
11
13 user32_ = fml::NativeLibrary::Create("user32.dll");
14 get_pointer_type_ =
15 user32_->ResolveFunction<GetPointerType_*>("GetPointerType");
16}
17
19 user32_ = nullptr;
20}
21
23 POINTER_INPUT_TYPE* pointer_type) const {
24 if (!get_pointer_type_.has_value()) {
25 return FALSE;
26 }
27
28 return get_pointer_type_.value()(pointer_id, pointer_type);
29}
30
32 PULONG count,
33 PZZWSTR languages,
34 PULONG length) const {
35 return ::GetThreadPreferredUILanguages(flags, count, languages, length);
36}
37
39 HIGHCONTRAST high_contrast = {.cbSize = sizeof(HIGHCONTRAST)};
40 if (!::SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(HIGHCONTRAST),
41 &high_contrast, 0)) {
42 return false;
43 }
44
45 return high_contrast.dwFlags & HCF_HIGHCONTRASTON;
46}
47
49 BOOL composition_enabled;
50 if (SUCCEEDED(::DwmIsCompositionEnabled(&composition_enabled))) {
51 return composition_enabled;
52 }
53
54 return true;
55}
56
58 return ::DwmFlush();
59}
60
61} // namespace flutter
int count
Definition: FontMgrTest.cpp:50
virtual HRESULT DwmFlush() const
virtual BOOL GetPointerType(UINT32 pointer_id, POINTER_INPUT_TYPE *pointer_type) const
virtual bool GetHighContrastEnabled() const
virtual bool DwmIsCompositionEnabled() const
virtual LRESULT GetThreadPreferredUILanguages(DWORD flags, PULONG count, PZZWSTR languages, PULONG length) const
const std::optional< T > ResolveFunction(const char *symbol)
static fml::RefPtr< NativeLibrary > Create(const char *path)
FlutterSemanticsFlag flags
size_t length
return FALSE
int BOOL
Definition: windows_types.h:37
#define SUCCEEDED(hr)
LONG_PTR LRESULT
Definition: windows_types.h:61
unsigned long DWORD
Definition: windows_types.h:22