2004-03-06 03:38:59 +00:00
|
|
|
#include <config.h>
|
2001-03-03 18:23:21 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-07-03 14:14:30 +00:00
|
|
|
extern guint32 create_child_plug (guint32 xid,
|
|
|
|
gboolean local);
|
2001-03-03 18:23:21 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
guint32 xid;
|
2001-07-03 14:14:30 +00:00
|
|
|
guint32 plug_xid;
|
2001-03-03 18:23:21 +00:00
|
|
|
|
|
|
|
gtk_init (&argc, &argv);
|
|
|
|
|
2001-07-03 14:14:30 +00:00
|
|
|
if (argc != 1 && argc != 2)
|
2001-03-03 18:23:21 +00:00
|
|
|
{
|
2001-07-03 14:14:30 +00:00
|
|
|
fprintf (stderr, "Usage: testsocket_child [WINDOW_ID]\n");
|
2001-03-03 18:23:21 +00:00
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
2001-07-03 14:14:30 +00:00
|
|
|
if (argc == 2)
|
2001-03-03 18:23:21 +00:00
|
|
|
{
|
2001-07-03 14:14:30 +00:00
|
|
|
xid = strtol (argv[1], NULL, 0);
|
|
|
|
if (xid == 0)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "Invalid window id '%s'\n", argv[1]);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
create_child_plug (xid, FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
plug_xid = create_child_plug (0, FALSE);
|
|
|
|
printf ("%d\n", plug_xid);
|
|
|
|
fflush (stdout);
|
2001-03-03 18:23:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|