00001 00002 /* 00003 This file is part of the Opie Project 00004 00005 Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 00006 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 00007 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 00008 =. 00009 .=l. 00010 .>+-= 00011 _;:, .> :=|. This program is free software; you can 00012 .> <`_, > . <= redistribute it and/or modify it under 00013 :`=1 )Y*s>-.-- : the terms of the GNU General Public 00014 .="- .-=="i, .._ License as published by the Free Software 00015 - . .-<_> .<> Foundation; either version 2 of the License, 00016 ._= =} : or (at your option) any later version. 00017 .%`+i> _;_. 00018 .i_,=:_. -<s. This program is distributed in the hope that 00019 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00020 : .. .:, . . . without even the implied warranty of 00021 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00022 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00023 ..}^=.= = ; Library General Public License for more 00024 ++= -. .` .: details. 00025 : = ...= . :.=- 00026 -. .:....=;==+<; You should have received a copy of the GNU 00027 -_. . . )=. = Library General Public License along with 00028 -- :-=` this library; see the file COPYING.LIB. 00029 If not, write to the Free Software Foundation, 00030 Inc., 59 Temple Place - Suite 330, 00031 Boston, MA 02111-1307, USA. 00032 00033 */ 00034 00035 00036 #include <qwidget.h> 00037 #include <qrect.h> 00038 00039 #include "lib.h" 00040 00041 class QImage; 00042 00043 00044 class XineVideoWidget : public QWidget { 00045 Q_OBJECT 00046 00047 public: 00048 XineVideoWidget ( QWidget* parent, const char* name ); 00049 ~XineVideoWidget ( ); 00050 QImage *logo ( ) const; 00051 void setLogo ( QImage *image ); 00052 void setVideoFrame ( uchar *image, int width, int height, int linestep ); 00053 void clear ( ); 00054 00055 QSize videoSize() const; 00056 00057 protected: 00058 void paintEvent2( QPaintEvent *p ); 00059 virtual void paintEvent(QPaintEvent*); 00060 virtual void resizeEvent ( QResizeEvent *r ); 00061 QRect old_framerect; 00062 QSize old_size; 00063 00064 void mouseReleaseEvent ( QMouseEvent *e ); 00065 00066 signals: 00067 void clicked ( ); 00068 void videoResized ( const QSize &s ); 00069 00070 private: 00071 QRect m_lastframe; 00072 QRect m_thisframe; 00073 00074 uchar *m_buff; 00075 int m_bytes_per_line_fb; 00076 int m_bytes_per_line_frame; 00077 int m_bytes_per_pixel; 00078 int m_lastsize; 00079 QSize m_framesize; 00080 QImage *m_logo; 00081 mutable int m_rotation; 00082 ThreadUtil::Mutex m_bufmutex; 00083 }; 00084
1.4.2