From 5f44f7b187093ef290315b7f8766b540a31de35f Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 13 Jun 2020 22:45:28 +0900 Subject: Initial code import from debian snapshot https://snapshot.debian.org/package/codeine/1.0.1-3.dfsg-3.1/ Signed-off-by: Michele Calgaro --- src/app/analyzer.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/app/analyzer.h (limited to 'src/app/analyzer.h') diff --git a/src/app/analyzer.h b/src/app/analyzer.h new file mode 100644 index 0000000..6fdb12f --- /dev/null +++ b/src/app/analyzer.h @@ -0,0 +1,75 @@ +// (c) 2004 Max Howell (max.howell@methylblue.com) +// See COPYING file for licensing information + +#ifndef ANALYZER_H +#define ANALYZER_H + +#ifdef __FreeBSD__ + #include +#endif + +#include //stack allocated and convenience +#include //stack allocated +#include //baseclass +#include //included for convenience + +namespace Analyzer +{ + typedef std::vector Scope; + + template class Base : public W + { + public: + uint timeout() const { return m_timeout; } + + protected: + Base( QWidget*, uint ); + + virtual void transform( Scope& ) = 0; + virtual void analyze( const Scope& ) = 0; + + private: + virtual bool event( QEvent* ); + + protected: + QTimer m_timer; + uint m_timeout; + }; + + class Base2D : public Base + { + Q_OBJECT + public: + const QPixmap *canvas() const { return &m_canvas; } + + private slots: + void draw(); + + protected: + Base2D( QWidget*, uint timeout ); + + QPixmap *canvas() { return &m_canvas; } + + void paintEvent( QPaintEvent* ) { if( !m_canvas.isNull() ) bitBlt( this, 0, 0, canvas() ); } + void resizeEvent( QResizeEvent* ); + + private: + QPixmap m_canvas; + }; + + class Block : public Analyzer::Base2D + { + public: + Block( QWidget* ); + + protected: + virtual void transform( Analyzer::Scope& ); + virtual void analyze( const Analyzer::Scope& ); + + virtual int heightForWidth( int ) const; + + virtual void show() {} //TODO temporary as the scope plugin causes freezes + }; +} + +#endif -- cgit v1.2.1