Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
nsSVGViewBox Class Reference
Inheritance diagram for nsSVGViewBox:
Inheritance graph
[legend]
Collaboration diagram for nsSVGViewBox:
Collaboration graph
[legend]

List of all members.

Public Types

enum  modificationType { mod_other = 0, mod_context, mod_die }

Public Member Functions

 nsSVGViewBox (nsIDOMSVGLength *viewportWidth, nsIDOMSVGLength *viewportHeight)
virtual ~nsSVGViewBox ()
NS_DECL_ISUPPORTS NS_IMETHOD WillModifySVGObservable (nsISVGValue *observable, modificationType aModType)
NS_IMETHOD DidModifySVGObservable (nsISVGValue *observable, modificationType aModType)
NS_IMETHOD SetX (float aX)
NS_IMETHOD SetY (float aY)
NS_IMETHOD SetWidth (float aWidth)
NS_IMETHOD SetHeight (float aHeight)
NS_IMETHOD SetValueString (const nsAString &aValue)
NS_IMETHOD GetValueString (nsAString &aValue)
NS_IMETHOD AddObserver (nsISVGValueObserver *observer)
NS_IMETHOD RemoveObserver (nsISVGValueObserver *observer)
NS_IMETHOD BeginBatchUpdate ()
NS_IMETHOD EndBatchUpdate ()
typedef NS_STDCALL_FUNCPROTO (nsresult, SVGObserverNotifyFunction, nsISVGValueObserver, DidModifySVGObservable,(nsISVGValue *, nsISVGValue::modificationType))

Public Attributes

attribute float x
attribute float y
attribute float width
attribute float height

Protected Member Functions

void WillModify (modificationType aModType=mod_other)
void DidModify (modificationType aModType=mod_other)
void ReleaseObservers ()
void NotifyObservers (SVGObserverNotifyFunction f, modificationType aModType)
PRInt32 GetModifyNestCount ()

Protected Attributes

float mX
float mY
float mWidth
float mHeight

Private Member Functions

void MarkSet ()

Private Attributes

PRBool mIsSet
nsCOMPtr< nsIDOMSVGLengthmViewportWidth
nsCOMPtr< nsIDOMSVGLengthmViewportHeight

Friends

class nsSVGValueAutoNotifier

Detailed Description

Definition at line 239 of file nsSVGRect.cpp.


Member Enumeration Documentation

Enumerator:
mod_other 
mod_context 
mod_die 

Definition at line 68 of file nsISVGValue.h.


Constructor & Destructor Documentation

nsSVGViewBox::nsSVGViewBox ( nsIDOMSVGLength viewportWidth,
nsIDOMSVGLength viewportHeight 
)

Definition at line 276 of file nsSVGRect.cpp.

Here is the call graph for this function:


Member Function Documentation

NS_IMETHODIMP nsSVGValue::AddObserver ( nsISVGValueObserver observer) [virtual, inherited]

Implements nsISVGValue.

Definition at line 97 of file nsSVGValue.cpp.

{
  nsIWeakReference* wr = NS_GetWeakReference(observer);
  if (!wr) return NS_ERROR_FAILURE;
  mObservers.AppendElement((void*)wr);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsSVGValue::BeginBatchUpdate ( ) [virtual, inherited]

Implements nsISVGValue.

Definition at line 119 of file nsSVGValue.cpp.

{
  WillModify();
  return NS_OK;
}

Here is the call graph for this function:

void nsSVGValue::DidModify ( modificationType  aModType = mod_other) [protected, inherited]

Definition at line 86 of file nsSVGValue.cpp.

{
  NS_ASSERTION(mModifyNestCount>0, "unbalanced Will/DidModify calls");
  if (--mModifyNestCount == 0) {
    OnDidModify();
    NotifyObservers(&nsISVGValueObserver::DidModifySVGObservable, aModType);
  }
}

Here is the call graph for this function:

Implements nsISVGValueObserver.

Definition at line 326 of file nsSVGRect.cpp.

{
  NS_ASSERTION(!mIsSet, "inconsistent state");
  WillModify(aModType);
  mViewportWidth->GetValue(&mWidth);
  mViewportHeight->GetValue(&mHeight);  
  DidModify(aModType);
  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsSVGValue::EndBatchUpdate ( ) [virtual, inherited]

Implements nsISVGValue.

Definition at line 126 of file nsSVGValue.cpp.

{
  DidModify();
  return NS_OK;
}

Here is the call graph for this function:

PRInt32 nsSVGValue::GetModifyNestCount ( ) [inline, protected, inherited]

Definition at line 79 of file nsSVGValue.h.

{ return mModifyNestCount; }
NS_IMETHODIMP nsSVGRect::GetValueString ( nsAString &  aValue) [virtual, inherited]

Implements nsISVGValue.

Definition at line 138 of file nsSVGRect.cpp.

{
  PRUnichar buf[200];
  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
                            NS_LITERAL_STRING("%g %g %g %g").get(),
                            (double)mX, (double)mY,
                            (double)mWidth, (double)mHeight);
  aValue.Assign(buf);

  return NS_OK;
}

Here is the call graph for this function:

void nsSVGViewBox::MarkSet ( ) [private]

Definition at line 296 of file nsSVGRect.cpp.

Here is the caller graph for this function:

void nsSVGValue::NotifyObservers ( SVGObserverNotifyFunction  f,
modificationType  aModType 
) [protected, inherited]

Definition at line 66 of file nsSVGValue.cpp.

{
  PRInt32 count = mObservers.Count();
  for (PRInt32 i = 0; i < count; ++i) {
    nsIWeakReference* wr = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
    nsCOMPtr<nsISVGValueObserver> observer = do_QueryReferent(wr);
    if (observer)
       (NS_STATIC_CAST(nsISVGValueObserver*,observer)->*f)(this, aModType);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

typedef nsSVGValue::NS_STDCALL_FUNCPROTO ( nsresult  ,
SVGObserverNotifyFunction  ,
nsISVGValueObserver  ,
DidModifySVGObservable  ,
(nsISVGValue *, nsISVGValue::modificationType  
) [inherited]
void nsSVGValue::ReleaseObservers ( ) [protected, inherited]

Definition at line 53 of file nsSVGValue.cpp.

{
  PRInt32 count = mObservers.Count();
  PRInt32 i;
  for (i = 0; i < count; ++i) {
    nsIWeakReference* wr = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
    NS_RELEASE(wr);
  }
  while (i)
    mObservers.RemoveElementAt(--i);
}

Here is the caller graph for this function:

NS_IMETHODIMP nsSVGValue::RemoveObserver ( nsISVGValueObserver observer) [virtual, inherited]

Implements nsISVGValue.

Definition at line 106 of file nsSVGValue.cpp.

{
  nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(observer);
  if (!wr) return NS_ERROR_FAILURE;
  PRInt32 i = mObservers.IndexOf((void*)wr);
  if (i<0) return NS_ERROR_FAILURE;
  nsIWeakReference* wr2 = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
  NS_RELEASE(wr2);
  mObservers.RemoveElementAt(i);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 361 of file nsSVGRect.cpp.

{
  MarkSet();
  return nsSVGRect::SetHeight(aHeight);
}

Here is the call graph for this function:

NS_IMETHODIMP nsSVGViewBox::SetValueString ( const nsAString &  aValue) [virtual]

Reimplemented from nsSVGRect.

Definition at line 372 of file nsSVGRect.cpp.

Here is the call graph for this function:

Definition at line 354 of file nsSVGRect.cpp.

{
  MarkSet();
  return nsSVGRect::SetWidth(aWidth);
}

Here is the call graph for this function:

Definition at line 340 of file nsSVGRect.cpp.

{
  MarkSet();
  return nsSVGRect::SetX(aX);
}

Here is the call graph for this function:

Definition at line 347 of file nsSVGRect.cpp.

{
  MarkSet();
  return nsSVGRect::SetY(aY);
}

Here is the call graph for this function:

void nsSVGValue::WillModify ( modificationType  aModType = mod_other) [protected, inherited]

Definition at line 79 of file nsSVGValue.cpp.

Here is the call graph for this function:

Implements nsISVGValueObserver.

Definition at line 319 of file nsSVGRect.cpp.

{
  return NS_OK;
}

Friends And Related Function Documentation

friend class nsSVGValueAutoNotifier [friend, inherited]

Definition at line 59 of file nsSVGValue.h.


Member Data Documentation

attribute float nsIDOMSVGRect::height [inherited]

Definition at line 50 of file nsIDOMSVGRect.idl.

float nsSVGRect::mHeight [protected, inherited]

Definition at line 72 of file nsSVGRect.cpp.

Definition at line 269 of file nsSVGRect.cpp.

Definition at line 271 of file nsSVGRect.cpp.

Definition at line 270 of file nsSVGRect.cpp.

float nsSVGRect::mWidth [protected, inherited]

Definition at line 72 of file nsSVGRect.cpp.

float nsSVGRect::mX [protected, inherited]

Definition at line 72 of file nsSVGRect.cpp.

float nsSVGRect::mY [protected, inherited]

Definition at line 72 of file nsSVGRect.cpp.

attribute float nsIDOMSVGRect::width [inherited]

Definition at line 48 of file nsIDOMSVGRect.idl.

attribute float nsIDOMSVGRect::x [inherited]

Definition at line 44 of file nsIDOMSVGRect.idl.

attribute float nsIDOMSVGRect::y [inherited]

Definition at line 46 of file nsIDOMSVGRect.idl.


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