| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class PlatformGestureEvent; | 40 class PlatformGestureEvent; |
| 41 class PlatformMouseEvent; | 41 class PlatformMouseEvent; |
| 42 class ScrollableArea; | 42 class ScrollableArea; |
| 43 | 43 |
| 44 class PLATFORM_EXPORT Scrollbar final : public Widget { | 44 class PLATFORM_EXPORT Scrollbar final : public Widget { |
| 45 public: | 45 public: |
| 46 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation); | 46 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation); |
| 47 | 47 |
| 48 virtual ~Scrollbar(); | 48 virtual ~Scrollbar(); |
| 49 | 49 |
| 50 ScrollbarOverlayStyle scrollbarOverlayStyle() const; | |
| 51 bool isScrollableAreaActive() const; | 50 bool isScrollableAreaActive() const; |
| 52 | 51 |
| 53 ScrollbarOrientation orientation() const { return m_orientation; } | 52 ScrollbarOrientation orientation() const { return m_orientation; } |
| 54 bool isLeftSideVerticalScrollbar() const; | 53 bool isLeftSideVerticalScrollbar() const; |
| 55 | 54 |
| 56 int value() const { return lroundf(m_currentPos); } | 55 int value() const { return lroundf(m_currentPos); } |
| 57 float currentPos() const { return m_currentPos; } | 56 float currentPos() const { return m_currentPos; } |
| 58 int visibleSize() const { return m_visibleSize; } | 57 int visibleSize() const { return m_visibleSize; } |
| 59 int totalSize() const { return m_totalSize; } | 58 int totalSize() const { return m_totalSize; } |
| 60 int maximum() const { return m_totalSize - m_visibleSize; } | 59 int maximum() const { return m_totalSize - m_visibleSize; } |
| 61 | 60 |
| 62 bool enabled() const { return m_enabled; } | |
| 63 void setEnabled(bool); | |
| 64 | |
| 65 // Called by the ScrollableArea when the scroll offset changes. | 61 // Called by the ScrollableArea when the scroll offset changes. |
| 66 void offsetDidChange(); | 62 void offsetDidChange(); |
| 67 | 63 |
| 68 void disconnectFromScrollableArea() { m_scrollableArea = 0; } | 64 void disconnectFromScrollableArea() { m_scrollableArea = 0; } |
| 69 ScrollableArea* scrollableArea() const { return m_scrollableArea; } | 65 ScrollableArea* scrollableArea() const { return m_scrollableArea; } |
| 70 | 66 |
| 71 int pressedPos() const { return m_pressedPos; } | 67 int pressedPos() const { return m_pressedPos; } |
| 72 | 68 |
| 73 void setHoveredPart(ScrollbarPart); | 69 void setHoveredPart(ScrollbarPart); |
| 74 void setPressedPart(ScrollbarPart); | 70 void setPressedPart(ScrollbarPart); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 float m_dragOrigin; | 141 float m_dragOrigin; |
| 146 | 142 |
| 147 // FIXME(sky): Does any of this hovered/pressed tracking do anything | 143 // FIXME(sky): Does any of this hovered/pressed tracking do anything |
| 148 // since we only have overlay scrollbars? | 144 // since we only have overlay scrollbars? |
| 149 ScrollbarPart m_hoveredPart; | 145 ScrollbarPart m_hoveredPart; |
| 150 ScrollbarPart m_pressedPart; | 146 ScrollbarPart m_pressedPart; |
| 151 int m_pressedPos; | 147 int m_pressedPos; |
| 152 float m_scrollPos; | 148 float m_scrollPos; |
| 153 int m_documentDragPos; | 149 int m_documentDragPos; |
| 154 | 150 |
| 155 bool m_enabled; | |
| 156 | |
| 157 Timer<Scrollbar> m_scrollTimer; | 151 Timer<Scrollbar> m_scrollTimer; |
| 158 bool m_overlapsResizer; | 152 bool m_overlapsResizer; |
| 159 | 153 |
| 160 private: | 154 private: |
| 161 virtual bool isScrollbar() const override { return true; } | 155 virtual bool isScrollbar() const override { return true; } |
| 162 | 156 |
| 163 float scrollableAreaCurrentPos() const; | 157 float scrollableAreaCurrentPos() const; |
| 164 }; | 158 }; |
| 165 | 159 |
| 166 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); | 160 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); |
| 167 | 161 |
| 168 } // namespace blink | 162 } // namespace blink |
| 169 | 163 |
| 170 #endif // SKY_ENGINE_PLATFORM_SCROLL_SCROLLBAR_H_ | 164 #endif // SKY_ENGINE_PLATFORM_SCROLL_SCROLLBAR_H_ |
| OLD | NEW |