VirtualBox

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

Last change on this file since 16259 was 15804, checked in by vboxsync, 16 years ago

FE/Qt4-OSX: new look of the dock preview icon

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.4 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 <Carbon/Carbon.h>
27
28class VBoxConsoleWnd;
29class VBoxFrameBuffer;
30
31class QPixmap;
32
33class VBoxDockIconPreview
34{
35public:
36 VBoxDockIconPreview (VBoxConsoleWnd *aMainWnd, const QPixmap& aOverlayImage);
37 ~VBoxDockIconPreview();
38
39 void updateDockOverlay();
40 void updateDockPreview (CGImageRef aVMImage);
41 void updateDockPreview (VBoxFrameBuffer *aFrameBuffer);
42
43private:
44 inline void initPreviewImages();
45 inline void initOverlayData (int aBitmapByteCount);
46 inline CGImageRef stateImage() const;
47 void drawOverlayIcons (CGContextRef aContext);
48
49 /* Flipping is necessary cause the drawing context in Carbon is flipped by 180 degree */
50 inline CGRect flipRect (CGRect aRect) const { aRect.origin.y = mDockIconRect.size.height - aRect.origin.y - aRect.size.height; return aRect; }
51 inline CGRect centerRect (CGRect aRect) const { return centerRectTo (aRect, mDockIconRect); }
52 inline CGRect centerRectTo (CGRect aRect, const CGRect& aToRect) const
53 {
54 aRect.origin.x = aToRect.origin.x + (aToRect.size.width - aRect.size.width) / 2.0;
55 aRect.origin.y = aToRect.origin.y + (aToRect.size.height - aRect.size.height) / 2.0;
56 return aRect;
57 }
58
59 /* Private member vars */
60 VBoxConsoleWnd *mMainWnd;
61 const CGRect mDockIconRect;
62
63 CGImageRef mOverlayImage;
64 CGImageRef mDockMonitor;
65 CGImageRef mDockMonitorGlossy;
66
67 void *mBitmapData;
68
69 CGImageRef mStatePaused;
70 CGImageRef mStateSaving;
71 CGImageRef mStateRestoring;
72
73 CGRect mUpdateRect;
74 CGRect mMonitorRect;
75};
76
77#endif /* __VBoxDockIconPreview_h__ */
78
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