Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsSVGRendererGDIPlusShim.cpp File Reference
#include <windows.h>
#include <unknwn.h>
#include <Gdiplus.h>
#include "nsCOMPtr.h"
#include "nsISVGRenderer.h"
#include "nsSVGRendererGDIPlus.h"

Go to the source code of this file.

Classes

class  nsSVGRendererGDIPlus
 GDI+ renderer factory. More...

Functions

static Status (WINAPI *pGdiplusStartup)(OUT ULONG_PTR *
static const
GdiplusStartupInput OUT
GdiplusStartupOutput *static 
VOID (WINAPI *pGdiplusShutdown)(ULONG_PTR)
static PRBool TryLoadLibraries ()
nsresult NS_NewSVGRendererGDIPlus (nsISVGRenderer **aResult)
void NS_InitSVGRendererGDIPlusGlobals ()
void NS_FreeSVGRendererGDIPlusGlobals ()
 NS_IMPL_ISUPPORTS1 (nsSVGRendererGDIPlus, nsISVGRenderer)

Variables

static
nsSVGRendererGDIPlusFunctions
rendererFunctions = nsnull

Function Documentation

Definition at line 173 of file nsSVGRendererGDIPlusShim.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 162 of file nsSVGRendererGDIPlusShim.cpp.

{
  if (!TryLoadLibraries())
    return;

  rendererFunctions->NS_InitSVGGDIPlusGlyphMetricsGlobals();
  
  // initialize gdi+ lazily in nsSVGRendererGDIPlus CTOR
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 143 of file nsSVGRendererGDIPlusShim.cpp.

{
  NS_PRECONDITION(aResult != nsnull, "null ptr");
  if (! aResult)
    return NS_ERROR_NULL_POINTER;

  if (!TryLoadLibraries())
    return NS_ERROR_FAILURE;

  nsSVGRendererGDIPlus* result = new nsSVGRendererGDIPlus();
  if (! result)
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(result);
  *aResult = result;
  return NS_OK;
}

Here is the call graph for this function:

static Status ( WINAPI *  pGdiplusStartup) [static]
static PRBool TryLoadLibraries ( ) [static]

Definition at line 106 of file nsSVGRendererGDIPlusShim.cpp.

{
  static PRBool attemptedLoad = PR_FALSE, successfulLoad = PR_FALSE;

  if (attemptedLoad)
    return successfulLoad;
  else
    attemptedLoad = PR_TRUE;

  HMODULE gdiplus, gkgdiplus;

  if ((gdiplus = LoadLibrary("gdiplus.dll")) == NULL)
    return PR_FALSE;
  pGdiplusStartup =
    (Status (WINAPI *)(OUT ULONG_PTR *, const GdiplusStartupInput *, OUT GdiplusStartupOutput *))GetProcAddress(gdiplus, "GdiplusStartup");
  pGdiplusShutdown =
     (VOID (WINAPI *)(ULONG_PTR))GetProcAddress(gdiplus, "GdiplusShutdown");

  if (!pGdiplusStartup || !pGdiplusShutdown)
    return PR_FALSE;
  
  if ((gkgdiplus = LoadLibrary("gksvggdiplus.dll")) == NULL)
    return PR_FALSE;

  nsSVGRendererGDIPlusFunctions *(*getFuncs)() = nsnull;

  getFuncs = (nsSVGRendererGDIPlusFunctions *(*)())GetProcAddress(gkgdiplus, "NS_GetSVGRendererGDIPlusFunctions");

  if (!getFuncs)
    return PR_FALSE;
  rendererFunctions = getFuncs();
  
  successfulLoad = PR_TRUE;
  return PR_TRUE;
}  

Here is the call graph for this function:

Here is the caller graph for this function:

static const GdiplusStartupInput OUT GdiplusStartupOutput* static VOID ( WINAPI *  pGdiplusShutdown) [static]

Here is the caller graph for this function:


Variable Documentation

Definition at line 55 of file nsSVGRendererGDIPlusShim.cpp.