Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsSVGGDIPlusGlyphGeometry.cpp File Reference
#include <windows.h>
#include <unknwn.h>
#include <Gdiplus.h>
#include "nsCOMPtr.h"
#include "nsSVGGDIPlusGlyphGeometry.h"
#include "nsISVGRendererGlyphGeometry.h"
#include "nsISVGGDIPlusCanvas.h"
#include "nsIDOMSVGMatrix.h"
#include "nsSVGGDIPlusRegion.h"
#include "nsISVGGDIPlusRegion.h"
#include "nsISVGRendererRegion.h"
#include "nsISVGGlyphGeometrySource.h"
#include "nsPromiseFlatString.h"
#include "nsSVGGDIPlusGlyphMetrics.h"
#include "nsISVGGDIPlusGlyphMetrics.h"
#include "nsPresContext.h"
#include "nsMemory.h"
#include "nsSVGGDIPlusGradient.h"
#include "nsSVGTypeCIDs.h"
#include "nsIComponentManager.h"
#include "nsIDOMSVGRect.h"

Go to the source code of this file.

Classes

class  nsSVGGDIPlusGlyphGeometry
 GDI+ glyph geometry implementation. More...
struct  gradCallbackStruct

Defines

#define M_PI   3.1415926

Functions

nsresult NS_NewSVGGDIPlusGlyphGeometry (nsISVGRendererGlyphGeometry **result, nsISVGGlyphGeometrySource *src)
static NS_INTERFACE_MAP_END void gradCBPath (Graphics *gfx, Brush *brush, void *cbStruct)
static void gradCBString (Graphics *gfx, Brush *brush, void *cbStruct)

Class Documentation

struct gradCallbackStruct

Definition at line 405 of file nsSVGGDIPlusGlyphGeometry.cpp.

Collaboration diagram for gradCallbackStruct:
Class Members
nsSVGCharacterPosition * cp
INT length
nsISVGGDIPlusGlyphMetrics * metrics
const WCHAR * start
StringFormat * stringformat
float x
float y

Define Documentation

#define M_PI   3.1415926

Definition at line 67 of file nsSVGGDIPlusGlyphGeometry.cpp.


Function Documentation

static NS_INTERFACE_MAP_END void gradCBPath ( Graphics *  gfx,
Brush *  brush,
void cbStruct 
) [static]

Definition at line 170 of file nsSVGGDIPlusGlyphGeometry.cpp.

{
  nsSVGGDIPlusGlyphGeometry *geom = (nsSVGGDIPlusGlyphGeometry *)cbStruct;
  gfx->FillPath(brush, geom->mStroke);
}
static void gradCBString ( Graphics *  gfx,
Brush *  brush,
void cbStruct 
) [static]

Definition at line 414 of file nsSVGGDIPlusGlyphGeometry.cpp.

{
  gradCallbackStruct *info = (gradCallbackStruct *)cbStruct;
  gfx->DrawString(info->start, info->length, info->metrics->GetFont(),
                  PointF(info->x, info->y), info->stringformat, brush);
  
  nsSVGCharacterPosition *cp = info->cp;

  if (!cp) {
    gfx->DrawString(info->start, info->length, info->metrics->GetFont(),
                    PointF(info->x, info->y), info->stringformat, brush);
  } else {
    for (PRUint32 i=0; i<info->length; i++) {
      if (cp[i].draw == PR_FALSE)
        continue;
      GraphicsState state = gfx->Save();
      gfx->TranslateTransform(cp[i].x, cp[i].y);
      gfx->RotateTransform(cp[i].angle * 180.0 / M_PI);
      gfx->DrawString(info->start + i, 1, info->metrics->GetFont(), PointF(0, 0),
                      info->stringformat, brush);
      gfx->Restore(state);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 134 of file nsSVGGDIPlusGlyphGeometry.cpp.

{
  *result = nsnull;
  
  nsSVGGDIPlusGlyphGeometry* gg = new nsSVGGDIPlusGlyphGeometry();
  if (!gg) return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(gg);

  nsresult rv = gg->Init(src);

  if (NS_FAILED(rv)) {
    NS_RELEASE(gg);
    return rv;
  }
  
  *result = gg;
  return rv;
}

Here is the call graph for this function: