00001 // 00002 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software 00003 // Foundation, Inc 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 #ifndef GNASH_KDE4_GLUE_H 00020 #define GNASH_KDE4_GLUE_H 00021 00022 #ifdef HAVE_CONFIG_H 00023 #include "gnashconfig.h" 00024 #endif 00025 00026 #include "snappingrange.h" 00027 00028 #include <QWidget> 00029 00030 class QRect; 00031 class QGLWidget; 00032 namespace gnash { 00033 class Renderer; 00034 class DrawingWidget; 00035 class Kde4Gui; 00036 } 00037 00038 namespace gnash 00039 { 00040 00041 class DrawingWidget : public QWidget 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 DrawingWidget(Kde4Gui& gui); 00047 ~DrawingWidget() {} 00048 00049 #ifdef RENDERER_OPENGL 00050 QGLWidget* _glWidget; 00051 #endif 00052 public slots: 00053 00054 void properties(); 00055 void preferences(); 00056 void play(); 00057 void pause(); 00058 void stop(); 00059 void restart(); 00060 void refresh(); 00061 void fullscreen(bool isFull); 00062 void quit(); 00063 00064 protected: 00065 void paintEvent(QPaintEvent*); 00066 void timerEvent(QTimerEvent*); 00067 void resizeEvent(QResizeEvent *event); 00068 void mouseReleaseEvent(QMouseEvent *event); 00069 void mousePressEvent(QMouseEvent *event); 00070 void mouseMoveEvent(QMouseEvent *event); 00071 void keyPressEvent(QKeyEvent *event); 00072 void keyReleaseEvent(QKeyEvent *event); 00073 void contextMenuEvent(QContextMenuEvent *event); 00074 00075 private: 00076 Kde4Gui& _gui; 00077 }; 00078 00079 class Kde4Glue 00080 { 00081 public: 00082 Kde4Glue() : _drawing_area(NULL) {} 00083 virtual ~Kde4Glue() { } 00084 virtual bool init(int argc, char **argv[]) = 0; 00085 00086 virtual void prepDrawingArea(DrawingWidget *drawing_area) = 0; 00087 virtual Renderer* createRenderHandler() = 0; 00088 virtual void render() = 0; 00089 virtual void render(const QRect& updateRect) = 0; 00090 virtual void setInvalidatedRegions(const InvalidatedRanges& /* ranges */) {} 00091 virtual void resize(int, int) {} 00092 virtual void initBuffer(int, int) {} 00093 protected: 00094 DrawingWidget *_drawing_area; 00095 }; 00096 00097 } // namespace gnash 00098 00099 #endif