diff options
author | Brian Osman <brianosman@google.com> | 2017-12-01 10:52:28 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-01 17:12:49 +0000 |
commit | 8ceee43de49b314fff58852c2d89ed3885ae71ee (patch) | |
tree | c3046b938bd7c026c84f164b785f749472629f80 /include/views | |
parent | 3ac99cfaa2d434c71d9c82fc234fadd55fe96394 (diff) |
Remove more views code, just to simplify things
Bug: skia:
Change-Id: Ie31a3c764e4f88f2b08f4198bd253841a2d8c264
Reviewed-on: https://skia-review.googlesource.com/79100
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/views')
-rw-r--r-- | include/views/SkEvent.h | 28 | ||||
-rw-r--r-- | include/views/SkView.h | 12 |
2 files changed, 4 insertions, 36 deletions
diff --git a/include/views/SkEvent.h b/include/views/SkEvent.h index aad3f58f3a..a2ccb0c748 100644 --- a/include/views/SkEvent.h +++ b/include/views/SkEvent.h @@ -9,7 +9,6 @@ #define SkEvent_DEFINED #include "SkMetaData.h" -#include "SkString.h" /** Unique 32bit id used to identify an instance of SkEventSink. When events are posted, they are posted to a specific sinkID. When it is time to dispatch the @@ -27,35 +26,18 @@ typedef uint32_t SkEventSinkID; */ class SkEvent { public: - /** - * Function pointer that takes an event, returns true if it "handled" it. - */ - typedef bool (*Proc)(const SkEvent& evt); - SkEvent(); - explicit SkEvent(const SkString& type); explicit SkEvent(const char type[]); SkEvent(const SkEvent& src); ~SkEvent(); - /** Copy the event's type into the specified SkString parameter */ - void getType(SkString* str) const; - - /** Returns true if the event's type matches exactly the specified type (case sensitive) */ - bool isType(const SkString& str) const; - /** Returns true if the event's type matches exactly the specified type (case sensitive) */ - bool isType(const char type[], size_t len = 0) const; + bool isType(const char type[]) const; /** * Set the event's type to the specified string. */ - void setType(const SkString&); - - /** - * Set the event's type to the specified string. - */ - void setType(const char type[], size_t len = 0); + void setType(const char type[]); /** * Return the event's unnamed 32bit field. Default value is 0 @@ -123,8 +105,6 @@ public: return fMeta.setScalars(name, count, values); } /** Add/replace the named string field to the event. In XML use the subelement <data name=... string=... */ - void setString(const char name[], const SkString& value) { fMeta.setString(name, value.c_str()); } - /** Add/replace the named string field to the event. In XML use the subelement <data name=... string=... */ void setString(const char name[], const char value[]) { fMeta.setString(name, value); } /** Add/replace the named pointer field to the event. There is no XML equivalent for this call */ void setPtr(const char name[], void* value) { fMeta.setPtr(name, value); } @@ -142,10 +122,10 @@ public: private: SkMetaData fMeta; - mutable char* fType; // may be characters with low bit set to know that it is not a pointer + char* fType; uint32_t f32; - void initialize(const char* type, size_t typeLen); + void initialize(const char* type); }; #endif diff --git a/include/views/SkView.h b/include/views/SkView.h index 9a84af832d..785f0cddbd 100644 --- a/include/views/SkView.h +++ b/include/views/SkView.h @@ -26,20 +26,12 @@ class SkView : public SkEventSink { public: enum Flag_Shift { kVisible_Shift, - kEnabled_Shift, - kFocusable_Shift, - kFlexH_Shift, - kFlexV_Shift, kNoClip_Shift, kFlagShiftCount }; enum Flag_Mask { kVisible_Mask = 1 << kVisible_Shift, //!< set if the view is visible - kEnabled_Mask = 1 << kEnabled_Shift, //!< set if the view is enabled - kFocusable_Mask = 1 << kFocusable_Shift, //!< set if the view can receive focus - kFlexH_Mask = 1 << kFlexH_Shift, //!< set if the view's width is stretchable - kFlexV_Mask = 1 << kFlexV_Shift, //!< set if the view's height is stretchable kNoClip_Mask = 1 << kNoClip_Shift, //!< set if the view is not clipped to its bounds kAllFlagMasks = (uint32_t)(0 - 1) >> (32 - kFlagShiftCount) @@ -58,13 +50,9 @@ public: /** Helper that returns non-zero if the kVisible_Mask bit is set in the view's flags */ int isVisible() const { return fFlags & kVisible_Mask; } - int isEnabled() const { return fFlags & kEnabled_Mask; } - int isFocusable() const { return fFlags & kFocusable_Mask; } int isClipToBounds() const { return !(fFlags & kNoClip_Mask); } /** Helper to set/clear the view's kVisible_Mask flag */ void setVisibleP(bool); - void setEnabledP(bool); - void setFocusableP(bool); void setClipToBounds(bool); /** Return the view's width */ |