#include <SkEvent.h>
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 SkScalar * | findScalars (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) |
SkScalar * | setScalars (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) |
SkMetaData & | getMetaData () |
const SkMetaData & | getMetaData () 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) |
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.
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 | ( | ) |
bool SkEvent::findBool | ( | const char | name[], | |
bool * | value | |||
) | const [inline] |
bool SkEvent::findPtr | ( | const char | name[], | |
void ** | value | |||
) | const [inline] |
bool SkEvent::findS32 | ( | const char | name[], | |
int32_t * | value = NULL | |||
) | const [inline] |
bool SkEvent::findScalar | ( | const char | name[], | |
SkScalar * | value = NULL | |||
) | const [inline] |
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.
const char* SkEvent::findString | ( | const char | name[] | ) | const [inline] |
uint32_t SkEvent::getFast32 | ( | ) | const [inline] |
const SkMetaData& SkEvent::getMetaData | ( | ) | const [inline] |
SkMetaData& SkEvent::getMetaData | ( | ) | [inline] |
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] |
bool SkEvent::hasPtr | ( | const char | name[], | |
void * | value | |||
) | const [inline] |
bool SkEvent::hasS32 | ( | const char | name[], | |
int32_t | value | |||
) | const [inline] |
bool SkEvent::hasScalar | ( | const char | name[], | |
SkScalar | value | |||
) | const [inline] |
bool SkEvent::hasString | ( | const char | name[], | |
const char | value[] | |||
) | const [inline] |
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::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.
void SkEvent::postTime | ( | SkEventSinkID | sinkID, | |
SkMSec | time | |||
) | [inline] |
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] |
void SkEvent::setFast32 | ( | uint32_t | x | ) | [inline] |
void SkEvent::setPtr | ( | const char | name[], | |
void * | value | |||
) | [inline] |
void SkEvent::setS32 | ( | const char | name[], | |
int32_t | value | |||
) | [inline] |
void SkEvent::setScalar | ( | const char | name[], | |
SkScalar | value | |||
) | [inline] |
void SkEvent::setString | ( | const char | name[], | |
const char | value[] | |||
) | [inline] |
void SkEvent::setString | ( | const char | name[], | |
const SkString & | value | |||
) | [inline] |
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().