summaryrefslogtreecommitdiffstats
path: root/client/screen_layer.h
diff options
context:
space:
mode:
authorYaniv Kamay <ykamay@redhat.com>2009-09-19 21:25:46 +0300
committerYaniv Kamay <ykamay@redhat.com>2009-10-14 15:06:41 +0200
commitc1b79eb035fa158fb2ac3bc8e559809611070016 (patch)
tree3348dd749a700dedf87c9b16fe8be77c62928df8 /client/screen_layer.h
downloadspice-c1b79eb035fa158fb2ac3bc8e559809611070016.tar.gz
spice-c1b79eb035fa158fb2ac3bc8e559809611070016.tar.xz
spice-c1b79eb035fa158fb2ac3bc8e559809611070016.zip
fresh start
Diffstat (limited to 'client/screen_layer.h')
-rw-r--r--client/screen_layer.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/client/screen_layer.h b/client/screen_layer.h
new file mode 100644
index 00000000..cbcc5503
--- /dev/null
+++ b/client/screen_layer.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2009 Red Hat, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _H_SCREEN_LAYER
+#define _H_SCREEN_LAYER
+
+#include "threads.h"
+#include "region.h"
+
+class RedScreen;
+class Application;
+
+class ScreenLayer {
+public:
+ ScreenLayer(int z_order, bool opaque);
+ virtual ~ScreenLayer();
+
+ void attach_to_screen(Application& applicaion, int screen_id);
+ void detach_from_screen(Application& applicaion);
+
+ void set_screen(RedScreen* screen) { _screen = screen;}
+ RedScreen* screen() { return _screen; }
+ int z_order() { return _z_order;}
+ void set_area(const QRegion& area);
+ void offset_area(int dx, int dy);
+ void clear_area();
+ void set_rect_area(const Rect& r);
+ void add_rect_area(const Rect& r);
+ void remove_rect_area(const Rect& r);
+ void begin_update(QRegion& direct_rgn, QRegion& composit_rgn);
+ void invalidate();
+ uint64_t invalidate(const Rect& r, bool urgent = false);
+ void invalidate(const QRegion& r);
+
+ virtual void copy_pixels(const QRegion& dest_region, RedDrawable& dest_dc) {}
+
+ void set_using_ogl(bool val) {_using_ogl = val;}
+ bool using_ogl() {return _using_ogl;}
+ virtual void on_size_changed() {}
+
+ virtual void pre_migrate() { }
+ virtual void post_migrate() { }
+
+ QRegion& area() { return _area;}
+ QRegion& direct_area() { return _direct_area;}
+ QRegion& composit_area() { return _composit_area;}
+
+ virtual void on_update_completion(uint64_t mark) {}
+
+private:
+ uint64_t invalidate_rect(const Rect& r, bool urgent);
+
+private:
+ RedScreen* _screen;
+ int _z_order;
+ bool _opaque;
+ bool _using_ogl;
+ Mutex _area_lock;
+ QRegion _area;
+ QRegion _direct_area;
+ QRegion _composit_area;
+};
+
+#endif
+