#include <SkView.h>
Inherits SkEventSink.
Inherited by SkAnimatorView, SkBitmapView, SkHasLabelView, SkImageView, SkProgressView, SkStaticTextView, SkStaticTextView, SkTextView, SkWidget, SkWidgetView, SkWidgetView, and SkWindow.
Classes | |
class | Artist |
class | B2FIter |
class | Click |
class | F2BIter |
class | Layout |
Public Types | |
enum | Flag_Shift { kVisible_Shift, kEnabled_Shift, kFocusable_Shift, kFlexH_Shift, kFlexV_Shift, kFlagShiftCount } |
enum | Flag_Mask { kVisible_Mask = 1 << kVisible_Shift, kEnabled_Mask = 1 << kEnabled_Shift, kFocusable_Mask = 1 << kFocusable_Shift, kFlexH_Mask = 1 << kFlexH_Shift, kFlexV_Mask = 1 << kFlexV_Shift, kAllFlagMasks = (uint32_t)(0 - 1) >> (32 - kFlagShiftCount) } |
enum | FocusDirection { kNext_FocusDirection, kPrev_FocusDirection, kFocusDirectionCount } |
Public Member Functions | |
SkView (uint32_t flags=0) | |
virtual | ~SkView () |
uint32_t | getFlags () const |
void | setFlags (uint32_t flags) |
int | isVisible () const |
int | isEnabled () const |
int | isFocusable () const |
void | setVisibleP (bool) |
void | setEnabledP (bool) |
void | setFocusableP (bool) |
SkScalar | width () const |
SkScalar | height () const |
void | setSize (SkScalar width, SkScalar height) |
void | setSize (const SkPoint &size) |
void | setWidth (SkScalar width) |
void | setHeight (SkScalar height) |
void | getLocalBounds (SkRect *bounds) const |
SkScalar | locX () const |
SkScalar | locY () const |
void | setLoc (SkScalar x, SkScalar y) |
void | setLoc (const SkPoint &loc) |
void | setLocX (SkScalar x) |
void | setLocY (SkScalar y) |
void | offset (SkScalar dx, SkScalar dy) |
void | draw (SkCanvas *canvas) |
void | inval (SkRect *rectOrNull) |
SkView * | getFocusView () const |
bool | hasFocus () const |
bool | acceptFocus () |
SkView * | moveFocus (FocusDirection) |
Click * | findClickHandler (SkScalar x, SkScalar y) |
SkView * | sendEventToParents (const SkEvent &) |
bool | postEvent (SkEvent *evt, SkEventSinkID sinkID, SkMSec delay) |
SkView * | getParent () const |
SkView * | attachChildToFront (SkView *child) |
SkView * | attachChildToBack (SkView *child) |
void | detachFromParent () |
void | detachAllChildren () |
void | globalToLocal (SkPoint *pt) const |
void | globalToLocal (SkScalar globalX, SkScalar globalY, SkPoint *local) const |
Artist * | getArtist () const |
Artist * | setArtist (Artist *artist) |
Layout * | getLayout () const |
Layout * | setLayout (Layout *, bool invokeLayoutNow=true) |
void | invokeLayout () |
void | inflate (const SkDOM &dom, const SkDOM::Node *node) |
void | postInflate (const SkTDict< SkView * > &ids) |
virtual bool | handleInval (const SkRect &) |
virtual SkCanvas * | beforeChildren (SkCanvas *c) |
called once before all of the children are drawn (or clipped/translated) | |
virtual void | afterChildren (SkCanvas *orig) |
called once after all of the children are drawn (or clipped/translated) | |
virtual void | beforeChild (SkView *child, SkCanvas *canvas) |
called right before this child's onDraw is called | |
virtual void | afterChild (SkView *child, SkCanvas *canvas) |
called right after this child's onDraw is called | |
virtual Click * | onFindClickHandler (SkScalar x, SkScalar y) |
virtual bool | onClick (Click *) |
virtual void | onInflate (const SkDOM &dom, const SkDOM::Node *node) |
virtual void | onPostInflate (const SkTDict< SkView * > &) |
virtual void | onFocusChange (bool gainFocusP) |
Static Public Member Functions | |
static void | DoClickDown (Click *, int x, int y) |
static void | DoClickMoved (Click *, int x, int y) |
static void | DoClickUp (Click *, int x, int y) |
Protected Member Functions | |
virtual bool | onGetFocusView (SkView **) const |
virtual bool | onSetFocusView (SkView *) |
Friends | |
class | B2FIter |
class | F2BIter |
class | SkLayerView |
SkView is the base class for screen management. All widgets and controls inherit from SkView.
Definition at line 33 of file SkView.h.
enum SkView::Flag_Mask |
enum SkView::Flag_Shift |
SkView::SkView | ( | uint32_t | flags = 0 |
) |
virtual SkView::~SkView | ( | ) | [virtual] |
bool SkView::acceptFocus | ( | ) |
virtual void SkView::afterChildren | ( | SkCanvas * | orig | ) | [inline, virtual] |
Attach the child view to this view, and increment the child's reference count. The child view is added such that it will be drawn before all other child views. The child view parameter is returned.
void SkView::detachAllChildren | ( | ) |
Attach the child view to this view, and increment the child's reference count. The child view is added such that it will be drawn after all other child views. The child view parameter is returned. Detach all child views from this view.
void SkView::detachFromParent | ( | ) |
If the view has a parent, detach the view from its parent and decrement the view's reference count. If the parent was the only owner of the view, this will cause the view to be deleted.
static void SkView::DoClickDown | ( | Click * | , | |
int | x, | |||
int | y | |||
) | [static] |
static void SkView::DoClickMoved | ( | Click * | , | |
int | x, | |||
int | y | |||
) | [static] |
static void SkView::DoClickUp | ( | Click * | , | |
int | x, | |||
int | y | |||
) | [static] |
void SkView::draw | ( | SkCanvas * | canvas | ) |
Call this to have the view draw into the specified canvas.
Artist* SkView::getArtist | ( | ) | const |
Return the artist attached to this view (or null). The artist's reference count is not affected.
uint32_t SkView::getFlags | ( | ) | const [inline] |
SkView* SkView::getFocusView | ( | ) | const |
Layout* SkView::getLayout | ( | ) | const |
Return the layout attached to this view (or null). The layout's reference count is not affected.
void SkView::getLocalBounds | ( | SkRect * | bounds | ) | const |
Return a rectangle set to [0, 0, width, height]
SkView* SkView::getParent | ( | ) | const [inline] |
Convert the specified x,y from global coordinates into view-local coordinates, returning the answer in the local parameter.
void SkView::globalToLocal | ( | SkPoint * | pt | ) | const [inline] |
virtual bool SkView::handleInval | ( | const SkRect & | ) | [virtual] |
Override this if you want to handle an inval request from this view or one of its children. Tyically this is only overridden by the by the "window". If your subclass does handle the request, return true so the request will not continue to propogate to the parent.
Reimplemented in SkWindow.
bool SkView::hasFocus | ( | ) | const |
SkScalar SkView::height | ( | ) | const [inline] |
void SkView::inflate | ( | const SkDOM & | dom, | |
const SkDOM::Node * | node | |||
) |
Call this to initialize this view based on the specified XML node
void SkView::inval | ( | SkRect * | rectOrNull | ) |
Call this to invalidate part of all of a view, requesting that the view's draw method be called. The rectangle parameter specifies the part of the view that should be redrawn. If it is null, it specifies the entire view bounds.
void SkView::invokeLayout | ( | ) |
If a layout is attached to this view, call its layoutChildren() method
int SkView::isVisible | ( | ) | const [inline] |
SkScalar SkView::locX | ( | ) | const [inline] |
SkScalar SkView::locY | ( | ) | const [inline] |
SkView* SkView::moveFocus | ( | FocusDirection | ) |
Offset (move) the view by the specified dx and dy. This does not affect the view's size
virtual bool SkView::onClick | ( | Click * | ) | [virtual] |
Override this to track clicks, returning true as long as you want to track the pen/mouse.
Reimplemented in SkPushButtonWidget, and SkSliderView.
Override this if you might handle the click
Reimplemented in SkPushButtonWidget, and SkSliderView.
virtual void SkView::onFocusChange | ( | bool | gainFocusP | ) | [virtual] |
virtual bool SkView::onGetFocusView | ( | SkView ** | ) | const [inline, protected, virtual] |
virtual void SkView::onInflate | ( | const SkDOM & | dom, | |
const SkDOM::Node * | node | |||
) | [virtual] |
Override this to initialize your subclass from the XML node. Be sure to call the inherited version too
Reimplemented in SkAnimatorView, SkBorderView, SkImageView, SkProgressBarView, SkScrollBarView, SkWidget, SkHasLabelWidget, SkButtonWidget, SkCheckBoxWidget, SkStaticTextView, SkBitmapView, SkHasLabelView, SkPushButtonView, SkCheckBoxView, SkProgressView, SkTextView, SkListView, SkGridView, SkWidgetView, SkCheckButtonView, SkStaticTextView, and SkListView.
Override this if you want to perform post initialization work based on the ID dictionary built during XML parsing. Be sure to call the inherited version too.
virtual bool SkView::onSetFocusView | ( | SkView * | ) | [inline, protected, virtual] |
bool SkView::postEvent | ( | SkEvent * | evt, | |
SkEventSinkID | sinkID, | |||
SkMSec | delay | |||
) | [inline] |
After a view hierarchy is inflated, this may be called with a dictionary containing pairs of <name, view*>, where the name string was the view's "id" attribute when it was inflated.
This will call the virtual onPostInflate for this view, and the recursively call postInflate on all of the view's children.
Send the event to the view's parent, and its parent etc. until one of them returns true from its onEvent call. This view is returned. If no parent handles the event, null is returned.
Attach the specified artist (or null) to the view, replacing any existing artist. If the new artist is not null, its reference count is incremented. The artist parameter is returned.
void SkView::setEnabledP | ( | bool | ) |
void SkView::setFlags | ( | uint32_t | flags | ) |
Set the flags associated with the view
void SkView::setFocusableP | ( | bool | ) |
Attach the specified layout (or null) to the view, replacing any existing layout. If the new layout is not null, its reference count is incremented. The layout parameter is returned.
Set the view's left and top edge. This does not affect the view's size
Set the view's width and height. These must both be >= 0. This does not affect the view's loc
void SkView::setVisibleP | ( | bool | ) |
Helper to set/clear the view's kVisible_Mask flag
SkScalar SkView::width | ( | ) | const [inline] |