luna-sysmgr-common
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
HostBase.h
Go to the documentation of this file.
1
/* @@@LICENSE
2
*
3
* Copyright (c) 2008-2012 Hewlett-Packard Development Company, L.P.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
* LICENSE@@@ */
27
#ifndef HOSTBASE_H
28
#define HOSTBASE_H
29
30
#include "
Common.h
"
31
32
33
34
#include "
TaskBase.h
"
35
#include "
Mutex.h
"
36
#include "
CustomEvents.h
"
37
#include "
InputControl.h
"
38
#include "
LedControl.h
"
39
40
#include <Qt>
41
#include <QImage>
42
43
class
QWidget
;
44
48
struct
HostInfo
49
{
53
void
*
displayBuffer
;
54
63
int
displayRowBytes
;
64
68
int
displayWidth
;
69
73
int
displayHeight
;
74
78
int
displayDepth
;
79
83
int
displayRedLength
;
84
88
int
displayGreenLength
;
89
93
int
displayBlueLength
;
94
98
int
displayAlphaLength
;
99
};
100
111
class
HostBase
:
public
QObject
,
112
public
TaskBase
113
{
114
Q_OBJECT
115
public
:
123
static
HostBase
*
instance
();
124
135
virtual
~HostBase
();
136
148
virtual
void
init
(
int
w,
int
h) = 0;
149
160
virtual
void
show
() {}
161
170
inline
const
HostInfo
&
getInfo
()
const
{
return
m_info
; }
171
172
//Documented in parent.
173
virtual
void
run
();
174
175
//Documented in parent.
176
virtual
void
quit
();
177
183
static
bool
hostIsQemu
();
184
194
virtual
const
char
*
hardwareName
()
const
= 0;
195
209
virtual
unsigned
short
translateKeyWithMeta
(
unsigned
short
key,
bool
withShift,
bool
withAlt );
210
218
void
lockPainting
() {
m_paintMutex
.
lock
(); }
219
223
void
unlockPainting
() {
m_paintMutex
.
unlock
(); }
224
230
virtual
void
setMetaModifier
(
bool
metaKeyDown ) {
m_metaKeyDown
= metaKeyDown; }
231
237
virtual
bool
metaModifier
() {
return
m_metaKeyDown
; }
238
249
virtual
int
getNumberOfSwitches
()
const
{
return
0; }
250
261
void
turboModeSubscription
(
bool
add);
262
274
virtual
void
setCentralWidget
(
QWidget
* view) {}
275
284
virtual
void
flip
() {}
285
295
virtual
bool
hasAltKey
(Qt::KeyboardModifiers modifiers);
296
304
virtual
QImage
takeScreenShot
()
const
{
return
QImage(); }
305
313
virtual
QImage
takeAppDirectRenderingScreenShot
()
const
{
return
QImage(); }
314
326
virtual
void
setAppDirectRenderingLayerEnabled
(
bool
enable) {}
327
336
void
setOrientation
(
OrientationEvent::Orientation
o);
337
344
QPoint
map
(
const
QPoint& pt) {
return
m_trans
.map(pt); }
345
355
virtual
void
setRenderingLayerEnabled
(
bool
enable) {}
356
364
virtual
InputControl
*
getInputControlALS
() {
return
0; }
365
373
virtual
InputControl
*
getInputControlBluetoothInputDetect
() {
return
0; }
374
382
virtual
InputControl
*
getInputControlProximity
() {
return
0; }
383
391
virtual
InputControl
*
getInputControlTouchpanel
() {
return
0; }
392
402
virtual
InputControl
*
getInputControlKeys
() {
return
0; }
403
413
virtual
LedControl
*
getLedControlKeypadAndDisplay
() {
return
0; }
414
420
virtual
void
OrientationSensorOn
(
bool
enable) {}
421
433
virtual
OrientationEvent
*
postProcessDeviceOrientation
(
OrientationEvent
*currOrientation)
434
{
435
if
(currOrientation)
436
{
437
return
(
new
OrientationEvent
(currOrientation->
orientation
(),0,0));
438
}
439
return
0;
440
}
441
452
virtual
bool
homeButtonWakesUpScreen
() {
return
false
; }
453
461
virtual
void
setBluetoothKeyboardActive
(
bool
active) {}
462
470
virtual
bool
bluetoothKeyboardActive
()
const
{
return
false
; }
471
479
Q_SIGNALS:
480
void
signalBluetoothKeyboardActive
(
bool
active);
481
482
protected
:
492
HostBase
();
493
494
//Documented in parent.
495
virtual
void
handleEvent
(
sptr<Event>
) {}
496
506
virtual
void
turboMode
(
bool
enable) {}
507
511
HostInfo
m_info
;
512
516
Mutex
m_paintMutex
;
517
521
bool
m_metaKeyDown
;
522
528
OrientationEvent::Orientation
m_orientation
;
529
533
QTransform
m_trans
;
534
543
int
m_numBuffers
;
544
550
unsigned
m_turboModeSubscriptions
;
551
};
552
553
#endif
/* HOSTBASE_H */
luna-sysmgr-common
include
HostBase.h
Generated on Fri Jun 21 2013 00:48:48 for luna-sysmgr-common by
1.8.3.1