Blender V4.3
GHOST_ImeWin32.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2010 The Chromium Authors. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#ifdef WITH_INPUT_IME
12
13# define WIN32_LEAN_AND_MEAN
14# include <windows.h>
15
16# include <string>
17
18# include "GHOST_Event.hh"
19# include "GHOST_Rect.hh"
20# include <vector>
21
22/* MSDN LOCALE_SISO639LANGNAME states maximum length of 9, including terminating null. */
23# define W32_ISO639_LEN 9
24
25class GHOST_EventIME : public GHOST_Event {
26 public:
33 GHOST_EventIME(uint64_t msec, GHOST_TEventType type, GHOST_IWindow *window, void *customdata)
34 : GHOST_Event(msec, type, window)
35 {
36 this->m_data = customdata;
37 }
38};
39
80
81/* This struct represents the status of an ongoing composition. */
82struct ImeComposition {
83 /* Represents the cursor position in the IME composition. */
84 int cursor_position;
85
86 /* Represents the position of the beginning of the selection */
87 int target_start;
88
89 /* Represents the position of the end of the selection */
90 int target_end;
91
100 int string_type;
101
102 /* Represents the string retrieved from IME (Input Method Editor) */
103 std::wstring ime_string;
104 std::vector<char> utf8_buf;
105 std::vector<unsigned char> format;
106};
107
124class GHOST_ImeWin32 {
125 public:
126 GHOST_ImeWin32();
127 ~GHOST_ImeWin32();
128
129 /* Retrieves whether or not there is an ongoing composition. */
130 bool is_composing() const
131 {
132 return is_composing_;
133 }
134
135 /* Retrieve the input language from Windows and store it. */
136 void UpdateInputLanguage();
137
138 BOOL IsLanguage(const char name[W32_ISO639_LEN]);
139
140 /* Saves the current conversion status. */
141 void UpdateConversionStatus(HWND window_handle);
142
143 /* Is the IME currently in conversion mode? */
144 bool IsEnglishMode();
145
146 /* Checks a key whether IME has to do handling. */
147 bool IsImeKeyEvent(char ascii, GHOST_TKey key);
148
155 void CreateImeWindow(HWND window_handle);
156
177 void SetImeWindowStyle(
178 HWND window_handle, UINT message, WPARAM wparam, LPARAM lparam, BOOL *handled);
179
186 void DestroyImeWindow(HWND window_handle);
187
194 void UpdateImeWindow(HWND window_handle);
195
203 void CleanupComposition(HWND window_handle);
204
213 void ResetComposition(HWND window_handle);
214
236 bool GetResult(HWND window_handle, LPARAM lparam, ImeComposition *composition);
237
259 bool GetComposition(HWND window_handle, LPARAM lparam, ImeComposition *composition);
260
283 void BeginIME(HWND window_handle, const GHOST_Rect &caret_rect, bool complete);
284
294 void EndIME(HWND window_handle);
295
297 void UpdateInfo(HWND window_handle);
298
300 void CheckFirst(HWND window_handle);
301
302 ImeComposition resultInfo, compInfo;
303 GHOST_TEventImeData eventImeData;
304
305 protected:
306 /* Determines whether or not the given attribute represents a target (a.k.a. a selection). */
307 bool IsTargetAttribute(char attribute) const
308 {
309 return (attribute == ATTR_TARGET_CONVERTED || attribute == ATTR_TARGET_NOTCONVERTED);
310 }
311
312 /* Retrieve the target area. */
313 void GetCaret(HIMC imm_context, LPARAM lparam, ImeComposition *composition);
314
315 /* Update the position of the IME windows. */
316 void MoveImeWindow(HWND window_handle, HIMC imm_context);
317
318 /* Complete the ongoing composition if it exists. */
319 void CompleteComposition(HWND window_handle, HIMC imm_context);
320
321 /* Retrieve a string from the IMM. */
322 bool GetString(HIMC imm_context, WPARAM lparam, int type, ImeComposition *composition);
323
324 private:
329 bool is_composing_;
330
331 /* Abbreviated ISO 639-1 name of the input language, such as "en" for English. */
332 char language_[W32_ISO639_LEN];
333
334 /* Current Conversion Mode Values. Retrieved with ImmGetConversionStatus. */
335 DWORD conversion_modes_;
336
337 /* Current Sentence Mode. Retrieved with ImmGetConversionStatus. */
338 DWORD sentence_mode_;
339
346 bool system_caret_;
347
348 /* The rectangle of the input caret retrieved from a renderer process. */
349 GHOST_Rect caret_rect_;
350
351 /* used for disable ime when start up */
352 bool is_first, is_enable;
353};
354
355#endif /* WITH_INPUT_IME */
GHOST_TEventType
GHOST_TKey
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color attribute
btAlignedObjectArray< btScalar > m_data
format
unsigned __int64 uint64_t
Definition stdint.h:90