diff options
author | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-12 14:27:47 +0000 |
---|---|---|
committer | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-12 14:27:47 +0000 |
commit | ef7bdfac618f60e9edc9f42cd4661d563937e6d8 (patch) | |
tree | 3acb17216c4ede79d0c349182dfaca38e96803a1 /include/views | |
parent | 16edff2b1cbd80e36456138f8631711a585205ba (diff) |
Added Debugger to Sample App, off by default
Removed CocoaDebugger from experimental
Slight changes to SkOSMenu
Bug fixes for NetPipeReader and DrawingBoard
git-svn-id: http://skia.googlecode.com/svn/trunk@2102 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/views')
-rw-r--r-- | include/views/SkOSMenu.h | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/include/views/SkOSMenu.h b/include/views/SkOSMenu.h index 763499e073..0c4a619efa 100644 --- a/include/views/SkOSMenu.h +++ b/include/views/SkOSMenu.h @@ -66,18 +66,19 @@ public: SkUnichar getKeyEquivalent() const { return fKey; } /** - * Post event associated with the menu item to target, any changes to - * the associated event must be made prior to calling this method + * Helper functions for predefined types */ - void postEvent() const { (new SkEvent(*(fEvent)))->post(); } + void setBool(bool value) const; //For Switch + void setScalar(SkScalar value) const; //For Slider + void setInt(int value) const; //For List + void setTriState(TriState value) const; //For Tristate + void setString(const char value[]) const; //For TextField /** - * Helper functions for predefined types + * Post event associated with the menu item to target, any changes to + * the associated event must be made prior to calling this method */ - void postEventWithBool(bool value) const; //For Switch - void postEventWithScalar(SkScalar value) const; //For Slider - void postEventWithInt(int value) const; //For List, TriState - void postEventWithString(const char value[]) const; //For TextField + void postEvent() const { (new SkEvent(*(fEvent)))->post(); } private: int fID; @@ -88,11 +89,12 @@ public: SkUnichar fKey; }; - void reset(); + void reset(); const char* getTitle() const { return fTitle.c_str(); } void setTitle (const char title[]) { fTitle.set(title); } - int countItems() const { return fItems.count(); } - const Item* getItem(int index) const { return fItems[index]; } + int getCount() const { return fItems.count(); } + const Item* getItemByID(int itemID) const; + void getItems(const Item* items[]) const; /** * Assign key to the menu item with itemID, will do nothing if there's no @@ -143,30 +145,30 @@ public: * Helper functions to retrieve information other than the stored value for * some predefined types */ - static bool FindListItemCount(const SkEvent* evt, int* count); + static bool FindListItemCount(const SkEvent& evt, int* count); /** * Ensure that the items array can store n SkStrings where n is the count * extracted using FindListItemCount */ - static bool FindListItems(const SkEvent* evt, SkString items[]); - static bool FindSliderMin(const SkEvent* evt, SkScalar* min); - static bool FindSliderMax(const SkEvent* evt, SkScalar* max); + static bool FindListItems(const SkEvent& evt, SkString items[]); + static bool FindSliderMin(const SkEvent& evt, SkScalar* min); + static bool FindSliderMax(const SkEvent& evt, SkScalar* max); /** * Returns true if an action with the given label is found, false otherwise */ - static bool FindAction(const SkEvent* evt, const char label[]); + static bool FindAction(const SkEvent& evt, const char label[]); /** * The following helper functions will return true if evt is generated from * a predefined item type and retrieve the corresponding state information. * They will return false and leave value unchanged if there's a type * mismatch or slotName is incorrect */ - static bool FindListIndex(const SkEvent* evt, const char slotName[], int* value); - static bool FindSliderValue(const SkEvent* evt, const char slotName[], SkScalar* value); - static bool FindSwitchState(const SkEvent* evt, const char slotName[], bool* value); - static bool FindTriState(const SkEvent* evt, const char slotName[], TriState* value); - static bool FindText(const SkEvent* evt, const char slotName[], SkString* value); + static bool FindListIndex(const SkEvent& evt, const char slotName[], int* value); + static bool FindSliderValue(const SkEvent& evt, const char slotName[], SkScalar* value); + static bool FindSwitchState(const SkEvent& evt, const char slotName[], bool* value); + static bool FindTriState(const SkEvent& evt, const char slotName[], TriState* value); + static bool FindText(const SkEvent& evt, const char slotName[], SkString* value); private: SkString fTitle; |