4 * Copyright 2021 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WIN32U_PRIVATE
22 #define __WINE_WIN32U_PRIVATE
30 #include "wine/gdi_driver.h"
31 #include "wine/unixlib.h"
32 #include "wine/debug.h"
33 #include "wine/server.h"
37 /* win32u functions */
38 INT (WINAPI
*pNtGdiAbortDoc
)( HDC hdc
);
39 BOOL (WINAPI
*pNtGdiAbortPath
)( HDC hdc
);
40 BOOL (WINAPI
*pNtGdiAlphaBlend
)( HDC hdc_dst
, int x_dst
, int y_dst
, int width_dst
, int height_dst
,
41 HDC hdc_src
, int x_src
, int y_src
, int width_src
, int height_src
,
42 BLENDFUNCTION blend_function
, HANDLE xform
);
43 BOOL (WINAPI
*pNtGdiAngleArc
)( HDC hdc
, INT x
, INT y
, DWORD radius
, FLOAT start_angle
,
45 BOOL (WINAPI
*pNtGdiArcInternal
)( UINT type
, HDC hdc
, INT left
, INT top
, INT right
, INT bottom
,
46 INT xstart
, INT ystart
, INT xend
, INT yend
);
47 BOOL (WINAPI
*pNtGdiBeginPath
)( HDC hdc
);
48 BOOL (WINAPI
*pNtGdiBitBlt
)( HDC hdc_dst
, INT x_dst
, INT y_dst
, INT width
, INT height
, HDC hdc_src
,
49 INT x_src
, INT y_src
, DWORD rop
, DWORD bk_color
, FLONG fl
);
50 BOOL (WINAPI
*pNtGdiCloseFigure
)( HDC hdc
);
51 BOOL (WINAPI
*pNtGdiComputeXformCoefficients
)( HDC hdc
);
52 HBITMAP (WINAPI
*pNtGdiCreateCompatibleBitmap
)( HDC hdc
, INT width
, INT height
);
53 HDC (WINAPI
*pNtGdiCreateCompatibleDC
)( HDC hdc
);
54 HBITMAP (WINAPI
*pNtGdiCreateDIBitmapInternal
)( HDC hdc
, INT width
, INT height
, DWORD init
,
55 const void *bits
, const BITMAPINFO
*data
,
56 UINT coloruse
, UINT max_info
, UINT max_bits
,
57 ULONG flags
, HANDLE xform
);
58 HDC (WINAPI
*pNtGdiCreateMetafileDC
)( HDC hdc
);
59 NTSTATUS (WINAPI
*pNtGdiDdDDICheckVidPnExclusiveOwnership
)( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP
*desc
);
60 NTSTATUS (WINAPI
*pNtGdiDdDDICloseAdapter
)( const D3DKMT_CLOSEADAPTER
*desc
);
61 NTSTATUS (WINAPI
*pNtGdiDdDDICreateDCFromMemory
)( D3DKMT_CREATEDCFROMMEMORY
*desc
);
62 NTSTATUS (WINAPI
*pNtGdiDdDDIDestroyDCFromMemory
)( const D3DKMT_DESTROYDCFROMMEMORY
*desc
);
63 NTSTATUS (WINAPI
*pNtGdiDdDDIDestroyDevice
)( const D3DKMT_DESTROYDEVICE
*desc
);
64 NTSTATUS (WINAPI
*pNtGdiDdDDIEscape
)( const D3DKMT_ESCAPE
*desc
);
65 NTSTATUS (WINAPI
*pNtGdiDdDDIOpenAdapterFromDeviceName
)( D3DKMT_OPENADAPTERFROMDEVICENAME
*desc
);
66 NTSTATUS (WINAPI
*pNtGdiDdDDIOpenAdapterFromLuid
)( D3DKMT_OPENADAPTERFROMLUID
*desc
);
67 NTSTATUS (WINAPI
*pNtGdiDdDDIQueryVideoMemoryInfo
)( D3DKMT_QUERYVIDEOMEMORYINFO
*desc
);
68 NTSTATUS (WINAPI
*pNtGdiDdDDISetVidPnSourceOwner
)( const D3DKMT_SETVIDPNSOURCEOWNER
*desc
);
69 BOOL (WINAPI
*pNtGdiDeleteObjectApp
)( HGDIOBJ obj
);
70 LONG (WINAPI
*pNtGdiDoPalette
)( HGDIOBJ handle
, WORD start
, WORD count
, void *entries
,
71 DWORD func
, BOOL inbound
);
72 BOOL (WINAPI
*pNtGdiEllipse
)( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
);
73 INT (WINAPI
*pNtGdiEndDoc
)(HDC hdc
);
74 BOOL (WINAPI
*pNtGdiEndPath
)( HDC hdc
);
75 INT (WINAPI
*pNtGdiEndPage
)( HDC hdc
);
76 BOOL (WINAPI
*pNtGdiEnumFonts
)( HDC hdc
, ULONG type
, ULONG win32_compat
, ULONG face_name_len
,
77 const WCHAR
*face_name
, ULONG charset
, ULONG
*count
, void *buf
);
78 INT (WINAPI
*pNtGdiExcludeClipRect
)( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
);
79 INT (WINAPI
*pNtGdiExtEscape
)( HDC hdc
, WCHAR
*driver
, INT driver_id
, INT escape
, INT input_size
,
80 const char *input
, INT output_size
, char *output
);
81 BOOL (WINAPI
*pNtGdiExtFloodFill
)( HDC hdc
, INT x
, INT y
, COLORREF color
, UINT type
);
82 BOOL (WINAPI
*pNtGdiExtTextOutW
)( HDC hdc
, INT x
, INT y
, UINT flags
, const RECT
*rect
,
83 const WCHAR
*str
, UINT count
, const INT
*dx
, DWORD cp
);
84 INT (WINAPI
*pNtGdiExtSelectClipRgn
)( HDC hdc
, HRGN region
, INT mode
);
85 BOOL (WINAPI
*pNtGdiFillPath
)( HDC hdc
);
86 BOOL (WINAPI
*pNtGdiFillRgn
)( HDC hdc
, HRGN hrgn
, HBRUSH hbrush
);
87 BOOL (WINAPI
*pNtGdiFontIsLinked
)( HDC hdc
);
88 BOOL (WINAPI
*pNtGdiFrameRgn
)( HDC hdc
, HRGN hrgn
, HBRUSH brush
, INT width
, INT height
);
89 BOOL (WINAPI
*pNtGdiGetAndSetDCDword
)( HDC hdc
, UINT method
, DWORD value
, DWORD
*result
);
90 INT (WINAPI
*pNtGdiGetAppClipBox
)( HDC hdc
, RECT
*rect
);
91 UINT (WINAPI
*pNtGdiGetBoundsRect
)( HDC hdc
, RECT
*rect
, UINT flags
);
92 BOOL (WINAPI
*pNtGdiGetCharABCWidthsW
)( HDC hdc
, UINT first
, UINT last
, WCHAR
*chars
,
93 ULONG flags
, void *buffer
);
94 BOOL (WINAPI
*pNtGdiGetCharWidthW
)( HDC hdc
, UINT first_char
, UINT last_char
, WCHAR
*chars
,
95 ULONG flags
, void *buffer
);
96 BOOL (WINAPI
*pNtGdiGetCharWidthInfo
)( HDC hdc
, struct char_width_info
*info
);
97 INT (WINAPI
*pNtGdiGetDIBitsInternal
)( HDC hdc
, HBITMAP hbitmap
, UINT startscan
, UINT lines
,
98 void *bits
, BITMAPINFO
*info
, UINT coloruse
,
99 UINT max_bits
, UINT max_info
);
100 INT (WINAPI
*pNtGdiGetDeviceCaps
)( HDC hdc
, INT cap
);
101 BOOL (WINAPI
*pNtGdiGetDeviceGammaRamp
)( HDC hdc
, void *ptr
);
102 DWORD (WINAPI
*pNtGdiGetFontData
)( HDC hdc
, DWORD table
, DWORD offset
, void *buffer
, DWORD length
);
103 DWORD (WINAPI
*pNtGdiGetFontUnicodeRanges
)( HDC hdc
, GLYPHSET
*lpgs
);
104 DWORD (WINAPI
*pNtGdiGetGlyphIndicesW
)( HDC hdc
, const WCHAR
*str
, INT count
,
105 WORD
*indices
, DWORD flags
);
106 DWORD (WINAPI
*pNtGdiGetGlyphOutline
)( HDC hdc
, UINT ch
, UINT format
, GLYPHMETRICS
*metrics
,
107 DWORD size
, void *buffer
, const MAT2
*mat2
,
108 BOOL ignore_rotation
);
109 DWORD (WINAPI
*pNtGdiGetKerningPairs
)( HDC hdc
, DWORD count
, KERNINGPAIR
*kern_pair
);
110 COLORREF (WINAPI
*pNtGdiGetNearestColor
)( HDC hdc
, COLORREF color
);
111 UINT (WINAPI
*pNtGdiGetOutlineTextMetricsInternalW
)( HDC hdc
, UINT cbData
,
112 OUTLINETEXTMETRICW
*otm
, ULONG opts
);
113 COLORREF (WINAPI
*pNtGdiGetPixel
)( HDC hdc
, INT x
, INT y
);
114 INT (WINAPI
*pNtGdiGetRandomRgn
)( HDC hdc
, HRGN region
, INT code
);
115 BOOL (WINAPI
*pNtGdiGetRasterizerCaps
)( RASTERIZER_STATUS
*status
, UINT size
);
116 BOOL (WINAPI
*pNtGdiGetRealizationInfo
)( HDC hdc
, struct font_realization_info
*info
);
117 UINT (WINAPI
*pNtGdiGetTextCharsetInfo
)( HDC hdc
, FONTSIGNATURE
*fs
, DWORD flags
);
118 BOOL (WINAPI
*pNtGdiGetTextExtentExW
)( HDC hdc
, const WCHAR
*str
, INT count
, INT max_ext
,
119 INT
*nfit
, INT
*dxs
, SIZE
*size
, UINT flags
);
120 INT (WINAPI
*pNtGdiGetTextFaceW
)( HDC hdc
, INT count
, WCHAR
*name
, BOOL alias_name
);
121 BOOL (WINAPI
*pNtGdiGetTextMetricsW
)( HDC hdc
, TEXTMETRICW
*metrics
, ULONG flags
);
122 BOOL (WINAPI
*pNtGdiGradientFill
)( HDC hdc
, TRIVERTEX
*vert_array
, ULONG nvert
,
123 void *grad_array
, ULONG ngrad
, ULONG mode
);
124 INT (WINAPI
*pNtGdiIntersectClipRect
)( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
);
125 BOOL (WINAPI
*pNtGdiInvertRgn
)( HDC hdc
, HRGN hrgn
);
126 BOOL (WINAPI
*pNtGdiLineTo
)( HDC hdc
, INT x
, INT y
);
127 BOOL (WINAPI
*pNtGdiMaskBlt
)( HDC hdc
, INT x_dst
, INT y_dst
, INT width_dst
, INT height_dst
,
128 HDC hdc_src
, INT x_src
, INT y_src
, HBITMAP mask
,
129 INT x_mask
, INT y_mask
, DWORD rop
, DWORD bk_color
);
130 BOOL (WINAPI
*pNtGdiModifyWorldTransform
)( HDC hdc
, const XFORM
*xform
, DWORD mode
);
131 BOOL (WINAPI
*pNtGdiMoveTo
)( HDC hdc
, INT x
, INT y
, POINT
*pt
);
132 INT (WINAPI
*pNtGdiOffsetClipRgn
)( HDC hdc
, INT x
, INT y
);
133 HDC (WINAPI
*pNtGdiOpenDCW
)( UNICODE_STRING
*device
, const DEVMODEW
*devmode
,
134 UNICODE_STRING
*output
, ULONG type
, BOOL is_display
,
135 HANDLE hspool
, DRIVER_INFO_2W
*driver_info
, void *pdev
);
136 BOOL (WINAPI
*pNtGdiPatBlt
)( HDC hdc
, INT left
, INT top
, INT width
, INT height
, DWORD rop
);
137 BOOL (WINAPI
*pNtGdiPlgBlt
)( HDC hdc
, const POINT
*point
, HDC hdc_src
, INT x_src
, INT y_src
,
138 INT width
, INT height
, HBITMAP mask
, INT x_mask
, INT y_mask
,
140 BOOL (WINAPI
*pNtGdiPolyDraw
)(HDC hdc
, const POINT
*points
, const BYTE
*types
, DWORD count
);
141 ULONG (WINAPI
*pNtGdiPolyPolyDraw
)( HDC hdc
, const POINT
*points
, const ULONG
*counts
,
142 DWORD count
, UINT function
);
143 BOOL (WINAPI
*pNtGdiPtVisible
)( HDC hdc
, INT x
, INT y
);
144 BOOL (WINAPI
*pNtGdiRectVisible
)( HDC hdc
, const RECT
*rect
);
145 BOOL (WINAPI
*pNtGdiRectangle
)( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
);
146 BOOL (WINAPI
*pNtGdiResetDC
)( HDC hdc
, const DEVMODEW
*devmode
, BOOL
*banding
,
147 DRIVER_INFO_2W
*driver_info
, void *dev
);
148 BOOL (WINAPI
*pNtGdiResizePalette
)( HPALETTE palette
, UINT count
);
149 BOOL (WINAPI
*pNtGdiRestoreDC
)( HDC hdc
, INT level
);
150 BOOL (WINAPI
*pNtGdiRoundRect
)( HDC hdc
, INT left
, INT top
, INT right
,
151 INT bottom
, INT ell_width
, INT ell_height
);
152 BOOL (WINAPI
*pNtGdiScaleViewportExtEx
)( HDC hdc
, INT x_num
, INT x_denom
,
153 INT y_num
, INT y_denom
, SIZE
*size
);
154 BOOL (WINAPI
*pNtGdiScaleWindowExtEx
)( HDC hdc
, INT x_num
, INT x_denom
,
155 INT y_num
, INT y_denom
, SIZE
*size
);
156 HGDIOBJ (WINAPI
*pNtGdiSelectBitmap
)( HDC hdc
, HGDIOBJ handle
);
157 HGDIOBJ (WINAPI
*pNtGdiSelectBrush
)( HDC hdc
, HGDIOBJ handle
);
158 BOOL (WINAPI
*pNtGdiSelectClipPath
)( HDC hdc
, INT mode
);
159 HGDIOBJ (WINAPI
*pNtGdiSelectFont
)( HDC hdc
, HGDIOBJ handle
);
160 HGDIOBJ (WINAPI
*pNtGdiSelectPen
)( HDC hdc
, HGDIOBJ handle
);
161 UINT (WINAPI
*pNtGdiSetBoundsRect
)( HDC hdc
, const RECT
*rect
, UINT flags
);
162 INT (WINAPI
*pNtGdiSetDIBitsToDeviceInternal
)( HDC hdc
, INT x_dst
, INT y_dst
, DWORD cx
,
163 DWORD cy
, INT x_src
, INT y_src
, UINT startscan
,
164 UINT lines
, const void *bits
, const BITMAPINFO
*bmi
,
165 UINT coloruse
, UINT max_bits
, UINT max_info
,
166 BOOL xform_coords
, HANDLE xform
);
167 BOOL (WINAPI
*pNtGdiSetDeviceGammaRamp
)( HDC hdc
, void *ptr
);
168 DWORD (WINAPI
*pNtGdiSetLayout
)( HDC hdc
, LONG wox
, DWORD layout
);
169 COLORREF (WINAPI
*pNtGdiSetPixel
)( HDC hdc
, INT x
, INT y
, COLORREF color
);
170 UINT (WINAPI
*pNtGdiSetSystemPaletteUse
)( HDC hdc
, UINT use
);
171 INT (WINAPI
*pNtGdiStartDoc
)( HDC hdc
, const DOCINFOW
*doc
, BOOL
*banding
, INT job
);
172 INT (WINAPI
*pNtGdiStartPage
)( HDC hdc
);
173 BOOL (WINAPI
*pNtGdiStretchBlt
)( HDC hdc
, INT x_dst
, INT y_dst
, INT width_dst
, INT height_dst
,
174 HDC hdc_src
, INT x_src
, INT y_src
, INT width_src
, INT height_src
,
175 DWORD rop
, COLORREF bk_color
);
176 INT (WINAPI
*pNtGdiStretchDIBitsInternal
)( HDC hdc
, INT x_dst
, INT y_dst
, INT width_dst
,
177 INT height_dst
, INT x_src
, INT y_src
, INT width_src
,
178 INT height_src
, const void *bits
, const BITMAPINFO
*bmi
,
179 UINT coloruse
, DWORD rop
, UINT max_info
, UINT max_bits
,
181 BOOL (WINAPI
*pNtGdiStrokeAndFillPath
)( HDC hdc
);
182 BOOL (WINAPI
*pNtGdiStrokePath
)( HDC hdc
);
183 BOOL (WINAPI
*pNtGdiTransparentBlt
)( HDC hdc
, int x_dst
, int y_dst
, int width_dst
, int height_dst
,
184 HDC hdc_src
, int x_src
, int y_src
, int width_src
, int height_src
,
186 BOOL (WINAPI
*pNtGdiUnrealizeObject
)( HGDIOBJ obj
);
187 BOOL (WINAPI
*pNtGdiUpdateColors
)( HDC hdc
);
188 BOOL (WINAPI
*pNtGdiWidenPath
)( HDC hdc
);
189 BOOL (WINAPI
*pNtUserDrawCaptionTemp
)( HWND hwnd
, HDC hdc
, const RECT
*rect
, HFONT font
,
190 HICON icon
, const WCHAR
*str
, UINT flags
);
191 DWORD (WINAPI
*pNtUserDrawMenuBarTemp
)( HWND hwnd
, HDC hdc
, RECT
*rect
, HMENU handle
, HFONT font
);
192 BOOL (WINAPI
*pNtUserEndPaint
)( HWND hwnd
, const PAINTSTRUCT
*ps
);
193 INT (WINAPI
*pNtUserExcludeUpdateRgn
)( HDC hdc
, HWND hwnd
);
194 INT (WINAPI
*pNtUserReleaseDC
)( HWND hwnd
, HDC hdc
);
195 BOOL (WINAPI
*pNtUserScrollDC
)( HDC hdc
, INT dx
, INT dy
, const RECT
*scroll
, const RECT
*clip
,
196 HRGN ret_update_rgn
, RECT
*update_rect
);
197 HPALETTE (WINAPI
*pNtUserSelectPalette
)( HDC hdc
, HPALETTE hpal
, WORD bkg
);
198 BOOL (WINAPI
*pNtUserUpdateLayeredWindow
)( HWND hwnd
, HDC hdc_dst
, const POINT
*pts_dst
,
199 const SIZE
*size
, HDC hdc_src
, const POINT
*pts_src
,
200 COLORREF key
, const BLENDFUNCTION
*blend
,
201 DWORD flags
, const RECT
*dirty
);
203 /* Wine-specific functions */
204 INT (WINAPI
*pSetDIBits
)( HDC hdc
, HBITMAP hbitmap
, UINT startscan
,
205 UINT lines
, const void *bits
, const BITMAPINFO
*info
,
207 BOOL (CDECL
*get_brush_bitmap_info
)( HBRUSH handle
, BITMAPINFO
*info
, void *bits
, UINT
*usage
);
208 BOOL (CDECL
*get_file_outline_text_metric
)( const WCHAR
*path
, OUTLINETEXTMETRICW
*otm
);
209 BOOL (CDECL
*get_icm_profile
)( HDC hdc
, BOOL allow_default
, DWORD
*size
, WCHAR
*filename
);
210 BOOL (CDECL
*wine_send_input
)( HWND hwnd
, const INPUT
*input
, const RAWINPUT
*rawinput
);
214 extern UINT
enum_clipboard_formats( UINT format
) DECLSPEC_HIDDEN
;
215 extern void release_clipboard_owner( HWND hwnd
) DECLSPEC_HIDDEN
;
218 extern HICON
alloc_cursoricon_handle( BOOL is_icon
) DECLSPEC_HIDDEN
;
219 extern BOOL
get_clip_cursor( RECT
*rect
) DECLSPEC_HIDDEN
;
220 extern ULONG_PTR
get_icon_param( HICON handle
) DECLSPEC_HIDDEN
;
221 extern ULONG_PTR
set_icon_param( HICON handle
, ULONG_PTR param
) DECLSPEC_HIDDEN
;
224 extern struct window_surface dummy_surface DECLSPEC_HIDDEN
;
225 extern BOOL
create_dib_surface( HDC hdc
, const BITMAPINFO
*info
) DECLSPEC_HIDDEN
;
226 extern void create_offscreen_window_surface( const RECT
*visible_rect
,
227 struct window_surface
**surface
) DECLSPEC_HIDDEN
;
228 extern void erase_now( HWND hwnd
, UINT rdw_flags
) DECLSPEC_HIDDEN
;
229 extern void flush_window_surfaces( BOOL idle
) DECLSPEC_HIDDEN
;
230 extern void move_window_bits( HWND hwnd
, struct window_surface
*old_surface
,
231 struct window_surface
*new_surface
,
232 const RECT
*visible_rect
, const RECT
*old_visible_rect
,
233 const RECT
*window_rect
, const RECT
*valid_rects
) DECLSPEC_HIDDEN
;
234 extern void move_window_bits_parent( HWND hwnd
, HWND parent
, const RECT
*window_rect
,
235 const RECT
*valid_rects
) DECLSPEC_HIDDEN
;
236 extern void register_window_surface( struct window_surface
*old
,
237 struct window_surface
*new ) DECLSPEC_HIDDEN
;
240 extern LRESULT
default_window_proc( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
241 BOOL ansi
) DECLSPEC_HIDDEN
;
242 extern LRESULT
desktop_window_proc( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
243 extern BOOL
draw_menu_button( HWND hwnd
, HDC dc
, RECT
*r
, enum NONCLIENT_BUTTON_TYPE
, BOOL down
, BOOL grayed
) DECLSPEC_HIDDEN
;
244 extern BOOL
draw_frame_menu( HDC dc
, RECT
*r
, UINT flags
) DECLSPEC_HIDDEN
;
245 extern BOOL
draw_nc_sys_button( HWND hwnd
, HDC hdc
, BOOL down
) DECLSPEC_HIDDEN
;
246 extern BOOL
draw_rect_edge( HDC hdc
, RECT
*rc
, UINT uType
, UINT uFlags
, UINT width
) DECLSPEC_HIDDEN
;
247 extern void fill_rect( HDC dc
, const RECT
*rect
, HBRUSH hbrush
) DECLSPEC_HIDDEN
;
248 extern void get_sys_popup_pos( HWND hwnd
, RECT
*rect
) DECLSPEC_HIDDEN
;
249 extern LRESULT
handle_nc_hit_test( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
252 extern LRESULT
call_current_hook( HHOOK hhook
, INT code
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
253 extern LRESULT
call_hooks( INT id
, INT code
, WPARAM wparam
, LPARAM lparam
,
254 size_t lparam_size
) DECLSPEC_HIDDEN
;
255 extern BOOL
is_hooked( INT id
) DECLSPEC_HIDDEN
;
256 extern BOOL
unhook_windows_hook( INT id
, HOOKPROC proc
) DECLSPEC_HIDDEN
;
259 extern void cleanup_imm_thread(void) DECLSPEC_HIDDEN
;
260 extern HWND
get_default_ime_window( HWND hwnd
) DECLSPEC_HIDDEN
;
261 extern HIMC
get_default_input_context(void) DECLSPEC_HIDDEN
;
262 extern HIMC
get_window_input_context( HWND hwnd
) DECLSPEC_HIDDEN
;
263 extern BOOL
register_imm_window( HWND hwnd
) DECLSPEC_HIDDEN
;
264 extern void unregister_imm_window( HWND hwnd
) DECLSPEC_HIDDEN
;
267 extern BOOL
destroy_caret(void) DECLSPEC_HIDDEN
;
268 extern LONG global_key_state_counter DECLSPEC_HIDDEN
;
269 extern HWND
get_active_window(void) DECLSPEC_HIDDEN
;
270 extern HWND
get_capture(void) DECLSPEC_HIDDEN
;
271 extern BOOL
get_cursor_pos( POINT
*pt
) DECLSPEC_HIDDEN
;
272 extern HWND
get_focus(void) DECLSPEC_HIDDEN
;
273 extern DWORD
get_input_state(void) DECLSPEC_HIDDEN
;
274 extern HWND
get_progman_window(void) DECLSPEC_HIDDEN
;
275 extern HWND
get_shell_window(void) DECLSPEC_HIDDEN
;
276 extern HWND
get_taskman_window(void) DECLSPEC_HIDDEN
;
277 extern BOOL WINAPI
release_capture(void) DECLSPEC_HIDDEN
;
278 extern BOOL
set_capture_window( HWND hwnd
, UINT gui_flags
, HWND
*prev_ret
) DECLSPEC_HIDDEN
;
279 extern BOOL
set_caret_blink_time( unsigned int time
) DECLSPEC_HIDDEN
;
280 extern BOOL
set_caret_pos( int x
, int y
) DECLSPEC_HIDDEN
;
281 extern BOOL
set_foreground_window( HWND hwnd
, BOOL mouse
) DECLSPEC_HIDDEN
;
282 extern HWND
set_progman_window( HWND hwnd
) DECLSPEC_HIDDEN
;
283 extern HWND
set_taskman_window( HWND hwnd
) DECLSPEC_HIDDEN
;
284 extern void toggle_caret( HWND hwnd
) DECLSPEC_HIDDEN
;
285 extern void update_mouse_tracking_info( HWND hwnd
) DECLSPEC_HIDDEN
;
288 extern HMENU
create_menu( BOOL is_popup
) DECLSPEC_HIDDEN
;
289 extern BOOL
draw_menu_bar( HWND hwnd
) DECLSPEC_HIDDEN
;
290 extern UINT
draw_nc_menu_bar( HDC hdc
, RECT
*rect
, HWND hwnd
) DECLSPEC_HIDDEN
;
291 extern void end_menu( HWND hwnd
) DECLSPEC_HIDDEN
;
292 extern HMENU
get_menu( HWND hwnd
) DECLSPEC_HIDDEN
;
293 extern UINT
get_menu_bar_height( HWND hwnd
, UINT width
, INT org_x
, INT org_y
) DECLSPEC_HIDDEN
;
294 extern BOOL
get_menu_info( HMENU handle
, MENUINFO
*info
) DECLSPEC_HIDDEN
;
295 extern INT
get_menu_item_count( HMENU handle
) DECLSPEC_HIDDEN
;
296 extern UINT
get_menu_state( HMENU handle
, UINT item_id
, UINT flags
) DECLSPEC_HIDDEN
;
297 extern HMENU
get_window_sys_sub_menu( HWND hwnd
) DECLSPEC_HIDDEN
;
298 extern BOOL
is_menu( HMENU handle
) DECLSPEC_HIDDEN
;
299 extern HWND
is_menu_active(void) DECLSPEC_HIDDEN
;
300 extern LRESULT
popup_menu_window_proc( HWND hwnd
, UINT message
, WPARAM wparam
,
301 LPARAM lparam
) DECLSPEC_HIDDEN
;
302 extern BOOL
set_window_menu( HWND hwnd
, HMENU handle
) DECLSPEC_HIDDEN
;
303 extern void track_keyboard_menu_bar( HWND hwnd
, UINT wparam
, WCHAR ch
) DECLSPEC_HIDDEN
;
304 extern void track_mouse_menu_bar( HWND hwnd
, INT ht
, int x
, int y
) DECLSPEC_HIDDEN
;
307 extern BOOL
kill_system_timer( HWND hwnd
, UINT_PTR id
) DECLSPEC_HIDDEN
;
308 extern BOOL
reply_message_result( LRESULT result
) DECLSPEC_HIDDEN
;
309 extern NTSTATUS
send_hardware_message( HWND hwnd
, const INPUT
*input
, const RAWINPUT
*rawinput
,
310 UINT flags
) DECLSPEC_HIDDEN
;
311 extern LRESULT
send_internal_message_timeout( DWORD dest_pid
, DWORD dest_tid
, UINT msg
, WPARAM wparam
,
312 LPARAM lparam
, UINT flags
, UINT timeout
,
313 PDWORD_PTR res_ptr
) DECLSPEC_HIDDEN
;
314 extern LRESULT
send_message( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
315 extern BOOL
send_notify_message( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
, BOOL ansi
) DECLSPEC_HIDDEN
;
316 extern LRESULT
send_message_timeout( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
317 UINT flags
, UINT timeout
, BOOL ansi
) DECLSPEC_HIDDEN
;
320 extern BOOL
process_rawinput_message( MSG
*msg
, UINT hw_id
, const struct hardware_msg_data
*msg_data
) DECLSPEC_HIDDEN
;
321 extern BOOL
rawinput_device_get_usages( HANDLE handle
, USHORT
*usage_page
, USHORT
*usage
) DECLSPEC_HIDDEN
;
324 extern void draw_nc_scrollbar( HWND hwnd
, HDC hdc
, BOOL draw_horizontal
, BOOL draw_vertical
) DECLSPEC_HIDDEN
;
325 extern BOOL
get_scroll_info( HWND hwnd
, INT bar
, SCROLLINFO
*info
) DECLSPEC_HIDDEN
;
326 extern void handle_scroll_event( HWND hwnd
, INT bar
, UINT msg
, POINT pt
) DECLSPEC_HIDDEN
;
327 extern LRESULT
scroll_bar_window_proc( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
328 BOOL ansi
) DECLSPEC_HIDDEN
;
329 extern void set_standard_scroll_painted( HWND hwnd
, int bar
, BOOL painted
) DECLSPEC_HIDDEN
;
330 extern void track_scroll_bar( HWND hwnd
, int scrollbar
, POINT pt
) DECLSPEC_HIDDEN
;
333 extern BOOL enable_thunk_lock DECLSPEC_HIDDEN
;
334 extern HBRUSH
get_55aa_brush(void) DECLSPEC_HIDDEN
;
335 extern DWORD
get_dialog_base_units(void) DECLSPEC_HIDDEN
;
336 extern LONG
get_char_dimensions( HDC hdc
, TEXTMETRICW
*metric
, int *height
) DECLSPEC_HIDDEN
;
337 extern INT
get_display_depth( UNICODE_STRING
*name
) DECLSPEC_HIDDEN
;
338 extern RECT
get_display_rect( const WCHAR
*display
) DECLSPEC_HIDDEN
;
339 extern UINT
get_monitor_dpi( HMONITOR monitor
) DECLSPEC_HIDDEN
;
340 extern BOOL
get_monitor_info( HMONITOR handle
, MONITORINFO
*info
) DECLSPEC_HIDDEN
;
341 extern UINT
get_win_monitor_dpi( HWND hwnd
) DECLSPEC_HIDDEN
;
342 extern RECT
get_primary_monitor_rect( UINT dpi
) DECLSPEC_HIDDEN
;
343 extern DWORD
get_process_layout(void) DECLSPEC_HIDDEN
;
344 extern COLORREF
get_sys_color( int index
) DECLSPEC_HIDDEN
;
345 extern HBRUSH
get_sys_color_brush( unsigned int index
) DECLSPEC_HIDDEN
;
346 extern HPEN
get_sys_color_pen( unsigned int index
) DECLSPEC_HIDDEN
;
347 extern UINT
get_system_dpi(void) DECLSPEC_HIDDEN
;
348 extern int get_system_metrics( int index
) DECLSPEC_HIDDEN
;
349 extern UINT
get_thread_dpi(void) DECLSPEC_HIDDEN
;
350 extern DPI_AWARENESS
get_thread_dpi_awareness(void) DECLSPEC_HIDDEN
;
351 extern RECT
get_virtual_screen_rect( UINT dpi
) DECLSPEC_HIDDEN
;
352 extern BOOL
is_exiting_thread( DWORD tid
) DECLSPEC_HIDDEN
;
353 extern POINT
map_dpi_point( POINT pt
, UINT dpi_from
, UINT dpi_to
) DECLSPEC_HIDDEN
;
354 extern RECT
map_dpi_rect( RECT rect
, UINT dpi_from
, UINT dpi_to
) DECLSPEC_HIDDEN
;
355 extern BOOL
message_beep( UINT i
) DECLSPEC_HIDDEN
;
356 extern POINT
point_phys_to_win_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
357 extern POINT
point_thread_to_win_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
358 extern RECT
rect_thread_to_win_dpi( HWND hwnd
, RECT rect
) DECLSPEC_HIDDEN
;
359 extern HMONITOR
monitor_from_point( POINT pt
, UINT flags
, UINT dpi
) DECLSPEC_HIDDEN
;
360 extern HMONITOR
monitor_from_rect( const RECT
*rect
, UINT flags
, UINT dpi
) DECLSPEC_HIDDEN
;
361 extern HMONITOR
monitor_from_window( HWND hwnd
, UINT flags
, UINT dpi
) DECLSPEC_HIDDEN
;
362 extern void user_lock(void) DECLSPEC_HIDDEN
;
363 extern void user_unlock(void) DECLSPEC_HIDDEN
;
364 extern void user_check_not_lock(void) DECLSPEC_HIDDEN
;
368 extern HDWP
begin_defer_window_pos( INT count
) DECLSPEC_HIDDEN
;
369 extern BOOL
client_to_screen( HWND hwnd
, POINT
*pt
) DECLSPEC_HIDDEN
;
370 extern void destroy_thread_windows(void) DECLSPEC_HIDDEN
;
371 extern LRESULT
destroy_window( HWND hwnd
) DECLSPEC_HIDDEN
;
372 extern BOOL
enable_window( HWND hwnd
, BOOL enable
) DECLSPEC_HIDDEN
;
373 extern BOOL
get_client_rect( HWND hwnd
, RECT
*rect
) DECLSPEC_HIDDEN
;
374 extern HWND
get_desktop_window(void) DECLSPEC_HIDDEN
;
375 extern UINT
get_dpi_for_window( HWND hwnd
) DECLSPEC_HIDDEN
;
376 extern HWND
get_full_window_handle( HWND hwnd
) DECLSPEC_HIDDEN
;
377 extern HWND
get_parent( HWND hwnd
) DECLSPEC_HIDDEN
;
378 extern HWND
get_hwnd_message_parent(void) DECLSPEC_HIDDEN
;
379 extern DPI_AWARENESS_CONTEXT
get_window_dpi_awareness_context( HWND hwnd
) DECLSPEC_HIDDEN
;
380 extern MINMAXINFO
get_min_max_info( HWND hwnd
) DECLSPEC_HIDDEN
;
381 extern DWORD
get_window_context_help_id( HWND hwnd
) DECLSPEC_HIDDEN
;
382 extern HWND
get_window_relative( HWND hwnd
, UINT rel
) DECLSPEC_HIDDEN
;
383 extern DWORD
get_window_thread( HWND hwnd
, DWORD
*process
) DECLSPEC_HIDDEN
;
384 extern HWND
is_current_process_window( HWND hwnd
) DECLSPEC_HIDDEN
;
385 extern HWND
is_current_thread_window( HWND hwnd
) DECLSPEC_HIDDEN
;
386 extern BOOL
is_desktop_window( HWND hwnd
) DECLSPEC_HIDDEN
;
387 extern BOOL
is_iconic( HWND hwnd
) DECLSPEC_HIDDEN
;
388 extern BOOL
is_window_drawable( HWND hwnd
, BOOL icon
) DECLSPEC_HIDDEN
;
389 extern BOOL
is_window_enabled( HWND hwnd
) DECLSPEC_HIDDEN
;
390 extern BOOL
is_window_unicode( HWND hwnd
) DECLSPEC_HIDDEN
;
391 extern BOOL
is_window_visible( HWND hwnd
) DECLSPEC_HIDDEN
;
392 extern BOOL
is_zoomed( HWND hwnd
) DECLSPEC_HIDDEN
;
393 extern DWORD
get_window_long( HWND hwnd
, INT offset
) DECLSPEC_HIDDEN
;
394 extern ULONG_PTR
get_window_long_ptr( HWND hwnd
, INT offset
, BOOL ansi
) DECLSPEC_HIDDEN
;
395 extern BOOL
get_window_rect( HWND hwnd
, RECT
*rect
, UINT dpi
) DECLSPEC_HIDDEN
;
396 enum coords_relative
;
397 extern BOOL
get_window_rects( HWND hwnd
, enum coords_relative relative
, RECT
*window_rect
,
398 RECT
*client_rect
, UINT dpi
) DECLSPEC_HIDDEN
;
399 extern HWND
*list_window_children( HDESK desktop
, HWND hwnd
, UNICODE_STRING
*class,
400 DWORD tid
) DECLSPEC_HIDDEN
;
401 extern int map_window_points( HWND hwnd_from
, HWND hwnd_to
, POINT
*points
, UINT count
,
402 UINT dpi
) DECLSPEC_HIDDEN
;
403 extern void map_window_region( HWND from
, HWND to
, HRGN hrgn
) DECLSPEC_HIDDEN
;
404 extern BOOL
screen_to_client( HWND hwnd
, POINT
*pt
) DECLSPEC_HIDDEN
;
405 extern LONG_PTR
set_window_long( HWND hwnd
, INT offset
, UINT size
, LONG_PTR newval
,
406 BOOL ansi
) DECLSPEC_HIDDEN
;
407 extern BOOL
set_window_pos( WINDOWPOS
*winpos
, int parent_x
, int parent_y
) DECLSPEC_HIDDEN
;
408 extern ULONG
set_window_style( HWND hwnd
, ULONG set_bits
, ULONG clear_bits
) DECLSPEC_HIDDEN
;
409 extern BOOL
show_owned_popups( HWND owner
, BOOL show
) DECLSPEC_HIDDEN
;
410 extern void update_window_state( HWND hwnd
) DECLSPEC_HIDDEN
;
411 extern HWND
window_from_point( HWND hwnd
, POINT pt
, INT
*hittest
) DECLSPEC_HIDDEN
;
413 /* to release pointers retrieved by win_get_ptr */
414 static inline void release_win_ptr( struct tagWND
*ptr
)
419 extern void wrappers_init( unixlib_handle_t handle
) DECLSPEC_HIDDEN
;
420 extern void gdi_init(void) DECLSPEC_HIDDEN
;
421 extern NTSTATUS
callbacks_init( void *args
) DECLSPEC_HIDDEN
;
422 extern void winstation_init(void) DECLSPEC_HIDDEN
;
423 extern void sysparams_init(void) DECLSPEC_HIDDEN
;
424 extern int muldiv( int a
, int b
, int c
) DECLSPEC_HIDDEN
;
426 extern HKEY
reg_create_key( HKEY root
, const WCHAR
*name
, ULONG name_len
,
427 DWORD options
, DWORD
*disposition
) DECLSPEC_HIDDEN
;
428 extern HKEY
reg_open_hkcu_key( const char *name
) DECLSPEC_HIDDEN
;
429 extern HKEY
reg_open_key( HKEY root
, const WCHAR
*name
, ULONG name_len
) DECLSPEC_HIDDEN
;
430 extern ULONG
query_reg_value( HKEY hkey
, const WCHAR
*name
,
431 KEY_VALUE_PARTIAL_INFORMATION
*info
, ULONG size
) DECLSPEC_HIDDEN
;
432 extern ULONG
query_reg_ascii_value( HKEY hkey
, const char *name
,
433 KEY_VALUE_PARTIAL_INFORMATION
*info
, ULONG size
) DECLSPEC_HIDDEN
;
434 extern void set_reg_ascii_value( HKEY hkey
, const char *name
, const char *value
) DECLSPEC_HIDDEN
;
435 extern BOOL
set_reg_value( HKEY hkey
, const WCHAR
*name
, UINT type
, const void *value
,
436 DWORD count
) DECLSPEC_HIDDEN
;
437 extern BOOL
reg_delete_tree( HKEY parent
, const WCHAR
*name
, ULONG name_len
) DECLSPEC_HIDDEN
;
438 extern void reg_delete_value( HKEY hkey
, const WCHAR
*name
) DECLSPEC_HIDDEN
;
440 extern HKEY hkcu_key DECLSPEC_HIDDEN
;
442 extern const struct user_driver_funcs
*user_driver DECLSPEC_HIDDEN
;
444 static inline BOOL
set_ntstatus( NTSTATUS status
)
446 if (status
) RtlSetLastWin32Error( RtlNtStatusToDosError( status
));
450 static inline WCHAR
win32u_towupper( WCHAR ch
)
452 return RtlUpcaseUnicodeChar( ch
);
455 extern CPTABLEINFO ansi_cp DECLSPEC_HIDDEN
;
457 CPTABLEINFO
*get_cptable( WORD cp
) DECLSPEC_HIDDEN
;
458 const NLS_LOCALE_DATA
*get_locale_data( LCID lcid
) DECLSPEC_HIDDEN
;
459 extern BOOL
translate_charset_info( DWORD
*src
, CHARSETINFO
*cs
, DWORD flags
) DECLSPEC_HIDDEN
;
460 DWORD
win32u_mbtowc( CPTABLEINFO
*info
, WCHAR
*dst
, DWORD dstlen
, const char *src
,
461 DWORD srclen
) DECLSPEC_HIDDEN
;
462 DWORD
win32u_wctomb( CPTABLEINFO
*info
, char *dst
, DWORD dstlen
, const WCHAR
*src
,
463 DWORD srclen
) DECLSPEC_HIDDEN
;
464 DWORD
win32u_wctomb_size( CPTABLEINFO
*info
, const WCHAR
*src
, DWORD srclen
) DECLSPEC_HIDDEN
;
465 DWORD
win32u_mbtowc_size( CPTABLEINFO
*info
, const char *src
, DWORD srclen
) DECLSPEC_HIDDEN
;
467 static inline WCHAR
*win32u_wcsdup( const WCHAR
*str
)
469 DWORD size
= (lstrlenW( str
) + 1) * sizeof(WCHAR
);
470 WCHAR
*ret
= malloc( size
);
471 if (ret
) memcpy( ret
, str
, size
);
475 static inline WCHAR
*towstr( const char *str
)
477 DWORD len
= strlen( str
) + 1;
478 WCHAR
*ret
= malloc( len
* sizeof(WCHAR
) );
479 if (ret
) win32u_mbtowc( &ansi_cp
, ret
, len
, str
, len
);
483 #define towupper(c) win32u_towupper(c)
484 #define wcsdup(s) win32u_wcsdup(s)
486 static inline void ascii_to_unicode( WCHAR
*dst
, const char *src
, size_t len
)
488 while (len
--) *dst
++ = (unsigned char)*src
++;
491 static inline UINT
asciiz_to_unicode( WCHAR
*dst
, const char *src
)
494 while ((*p
++ = *src
++));
495 return (p
- dst
) * sizeof(WCHAR
);
498 static inline BOOL
is_win9x(void)
500 return NtCurrentTeb()->Peb
->OSPlatformId
== VER_PLATFORM_WIN32s
;
503 static inline ULONG_PTR
zero_bits(void)
506 return !NtCurrentTeb()->WowTebOffset
? 0 : 0x7fffffff;
512 static inline const char *debugstr_us( const UNICODE_STRING
*us
)
514 if (!us
) return "<null>";
515 return debugstr_wn( us
->Buffer
, us
->Length
/ sizeof(WCHAR
) );
518 static inline const char *debugstr_color( COLORREF color
)
520 if (color
& (1 << 24)) /* PALETTEINDEX */
521 return wine_dbg_sprintf( "PALETTEINDEX(%u)", LOWORD(color
) );
522 if (color
>> 16 == 0x10ff) /* DIBINDEX */
523 return wine_dbg_sprintf( "DIBINDEX(%u)", LOWORD(color
) );
524 return wine_dbg_sprintf( "RGB(%02x,%02x,%02x)", GetRValue(color
), GetGValue(color
), GetBValue(color
) );
527 #endif /* __WINE_WIN32U_PRIVATE */