76 #ifndef QT_COCOA_HELPERS_MAC_P_H 77 #define QT_COCOA_HELPERS_MAC_P_H 91 #include <private/qt_mac_p.h> 105 #include <private/qeffects_p.h> 106 #include <private/qwidget_p.h> 110 #include "private/qt_mac_p.h" 112 struct HIContentBorderMetrics;
113 struct TabletProximityRec;
116 typedef struct _NSPoint
NSPoint;
147 #ifdef QT_MAC_USE_COCOA 148 bool qt_dispatchKeyEventWithCocoa(
void *
keyEvent,
QWidget *widgetToGetEvent);
150 void macDrawRectOnTop(
void *
window);
151 void macSyncDrawingOnFirstInvocation(
void *
window);
152 void qt_cocoaStackChildWindowOnTopOfOtherChildren(
QWidget *
widget);
153 void qt_mac_menu_collapseSeparators(
void * menu,
bool collapse);
166 #if QT_MAC_USE_COCOA && __OBJC__ 172 NSDragOperation performedAction;
175 DnDParams *macCurrentDnDParameters();
177 NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions);
178 Qt::DropAction qt_mac_mapNSDragOperation(NSDragOperation nsActions);
179 Qt::DropActions qt_mac_mapNSDragOperations(NSDragOperation nsActions);
181 QWidget *qt_mac_getTargetForKeyEvent(
QWidget *widgetThatReceivedEvent);
185 void qt_mac_handleNonClientAreaMouseEvent(NSWindow *
window, NSEvent *
event);
211 inline NSMutableArray *qt_mac_QStringListToNSMutableArray(
const QStringList &qstrlist)
214 inline QString qt_mac_NSStringToQString(
const NSString *nsstr)
217 inline NSString *qt_mac_QStringToNSString(
const QString &qstr)
218 {
return [
const_cast<NSString *
>(
reinterpret_cast<const NSString *
>(
QCFString::toCFStringRef(qstr))) autorelease]; }
220 #ifdef QT_MAC_USE_COCOA 221 class QCocoaPostMessageArgs {
228 QCocoaPostMessageArgs(
id target,
SEL selector,
int argCount=0,
id arg1=0,
id arg2=0)
229 : target(target), selector(selector), argCount(argCount), arg1(arg1), arg2(arg2)
236 ~QCocoaPostMessageArgs()
243 void qt_cocoaPostMessage(
id target,
SEL selector,
int argCount=0,
id arg1=0,
id arg2=0);
244 void qt_cocoaPostMessageAfterEventLoopExit(
id target,
SEL selector,
int argCount=0,
id arg1=0,
id arg2=0);
266 _inWheelEvent =
true;
273 if (_target && _target != target)
275 if (_scrollRect.
width() != -1 && _scrollRect != scrollRect)
281 _scrollRect = scrollRect;
289 _inWheelEvent =
false;
298 _scrollRect =
QRect(0, 0, -1, -1);
304 #ifdef QT_MAC_USE_COCOA 306 void qt_mac_setNeedsDisplay(
QWidget *widget);
307 void qt_mac_setNeedsDisplayInRect(
QWidget *widget,
QRegion region);
308 #endif // QT_MAC_USE_COCOA 315 CGContextRetain(context);
316 CGContextSaveGState(context);
321 CGContextRestoreGState(context);
322 CGContextRelease(context);
327 CGImageRef image = CGBitmapContextCreateImage(imageContext);
328 CGImageRef subImage = CGImageCreateWithImageInRect(image, area);
330 CGContextTranslateCTM (context, 0, drawingArea.origin.y + CGRectGetMaxY(drawingArea));
331 CGContextScaleCTM(context, 1, -1);
332 CGContextDrawImage(context, drawingArea, subImage);
334 CGImageRelease(subImage);
335 CGImageRelease(image);
340 #endif // QT_COCOA_HELPERS_MAC_P_H void qt_mac_updateContentBorderMetricts(void *window, const ::HIContentBorderMetrics &metrics)
OSStatus qt_mac_drawCGImage(CGContextRef cg, const CGRect *inbounds, CGImageRef)
The QApplication class manages the GUI application's control flow and main settings.
#define QT_END_NAMESPACE
This macro expands to.
void qt_mac_release_graphics_context(CGContextRef context)
QPointer< QWidget > widget
static void keyEvent(KeyAction action, QWidget *widget, char ascii, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1)
bool qt_mac_handleTabletEvent(void *view, void *event)
int flipYCoordinate(int y)
PasteboardRef OSPasteboardRef
bool qt_dispatchKeyEvent(void *keyEvent, QWidget *widgetToGetEvent)
The QPointF class defines a point in the plane using floating point precision.
static Qt::MouseButtons buttons
static CFStringRef toCFStringRef(const QString &str)
static QString toQString(CFStringRef cfstr)
int width() const
Returns the width of the rectangle.
struct CGImage * CGImageRef
bool macWindowIsTextured(void *window)
void qt_mac_update_mouseTracking(QWidget *widget)
void macWindowFlush(void *window)
int height() const
Returns the height of the rectangle.
The QString class provides a Unicode character string.
void * qt_mac_create_nsimage(const QPixmap &pm)
Qt::MouseButton qt_mac_get_button(EventMouseButton button)
void qt_mac_constructQIconFromIconRef(const IconRef icon, const IconRef overlayIcon, QIcon *retIcon, QStyle::StandardPixmap standardIcon=QStyle::SP_CustomBase)
StandardPixmap
This enum describes the available standard pixmaps.
void macWindowFade(void *window, float durationSeconds=0.15)
Qt::KeyboardModifiers qt_cocoaModifiers2QtModifiers(ulong modifierFlags)
void macSendToolbarChangeEvent(QWidget *widget)
#define QT_BEGIN_NAMESPACE
This macro expands to.
void qt_mac_replaceDrawRectOriginal(void *window, QWidgetPrivate *widget)
void macWindowToolbarSet(void *window, void *toolbarRef)
The QStringList class provides a list of strings.
bool qt_mac_checkForNativeSizeGrip(const QWidget *widget)
QPointF flipPoint(const NSPoint &p)
The QRegion class specifies a clip region for a painter.
QPixmap qt_mac_convert_iconref(const IconRef icon, int width, int height)
Qt::MouseButtons qt_mac_get_buttons(int buttons)
void * qt_mac_QStringListToNSMutableArrayVoid(const QStringList &list)
QApplication * qAppInstance()
Qt::KeyboardModifiers qt_cocoaDragOperation2QtModifiers(uint dragOperations)
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
void qt_mac_replaceDrawRect(void *window, QWidgetPrivate *widget)
void qt_mac_draw_image(CGContextRef context, CGContextRef imageContext, CGRect area, CGRect drawingArea)
void qt_mac_post_retranslateAppMenu()
CGFloat qt_mac_get_scalefactor()
Type
This enum type defines the valid event types in Qt.
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
QStringList qt_mac_NSArrayToQStringList(void *nsarray)
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
void macWindowSetHasShadow(void *window, bool hasShadow)
The QPixmap class is an off-screen image representation that can be used as a paint device...
void qt_mac_showBaseLineSeparator(void *window, bool show)
void qt_syncCocoaTitleBarButtons(OSWindowRef window, QWidget *widgetForWindow)
bool macWindowToolbarIsVisible(void *window)
void qt_dispatchModifiersChanged(void *flagsChangedEvent, QWidget *widgetToGetEvent)
void macWindowToolbarShow(const QWidget *widget, bool show)
struct CGContext * CGContextRef
QString qt_mac_get_pasteboardString(OSPasteboardRef paste)
void qt_mac_retain_graphics_context(CGContextRef context)
qt_mac_getTargetForMouseEvent(event, QEvent::Gesture, qlocal, qglobal, 0, &widgetToGetTouch)
struct OpaqueIconRef * IconRef
static int area(const QSize &s)
void qt_dispatchTabletProximityEvent(void *tabletEvent)
The QIcon class provides scalable icons in different modes and states.