3 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
12 #include <l4/mag-gfx/geometry>
13 #include <l4/scout-gfx/widget>
17 using Mag_gfx::Canvas;
26 virtual ~Screen_update() { }
29 * Flip fore and back buffers
31 virtual void flip_buf_scr() { }
34 * Copy background buffer to foreground
36 virtual void copy_buf_to_scr(Rect const &) { }
39 * Flush pixels of specified screen area
41 virtual void scr_update(Rect const &r) = 0;
49 int _cnt; /* nb of requests since last process */
50 Widget *_root; /* root element for drawing */
51 Canvas *_canvas; /* graphics backend */
52 Screen_update *_scr_update; /* flushing pixels in backend */
53 Area _win; /* current size of output window */
61 : _cnt(0), _root(0), _canvas(0), _scr_update(0), _win(Area())
67 Canvas *canvas() const { return _canvas; }
69 void setup(Canvas *canvas, Screen_update *scr_update, Area const &win)
72 _scr_update = scr_update;
78 * Define root element for issueing drawing operations
80 inline void root(Widget *root) { _root = root; }
83 * Collect redraw requests
85 void request(Rect const &r);
88 * Process redrawing operations
90 void process(Rect const &view);