Qt 4.8
Classes | Typedefs | Functions | Variables
qmime_mac.cpp File Reference
#include "qmime.h"
#include "qfile.h"
#include "qfileinfo.h"
#include "qtextstream.h"
#include "qdir.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include "qdebug.h"
#include "qpixmap.h"
#include "qimagewriter.h"
#include "qimagereader.h"
#include "qdatastream.h"
#include "qbuffer.h"
#include "qdatetime.h"
#include "qapplication_p.h"
#include "qtextcodec.h"
#include "qregexp.h"
#include "qurl.h"
#include "qmap.h"
#include <private/qt_mac_p.h>

Go to the source code of this file.

Classes

class  QMacPasteboardMimeAny
 
class  QMacPasteboardMimeFileUri
 
class  QMacPasteboardMimeHTMLText
 
class  QMacPasteboardMimePlainText
 
class  QMacPasteboardMimeTiff
 
class  QMacPasteboardMimeTypeName
 
class  QMacPasteboardMimeUnicodeText
 
class  QMacPasteboardMimeUrl
 
class  QMacPasteboardMimeVCard
 

Typedefs

typedef QList< QMacPasteboardMime * > MimeList
 

Functions

static void cleanup_mimes ()
 
const QStringListqEnabledDraggedTypes ()
 
Q_GUI_EXPORT void qRegisterDraggedTypes (const QStringList &types)
 
CGImageRef qt_mac_createCGImageFromQImage (const QImage &img, const QImage **imagePtr=0)
 

Variables

ScrapFlavorType qt_mac_mime_type = 'CUTE'
 
CFStringRef qt_mac_mime_typeUTI = CFSTR("com.pasteboard.trolltech.marker")
 

Typedef Documentation

◆ MimeList

Definition at line 81 of file qmime_mac.cpp.

Function Documentation

◆ cleanup_mimes()

static void cleanup_mimes ( )
static

Definition at line 84 of file qmime_mac.cpp.

Referenced by QMacPasteboardMime::initialize().

85 {
86  MimeList *mimes = globalMimeList();
87  while (!mimes->isEmpty())
88  delete mimes->takeFirst();
89 }
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
T takeFirst()
Removes the first item in the list and returns it.
Definition: qlist.h:489
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ qEnabledDraggedTypes()

const QStringList& qEnabledDraggedTypes ( )

Definition at line 114 of file qmime_mac.cpp.

115 {
116  return (*globalDraggedTypesList());
117 }

◆ qRegisterDraggedTypes()

Q_GUI_EXPORT void qRegisterDraggedTypes ( const QStringList types)
related

Definition at line 109 of file qmime_mac.cpp.

110 {
111  (*globalDraggedTypesList()) += types;
112 }

◆ qt_mac_createCGImageFromQImage()

CGImageRef qt_mac_createCGImageFromQImage ( const QImage img,
const QImage **  imagePtr = 0 
)

Definition at line 1006 of file qpaintengine_mac.cpp.

Referenced by QMacPasteboardMimeHTMLText::convertFromMime(), QMacPasteboardMimeTiff::convertFromMime(), and QCoreGraphicsPaintEngine::drawImage().

1007 {
1008  QImage *image;
1009  if (img.depth() != 32)
1011  else
1012  image = new QImage(img);
1013 
1014  uint cgflags = kCGImageAlphaNone;
1015  switch (image->format()) {
1017  cgflags = kCGImageAlphaPremultipliedFirst;
1018  break;
1019  case QImage::Format_ARGB32:
1020  cgflags = kCGImageAlphaFirst;
1021  break;
1022  case QImage::Format_RGB32:
1023  cgflags = kCGImageAlphaNoneSkipFirst;
1024  default:
1025  break;
1026  }
1027 #if defined(kCGBitmapByteOrder32Host) //only needed because CGImage.h added symbols in the minor version
1028  cgflags |= kCGBitmapByteOrder32Host;
1029 #endif
1030  QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(image,
1031  static_cast<const QImage *>(image)->bits(),
1032  image->byteCount(),
1034  if (imagePtr)
1035  *imagePtr = image;
1036  return CGImageCreate(image->width(), image->height(), 8, 32,
1037  image->bytesPerLine(),
1039  cgflags, dataProvider, 0, false, kCGRenderingIntentDefault);
1040 
1041 }
static CGColorSpaceRef macGenericColorSpace()
int byteCount() const
Returns the number of bytes occupied by the image data.
Definition: qimage.cpp:1800
static void drawImageReleaseData(void *info, const void *, size_t)
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
Format format() const
Returns the format of the image.
Definition: qimage.cpp:2305
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
int depth() const
Returns the depth of the image.
Definition: qimage.cpp:1620
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572

Variable Documentation

◆ qt_mac_mime_type

ScrapFlavorType qt_mac_mime_type = 'CUTE'

Definition at line 125 of file qmime_mac.cpp.

◆ qt_mac_mime_typeUTI

CFStringRef qt_mac_mime_typeUTI = CFSTR("com.pasteboard.trolltech.marker")

Definition at line 126 of file qmime_mac.cpp.