Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / win / wincomp.hxx
blob87aae83e9cfc52bde513ac9fcd6511e5e9cd70fe
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_INC_WIN_WINCOMP_HXX
21 #define INCLUDED_VCL_INC_WIN_WINCOMP_HXX
23 #include <string.h>
26 // Anpassungen fuer TypeChecking
28 inline HPEN SelectPen( HDC hDC, HPEN hPen )
30 return static_cast<HPEN>(SelectObject( hDC, static_cast<HGDIOBJ>(hPen) ));
33 inline void DeletePen( HPEN hPen )
35 DeleteObject( static_cast<HGDIOBJ>(hPen) );
38 inline HPEN GetStockPen( int nObject )
40 return static_cast<HPEN>(GetStockObject( nObject ));
43 inline HBRUSH SelectBrush( HDC hDC, HBRUSH hBrush )
45 return static_cast<HBRUSH>(SelectObject( hDC, static_cast<HGDIOBJ>(hBrush) ));
48 inline void DeleteBrush( HBRUSH hBrush )
50 DeleteObject( static_cast<HGDIOBJ>(hBrush) );
53 inline HBRUSH GetStockBrush( int nObject )
55 return static_cast<HBRUSH>(GetStockObject( nObject ));
58 inline HFONT SelectFont( HDC hDC, HFONT hFont )
60 return static_cast<HFONT>(SelectObject( hDC, static_cast<HGDIOBJ>(hFont) ));
63 inline void DeleteFont( HFONT hFont )
65 DeleteObject( static_cast<HGDIOBJ>(hFont) );
68 inline HFONT GetStockFont( int nObject )
70 return static_cast<HFONT>(GetStockObject( nObject ));
73 inline HBITMAP SelectBitmap( HDC hDC, HBITMAP hBitmap )
75 return static_cast<HBITMAP>(SelectObject( hDC, static_cast<HGDIOBJ>(hBitmap) ));
78 inline void DeleteBitmap( HBITMAP hBitmap )
80 DeleteObject( static_cast<HGDIOBJ>(hBitmap) );
83 inline void DeleteRegion( HRGN hRegion )
85 DeleteObject( static_cast<HGDIOBJ>(hRegion) );
88 inline HPALETTE GetStockPalette( int nObject )
90 return static_cast<HPALETTE>(GetStockObject( nObject ));
93 inline void DeletePalette( HPALETTE hPalette )
95 DeleteObject( static_cast<HGDIOBJ>(hPalette) );
98 inline void SetWindowStyle( HWND hWnd, DWORD nStyle )
100 SetWindowLong( hWnd, GWL_STYLE, nStyle );
103 inline DWORD GetWindowStyle( HWND hWnd )
105 return GetWindowLong( hWnd, GWL_STYLE );
108 inline void SetWindowExStyle( HWND hWnd, DWORD nStyle )
110 SetWindowLong( hWnd, GWL_EXSTYLE, nStyle );
113 inline DWORD GetWindowExStyle( HWND hWnd )
115 return GetWindowLong( hWnd, GWL_EXSTYLE );
118 inline BOOL IsMinimized( HWND hWnd )
120 return IsIconic( hWnd );
123 inline BOOL IsMaximized( HWND hWnd )
125 return IsZoomed( hWnd );
128 inline void SetWindowFont( HWND hWnd, HFONT hFont, BOOL bRedraw )
130 SendMessage( hWnd, WM_SETFONT, reinterpret_cast<WPARAM>(hFont), MAKELPARAM((UINT)bRedraw,0) );
133 inline HFONT GetWindowFont( HWND hWnd )
135 return reinterpret_cast<HFONT>(SendMessage( hWnd, WM_GETFONT, 0, 0 ));
138 inline void SetClassCursor( HWND hWnd, HCURSOR hCursor )
140 SetClassLongPtr( hWnd, GCLP_HCURSOR, reinterpret_cast<LONG_PTR>(hCursor) );
143 inline HCURSOR GetClassCursor( HWND hWnd )
145 return reinterpret_cast<HCURSOR>(GetClassLongPtr( hWnd, GCLP_HCURSOR ));
148 inline void SetClassIcon( HWND hWnd, HICON hIcon )
150 SetClassLongPtr( hWnd, GCLP_HICON, reinterpret_cast<LONG_PTR>(hIcon) );
153 inline HICON GetClassIcon( HWND hWnd )
155 return reinterpret_cast<HICON>(GetClassLongPtr( hWnd, GCLP_HICON ));
158 inline HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush )
160 return reinterpret_cast<HBRUSH>(SetClassLongPtr( hWnd, GCLP_HBRBACKGROUND, reinterpret_cast<LONG_PTR>(hBrush) ));
163 inline HBRUSH GetClassBrush( HWND hWnd )
165 return reinterpret_cast<HBRUSH>(GetClassLongPtr( hWnd, GCLP_HBRBACKGROUND ));
168 inline HINSTANCE GetWindowInstance( HWND hWnd )
170 return reinterpret_cast<HINSTANCE>(GetWindowLongPtr( hWnd, GWLP_HINSTANCE ));
174 #define MOUSEZ_CLASSNAME "MouseZ" // wheel window class
175 #define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title
177 #define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
178 #define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
180 #define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
182 #ifndef WHEEL_DELTA
183 #define WHEEL_DELTA 120
184 #endif
185 #ifndef WM_MOUSEWHEEL
186 #define WM_MOUSEWHEEL 0x020A
187 #endif
188 #ifndef SPI_GETWHEELSCROLLLINES
189 #define SPI_GETWHEELSCROLLLINES 104
190 #endif
191 #ifndef SPI_SETWHEELSCROLLLINES
192 #define SPI_SETWHEELSCROLLLINES 105
193 #endif
194 #ifndef WHEEL_PAGESCROLL
195 #define WHEEL_PAGESCROLL (UINT_MAX)
196 #endif
199 // - 5.0-Erweiterungen -
201 #ifndef COLOR_GRADIENTACTIVECAPTION
202 #define COLOR_GRADIENTACTIVECAPTION 27
203 #endif
204 #ifndef COLOR_GRADIENTINACTIVECAPTION
205 #define COLOR_GRADIENTINACTIVECAPTION 28
206 #endif
208 #ifndef SPI_GETFLATMENU
209 #define SPI_GETFLATMENU 0x1022
210 #endif
211 #ifndef COLOR_MENUBAR
212 #define COLOR_MENUBAR 30
213 #endif
214 #ifndef COLOR_MENUHILIGHT
215 #define COLOR_MENUHILIGHT 29
216 #endif
218 #ifndef CS_DROPSHADOW
219 #define CS_DROPSHADOW 0x00020000
220 #endif
222 // MT 12/03: From winuser.h, only needed in salframe.cxx
223 // Better change salframe.cxx to include winuser.h
225 #define WS_EX_LAYERED 0x00080000
227 #ifndef WM_UNICHAR
228 #define WM_UNICHAR 0x0109
229 #define UNICODE_NOCHAR 0xFFFF
230 #endif
232 #endif // INCLUDED_VCL_INC_WIN_WINCOMP_HXX
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */