Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes | Friends
xGC Class Reference

#include <nsGCCache.h>

List of all members.

Public Member Functions

 xGC (Display *display, Drawable d, unsigned long valuemask, XGCValues *values)
virtual ~xGC ()
PRInt32 AddRef (void)
PRInt32 Release (void)
 operator const GC ()

Private Attributes

PRInt32 mRefCnt
DisplaymDisplay
GC mGC

Friends

class nsGCCacheXlib

Detailed Description

Definition at line 65 of file nsGCCache.h.


Constructor & Destructor Documentation

xGC::xGC ( Display display,
Drawable  d,
unsigned long  valuemask,
XGCValues *  values 
) [inline]

Definition at line 69 of file nsGCCache.h.

  {
    mRefCnt = 0;
    mDisplay = display;
    mGC = ::XCreateGC(display, d, valuemask, values);
  }
virtual xGC::~xGC ( ) [inline, virtual]

Definition at line 76 of file nsGCCache.h.

                 {
    ::XFreeGC(mDisplay, mGC);
  }

Member Function Documentation

PRInt32 xGC::AddRef ( void  ) [inline]

Definition at line 80 of file nsGCCache.h.

                       {
#ifdef DEBUG  
    if(mRefCnt>400) abort();
#endif /* DEBUG */
    NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
    ++mRefCnt;
    return mRefCnt;
  }

Here is the caller graph for this function:

xGC::operator const GC ( ) [inline]

Definition at line 100 of file nsGCCache.h.

{ return (const GC)mGC; }
PRInt32 xGC::Release ( void  ) [inline]

Definition at line 88 of file nsGCCache.h.

                        {
    NS_PRECONDITION(0 != mRefCnt, "dup release");
    --mRefCnt;
    if (mRefCnt == 0) {
      mRefCnt = 1; /* stabilize */
      delete this;
      return 0;
    }
    return mRefCnt;
  }

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class nsGCCacheXlib [friend]

Definition at line 66 of file nsGCCache.h.


Member Data Documentation

Display* xGC::mDisplay [private]

Definition at line 104 of file nsGCCache.h.

GC xGC::mGC [private]

Definition at line 105 of file nsGCCache.h.

PRInt32 xGC::mRefCnt [private]

Definition at line 103 of file nsGCCache.h.


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