Qt 4.8
Classes | Macros | Typedefs | Enumerations | Functions | Variables
qwidget_mac.mm File Reference
#include <private/qt_mac_p.h>
#include <private/qeventdispatcher_mac_p.h>
#include "qapplication.h"
#include "qapplication_p.h"
#include "qbitmap.h"
#include "qcursor.h"
#include "qdesktopwidget.h"
#include "qevent.h"
#include "qfileinfo.h"
#include "qimage.h"
#include "qlayout.h"
#include "qmenubar.h"
#include <private/qbackingstore_p.h>
#include <private/qwindowsurface_mac_p.h>
#include <private/qpaintengine_mac_p.h>
#include "qpainter.h"
#include "qstyle.h"
#include "qtimer.h"
#include "qfocusframe.h"
#include "qdebug.h"
#include <private/qmainwindowlayout_p.h>
#include <private/qabstractscrollarea_p.h>
#include <qabstractscrollarea.h>
#include <ApplicationServices/ApplicationServices.h>
#include <limits.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qcocoaview_mac_p.h>
#include <private/qcocoawindow_mac_p.h>
#include <private/qcocoawindowdelegate_mac_p.h>
#include <private/qcocoapanel_mac_p.h>
#include "qwidget_p.h"
#include "qevent_p.h"
#include "qdnd_p.h"
#include <QtGui/qgraphicsproxywidget.h>
#include "qmainwindow.h"

Go to the source code of this file.

Classes

struct  QPaintEngineCleanupHandler
 

Macros

#define HIViewInstallEventHandler(target, handler, numTypes, list, userData, outHandlerRef)   InstallEventHandler( HIObjectGetEventTarget( (HIObjectRef) (target) ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
 
#define kHIViewFeatureIgnoresClicks   kHIViewIgnoresClicks
 
#define kHIViewScrollRectAdjustInvalid   1
 
#define kHIViewScrollRectDontInvalidateRevealedArea   2
 
#define ReleaseWindowGroup(x)   Are you sure you wanted to do that? (you wanted qt_mac_release_window_group)
 
#define S   "com.trolltech.qt-" S0(QT_NAMESPACE) ".widget"
 
#define S0(x)   SS(x)
 
#define SF(x)   ((x > max_f) ? max_f : x)
 
#define SS(x)   #x
 
#define WRECT_MAX   8191
 
#define XCOORD_MAX   16383
 

Typedefs

typedef QHash< Qt::WindowFlags, WindowGroupRef > WindowGroupHash
 

Enumerations

enum  { kWidgetPropertyQWidget = 'QWId' }
 
enum  {
  kEventClassGesture = 'gest', kEventGestureStarted = 1, kEventGestureEnded = 2, kEventGestureMagnify = 4,
  kEventGestureSwipe = 5, kEventGestureRotate = 6, kEventParamRotationAmount = 'rota', kEventParamSwipeDirection = 'swip',
  kEventParamMagnificationAmount = 'magn'
}
 

Functions

OSStatus _HIViewScrollRectWithOptions (HIViewRef, const HIRect *, CGFloat, CGFloat, OptionBits) __attribute__((weak))
 
static void cleanup_widget_eventUPP ()
 
static void cleanup_win_eventUPP ()
 
NSComparisonResult compareViews2Lower (id view1, id view2, void *context)
 
NSComparisonResult compareViews2Raise (id view1, id view2, void *context)
 
NSComparisonResult compareViews2StackUnder (id view1, id view2, void *context)
 
static const EventHandlerUPP make_widget_eventUPP ()
 
static const EventHandlerUPP make_win_eventUPP ()
 
bool qt_event_remove_activate ()
 
void qt_event_request_activate (QWidget *)
 
void qt_event_request_showsheet (QWidget *)
 
void qt_event_request_window_change (QWidget *)
 
static bool qt_isGenuineQWidget (OSViewRef ref)
 
bool qt_isGenuineQWidget (const QWidget *window)
 
bool qt_mac_can_clickThrough (const QWidget *w)
 
QRegion qt_mac_convert_mac_region (RgnHandle rgn)
 
CGImageRef qt_mac_create_cgimage (const QPixmap &, bool)
 
IconRef qt_mac_create_iconref (const QPixmap &)
 
OSViewRef qt_mac_create_widget (QWidget *widget, QWidgetPrivate *widgetPrivate, OSViewRef parent)
 
static OSWindowRef qt_mac_create_window (QWidget *, WindowClass wclass, WindowAttributes wattr, const QRect &crect)
 
static QSize qt_mac_desktopSize ()
 
static void qt_mac_destructDrawer (NSDrawer *drawer)
 
static void qt_mac_destructView (OSViewRef view)
 
static void qt_mac_destructWindow (OSWindowRef window)
 
Q_GUI_EXPORT OSViewRef qt_mac_effectiveview_for (const QWidget *w)
 
void qt_mac_event_release (QWidget *w)
 
QWidgetqt_mac_find_window (OSWindowRef window)
 
Q_GUI_EXPORT OSViewRef qt_mac_get_contentview_for (OSWindowRef w)
 
SInt32 qt_mac_get_group_level (WindowClass wclass)
 
RgnHandle qt_mac_get_rgn ()
 
bool qt_mac_insideKeyWindow (const QWidget *w)
 
bool qt_mac_is_macdrawer (const QWidget *w)
 
bool qt_mac_is_macsheet (const QWidget *w)
 
QWidgetqt_mac_modal_blocked (QWidget *)
 
QPoint qt_mac_nativeMapFromParent (const QWidget *child, const QPoint &pt)
 
Q_GUI_EXPORT OSViewRef qt_mac_nativeview_for (const QWidget *w)
 
Q_GUI_EXPORT QPoint qt_mac_posInWindow (const QWidget *w)
 
static void qt_mac_release_stays_on_top_group (WindowGroupRef group)
 
static void qt_mac_release_window_group (WindowGroupRef group)
 
bool qt_mac_sendMacEventToWidget (QWidget *widget, EventRef ref)
 
void qt_mac_set_cursor (const QCursor *, const QPoint &)
 
bool qt_mac_set_drawer_preferred_edge (QWidget *w, Qt::DockWidgetArea where)
 
static void qt_mac_set_fullscreen_mode (bool b)
 
void Q_GUI_EXPORT qt_mac_set_raise_process (bool b)
 
static void qt_mac_set_window_group (OSWindowRef window, Qt::WindowFlags flags, int level)
 
static void qt_mac_set_window_group_to_popup (OSWindowRef window)
 
static void qt_mac_set_window_group_to_stays_on_top (OSWindowRef window, Qt::WindowType type)
 
static void qt_mac_set_window_group_to_tooltip (OSWindowRef window)
 
void qt_mac_setMouseGrabCursor (bool set, QCursor *cursor=0)
 
void qt_mac_unregister_widget ()
 
void qt_mac_update_cursor ()
 
static void qt_mac_update_widget_position (QWidget *q, QRect oldRect, QRect newRect)
 
void qt_mac_updateParentUnderAlienWidget (QWidget *alienWidget)
 
Q_GUI_EXPORT OSWindowRef qt_mac_window_for (OSViewRef view)
 
Q_GUI_EXPORT OSWindowRef qt_mac_window_for (const QWidget *w)
 
QMainWindowLayoutqt_mainwindow_layout (const QMainWindow *window)
 
bool qt_nograb ()
 
static bool updateRedirectedToGraphicsProxyWidget (QWidget *widget, const QRect &rect)
 
static bool updateRedirectedToGraphicsProxyWidget (QWidget *widget, const QRegion &rgn)
 

Variables

static CFStringRef kObjectQWidget = CFSTR(S)
 
const UInt32 kWidgetCreatorQt = kEventClassQt
 
QWidgetmac_keyboard_grabber = 0
 
QWidgetmac_mouse_grabber = 0
 
static EventHandlerUPP mac_widget_eventUPP = 0
 
static EventHandlerUPP mac_win_eventUPP = 0
 
QPointer< QWidgetqt_button_down
 
QPointer< QWidgetqt_last_mouse_receiver
 
QPointer< QWidgetqt_last_native_mouse_receiver
 
static bool qt_mac_raise_process = true
 
static OSWindowRef qt_root_win = 0
 
QPointer< QWidgettopLevelAt_cache
 
static HIObjectClassRef widget_class = 0
 
static EventTypeSpec widget_events []
 
static EventTypeSpec window_events []
 

Macro Definition Documentation

◆ HIViewInstallEventHandler

#define HIViewInstallEventHandler (   target,
  handler,
  numTypes,
  list,
  userData,
  outHandlerRef 
)    InstallEventHandler( HIObjectGetEventTarget( (HIObjectRef) (target) ), (handler), (numTypes), (list), (userData), (outHandlerRef) )

◆ kHIViewFeatureIgnoresClicks

#define kHIViewFeatureIgnoresClicks   kHIViewIgnoresClicks

◆ kHIViewScrollRectAdjustInvalid

#define kHIViewScrollRectAdjustInvalid   1

Definition at line 129 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::scroll_sys().

◆ kHIViewScrollRectDontInvalidateRevealedArea

#define kHIViewScrollRectDontInvalidateRevealedArea   2

Definition at line 130 of file qwidget_mac.mm.

◆ ReleaseWindowGroup

#define ReleaseWindowGroup (   x)    Are you sure you wanted to do that? (you wanted qt_mac_release_window_group)

Definition at line 536 of file qwidget_mac.mm.

Referenced by qt_mac_release_window_group().

◆ S

#define S   "com.trolltech.qt-" S0(QT_NAMESPACE) ".widget"

Definition at line 165 of file qwidget_mac.mm.

Referenced by _qdtoa().

◆ S0

#define S0 (   x)    SS(x)

Definition at line 164 of file qwidget_mac.mm.

◆ SF

#define SF (   x)    ((x > max_f) ? max_f : x)

◆ SS

#define SS (   x)    #x

Definition at line 163 of file qwidget_mac.mm.

◆ WRECT_MAX

#define WRECT_MAX   8191

Definition at line 121 of file qwidget_mac.mm.

Referenced by qt_mac_update_widget_position().

◆ XCOORD_MAX

#define XCOORD_MAX   16383

Definition at line 120 of file qwidget_mac.mm.

Referenced by qt_mac_update_widget_position().

Typedef Documentation

◆ WindowGroupHash

typedef QHash<Qt::WindowFlags, WindowGroupRef> WindowGroupHash

Definition at line 146 of file qwidget_mac.mm.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kWidgetPropertyQWidget 

Definition at line 149 of file qwidget_mac.mm.

149  {
150  kWidgetPropertyQWidget = 'QWId' //QWidget *
151 };

◆ anonymous enum

anonymous enum
Enumerator
kEventClassGesture 
kEventGestureStarted 
kEventGestureEnded 
kEventGestureMagnify 
kEventGestureSwipe 
kEventGestureRotate 
kEventParamRotationAmount 
kEventParamSwipeDirection 
kEventParamMagnificationAmount 

Definition at line 803 of file qwidget_mac.mm.

Function Documentation

◆ _HIViewScrollRectWithOptions()

OSStatus _HIViewScrollRectWithOptions ( HIViewRef  ,
const HIRect *  ,
CGFloat  ,
CGFloat  ,
OptionBits   
)

◆ cleanup_widget_eventUPP()

static void cleanup_widget_eventUPP ( )
static

Definition at line 1227 of file qwidget_mac.mm.

Referenced by make_widget_eventUPP().

1228 {
1229  DisposeEventHandlerUPP(mac_widget_eventUPP);
1230  mac_widget_eventUPP = 0;
1231 }
static EventHandlerUPP mac_widget_eventUPP

◆ cleanup_win_eventUPP()

static void cleanup_win_eventUPP ( )
static

Definition at line 841 of file qwidget_mac.mm.

Referenced by make_win_eventUPP().

842 {
843  DisposeEventHandlerUPP(mac_win_eventUPP);
844  mac_win_eventUPP = 0;
845 }
static EventHandlerUPP mac_win_eventUPP
Definition: qwidget_mac.mm:840

◆ compareViews2Lower()

NSComparisonResult compareViews2Lower ( id  view1,
id  view2,
void *  context 
)

Definition at line 4005 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::lower_sys().

4006 {
4007  id topView = reinterpret_cast<id>(context);
4008  if (view1 == topView)
4009  return NSOrderedAscending;
4010  if (view2 == topView)
4011  return NSOrderedDescending;
4012  return NSOrderedSame;
4013 }

◆ compareViews2Raise()

NSComparisonResult compareViews2Raise ( id  view1,
id  view2,
void *  context 
)

Definition at line 3927 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::raise_sys().

3928 {
3929  id topView = reinterpret_cast<id>(context);
3930  if (view1 == topView)
3931  return NSOrderedDescending;
3932  if (view2 == topView)
3933  return NSOrderedAscending;
3934  return NSOrderedSame;
3935 }

◆ compareViews2StackUnder()

NSComparisonResult compareViews2StackUnder ( id  view1,
id  view2,
void *  context 
)

Definition at line 4041 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::stackUnder_sys().

4042 {
4043  const QHash<NSView *, int> &viewOrder = *reinterpret_cast<QHash<NSView *, int> *>(context);
4044  if (viewOrder[view1] < viewOrder[view2])
4045  return NSOrderedAscending;
4046  if (viewOrder[view1] > viewOrder[view2])
4047  return NSOrderedDescending;
4048  return NSOrderedSame;
4049 }
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66

◆ make_widget_eventUPP()

static const EventHandlerUPP make_widget_eventUPP ( )
static

Definition at line 1232 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::create_sys(), and qt_mac_create_widget().

1233 {
1235  return mac_widget_eventUPP;
1237  return mac_widget_eventUPP = NewEventHandlerUPP(QWidgetPrivate::qt_widget_event);
1238 }
static void cleanup_widget_eventUPP()
static EventHandlerUPP mac_widget_eventUPP
void qAddPostRoutine(QtCleanUpFunction ptr)
Adds a global routine that will be called from the QApplication destructor.

◆ make_win_eventUPP()

static const EventHandlerUPP make_win_eventUPP ( )
static

Definition at line 846 of file qwidget_mac.mm.

Referenced by qt_mac_unregister_widget().

847 {
848  if(mac_win_eventUPP)
849  return mac_win_eventUPP;
851  return mac_win_eventUPP = NewEventHandlerUPP(QWidgetPrivate::qt_window_event);
852 }
static void cleanup_win_eventUPP()
Definition: qwidget_mac.mm:841
static EventHandlerUPP mac_win_eventUPP
Definition: qwidget_mac.mm:840
void qAddPostRoutine(QtCleanUpFunction ptr)
Adds a global routine that will be called from the QApplication destructor.

◆ qt_event_remove_activate()

bool qt_event_remove_activate ( )

Definition at line 884 of file qapplication_mac.mm.

Referenced by QWidget::activateWindow(), qt_event_activate_timer_callbk(), and qt_event_request_activate().

885 {
886  if (request_activate_pending.timer) {
887  RemoveEventLoopTimer(request_activate_pending.timer);
888  request_activate_pending.timer = 0;
889  }
890  if (request_activate_pending.event)
892  return true;
893 }
static struct @193 request_activate_pending
static void qt_mac_event_release(EventRef &event)

◆ qt_event_request_activate()

void qt_event_request_activate ( QWidget )

Definition at line 911 of file qapplication_mac.mm.

Referenced by QWidgetPrivate::hide_sys(), and QWidgetPrivate::show_sys().

912 {
913  if (w == request_activate_pending.widget)
914  return;
915 
916  /* We put these into a timer because due to order of events being sent we need to be sure this
917  comes from inside of the event loop */
919  if (!request_activate_pending.timerUPP)
920  request_activate_pending.timerUPP = NewEventLoopTimerUPP(qt_event_activate_timer_callbk);
921  request_activate_pending.widget = w;
922  InstallEventLoopTimer(GetMainEventLoop(), 0, 0, request_activate_pending.timerUPP, 0, &request_activate_pending.timer);
923 }
bool qt_event_remove_activate()
static struct @193 request_activate_pending
void qt_event_activate_timer_callbk(EventLoopTimerRef r, void *)

◆ qt_event_request_showsheet()

void qt_event_request_showsheet ( QWidget )

Definition at line 748 of file qapplication_mac.mm.

Referenced by QWidgetPrivate::show_sys().

749 {
751 #ifdef QT_MAC_USE_COCOA
752  w->repaint();
753  [NSApp beginSheet:qt_mac_window_for(w) modalForWindow:qt_mac_window_for(w->parentWidget())
754  modalDelegate:nil didEndSelector:nil contextInfo:0];
755 #else
757  CreateEvent(0, kEventClassQt, kEventQtRequestShowSheet, GetCurrentEventTime(),
758  kEventAttributeUserEvent, &request_showsheet_pending);
759  SetEventParameter(request_showsheet_pending, kEventParamQWidget, typeQWidget, sizeof(w), &w);
760  PostEventToQueue(GetMainEventQueue(), request_showsheet_pending, kEventPriorityStandard);
761 #endif
762 }
static EventRef request_showsheet_pending
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
const UInt32 kEventClassQt
Definition: qt_mac_p.h:92
bool qt_mac_is_macsheet(const QWidget *)
Definition: qwidget_mac.mm:295
static bool qt_mac_event_remove(EventRef &event)

◆ qt_event_request_window_change()

void qt_event_request_window_change ( QWidget )

Definition at line 858 of file qapplication_mac.mm.

Referenced by QWidgetPrivate::hide_sys(), QWidgetPrivate::lower_sys(), make_widget_eventUPP(), make_win_eventUPP(), QWidgetPrivate::raise_sys(), QWidgetPrivate::scroll_sys(), QWidgetPrivate::setGeometry_sys(), QWidgetPrivate::setParent_sys(), QWidget::setWindowState(), QWidgetPrivate::show_sys(), and QWidgetPrivate::stackUnder_sys().

859 {
860  if (!widget)
861  return;
862 
863  // Post a kEventQtRequestWindowChange event. This event is semi-public,
864  // don't remove this line!
866 
867  // Post update request on gl widgets unconditionally.
868  if (qt_widget_private(widget)->isGLWidget == true) {
870  return;
871  }
872 
875 }
QPointer< QWidget > widget
static void qt_mac_update_intersected_gl_widgets(QWidget *widget)
static void qt_post_window_change_event(QWidget *widget)
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
static void qt_mac_update_child_gl_widgets(QWidget *widget)
Q_GUI_EXPORT void qt_event_request_window_change()

◆ qt_isGenuineQWidget() [1/2]

static bool qt_isGenuineQWidget ( OSViewRef  ref)
static

Definition at line 464 of file qwidget_mac.mm.

Referenced by make_widget_eventUPP(), qt_isGenuineQWidget(), qt_mac_window_for(), and QWidgetPrivate::setParent_sys().

465 {
466 #ifdef QT_MAC_USE_COCOA
467  return [ref isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]];
468 #else
469  return HIObjectIsOfClass(HIObjectRef(ref), kObjectQWidget);
470 #endif
471 }
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
struct OpaqueHIObjectRef * HIObjectRef
static CFStringRef kObjectQWidget
Definition: qwidget_mac.mm:167

◆ qt_isGenuineQWidget() [2/2]

bool qt_isGenuineQWidget ( const QWidget window)

Definition at line 473 of file qwidget_mac.mm.

Referenced by QApplicationPrivate::globalEventProcessor().

474 {
475  if (!window)
476  return false;
477 
478  if (!window->internalWinId())
479  return true; //alien
480 
481  return qt_isGenuineQWidget(OSViewRef(window->internalWinId()));
482 }
static bool qt_isGenuineQWidget(OSViewRef ref)
Definition: qwidget_mac.mm:464
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
HIViewRef OSViewRef

◆ qt_mac_can_clickThrough()

bool qt_mac_can_clickThrough ( const QWidget w)

Definition at line 280 of file qwidget_mac.mm.

Referenced by QApplicationPrivate::globalEventProcessor(), QStyleOption::init(), and QWidget::setForegroundRole().

281 {
282  static int qt_mac_carbon_clickthrough = -1;
283  if (qt_mac_carbon_clickthrough < 0)
284  qt_mac_carbon_clickthrough = !qgetenv("QT_MAC_NO_COCOA_CLICKTHROUGH").isEmpty();
285  bool ret = !qt_mac_carbon_clickthrough;
286  for ( ; w; w = w->parentWidget()) {
288  ret = false;
289  break;
290  }
291  }
292  return ret;
293 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421

◆ qt_mac_convert_mac_region()

QRegion qt_mac_convert_mac_region ( RgnHandle  rgn)

◆ qt_mac_create_cgimage()

CGImageRef qt_mac_create_cgimage ( const QPixmap ,
bool   
)

◆ qt_mac_create_iconref()

IconRef qt_mac_create_iconref ( const QPixmap )

Definition at line 1109 of file qpixmap_mac.cpp.

Referenced by QWidgetPrivate::setWindowIcon_sys().

1110 {
1111  if (px.isNull())
1112  return 0;
1113 
1114  //create icon
1115  IconFamilyHandle iconFamily = reinterpret_cast<IconFamilyHandle>(NewHandle(0));
1116  //create data
1117  {
1118  struct {
1119  OSType mac_type;
1120  int width, height, depth;
1121  bool mask;
1122  } images[] = {
1123  { kThumbnail32BitData, 128, 128, 32, false },
1124  { kThumbnail8BitMask, 128, 128, 8, true },
1125  { 0, 0, 0, 0, false } //end marker
1126  };
1127  for(int i = 0; images[i].mac_type; i++) {
1128  //get QPixmap data
1129  QImage scaled_px = px.toImage().scaled(images[i].width, images[i].height);
1130 
1131  quint32 *sptr = (quint32 *) scaled_px.bits();
1132  quint32 *srow;
1133  uint sbpr = scaled_px.bytesPerLine();
1134 
1135  //get Handle data
1136  const int dbpr = images[i].width * (images[i].depth/8);
1137  Handle hdl = NewHandle(dbpr*images[i].height);
1138  if(!sptr) { //handle null pixmap
1139  memset((*hdl), '\0', dbpr*images[i].height);
1140  } else if(images[i].mask) {
1141  if(images[i].mac_type == kThumbnail8BitMask) {
1142  for(int y = 0, hindex = 0; y < images[i].height; ++y) {
1143  srow = sptr + (y * (sbpr/4));
1144  for(int x = 0; x < images[i].width; ++x)
1145  *((*hdl)+(hindex++)) = qAlpha(*(srow+x));
1146  }
1147  }
1148  } else {
1149  char *dest = (*hdl);
1150 #if defined(__i386__)
1151  if(images[i].depth == 32) {
1152  for(int y = 0; y < images[i].height; ++y) {
1153  uint *source = (uint*)((const uchar*)sptr+(sbpr*y));
1154  for(int x = 0; x < images[i].width; ++x, dest += 4)
1155  *((uint*)dest) = CFSwapInt32(*(source + x));
1156  }
1157  } else
1158 #endif
1159  {
1160  for(int y = 0; y < images[i].height; ++y)
1161  memcpy(dest+(y*dbpr), ((const uchar*)sptr+(sbpr*y)), dbpr);
1162  }
1163  }
1164 
1165  //set the family data to the Handle
1166  OSStatus set = SetIconFamilyData(iconFamily, images[i].mac_type, hdl);
1167  if(set != noErr)
1168  qWarning("%s: %d -- Unable to create icon data[%d]!! %ld",
1169  __FILE__, __LINE__, i, long(set));
1170  DisposeHandle(hdl);
1171  }
1172  }
1173 
1174  //acquire and cleanup
1175  IconRef ret;
1176  static int counter = 0;
1177  const OSType kQtCreator = 'CUTE';
1178  RegisterIconRefFromIconFamily(kQtCreator, (OSType)counter, iconFamily, &ret);
1179  AcquireIconRef(ret);
1180  UnregisterIconRef(kQtCreator, (OSType)counter);
1181  DisposeHandle(reinterpret_cast<Handle>(iconFamily));
1182  counter++;
1183  return ret;
1184 
1185 }
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
Definition: qrgb.h:66
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
unsigned char uchar
Definition: qglobal.h:994
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
unsigned int uint
Definition: qglobal.h:996
signed long OSStatus
uchar * bits()
Returns a pointer to the first pixel data.
Definition: qimage.cpp:1946
unsigned int quint32
Definition: qglobal.h:938
QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
Definition: qimage.h:232
struct OpaqueIconRef * IconRef

◆ qt_mac_create_widget()

OSViewRef qt_mac_create_widget ( QWidget widget,
QWidgetPrivate widgetPrivate,
OSViewRef  parent 
)

Definition at line 1602 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::create_sys(), QMacNativeWidget::QMacNativeWidget(), and qt_mac_unregister_widget().

1603 {
1604 #ifdef QT_MAC_USE_COCOA
1606  QT_MANGLE_NAMESPACE(QCocoaView) *view = [[QT_MANGLE_NAMESPACE(QCocoaView) alloc] initWithQWidget:widget widgetPrivate:widgetPrivate];
1607 
1608 #ifdef ALIEN_DEBUG
1609  qDebug() << "Creating NSView for" << widget;
1610 #endif
1611 
1612  if (view && parent)
1613  [parent addSubview:view];
1614  return view;
1615 #else
1616  Q_UNUSED(widget);
1617  Q_UNUSED(widgetPrivate);
1618  if(!widget_class) {
1619  OSStatus err = HIObjectRegisterSubclass(kObjectQWidget, kHIViewClassID, 0, make_widget_eventUPP(),
1620  GetEventTypeCount(widget_events), widget_events,
1621  0, &widget_class);
1622  if (err && err != hiObjectClassExistsErr)
1623  qWarning("QWidget: Internal error (%d)", __LINE__);
1624  }
1625  HIViewRef ret = 0;
1626  if(HIObjectCreate(kObjectQWidget, 0, (HIObjectRef*)&ret) != noErr)
1627  qWarning("QWidget: Internal error (%d)", __LINE__);
1628  if(ret && parent)
1629  HIViewAddSubview(parent, ret);
1630  return ret;
1631 #endif
1632 }
static const EventHandlerUPP make_widget_eventUPP()
static EventTypeSpec widget_events[]
QPointer< QWidget > widget
Q_CORE_EXPORT void qDebug(const char *,...)
static HIObjectClassRef widget_class
struct OpaqueControlRef * HIViewRef
Q_CORE_EXPORT void qWarning(const char *,...)
signed long OSStatus
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
struct OpaqueHIObjectRef * HIObjectRef
static CFStringRef kObjectQWidget
Definition: qwidget_mac.mm:167
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ qt_mac_create_window()

static OSWindowRef qt_mac_create_window ( QWidget ,
WindowClass  wclass,
WindowAttributes  wattr,
const QRect crect 
)
static

Definition at line 778 of file qwidget_mac.mm.

Referenced by qt_mac_unregister_widget(), and updateRedirectedToGraphicsProxyWidget().

780 {
782  Rect geo;
783  SetRect(&geo, crect.left(), crect.top(), crect.right() + 1, crect.bottom() + 1);
784  OSStatus err;
785  if(geo.right <= geo.left) geo.right = geo.left + 1;
786  if(geo.bottom <= geo.top) geo.bottom = geo.top + 1;
787  Rect null_rect;
788  SetRect(&null_rect, 0, 0, 1, 1);
789  err = CreateNewWindow(wclass, wattr, &null_rect, &window);
790  if(err == noErr) {
791  err = SetWindowBounds(window, kWindowContentRgn, &geo);
792  if(err != noErr)
793  qWarning("QWidget: Internal error (%s:%d)", __FILE__, __LINE__);
794  }
795  return window;
796 }
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
NSWindow * window
WindowRef OSWindowRef
Q_CORE_EXPORT void qWarning(const char *,...)
signed long OSStatus
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246

◆ qt_mac_desktopSize()

static QSize qt_mac_desktopSize ( )
static

Definition at line 203 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::create_sys(), and qt_mac_unregister_widget().

204 {
205  int w = 0, h = 0;
206  CGDisplayCount cg_count;
207  CGGetActiveDisplayList(0, 0, &cg_count);
208  QVector<CGDirectDisplayID> displays(cg_count);
209  CGGetActiveDisplayList(cg_count, displays.data(), &cg_count);
210  Q_ASSERT(cg_count == (CGDisplayCount)displays.size());
211  for(int i = 0; i < (int)cg_count; ++i) {
212  CGRect r = CGDisplayBounds(displays.at(i));
213  w = qMax<int>(w, qRound(r.origin.x + r.size.width));
214  h = qMax<int>(h, qRound(r.origin.y + r.size.height));
215  }
216  return QSize(w, h);
217 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
struct CGRect CGRect
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ qt_mac_destructDrawer()

static void qt_mac_destructDrawer ( NSDrawer *  drawer)
static

Definition at line 270 of file qwidget_mac.mm.

Referenced by QWidget::destroy(), and QWidgetPrivate::setParent_sys().

271 {
272 #ifdef QT_MAC_USE_COCOA
273  [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] resignDelegateForDrawer:drawer];
274  [drawer release];
275 #else
276  Q_UNUSED(drawer);
277 #endif
278 }
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ qt_mac_destructView()

static void qt_mac_destructView ( OSViewRef  view)
static

Definition at line 235 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::create_sys(), QWidget::destroy(), and QWidgetPrivate::setParent_sys().

236 {
237 #ifdef QT_MAC_USE_COCOA
238  NSWindow *window = [view window];
239  if ([window contentView] == view) {
240  NSView* newView = [[NSView alloc] initWithFrame:[view bounds]];
241  [window setContentView:newView];
242  [newView release];
243  } else {
244  [view removeFromSuperview];
245  [view release];
246  }
247 #else
248  HIViewRemoveFromSuperview(view);
249  CFRelease(view);
250 #endif
251 }
NSWindow * window

◆ qt_mac_destructWindow()

static void qt_mac_destructWindow ( OSWindowRef  window)
static

Definition at line 253 of file qwidget_mac.mm.

Referenced by QWidget::destroy(), qt_mac_unregister_widget(), and QWidgetPrivate::setParent_sys().

254 {
255 #ifdef QT_MAC_USE_COCOA
256  if ([window isVisible] && [window isSheet]){
257  [NSApp endSheet:window];
258  [window orderOut:window];
259  }
260 
261  [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] resignDelegateForWindow:window];
262  [window release];
263 #else
264  // Remove property to clean up memory:
265  RemoveWindowProperty(window, kWidgetCreatorQt, kWidgetPropertyQWidget);
266  CFRelease(window);
267 #endif
268 }
const UInt32 kWidgetCreatorQt
Definition: qwidget_mac.mm:148
NSWindow * window
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ qt_mac_effectiveview_for()

Q_GUI_EXPORT OSViewRef qt_mac_effectiveview_for ( const QWidget w)

Definition at line 424 of file qwidget_mac.mm.

Referenced by flipPoint(), QMacWindowFader::performFade(), qt_mac_window_for(), QWidgetPrivate::registerDropSite(), and QWidgetPrivate::setFocus_sys().

425 {
426  // Get the first non-alien (parent) widget for
427  // w, and return its NSView (if it has one):
428  return reinterpret_cast<OSViewRef>(w->effectiveWinId());
429 }
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
HIViewRef OSViewRef

◆ qt_mac_event_release()

void qt_mac_event_release ( QWidget w)

Definition at line 1002 of file qapplication_mac.mm.

Referenced by QWidget::destroy(), and QWidgetPrivate::hide_sys().

1003 {
1004  if (w) {
1005 #ifndef QT_MAC_USE_COCOA
1008 #endif
1009  if (w == qt_mac_dock_menu) {
1010  qt_mac_dock_menu = 0;
1011 #ifndef QT_MAC_USE_COCOA
1012  SetApplicationDockTileMenu(0);
1013 #else
1014  [NSApp setDockMenu:0];
1015 #endif
1016  }
1017  }
1018 }
static EventRef request_showsheet_pending
static void qt_mac_event_release(EventRef &event)
static EventRef request_context_pending
static QMenu * qt_mac_dock_menu

◆ qt_mac_find_window()

QWidget* qt_mac_find_window ( OSWindowRef  window)

Definition at line 391 of file qwidget_mac.mm.

Referenced by QApplicationPrivate::globalEventProcessor(), QWidgetPrivate::hide_sys(), make_win_eventUPP(), onApplicationChangedActivation(), qt_mac_window_at(), and QApplicationPrivate::tryModalHelper_sys().

392 {
393 #ifdef QT_MAC_USE_COCOA
394  return [window QT_MANGLE_NAMESPACE(qt_qwidget)];
395 #else
396  if(!window)
397  return 0;
398 
399  QWidget *ret;
400  if(GetWindowProperty(window, kWidgetCreatorQt, kWidgetPropertyQWidget, sizeof(ret), 0, &ret) == noErr)
401  return ret;
402  return 0;
403 #endif
404 }
const UInt32 kWidgetCreatorQt
Definition: qwidget_mac.mm:148
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
NSWindow * window
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ qt_mac_get_contentview_for()

Q_GUI_EXPORT OSViewRef qt_mac_get_contentview_for ( OSWindowRef  w)

Definition at line 431 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::create_sys(), qt_mac_unregister_widget(), and QWidgetPrivate::show_sys().

432 {
433 #ifdef QT_MAC_USE_COCOA
434  return [w contentView];
435 #else
436  HIViewRef contentView = 0;
437  OSStatus err = GetRootControl(w, &contentView); // Returns the window's content view (Apple QA1214)
438  if (err == errUnknownControl) {
439  contentView = HIViewGetRoot(w);
440  } else if (err != noErr) {
441  qWarning("Qt:Could not get content or root view of window! %s:%d [%ld]",
442  __FILE__, __LINE__, err);
443  }
444  return contentView;
445 #endif
446 }
struct OpaqueControlRef * HIViewRef
Q_CORE_EXPORT void qWarning(const char *,...)
signed long OSStatus

◆ qt_mac_get_group_level()

SInt32 qt_mac_get_group_level ( WindowClass  wclass)

Definition at line 538 of file qwidget_mac.mm.

Referenced by qt_mac_set_window_group_to_popup(), qt_mac_set_window_group_to_stays_on_top(), and qt_mac_set_window_group_to_tooltip().

539 {
540  SInt32 group_level;
541  CGWindowLevel tmpLevel;
542  GetWindowGroupLevelOfType(GetWindowGroupOfClass(wclass), kWindowGroupLevelActive, &tmpLevel);
543  group_level = tmpLevel;
544  return group_level;
545 }

◆ qt_mac_get_rgn()

RgnHandle qt_mac_get_rgn ( )

◆ qt_mac_insideKeyWindow()

bool qt_mac_insideKeyWindow ( const QWidget w)

Definition at line 311 of file qwidget_mac.mm.

Referenced by QWidget::previousInFocusChain().

312 {
313 #ifdef QT_MAC_USE_COCOA
314  return [[reinterpret_cast<NSView *>(w->effectiveWinId()) window] isKeyWindow];
315 #else
316  Q_UNUSED(w);
317 #endif
318  return false;
319 }
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
NSWindow * window
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ qt_mac_is_macdrawer()

bool qt_mac_is_macdrawer ( const QWidget w)

Definition at line 306 of file qwidget_mac.mm.

Referenced by QWidget::activateWindow(), QMainWindow::addDockWidget(), QWidget::destroy(), QApplicationPrivate::globalEventProcessor(), QWidgetPrivate::hide_sys(), QWidget::previousInFocusChain(), qt_mac_set_drawer_preferred_edge(), qt_mac_unregister_widget(), QDockAreaLayoutInfo::restoreState(), QWidgetPrivate::setParent_sys(), QWidgetPrivate::show_sys(), and IsWindowAndNotDrawerOrSheetTest::test().

307 {
308  return (w && w->parentWidget() && w->windowType() == Qt::Drawer);
309 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937

◆ qt_mac_is_macsheet()

bool qt_mac_is_macsheet ( const QWidget w)

Definition at line 295 of file qwidget_mac.mm.

Referenced by QFileDialogPrivate::createNavServicesDialog(), QApplicationPrivate::enterModal_sys(), QApplicationPrivate::globalEventProcessor(), QWidgetPrivate::hide_sys(), QFileDialogPrivate::hideCarbonNavServicesDialog(), QApplicationPrivate::leaveModal_sys(), make_win_eventUPP(), qt_event_request_showsheet(), qt_mac_unregister_widget(), QWidgetPrivate::show_sys(), QFontDialogPrivate::showCocoaFontPanel(), IsWindowAndNotDrawerOrSheetTest::test(), and QApplicationPrivate::tryModalHelper_sys().

296 {
297  if (!w)
298  return false;
299 
300  Qt::WindowModality modality = w->windowModality();
301  if (modality == Qt::ApplicationModal)
302  return false;
303  return w->parentWidget() && (modality == Qt::WindowModal || w->windowType() == Qt::Sheet);
304 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
Qt::WindowModality windowModality
which windows are blocked by the modal widget
Definition: qwidget.h:156
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
WindowModality
Definition: qnamespace.h:1683

◆ qt_mac_modal_blocked()

QWidget* qt_mac_modal_blocked ( QWidget )

◆ qt_mac_nativeMapFromParent()

QPoint qt_mac_nativeMapFromParent ( const QWidget child,
const QPoint pt 
)

Definition at line 3576 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::childAtRecursiveHelper().

3577 {
3578 #ifndef QT_MAC_USE_COCOA
3579  CGPoint nativePoint = CGPointMake(pt.x(), pt.y());
3580  HIViewConvertPoint(&nativePoint, qt_mac_nativeview_for(child->parentWidget()),
3581  qt_mac_nativeview_for(child));
3582 #else
3583  NSPoint nativePoint = [qt_mac_nativeview_for(child) convertPoint:NSMakePoint(pt.x(), pt.y()) fromView:qt_mac_nativeview_for(child->parentWidget())];
3584 #endif
3585  return QPoint(nativePoint.x, nativePoint.y);
3586 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
Q_GUI_EXPORT OSViewRef qt_mac_nativeview_for(const QWidget *w)
Definition: qwidget_mac.mm:419
struct CGPoint NSPoint
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

◆ qt_mac_nativeview_for()

Q_GUI_EXPORT OSViewRef qt_mac_nativeview_for ( const QWidget w)

◆ qt_mac_posInWindow()

Q_GUI_EXPORT QPoint qt_mac_posInWindow ( const QWidget w)

Definition at line 380 of file qwidget_mac.mm.

Referenced by make_widget_eventUPP(), and qt_mac_get_widget_rgn().

381 {
382  QPoint ret = w->data->wrect.topLeft();
383  while(w && !w->isWindow()) {
384  ret += w->pos();
385  w = w->parentWidget();
386  }
387  return ret;
388 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
QWidgetData * data
Definition: qwidget.h:815
QRect wrect
Definition: qwidget.h:145
QPoint pos
the position of the widget within its parent widget
Definition: qwidget.h:163
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ qt_mac_release_stays_on_top_group()

static void qt_mac_release_stays_on_top_group ( WindowGroupRef  group)
static

Definition at line 518 of file qwidget_mac.mm.

Referenced by qt_mac_release_window_group().

519 {
520  for (WindowGroupHash::iterator it = qt_mac_window_groups()->begin(); it != qt_mac_window_groups()->end(); ++it) {
521  if (it.value() == group) {
522  qt_mac_window_groups()->remove(it.key());
523  return;
524  }
525  }
526 }
#define it(className, varName)
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330

◆ qt_mac_release_window_group()

static void qt_mac_release_window_group ( WindowGroupRef  group)
static

Definition at line 530 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::deleteTLSysExtra(), and qt_mac_unregister_widget().

531 {
532  ReleaseWindowGroup(group);
533  if (GetWindowGroupRetainCount(group) == 0)
535 }
#define ReleaseWindowGroup(x)
Definition: qwidget_mac.mm:536
static void qt_mac_release_stays_on_top_group(WindowGroupRef group)
Definition: qwidget_mac.mm:518

◆ qt_mac_sendMacEventToWidget()

bool qt_mac_sendMacEventToWidget ( QWidget widget,
EventRef  ref 
)

Definition at line 448 of file qwidget_mac.mm.

Referenced by flipPoint(), qt_dispatchKeyEvent(), and qt_mac_handleTabletEvent().

449 {
450  return widget->macEvent(0, ref);
451 }
virtual bool macEvent(EventHandlerCallRef, EventRef)
This special event handler can be reimplemented in a subclass to receive native Macintosh events...
Definition: qwidget.cpp:9918

◆ qt_mac_set_cursor()

void qt_mac_set_cursor ( const QCursor ,
const QPoint  
)

◆ qt_mac_set_drawer_preferred_edge()

bool qt_mac_set_drawer_preferred_edge ( QWidget w,
Qt::DockWidgetArea  where 
)

Definition at line 321 of file qwidget_mac.mm.

Referenced by QMainWindow::addDockWidget(), and QDockAreaLayoutInfo::restoreState().

322 {
323  if(!qt_mac_is_macdrawer(w))
324  return false;
325 
326 #if QT_MAC_USE_COCOA
327  NSDrawer *drawer = qt_mac_drawer_for(w);
328  if (!drawer)
329  return false;
330  NSRectEdge edge;
331  if (where & Qt::LeftDockWidgetArea)
332  edge = NSMinXEdge;
333  else if (where & Qt::RightDockWidgetArea)
334  edge = NSMaxXEdge;
335  else if (where & Qt::TopDockWidgetArea)
336  edge = NSMaxYEdge;
337  else if (where & Qt::BottomDockWidgetArea)
338  edge = NSMinYEdge;
339  else
340  return false;
341 
342  if (edge == [drawer preferredEdge]) //no-op
343  return false;
344 
345  if (w->isVisible()) {
346  [drawer close];
347  [drawer openOnEdge:edge];
348  }
349  [drawer setPreferredEdge:edge];
350 #else
352  OptionBits edge;
353  if(where & Qt::LeftDockWidgetArea)
354  edge = kWindowEdgeLeft;
355  else if(where & Qt::RightDockWidgetArea)
356  edge = kWindowEdgeRight;
357  else if(where & Qt::TopDockWidgetArea)
358  edge = kWindowEdgeTop;
359  else if(where & Qt::BottomDockWidgetArea)
360  edge = kWindowEdgeBottom;
361  else
362  return false;
363 
364  if(edge == GetDrawerPreferredEdge(window)) //no-op
365  return false;
366 
367  //do it
368  SetDrawerPreferredEdge(window, edge);
369  if(w->isVisible()) {
370  CloseDrawer(window, false);
371  OpenDrawer(window, edge, true);
372  }
373 #endif
374  return true;
375 }
Q_GUI_EXPORT OSWindowRef qt_mac_window_for(OSViewRef view)
Definition: qwidget_mac.mm:453
bool isVisible() const
Definition: qwidget.h:1005
NSWindow * window
WindowRef OSWindowRef
bool qt_mac_is_macdrawer(const QWidget *w)
Definition: qwidget_mac.mm:306

◆ qt_mac_set_fullscreen_mode()

static void qt_mac_set_fullscreen_mode ( bool  b)
inlinestatic

Definition at line 406 of file qwidget_mac.mm.

Referenced by QWidget::activateWindow(), QWidgetPrivate::hide_sys(), and QWidget::setWindowState().

407 {
408  extern bool qt_mac_app_fullscreen; //qapplication_mac.mm
409  if(qt_mac_app_fullscreen == b)
410  return;
411  qt_mac_app_fullscreen = b;
412  if (b) {
413  SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
414  } else {
415  SetSystemUIMode(kUIModeNormal, 0);
416  }
417 }
bool qt_mac_app_fullscreen

◆ qt_mac_set_raise_process()

void Q_GUI_EXPORT qt_mac_set_raise_process ( bool  b)

Definition at line 202 of file qwidget_mac.mm.

202 { qt_mac_raise_process = b; }
static bool qt_mac_raise_process
Definition: qwidget_mac.mm:154

◆ qt_mac_set_window_group()

static void qt_mac_set_window_group ( OSWindowRef  window,
Qt::WindowFlags  flags,
int  level 
)
static

Definition at line 549 of file qwidget_mac.mm.

Referenced by qt_mac_set_window_group_to_popup(), qt_mac_set_window_group_to_stays_on_top(), and qt_mac_set_window_group_to_tooltip().

550 {
551  WindowGroupRef group = 0;
552  if (qt_mac_window_groups()->contains(flags)) {
553  group = qt_mac_window_groups()->value(flags);
554  RetainWindowGroup(group);
555  } else {
556  CreateWindowGroup(kWindowActivationScopeNone, &group);
557  SetWindowGroupLevel(group, level);
558  SetWindowGroupParent(group, GetWindowGroupOfClass(kAllWindowClasses));
559  qt_mac_window_groups()->insert(flags, group);
560  }
561  SetWindowGroup(window, group);
562 }
NSWindow * window

◆ qt_mac_set_window_group_to_popup()

static void qt_mac_set_window_group_to_popup ( OSWindowRef  window)
inlinestatic

Definition at line 582 of file qwidget_mac.mm.

Referenced by qt_mac_unregister_widget().

583 {
584  // In Qt, a popup is seen as a 'stay on top' window.
585  // Since new groups are created for 'stays on top' windows, the
586  // same must be done for popups. Otherwise, popups would be drawn
587  // below 'stays on top' windows. Add 1 to get above pure stay-on-top windows.
589 }
NSWindow * window
SInt32 qt_mac_get_group_level(WindowClass wclass)
Definition: qwidget_mac.mm:538
static void qt_mac_set_window_group(OSWindowRef window, Qt::WindowFlags flags, int level)
Definition: qwidget_mac.mm:549

◆ qt_mac_set_window_group_to_stays_on_top()

static void qt_mac_set_window_group_to_stays_on_top ( OSWindowRef  window,
Qt::WindowType  type 
)
inlinestatic

Definition at line 564 of file qwidget_mac.mm.

Referenced by qt_mac_unregister_widget().

565 {
566  // We create one static stays on top window group so that
567  // all stays on top (aka popups) will fall into the same
568  // group and be able to be raise()'d with releation to one another (from
569  // within the same window group).
571 }
int type
Definition: qmetatype.cpp:239
NSWindow * window
SInt32 qt_mac_get_group_level(WindowClass wclass)
Definition: qwidget_mac.mm:538
static void qt_mac_set_window_group(OSWindowRef window, Qt::WindowFlags flags, int level)
Definition: qwidget_mac.mm:549

◆ qt_mac_set_window_group_to_tooltip()

static void qt_mac_set_window_group_to_tooltip ( OSWindowRef  window)
inlinestatic

Definition at line 573 of file qwidget_mac.mm.

Referenced by qt_mac_unregister_widget().

574 {
575  // Since new groups are created for 'stays on top' windows, the
576  // same must be done for tooltips. Otherwise, tooltips would be drawn
577  // below 'stays on top' widgets even tough they are on the same level.
578  // Also, add 'two' to the group level to make sure they also get on top of popups.
580 }
NSWindow * window
SInt32 qt_mac_get_group_level(WindowClass wclass)
Definition: qwidget_mac.mm:538
static void qt_mac_set_window_group(OSWindowRef window, Qt::WindowFlags flags, int level)
Definition: qwidget_mac.mm:549

◆ qt_mac_setMouseGrabCursor()

void qt_mac_setMouseGrabCursor ( bool  set,
QCursor cursor = 0 
)

Definition at line 227 of file qcursor_mac.mm.

Referenced by QWidget::grabMouse(), and QWidget::releaseMouse().

228 {
229  if (grabCursor) {
230  delete grabCursor;
231  grabCursor = 0;
232  }
233  if (set) {
234  if (cursor)
235  grabCursor = new QCursor(*cursor);
236  else if (lastMouseCursorWidget)
238  else
240  }
242 }
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
static QPointer< QWidget > lastMouseCursorWidget
Definition: qcursor_mac.mm:140
void qt_mac_update_cursor()
Definition: qcursor_mac.mm:201
QCursor cursor
the cursor shape for this widget
Definition: qwidget.h:183
static QCursor * grabCursor
Definition: qcursor_mac.mm:142

◆ qt_mac_unregister_widget()

void qt_mac_unregister_widget ( )

Definition at line 1634 of file qwidget_mac.mm.

Referenced by qt_cleanup().

1635 {
1636 #ifndef QT_MAC_USE_COCOA
1637  HIObjectUnregisterClass(widget_class);
1638  widget_class = 0;
1639 #endif
1640 }
static HIObjectClassRef widget_class

◆ qt_mac_update_cursor()

void qt_mac_update_cursor ( )

Definition at line 201 of file qcursor_mac.mm.

Referenced by QWidgetPrivate::hide_sys(), qt_mac_setMouseGrabCursor(), QWidgetPrivate::setCursor_sys(), QWidgetPrivate::show_sys(), and QWidgetPrivate::unsetCursor_sys().

202 {
203  // This function is similar to qt_mac_updateCursorWithWidgetUnderMouse
204  // except that is clears the optimization cache, and finds the widget
205  // under mouse itself. Clearing the cache is useful in cases where the
206  // application has been deactivated/activated etc.
207  // NB: since we dont have any true native widget, the call to
208  // qt_mac_getTargetForMouseEvent will fail when the mouse is over QMacNativeWidgets.
209 #ifdef QT_MAC_USE_COCOA
212  QWidget *widgetUnderMouse = 0;
213 
214  if (qt_button_down) {
215  widgetUnderMouse = qt_button_down;
216  } else {
217  QPoint localPoint;
218  QPoint globalPoint;
219  qt_mac_getTargetForMouseEvent(0, QEvent::None, localPoint, globalPoint, 0, &widgetUnderMouse);
220  }
221  qt_mac_updateCursorWithWidgetUnderMouse(widgetUnderMouse);
222 #else
224 #endif
225 }
void qt_mac_updateCursorWithWidgetUnderMouse(QWidget *widgetUnderMouse)
Definition: qcursor_mac.mm:144
static QPointer< QWidget > lastWidgetUnderMouse
Definition: qcursor_mac.mm:139
static QPointer< QWidget > lastMouseCursorWidget
Definition: qcursor_mac.mm:140
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPointer< QWidget > qt_button_down
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
qt_mac_getTargetForMouseEvent(event, QEvent::Gesture, qlocal, qglobal, 0, &widgetToGetTouch)

◆ qt_mac_update_widget_position()

static void qt_mac_update_widget_position ( QWidget q,
QRect  oldRect,
QRect  newRect 
)
static

Definition at line 4092 of file qwidget_mac.mm.

4093 {
4094  HIRect bounds = CGRectMake(newRect.x(), newRect.y(),
4095  newRect.width(), newRect.height());
4096 
4097  const HIViewRef view = qt_mac_nativeview_for(q);
4098  const bool isMove = (oldRect.topLeft() != newRect.topLeft());
4099  const bool isResize = (oldRect.size() != newRect.size());
4100 
4101 // qDebug() << oldRect << newRect << isMove << isResize << q->testAttribute(Qt::WA_OpaquePaintEvent) << q->testAttribute(Qt::WA_StaticContents);
4103 
4104  // Perform a normal (complete repaint) update in some cases:
4105  if (
4106  // always repaint on move.
4107  (isMove) ||
4108 
4109  // limited update on resize requires WA_StaticContents.
4110  (isResize && q->testAttribute(Qt::WA_StaticContents) == false) ||
4111 
4112  // one of the rects are invalid
4113  (oldRect.isValid() == false || newRect.isValid() == false) ||
4114 
4115  // the position update is a part of a drag-and-drop operation
4117 
4118  // we are on Panther (no HIViewSetNeedsDisplayInRect)
4120  ){
4121  HIViewSetFrame(view, &bounds);
4122  return;
4123  }
4124 
4125  const int dx = newRect.x() - oldRect.x();
4126  const int dy = newRect.y() - oldRect.y();
4127 
4128  if (isMove) {
4129  // HIViewScrollRect silently fails if we try to scroll anything under the grow box.
4130  // Check if there's one present within the widget rect, and if there is fall back
4131  // to repainting the entire widget.
4132  QWidget const * const parentWidget = q->parentWidget();
4133  const HIViewRef parentView = qt_mac_nativeview_for(parentWidget);
4134  HIViewRef nativeSizeGrip = 0;
4136  HIViewFindByID(HIViewGetRoot(HIViewGetWindow(HIViewRef(q->winId()))), kHIViewWindowGrowBoxID, &nativeSizeGrip);
4137  if (nativeSizeGrip) {
4138  QWidget * const window = q->window();
4139 
4140  const int sizeGripSize = 20;
4141  const QRect oldWidgetRect = QRect(q->mapTo(window, QPoint(0, 0)), QSize(oldRect.width(), oldRect.height()));
4142  const QRect newWidgetRect = QRect(q->mapTo(window, QPoint(0, 0)), QSize(newRect.width(), newRect.height()));
4143  const QRect sizeGripRect = QRect(window->rect().bottomRight() - QPoint(sizeGripSize, sizeGripSize),
4144  window->rect().bottomRight());
4145 
4146  if (sizeGripRect.intersects(oldWidgetRect) || sizeGripRect.intersects(newWidgetRect)) {
4147  HIViewSetFrame(view, &bounds);
4148  return;
4149  }
4150  }
4151 
4152  // Don't scroll anything outside the parent widget rect.
4153  const QRect scrollRect = (oldRect | newRect) & parentWidget->rect();
4154  const HIRect scrollBounds =
4155  CGRectMake(scrollRect.x(), scrollRect.y(), scrollRect.width(), scrollRect.height());
4156 
4157  // We cannot scroll when the widget has a mask as that would
4158  // scroll the masked out areas too
4159  if (qd->extra && qd->extra->hasMask) {
4160  HIViewMoveBy(view, dx, dy);
4161  return;
4162  }
4163 
4164  OSStatus err = HIViewScrollRect(parentView, &scrollBounds, dx, dy);
4165  if (err != noErr) {
4166  HIViewSetNeedsDisplay(view, true);
4167  qWarning("QWidget: Internal error (%s:%d)", __FILE__, __LINE__);
4168  }
4169  }
4170  // Set the view bounds with drawing disabled to prevent repaints.
4171  HIViewSetDrawingEnabled(view, false);
4172  HIViewSetFrame(view, &bounds);
4173  HIViewSetDrawingEnabled(view, true);
4174 
4175  // Update any newly exposed areas due to resizing.
4176  const int startx = oldRect.width();
4177  const int stopx = newRect.width();
4178  const int starty = oldRect.height();
4179  const int stopy = newRect.height();
4180 
4181  const HIRect verticalSlice = CGRectMake(startx, 0, stopx , stopy);
4182  HIViewSetNeedsDisplayInRect(view, &verticalSlice, true);
4183  const HIRect horizontalSlice = CGRectMake(0, starty, startx, stopy);
4184  HIViewSetNeedsDisplayInRect(view, &horizontalSlice, true);
4185 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
QPoint mapTo(QWidget *, const QPoint &) const
Translates the widget coordinate pos to the coordinate system of parent.
Definition: qwidget.cpp:4409
QDrag * object
Definition: qdnd_p.h:238
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
NSWindow * window
QPoint bottomRight() const
Returns the position of the rectangle&#39;s bottom-right corner.
Definition: qrect.h:291
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
struct OpaqueControlRef * HIViewRef
Q_CORE_EXPORT void qWarning(const char *,...)
signed long OSStatus
static QWidget * parentWidget(const QWidget *w)
Q_GUI_EXPORT OSViewRef qt_mac_nativeview_for(const QWidget *w)
Definition: qwidget_mac.mm:419
static QDragManager * self()
Definition: qdnd.cpp:163
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QWExtra * extra
Definition: qwidget_p.h:700
uint hasMask
Definition: qwidget_p.h:278
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
Definition: qglobal.h:1646
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Definition: qrect.cpp:1429
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
Definition: qrect.h:237
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ qt_mac_updateParentUnderAlienWidget()

void qt_mac_updateParentUnderAlienWidget ( QWidget alienWidget)

Definition at line 2740 of file qwidget_mac.mm.

Referenced by QWidget::destroy(), and QWidgetPrivate::hide_sys().

2741 {
2742  QWidget *nativeParent = alienWidget->nativeParentWidget();
2743  if (!nativeParent)
2744  return;
2745 
2746  QPoint globalPos = alienWidget->mapToGlobal(QPoint(0, 0));
2747  QRect dirtyRect = QRect(nativeParent->mapFromGlobal(globalPos), alienWidget->size());
2748  nativeParent->update(dirtyRect);
2749 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
QWidget * nativeParentWidget() const
Returns the native parent for this widget, i.
Definition: qwidget.cpp:4514
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:165
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.

◆ qt_mac_window_for() [1/2]

Q_GUI_EXPORT OSWindowRef qt_mac_window_for ( OSViewRef  view)

◆ qt_mac_window_for() [2/2]

Q_GUI_EXPORT OSWindowRef qt_mac_window_for ( const QWidget w)

Definition at line 484 of file qwidget_mac.mm.

Referenced by QMainWindowLayout::cleanUpMacToolbarItems(), QPrintDialogPrivate::closeCarbonPrintPanel(), QFileDialogPrivate::createNavServicesDialog(), QCoreGraphicsPaintEngine::end(), flipPoint(), QMacWindowSurface::flush(), QRasterWindowSurface::flush(), QEventDispatcherMac::flush(), QApplicationPrivate::globalEventProcessor(), QToolBarPrivate::init(), QMainWindowLayout::insertIntoMacToolbar(), macWindowToolbarShow(), QPageSetupDialogPrivate::openCarbonPageLayout(), QPrintDialogPrivate::openCarbonPrintPanel(), QMacWindowFader::performFade(), qt_event_request_showsheet(), qt_mac_grabScreenRect_10_3(), qt_mac_graphicsContextFor(), qt_mac_is_metal(), qt_mac_post_retranslateAppMenu(), QMainWindowLayout::removeFromMacToolbar(), QMainWindowLayout::toggleToolBarsVisible(), QApplicationPrivate::tryModalHelper_sys(), QMainWindowLayout::updateHIToolBarStatus(), and QTabBarPrivate::updateMacBorderMetrics().

485 {
486  if (OSViewRef hiview = qt_mac_effectiveview_for(w)) {
488  if (window)
489  return window;
490 
491  if (qt_isGenuineQWidget(hiview)) {
492  // This is a workaround for NSToolbar. When a widget is hidden
493  // by clicking the toolbar button, Cocoa reparents the widgets
494  // to another window (but Qt doesn't know about it).
495  // When we start showing them, it reparents back,
496  // but at this point it's window is nil, but the window it's being brought
497  // into (the Qt one) is for sure created.
498  // This stops the hierarchy moving under our feet.
499  QWidget *toplevel = w->window();
500  if (toplevel != w) {
501  hiview = qt_mac_nativeview_for(toplevel);
502  if (OSWindowRef w = qt_mac_window_for(hiview))
503  return w;
504  }
505 
506  toplevel->d_func()->createWindow_sys();
507  // Reget the hiview since "create window" could potentially move the view (I guess).
508  hiview = qt_mac_nativeview_for(toplevel);
509  return qt_mac_window_for(hiview);
510  }
511  }
512  return 0;
513 }
Q_GUI_EXPORT OSWindowRef qt_mac_window_for(OSViewRef view)
Definition: qwidget_mac.mm:453
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
NSWindow * window
static bool qt_isGenuineQWidget(OSViewRef ref)
Definition: qwidget_mac.mm:464
WindowRef OSWindowRef
Q_GUI_EXPORT OSViewRef qt_mac_nativeview_for(const QWidget *w)
Definition: qwidget_mac.mm:419
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
HIViewRef OSViewRef
Q_GUI_EXPORT OSViewRef qt_mac_effectiveview_for(const QWidget *w)
Definition: qwidget_mac.mm:424

◆ qt_mainwindow_layout()

QMainWindowLayout * qt_mainwindow_layout ( const QMainWindow window)

Definition at line 111 of file qmainwindow.cpp.

Referenced by QMainWindowLayoutState::apply(), qt_mac_unregister_widget(), QWidgetPrivate::setModal_sys(), and QWidgetPrivate::setParent_sys().

112 {
113  return QMainWindowPrivate::mainWindowLayout(mainWindow);
114 }
static QMainWindowLayout * mainWindowLayout(const QMainWindow *mainWindow)

◆ qt_nograb()

bool qt_nograb ( )

Definition at line 482 of file qapplication_mac.mm.

Referenced by QWidget::grabKeyboard(), QWidget::grabMouse(), QWidget::releaseKeyboard(), and QWidget::releaseMouse().

483 {
484 #if defined(QT_DEBUG)
485  return appNoGrab;
486 #else
487  return false;
488 #endif
489 }
static bool appNoGrab

◆ updateRedirectedToGraphicsProxyWidget() [1/2]

static bool updateRedirectedToGraphicsProxyWidget ( QWidget widget,
const QRect rect 
)
inlinestatic

Definition at line 592 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::createDefaultWindowSurface_sys().

593 {
594  if (!widget)
595  return false;
596 
597 #ifndef QT_NO_GRAPHICSVIEW
598  QWidget *tlw = widget->window();
599  QWExtra *extra = qt_widget_private(tlw)->extra;
600  if (extra && extra->proxyWidget) {
601  extra->proxyWidget->update(rect.translated(widget->mapTo(tlw, QPoint())));
602  return true;
603  }
604 #endif
605 
606  return false;
607 }
QPoint mapTo(QWidget *, const QPoint &) const
Translates the widget coordinate pos to the coordinate system of parent.
Definition: qwidget.cpp:4409
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
QGraphicsProxyWidget * proxyWidget
Definition: qwidget_p.h:251
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QWExtra * extra
Definition: qwidget_p.h:700
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920

◆ updateRedirectedToGraphicsProxyWidget() [2/2]

static bool updateRedirectedToGraphicsProxyWidget ( QWidget widget,
const QRegion rgn 
)
inlinestatic

Definition at line 609 of file qwidget_mac.mm.

610 {
611  if (!widget)
612  return false;
613 
614 #ifndef QT_NO_GRAPHICSVIEW
615  QWidget *tlw = widget->window();
616  QWExtra *extra = qt_widget_private(tlw)->extra;
617  if (extra && extra->proxyWidget) {
618  const QPoint offset(widget->mapTo(tlw, QPoint()));
619  const QVector<QRect> rects = rgn.rects();
620  for (int i = 0; i < rects.size(); ++i)
621  extra->proxyWidget->update(rects.at(i).translated(offset));
622  return true;
623  }
624 #endif
625 
626  return false;
627 }
QPoint mapTo(QWidget *, const QPoint &) const
Translates the widget coordinate pos to the coordinate system of parent.
Definition: qwidget.cpp:4409
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
QGraphicsProxyWidget * proxyWidget
Definition: qwidget_p.h:251
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
QWExtra * extra
Definition: qwidget_p.h:700
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920

Variable Documentation

◆ kObjectQWidget

CFStringRef kObjectQWidget = CFSTR(S)
static

Definition at line 167 of file qwidget_mac.mm.

Referenced by make_widget_eventUPP(), qt_isGenuineQWidget(), and qt_mac_create_widget().

◆ kWidgetCreatorQt

const UInt32 kWidgetCreatorQt = kEventClassQt

◆ mac_keyboard_grabber

QWidget* mac_keyboard_grabber = 0

◆ mac_mouse_grabber

QWidget* mac_mouse_grabber = 0

◆ mac_widget_eventUPP

EventHandlerUPP mac_widget_eventUPP = 0
static

Definition at line 1226 of file qwidget_mac.mm.

Referenced by cleanup_widget_eventUPP(), and make_widget_eventUPP().

◆ mac_win_eventUPP

EventHandlerUPP mac_win_eventUPP = 0
static

Definition at line 840 of file qwidget_mac.mm.

Referenced by cleanup_win_eventUPP(), and make_win_eventUPP().

◆ qt_button_down

QPointer<QWidget> qt_button_down

◆ qt_last_mouse_receiver

QPointer<QWidget> qt_last_mouse_receiver

Definition at line 189 of file qapplication_mac.mm.

◆ qt_last_native_mouse_receiver

QPointer<QWidget> qt_last_native_mouse_receiver

Referenced by flipPoint().

◆ qt_mac_raise_process

bool qt_mac_raise_process = true
static

Definition at line 154 of file qwidget_mac.mm.

Referenced by qt_mac_set_raise_process(), and QWidgetPrivate::raise_sys().

◆ qt_root_win

OSWindowRef qt_root_win = 0
static

◆ topLevelAt_cache

QPointer<QWidget> topLevelAt_cache

Definition at line 168 of file qapplication_mac.mm.

◆ widget_class

HIObjectClassRef widget_class = 0
static

Definition at line 1202 of file qwidget_mac.mm.

Referenced by qt_mac_create_widget(), and qt_mac_unregister_widget().

◆ widget_events

EventTypeSpec widget_events[]
static
Initial value:
= {
{ kEventClassHIObject, kEventHIObjectConstruct },
{ kEventClassHIObject, kEventHIObjectDestruct },
{ kEventClassControl, kEventControlDraw },
{ kEventClassControl, kEventControlInitialize },
{ kEventClassControl, kEventControlGetPartRegion },
{ kEventClassControl, kEventControlGetClickActivation },
{ kEventClassControl, kEventControlSetFocusPart },
{ kEventClassControl, kEventControlDragEnter },
{ kEventClassControl, kEventControlDragWithin },
{ kEventClassControl, kEventControlDragLeave },
{ kEventClassControl, kEventControlDragReceive },
{ kEventClassControl, kEventControlOwningWindowChanged },
{ kEventClassControl, kEventControlBoundsChanged },
{ kEventClassControl, kEventControlGetSizeConstraints },
{ kEventClassControl, kEventControlVisibilityChanged },
{ kEventClassMouse, kEventMouseDown },
{ kEventClassMouse, kEventMouseUp },
{ kEventClassMouse, kEventMouseMoved },
{ kEventClassMouse, kEventMouseDragged }
}

Definition at line 1203 of file qwidget_mac.mm.

Referenced by QWidgetPrivate::create_sys(), and qt_mac_create_widget().

◆ window_events

EventTypeSpec window_events[]
static
Initial value:
= {
{ kEventClassWindow, kEventWindowClose },
{ kEventClassWindow, kEventWindowExpanded },
{ kEventClassWindow, kEventWindowHidden },
{ kEventClassWindow, kEventWindowZoom },
{ kEventClassWindow, kEventWindowZoomed },
{ kEventClassWindow, kEventWindowCollapsed },
{ kEventClassWindow, kEventWindowToolbarSwitchMode },
{ kEventClassWindow, kEventWindowProxyBeginDrag },
{ kEventClassWindow, kEventWindowProxyEndDrag },
{ kEventClassWindow, kEventWindowResizeCompleted },
{ kEventClassWindow, kEventWindowBoundsChanging },
{ kEventClassWindow, kEventWindowGetRegion },
{ kEventClassWindow, kEventWindowGetClickModality },
{ kEventClassWindow, kEventWindowTransitionCompleted },
{ kEventClassMouse, kEventMouseDown }
}

Definition at line 818 of file qwidget_mac.mm.

Referenced by qt_mac_unregister_widget().