[maemo-developers] gtkmozembed not embedding browser

From: Dustin Smith dsmit at MIT.EDU
Date: Tue Sep 9 00:22:32 EEST 2008
My goal is to write a lightweight application that embeds a  
fullscreen Flash movie (via a browser component) on a N810 running  
Maemo Diablo v4.2008.  I have tried writing my own EAL wrapper (using  
dummy-eal [1]) and running eal-test (as instructed: [2]), but after  
the dummy-eal widget had loaded, the browser component would never  
appear, even after "successful" execution.   Now I'm using the  
gtkembedmoz-1.2.3 library [3], but am having a similar problem.

The minimal C++ program below uses "gtkmozembed" and tries to load  
Google.  GTK builds a window but the browser never loads the page.   
Does anyone know what may be going wrong here?

Thanks very much,
Dustin

[1] https://garage.maemo.org/project/showfiles.php?group_id=107
[2] http://browser.garage.maemo.org/docs/dummy.html
[3] https://garage.maemo.org/svn/browser/mozilla/trunk/libgtkembedmoz/

----------[moz.cpp]-----------

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <gtk/gtk.h>
#include <libgnomevfs/gnome-vfs.h>
#include "gtkmozembed.h"

static void close_button_handler ()
{
	gtk_main_quit ();
}

int main(int argc, char *argv[]) {

	GtkWidget *embed;
	GtkWidget *window;

	g_thread_init(NULL);

	gtk_init (&argc, &argv);

	if(!gnome_vfs_init()) {
		g_error("Gnome VFS init failed\n");
	}

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  	gtk_window_set_title(GTK_WINDOW(window), "Flash Embed");
	gtk_window_set_default_size(GTK_WINDOW(window), 500, 400);
	gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC  
(close_button_handler), NULL);

  	embed = gtk_moz_embed_new();
  	gchar *url = "http://www.google.com";
   	gtk_moz_embed_load_url(GTK_MOZ_EMBED(embed), url);
	
	gtk_container_add (GTK_CONTAINER (window), embed);
	gtk_widget_show_all(GTK_WIDGET(window));
  	gtk_main();

	return 0;
}



---------[Makefile]-----------

PKGS = gtkembedmoz gtk+-2.0 gconf-2.0 gnome-vfs-module-2.0
CFLAGS = `pkg-config --cflags $(PKGS)`
LDFLAGS = `pkg-config --libs $(PKGS)`

make: moz.cpp
	svn update
	g++ $(CFLAGS) -g -o moz moz.cpp $(LDFLAGS)



-----[scratchbox output]------

run-standalone.sh ./moz
qemu: Unsupported syscall: 264
/home/dustin/.osso/current-gtk-key-theme:1: Unable to find include  
file: "keybindings.rc"
hildon-desktop[6502]: GLIB WARNING ** default - Application Flash  
Embed did not provide valid .desktop file
Audio File Library: could not open file '/usr/share/sounds/ui- 
window_open.wav' [error 3]
Audio File Library: could not open file '/usr/share/sounds/ui- 
window_close.wav' [error 3]



More information about the maemo-developers mailing list