Gnash  0.8.10
gtkext.h
Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
00003 //   Free Software 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 __GTKEXT_PLUGIN_H__
00020 #define __GTKEXT_PLUGIN_H__
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025 
00026 #include <memory> // for auto_ptr
00027 #include "as_object.h"
00028 
00029 #include <cstdio>
00030 #include <string>
00031 #include <map>
00032 #include <gtk/gtk.h>
00033 #include <gdk/gdkx.h>
00034 
00035 namespace gnash
00036 {
00037 
00038 class GtkExt : public as_object {
00039 public:
00040     GtkExt();
00041     ~GtkExt();
00042 
00043     typedef void (*gtk_callback_t)(GtkWidget *widget, gpointer data);
00044 
00045     // Gtk2 API
00046     void window_new();
00047     void signal_connect();
00048     void container_set_border_width(int width);
00049     GtkWidget *button_new_with_label(const char *label);
00050     void signal_connect_swapped();
00051     void container_add();
00052     void widget_show();
00053     void main();
00054 
00055     // internal methods
00056     GtkWidget *getWindow() { return _window; };
00057     void setWindow(GtkWidget *x) { _window = x; };
00058 //     void addCallback(std::string &event, as_value *func) { _callbacks[event] = func; };
00059 //     as_value *getCallback(std::string &event) { return _callbacks[event]; };
00060 //     std::map<std::string, as_value *>        _callbacks;
00061     
00062 private:
00063     GtkWidget                   *_window;
00064 };
00065 
00066 extern "C" {
00067     void gtkext_class_init(as_object &obj);  
00069 }
00070 
00071 std::auto_ptr<as_object> init_gtkext_instance();
00072 
00073 } // end of gnash namespace
00074 
00075 // __GTKEXT_PLUGIN_H__
00076 #endif
00077 
00078 // Local Variables:
00079 // mode: C++
00080 // indent-tabs-mode: t
00081 // End: