Go to the documentation of this file.
19 #ifndef GNASH_KDE4GUI_H
20 #define GNASH_KDE4GUI_H
30 #include <QX11EmbedWidget>
41 #ifdef RENDERER_OPENGL
80 QPushButton* _playButton;
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);
95 virtual void renderBuffer();
96 virtual void setInterval(
unsigned int interval);
97 virtual void setTimeout(
unsigned int timeout);
98 virtual void handleKeyEvent(QKeyEvent *event,
bool down);
100 virtual void setFullscreen();
101 virtual bool showMouse(
bool show);
102 virtual void unsetFullscreen();
103 virtual void setClipboard(
const std::string& copy);
104 virtual std::pair<int, int> screenResolution()
const;
105 virtual double getScreenDPI()
const;
106 virtual bool yesno(
const std::string& question);
110 void showProperties();
111 void showPreferences();
116 void renderWidget(
const QRect& updateRect);
118 void popupMenu(
const QPoint&
point);
121 typedef std::vector<geometry::Range2d<int> > DrawBounds;
122 typedef std::map<int, gnash::key::code> KeyMap;
126 void createMainMenu();
138 DrawBounds _drawbounds;
145 std::unique_ptr<QApplication> _application;
157 std::unique_ptr<Qt4Glue> _glue;
160 std::unique_ptr<QMainWindow> _window;
168 int qtToGnashModifier(
const Qt::KeyboardModifiers modifiers);
181 QAction* propertiesAction;
186 QAction* preferencesAction;
189 QMenu* movieControlMenu;
191 QAction* pauseAction;
193 QAction* restartAction;
197 QAction* refreshAction;
198 QAction* fullscreenAction;
201 namespace Qt4GuiPrefs
212 void savePreferences();
218 QSlider* _verbositySlider;
219 QCheckBox* _logToFileToggle;
220 QLineEdit* _logFileName;
221 QCheckBox* _parserDumpToggle;
222 QCheckBox* _actionDumpToggle;
223 QCheckBox* _malformedSWFToggle;
224 QCheckBox* _ASCodingErrorToggle;
227 QCheckBox* _localHostToggle;
228 QCheckBox* _localDomainToggle;
229 QCheckBox* _insecureSSLToggle;
230 QLineEdit* _solSandboxDir;
231 QCheckBox* _solReadOnlyToggle;
232 QCheckBox* _solLocalDomainToggle;
233 QCheckBox* _localConnectionToggle;
236 QSpinBox* _streamsTimeoutScale;
239 QCheckBox* _soundToggle;
240 QCheckBox* _saveStreamingMediaToggle;
241 QCheckBox* _saveLoadedMediaToggle;
242 QLineEdit* _mediaDir;
245 QLineEdit* _versionText;
247 QLineEdit* _urlOpenerText;
248 QSpinBox* _librarySize;
249 QCheckBox* _startStoppedToggle;
int verbosityLevel() const
Definition: rc.h:112
gnash_cursor_type
Enumerates mouse cursor types.
Definition: gui.h:81
virtual double getScreenDPI() const
Definition: Qt4Gui.cpp:379
@ GNASH_MOD_CONTROL
Definition: GnashKey.h:37
bool useActionDump() const
Definition: rc.h:74
@ RIGHT_BRACKET
Definition: GnashKey.h:142
@ DOWN
Definition: GnashKey.h:207
std::shared_ptr< Renderer > _renderer
The handler which is called to update the client area of our window.
Definition: gui.h:506
PreferencesDialog(QWidget *parent)
Definition: Qt4Gui.cpp:780
@ BACKSPACE
Definition: GnashKey.h:53
@ CURSOR_INPUT
Definition: gui.h:84
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: Qt4Gui.cpp:314
@ height
Definition: klash_part.cpp:329
@ d
Definition: GnashKey.h:150
Top-level gnash exception.
Definition: GnashException.h:31
bool updateFile(const std::string &filespec)
Writes a valid gnashrc file. If the file already exists, is is overwritten.
Definition: rc.cpp:730
void setStreamsTimeout(const double &x)
Set seconds of inactivity before timing out streams downloads.
Definition: rc.h:232
void log_debug(StringType msg, Args... args)
Definition: log.h:301
void setFlashSystemOS(const std::string &value)
Definition: rc.h:208
@ i
Definition: GnashKey.h:155
void setSOLReadOnly(bool x)
Definition: rc.h:279
std::string & getRenderBackend()
Definition: RunResources.h:136
void setLocalConnection(bool x)
Definition: rc.h:283
#define _(String)
Definition: log.h:44
Definition: Qt4GlueOgl.h:38
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
virtual void renderBuffer()
Definition: Qt4Gui.cpp:255
@ DELETEKEY
Definition: GnashKey.h:177
@ CONTROL
Definition: GnashKey.h:62
@ LEFT_BRACKET
Definition: GnashKey.h:140
@ CAPSLOCK
Definition: GnashKey.h:65
void resize(int width, int height)
Definition: Qt4Gui.cpp:472
@ F1
Definition: GnashKey.h:190
void setMovieLibraryLimit(int value)
Definition: rc.h:96
virtual void setClipboard(const std::string ©)
Definition: Qt4Gui.cpp:111
int getMovieLibraryLimit() const
Definition: rc.h:95
@ GNASH_MOD_NONE
Definition: GnashKey.h:35
bool showMalformedSWFErrors() const
Definition: rc.h:89
virtual void setCursor(gnash_cursor_type newcursor)
Sets the current mouse cursor for the Gui window.
Definition: Qt4Gui.cpp:321
const std::string & getDebugLog() const
Definition: rc.h:116
void pause()
Toggle between "stop" and "play" mode.
Definition: gui.cpp:875
void log_error(StringType msg, Args... args)
Definition: log.h:283
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
@ PGUP
Definition: GnashKey.h:213
RunResources & _runResources
Per-run resources.
Definition: gui.h:500
virtual void setFullscreen()
Definition: Qt4Gui.cpp:354
void setRenderer(std::shared_ptr< Renderer > r)
Definition: RunResources.h:108
@ LEFT
Definition: GnashKey.h:209
void saveLoadedMedia(bool value)
Definition: rc.h:302
bool _fullscreen
Definition: gui.h:513
@ RIGHT
Definition: GnashKey.h:208
bool getSOLLocalDomain() const
Definition: rc.h:273
Range2d< T > Intersection(const Range2d< T > &r1, const Range2d< T > &r2)
Return a rectangle being the intersetion of the two rectangles.
Definition: Range2d.h:762
bool isFinite() const
Returns true if this is a finite Range2d.
Definition: Range2d.h:210
Qt4Gui(unsigned long xid, float scale, bool loop, RunResources &r)
Definition: Qt4Gui.cpp:81
@ r
Definition: GnashKey.h:164
bool getLocalConnection() const
Definition: rc.h:281
bool useLocalDomain() const
Definition: rc.h:135
@ GNASH_MOD_SHIFT
Definition: GnashKey.h:36
virtual bool yesno(const std::string &question)
Prompt user with a question she can answer with yes/no.
Definition: Qt4Gui.cpp:575
@ INSERT
Definition: GnashKey.h:210
bool getSOLReadOnly() const
Definition: rc.h:277
@ ALT
Definition: GnashKey.h:63
@ PGDN
Definition: GnashKey.h:214
@ END
Definition: GnashKey.h:212
virtual bool init(int argc, char **argv[])
/ Initialise the gui and the associated renderer.
Definition: Qt4Gui.cpp:119
code
Definition: GnashKey.h:44
@ _0
Definition: GnashKey.h:94
@ ENTER
Definition: GnashKey.h:58
Definition: Qt4GlueCairo.h:42
@ play
Definition: klash_part.cpp:330
bool useSound() const
Definition: rc.h:124
int _width
Desired window width.
Definition: gui.h:494
@ TAB
Definition: GnashKey.h:54
@ CLEAR
Definition: GnashKey.h:57
@ INVALID
Definition: GnashKey.h:45
@ DOUBLE_QUOTE
Definition: GnashKey.h:79
const std::string & getURLOpenerFormat() const
Get the URL opener command format.
Definition: rc.h:239
@ p
Definition: GnashKey.h:162
@ SHIFT
Definition: GnashKey.h:61
bool useLocalHost() const
Whether to restrict access to the local host
Definition: rc.h:139
void saveStreamingMedia(bool value)
Definition: rc.h:298
@ UP
Definition: GnashKey.h:206
virtual void resizeWindow(int width, int height)
Definition: Qt4Gui.cpp:234
virtual void setTimeout(unsigned int timeout)
Set the time in milliseconds after which the programme should exit.
Definition: Qt4Gui.cpp:306
@ HOME
Definition: GnashKey.h:211
const std::string & getMediaDir() const
Definition: rc.h:308
void resize_view(int width, int height)
Resize the client area view and the window accordingly.
Definition: gui.cpp:429
virtual bool createWindow(const char *windowtitle, int width, int height, int xPosition=0, int yPosition=0)
Create and display our window.
Definition: Qt4Gui.cpp:182
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
bool useParserDump() const
Definition: rc.h:77
bool _mouseShown
Definition: gui.h:516
2D Point class
Definition: Point2d.h:39
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
virtual void handleKeyEvent(QKeyEvent *event, bool down)
Definition: Qt4Gui.cpp:464
void play()
Put the application in "play" mode.
Definition: gui.cpp:830
void quit()
Always called on exit.
Definition: gui.cpp:215
bool want_multiple_regions()
Definition: Qt4Gui.h:114
@ CURSOR_HAND
Definition: gui.h:82
@ j
Definition: GnashKey.h:156
virtual bool showMouse(bool show)
Sets whether the gui should show the system mouse pointer.
Definition: Qt4Gui.cpp:338
void restart()
Definition: gui.cpp:269
virtual bool run()
Start main rendering loop.
Definition: Qt4Gui.cpp:176
Definition: Qt4GlueAgg.h:40
void setSOLSafeDir(const std::string &x)
Definition: rc.h:271
@ ESCAPE
Definition: GnashKey.h:72
unsigned long _xid
The X Window ID to attach to. If zero, we create a new window.
Definition: gui.h:486
@ MINUS
Definition: GnashKey.h:90
virtual ~Qt4Gui()
Definition: Qt4Gui.cpp:106
@ c
Definition: GnashKey.h:149
void showProperties()
Definition: Qt4Gui.cpp:479
@ EQUALS
Definition: GnashKey.h:108
@ BACKSLASH
Definition: GnashKey.h:141
void showPreferences()
Definition: Qt4Gui.cpp:564
#define DSOEXPORT
Definition: dsodefs.h:55
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
geometry::Range2d< int > _validbounds
Definition: gui.h:491
const std::string & getFlashVersionString() const
Definition: rc.h:196
bool startStopped() const
Return true if user is willing to start the gui in "stop" mode.
Definition: rc.h:103
void renderWidget(const QRect &updateRect)
Definition: Qt4Gui.cpp:274
@ GNASH_MOD_ALT
Definition: GnashKey.h:38
@ NOBREAKSPACE
Definition: GnashKey.h:227
const std::string & getSOLSafeDir() const
Definition: rc.h:268
@ SLASH
Definition: GnashKey.h:92
void popupMenu(const QPoint &point)
Definition: Qt4Gui.cpp:243
#define _q(Str)
Definition: Qt4Gui.cpp:72
bool insecureSSL() const
Definition: rc.h:106
void setURLOpenerFormat(const std::string &value)
Definition: rc.h:244
@ SPACE
Definition: GnashKey.h:77
void setDebugLog(const std::string &x)
Definition: rc.h:115
void setFlashVersionString(const std::string &value)
Definition: rc.h:200
void notify_key_event(gnash::key::code k, int modifier, bool pressed)
Key event notification to be called when a key is pressed or depressed.
Definition: gui.cpp:560
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
@ width
Definition: klash_part.cpp:329
@ HELP
Definition: GnashKey.h:325
double getStreamsTimeout() const
The number of seconds of inactivity before timing out streams downloads.
Definition: rc.h:229
void quitUI()
End main rendering loop calling GUI-specific exit functions.
Definition: Qt4Gui.cpp:593
@ SEMICOLON
Definition: GnashKey.h:106
bool useWriteLog() const
Definition: rc.h:80
bool showASCodingErrors() const
Definition: rc.h:86
virtual std::pair< int, int > screenResolution() const
Definition: Qt4Gui.cpp:387
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: Qt4Gui.cpp:282
@ e
Definition: GnashKey.h:151
void setMediaDir(const std::string &value)
Definition: rc.h:306
int _height
Desired window height.
Definition: gui.h:497
virtual void unsetFullscreen()
Definition: Qt4Gui.cpp:364
const std::string & getFlashSystemOS() const
Definition: rc.h:204
void setSOLLocalDomain(bool x)
Definition: rc.h:275
void stop()
Put the application in "stop" mode.
Definition: gui.cpp:853
@ NUM_LOCK
Definition: GnashKey.h:223