OpenTTD Source 20241224-master-gf74b0cf984
|
Implementation of the Windows (GDI) video driver. More...
#include "../stdafx.h"
#include "../openttd.h"
#include "../error_func.h"
#include "../gfx_func.h"
#include "../os/windows/win32.h"
#include "../blitter/factory.hpp"
#include "../core/geometry_func.hpp"
#include "../core/math_func.hpp"
#include "../core/random_func.hpp"
#include "../texteff.hpp"
#include "../thread.h"
#include "../progress.h"
#include "../window_gui.h"
#include "../window_func.h"
#include "../framerate_type.h"
#include "../library_loader.h"
#include "win32_v.h"
#include <windows.h>
#include <imm.h>
#include <versionhelpers.h>
#include "../safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | Win32VkMapping |
Macros | |
#define | MAPVK_VK_TO_CHAR (2) |
#define | PM_QS_INPUT 0x20000 |
#define | WM_DPICHANGED 0x02E0 |
#define | AS(x, z) {x, 1, z} |
#define | AM(x, y, z, w) {x, y - x + 1, z} |
#define | WM_MOUSEWHEEL 0x020A |
#define | GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD(wparam)) |
Functions | |
static uint | MapWindowsKey (uint sym) |
static LRESULT | HandleCharMsg (uint keycode, char32_t charcode) |
Forward key presses to the window system. | |
static bool | DrawIMECompositionString () |
Should we draw the composition string ourself, i.e is this a normal IME? | |
static void | SetCompositionPos (HWND hwnd) |
Set position of the composition window to the caret position. | |
static void | SetCandidatePos (HWND hwnd) |
Set the position of the candidate window. | |
static LRESULT | HandleIMEComposition (HWND hwnd, WPARAM wParam, LPARAM lParam) |
Handle WM_IME_COMPOSITION messages. | |
static void | CancelIMEComposition (HWND hwnd) |
Clear the current composition string. | |
LRESULT CALLBACK | WndProcGdi (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
static void | RegisterWndClass () |
static void | FindResolutions (uint8_t bpp) |
static BOOL CALLBACK | MonitorEnumProc (HMONITOR hMonitor, HDC, LPRECT, LPARAM data) |
Variables | |
bool | _window_maximize |
static Dimension | _bck_resolution |
DWORD | _imm_props |
static Palette | _local_palette |
Current palette to use for drawing. | |
static const Win32VkMapping | _vk_mapping [] |
static const Dimension | default_resolutions [] |
static FVideoDriver_Win32GDI | iFVideoDriver_Win32GDI |
Implementation of the Windows (GDI) video driver.
Definition in file win32_v.cpp.
#define AM | ( | x, | |
y, | |||
z, | |||
w | |||
) | {x, y - x + 1, z} |
Definition at line 65 of file win32_v.cpp.
#define AS | ( | x, | |
z | |||
) | {x, 1, z} |
Definition at line 64 of file win32_v.cpp.
#define MAPVK_VK_TO_CHAR (2) |
Definition at line 35 of file win32_v.cpp.
#define PM_QS_INPUT 0x20000 |
Definition at line 39 of file win32_v.cpp.
#define WM_DPICHANGED 0x02E0 |
Definition at line 43 of file win32_v.cpp.
|
static |
Clear the current composition string.
Definition at line 391 of file win32_v.cpp.
References HandleTextInput().
Referenced by VideoDriver_Win32Base::EditBoxLostFocus().
|
static |
Should we draw the composition string ourself, i.e is this a normal IME?
Definition at line 269 of file win32_v.cpp.
Referenced by HandleIMEComposition().
|
static |
Definition at line 796 of file win32_v.cpp.
|
static |
Forward key presses to the window system.
Definition at line 242 of file win32_v.cpp.
References Debug, HandleKeypress(), Utf16DecodeSurrogate(), Utf16IsLeadSurrogate(), and Utf16IsTrailSurrogate().
|
static |
Handle WM_IME_COMPOSITION messages.
Definition at line 331 of file win32_v.cpp.
References convert_from_fs(), DrawIMECompositionString(), FS2OTTD(), HandleTextInput(), SetCompositionPos(), and Utf16IsLeadSurrogate().
|
static |
Definition at line 108 of file win32_v.cpp.
|
static |
Definition at line 937 of file win32_v.cpp.
|
static |
Definition at line 758 of file win32_v.cpp.
|
static |
Set the position of the candidate window.
Definition at line 297 of file win32_v.cpp.
References NWidgetBase::current_x, NWidgetBase::current_y, EditBoxInGlobalFocus(), Window::GetCaretPosition(), Window::height, Window::left, Window::nested_focus, NWidgetBase::pos_x, NWidgetBase::pos_y, Window::top, WC_CONSOLE, Window::width, and Window::window_class.
Referenced by VideoDriver_Win32Base::EditBoxLostFocus().
|
static |
Set position of the composition window to the caret position.
Definition at line 275 of file win32_v.cpp.
References EditBoxInGlobalFocus(), Window::GetCaretPosition(), Window::left, and Window::top.
Referenced by VideoDriver_Win32Base::EditBoxLostFocus(), and HandleIMEComposition().
LRESULT CALLBACK WndProcGdi | ( | HWND | hwnd, |
UINT | msg, | ||
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
Definition at line 400 of file win32_v.cpp.
|
static |
Definition at line 47 of file win32_v.cpp.
DWORD _imm_props |
Definition at line 48 of file win32_v.cpp.
|
static |
Current palette to use for drawing.
Definition at line 50 of file win32_v.cpp.
Referenced by VideoDriver_Win32Base::CheckPaletteAnim(), and VideoDriver_Win32GDI::Paint().
|
static |
Definition at line 67 of file win32_v.cpp.
bool _window_maximize |
Definition at line 46 of file win32_v.cpp.
|
static |
Definition at line 782 of file win32_v.cpp.
|
static |
Definition at line 1031 of file win32_v.cpp.