45 #include <QtCore/qdebug.h> 46 #include <QWindowSystemInterface> 56 # include <X11/extensions/XShm.h> 73 #ifndef DONT_USE_MIT_SHM 77 XDestroyImage (
image);
79 shmctl (
shminfo.shmid, IPC_RMID, 0);
88 #ifdef DONT_USE_MIT_SHM 93 image_info->destroy();
98 &image_info->shminfo, width, height);
101 image_info->shminfo.shmid = shmget (IPC_PRIVATE,
102 image->bytes_per_line * image->height, IPC_CREAT|0700);
104 image_info->shminfo.shmaddr = image->data = (
char*)shmat (image_info->shminfo.shmid, 0, 0);
105 image_info->shminfo.readOnly = False;
107 image_info->image =
image;
111 Q_ASSERT(shm_attach_status == True);
113 shm_img =
QImage( (
uchar*) image->data, image->width, image->height, image->bytes_per_line, win->
format() );
121 if (shm_img.size() != s)
127 return shm_img.size();
132 painted(false), image_info(0)
161 #ifdef DONT_USE_MIT_SHM 207 for (
int i = 0; i < rects.
size(); ++i)
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
#define QT_END_NAMESPACE
This macro expands to.
void resizeShmImage(int width, int height)
QPointer< QWidget > widget
QRect rect(const QWidget *widget) const
Returns the rectangle for widget in the coordinates of this window surface.
#define it(className, varName)
void endPaint(const QRegion ®ion)
This function is called after painting onto the surface has ended, with the region in which the paint...
bool isNull() const
Returns true if it is a null image, otherwise returns false.
Display * nativeDisplay() const
QXlibWindowSurface(QWidget *window)
virtual QPoint offset(const QWidget *widget) const
Returns the offset of widget in the coordinates of this window surface.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
int bytesPerLine() const
Returns the number of bytes per image scanline.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
static QXlibScreen * testLiteScreenForWidget(QWidget *widget)
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void beginPaint(const QRegion ®ion)
This function is called before painting onto the surface begins, with the region in which the paintin...
The QImage class provides a hardware-independent image representation that allows direct access to th...
QXlibShmImageInfo(Display *xdisplay)
The QRegion class specifies a clip region for a painter.
QXlibShmImageInfo * image_info
void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset)
Flushes the given region from the specified widget onto the screen.
The QWindowSurface class provides the drawing area for top-level windows.
const T & at(int i) const
Returns the item at index position i in the vector.
GC graphicsContext() const
int width() const
Returns the width of the image.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
QPaintDevice * paintDevice()
Implement this function to return the appropriate paint device.
The QPoint class defines a point in the plane using integer precision.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the image.
bool scroll(const QRegion &area, int dx, int dy)
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative...
The QSize class defines the size of a two-dimensional object using integer point precision.
QImage::Format format() const
QXlibDisplay * display() const
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
static int area(const QSize &s)
void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)