SkEvent Class Reference

#include <SkEvent.h>

Collaboration diagram for SkEvent:
[legend]

List of all members.

Public Member Functions

 SkEvent ()
 SkEvent (const SkString &type)
 SkEvent (const char type[])
 SkEvent (const SkEvent &src)
 ~SkEvent ()
void getType (SkString *str) const
bool isType (const SkString &str) const
bool isType (const char type[], size_t len=0) const
void setType (const SkString &)
void setType (const char type[], size_t len=0)
uint32_t getFast32 () const
void setFast32 (uint32_t x)
bool findS32 (const char name[], int32_t *value=NULL) const
bool findScalar (const char name[], SkScalar *value=NULL) const
const SkScalarfindScalars (const char name[], int *count, SkScalar values[]=NULL) const
const char * findString (const char name[]) const
bool findPtr (const char name[], void **value) const
bool findBool (const char name[], bool *value) const
bool hasS32 (const char name[], int32_t value) const
bool hasScalar (const char name[], SkScalar value) const
bool hasString (const char name[], const char value[]) const
bool hasPtr (const char name[], void *value) const
bool hasBool (const char name[], bool value) const
void setS32 (const char name[], int32_t value)
void setScalar (const char name[], SkScalar value)
SkScalarsetScalars (const char name[], int count, const SkScalar values[]=NULL)
void setString (const char name[], const SkString &value)
void setString (const char name[], const char value[])
void setPtr (const char name[], void *value)
void setBool (const char name[], bool value)
SkMetaDatagetMetaData ()
const SkMetaDatagetMetaData () const
void tron ()
void troff ()
bool isDebugTrace () const
void inflate (const SkDOM &, const SkDOM::Node *)
 SkDEBUGCODE (void dump(const char title[]=NULL);) static bool Post(SkEvent *evt
bool post (SkEventSinkID sinkID, SkMSec delay=0)
void postTime (SkEventSinkID sinkID, SkMSec time)

Static Public Member Functions

static bool PostTime (SkEvent *evt, SkEventSinkID targetID, SkMSec time)
static void Init ()
static void Term ()
static bool ProcessEvent ()
static void ServiceQueueTimer ()
static void SignalNonEmptyQueue ()
static void SignalQueueTimer (SkMSec delay)

Public Attributes

SkEventSinkID targetID
SkEventSinkID SkMSec delay = 0)

Detailed Description

SkEvents are used to communicate type-safe information to SkEventSinks. SkEventSinks (including SkViews) each have a unique ID, which is stored in an event. This ID is used to target the event once it has been "posted".

Definition at line 39 of file SkEvent.h.


Constructor & Destructor Documentation

SkEvent::SkEvent (  ) 

Default construct, creating an empty event.

SkEvent::SkEvent ( const SkString type  )  [explicit]

Construct a new event with the specified type.

SkEvent::SkEvent ( const char  type[]  )  [explicit]

Construct a new event with the specified type.

SkEvent::SkEvent ( const SkEvent src  ) 

Construct a new event by copying the fields from the src event.

SkEvent::~SkEvent (  ) 

Member Function Documentation

bool SkEvent::findBool ( const char  name[],
bool *  value 
) const [inline]

Definition at line 102 of file SkEvent.h.

bool SkEvent::findPtr ( const char  name[],
void **  value 
) const [inline]

Return true if the event contains the named pointer field, and return the field in value (if value is non-null). If there is no matching named field, return false and ignore the value parameter.

Definition at line 101 of file SkEvent.h.

bool SkEvent::findS32 ( const char  name[],
int32_t *  value = NULL 
) const [inline]

Return true if the event contains the named 32bit field, and return the field in value (if value is non-null). If there is no matching named field, return false and ignore the value parameter.

Definition at line 83 of file SkEvent.h.

bool SkEvent::findScalar ( const char  name[],
SkScalar value = NULL 
) const [inline]

Return true if the event contains the named SkScalar field, and return the field in value (if value is non-null). If there is no matching named field, return false and ignore the value parameter.

Definition at line 88 of file SkEvent.h.

const SkScalar* SkEvent::findScalars ( const char  name[],
int *  count,
SkScalar  values[] = NULL 
) const [inline]

Return true if the event contains the named SkScalar field, and return the fields in value[] (if value is non-null), and return the number of SkScalars in count (if count is non-null). If there is no matching named field, return false and ignore the value and count parameters.

Definition at line 93 of file SkEvent.h.

const char* SkEvent::findString ( const char  name[]  )  const [inline]

Return the value of the named string field, or if no matching named field exists, return null.

Definition at line 96 of file SkEvent.h.

uint32_t SkEvent::getFast32 (  )  const [inline]

Return the event's unnamed 32bit field. Default value is 0

Definition at line 73 of file SkEvent.h.

const SkMetaData& SkEvent::getMetaData (  )  const [inline]

Return the underlying metadata object

Definition at line 131 of file SkEvent.h.

SkMetaData& SkEvent::getMetaData (  )  [inline]

Return the underlying metadata object

Definition at line 129 of file SkEvent.h.

void SkEvent::getType ( SkString str  )  const

Return the event's type (will never be null) Copy the event's type into the specified SkString parameter

bool SkEvent::hasBool ( const char  name[],
bool  value 
) const [inline]

Definition at line 112 of file SkEvent.h.

bool SkEvent::hasPtr ( const char  name[],
void *  value 
) const [inline]

Returns true if ethe event contains the named pointer field, and if it equals the specified value

Definition at line 111 of file SkEvent.h.

bool SkEvent::hasS32 ( const char  name[],
int32_t  value 
) const [inline]

Returns true if ethe event contains the named 32bit field, and if it equals the specified value

Definition at line 105 of file SkEvent.h.

bool SkEvent::hasScalar ( const char  name[],
SkScalar  value 
) const [inline]

Returns true if ethe event contains the named SkScalar field, and if it equals the specified value

Definition at line 107 of file SkEvent.h.

bool SkEvent::hasString ( const char  name[],
const char  value[] 
) const [inline]

Returns true if ethe event contains the named string field, and if it equals (using strcmp) the specified value

Definition at line 109 of file SkEvent.h.

void SkEvent::inflate ( const SkDOM ,
const SkDOM::Node  
)

Call this to initialize the event from the specified XML node

static void SkEvent::Init (  )  [static]

Porting layer must call these functions Global initialization function for the SkEvent system. Should be called exactly once before any other event method is called, and should be called after the call to SkGraphics::Init().

bool SkEvent::isDebugTrace (  )  const [inline]

Definition at line 135 of file SkEvent.h.

bool SkEvent::isType ( const char  type[],
size_t  len = 0 
) const

Returns true if the event's type matches exactly the specified type (case sensitive)

bool SkEvent::isType ( const SkString str  )  const

Returns true if the event's type matches exactly the specified type (case sensitive)

bool SkEvent::post ( SkEventSinkID  sinkID,
SkMSec  delay = 0 
) [inline]

Helper method for calling SkEvent::PostTime(this, ...), where the caller specifies a delay. The real "time" will be computed automatically by sampling the clock and adding its value to delay.

Definition at line 166 of file SkEvent.h.

void SkEvent::postTime ( SkEventSinkID  sinkID,
SkMSec  time 
) [inline]

Definition at line 171 of file SkEvent.h.

static bool SkEvent::PostTime ( SkEvent evt,
SkEventSinkID  targetID,
SkMSec  time 
) [static]

Post the specified event to the event queue, targeting the specified eventsink, to be delivered on/after the specified millisecond time. The event must be dynamically allocated for this. It cannot be a global or on the stack. After this call, ownership is transfered to the system, so the caller must not retain the event's ptr. Returns false if the event could not be posted (which means it will have been deleted).

static bool SkEvent::ProcessEvent (  )  [static]

Call this to process one event from the queue. If it returns true, there are more events to process.

static void SkEvent::ServiceQueueTimer (  )  [static]

Call this whenever the requested timer has expired (requested by a call to SetQueueTimer). It will post any delayed events whose time as "expired" onto the event queue. It may also call SignalQueueTimer() and SignalNonEmptyQueue().

void SkEvent::setBool ( const char  name[],
bool  value 
) [inline]

Definition at line 126 of file SkEvent.h.

void SkEvent::setFast32 ( uint32_t  x  )  [inline]

Set the event's unnamed 32bit field. In XML, use the subelement <data fast32="...">

Definition at line 77 of file SkEvent.h.

void SkEvent::setPtr ( const char  name[],
void *  value 
) [inline]

Add/replace the named pointer field to the event. There is no XML equivalent for this call

Definition at line 125 of file SkEvent.h.

void SkEvent::setS32 ( const char  name[],
int32_t  value 
) [inline]

Add/replace the named 32bit field to the event. In XML use the subelement <data name="..." s32="...">

Definition at line 115 of file SkEvent.h.

void SkEvent::setScalar ( const char  name[],
SkScalar  value 
) [inline]

Add/replace the named SkScalar field to the event. In XML use the subelement <data name="..." scalar="...">

Definition at line 117 of file SkEvent.h.

SkScalar* SkEvent::setScalars ( const char  name[],
int  count,
const SkScalar  values[] = NULL 
) [inline]

Add/replace the named SkScalar[] field to the event.

Definition at line 119 of file SkEvent.h.

void SkEvent::setString ( const char  name[],
const char  value[] 
) [inline]

Add/replace the named string field to the event. In XML use the subelement <data name=... string=...

Definition at line 123 of file SkEvent.h.

void SkEvent::setString ( const char  name[],
const SkString value 
) [inline]

Add/replace the named string field to the event. In XML use the subelement <data name=... string=...

Definition at line 121 of file SkEvent.h.

void SkEvent::setType ( const char  type[],
size_t  len = 0 
)

Set the event's type to the specified string. In XML, use the "type" attribute.

void SkEvent::setType ( const SkString  ) 

Set the event's type to the specified string. In XML, use the "type" attribute.

static void SkEvent::SignalNonEmptyQueue (  )  [static]

Porting layer must implement these functions Called whenever an SkEvent is posted to an empty queue, so that the OS can be told to later call Dequeue().

static void SkEvent::SignalQueueTimer ( SkMSec  delay  )  [static]

Called whenever the delay until the next delayed event changes. If zero is passed, then there are no more queued delay events.

SkEvent::SkDEBUGCODE ( void dump(const char title[]=NULL);   ) 

Post the specified event to the event queue, targeting the specified eventsink, with an optional delay. The event must be dynamically allocated for this. It cannot be a global or on the stack. After this call, ownership is transfered to the system, so the caller must not retain the event's ptr. Returns false if the event could not be posted (which means it will have been deleted).

static void SkEvent::Term (  )  [static]

Global cleanup function for the SkEvent system. Should be called exactly once after all event methods have been called, and should be called before calling SkGraphics::Term().

void SkEvent::troff (  )  [inline]

Definition at line 134 of file SkEvent.h.

void SkEvent::tron (  )  [inline]

Definition at line 133 of file SkEvent.h.


Member Data Documentation

Definition at line 154 of file SkEvent.h.

Definition at line 154 of file SkEvent.h.


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

Generated on Tue Oct 20 10:33:03 2009 for Skia by  doxygen 1.6.1