Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
nsDeviceContextPh Class Reference

#include <nsDeviceContextPh.h>

Collaboration diagram for nsDeviceContextPh:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsDeviceContextPh ()
virtual ~nsDeviceContextPh ()
NS_IMETHOD Init (nsNativeWidget aWidget)
NS_IMETHOD CreateRenderingContext (nsIRenderingContext *&aContext)
NS_IMETHOD CreateRenderingContext (nsIView *aView, nsIRenderingContext *&aContext)
NS_IMETHOD CreateRenderingContext (nsIWidget *aWidget, nsIRenderingContext *&aContext)
NS_IMETHODIMP SupportsNativeWidgets (PRBool &aSupportsWidgets)
NS_IMETHODIMP GetScrollBarDimensions (float &aWidth, float &aHeight) const
NS_IMETHOD GetSystemFont (nsSystemFontID anID, nsFont *aFont) const
NS_IMETHODIMP GetDrawingSurface (nsIRenderingContext &aContext, nsIDrawingSurface *&aSurface)
NS_IMETHOD CheckFontExistence (const nsString &aFontName)
NS_IMETHOD GetDeviceSurfaceDimensions (PRInt32 &aWidth, PRInt32 &aHeight)
NS_IMETHOD GetClientRect (nsRect &aRect)
NS_IMETHOD GetRect (nsRect &aRect)
NS_IMETHOD GetDeviceContextFor (nsIDeviceContextSpec *aDevice, nsIDeviceContext *&aContext)
NS_IMETHOD BeginDocument (PRUnichar *t, PRUnichar *aPrintToFileName, PRInt32 aStartPage, PRInt32 aEndPage)
NS_IMETHOD EndDocument (void)
NS_IMETHOD AbortDocument (void)
NS_IMETHOD BeginPage (void)
NS_IMETHOD EndPage (void)
NS_IMETHODIMP GetDepth (PRUint32 &aDepth)
nsresult SetDPI (PRInt32 dpi)

Static Public Member Functions

static int prefChanged (const char *aPref, void *aClosure)

Protected Member Functions

nsresult Init (nsNativeDeviceContext aContext, nsIDeviceContext *aOrigContext)
nsresult GetDisplayInfo (PRInt32 &aWidth, PRInt32 &aHeight, PRUint32 &aDepth)
void CommonInit (nsNativeDeviceContext aDC)
void GetPrinterRect (int *width, int *height)

Protected Attributes

nsIDrawingSurfacemSurface
PRUint32 mDepth
float mPixelScale
PRInt16 mScrollbarHeight
PRInt16 mScrollbarWidth
float mWidthFloat
float mHeightFloat
PRInt32 mWidth
PRInt32 mHeight
nsIDeviceContextSpecmSpec
nsNativeDeviceContext mDC
PhGC_t * mGC
PRBool mIsPrintingStart

Static Protected Attributes

static nscoord mDpi = 96

Private Member Functions

int ReadSystemFonts () const
void DefaultSystemFonts () const

Private Attributes

nsCOMPtr< nsIScreenManagermScreenManager

Detailed Description

Definition at line 51 of file nsDeviceContextPh.h.


Constructor & Destructor Documentation

Definition at line 61 of file nsDeviceContextPh.cpp.

  : DeviceContextImpl()
  {
  mTwipsToPixels = 1.0;
  mPixelsToTwips = 1.0;
  mDepth = 0 ;
  mSurface = NULL;
  mPixelScale = 1.0f;
  mWidthFloat = 0.0f;
  mHeightFloat = 0.0f;

  /* These *MUST* be -1 */
  mWidth = -1;
  mHeight = -1;

  mSpec = nsnull;
  mDC = nsnull;
       mGC = nsnull;

       mIsPrintingStart = 0;
       }

Here is the caller graph for this function:

Definition at line 83 of file nsDeviceContextPh.cpp.

                                         {
  nsDrawingSurfacePh *surf = (nsDrawingSurfacePh *)mSurface;

  NS_IF_RELEASE(surf);    //this clears the surf pointer...
  mSurface = nsnull;

       if( mGC ) PgDestroyGC( mGC ); /* we are always the owners of this gc */

       if( mFontLoadCache ) { 
#ifdef DEBUG_Adrian
printf( "\n\n\n!!!!!!!!!!!!!!!!! ~nsDeviceContextPh is unloading the mFontLoadCache!!!!!!!!!!!!!!!!!!!\n\n" );
#endif
              delete mFontLoadCache;
              mFontLoadCache = nsnull;
              }
       NS_IF_RELEASE( mSpec );
       }

Member Function Documentation

Definition at line 569 of file nsDeviceContextPh.cpp.

                                                       {
  return EndDocument();
       }

Here is the call graph for this function:

NS_IMETHODIMP nsDeviceContextPh::BeginDocument ( PRUnichar t,
PRUnichar aPrintToFileName,
PRInt32  aStartPage,
PRInt32  aEndPage 
)

Definition at line 552 of file nsDeviceContextPh.cpp.

                                                                                                                                {
       if( mSpec ) {
              PpPrintContext_t *pc = ((nsDeviceContextSpecPh *)mSpec)->GetPrintContext();
              PpStartJob(pc);
              mIsPrintingStart = 1;
              }
       return NS_OK;
       }

Definition at line 573 of file nsDeviceContextPh.cpp.

                                                   {
       if( mSpec ) {
              PpPrintContext_t *pc = ((nsDeviceContextSpecPh *)mSpec)->GetPrintContext();
              PpContinueJob( pc );
              if( !mIsPrintingStart ) PpPrintNewPage( pc );
              mIsPrintingStart = 0;
              }
       return NS_OK;
       }

Definition at line 421 of file nsDeviceContextPh.cpp.

                                                                                 {
  char *fontName = ToNewCString(aFontName);

  if( fontName ) {

#ifdef DEBUG_Adrian
printf( "\tCheckFontExistence for fontName=%s\n", fontName );
#endif

              nsCStringKey key( fontName );
              if( !mFontLoadCache ) mFontLoadCache = new nsHashtable();
              else {
                     int value = ( int ) mFontLoadCache->Get( &key );
                     if( value == 1 ) { /* the font exists and you already asked this before */
                            delete [] fontName;
#ifdef DEBUG_Adrian
printf( "\t\tFound it in cache it exists\n" );
#endif
                            return NS_OK;
                            }
                     else if( value == 2 ) { /* the font doesn't exist and you already asked this before */
                            delete [] fontName;
#ifdef DEBUG_Adrian
printf( "\t\tFound it in cache it doesnt exist\n" );
#endif
                            return NS_ERROR_FAILURE;
                            }
                     /* else you didn't ask this before */
#ifdef DEBUG_Adrian
printf( "\t\t Not Found in cache\n" );
#endif
                     }

              /* here either the mFontLoadCache was not allocated ( first time ) or this is the first time you ask about it */
              
       nsresult res;
              if( PfFindFont( (char *)fontName, 0, 0 ) ) {
                     mFontLoadCache->Put( &key, (void*)1 );
                     res = NS_OK;
                     }
              else {
                     mFontLoadCache->Put( &key, (void*)2 );
                     res = NS_ERROR_FAILURE;
                     }
              delete [] fontName;
              return res;
              }

       return NS_ERROR_FAILURE;
       }

Here is the call graph for this function:

Definition at line 174 of file nsDeviceContextPh.cpp.

                                                                {
  PRInt32           aWidth, aHeight;
  static int        initialized = 0;


       if( !mScreenManager ) mScreenManager = do_GetService("@mozilla.org/gfx/screenmanager;1");

  if( !initialized ) {
    initialized = 1;
    // Set prefVal the value of the preference "layout.css.dpi"
    // or -1 if we can't get it.
    // If it's negative, we pretend it's not set.
    // If it's 0, it means force use of the operating system's logical resolution.
    // If it's positive, we use it as the logical resolution
    PRInt32 prefVal = -1;
    nsresult res;

    nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res));
    if( NS_SUCCEEDED( res ) && prefs ) {
      res = prefs->GetIntPref("layout.css.dpi", &prefVal);
      if( NS_FAILED( res ) ) {
        prefVal = 96;
       }

      prefs->RegisterCallback( "layout.css.dpi", prefChanged, (void *)this );
      if( prefVal >0 ) mDpi = prefVal;
       }
       }

  SetDPI( mDpi );

       GetDisplayInfo(aWidth, aHeight, mDepth);

       /* Turn off virtual console support... */
       mWidthFloat  = (float) aWidth;
       mHeightFloat = (float) aHeight;
    
  /* Revisit: the scroll bar sizes is a gross guess based on Phab */
  mScrollbarHeight = 17;
  mScrollbarWidth  = 17;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 216 of file nsDeviceContextPh.cpp.

                                                                                          {

#ifdef NS_PRINT_PREVIEW
       // Defer to Alt when there is one
       if(mAltDC && ((mUseAltDC & kUseAltDCFor_CREATERC_PAINT) || (mUseAltDC & kUseAltDCFor_CREATERC_REFLOW))) {
              return mAltDC->CreateRenderingContext(aContext);
              }
#endif

  nsIRenderingContext *pContext;
  nsresult             rv;
  nsDrawingSurfacePh  *surf;
   
       pContext = new nsRenderingContextPh();
       
       if( nsnull != pContext ) {
         NS_ADDREF(pContext);

         surf = new nsDrawingSurfacePh();
         if( nsnull != surf ) {
                     PpPrintContext_t *pc = ((nsDeviceContextSpecPh *)mSpec)->GetPrintContext();
                     mGC = PgCreateGC( 0 );
                     rv = surf->Init( (PhDrawContext_t*)pc, mGC );
                     if( NS_OK == rv ) rv = pContext->Init(this, surf);
                     else rv = NS_ERROR_OUT_OF_MEMORY;
                     }
              }
       else rv = NS_ERROR_OUT_OF_MEMORY;

       if( NS_OK != rv ) NS_IF_RELEASE( pContext );

       aContext = pContext;
       return rv;
       }

Here is the call graph for this function:

Definition at line 61 of file nsDeviceContextPh.h.

{return (DeviceContextImpl::CreateRenderingContext(aView,aContext));}

Definition at line 62 of file nsDeviceContextPh.h.

{return (DeviceContextImpl::CreateRenderingContext(aWidget,aContext));}

Definition at line 561 of file nsDeviceContextPh.cpp.

                                                     {
       if( mSpec ) {
       PpPrintContext_t *pc = ((nsDeviceContextSpecPh *)mSpec)->GetPrintContext();
       PpEndJob(pc);
              }
  return NS_OK;
       }

Here is the caller graph for this function:

Definition at line 583 of file nsDeviceContextPh.cpp.

                                                 {
       if( mSpec ) {
              PpPrintContext_t *pc = ((nsDeviceContextSpecPh *)mSpec)->GetPrintContext();
              PpSuspendJob(pc);
              }
       return NS_OK;
       }

Definition at line 103 of file nsDeviceContextPh.h.

{ return GetRect ( aRect ); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 117 of file nsDeviceContextPh.h.

              {
              aDepth = mDepth; // 24;
              return NS_OK;
              }

Definition at line 512 of file nsDeviceContextPh.cpp.

                                                                                                                   {
       nsDeviceContextPh* devConPh = new nsDeviceContextPh(); //ref count 0
       if (devConPh != nsnull) {
              // this will ref count it
       nsresult rv = devConPh->QueryInterface(NS_GET_IID(nsIDeviceContext), (void**)&aContext);
              NS_ASSERTION(NS_SUCCEEDED(rv), "This has to support nsIDeviceContext");
       } else {
           return NS_ERROR_OUT_OF_MEMORY;
       }

       devConPh->mSpec = aDevice;
       NS_ADDREF(aDevice);
       return devConPh->Init(NULL, this);
       }

Here is the call graph for this function:

Definition at line 473 of file nsDeviceContextPh.cpp.

                                                                                                 {

#ifdef NS_PRINT_PREVIEW
       // Defer to Alt when there is one
       if (mAltDC && (mUseAltDC & kUseAltDCFor_SURFACE_DIM)) {
              return mAltDC->GetDeviceSurfaceDimensions(aWidth, aHeight);
              }
#endif

  if( mWidth == -1 ) mWidth = NSToIntRound(mWidthFloat * mDevUnitsToAppUnits);
  if( mHeight == -1 ) mHeight = NSToIntRound(mHeightFloat * mDevUnitsToAppUnits);

  aWidth = mWidth;
  aHeight = mHeight;

  return NS_OK;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsDeviceContextPh::GetDisplayInfo ( PRInt32 aWidth,
PRInt32 aHeight,
PRUint32 aDepth 
) [protected]

Definition at line 594 of file nsDeviceContextPh.cpp.

                                                                                                  {
  nsresult                         res = NS_ERROR_FAILURE;
  PhSysInfo_t       SysInfo;
  PhRect_t          rect;
  char              *p = NULL;
  int               inp_grp;
  PhRid_t           rid;

  /* Initialize variables */
  aWidth  = 0;
  aHeight = 0;
  aDepth  = 0;
  
       /* Get the Screen Size and Depth*/
       p = getenv("PHIG");
       if( p ) inp_grp = atoi( p );
       else inp_grp = 1;

       PhQueryRids( 0, 0, inp_grp, Ph_GRAFX_REGION, 0, 0, 0, &rid, 1 );
       PhWindowQueryVisible( Ph_QUERY_IG_POINTER, 0, inp_grp, &rect );
       aWidth  = rect.lr.x - rect.ul.x + 1;
       aHeight = rect.lr.y - rect.ul.y + 1;  

       /* Get the System Info for the RID */
       if( PhQuerySystemInfo( rid, NULL, &SysInfo ) ) {
              /* Make sure the "color_bits" field is valid */
              if( SysInfo.gfx.valid_fields & Ph_GFX_COLOR_BITS ) {
                     aDepth = SysInfo.gfx.color_bits;
                     res = NS_OK;
                     }
              }
  return res;
       }

Here is the caller graph for this function:

Definition at line 92 of file nsDeviceContextPh.h.

              {
              nsRect aRect;
              GetClientRect( aRect );
              aContext.CreateDrawingSurface(aRect, 0, aSurface);
              return nsnull == aSurface ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
              }

Here is the call graph for this function:

void nsDeviceContextPh::GetPrinterRect ( int width,
int height 
) [protected]

Definition at line 140 of file nsDeviceContextPh.cpp.

                                                                  {
       PhDim_t dim;
       const PhDim_t *psize;
       const PhRect_t       *non_print;
       PhRect_t      rect, margins;
       const char *orientation = 0;
       int                  tmp;
       PpPrintContext_t *pc = ((nsDeviceContextSpecPh *)mSpec)->GetPrintContext();
       
       memset( &rect, 0, sizeof(rect));
       memset( &margins, 0, sizeof(margins));

       PpPrintGetPC(pc, Pp_PC_PAPER_SIZE, (const void **)&psize );
       PpPrintGetPC(pc, Pp_PC_NONPRINT_MARGINS, (const void **)&non_print );
       dim.w = (psize->w - ( non_print->ul.x + non_print->lr.x )) * 100 / 1000;
       dim.h = (psize->h - ( non_print->ul.x + non_print->lr.x )) * 100 / 1000;

       PpPrintGetPC(pc, Pp_PC_ORIENTATION, (const void **)&orientation );

       if( *orientation ) {
              tmp = dim.w;
              dim.w = dim.h;
              dim.h = tmp;
              }

       /* set these to 0 since we do the margins */
       PpPrintSetPC(pc, INITIAL_PC, 0 , Pp_PC_MARGINS, &rect ); 
       PpPrintSetPC(pc, INITIAL_PC, 0 , Pp_PC_SOURCE_SIZE, &dim );

       *width = dim.w;
       *height = dim.h;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 491 of file nsDeviceContextPh.cpp.

                                                        {
       if( mScreenManager ) {
    nsCOMPtr<nsIScreen> screen;
    mScreenManager->GetPrimaryScreen( getter_AddRefs( screen ) );
    screen->GetRect(&aRect.x, &aRect.y, &aRect.width, &aRect.height);
    aRect.x = NSToIntRound(mDevUnitsToAppUnits * aRect.x);
    aRect.y = NSToIntRound(mDevUnitsToAppUnits * aRect.y);
    aRect.width = NSToIntRound(mDevUnitsToAppUnits * aRect.width);
    aRect.height = NSToIntRound(mDevUnitsToAppUnits * aRect.height);
              }
       else {
       PRInt32 width, height;
       GetDeviceSurfaceDimensions( width, height );
       aRect.x = 0;
       aRect.y = 0;
       aRect.width = width;
       aRect.height = height;
              }
  return NS_OK;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsDeviceContextPh::GetScrollBarDimensions ( float &  aWidth,
float &  aHeight 
) const [inline]

Definition at line 74 of file nsDeviceContextPh.h.

              {
              /* Revisit: the scroll bar sizes is a gross guess based on Phab */
              float scale;
              GetCanonicalPixelScale(scale);
              aWidth = mScrollbarWidth * mPixelsToTwips * scale;
              aHeight = mScrollbarHeight * mPixelsToTwips * scale;
              return NS_OK;
              }

Definition at line 363 of file nsDeviceContextPh.cpp.

{

       if( !InitSystemFonts ) {
              InitSystemFonts = 1;
              DefaultSystemFonts( );
              ReadSystemFonts( );
              }

       aFont->decorations = NS_FONT_DECORATION_NONE;

  switch (aID) {
    case eSystemFont_Caption:      // css2
              case eSystemFont_Icon:
              case eSystemFont_SmallCaption:
              case eSystemFont_StatusBar:
              case eSystemFont_Window:       // css3
              case eSystemFont_Document:
              case eSystemFont_Workspace:
              case eSystemFont_Desktop:
              case eSystemFont_Info:
              case eSystemFont_Dialog:
              case eSystemFont_Button:
              case eSystemFont_PullDownMenu:
              case eSystemFont_List:
              case eSystemFont_Field:
              case eSystemFont_Widget:
              aFont->name.AssignWithConversion( FaceGeneralFont );
                     aFont->style = StyleGeneralFont;
                     aFont->weight = WeightGeneralFont;
                     aFont->size = SizeGeneralFont / ( mAppUnitsToDevUnits * 0.68 ); /* see nsFontMetricsPh::Init */
                     break;
              case eSystemFont_MessageBox:
                     aFont->name.AssignWithConversion( FaceMessageFont );
                     aFont->style = StyleMessageFont;
                     aFont->weight = WeightMessageFont;
                     aFont->size = SizeMessageFont / ( mAppUnitsToDevUnits * 0.68 ); /* see nsFontMetricsPh::Init */
                     break;
              case eSystemFont_Tooltips:     // moz
                     aFont->name.AssignWithConversion( FaceBalloonFont );
                     aFont->style = StyleBalloonFont;
                     aFont->weight = WeightBalloonFont;
                     aFont->size = SizeBalloonFont / ( mAppUnitsToDevUnits * 0.68 ); /* see nsFontMetricsPh::Init */
                     break;
              case eSystemFont_Menu:
                     aFont->name.AssignWithConversion( FaceMenuFont );
                     aFont->style = StyleMenuFont;
                     aFont->weight = WeightMenuFont;
                     aFont->size = SizeMenuFont / ( mAppUnitsToDevUnits * 0.68 ); /* see nsFontMetricsPh::Init */
                     break;
       }

  aFont->systemFont = PR_TRUE;

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 101 of file nsDeviceContextPh.cpp.

                                                                {
    
  CommonInit(NULL);
 
  // Call my base class
  return DeviceContextImpl::Init( aWidget );
       }

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsDeviceContextPh::Init ( nsNativeDeviceContext  aContext,
nsIDeviceContext aOrigContext 
) [protected]

Definition at line 111 of file nsDeviceContextPh.cpp.

                                                                                                   {
  float origscale, newscale, t2d, a2d;
    
  mDC = aContext;

  CommonInit(mDC);

  newscale = TwipsToDevUnits();
  origscale = aOrigContext->AppUnitsToDevUnits();
  
  mPixelScale = newscale / origscale;

  t2d = aOrigContext->TwipsToDevUnits();
  a2d = aOrigContext->AppUnitsToDevUnits();

  mAppUnitsToDevUnits = (a2d / t2d) * mTwipsToPixels;
  mDevUnitsToAppUnits = 1.0f / mAppUnitsToDevUnits;

       int w, h;
       GetPrinterRect( &w, &h );
       mWidthFloat = w;
       mHeightFloat = h;

       /* Call Base Class */
       DeviceContextImpl::CommonInit( );

       return NS_OK;
       }

Here is the call graph for this function:

int nsDeviceContextPh::prefChanged ( const char *  aPref,
void aClosure 
) [static]

Definition at line 539 of file nsDeviceContextPh.cpp.

                                                                      {
  nsDeviceContextPh *context = (nsDeviceContextPh*)aClosure;
  nsresult rv;

  if( nsCRT::strcmp(aPref, "layout.css.dpi")==0 )  {
    PRInt32 dpi;
    nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &rv));
    rv = prefs->GetIntPref(aPref, &dpi);
    if( NS_SUCCEEDED( rv ) ) context->SetDPI( dpi ); 
              }
  return 0;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 259 of file nsDeviceContextPh.cpp.

{
       FILE *fp;
       char buffer[512];

       fp = fopen( "/usr/share/mozilla/system_fonts", "r" );
       if( !fp ) return -1;

       while ( fgets( buffer, 512, fp ) != NULL ) {
              int len, code;
              char *p, **face;
              int *size;
              short *style, *weight;

              /* skip comments and blank lines */
              if( buffer[0] == '#' || buffer[0] == ' ' || buffer[0] == '\n' ) continue;
              len = strlen( buffer );
              if( len<3 ) continue;

              if( buffer[len-1] == '\n' ) buffer[ len-1 ] = 0;

              code = buffer[0] << 8 | buffer[1];
              p = &buffer[2];
              switch( code ) {
                     case 'h=':
                            if( !strcmp( p, "General" ) ) {
                                   style = &StyleGeneralFont;
                                   face = &FaceGeneralFont;
                                   weight = &WeightGeneralFont;
                                   size = &SizeGeneralFont;
                                   }
                            else if( !strcmp( p, "Message" ) ) {
                                   style = &StyleMessageFont;
                                   face = &FaceMessageFont;
                                   weight = &WeightMessageFont;
                                   size = &SizeMessageFont;
                                   }
                            else if( !strcmp( p, "Menu" ) ) {
                                   style = &StyleMenuFont;
                                   face = &FaceMenuFont;
                                   weight = &WeightMenuFont;
                                   size = &SizeMenuFont;
                                   }
                            else if( !strcmp( p, "Balloon" ) ) {
                                   style = &StyleBalloonFont;
                                   face = &FaceBalloonFont;
                                   weight = &WeightBalloonFont;
                                   size = &SizeBalloonFont;
                                   }
                            break;
                     case 'f=':
                            *face = strdup( p );
                            break;
                     case 's=':
                            *size = atoi( p );
                            break;
                     case 'w=':
                            *weight = 0;
                            if( strstr( p, "bold" ) )
                                   *weight = NS_FONT_WEIGHT_BOLD;
                            else
                                   *weight = NS_FONT_WEIGHT_NORMAL;
                            break;
                     case 'S=':
                            *style = 0;
                            if( strstr( p, "italic" ) )
                                   *style = NS_FONT_STYLE_ITALIC;
                            else
                                   *style = NS_FONT_STYLE_NORMAL;
                            if( strstr( p, "antialias" ) )
                                   *style |= NS_FONT_STYLE_ANTIALIAS;

                            break;
                     }
              }

       fclose( fp );

       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 527 of file nsDeviceContextPh.cpp.

                                                 {
  const int pt2t = 82;//72

  mDpi = aDpi;

  // make p2t a nice round number - this prevents rounding problems
  mPixelsToTwips = float(NSToIntRound(float(NSIntPointsToTwips(pt2t)) / float(aDpi)));
  mTwipsToPixels = 1.0f / mPixelsToTwips;
  // XXX need to reflow all documents
  return NS_OK;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file nsDeviceContextPh.h.

              {
              /* REVISIT: These needs to return FALSE if we are printing! */
         if( nsnull == mDC ) aSupportsWidgets = PR_TRUE;
         else aSupportsWidgets = PR_FALSE;   /* while printing! */
         return NS_OK;
              }

Member Data Documentation

Definition at line 145 of file nsDeviceContextPh.h.

Definition at line 134 of file nsDeviceContextPh.h.

nscoord nsDeviceContextPh::mDpi = 96 [static, protected]

Definition at line 148 of file nsDeviceContextPh.h.

PhGC_t* nsDeviceContextPh::mGC [protected]

Definition at line 146 of file nsDeviceContextPh.h.

Definition at line 142 of file nsDeviceContextPh.h.

Definition at line 140 of file nsDeviceContextPh.h.

Definition at line 150 of file nsDeviceContextPh.h.

float nsDeviceContextPh::mPixelScale [protected]

Definition at line 135 of file nsDeviceContextPh.h.

Definition at line 153 of file nsDeviceContextPh.h.

Definition at line 136 of file nsDeviceContextPh.h.

Definition at line 137 of file nsDeviceContextPh.h.

Definition at line 144 of file nsDeviceContextPh.h.

Definition at line 133 of file nsDeviceContextPh.h.

Definition at line 141 of file nsDeviceContextPh.h.

float nsDeviceContextPh::mWidthFloat [protected]

Definition at line 139 of file nsDeviceContextPh.h.


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