genode/os/src/server/nitpicker/chunky_menubar.h

61 lines
1.3 KiB
C
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief Chunky-pixel-based menubar
* \author Norman Feske
* \date 2006-08-22
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2006-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CHUNKY_MENUBAR_
#define _CHUNKY_MENUBAR_
#include <nitpicker_gfx/chunky_canvas.h>
#include "menubar.h"
template <typename PT>
class Chunky_menubar : public Chunky_texture<PT>,
public Session, public Menubar
{
private:
Chunky_canvas<PT> _chunky_canvas;
public:
2013-09-07 02:02:26 +02:00
Chunky_menubar(PT *pixels, Area size)
:
Chunky_texture<PT>(pixels, 0, size),
Session(Genode::Session_label(""), *this, 0),
2013-09-07 02:02:26 +02:00
Menubar(_chunky_canvas, size, *this), _chunky_canvas(pixels, size)
{ }
/***********************
** Session interface **
***********************/
void submit_input_event(Input::Event) { }
2011-12-22 16:19:25 +01:00
/********************
** View interface **
********************/
2013-09-07 02:02:26 +02:00
int frame_size(Mode const &mode) const { return 0; }
void frame(Canvas &canvas, Mode const &mode) { }
void draw(Canvas const &canvas, Mode const &mode)
2011-12-22 16:19:25 +01:00
{
Clip_guard clip_guard(canvas, *this);
/* draw menubar content */
2013-09-07 02:02:26 +02:00
canvas.draw_texture(*this, BLACK, p1(), Canvas::SOLID);
2011-12-22 16:19:25 +01:00
}
};
#endif