5#include <QtFbSupport/private/qfbcursor_p.h>
6#include <QtFbSupport/private/qfbwindow_p.h>
7#include <QtCore/QRegularExpression>
8#include <QtGui/QPainter>
14#include <memory_region.h>
24 switch (fbinfo->BitsPerPixel) {
26 if (fbinfo->Alpha.Bits)
59 : mArgs(
args), mBlitter(0)
67 CheckSuccess(gh_FB_close_munmap(mFbh, &vmr));
68 CheckSuccess(DeallocateMemoryRegionWithCookie(__ghs_VirtualMemoryRegionPool,
90 else if (
arg.contains(offsetRx, &
match))
93 fbDevice =
match.captured(1);
98 err = gh_FB_get_driver_by_name(NULL, &mFbd);
102 err = gh_FB_get_next_driver(&
context, &mFbd);
105 err = gh_FB_get_driver_by_name(
qPrintable(fbDevice), &mFbd);
112 memset(&mFbinfo, 0,
sizeof(FBInfo));
113 CheckSuccess(gh_FB_check_info(mFbd, &mFbinfo));
114 if (userGeometry.
width() && userGeometry.
height()) {
115 mFbinfo.Width = userGeometry.
width();
116 mFbinfo.Height = userGeometry.
height();
117 err = gh_FB_check_info(mFbd, &mFbinfo);
126 if (mFbinfo.MMapSize) {
127 err = AllocateAnyMemoryRegionWithCookie(__ghs_VirtualMemoryRegionPool,
128 mFbinfo.MMapSize, &mVMR, &mVMRCookie);
134 err = gh_FB_open_mmap(mFbd, &mFbinfo, mVMR, &mFbh);
136 err = gh_FB_open(mFbd, &mFbinfo, &mFbh);
143 CheckSuccess(gh_FB_get_info(mFbh, &mFbinfo));
145 mDepth = mFbinfo.BitsPerPixel;
150 int mmWidth =
qRound((mFbinfo.Width * 25.4) / dpi);
151 int mmHeight =
qRound((mFbinfo.Height * 25.4) / dpi);
155 mFbScreenImage =
QImage((
uchar *)mFbinfo.Start, mFbinfo.Width, mFbinfo.Height,
156 mFbinfo.BytesPerLine,
mFormat);
171 mBlitter =
new QPainter(&mFbScreenImage);
175 (uint32_t)
rect.left(),
176 (uint32_t)
rect.top(),
177 (uint32_t)
rect.width(),
178 (uint32_t)
rect.height()
181 gh_FB_expose(mFbh, &fbrect, NULL);
QFbWindow * windowForId(WId wid) const
void initializeCompositor()
virtual QRegion doRedraw()
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.
Format
The following image formats are available in Qt.
QPixmap grabWindow(WId wid, int x, int y, int width, int height) const override
This function is called when Qt needs to be able to grab the content of a window.
QRegion doRedraw() override
QIntegrityFbScreen(const QStringList &args)
The QPainter class performs low-level painting on widgets and other paint devices.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QPixmap copy(int x, int y, int width, int height) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr void setSize(const QSize &s) noexcept
Sets the size of the rectangle to the given size.
constexpr void setTopLeft(const QPoint &p) noexcept
Set the top-left corner of the rectangle to the given position.
constexpr int width() const noexcept
Returns the width of the rectangle.
The QRegion class specifies a clip region for a painter.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
int qRound(qfloat16 d) noexcept
static QImage::Format determineFormat(const FBInfo *fbinfo)
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLint GLsizei GLsizei GLenum format
#define qPrintable(string)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)