2 Copyright (C) 2009 Red Hat, Inc.
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 #ifndef _H_SCREEN_LAYER
19 #define _H_SCREEN_LAYER
21 #include "common/region.h"
29 ScreenLayer(int z_order, bool opaque);
30 virtual ~ScreenLayer();
32 void attach_to_screen(Application& application, int screen_id);
33 void detach_from_screen(Application& application);
35 void set_screen(RedScreen* screen) { _screen = screen;}
36 RedScreen* screen() { return _screen; }
37 int z_order() { return _z_order;}
38 void set_area(const QRegion& area);
39 void offset_area(int dx, int dy);
41 void set_rect_area(const SpiceRect& r);
42 void add_rect_area(const SpiceRect& r);
43 void remove_rect_area(const SpiceRect& r);
44 void begin_update(QRegion& direct_rgn, QRegion& composit_rgn);
46 uint64_t invalidate(const SpiceRect& r, bool urgent = false);
47 void invalidate(const QRegion& r);
48 bool contains_point(int x, int y);
50 virtual void copy_pixels(const QRegion& dest_region, RedDrawable& dest_dc) {}
52 void set_using_ogl(bool val) {_using_ogl = val;}
53 bool using_ogl() {return _using_ogl;}
54 virtual void on_size_changed() {}
56 virtual void pre_migrate() { }
57 virtual void post_migrate() { }
59 QRegion& area() { return _area;}
60 QRegion& direct_area() { return _direct_area;}
61 QRegion& composit_area() { return _composit_area;}
63 virtual void on_update_completion(uint64_t mark) {}
65 virtual bool pointer_test(int x, int y) { return false;}
66 virtual void on_pointer_enter(int x, int y, unsigned int buttons_state) {}
67 virtual void on_pointer_motion(int x, int y, unsigned int buttons_state) {}
68 virtual void on_pointer_leave() {}
69 virtual void on_mouse_button_press(int button, int buttons_state) {}
70 virtual void on_mouse_button_release(int button, int buttons_state) {}
73 uint64_t invalidate_rect(const SpiceRect& r, bool urgent);
74 void notify_changed();
84 QRegion _composit_area;