VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxDockIconPreview.h@ 20554

Last change on this file since 20554 was 20374, checked in by vboxsync, 16 years ago

*: s/RT_\(BEGIN|END\)_DECLS/RT_C_DECLS_\1/g

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxDockIconPreview class declaration
5 */
6
7/*
8 * Copyright (C) 2009 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef ___VBoxDockIconPreview_h___
24#define ___VBoxDockIconPreview_h___
25
26#include "VBoxUtils-darwin.h"
27
28RT_C_DECLS_BEGIN
29void darwinCreateVBoxDockIconTileView (void);
30void darwinDestroyVBoxDockIconTileView (void);
31
32CGContextRef darwinBeginCGContextForApplicationDockTile (void);
33void darwinEndCGContextForApplicationDockTile (CGContextRef aContext);
34
35void darwinOverlayApplicationDockTileImage (CGImageRef pImage);
36void darwinRestoreApplicationDockTileImage (void);
37RT_C_DECLS_END
38
39#ifndef __OBJC__
40class VBoxConsoleWnd;
41class VBoxFrameBuffer;
42
43class QPixmap;
44
45class VBoxDockIconPreview
46{
47public:
48 VBoxDockIconPreview (VBoxConsoleWnd *aMainWnd, const QPixmap& aOverlayImage);
49 ~VBoxDockIconPreview();
50
51 void updateDockOverlay();
52 void updateDockPreview (CGImageRef aVMImage);
53 void updateDockPreview (VBoxFrameBuffer *aFrameBuffer);
54
55private:
56 inline void initPreviewImages();
57 inline void initOverlayData (int aBitmapByteCount);
58 inline CGImageRef stateImage() const;
59 void drawOverlayIcons (CGContextRef aContext);
60
61 /* Flipping is necessary cause the drawing context in Carbon is flipped by 180 degree */
62 inline CGRect flipRect (CGRect aRect) const { return ::darwinFlipCGRect (aRect, mDockIconRect); }
63 inline CGRect centerRect (CGRect aRect) const { return ::darwinCenterRectTo (aRect, mDockIconRect); }
64 inline CGRect centerRectTo (CGRect aRect, const CGRect& aToRect) const { return ::darwinCenterRectTo (aRect, aToRect); }
65
66 void updateDockPreviewImpl (CGContextRef aContext, CGImageRef aVMImage);
67
68 /* Private member vars */
69 VBoxConsoleWnd *mMainWnd;
70 const CGRect mDockIconRect;
71
72 CGImageRef mOverlayImage;
73 CGImageRef mDockMonitor;
74 CGImageRef mDockMonitorGlossy;
75
76 void *mBitmapData;
77
78 CGImageRef mStatePaused;
79 CGImageRef mStateSaving;
80 CGImageRef mStateRestoring;
81
82 CGRect mUpdateRect;
83 CGRect mMonitorRect;
84};
85#endif /* !__OBJC__ */
86
87#endif /* !___VBoxDockIconPreview_h___ */
88
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette