Gnash  0.8.11dev
kdesup.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 // 2011 Free Software Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef GNASH_KDESUP_H
20 #define GNASH_KDESUP_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include "gui.h"
27 
28 #include <qapplication.h>
29 #include <qpopupmenu.h>
30 
31 #ifdef RENDERER_OPENGL
32 # include <qgl.h>
33 # include "kde_glue_opengl.h"
34 # define WIDGETCLASS QGLWidget
35 # define GLUE KdeOpenGLGlue
36 #elif defined(RENDERER_CAIRO)
37 // #include <cairo.h>
38 // #include "kde_glue_cairo.h"
39 # error "Cairo not supported yet for KDE!"
40 #elif defined(RENDERER_AGG)
41 # include "kde_glue_agg.h"
42 # define WIDGETCLASS QWidget
43 # define GLUE KdeAggGlue
44 #endif
45 
46 
47 namespace gnash
48 {
49 
50 
51 class KdeGui;
52 
53 class qwidget : public WIDGETCLASS
54 {
55  Q_OBJECT
56 public:
57  qwidget(KdeGui* godfather);
58  void setInterval(unsigned int interval);
59 protected:
60 #if QT_VERSION > 2312
61  void contextMenuEvent(QContextMenuEvent *event);
62 #endif
63  void mousePressEvent(QMouseEvent *event);
64  void mouseReleaseEvent( QMouseEvent * );
65  void mouseMoveEvent(QMouseEvent *event);
66  void keyPressEvent(QKeyEvent *event);
67  void keyReleaseEvent(QKeyEvent *event);
68  void timerEvent(QTimerEvent *);
69  void resizeEvent(QResizeEvent *event);
70  void paintEvent (QPaintEvent *event);
71 public slots:
78 private:
79  QPopupMenu _qmenu;
80  KdeGui* _godfather;
81 };
82 
83 
84 class DSOEXPORT KdeGui : public Gui
85 {
86 
87 public:
88  KdeGui(unsigned long xid, float scale, bool loop, RunResources& r);
89  virtual ~KdeGui();
90  virtual bool init(int argc, char **argv[]);
91  virtual bool createWindow(const char* windowtitle, int width, int height,
92  int xPosition = 0, int yPosition = 0);
93  virtual bool run();
94  virtual bool createMenu();
95  virtual bool setupEvents();
96  virtual void renderBuffer();
97  virtual void setInterval(unsigned int interval);
98  virtual void setTimeout(unsigned int timeout);
99  virtual void handleKeyEvent(QKeyEvent *event, bool down);
100  virtual void setCursor(gnash_cursor_type newcursor);
101  void setInvalidatedRegions(const InvalidatedRanges& ranges);
102  void resize(int width, int height);
103  void quitUI();
104  private:
105  std::unique_ptr<QApplication> _qapp;
106  std::unique_ptr<qwidget> _qwidget;
107  GLUE _glue;
108 
109  gnash::key::code qtToGnashKey(QKeyEvent *event);
110  int qtToGnashModifier(Qt::ButtonState state);
111 };
112 
113 // end of namespace gnash
114 }
115 
116 // end of __KDESUP_H__
117 #endif
void resizeEvent(QResizeEvent *event)
Definition: kde.cpp:479
void setInterval(unsigned int interval)
Definition: kde.cpp:433
void keyPressEvent(QKeyEvent *event)
Definition: kde.cpp:467
void mouseReleaseEvent(QMouseEvent *)
Definition: kde.cpp:461
Definition: kdesup.h:53
void menuitem_play_callback()
Start the movie playing from the current frame.
Definition: kde.cpp:373
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
gnash_cursor_type
Enumerates mouse cursor types.
Definition: gui.h:81
qwidget(KdeGui *godfather)
Definition: kde.cpp:411
Definition: klash_part.cpp:329
Definition: kdesup.h:84
code
Definition: GnashKey.h:43
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
Definition: GnashKey.h:164
Definition: klash_part.cpp:329
void paintEvent(QPaintEvent *event)
Definition: kde.cpp:485
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
void menuitem_stop_callback()
stop the movie that&#39;s playing.
Definition: kde.cpp:389
void keyReleaseEvent(QKeyEvent *event)
Definition: kde.cpp:473
void menuitem_quit_callback()
quit complete, and close the application
Definition: kde.cpp:365
#define DSOEXPORT
Definition: dsodefs.h:55
void menuitem_pause_callback()
toggle that&#39;s playing or paused.
Definition: kde.cpp:381
void menuitem_restart_callback()
restart the movie from the beginning
Definition: kde.cpp:349
void mousePressEvent(QMouseEvent *event)
Definition: kde.cpp:454
void menuitem_refresh_callback()
force redraw of current frame
Definition: kde.cpp:357
void timerEvent(QTimerEvent *)
Definition: kde.cpp:440
void mouseMoveEvent(QMouseEvent *event)
Definition: kde.cpp:402