Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdirectfbcursor.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
include
"qdirectfbcursor.h"
6
#
include
"qdirectfbconvenience.h"
7
8
QT_BEGIN_NAMESPACE
9
10
QDirectFBCursor
::
QDirectFBCursor
(
QPlatformScreen
*
screen
)
11
: m_screen(screen)
12
{
13
#
ifndef
QT_NO_CURSOR
14
m_image.reset(
new
QPlatformCursorImage(0, 0, 0, 0, 0, 0));
15
#
endif
16
}
17
18
#
ifndef
QT_NO_CURSOR
19
void
QDirectFBCursor
::
changeCursor
(QCursor *cursor, QWindow *)
20
{
21
int
xSpot;
22
int
ySpot;
23
QPixmap map;
24
25
const
Qt::CursorShape newShape = cursor ? cursor->shape() : Qt::ArrowCursor;
26
if
(newShape != Qt::BitmapCursor) {
27
m_image->set(newShape);
28
xSpot = m_image->hotspot().x();
29
ySpot = m_image->hotspot().y();
30
QImage *i = m_image->image();
31
map = QPixmap::fromImage(*i);
32
}
else
{
33
QPoint point = cursor->hotSpot();
34
xSpot = point.x();
35
ySpot = point.y();
36
map = cursor->pixmap();
37
}
38
39
DFBResult res;
40
IDirectFBDisplayLayer *layer = toDfbLayer(m_screen);
41
IDirectFBSurface* surface(QDirectFbConvenience::dfbSurfaceForPlatformPixmap(map.handle()));
42
43
res = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
44
if
(res != DFB_OK) {
45
DirectFBError(
"Failed to set DLSCL_ADMINISTRATIVE"
, res);
46
return
;
47
}
48
49
layer->SetCursorShape(layer, surface, xSpot, ySpot);
50
layer->SetCooperativeLevel(layer, DLSCL_SHARED);
51
}
52
#
endif
53
54
QT_END_NAMESPACE
QDirectFBCursor
Definition
qdirectfbcursor.h:19
QDirectFBCursor::changeCursor
void changeCursor(QCursor *cursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
Definition
qdirectfbcursor.cpp:19
QPlatformScreen
The QPlatformScreen class provides an abstraction for visual displays.
Definition
qplatformscreen.h:45
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
platforms
directfb
qdirectfbcursor.cpp
Generated on
for Qt by
1.18.0