• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

gtksup.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   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_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(); //an alternative popup menu
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     //  This should only appear in the standalone player.
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     // Display a properties dialogue
00116     void showPropertiesDialog();
00117     
00118     // Display a preferences dialogue
00119     void showPreferencesDialog();
00120     
00121     // Display an About dialogue
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     // A window only for rendering the plugin as fullscreen.
00150     GtkWidget* _overlay;
00151     
00152     // The area rendered into by Gnash
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     // Create a tree model for displaying movie info
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 } // namespace gnash
00188 
00189 #endif

Generated on Fri Mar 16 2012 15:46:10 for Gnash by  doxygen 1.7.1