VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h@ 4781

最後變更 在這個檔案從4781是 4572,由 vboxsync 提交於 18 年 前

2292: Remove license display from .deb:
License Viewer implemented:

  1. If the GUI/LicenseAgreed flag is not presented in the user's VirtualBox.xml configuration file extra-data (or this flag's value is not equal to LicenseX-Y.html file version X-Y) then license file LicenseX-Y.html will be displayed to the user.
  2. If the file in LicenseX-Y.html format (for example, License1-3.html) is not presented in RTPathAppDocs() directory then the error-box will be displayed and application will exit (this will force the user to respect the license in case of license file is not found due to user simple removed this file).
  3. If the user read the license (at least scrolls the license-view to the end) and agreed it then the license viewer will be closed and will never bother the user until another license file with higher license version appears in RTPathAppDocs() directory (for example, License1-4.html).

NOTE: Feature temporary disabled due to License1-3.html file is not defaultly generated to RTPathAppDocs() directory yet.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.4 KB
 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * Header with common definitions and global functions
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.alldomusa.eu.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 as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __VBoxDefs_h__
20#define __VBoxDefs_h__
21
22#include <qevent.h>
23
24#define LOG_GROUP LOG_GROUP_GUI
25#include <VBox/log.h>
26#include <iprt/assert.h>
27
28#include <iprt/alloc.h>
29#include <iprt/asm.h>
30
31#ifdef VBOX_GUI_DEBUG
32
33#define AssertWrapperOk(w) \
34 AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
35#define AssertWrapperOkMsg(w, m) \
36 AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
37
38#else // !VBOX_GUI_DEBUG
39
40#define AssertWrapperOk(w) do {} while (0)
41#define AssertWrapperOkMsg(w, m) do {} while (0)
42
43#endif // !VBOX_GUI_DEBUG
44
45#ifndef SIZEOF_ARRAY
46#define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
47#endif
48
49#if defined (VBOX_GUI_USE_QIMAGE) || \
50 defined (VBOX_GUI_USE_SDL) || \
51 defined (VBOX_GUI_USE_DDRAW)
52 #if !defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
53 #define VBOX_GUI_USE_EXT_FRAMEBUFFER
54 #endif
55#else
56 #if defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
57 #undef VBOX_GUI_USE_EXT_FRAMEBUFFER
58 #endif
59 #if !defined (VBOX_GUI_USE_REFRESH_TIMER)
60 #define VBOX_GUI_USE_REFRESH_TIMER
61 #endif
62#endif
63
64/////////////////////////////////////////////////////////////////////////////
65
66#if defined (VBOX_GUI_DEBUG)
67
68#include <VBox/types.h> // for uint64_t type
69
70#include <qthread.h>
71#include <qdatetime.h>
72
73/**
74 * A class to measure intervals using rdtsc instruction.
75 */
76class VMCPUTimer : public QThread // for crossplatform msleep()
77{
78public:
79 inline static uint64_t ticks() {
80 return ASMReadTSC();
81 }
82 inline static uint64_t msecs( uint64_t tcks ) {
83 return tcks / ticks_per_msec;
84 }
85 inline static uint64_t msecsSince( uint64_t tcks ) {
86 tcks = ticks() - tcks;
87 return tcks / ticks_per_msec;
88 }
89 inline static void calibrate( int ms )
90 {
91 QTime t;
92 uint64_t tcks = ticks();
93 t.start();
94 msleep( ms );
95 tcks = ticks() - tcks;
96 int msecs = t.elapsed();
97 ticks_per_msec = tcks / msecs;
98 }
99 inline static uint64_t ticksPerMsec() {
100 return ticks_per_msec;
101 }
102private:
103 static uint64_t ticks_per_msec;
104};
105
106#endif // VBOX_GUI_DEBUG
107
108/* A common namespace for all enums */
109struct VBoxDefs
110{
111 /** Disk image type. */
112 enum DiskType { InvalidType, HD = 0x01, CD = 0x02, FD = 0x04 };
113
114 /** VM display rendering mode. */
115 enum RenderMode
116 {
117 InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode
118 };
119
120 /** Additional Qt event types. */
121 enum
122 {
123 AsyncEventType = QEvent::User + 100,
124 ResizeEventType,
125 RepaintEventType,
126 SetRegionEventType,
127 MouseCapabilityEventType,
128 MousePointerChangeEventType,
129 MachineStateChangeEventType,
130 AdditionsStateChangeEventType,
131 MediaChangeEventType,
132 MachineDataChangeEventType,
133 MachineRegisteredEventType,
134 SessionStateChangeEventType,
135 SnapshotEventType,
136 NetworkAdapterChangeEventType,
137 USBCtlStateChangeEventType,
138 USBDeviceStateChangeEventType,
139 SharedFolderChangeEventType,
140 RuntimeErrorEventType,
141 ModifierKeyChangeEventType,
142 EnumerateMediaEventType,
143#if defined (Q_WS_WIN)
144 ShellExecuteEventType,
145#endif
146 ActivateMenuEventType,
147#if defined (Q_WS_MAC)
148 ShowWindowEventType,
149#endif
150 };
151
152 static const char* GUI_LastWindowPosition;
153 static const char* GUI_LastWindowPosition_Max;
154 static const char* GUI_Fullscreen;
155 static const char* GUI_Seamless;
156 static const char* GUI_AutoresizeGuest;
157 static const char* GUI_FirstRun;
158 static const char* GUI_SaveMountedAtRuntime;
159 static const char* GUI_LastCloseAction;
160 static const char* GUI_SuppressMessages;
161 static const char* GUI_PermanentSharedFoldersAtRuntime;
162#ifdef Q_WS_X11
163 static const char* GUI_LicenseKey;
164#endif
165};
166
167#endif // __VBoxDefs_h__
168
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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