1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
24 #include <tools/solar.h>
25 #include <vcl/outdev.hxx>
26 #include <vcl/timer.hxx>
27 #include <vcl/inputctx.hxx>
28 #include <vcl/pointr.hxx>
29 #include <tools/wintypes.hxx>
30 #include <vcl/vclevent.hxx>
31 #include <com/sun/star/uno/Reference.hxx>
32 #include <cppuhelper/weakref.hxx>
34 #include <vcl/salnativewidgets.hxx>
40 struct ImplAccessibleInfos
;
47 class ImplDevFontList
;
57 namespace accessibility
{
79 namespace datatransfer
{
85 class XDropTargetListener
;
86 class XDragGestureRecognizer
;
92 struct ControlLayoutData
;
100 long ImplWindowFrameProc( Window
* pInst
, SalFrame
* pFrame
, sal_uInt16 nEvent
, const void* pEvent
);
106 #define WINDOW_HITTEST_INSIDE ((sal_uInt16)0x0001)
107 #define WINDOW_HITTEST_TRANSPARENT ((sal_uInt16)0x0002)
115 OUString
* mpExtOldText
;
116 sal_uInt16
* mpExtOldAttrAry
;
117 Rectangle
* mpCursorRect
;
118 long mnCursorExtWidth
;
120 Rectangle
* mpCompositionCharRects
;
121 long mnCompositionCharRects
;
122 Rectangle
* mpFocusRect
;
123 Rectangle
* mpTrackRect
;
124 sal_uInt16 mnTrackFlags
;
125 sal_uInt16 mnIsTopWindow
;
126 sal_Bool mbMouseOver
; // tracks mouse over for native widget paint effect
127 sal_Bool mbEnableNativeWidget
; // toggle native widget rendering
128 ::std::list
< Window
* >
132 // -------------------
133 // - ImplOverlapData -
134 // -------------------
136 struct ImplOverlapData
138 VirtualDevice
* mpSaveBackDev
; // Gesicherte Hintergrund-Bitmap
139 Region
* mpSaveBackRgn
; // Gesicherte Region, was invalidiert werden muss
140 Window
* mpNextBackWin
; // Naechstes Fenster mit Hintergrund-Sicherung
141 sal_uIntPtr mnSaveBackSize
; // Groesse Bitmap fuer Hintergrund-Sicherung
142 sal_Bool mbSaveBack
; // sal_True: Background sichern
143 sal_uInt8 mnTopLevel
; // Level for Overlap-Window
152 Timer maPaintTimer
; // paint timer
153 Timer maResizeTimer
; // resize timer
154 InputContext maOldInputContext
; // Last set Input Context
155 Window
* mpNextFrame
; // next frame window
156 Window
* mpFirstOverlap
; // first overlap window
157 Window
* mpFocusWin
; // focus window (is also set, when frame doesn't have the focous)
158 Window
* mpMouseMoveWin
; // last window, where MouseMove() called
159 Window
* mpMouseDownWin
; // last window, where MouseButtonDown() called
160 Window
* mpFirstBackWin
; // Erstes Overlap-Window mit Hintergrund-Sicherung
161 ::std::vector
<Window
*> maOwnerDrawList
; // List of system windows with owner draw decoration
162 ImplDevFontList
* mpFontList
; // Font-List for this frame
163 ImplFontCache
* mpFontCache
; // Font-Cache for this frame
164 sal_Int32 mnDPIX
; // Original Screen Resolution
165 sal_Int32 mnDPIY
; // Original Screen Resolution
166 ImplMapRes maMapUnitRes
; // for LogicUnitToPixel
167 sal_uIntPtr mnAllSaveBackSize
; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
168 sal_uIntPtr mnFocusId
; // FocusId for PostUserLink
169 sal_uIntPtr mnMouseMoveId
; // MoveId for PostUserLink
170 long mnLastMouseX
; // last x mouse position
171 long mnLastMouseY
; // last y mouse position
172 long mnBeforeLastMouseX
; // last but one x mouse position
173 long mnBeforeLastMouseY
; // last but one y mouse position
174 long mnFirstMouseX
; // first x mouse position by mousebuttondown
175 long mnFirstMouseY
; // first y mouse position by mousebuttondown
176 long mnLastMouseWinX
; // last x mouse position, rel. to pMouseMoveWin
177 long mnLastMouseWinY
; // last y mouse position, rel. to pMouseMoveWin
178 sal_uInt16 mnModalMode
; // frame based modal count (app based makes no sense anymore)
179 sal_uIntPtr mnMouseDownTime
; // mouse button down time for double click
180 sal_uInt16 mnClickCount
; // mouse click count
181 sal_uInt16 mnFirstMouseCode
; // mouse code by mousebuttondown
182 sal_uInt16 mnMouseCode
; // mouse code
183 sal_uInt16 mnMouseMode
; // mouse mode
184 MapUnit meMapUnit
; // last MapUnit for LogicUnitToPixel
185 sal_Bool mbHasFocus
; // focus
186 sal_Bool mbInMouseMove
; // is MouseMove on stack
187 sal_Bool mbMouseIn
; // is Mouse inside the frame
188 sal_Bool mbStartDragCalled
; // is command startdrag called
189 sal_Bool mbNeedSysWindow
; // set, when FrameSize <= IMPL_MIN_NEEDSYSWIN
190 sal_Bool mbMinimized
; // set, when FrameSize <= 0
191 sal_Bool mbStartFocusState
; // FocusState, beim abschicken des Events
192 sal_Bool mbInSysObjFocusHdl
; // Innerhalb vom GetFocus-Handler eines SysChildren
193 sal_Bool mbInSysObjToTopHdl
; // Innerhalb vom ToTop-Handler eines SysChildren
194 sal_Bool mbSysObjFocus
; // Hat ein SysChild den Focus
196 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragSource
> mxDragSource
;
197 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTarget
> mxDropTarget
;
198 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetListener
> mxDropTargetListener
;
199 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> mxClipboard
;
200 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> mxSelection
;
202 sal_Bool mbInternalDragGestureRecognizer
;
205 // -----------------------
206 // - ImplAccessibleInfos -
207 // -----------------------
209 struct ImplAccessibleInfos
211 sal_uInt16 nAccessibleRole
;
212 String
* pAccessibleName
;
213 String
* pAccessibleDescription
;
214 Window
* pLabeledByWindow
;
215 Window
* pLabelForWindow
;
216 Window
* pMemberOfWindow
;
218 ImplAccessibleInfos();
219 ~ImplAccessibleInfos();
227 enum AlwaysInputMode
{ AlwaysInputNone
= 0, AlwaysInputEnabled
= 1, AlwaysInputDisabled
=2 };
232 WindowImpl( WindowType
);
235 ImplWinData
* mpWinData
;
236 ImplOverlapData
* mpOverlapData
;
237 ImplFrameData
* mpFrameData
;
240 Window
* mpFrameWindow
;
241 Window
* mpOverlapWindow
;
242 Window
* mpBorderWindow
;
243 Window
* mpClientWindow
;
245 Window
* mpRealParent
;
246 Window
* mpFirstChild
;
248 Window
* mpFirstOverlap
;
249 Window
* mpLastOverlap
;
252 Window
* mpNextOverlap
;
253 Window
* mpLastFocusWindow
;
254 Window
* mpDlgCtrlDownWindow
;
255 VclEventListeners maEventListeners
;
256 VclEventListeners maChildEventListeners
;
258 // The canvas interface for this VCL window. Is persistent after the first GetCanvas() call
259 ::com::sun::star::uno::WeakReference
< ::com::sun::star::rendering::XCanvas
> mxCanvas
;
261 ImplDelData
* mpFirstDel
;
268 Color maControlForeground
;
269 Color maControlBackground
;
270 sal_Int32 mnLeftBorder
;
271 sal_Int32 mnTopBorder
;
272 sal_Int32 mnRightBorder
;
273 sal_Int32 mnBottomBorder
;
274 sal_Int32 mnWidthRequest
;
275 sal_Int32 mnHeightRequest
;
282 XubString maHelpText
;
283 XubString maQuickHelpText
;
284 InputContext maInputContext
;
285 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
> mxWindowPeer
;
286 ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> mxAccessible
;
287 ::boost::shared_ptr
< VclSizeGroup
> m_xSizeGroup
;
288 ::std::vector
< FixedText
* > m_aMnemonicLabels
;
289 ImplAccessibleInfos
* mpAccessibleInfos
;
290 VCLXWindow
* mpVCLXWindow
;
291 Region maWinRegion
; // region to 'shape' the VCL window (frame coordinates)
292 Region maWinClipRegion
; // the (clipping) region that finally corresponds to the VCL window (frame coordinates)
293 Region maInvalidateRegion
; // region that has to be redrawn (frame coordinates)
294 Region
* mpChildClipRegion
; // child clip region if CLIPCHILDREN is set (frame coordinates)
295 Region
* mpPaintRegion
; // only set during Paint() method call (window coordinates)
298 WinBits mnExtendedStyle
;
299 WinBits mnPrevExtendedStyle
;
301 ControlPart mnNativeBackground
;
302 sal_uInt16 mnWaitCount
;
303 sal_uInt16 mnPaintFlags
;
304 sal_uInt16 mnGetFocusFlags
;
305 sal_uInt16 mnParentClipMode
;
306 sal_uInt16 mnActivateMode
;
307 sal_uInt16 mnDlgCtrlFlags
;
308 sal_uInt16 mnLockCount
;
309 AlwaysInputMode meAlwaysInputMode
;
312 VclPackType mePackType
;
314 sal_Int32 mnGridHeight
;
315 sal_Int32 mnGridLeftAttach
;
316 sal_Int32 mnGridTopAttach
;
317 sal_Int32 mnGridWidth
;
318 sal_Int32 mnBorderWidth
;
319 sal_Int32 mnMarginLeft
;
320 sal_Int32 mnMarginRight
;
321 sal_Int32 mnMarginTop
;
322 sal_Int32 mnMarginBottom
;
343 mbChildPtrOverwrite
:1,
357 mbWaitSystemResize
:1,
358 mbInitWinClipRegion
:1,
363 mbChildTransparent
:1,
364 mbPaintTransparent
:1,
365 mbMouseTransparent
:1,
370 mbNativeFocusVisible
:1,
373 mbControlForeground
:1,
374 mbControlBackground
:1,
377 mbCompoundControlHasFocus
:1,
384 mbCreatedWithToolkit
:1,
387 mbSuppressAccessibilityEvents
:1,
388 mbMenuFloatingWindow
:1,
389 mbDrawSelectionBackground
:1,
390 mbIsInTaskPaneList
:1,
391 mbToolbarFloatingWindow
:1,
392 mbCallHandlersDuringInputDisabled
:1,
400 mbIsThemingEnabled
:1;
402 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> mxDNDListenerContainer
;
409 long ImplHandleMouseEvent( Window
* pWindow
, sal_uInt16 nSVEvent
, sal_Bool bMouseLeave
,
410 long nX
, long nY
, sal_uIntPtr nMsgTime
,
411 sal_uInt16 nCode
, sal_uInt16 nMode
);
412 void ImplHandleResize( Window
* pWindow
, long nNewWidth
, long nNewHeight
);
414 #endif // _SV_WINDOW_H
416 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */