diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /xparts/mozilla/main.c | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'xparts/mozilla/main.c')
-rw-r--r-- | xparts/mozilla/main.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/xparts/mozilla/main.c b/xparts/mozilla/main.c new file mode 100644 index 00000000..c4b8e3ca --- /dev/null +++ b/xparts/mozilla/main.c @@ -0,0 +1,69 @@ +#include "kmozilla.h" +#include <dcopc/dcopc.h> +#include "gtkpart.h" + +#include <stdio.h> + +gboolean dcop_socket_notify( GIOChannel *chan, GIOCondition condition, gpointer data ) +{ + DcopClient *client = (DcopClient *)data; + g_warning( "dcop_socket_notify\n" ); + dcop_client_process_socket_data( client ); + return TRUE; +} + +void gtktest_exit() +{ + g_warning( "EXIT!\n" ); + gtk_main_quit(); +} + + +int main( int argc, char **argv ) +{ + GtkKmozilla *moz; + GtkXPart *part; + DcopClient *client; + GIOChannel *socket_chan; + + gtk_init( &argc, &argv ); + + moz = gtk_kmozilla_new( ); + part = (GtkXPart *)moz; + client = dcop_client_new(); +/* dcop_client_attach( client );*/ + /* for debugging*/ + dcop_client_register_as( client, "kmozilla", TRUE ); + + socket_chan = g_io_channel_unix_new( dcop_client_socket( client ) ); + g_io_channel_ref( socket_chan ); + g_io_add_watch( socket_chan, G_IO_IN, dcop_socket_notify, client ); + + fprintf(stderr, "client initialized!\n"); + + gtk_kmozilla_set_dcop_client(part, client); + if(!gtk_xpart_register(part, argv[1], argv[2])) + fprintf(stderr, "could not register part\n"); + + { + /* initialize actions */ + const char * actions = "<!DOCTYPE actionList SYSTEM \"actionlist.dtd\">\n" + "<Actionlist>\n" + " <Action name=\"stop\" />\n" + " <Action name=\"reload\" />\n" + " <Action name=\"nonexistant\" />\n" + " <XMLFile location=\"./kmozilla.rc\" />\n" + "</Actionlist>\n"; + gtk_xpart_initialize_actions( part, actions ); + fprintf(stderr, "hopfully initialized actions\n"); + } + fprintf(stderr, "done!\n"); + + gtk_main(); + + g_io_channel_unref( socket_chan ); + + gtk_object_destroy( GTK_OBJECT(client) ); + + return 0; +} |