BlinkenArea - GitList
Repositories
Blog
Wiki
libetherpix
Code
Commits
Branches
Tags
Search
Tree:
5c70d9d
Branches
Tags
master
libetherpix
simulator
draw.h
implement receiving packets
Stefan Schuermans
commited
5c70d9d
at 2017-06-11 15:48:14
draw.h
Blame
History
Raw
/* * EtherPix simulator * * Copyright 2017 Stefan Schuermans <stefan schuermans info> * * 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, version 3 of the License. * * * 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 Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DRAW_H #define DRAW_H #include <gtkmm.h> #include "config.h" /// drawing area class Draw: public Gtk::DrawingArea { public: /** * @brief constructor * @param[in] Gtk Window object (a C object) * @param[in] builder reference to GTK builder object */ Draw(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder); /// virtual destructor virtual ~Draw(); /// set configuration object void setConfig(Config const&config); /// request image update void reqUpdate(); protected: /** * @brief widget is (re)configured * @param[in] cfg configuration event * @return if callback was completely handled */ virtual bool on_configure_event(GdkEventConfigure *cfg); /** * @brief widget is being drawn * @param[in] cairo cairo context for drawing * @return if callback was completely handled */ virtual bool on_draw(const Cairo::RefPtr<Cairo::Context> &cairo); /// update image void updateImage(); protected: /// reference to GTK builder object Glib::RefPtr<Gtk::Builder> m_builder; /// cairo surface with current simulator image Cairo::RefPtr<Cairo::ImageSurface> m_image; /// configuration object Config const *m_config; }; #endif // #ifndef DRAW_H