diff options
| author | 2010-07-09 11:44:11 -0700 | |
|---|---|---|
| committer | 2010-07-09 16:58:19 -0700 | |
| commit | 9147d11a5f1d50496908bb1f49996e3ad23e19cc (patch) | |
| tree | 514adfc5e7e80550607f7b1c06a52f9ce12d46e5 /include/ui/Rect.h | |
| parent | 4865402092f4451e5d69c72cf00a7197e0c357bc (diff) | |
Add ANativeWindow API for directly drawing to the surface bits.
Also other cleanup and fixes:
- We now properly set the default window format to 565.
- New APIs to set the window format and flags from native code.
- Tweaked glue for simpler handling of the "destroy" message.
- Um, other stuff.
Change-Id: Id7790a21a2fa9a19b91854d225324a7c1e7c6ade
Diffstat (limited to 'include/ui/Rect.h')
| -rw-r--r-- | include/ui/Rect.h | 33 | 
1 files changed, 15 insertions, 18 deletions
diff --git a/include/ui/Rect.h b/include/ui/Rect.h index a213c09309..4e65a2d0b9 100644 --- a/include/ui/Rect.h +++ b/include/ui/Rect.h @@ -20,31 +20,28 @@  #include <utils/TypeHelpers.h>  #include <ui/Point.h> +#include <android/rect.h> +  namespace android { -class Rect +class Rect : public ARect  {  public: -    int left; -    int top; -    int right; -    int bottom; - -    typedef int value_type; +    typedef int32_t value_type;      // we don't provide copy-ctor and operator= on purpose      // because we want the compiler generated versions      inline Rect() {      } -    inline Rect(int w, int h) -        : left(0), top(0), right(w), bottom(h) { +    inline Rect(int32_t w, int32_t h) { +        left = top = 0; right = w; bottom = h;      } -    inline Rect(int l, int t, int r, int b) -        : left(l), top(t), right(r), bottom(b) { +    inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) { +        left = l; top = t; right = r; bottom = b;      } -    inline Rect(const Point& lt, const Point& rb)  -        : left(lt.x), top(lt.y), right(rb.x), bottom(rb.y) { +    inline Rect(const Point& lt, const Point& rb) { +        left = lt.x; top = lt.y; right = rb.x; bottom = rb.y;      }      void makeInvalid(); @@ -68,12 +65,12 @@ public:      }      // rectangle's width -    inline int width() const { +    inline int32_t width() const {          return right-left;      }      // rectangle's height -    inline int height() const { +    inline int32_t height() const {          return bottom-top;      } @@ -136,12 +133,12 @@ public:      const Rect operator + (const Point& rhs) const;      const Rect operator - (const Point& rhs) const; -    void translate(int dx, int dy) { // legacy, don't use. +    void translate(int32_t dx, int32_t dy) { // legacy, don't use.          offsetBy(dx, dy);      } -    Rect&   offsetTo(int x, int y); -    Rect&   offsetBy(int x, int y); +    Rect&   offsetTo(int32_t x, int32_t y); +    Rect&   offsetBy(int32_t x, int32_t y);      bool    intersect(const Rect& with, Rect* result) const;  };  |