gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r12100: Add support for switchable r


From: John Wimer
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12100: Add support for switchable renderers in the Kde4 gui.
Date: Mon, 22 Mar 2010 21:48:47 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12100
committer: John Wimer <address@hidden>
branch nick: trunk
timestamp: Mon 2010-03-22 21:48:47 +0100
message:
  Add support for switchable renderers in the Kde4 gui.
removed:
  gui/klash4.moc.in
added:
  gui/Kde4Glue.cpp
  gui/Kde4Glue.moc.in
  gui/Kde4Gui.moc.in
modified:
  .bzrignore
  gui/Kde4Glue.h
  gui/Kde4GlueAgg.cpp
  gui/Kde4GlueAgg.h
  gui/Kde4GlueCairo.cpp
  gui/Kde4GlueCairo.h
  gui/Kde4GlueOgl.cpp
  gui/Kde4GlueOgl.h
  gui/Kde4Gui.cpp
  gui/Kde4Gui.h
  gui/Makefile.am
  gui/am-frag/kde4.am
  plugin/klash/klash_part.cpp
  plugin/klash4/klash_part.cpp
=== modified file '.bzrignore'
--- a/.bzrignore        2010-02-23 16:26:50 +0000
+++ b/.bzrignore        2010-03-22 20:48:47 +0000
@@ -1,5 +1,6 @@
 Makefile.in
 Makefile
+bzrversion.h
 .deps
 .libs
 *.lo
@@ -36,12 +37,15 @@
 gui/gnash
 gui/gtk-gnash
 gui/kde-gnash
+gui/kde4-gnash
 gui/haiku-gnash
 gui/sdl-gnash
 gui/fb-gnash
 gui/riscos-gnash
 gui/fltk-gnash
 gui/aqua-gnash
+gui/*.moc
+gui/*.gcda
 doc/Doxyfile
 libbase/gnashpluginrc
 libbase/gnashrc

=== added file 'gui/Kde4Glue.cpp'
--- a/gui/Kde4Glue.cpp  1970-01-01 00:00:00 +0000
+++ b/gui/Kde4Glue.cpp  2010-03-22 20:48:47 +0000
@@ -0,0 +1,165 @@
+// Kde4Glue.cpp: KDE4/Qt4 shared code to connect the various renderers to
+// the Kde4 gui.
+//                                                         
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+//   Foundation, Inc                                       
+//                 
+// 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; either version 3 of the License, or           
 // (at your option) any later version.
+//                                                                             
 // 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 General Public License           
 // along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "Kde4Glue.h"
+#include "Kde4Glue.moc"
+#include "Kde4Gui.h"
+#include <QWidget>
+#include <QPaintEvent>
+
+namespace gnash
+{
+
+/// DrawingWidget implementation
+DrawingWidget::DrawingWidget(Kde4Gui& gui)
+    : _gui(gui)
+{
+}
+
+void
+DrawingWidget::paintEvent(QPaintEvent *event)
+{
+    _gui.renderWidget(event->rect());
+}
+
+
+void
+DrawingWidget::timerEvent(QTimerEvent*)
+{
+    Gui::advance_movie(&_gui);
+}
+
+
+void
+DrawingWidget::mouseMoveEvent(QMouseEvent *event)
+{
+    QPoint position = event->pos();
+    _gui.notify_mouse_moved(position.x(), position.y());
+}
+
+
+void
+DrawingWidget::contextMenuEvent(QContextMenuEvent* event)
+{
+    _gui.popupMenu(event->globalPos());
+}
+
+
+void
+DrawingWidget::mousePressEvent(QMouseEvent* /* event */)
+{
+    _gui.notify_mouse_clicked(true, 1);
+}
+
+
+void
+DrawingWidget::mouseReleaseEvent(QMouseEvent* /* event */)
+{
+    _gui.notify_mouse_clicked(false, 1);
+}
+
+
+void
+DrawingWidget::keyPressEvent(QKeyEvent *event)
+{
+    _gui.handleKeyEvent(event, true);
+}
+
+void
+DrawingWidget::keyReleaseEvent(QKeyEvent *event)
+{
+    _gui.handleKeyEvent(event, false);
+}
+
+
+void
+DrawingWidget::resizeEvent(QResizeEvent *event)
+{
+    _gui.resize(event->size().width(), event->size().height());
+    update();
+}
+
+
+void
+DrawingWidget::properties()
+{
+    _gui.showProperties();
+}
+
+
+void
+DrawingWidget::preferences()
+{
+    _gui.showPreferences();
+}
+
+
+void
+DrawingWidget::play()
+{
+    _gui.play();
+}
+
+
+void
+DrawingWidget::pause()
+{
+    _gui.pause();
+}
+
+
+void
+DrawingWidget::restart()
+{
+    _gui.restart();
+}
+
+
+void
+DrawingWidget::stop()
+{
+    _gui.stop();
+}                                                             
+
+
+
+void
+DrawingWidget::refresh()
+{
+    _gui.refreshView();                                       
+}
+
+void
+DrawingWidget::quit()
+{
+    _gui.quit();
+}
+
+void
+DrawingWidget::fullscreen(bool isFull)
+{
+    if (isFull) {
+        _gui.setFullscreen();
+    }
+    else {
+        _gui.unsetFullscreen();
+    }
+}
+
+}

=== modified file 'gui/Kde4Glue.h'
--- a/gui/Kde4Glue.h    2010-01-11 06:41:38 +0000
+++ b/gui/Kde4Glue.h    2010-03-22 20:48:47 +0000
@@ -23,17 +23,59 @@
 #include "gnashconfig.h"
 #endif
 
-#include "gnash.h"
+#include "snappingrange.h"
+
 #include <QWidget>
-#include "snappingrange.h"
 
+class QRect;
+class QGLWidget;
 namespace gnash {
     class Renderer;
+    class DrawingWidget;
+    class Kde4Gui;
 }
 
 namespace gnash
 {
 
+class DrawingWidget : public QWidget
+{
+    Q_OBJECT
+
+public:
+    DrawingWidget(Kde4Gui& gui);
+    ~DrawingWidget() {}
+
+#ifdef RENDERER_OPENGL
+    QGLWidget* _glWidget;
+#endif 
+public slots:
+    
+    void properties();
+    void preferences();
+    void play(); 
+    void pause();
+    void stop();
+    void restart();
+    void refresh();
+    void fullscreen(bool isFull); 
+    void quit();
+
+protected:
+    void paintEvent(QPaintEvent*);
+    void timerEvent(QTimerEvent*);
+    void resizeEvent(QResizeEvent *event);
+    void mouseReleaseEvent(QMouseEvent *event);
+    void mousePressEvent(QMouseEvent *event); 
+    void mouseMoveEvent(QMouseEvent *event); 
+    void keyPressEvent(QKeyEvent *event);
+    void keyReleaseEvent(QKeyEvent *event);
+    void contextMenuEvent(QContextMenuEvent *event);
+    
+private:
+    Kde4Gui& _gui;
+};  
+
 class Kde4Glue
 {
   public:
@@ -41,7 +83,7 @@
     virtual ~Kde4Glue() { }
     virtual bool init(int argc, char **argv[]) = 0;
 
-    virtual void prepDrawingArea(QWidget *drawing_area) = 0;
+    virtual void prepDrawingArea(DrawingWidget *drawing_area) = 0;
     virtual Renderer* createRenderHandler() = 0;
     virtual void render() = 0;
     virtual void render(const QRect& updateRect) = 0;
@@ -49,7 +91,7 @@
     virtual void resize(int, int) {}
     virtual void initBuffer(int, int) {}
   protected:
-    QWidget     *_drawing_area;
+    DrawingWidget     *_drawing_area;
 };
 
 } // namespace gnash

=== added file 'gui/Kde4Glue.moc.in'
--- a/gui/Kde4Glue.moc.in       1970-01-01 00:00:00 +0000
+++ b/gui/Kde4Glue.moc.in       2010-03-22 20:48:47 +0000
@@ -0,0 +1,98 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'Kde4Glue.h'
+**
+** Created: Mon Mar 22 08:26:47 2010
+**      by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "Kde4Glue.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'Kde4Glue.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_gnash__DrawingWidget[] = {
+
+ // content:
+       4,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       9,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       0,       // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+      22,   21,   21,   21, 0x0a,
+      35,   21,   21,   21, 0x0a,
+      49,   21,   21,   21, 0x0a,
+      56,   21,   21,   21, 0x0a,
+      64,   21,   21,   21, 0x0a,
+      71,   21,   21,   21, 0x0a,
+      81,   21,   21,   21, 0x0a,
+      98,   91,   21,   21, 0x0a,
+     115,   21,   21,   21, 0x0a,
+
+       0        // eod
+};
+
+static const char qt_meta_stringdata_gnash__DrawingWidget[] = {
+    "gnash::DrawingWidget\0\0properties()\0"
+    "preferences()\0play()\0pause()\0stop()\0"
+    "restart()\0refresh()\0isFull\0fullscreen(bool)\0"
+    "quit()\0"
+};
+
+const QMetaObject gnash::DrawingWidget::staticMetaObject = {
+    { &QWidget::staticMetaObject, qt_meta_stringdata_gnash__DrawingWidget,
+      qt_meta_data_gnash__DrawingWidget, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &gnash::DrawingWidget::getStaticMetaObject() { return 
staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *gnash::DrawingWidget::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : 
&staticMetaObject;
+}
+
+void *gnash::DrawingWidget::qt_metacast(const char *_clname)
+{
+    if (!_clname) return 0;
+    if (!strcmp(_clname, qt_meta_stringdata_gnash__DrawingWidget))
+        return static_cast<void*>(const_cast< DrawingWidget*>(this));
+    return QWidget::qt_metacast(_clname);
+}
+
+int gnash::DrawingWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+    _id = QWidget::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        switch (_id) {
+        case 0: properties(); break;
+        case 1: preferences(); break;
+        case 2: play(); break;
+        case 3: pause(); break;
+        case 4: stop(); break;
+        case 5: restart(); break;
+        case 6: refresh(); break;
+        case 7: fullscreen((*reinterpret_cast< bool(*)>(_a[1]))); break;
+        case 8: quit(); break;
+        default: ;
+        }
+        _id -= 9;
+    }
+    return _id;
+}
+QT_END_MOC_NAMESPACE

=== modified file 'gui/Kde4GlueAgg.cpp'
--- a/gui/Kde4GlueAgg.cpp       2010-02-23 17:40:25 +0000
+++ b/gui/Kde4GlueAgg.cpp       2010-03-22 20:48:47 +0000
@@ -25,6 +25,7 @@
 #include "Renderer.h"
 #include "Renderer_agg.h"
 #include "GnashException.h"
+#include <QWidget>
 #include <QImage>
 #include <QRect>
 
@@ -51,7 +52,7 @@
 
 
 void
-Kde4AggGlue::prepDrawingArea(QWidget *drawing_area)
+Kde4AggGlue::prepDrawingArea(DrawingWidget *drawing_area)
 {
     _drawing_area = drawing_area;
 }

=== modified file 'gui/Kde4GlueAgg.h'
--- a/gui/Kde4GlueAgg.h 2010-03-11 01:47:08 +0000
+++ b/gui/Kde4GlueAgg.h 2010-03-22 20:48:47 +0000
@@ -44,7 +44,7 @@
     ~Kde4AggGlue();
     
     bool init(int argc, char **argv[]);
-    void prepDrawingArea(QWidget *drawing_area);
+    void prepDrawingArea(DrawingWidget *drawing_area);
     Renderer* createRenderHandler();
     void initBuffer(int width, int height);
     void resize(int width, int height);
@@ -61,8 +61,6 @@
 };
 
 
-
-
 }
 
 #endif

=== modified file 'gui/Kde4GlueCairo.cpp'
--- a/gui/Kde4GlueCairo.cpp     2010-01-11 06:41:38 +0000
+++ b/gui/Kde4GlueCairo.cpp     2010-03-22 20:48:47 +0000
@@ -21,9 +21,11 @@
 #include "gnashconfig.h"
 #endif
 
+#include "Kde4Gui.h"
 #include "Kde4GlueCairo.h"
 #include "Renderer.h"
 #include "Renderer_cairo.h"
+#include <QWidget>
 #include <QRect>
 
 namespace gnash
@@ -96,7 +98,7 @@
 }
 
 void
-Kde4CairoGlue::prepDrawingArea(QWidget *drawing_area)
+Kde4CairoGlue::prepDrawingArea(DrawingWidget *drawing_area)
 {
     assert(drawing_area);
     _drawing_area = drawing_area;

=== modified file 'gui/Kde4GlueCairo.h'
--- a/gui/Kde4GlueCairo.h       2010-03-14 02:26:46 +0000
+++ b/gui/Kde4GlueCairo.h       2010-03-22 20:48:47 +0000
@@ -16,8 +16,8 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-#ifndef GNASH_KDE4_AGG_GLUE_H
-#define GNASH_KDE4_AGG_GLUE_H
+#ifndef GNASH_KDE4_CAIRO_GLUE_H
+#define GNASH_KDE4_CAIRO_GLUE_H
 
 
 #ifdef HAVE_CONFIG_H
@@ -47,7 +47,7 @@
     
     bool init(int argc, char **argv[]);
     void initBuffer(int width, int height);
-    void prepDrawingArea(QWidget *drawing_area);
+    void prepDrawingArea(DrawingWidget *drawing_area);
     Renderer* createRenderHandler();
     void render();
     void render(const QRect& updateRect);

=== modified file 'gui/Kde4GlueOgl.cpp'
--- a/gui/Kde4GlueOgl.cpp       2010-03-14 02:26:46 +0000
+++ b/gui/Kde4GlueOgl.cpp       2010-03-22 20:48:47 +0000
@@ -21,12 +21,15 @@
 #include "gnashconfig.h"
 #endif
 
+#include <QWidget>
+#include <QGLWidget>
+#include <QRect>
+
 #include "Kde4GlueOgl.h"
+#include "Kde4Gui.h"
 #include "Renderer.h"
 #include "Renderer_ogl.h"
 #include "GnashException.h"
-#include <QRect>
-#include <QGLWidget>
 
 namespace gnash
 {
@@ -51,11 +54,16 @@
 
 
 void
-Kde4OglGlue::prepDrawingArea(QWidget *drawing_area)
+Kde4OglGlue::prepDrawingArea(DrawingWidget *drawing_area)
 {
     assert(drawing_area);
     _drawing_area = drawing_area;
-    static_cast<QGLWidget*>(_drawing_area)->makeCurrent();
+    _drawing_area->_glWidget = new QGLWidget(drawing_area);
+    _drawing_area->_glWidget->setVisible(drawing_area->isVisible());
+    _drawing_area->_glWidget->setMinimumSize(drawing_area->minimumSize());
+    _drawing_area->_glWidget->setSizePolicy(QSizePolicy::Expanding,
+                                            QSizePolicy::Expanding);
+    _drawing_area->_glWidget->makeCurrent();
 }
 
 
@@ -63,7 +71,7 @@
 Kde4OglGlue::render()
 {
     assert(_drawing_area);
-    static_cast<QGLWidget*>(_drawing_area)->swapBuffers();
+    _drawing_area->_glWidget->swapBuffers();
 }
 
 

=== modified file 'gui/Kde4GlueOgl.h'
--- a/gui/Kde4GlueOgl.h 2010-01-11 06:41:38 +0000
+++ b/gui/Kde4GlueOgl.h 2010-03-22 20:48:47 +0000
@@ -16,8 +16,8 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-#ifndef GNASH_KDE4_AGG_GLUE_H
-#define GNASH_KDE4_AGG_GLUE_H
+#ifndef GNASH_KDE4_OGL_GLUE_H
+#define GNASH_KDE4_OGL_GLUE_H
 
 
 #ifdef HAVE_CONFIG_H
@@ -26,12 +26,11 @@
 
 #include "Kde4Glue.h"
 
-#include <QImage>
 #include <boost/scoped_array.hpp>
-#include <QPainter>
 #include "snappingrange.h"
 
 class QRect;
+class QWidget;
 
 namespace gnash
 {
@@ -43,7 +42,7 @@
     ~Kde4OglGlue();
     
     bool init(int argc, char **argv[]);
-    void prepDrawingArea(QWidget *drawing_area);
+    void prepDrawingArea(DrawingWidget *drawing_area);
     Renderer* createRenderHandler();
     void render();
     void render(const QRect& updateRect);
@@ -55,8 +54,6 @@
 };
 
 
-
-
 }
 
 #endif

=== modified file 'gui/Kde4Gui.cpp'
--- a/gui/Kde4Gui.cpp   2010-03-13 18:00:33 +0000
+++ b/gui/Kde4Gui.cpp   2010-03-22 20:48:47 +0000
@@ -1,4 +1,4 @@
-// kde.cpp:  K Development Environment top level window, for Gnash.
+// Kde4Gui.cpp: KDE4/Qt4 Gui implementation for Gnash window
 // 
 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
 //   Foundation, Inc
@@ -63,7 +63,7 @@
 
 #include "gui.h"
 #include "Kde4Gui.h"
-#include "klash4.moc"
+#include "Kde4Gui.moc"
 #include "Renderer.h"
 #include "RunResources.h" 
 
@@ -89,7 +89,7 @@
 
 
 bool
-Kde4Gui::init(int argc, char **argv[])
+Kde4Gui::init(int /*argc*/, char ** /*argv*/[])
 {
 
     char** r = NULL;
@@ -100,7 +100,37 @@
     _embedWidget = new EmbedWidget(*this);
     _drawingWidget = _embedWidget->drawingWidget();
 
-    _glue.init (argc, argv);
+    std::string renderer = _runResources.getRenderBackend();
+    if (renderer.empty()) {
+        gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
+        renderer = rcfile.getRenderer();
+    }
+
+    if (renderer == "cairo") {
+#ifdef RENDERER_CAIRO
+        log_debug("Using Cairo renderer");
+        _glue.reset(new Kde4CairoGlue());
+#else
+        log_error(_("Cairo renderer not supported!"));
+        return false;
+#endif
+    } else if (renderer == "opengl") {
+#ifdef RENDERER_OPENGL
+        log_debug("Using OpenGL renderer");
+        _glue.reset(new Kde4OglGlue());
+#else
+        log_error(_("OpenGL renderer not supported!"));
+        return false;
+#endif
+    } else {
+#ifdef RENDERER_AGG
+        log_debug("Using AGG renderer");
+        _glue.reset(new Kde4AggGlue());
+#else
+        log_error(_("AGG renderer not supported!"));
+        return false;
+#endif
+    }
 
     setupActions();
     setupMenus();
@@ -155,16 +185,16 @@
         _window->show();
     }
 
-    _glue.prepDrawingArea(_drawingWidget);
+    _glue->prepDrawingArea(_drawingWidget);
 
-    _renderer.reset(_glue.createRenderHandler());
+    _renderer.reset(_glue->createRenderHandler());
 
     if (!_renderer.get()) {
         return false;
     }
 
     _validbounds.setTo(0, 0, _width, _height);
-    _glue.initBuffer(_width, _height);
+    _glue->initBuffer(_width, _height);
     
     log_debug(_("Setting renderer"));
 
@@ -222,7 +252,7 @@
 {
     // This call renders onto the widget using a QPainter,
     // which *must only happen inside a paint event*.
-    _glue.render(updateRect);
+    _glue->render(updateRect);
 }
 
 
@@ -405,7 +435,7 @@
 void
 Kde4Gui::resize(int width, int height)
 {
-    _glue.resize(width, height);
+    _glue->resize(width, height);
     resize_view(width, height);
 }
 
@@ -691,143 +721,6 @@
     _playButton->show();
 }
 
-/// DrawingWidget implementation
-
-DrawingWidget::DrawingWidget(Kde4Gui& gui)
- : _gui(gui)
-{
-}
-
-void 
-DrawingWidget::paintEvent(QPaintEvent *event)
-{
-    _gui.renderWidget(event->rect());
-}
-
-
-void
-DrawingWidget::timerEvent(QTimerEvent*)
-{
-    Gui::advance_movie(&_gui);
-}
-
-
-void
-DrawingWidget::mouseMoveEvent(QMouseEvent *event)
-{
-    QPoint position = event->pos();
-    _gui.notify_mouse_moved(position.x(), position.y());
-}
-
-
-void
-DrawingWidget::contextMenuEvent(QContextMenuEvent* event)
-{
-    _gui.popupMenu(event->globalPos());
-}
-
-
-void
-DrawingWidget::mousePressEvent(QMouseEvent* /* event */)
-{
-    _gui.notify_mouse_clicked(true, 1);
-}
-
-
-void
-DrawingWidget::mouseReleaseEvent(QMouseEvent* /* event */)
-{
-    _gui.notify_mouse_clicked(false, 1);
-}
-
-
-void
-DrawingWidget::keyPressEvent(QKeyEvent *event)
-{
-    _gui.handleKeyEvent(event, true);
-}
-
-
-void
-DrawingWidget::keyReleaseEvent(QKeyEvent *event)
-{
-    _gui.handleKeyEvent(event, false);
-}
-
-
-void
-DrawingWidget::resizeEvent(QResizeEvent *event)
-{
-    _gui.resize(event->size().width(), event->size().height());
-    update();
-}
-
-
-void
-DrawingWidget::properties()
-{
-    _gui.showProperties();
-}
-
-
-void
-DrawingWidget::preferences()
-{
-    _gui.showPreferences();
-}
-
-
-void
-DrawingWidget::play()
-{
-    _gui.play();
-}
-
-
-void
-DrawingWidget::pause()
-{
-    _gui.pause();
-}
-
-
-void
-DrawingWidget::restart()
-{
-    _gui.restart();
-}
-
-
-void
-DrawingWidget::stop()
-{
-    _gui.stop();
-}
-
-
-void
-DrawingWidget::refresh()
-{
-    _gui.refreshView();
-}
-
-void
-DrawingWidget::quit()
-{
-    _gui.quit();
-}
-
-void
-DrawingWidget::fullscreen(bool isFull)
-{
-    if (isFull) {
-        _gui.setFullscreen();
-    }
-    else {
-        _gui.unsetFullscreen();
-    }
-}
-
 namespace Kde4GuiPrefs {
 
 PreferencesDialog::PreferencesDialog(QWidget* parent)

=== modified file 'gui/Kde4Gui.h'
--- a/gui/Kde4Gui.h     2010-03-11 01:47:08 +0000
+++ b/gui/Kde4Gui.h     2010-03-22 20:48:47 +0000
@@ -30,19 +30,17 @@
 #include <QX11EmbedWidget>
 #include <QDialog>
 
+#ifdef RENDERER_AGG
+#include "Kde4GlueAgg.h"
+#endif
+
+#ifdef RENDERER_CAIRO
+#include "Kde4GlueCairo.h"
+#endif
+
 #ifdef RENDERER_OPENGL
-# include "Kde4GlueOgl.h"
-# include <QGLWidget>
-# define BaseWidget QGLWidget
-# define GlueClass Kde4OglGlue
-#elif defined(RENDERER_CAIRO)
-#include "Kde4GlueCairo.h"
-# define BaseWidget QWidget
-# define GlueClass Kde4CairoGlue
-#elif defined(RENDERER_AGG)
-# include "Kde4GlueAgg.h"
-# define BaseWidget QWidget
-# define GlueClass Kde4AggGlue
+#include "Kde4GlueOgl.h"
+class QGLWidget;
 #endif
 
 
@@ -58,49 +56,12 @@
 
 namespace gnash {
     class Kde4Gui;
+       class DrawingWidget;
 }
 
 namespace gnash
 {
 
-class DrawingWidget : public BaseWidget
-{
-    Q_OBJECT
-
-public:
-    DrawingWidget(Kde4Gui& gui);
-    ~DrawingWidget() {}
-
-public slots:
-
-    void properties();
-    void preferences();
-    void play();
-    void pause();
-    void stop();
-    void restart();
-    void refresh();
-    void fullscreen(bool isFull);
-    void quit();
-
-protected:
-    void paintEvent(QPaintEvent*);
-    void timerEvent(QTimerEvent*);
-    void resizeEvent(QResizeEvent *event);
-    void mouseReleaseEvent(QMouseEvent *event);
-    void mousePressEvent(QMouseEvent *event);
-    void mouseMoveEvent(QMouseEvent *event);
-    void keyPressEvent(QKeyEvent *event);
-    void keyReleaseEvent(QKeyEvent *event);
-    void contextMenuEvent(QContextMenuEvent *event);
-
-private:
-
-    Kde4Gui& _gui;
-
-};
-
-
 class EmbedWidget : public QX11EmbedWidget
 {
     Q_OBJECT
@@ -188,7 +149,7 @@
     DrawingWidget* _drawingWidget;
     
     /// Takes care of painting onto the widget.
-    GlueClass _glue;
+       std::auto_ptr<Kde4Glue> _glue;
     
     /// The main application window.
     std::auto_ptr<QMainWindow> _window;

=== added file 'gui/Kde4Gui.moc.in'
--- a/gui/Kde4Gui.moc.in        1970-01-01 00:00:00 +0000
+++ b/gui/Kde4Gui.moc.in        2010-03-22 20:48:47 +0000
@@ -0,0 +1,142 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'Kde4Gui.h'
+**
+** Created: Mon Mar 22 09:59:37 2010
+**      by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "Kde4Gui.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'Kde4Gui.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_gnash__EmbedWidget[] = {
+
+ // content:
+       4,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       2,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       0,       // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+      20,   19,   19,   19, 0x0a,
+      37,   19,   19,   19, 0x0a,
+
+       0        // eod
+};
+
+static const char qt_meta_stringdata_gnash__EmbedWidget[] = {
+    "gnash::EmbedWidget\0\0hidePlayButton()\0"
+    "showPlayButton()\0"
+};
+
+const QMetaObject gnash::EmbedWidget::staticMetaObject = {
+    { &QX11EmbedWidget::staticMetaObject, 
qt_meta_stringdata_gnash__EmbedWidget,
+      qt_meta_data_gnash__EmbedWidget, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &gnash::EmbedWidget::getStaticMetaObject() { return 
staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *gnash::EmbedWidget::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : 
&staticMetaObject;
+}
+
+void *gnash::EmbedWidget::qt_metacast(const char *_clname)
+{
+    if (!_clname) return 0;
+    if (!strcmp(_clname, qt_meta_stringdata_gnash__EmbedWidget))
+        return static_cast<void*>(const_cast< EmbedWidget*>(this));
+    return QX11EmbedWidget::qt_metacast(_clname);
+}
+
+int gnash::EmbedWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+    _id = QX11EmbedWidget::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        switch (_id) {
+        case 0: hidePlayButton(); break;
+        case 1: showPlayButton(); break;
+        default: ;
+        }
+        _id -= 2;
+    }
+    return _id;
+}
+static const uint qt_meta_data_gnash__Kde4GuiPrefs__PreferencesDialog[] = {
+
+ // content:
+       4,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       1,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       0,       // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+      40,   39,   39,   39, 0x08,
+
+       0        // eod
+};
+
+static const char qt_meta_stringdata_gnash__Kde4GuiPrefs__PreferencesDialog[] 
= {
+    "gnash::Kde4GuiPrefs::PreferencesDialog\0"
+    "\0savePreferences()\0"
+};
+
+const QMetaObject gnash::Kde4GuiPrefs::PreferencesDialog::staticMetaObject = {
+    { &QDialog::staticMetaObject, 
qt_meta_stringdata_gnash__Kde4GuiPrefs__PreferencesDialog,
+      qt_meta_data_gnash__Kde4GuiPrefs__PreferencesDialog, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject 
&gnash::Kde4GuiPrefs::PreferencesDialog::getStaticMetaObject() { return 
staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *gnash::Kde4GuiPrefs::PreferencesDialog::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : 
&staticMetaObject;
+}
+
+void *gnash::Kde4GuiPrefs::PreferencesDialog::qt_metacast(const char *_clname)
+{
+    if (!_clname) return 0;
+    if (!strcmp(_clname, 
qt_meta_stringdata_gnash__Kde4GuiPrefs__PreferencesDialog))
+        return static_cast<void*>(const_cast< PreferencesDialog*>(this));
+    return QDialog::qt_metacast(_clname);
+}
+
+int gnash::Kde4GuiPrefs::PreferencesDialog::qt_metacall(QMetaObject::Call _c, 
int _id, void **_a)
+{
+    _id = QDialog::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        switch (_id) {
+        case 0: savePreferences(); break;
+        default: ;
+        }
+        _id -= 1;
+    }
+    return _id;
+}
+QT_END_MOC_NAMESPACE

=== modified file 'gui/Makefile.am'
--- a/gui/Makefile.am   2010-03-14 22:11:53 +0000
+++ b/gui/Makefile.am   2010-03-22 20:48:47 +0000
@@ -33,7 +33,7 @@
 # noinst_LTLIBRARIES = libgnashgui.la
 BUILT_SOURCES = .configline
 
-EXTRA_DIST = gnash.in klash3.moc.in klash4.moc.in am-frag
+EXTRA_DIST = gnash.in klash3.moc.in Kde4Gui.moc.in Kde4Glue.moc.in am-frag
 
 # If python support is enabled, built that too
 if HAS_PYTHON
@@ -214,7 +214,8 @@
 
 # Build the KDE4 gui
 if BUILD_KDE4_GUI
-BUILT_SOURCES += klash4.moc
+BUILT_SOURCES += Kde4Gui.moc
+BUILT_SOURCES += Kde4Glue.moc
 include $(srcdir)/am-frag/kde4.am
 endif
 
@@ -278,7 +279,7 @@
 include $(srcdir)/am-frag/riscos.am
 endif
 
-CLEANFILES = klash3.moc klash4.moc .configline gnash
+CLEANFILES = klash3.moc Kde4Gui.moc Kde4Glue.moc .configline gnash
 
 bundle: Info.plist aqua-gnash
        @echo " Building: $(bundle_name)" 

=== modified file 'gui/am-frag/kde4.am'
--- a/gui/am-frag/kde4.am       2010-03-15 16:19:39 +0000
+++ b/gui/am-frag/kde4.am       2010-03-22 20:48:47 +0000
@@ -20,20 +20,29 @@
 # 
 if BUILD_KDE4_GUI
 
-klash4.moc: $(srcdir)/Kde4Gui.h
-       @if test x"$(MOC4)" != x; then \
-         echo "Generating MOC 4 file..."; \
-         $(MOC4) $(srcdir)/Kde4Gui.h -o klash4.moc; \
-       else  \
-         echo "WARNING: Install QT 4.x moc tool! Linking to default MOC file"; 
\
-         ln -sf $(srcdir)/klash4.moc.in klash4.moc; \
+Kde4Gui.moc: $(srcdir)/Kde4Gui.h
+       @if test x"$(MOC4)" != x; then \
+         echo "Generating MOC file: Kde4Gui.moc."; \
+         $(MOC4) $(srcdir)/Kde4Gui.h -o Kde4Gui.moc; \
+       else  \
+         echo "WARNING: Install QT 4.x moc tool! Using default MOC file"; \
+         ln -sf $(srcdir)/Kde4Gui.moc.in Kde4Gui.moc; \
+       fi
+
+Kde4Glue.moc: $(srcdir)/Kde4Glue.h
+       @if test x"$(MOC4)" != x; then \
+         echo "Generating MOC file: Kde4Glue.moc."; \
+         $(MOC4) $(srcdir)/Kde4Glue.h -o Kde4Glue.moc; \
+       else  \
+         echo "WARNING: Install QT 4.x moc tool! Using default MOC file"; \
+         ln -sf $(srcdir)/Kde4Glue.moc.in Kde4Glue.moc; \
        fi
 
 endif
 
 bin_PROGRAMS += kde4-gnash
 
-kde4_gnash_SOURCES = $(GUI_SRCS) GuiKde4.cpp  Kde4Gui.cpp Kde4Gui.h Kde4Glue.h
+kde4_gnash_SOURCES = $(GUI_SRCS) GuiKde4.cpp  Kde4Gui.cpp Kde4Glue.cpp 
Kde4Gui.h Kde4Glue.h
 
 kde4_gnash_CPPFLAGS = -DGUI_KDE4 -DGUI_CONFIG=\"KDE4\" $(AM_CPPFLAGS) 
$(KDE4_CFLAGS) $(QT4_CFLAGS)
 kde4_gnash_LDFLAGS = $(LIBLTDL) -export-dynamic 

=== removed file 'gui/klash4.moc.in'
--- a/gui/klash4.moc.in 2009-05-22 21:29:17 +0000
+++ b/gui/klash4.moc.in 1970-01-01 00:00:00 +0000
@@ -1,193 +0,0 @@
-/****************************************************************************
-** Meta object code from reading C++ file 'Kde4Gui.h'
-**
-** Created: Fri May 22 20:44:55 2009
-**      by: The Qt Meta Object Compiler version 59 (Qt 4.4.3)
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#include "Kde4Gui.h"
-#if !defined(Q_MOC_OUTPUT_REVISION)
-#error "The header file 'Kde4Gui.h' doesn't include <QObject>."
-#elif Q_MOC_OUTPUT_REVISION != 59
-#error "This file was generated using the moc from 4.4.3. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
-#endif
-
-QT_BEGIN_MOC_NAMESPACE
-static const uint qt_meta_data_gnash__DrawingWidget[] = {
-
- // content:
-       1,       // revision
-       0,       // classname
-       0,    0, // classinfo
-       8,   10, // methods
-       0,    0, // properties
-       0,    0, // enums/sets
-
- // slots: signature, parameters, type, tag, flags
-      22,   21,   21,   21, 0x0a,
-      35,   21,   21,   21, 0x0a,
-      49,   21,   21,   21, 0x0a,
-      56,   21,   21,   21, 0x0a,
-      64,   21,   21,   21, 0x0a,
-      71,   21,   21,   21, 0x0a,
-      81,   21,   21,   21, 0x0a,
-      98,   91,   21,   21, 0x0a,
-
-       0        // eod
-};
-
-static const char qt_meta_stringdata_gnash__DrawingWidget[] = {
-    "gnash::DrawingWidget\0\0properties()\0"
-    "preferences()\0play()\0pause()\0stop()\0"
-    "restart()\0refresh()\0isFull\0fullscreen(bool)\0"
-};
-
-const QMetaObject gnash::DrawingWidget::staticMetaObject = {
-    { &BaseWidget::staticMetaObject, qt_meta_stringdata_gnash__DrawingWidget,
-      qt_meta_data_gnash__DrawingWidget, 0 }
-};
-
-const QMetaObject *gnash::DrawingWidget::metaObject() const
-{
-    return &staticMetaObject;
-}
-
-void *gnash::DrawingWidget::qt_metacast(const char *_clname)
-{
-    if (!_clname) return 0;
-    if (!strcmp(_clname, qt_meta_stringdata_gnash__DrawingWidget))
-        return static_cast<void*>(const_cast< DrawingWidget*>(this));
-    return BaseWidget::qt_metacast(_clname);
-}
-
-int gnash::DrawingWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
-    _id = BaseWidget::qt_metacall(_c, _id, _a);
-    if (_id < 0)
-        return _id;
-    if (_c == QMetaObject::InvokeMetaMethod) {
-        switch (_id) {
-        case 0: properties(); break;
-        case 1: preferences(); break;
-        case 2: play(); break;
-        case 3: pause(); break;
-        case 4: stop(); break;
-        case 5: restart(); break;
-        case 6: refresh(); break;
-        case 7: fullscreen((*reinterpret_cast< bool(*)>(_a[1]))); break;
-        }
-        _id -= 8;
-    }
-    return _id;
-}
-static const uint qt_meta_data_gnash__EmbedWidget[] = {
-
- // content:
-       1,       // revision
-       0,       // classname
-       0,    0, // classinfo
-       2,   10, // methods
-       0,    0, // properties
-       0,    0, // enums/sets
-
- // slots: signature, parameters, type, tag, flags
-      20,   19,   19,   19, 0x0a,
-      37,   19,   19,   19, 0x0a,
-
-       0        // eod
-};
-
-static const char qt_meta_stringdata_gnash__EmbedWidget[] = {
-    "gnash::EmbedWidget\0\0hidePlayButton()\0"
-    "showPlayButton()\0"
-};
-
-const QMetaObject gnash::EmbedWidget::staticMetaObject = {
-    { &QX11EmbedWidget::staticMetaObject, 
qt_meta_stringdata_gnash__EmbedWidget,
-      qt_meta_data_gnash__EmbedWidget, 0 }
-};
-
-const QMetaObject *gnash::EmbedWidget::metaObject() const
-{
-    return &staticMetaObject;
-}
-
-void *gnash::EmbedWidget::qt_metacast(const char *_clname)
-{
-    if (!_clname) return 0;
-    if (!strcmp(_clname, qt_meta_stringdata_gnash__EmbedWidget))
-        return static_cast<void*>(const_cast< EmbedWidget*>(this));
-    return QX11EmbedWidget::qt_metacast(_clname);
-}
-
-int gnash::EmbedWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
-    _id = QX11EmbedWidget::qt_metacall(_c, _id, _a);
-    if (_id < 0)
-        return _id;
-    if (_c == QMetaObject::InvokeMetaMethod) {
-        switch (_id) {
-        case 0: hidePlayButton(); break;
-        case 1: showPlayButton(); break;
-        }
-        _id -= 2;
-    }
-    return _id;
-}
-static const uint qt_meta_data_gnash__Kde4GuiPrefs__PreferencesDialog[] = {
-
- // content:
-       1,       // revision
-       0,       // classname
-       0,    0, // classinfo
-       1,   10, // methods
-       0,    0, // properties
-       0,    0, // enums/sets
-
- // slots: signature, parameters, type, tag, flags
-      40,   39,   39,   39, 0x08,
-
-       0        // eod
-};
-
-static const char qt_meta_stringdata_gnash__Kde4GuiPrefs__PreferencesDialog[] 
= {
-    "gnash::Kde4GuiPrefs::PreferencesDialog\0"
-    "\0savePreferences()\0"
-};
-
-const QMetaObject gnash::Kde4GuiPrefs::PreferencesDialog::staticMetaObject = {
-    { &QDialog::staticMetaObject, 
qt_meta_stringdata_gnash__Kde4GuiPrefs__PreferencesDialog,
-      qt_meta_data_gnash__Kde4GuiPrefs__PreferencesDialog, 0 }
-};
-
-const QMetaObject *gnash::Kde4GuiPrefs::PreferencesDialog::metaObject() const
-{
-    return &staticMetaObject;
-}
-
-void *gnash::Kde4GuiPrefs::PreferencesDialog::qt_metacast(const char *_clname)
-{
-    if (!_clname) return 0;
-    if (!strcmp(_clname, 
qt_meta_stringdata_gnash__Kde4GuiPrefs__PreferencesDialog))
-        return static_cast<void*>(const_cast< PreferencesDialog*>(this));
-    return QDialog::qt_metacast(_clname);
-}
-
-int gnash::Kde4GuiPrefs::PreferencesDialog::qt_metacall(QMetaObject::Call _c, 
int _id, void **_a)
-{
-    _id = QDialog::qt_metacall(_c, _id, _a);
-    if (_id < 0)
-        return _id;
-    if (_c == QMetaObject::InvokeMetaMethod) {
-        switch (_id) {
-        case 0: savePreferences(); break;
-        }
-        _id -= 1;
-    }
-    return _id;
-}
-QT_END_MOC_NAMESPACE

=== modified file 'plugin/klash/klash_part.cpp'
--- a/plugin/klash/klash_part.cpp       2010-01-11 06:41:38 +0000
+++ b/plugin/klash/klash_part.cpp       2010-03-22 20:48:47 +0000
@@ -72,7 +72,7 @@
 KParts::Part *KlashFactory::createPartObject
   (QWidget *wparent, const char *wname,
    QObject *parent, const char * name,
-   const char * cls, const QStringList & args) {
+   const char * /*cls*/, const QStringList & args) {
       //kdDebug() << "KlashFactory::createPartObject " << cls << endl;
       return new KlashPart (wparent, wname, parent, name, args);
 }

=== modified file 'plugin/klash4/klash_part.cpp'
--- a/plugin/klash4/klash_part.cpp      2010-01-11 06:41:38 +0000
+++ b/plugin/klash4/klash_part.cpp      2010-03-22 20:48:47 +0000
@@ -74,7 +74,7 @@
 KParts::Part *KlashFactory::createPartObject
   (QWidget *wparent,
    QObject *parent,
-   const char * cls, const QStringList & args) {
+   const char * /*cls*/, const QStringList & args) {
       //kdDebug() << "KlashFactory::createPartObject " << cls << endl;
       return new KlashPart (wparent, parent, args);
 }
@@ -313,7 +313,7 @@
     static_cast <KlashPart *> (parent ())->openUrl (KUrl(url));
 }
 
-KDE_NO_EXPORT void KlashBrowserExtension::requestOpenUrl (const KUrl & url, 
const QString & target, const QString & service) {
+KDE_NO_EXPORT void KlashBrowserExtension::requestOpenUrl (const KUrl & url, 
const QString & /*target*/, const QString & /*service*/) {
     KParts::OpenUrlArguments args;
     //FIXME what replaces those?
     //args.frameName = target;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]