2
* The contents of this file are subject to the Mozilla Public
3
* License Version 1.1 (the "License"); you may not use this file
4
* except in compliance with the License. You may obtain a copy of
5
* the License at http://www.mozilla.org/MPL/
7
* Software distributed under the License is distributed on an "AS
8
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
* implied. See the License for the specific language governing
10
* rights and limitations under the License.
12
* The Original Code is mozilla.org code.
14
* The Initial Developer of the Original Code is Christopher Blizzard.
15
* Portions created by Christopher Blizzard are Copyright (C)
16
* Christopher Blizzard. All Rights Reserved.
19
* Christopher Blizzard <blizzard@mozilla.org>
25
#include <sys/types.h>
28
GtkWidget *toplevel_window = 0;
29
GtkWidget *button = 0;
31
GtkWidget *gtk_socket = 0;
34
insert_mozilla(gpointer data);
37
main(int argc, char **argv)
39
gtk_init(&argc, &argv);
41
toplevel_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
43
gtk_signal_connect(GTK_OBJECT(toplevel_window), "destroy",
44
(GtkSignalFunc) gtk_exit, NULL);
46
vbox = gtk_vbox_new(FALSE, 0);
47
gtk_container_add(GTK_CONTAINER(toplevel_window), vbox);
48
gtk_widget_show(vbox);
50
button = gtk_button_new_with_label("Insert Mozilla");
52
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
53
gtk_widget_show(button);
55
gtk_signal_connect(GTK_OBJECT(button), "clicked",
56
GTK_SIGNAL_FUNC(insert_mozilla), NULL);
58
gtk_widget_show(toplevel_window);
66
insert_mozilla(gpointer data)
74
gtk_socket = gtk_socket_new();
75
gtk_box_pack_start(GTK_BOX(vbox), gtk_socket, TRUE, TRUE, 0);
76
gtk_widget_show(gtk_socket);
78
sprintf(buffer, "%#lx", GDK_WINDOW_XWINDOW(gtk_socket->window));
82
if ((pid = fork()) == 0) { /* child */
83
execl("./TestGtkEmbedChild", "./TestGtkEmbedChild", buffer, NULL);
84
fprintf(stderr, "can't exec child\n");
87
else if (pid > 0) { /* parent */
90
fprintf(stderr, "Can't fork.\n");