Commit 4d2f2ff23409527863937df129d28fc3efd6859a

  • avatar
  • Mark Kromis <greybird @Atomi…ath.local>
  • Sun Oct 11 17:24:33 CEST 2009
Compile patches for building, needs debugged.
  
180180# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1
181181# define Q_OS_IPHONE
182182# define Q_OS_BSD4
183# define QT_NO_TABLET
183184# else
184185# define Q_OS_DARWIN
185186# define Q_OS_BSD4
776776/*
777777 The window system, must be one of: (Q_WS_x)
778778
779 IPHONE - iPhone
779780 MACX - Mac OS X
780781 MAC9 - Mac OS 9
781782 QWS - Qt for Embedded Linux
815815# elif defined(Q_OS_MAC32)
816816# define Q_WS_MAC32
817817# endif
818# elif defined(Q_OS_IPHONE)
819# define Q_WS_IPHONE
818820# elif defined(Q_OS_SYMBIAN)
819821# if (defined(__SERIES60_31__) || defined(__S60_32__) || defined(__S60_50__)) && !defined(QT_NO_S60)
820822# define Q_WS_S60
  
15331533
15341534#if defined(Q_WS_MAC)
15351535 typedef void * HANDLE;
1536#elif defined(Q_WS_IPHONE)
1537 typedef void *HANDLE;
15361538#elif defined(Q_WS_WIN)
15371539 typedef void *HANDLE;
15381540#elif defined(Q_WS_X11)
  
44DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE
55win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
66
7!win32:!embedded:!mac:!symbian:CONFIG += x11
7!win32:!embedded:!mac:!symbian:!iphone:CONFIG += x11
88
99unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
1010
1515#platforms
1616x11:include(kernel/x11.pri)
1717mac:include(kernel/mac.pri)
18iphone:include(kernel/iphone.pri)
1819win32:include(kernel/win.pri)
1920embedded:include(embedded/embedded.pri)
2021symbian {
  
123123 friend void qt_mac_cgimage_data_free(void *, const void*, size_t);
124124 friend IconRef qt_mac_create_iconref(const QPixmap&);
125125 friend CGContextRef qt_mac_cg_context(const QPaintDevice*);
126#ifndef Q_WS_IPHONE
126127 friend QColor qcolorForThemeTextColor(ThemeTextColor themeColor);
128#endif
127129};
128130
129131QT_END_NAMESPACE
  
5050#if defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
5151# include <private/qpixmap_raster_p.h>
5252#endif
53#ifdef Q_WS_MAC
53#if defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
5454# include <private/qpixmap_mac_p.h>
5555#endif
5656
7777 return new QX11PixmapData(type);
7878#elif defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
7979 return new QRasterPixmapData(type);
80#elif defined(Q_WS_MAC)
80#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
8181 return new QMacPixmapData(type);
8282#else
8383#error QSimplePixmapDataFactory::create() not implemented
  
1!x11:!embedded:iphone {
2 LIBS_PRIVATE += -framework CoreFoundation -lz
3}
  
181181
182182}
183183
184!embedded:!x11:mac {
184!embedded:!x11:mac:iphone {
185185 SOURCES += \
186186 kernel/qclipboard_mac.cpp \
187187 kernel/qmime_mac.cpp \
  
499499 static Qt::NavigationMode navigationMode;
500500#endif
501501
502#if defined(Q_WS_MAC) || defined(Q_WS_X11)
502#if defined(Q_WS_MAC) || defined(Q_WS_IPHONE) || defined(Q_WS_X11)
503503 void _q_alertTimeOut();
504504 QHash<QWidget *, QTimer *> alertTimerHash;
505505#endif
  
115115
116116QT_BEGIN_NAMESPACE
117117Qt::MouseButtons qt_mac_get_buttons(int buttons);
118#ifndef Q_WS_IPHONE
118119Qt::MouseButton qt_mac_get_button(EventMouseButton button);
120#endif
119121void macWindowFade(void * /*OSWindowRef*/ window, float durationSeconds = 0);
120122bool macWindowIsTextured(void * /*OSWindowRef*/ window);
121123void macWindowToolbarShow(const QWidget *widget, bool show );
145145bool qt_mac_handleMouseEvent(void * /*QCocoaView * */view, void * /*NSEvent * */event, QEvent::Type eventType, Qt::MouseButton button);
146146bool qt_mac_handleTabletEvent(void * /*QCocoaView * */view, void * /*NSEvent * */event);
147147inline QApplication *qAppInstance() { return static_cast<QApplication *>(QCoreApplication::instance()); }
148#ifndef Q_WS_IPHONE
148149struct ::TabletProximityRec;
149150void qt_dispatchTabletProximityEvent(const ::TabletProximityRec &proxRec);
151#endif
150152Qt::KeyboardModifiers qt_cocoaModifiers2QtModifiers(ulong modifierFlags);
151153Qt::KeyboardModifiers qt_cocoaDragOperation2QtModifiers(uint dragOperations);
152154QPixmap qt_mac_convert_iconref(const IconRef icon, int width, int height);
  
5959#include <Cocoa/Cocoa.h>
6060#endif
6161
62#include <CoreServices/CoreServices.h>
62#ifndef Q_WS_IPHONE
63# include <CoreServices/CoreServices.h>
64# include <Carbon/Carbon.h>
65#else
66# include <CoreGraphics/CoreGraphics.h>
67#endif
6368
6469#include "QtCore/qglobal.h"
6570#include "QtCore/qvariant.h"
7575
7676#include "QtGui/qpainter.h"
7777
78#include <Carbon/Carbon.h>
7978
8079QT_BEGIN_NAMESPACE
8180class QWidget;
225225 uchar mime_type;
226226 mutable QPointer<QMimeData> mime;
227227 mutable bool mac_mime_source;
228#ifndef Q_WS_IPHONE
228229 static OSStatus promiseKeeper(OSPasteboardRef, PasteboardItemID, CFStringRef, void *);
230#endif
229231 void clear_helper();
230232public:
231233 QMacPasteboard(OSPasteboardRef p, uchar mime_type=0);
260260# undef check
261261#endif
262262
263#ifndef Q_WS_IPHONE
263264QFont qfontForThemeFont(ThemeFontID themeID);
264265
265266QColor qcolorForTheme(ThemeBrush brush);
266267
267268QColor qcolorForThemeTextColor(ThemeTextColor themeColor);
269#endif
268270
269271struct QMacDndAnswerRecord {
270272 QRect rect;
  
7777#include <private/qt_mac_p.h>
7878#endif
7979
80#ifdef Q_WS_IPHONE
81#include <private/qt_mac_p.h>
82#endif
83
8084#if defined(Q_WS_QWS)
8185#include "QtGui/qinputcontext.h"
8286#include "QtGui/qscreen_qws.h"
102102#if defined(Q_WS_QWS)
103103class QWSManager;
104104#endif
105#if defined(Q_WS_MAC)
105#if defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
106106class QCoreGraphicsPaintEnginePrivate;
107107#endif
108108class QPaintEngine;
163163#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
164164 HICON winIconBig; // internal big Windows icon
165165 HICON winIconSmall; // internal small Windows icon
166#elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC
166#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE) // <--------------------------------- MAC
167167 uint resizer : 4;
168168 uint isSetGeometry : 1;
169169 uint isMove : 1;
170170 quint32 wattr;
171171 quint32 wclass;
172 WindowGroupRef group;
172 //WindowGroupRef group;
173173 IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys.
174174 quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys()
175175#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
225225#elif defined(Q_WS_X11) // <--------------------------------------------------------- X11
226226 uint compress_events : 1;
227227 WId xDndProxy; // XDND forwarding to embedded windows
228#elif defined(Q_WS_MAC) // <------------------------------------------------------ MAC
228#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE) // <--------------------------------- MAC
229229#ifdef QT_MAC_USE_COCOA
230230 // Cocoa Mask stuff
231231 QImage maskBits;
  
9494
9595// Window system dependent definitions
9696
97#if defined(Q_WS_MAC) && !defined(Q_WS_QWS)
97#if defined(Q_WS_MAC) || defined(Q_WS_IPHONE) && !defined(Q_WS_QWS)
9898
9999#include <QtGui/qmacdefines_mac.h>
100100
101#ifdef Q_WS_MAC32
101#if defined(Q_WS_MAC32) || defined(Q_WS_IPHONE)
102102typedef int WId;
103103#else
104104typedef long WId;
  
4747#if defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
4848# include <private/qpixmap_raster_p.h>
4949#endif
50#ifdef Q_WS_MAC
50#if defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
5151# include <private/qpixmap_mac_p.h>
5252#endif
5353
6666 return new QX11PixmapData(type);
6767#elif defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
6868 return new QRasterPixmapData(type);
69#elif defined(Q_WS_MAC)
69#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
7070 return new QMacPixmapData(type);
7171#elif !defined(Q_WS_QWS)
7272#error QGraphicsSystem::createDefaultPixmapData() not implemented
  
5959template <class T> class QVector;
6060class QVariant;
6161
62#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
62#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_IPHONE) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
6363struct QRegionPrivate;
6464#endif
6565
145145 inline HRGN handle() const { ensureHandle(); return d->rgn; }
146146#elif defined(Q_WS_X11)
147147 inline Region handle() const { if(!d->rgn) updateX11Region(); return d->rgn; }
148#elif defined(Q_WS_MAC)
148#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
149149#if defined Q_WS_MAC32
150150 RgnHandle toQDRgn() const;
151151 RgnHandle toQDRgnForUpdate_sys() const;
179179 void updateX11Region() const;
180180 void *clipRectangles(int &num) const;
181181 friend void *qt_getClipRects(const QRegion &r, int &num);
182#elif defined(Q_WS_MAC)
182#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
183183 static OSStatus shape2QRegionHelper(int inMessage, HIShapeRef inShape,
184184 const CGRect *inRect, void *inRefcon);
185185#endif
200200#elif defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
201201 mutable RgnHandle unused; // Here for binary compatability reasons. ### Qt 5 remove.
202202#endif
203#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
203#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_IPHONE) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
204204 QRegionPrivate *qt_rgn;
205205#endif
206206 };
  
4141 styles += gtk
4242}
4343
44iphone{
45 styles -= mac
46 DEFINES += QT_NO_STYLE_MAC
47}
48
4449contains( styles, mac ) {
4550 HEADERS += \
4651 styles/qmacstyle_mac.h \
  
404404 bool writingSystemCheck : 1;
405405 bool loaded : 1;
406406#endif
407#if !defined(QWS) && defined(Q_OS_MAC)
407#if !defined(QWS) && (defined(Q_OS_MAC) || defined(Q_OS_IPHONE))
408408 bool fixedPitchComputed : 1;
409409#endif
410410#ifdef Q_WS_X11
431431 QtFontFoundry *foundry(const QString &f, bool = false);
432432};
433433
434#if !defined(QWS) && defined(Q_OS_MAC)
434#if !defined(QWS) && (defined(Q_OS_MAC) || defined(Q_OS_IPHONE))
435435inline static void qt_mac_get_fixed_pitch(QtFontFamily *f)
436436{
437437 if(f && !f->fixedPitchComputed) {
640640 HANDLE handle;
641641 bool memoryFont;
642642 QVector<FONTSIGNATURE> signatures;
643#elif defined(Q_WS_MAC)
643#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
644644 ATSFontContainerRef handle;
645645#endif
646646 QStringList families;
10351035QT_BEGIN_INCLUDE_NAMESPACE
10361036#if defined(Q_WS_X11)
10371037# include "qfontdatabase_x11.cpp"
1038#elif defined(Q_WS_MAC)
1038#elif defined(Q_WS_MAC) || defined(Q_WS_IPHONE)
10391039# include "qfontdatabase_mac.cpp"
10401040#elif defined(Q_WS_WIN)
10411041# include "qfontdatabase_win.cpp"
11271127}
11281128#endif // Q_WS_X11
11291129
1130#if !defined(Q_WS_MAC)
1130#if !(defined(Q_WS_MAC) || defined(Q_WS_IPHONE))
11311131static
11321132unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
11331133 const QtFontFamily *family, const QString &foundry_name,
  
88} else {
99 VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
1010}
11mac:!contains(QMAKE_EXT_C, .mm):QMAKE_EXT_C += .mm
11iphone|mac:!contains(QMAKE_EXT_C, .mm):QMAKE_EXT_C += .mm
1212
1313#load up the headers info
1414CONFIG += qt_install_headers
3535CONFIG += qt warn_on depend_includepath
3636CONFIG += qmake_cache target_qt
3737CONFIG -= fix_output_dirs
38win32|mac:!macx-xcode:CONFIG += debug_and_release
38win32|mac|iphone:!macx-xcode:CONFIG += debug_and_release
3939linux-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
4040
4141contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
4343contains(QT_CONFIG, largefile):CONFIG += largefile
4444
4545#mac frameworks
46mac:!static:contains(QT_CONFIG, qt_framework) {
46iphone|mac:!static:contains(QT_CONFIG, qt_framework) {
4747 #QMAKE_FRAMEWORK_VERSION = 4.0
4848 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
4949 CONFIG(debug, debug|release) {
6565 }
6666}
6767
68mac {
68iphone|mac {
6969 CONFIG += explicitlib
7070 macx-g++ {
7171 QMAKE_CFLAGS += -fconstant-cfstrings