#include <l4/mag-gfx/canvas>
#include <l4/mag/server/view>
+#include <l4/mag/server/session>
#include <l4/re/util/video/goos_svr>
#include <l4/re/util/event_svr>
namespace Mag_server {
class Client_fb
-: public View, public Object,
+: public View, public Session, public Object,
private L4Re::Util::Video::Goos_svr,
public L4Re::Util::Icu_cap_array_svr<Client_fb>
{
private:
typedef L4Re::Util::Icu_cap_array_svr<Client_fb> Icu_svr;
Core_api const *_core;
- Point _offs;
Texture *_fb;
- Area _bar_size;
+ int _bar_height;
L4Re::Util::Auto_cap<L4Re::Dataspace>::Cap _ev_ds;
L4Re::Rm::Auto_region<void*> _ev_ds_m;
L4Re::Event_buffer _events;
Irq _ev_irq;
+ enum
+ {
+ F_fb_fixed_location = 1 << 0,
+ F_fb_shaded = 1 << 1,
+ F_fb_focus = 1 << 2,
+ };
+ unsigned _flags;
public:
- Client_fb(Core_api const *core, Rect const &pos, Point const &offs,
- Texture *fb, L4::Cap<L4Re::Dataspace> const &fb_ds);
+ int setup();
+
+ explicit Client_fb(Core_api const *core);
L4::Cap<void> rcv_cap() const { return _core->rcv_cap(); }
- void set_offs(Point const &offs)
- { _offs = offs; }
+ void toggle_shaded();
void draw(Canvas *, View_stack const *, Mode) const;
void handle_event(L4Re::Event_buffer::Event const &e,
int dispatch(l4_umword_t obj, L4::Ipc_iostream &s);
int refresh(int x, int y, int w, int h);
+ Area visible_size() const;
+
void destroy();
+
+ Session *session() const { return const_cast<Client_fb*>(this); }
+
+ static void set_geometry_prop(Session *s, Property_handler const *p, cxx::String const &v);
+ static void set_flags_prop(Session *s, Property_handler const *p, cxx::String const &v);
+ static void set_bar_height_prop(Session *s, Property_handler const *p, cxx::String const &v);
};
}