Re: [gtkmm] Gecko bindings?



On Fri, Jul 02, 2004 at 01:15:53PM +0200, Murray Cumming wrote:
> Would someone like to start some Gecko (GtkMozEmbed, I think) bindings,
> so that we have a good HTML-rendering widget?

I have made a start at this, but I'm having some trouble actually
getting mozilla to work at all on my system, so I've run into a bit of a
brick wall there. I'll continue to try to get it going, but if anyone's
interested in continuing, the attached .hg file may be of use (or it may 
not, I've never wrapped a widget before, and wrote it just by looking at 
the relationship between gtk/gtkbutton.h and gtkmm's button.hg, since 
both seem to be derived from GtkBin).

~Ainsley
/*
	TODO: copyright notice
*/

#include <gtkmm/bin.h>
#include <gtkmm/stockid.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/bin_p.h)

namespace Gtk
{

class MozEmbed : public Bin
{
	_CLASS_GTKOBJECT(MozEmbed,GtkMozEmbed,GTK_MOZEMBED,Gtk::Bin,GtkBin)
protected:
	_CTOR_DEFAULT
public:
		// TODO: check this one - make it static?
	_WRAP_METHOD( void gtk_moz_embed_set_comp_path(char *aPath), gtk_moz_embed_set_comp_path)

	_WRAP_METHOD( void load_url(const char *url), gtk_moz_embed_load_url)
	_WRAP_METHOD( void stop_load(), gtk_moz_embed_stop_load)
	_WRAP_METHOD( bool can_go_back(), gtk_moz_embed_can_go_back)
	_WRAP_METHOD( bool can_go_forward(), gtk_moz_embed_can_go_forward)
	_WRAP_METHOD( void go_back(), gtk_moz_embed_go_back)
	_WRAP_METHOD( void go_forward(), gtk_moz_embed_go_forward)
	_WRAP_METHOD( void render_data(const char *data, guint32 len, const char *base_uri, const char *mime_type), gtk_moz_embed_render_data)
	_WRAP_METHOD( void open_stream(const char *base_uri, const char *mime_type), gtk_moz_embed_open_stream)
	_WRAP_METHOD( void append_data(const char *data, guint32 len), gtk_moz_embed_append_data)
	_WRAP_METHOD( void close_stream(), gtk_moz_embed_close_stream)
	_WRAP_METHOD( char *get_link_message(), gtk_moz_embed_get_link_message)
	_WRAP_METHOD( char *get_js_status(), gtk_moz_embed_get_js_status)
	_WRAP_METHOD( char *get_title(), gtk_moz_embed_get_title)
	_WRAP_METHOD( char *get_location(), gtk_moz_embed_get_location)
	_WRAP_METHOD( void reload(gint32 flags), gtk_moz_embed_reload)
	_WRAP_METHOD( void set_chrome_mask(guint32 flags), gtk_moz_embed_set_chrome_mask)
	_WRAP_METHOD( guint32 get_chrome_mask(), gtk_moz_embed_get_chrome_mask)

	_WRAP_SIGNAL(void link_message(), "link_message")
	_WRAP_SIGNAL(void js_status(), "js_status")
	_WRAP_SIGNAL(void location(), "location")
	_WRAP_SIGNAL(void title(), "title")
	_WRAP_SIGNAL(void progress(gint curprogress, gint maxprogress), "progress")
	_WRAP_SIGNAL(void progress_all(const char *aURI, gint curprogress, gint maxprogress), "progress_all")
	_WRAP_SIGNAL(void net_state(gint state, guint status), "net_state")
	_WRAP_SIGNAL(void net_state_all(const char *aURI, gint state, guint status), "net_state_all")
	_WRAP_SIGNAL(void net_start(), "net_start")
	_WRAP_SIGNAL(void net_stop(), "net_stop")
	_WRAP_SIGNAL(void new_window(GtkMozEmbed **newEmbed, guint chromemask), "new_window")
	_WRAP_SIGNAL(void visibility(gboolean visibility), "visibility")
	_WRAP_SIGNAL(void destroy_brsr(), "destroy_brsr")
	_WRAP_SIGNAL(gint open_uri(const char *aURI), "open_uri")
	_WRAP_SIGNAL(void size_to(gint width, gint height), "size_to")
	_WRAP_SIGNAL(gint dom_key_down(gpointer dom_event), "dom_key_down")
	_WRAP_SIGNAL(gint dom_key_press(gpointer dom_event), "dom_key_press")
	_WRAP_SIGNAL(gint dom_key_up(gpointer dom_event), "dom_key_up")
	_WRAP_SIGNAL(gint dom_mouse_down(gpointer dom_event), "dom_mouse_down")
	_WRAP_SIGNAL(gint dom_mouse_up(gpointer dom_event), "dom_mouse_up")
	_WRAP_SIGNAL(gint dom_mouse_click(gpointer dom_event), "dom_mouse_click")
	_WRAP_SIGNAL(gint dom_mouse_dbl_click(gpointer dom_event), "dom_mouse_dbl_click")
	_WRAP_SIGNAL(gint dom_mouse_over(gpointer dom_event), "dom_mouse_over")
	_WRAP_SIGNAL(gint dom_mouse_out(gpointer dom_event), "dom_mouse_out")
	_WRAP_SIGNAL(void security_change(gpointer request, guint state), "security_change")
	_WRAP_SIGNAL(void status_change(gpointer request, gint status, gpointer message), "status_change")

};

} // namespace Gtk



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]