Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
nsBlinkTimer Class Reference
Inheritance diagram for nsBlinkTimer:
Inheritance graph
[legend]
Collaboration diagram for nsBlinkTimer:
Collaboration graph
[legend]

List of all members.

Classes

struct  FrameData

Public Member Functions

 nsBlinkTimer ()
virtual ~nsBlinkTimer ()
NS_DECL_ISUPPORTS void AddFrame (nsPresContext *aPresContext, nsIFrame *aFrame)
PRBool RemoveFrame (nsIFrame *aFrame)
PRInt32 FrameCount ()
void Start ()
void Stop ()
void notify (in nsITimer timer)

Static Public Member Functions

static
NS_DECL_NSITIMERCALLBACK
nsresult 
AddBlinkFrame (nsPresContext *aPresContext, nsIFrame *aFrame)
static nsresult RemoveBlinkFrame (nsIFrame *aFrame)
static PRBool GetBlinkIsOff ()

Protected Attributes

nsCOMPtr< nsITimermTimer
nsVoidArray mFrames
nsPresContextmPresContext

Static Protected Attributes

static nsBlinkTimersTextBlinker = nsnull
static PRUint32 sState = 0

Detailed Description

Definition at line 263 of file nsTextFrame.cpp.


Constructor & Destructor Documentation

Definition at line 318 of file nsTextFrame.cpp.

{
}

Here is the caller graph for this function:

Definition at line 322 of file nsTextFrame.cpp.

Here is the call graph for this function:


Member Function Documentation

nsresult nsBlinkTimer::AddBlinkFrame ( nsPresContext aPresContext,
nsIFrame aFrame 
) [static]

Definition at line 411 of file nsTextFrame.cpp.

{
  if (!sTextBlinker)
  {
    sTextBlinker = new nsBlinkTimer;
    if (!sTextBlinker) return NS_ERROR_OUT_OF_MEMORY;
  }
  
  NS_ADDREF(sTextBlinker);

  sTextBlinker->AddFrame(aPresContext, aFrame);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsBlinkTimer::AddFrame ( nsPresContext aPresContext,
nsIFrame aFrame 
)

Definition at line 346 of file nsTextFrame.cpp.

                                                                         {
  FrameData* frameData = new FrameData(aPresContext, aFrame);
  mFrames.AppendElement(frameData);
  if (1 == mFrames.Count()) {
    Start();
  }
}

Here is the caller graph for this function:

Definition at line 373 of file nsTextFrame.cpp.

                                 {
  return mFrames.Count();
}
static PRBool nsBlinkTimer::GetBlinkIsOff ( ) [inline, static]

Definition at line 286 of file nsTextFrame.cpp.

{ return sState == 3; }

Here is the caller graph for this function:

void nsITimerCallback::notify ( in nsITimer  timer) [inherited]
Parameters:
aTimerthe timer which has expired

Definition at line 427 of file nsTextFrame.cpp.

{
  NS_ASSERTION(sTextBlinker, "Should have blink timer here");
  
  nsBlinkTimer* blinkTimer = sTextBlinker;    // copy so we can call NS_RELEASE on it
  if (!blinkTimer) return NS_OK;
  
  blinkTimer->RemoveFrame(aFrame);  
  NS_RELEASE(blinkTimer);
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 354 of file nsTextFrame.cpp.

                                                 {
  PRInt32 i, n = mFrames.Count();
  PRBool rv = PR_FALSE;
  for (i = 0; i < n; i++) {
    FrameData* frameData = (FrameData*) mFrames.ElementAt(i);

    if (frameData->mFrame == aFrame) {
      rv = mFrames.RemoveElementAt(i);
      delete frameData;
      break;
    }
  }
  
  if (0 == mFrames.Count()) {
    Stop();
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 328 of file nsTextFrame.cpp.

{
  nsresult rv;
  mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
  if (NS_OK == rv) {
    mTimer->InitWithCallback(this, 250, nsITimer::TYPE_REPEATING_PRECISE);
  }
}

Here is the call graph for this function:

Definition at line 337 of file nsTextFrame.cpp.

{
  if (nsnull != mTimer) {
    mTimer->Cancel();
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 301 of file nsTextFrame.cpp.

Definition at line 302 of file nsTextFrame.cpp.

Definition at line 300 of file nsTextFrame.cpp.

PRUint32 nsBlinkTimer::sState = 0 [static, protected]

Definition at line 307 of file nsTextFrame.cpp.

Definition at line 306 of file nsTextFrame.cpp.


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