Qt 4.8
Public Functions | Properties | List of all members
QTextItemIntCopy Class Reference

#include <qpaintbuffer_p.h>

Public Functions

QTextItemIntoperator() ()
 
 QTextItemIntCopy (const QTextItem &item)
 
 ~QTextItemIntCopy ()
 

Properties

QFont m_font
 
QTextItemInt m_item
 

Detailed Description

Definition at line 113 of file qpaintbuffer_p.h.

Constructors and Destructors

◆ QTextItemIntCopy()

QTextItemIntCopy::QTextItemIntCopy ( const QTextItem item)

Definition at line 63 of file qpaintbuffer.cpp.

64  : m_item(static_cast<const QTextItemInt &>(item))
65 {
66  QChar *chars = new QChar[m_item.num_chars];
67  unsigned short *logClusters = new unsigned short[m_item.num_chars];
68  memcpy(chars, m_item.chars, m_item.num_chars * sizeof(QChar));
69  memcpy(logClusters, m_item.logClusters, m_item.num_chars * sizeof(unsigned short));
70  m_item.chars = chars;
71  m_item.logClusters = logClusters;
72 
74  char *glyphLayoutData = new char[size];
75  QGlyphLayout glyphs(glyphLayoutData, m_item.glyphs.numGlyphs);
76  memcpy(glyphs.offsets, m_item.glyphs.offsets, m_item.glyphs.numGlyphs * sizeof(QFixedPoint));
77  memcpy(glyphs.glyphs, m_item.glyphs.glyphs, m_item.glyphs.numGlyphs * sizeof(HB_Glyph));
78  memcpy(glyphs.advances_x, m_item.glyphs.advances_x, m_item.glyphs.numGlyphs * sizeof(QFixed));
79  memcpy(glyphs.advances_y, m_item.glyphs.advances_y, m_item.glyphs.numGlyphs * sizeof(QFixed));
80  memcpy(glyphs.justifications, m_item.glyphs.justifications, m_item.glyphs.numGlyphs * sizeof(QGlyphJustification));
81  memcpy(glyphs.attributes, m_item.glyphs.attributes, m_item.glyphs.numGlyphs * sizeof(HB_GlyphAttributes));
82  m_item.glyphs = glyphs;
83 
84  m_font = *m_item.f;
85  m_item.f = &m_font;
86 
87  m_item.fontEngine->ref.ref(); // Increment reference count.
88 }
QAtomicInt ref
QFontEngine * fontEngine
QGlyphJustification * justifications
QFixed * advances_y
QFixed * advances_x
const QChar * chars
HB_Glyph * glyphs
const unsigned short * logClusters
bool ref()
Atomically increments the value of this QAtomicInt.
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
QGlyphLayout glyphs
static int spaceNeededForGlyphLayout(int totalGlyphs)
QTextItemInt m_item
HB_GlyphAttributes * attributes
QFixedPoint * offsets
const QFont * f

◆ ~QTextItemIntCopy()

QTextItemIntCopy::~QTextItemIntCopy ( )

Definition at line 90 of file qpaintbuffer.cpp.

91 {
92  delete m_item.chars;
93  delete m_item.logClusters;
94  delete m_item.glyphs.data();
95  if (!m_item.fontEngine->ref.deref())
96  delete m_item.fontEngine;
97 }
QAtomicInt ref
QFontEngine * fontEngine
char * data()
const QChar * chars
const unsigned short * logClusters
QGlyphLayout glyphs
bool deref()
Atomically decrements the value of this QAtomicInt.
QTextItemInt m_item

Functions

◆ operator()()

QTextItemInt& QTextItemIntCopy::operator() ( )
inline

Definition at line 118 of file qpaintbuffer_p.h.

118 {return m_item;}
QTextItemInt m_item

Properties

◆ m_font

QFont QTextItemIntCopy::m_font
private

Definition at line 121 of file qpaintbuffer_p.h.

Referenced by QTextItemIntCopy().

◆ m_item

QTextItemInt QTextItemIntCopy::m_item
private

Definition at line 120 of file qpaintbuffer_p.h.

Referenced by QTextItemIntCopy(), and ~QTextItemIntCopy().


The documentation for this class was generated from the following files: