| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef WINDOW_MANAGER_COMPOSITOR_H_ | 5 #ifndef WINDOW_MANAGER_COMPOSITOR_H_ | 
| 6 #define WINDOW_MANAGER_COMPOSITOR_H_ | 6 #define WINDOW_MANAGER_COMPOSITOR_H_ | 
| 7 | 7 | 
| 8 #include <list> | 8 #include <list> | 
| 9 #include <map> | 9 #include <map> | 
| 10 #include <string> | 10 #include <string> | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 187     bool visible() const { return visible_; } | 187     bool visible() const { return visible_; } | 
| 188     bool is_dimmed() const { return is_dimmed_; } | 188     bool is_dimmed() const { return is_dimmed_; } | 
| 189     int num_moves() const { return num_moves_; } | 189     int num_moves() const { return num_moves_; } | 
| 190 | 190 | 
| 191     MockCompositor::ContainerActor* parent() { return parent_; } | 191     MockCompositor::ContainerActor* parent() { return parent_; } | 
| 192     void set_parent(MockCompositor::ContainerActor* new_parent) { | 192     void set_parent(MockCompositor::ContainerActor* new_parent) { | 
| 193       parent_ = new_parent; | 193       parent_ = new_parent; | 
| 194     } | 194     } | 
| 195 | 195 | 
| 196     // Begin Compositor::Actor methods | 196     // Begin Compositor::Actor methods | 
| 197     void SetName(const std::string& name) {} | 197     void SetName(const std::string& name) { name_ = name; } | 
| 198     int GetWidth() { return width_; } | 198     int GetWidth() { return width_; } | 
| 199     int GetHeight() { return height_; } | 199     int GetHeight() { return height_; } | 
| 200     int GetX() { return x_; } | 200     int GetX() { return x_; } | 
| 201     int GetY() { return y_; } | 201     int GetY() { return y_; } | 
| 202     double GetXScale() { return scale_x_; } | 202     double GetXScale() { return scale_x_; } | 
| 203     double GetYScale() { return scale_y_; } | 203     double GetYScale() { return scale_y_; } | 
| 204     void SetVisibility(bool visible) { visible_ = visible; } | 204     void SetVisibility(bool visible) { visible_ = visible; } | 
| 205     void SetSize(int width, int height) { | 205     void SetSize(int width, int height) { | 
| 206       width_ = width; | 206       width_ = width; | 
| 207       height_ = height; | 207       height_ = height; | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 221     void SetOpacity(double opacity, int anim_ms) { opacity_ = opacity; } | 221     void SetOpacity(double opacity, int anim_ms) { opacity_ = opacity; } | 
| 222     void SetTilt(double tilt, int anim_ms) { | 222     void SetTilt(double tilt, int anim_ms) { | 
| 223       tilt_ = tilt; | 223       tilt_ = tilt; | 
| 224     } | 224     } | 
| 225     double GetTilt() const { return tilt_; } | 225     double GetTilt() const { return tilt_; } | 
| 226     void SetClip(int x, int y, int width, int height) {} | 226     void SetClip(int x, int y, int width, int height) {} | 
| 227     void Raise(Compositor::Actor* other); | 227     void Raise(Compositor::Actor* other); | 
| 228     void Lower(Compositor::Actor* other); | 228     void Lower(Compositor::Actor* other); | 
| 229     void RaiseToTop(); | 229     void RaiseToTop(); | 
| 230     void LowerToBottom(); | 230     void LowerToBottom(); | 
| 231     virtual std::string GetDebugString(int debug_level) { return ""; } | 231     virtual std::string GetDebugString(int indent_level); | 
| 232     void ShowDimmed(bool dimmed, int anim_ms) { is_dimmed_ = dimmed; } | 232     void ShowDimmed(bool dimmed, int anim_ms) { is_dimmed_ = dimmed; } | 
| 233     // End Compositor::Actor methods | 233     // End Compositor::Actor methods | 
| 234 | 234 | 
| 235     virtual void SetSizeImpl(int width, int height) {} | 235     virtual void SetSizeImpl(int width, int height) {} | 
| 236 | 236 | 
| 237    protected: | 237    protected: | 
|  | 238     std::string name_; | 
| 238     int x_, y_; | 239     int x_, y_; | 
| 239     int width_, height_; | 240     int width_, height_; | 
| 240     double scale_x_, scale_y_; | 241     double scale_x_, scale_y_; | 
| 241     double opacity_; | 242     double opacity_; | 
| 242     double tilt_; | 243     double tilt_; | 
| 243     bool visible_; | 244     bool visible_; | 
| 244     bool is_dimmed_; | 245     bool is_dimmed_; | 
| 245 | 246 | 
| 246     // Number of times that the actor has been moved. | 247     // Number of times that the actor has been moved. | 
| 247     int num_moves_; | 248     int num_moves_; | 
| 248 | 249 | 
| 249     MockCompositor::ContainerActor* parent_;  // not owned | 250     MockCompositor::ContainerActor* parent_;  // not owned | 
| 250 | 251 | 
| 251     DISALLOW_COPY_AND_ASSIGN(Actor); | 252     DISALLOW_COPY_AND_ASSIGN(Actor); | 
| 252   }; | 253   }; | 
| 253 | 254 | 
| 254   class ContainerActor : public MockCompositor::Actor, | 255   class ContainerActor : public MockCompositor::Actor, | 
| 255                          virtual public Compositor::ContainerActor { | 256                          virtual public Compositor::ContainerActor { | 
| 256    public: | 257    public: | 
| 257     ContainerActor(); | 258     ContainerActor(); | 
| 258     virtual ~ContainerActor(); | 259     virtual ~ContainerActor(); | 
| 259     void AddActor(Compositor::Actor* actor); | 260     void AddActor(Compositor::Actor* actor); | 
|  | 261     virtual std::string GetDebugString(int indent_level); | 
| 260 | 262 | 
| 261     Stacker<Actor*>* stacked_children() { return stacked_children_.get(); } | 263     Stacker<Actor*>* stacked_children() { return stacked_children_.get(); } | 
| 262 | 264 | 
| 263     // Get an index representing an actor's stacking position inside of | 265     // Get an index representing an actor's stacking position inside of | 
| 264     // this container.  Objects stacked higher have lower indexes. | 266     // this container.  Objects stacked higher have lower indexes. | 
| 265     // Convenient for testing. | 267     // Convenient for testing. | 
| 266     int GetStackingIndex(Compositor::Actor* actor); | 268     int GetStackingIndex(Compositor::Actor* actor); | 
| 267 | 269 | 
| 268    private: | 270    private: | 
| 269     scoped_ptr<Stacker<Actor*> > stacked_children_; | 271     scoped_ptr<Stacker<Actor*> > stacked_children_; | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 348  private: | 350  private: | 
| 349   XConnection* xconn_;  // not owned | 351   XConnection* xconn_;  // not owned | 
| 350   StageActor default_stage_; | 352   StageActor default_stage_; | 
| 351 | 353 | 
| 352   DISALLOW_COPY_AND_ASSIGN(MockCompositor); | 354   DISALLOW_COPY_AND_ASSIGN(MockCompositor); | 
| 353 }; | 355 }; | 
| 354 | 356 | 
| 355 }  // namespace window_manager | 357 }  // namespace window_manager | 
| 356 | 358 | 
| 357 #endif  // WINDOW_MANAGER_COMPOSITOR_H_ | 359 #endif  // WINDOW_MANAGER_COMPOSITOR_H_ | 
| OLD | NEW | 
|---|