Flutter Windows Embedder
windows_proc_table.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_WINDOWS_PROC_TABLE_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_WINDOWS_PROC_TABLE_H_
7 
8 #include <optional>
9 
10 #include "flutter/fml/macros.h"
11 #include "flutter/fml/native_library.h"
12 
13 namespace flutter {
14 
15 // Lookup table for Windows APIs that aren't available on all versions of
16 // Windows, or for mocking Windows API calls.
18  public:
20  virtual ~WindowsProcTable();
21 
22  // Retrieves the pointer type for a specified pointer.
23  //
24  // Used to react differently to touch or pen inputs. Returns false on failure.
25  // Available in Windows 8 and newer, otherwise returns false.
26  virtual BOOL GetPointerType(UINT32 pointer_id,
27  POINTER_INPUT_TYPE* pointer_type);
28 
29  // Get the preferred languages for the thread, and optionally the process,
30  // and system, in that order, depending on the flags.
31  // See
32  // https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getthreadpreferreduilanguages
33  virtual LRESULT GetThreadPreferredUILanguages(DWORD flags,
34  PULONG count,
35  PZZWSTR languages,
36  PULONG length) const;
37 
38  private:
39  using GetPointerType_ = BOOL __stdcall(UINT32 pointerId,
40  POINTER_INPUT_TYPE* pointerType);
41 
42  // The User32.dll library, used to resolve functions at runtime.
43  fml::RefPtr<fml::NativeLibrary> user32_;
44 
45  std::optional<GetPointerType_*> get_pointer_type_;
46 
47  FML_DISALLOW_COPY_AND_ASSIGN(WindowsProcTable);
48 };
49 
50 } // namespace flutter
51 
52 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_WINDOWS_PROC_TABLE_H_
flutter::WindowsProcTable::GetPointerType
virtual BOOL GetPointerType(UINT32 pointer_id, POINTER_INPUT_TYPE *pointer_type)
Definition: windows_proc_table.cc:19
flutter::WindowsProcTable::~WindowsProcTable
virtual ~WindowsProcTable()
Definition: windows_proc_table.cc:15
flutter::WindowsProcTable::WindowsProcTable
WindowsProcTable()
Definition: windows_proc_table.cc:9
flutter
Definition: accessibility_bridge_windows.cc:11
flutter::WindowsProcTable::GetThreadPreferredUILanguages
virtual LRESULT GetThreadPreferredUILanguages(DWORD flags, PULONG count, PZZWSTR languages, PULONG length) const
Definition: windows_proc_table.cc:28
flutter::WindowsProcTable
Definition: windows_proc_table.h:17