Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Private Attributes
nsAutoDrawSpecBuffer Class Reference

List of all members.

Public Types

enum  { BUFFER_LEN = 1024 }
enum  { BUFFER_LEN = 1024 }

Public Member Functions

 nsAutoDrawSpecBuffer (XftDraw *aDraw, XftColor *aColor)
 ~nsAutoDrawSpecBuffer ()
void Flush ()
void Draw (nscoord x, nscoord y, XftFont *font, FT_UInt glyph)
 nsAutoDrawSpecBuffer (XftDraw *aDraw, XftColor *aColor)
 ~nsAutoDrawSpecBuffer ()
void Flush ()
void Draw (nscoord x, nscoord y, XftFont *font, FT_UInt glyph)

Private Attributes

XftDraw * mDraw
XftColor * mColor
PRUint32 mSpecPos
XftGlyphFontSpec mSpecBuffer [BUFFER_LEN]

Detailed Description

Definition at line 258 of file nsFontMetricsXft.cpp.


Member Enumeration Documentation

anonymous enum
Enumerator:
BUFFER_LEN 

Definition at line 260 of file nsFontMetricsXft.cpp.

{BUFFER_LEN=1024};
anonymous enum
Enumerator:
BUFFER_LEN 

Definition at line 260 of file nsFontMetricsXft.cpp.

{BUFFER_LEN=1024};

Constructor & Destructor Documentation

nsAutoDrawSpecBuffer::nsAutoDrawSpecBuffer ( XftDraw *  aDraw,
XftColor *  aColor 
) [inline]

Definition at line 261 of file nsFontMetricsXft.cpp.

                                                           :
                         mDraw(aDraw), mColor(aColor), mSpecPos(0) {}

Definition at line 264 of file nsFontMetricsXft.cpp.

                            {
        Flush();
    }

Here is the call graph for this function:

nsAutoDrawSpecBuffer::nsAutoDrawSpecBuffer ( XftDraw *  aDraw,
XftColor *  aColor 
) [inline]

Definition at line 261 of file nsFontMetricsXft.cpp.

                                                           :
                         mDraw(aDraw), mColor(aColor), mSpecPos(0) {}

Definition at line 264 of file nsFontMetricsXft.cpp.

                            {
        Flush();
    }

Here is the call graph for this function:


Member Function Documentation

void nsAutoDrawSpecBuffer::Draw ( nscoord  x,
nscoord  y,
XftFont *  font,
FT_UInt  glyph 
)

Definition at line 2139 of file nsFontMetricsXft.cpp.

{
    if (mSpecPos >= BUFFER_LEN-1)
        Flush();

    mSpecBuffer[mSpecPos].x = x;
    mSpecBuffer[mSpecPos].y = y;
    mSpecBuffer[mSpecPos].font = font;
    mSpecBuffer[mSpecPos].glyph = glyph;
    ++mSpecPos;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsAutoDrawSpecBuffer::Draw ( nscoord  x,
nscoord  y,
XftFont *  font,
FT_UInt  glyph 
)

Definition at line 2152 of file nsFontMetricsXft.cpp.

{
    if (mSpecPos) {
        // Some Xft libraries will crash if none of the glyphs have any
        // area.  So before we draw, we scan through the glyphs.  If we
        // find any that have area, we can draw.
        for (PRUint32 i = 0; i < mSpecPos; i++) {
            XftGlyphFontSpec *sp = &mSpecBuffer[i];
            XGlyphInfo info;
            XftGlyphExtents(GDK_DISPLAY(), sp->font, &sp->glyph, 1, &info);
            if (info.width && info.height) {
                // If we get here it means we found a drawable glyph.  We will
                // Draw all the remaining glyphs and then break out of the loop
                XftDrawGlyphFontSpec(mDraw, mColor, mSpecBuffer+i, mSpecPos-i);
                break;
            }
        }
        mSpecPos = 0;
    }
}

Here is the caller graph for this function:


Member Data Documentation

XftColor * nsAutoDrawSpecBuffer::mColor [private]

Definition at line 273 of file nsFontMetricsXft.cpp.

XftDraw * nsAutoDrawSpecBuffer::mDraw [private]

Definition at line 272 of file nsFontMetricsXft.cpp.

XftGlyphFontSpec nsAutoDrawSpecBuffer::mSpecBuffer [private]

Definition at line 275 of file nsFontMetricsXft.cpp.

Definition at line 274 of file nsFontMetricsXft.cpp.


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