Gnash 0.8.10dev
|
00001 // 00002 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 00003 // 2011 Free Software 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 00033 namespace gnash { 00034 class Renderer; 00035 class DrawingWidget; 00036 class Qt4Gui; 00037 } 00038 00039 namespace gnash { 00040 00041 class DrawingWidget : public QWidget 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 DrawingWidget(Qt4Gui& 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* event); 00066 void timerEvent(QTimerEvent* event); 00067 void resizeEvent(QResizeEvent* event); 00068 void mouseReleaseEvent(QMouseEvent* event); 00069 void mousePressEvent(QMouseEvent* event); 00070 void mouseMoveEvent(QMouseEvent* event); 00071 void wheelEvent(QWheelEvent* event); 00072 00073 void keyPressEvent(QKeyEvent* event); 00074 void keyReleaseEvent(QKeyEvent* event); 00075 void contextMenuEvent(QContextMenuEvent* event); 00076 00077 private: 00078 Qt4Gui& _gui; 00079 }; 00080 00081 class Qt4Glue 00082 { 00083 public: 00084 Qt4Glue() : _drawing_area(NULL) {} 00085 virtual ~Qt4Glue() { } 00086 virtual bool init(int argc, char **argv[]) = 0; 00087 00088 virtual void prepDrawingArea(DrawingWidget *drawing_area) = 0; 00089 virtual Renderer* createRenderHandler() = 0; 00090 virtual void render() = 0; 00091 virtual void render(const QRect& updateRect) = 0; 00092 virtual void setInvalidatedRegions(const InvalidatedRanges& /* ranges */) {} 00093 virtual void resize(int, int) {} 00094 virtual void initBuffer(int, int) {} 00095 protected: 00096 DrawingWidget *_drawing_area; 00097 }; 00098 00099 } // namespace gnash 00100 00101 #endif