44 #include <private/qt_mac_p.h> 45 #include <private/qt_cocoa_helpers_mac_p.h> 46 #include <QtGui/qwidget.h> 77 #ifndef QT_MAC_USE_COCOA 80 QDBeginCGContext(port, &context);
85 CGContextRetain(context);
86 CGContextSaveGState(context);
89 CGContextTranslateCTM(context, 0, widget->
height());
90 CGContextScaleCTM(context, 1, -1);
94 for (
int i = 0; i < rects.
size(); ++i) {
96 CGContextAddRect(context, CGRectMake(rect.
x(), rect.
y(), rect.
width(), rect.
height()));
98 CGContextClip(context);
107 CGContextRestoreGState(context);
108 #ifndef QT_MAC_USE_COCOA 109 QDEndCGContext(port, &context);
111 CGContextFlush(context);
113 CGContextRelease(context);
134 CGContextTranslateCTM(context, dx, dy);
void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset)
Flushes the given region from the specified widget onto the screen.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QSize size() const
Returns the size of the pixmap.
QRect rect(const QWidget *widget) const
Returns the rectangle for widget in the coordinates of this window surface.
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
int width() const
Returns the width of the rectangle.
struct CGImage * CGImageRef
virtual QPoint offset(const QWidget *widget) const
Returns the offset of widget in the coordinates of this window surface.
QRect boundingRect() const
Returns the bounding rectangle of this region.
int height() const
Returns the height of the rectangle.
QMacWindowSurface(QWidget *widget)
CGContextRef qt_mac_graphicsContextFor(QWidget *widget)
OSWindowRef qt_mac_window_for(const QWidget *)
QMacWindowSurfacePrivate * d_ptr
#define QT_BEGIN_NAMESPACE
This macro expands to.
CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
Returns the CoreGraphics CGContextRef of the paint device.
QSize size() const
Returns the size of the rectangle.
QPaintDevice * paintDevice()
Implement this function to return the appropriate paint device.
The QRegion class specifies a clip region for a painter.
void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
The QWindowSurface class provides the drawing area for top-level windows.
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...
const T & at(int i) const
Returns the item at index position i in the vector.
int y() const
Returns the y-coordinate of the rectangle's top edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
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.
OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
The QRect class defines a rectangle in the plane using integer precision.
The QPixmap class is an off-screen image representation that can be used as a paint device...
bool isNull() const
Returns true if both the width and height is 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
struct CGContext * CGContextRef
CGImageRef toMacCGImageRef() const
Creates a CGImageRef equivalent to the QPixmap.
#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.
static int area(const QSize &s)