Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_GTKSUP_H
00020 #define GNASH_GTKSUP_H
00021
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025
00026 #include "gnash.h"
00027 #include "gtk_glue.h"
00028
00029 #include <string>
00030 #include <gdk/gdk.h>
00031 #include <gtk/gtk.h>
00032
00033 #ifdef BUILD_CANVAS
00034 #include "gtk_canvas.h"
00035 #endif
00036
00037 #ifdef GUI_HILDON
00038 extern "C" {
00039 # include <hildon/hildon.h>
00040 }
00041 #endif
00042
00043 #ifdef USE_ALP
00044 # include <alp/bundlemgr.h>
00045 #endif
00046
00047 namespace gnash
00048 {
00049
00050
00051 class GtkGui : public Gui
00052 {
00053 public:
00054
00055 GtkGui(unsigned long xid, float scale, bool loop, RunResources& r);
00056
00057 virtual ~GtkGui();
00058
00060
00061 virtual bool init(int argc, char **argv[]);
00062 virtual bool createWindow(int width, int height);
00063 virtual bool createWindow(const char *title, int width, int height,
00064 int xPosition = 0, int yPosition = 0);
00065 virtual void resizeWindow(int width, int height);
00066
00067 virtual bool run();
00068
00069 virtual void quitUI();
00070
00071 virtual bool createMenu();
00072
00073 virtual bool createMenuAlt();
00074
00076
00080 virtual bool setupEvents();
00081 virtual void beforeRendering();
00082 virtual void renderBuffer();
00083 virtual void setInterval(unsigned int interval);
00084 virtual void setTimeout(unsigned int timeout);
00085
00086 virtual void setFullscreen();
00087 virtual void unsetFullscreen();
00088
00089 virtual void hideMenu();
00090
00092 virtual double getPixelAspectRatio();
00093 virtual int getScreenResX();
00094 virtual int getScreenResY();
00095 virtual double getScreenDPI();
00096
00097 bool watchFD(int fd);
00098
00100
00103 void grabFocus();
00104
00106
00107 bool createMenuBar();
00108 void createFileMenu(GtkWidget *obj);
00109 void createEditMenu(GtkWidget *obj);
00110 void createViewMenu(GtkWidget *obj);
00111 void createQualityMenu(GtkWidget *obj);
00112 void createHelpMenu(GtkWidget *obj);
00113 void createControlMenu(GtkWidget *obj);
00114
00115
00116 void showPropertiesDialog();
00117
00118
00119 void showPreferencesDialog();
00120
00121
00122 void showAboutDialog();
00123
00124 void expose(const GdkRegion* region);
00125
00126 void setInvalidatedRegions(const InvalidatedRanges& ranges);
00127
00128 bool want_multiple_regions() { return true; }
00129
00130 virtual void setCursor(gnash_cursor_type newcursor);
00131
00132 virtual bool showMouse(bool show);
00133
00134 virtual void showMenu(bool show);
00135
00136 virtual void error(const std::string& msg);
00137
00138 bool checkX11Extension(const std::string& ext);
00139
00140 private:
00141
00142 #ifdef GUI_HILDON
00143 HildonProgram *_hildon_program;
00144 #endif
00145
00146 GtkWidget* _window;
00147 GtkWidget* _resumeButton;
00148
00149
00150 GtkWidget* _overlay;
00151
00152
00153 #ifdef BUILD_CANVAS
00154 GtkWidget* _canvas;
00155 #else
00156 GtkWidget* _drawingArea;
00157 #endif
00158
00159 GtkMenu* _popup_menu;
00160 GtkMenu* _popup_menu_alt;
00161 GtkWidget* _menubar;
00162 GtkWidget* _vbox;
00163
00165
00169 void setupWindowEvents();
00170
00171 #ifdef USE_SWFTREE
00172
00173 GtkTreeModel* makeTreeModel (std::auto_ptr<InfoTree> treepointer);
00174 #endif
00175
00176 void stopHook();
00177 void playHook();
00178
00179 guint _advanceSourceTimer;
00180
00181 void startAdvanceTimer();
00182
00183 void stopAdvanceTimer();
00184
00185 };
00186
00187 }
00188
00189 #endif