]> Pileus Git - ~andy/gtk/blob - tests/testsocket_child.c
For XEMBED embedding add a _XEMBED_INFO property to the client with
[~andy/gtk] / tests / testsocket_child.c
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #include <gtk/gtk.h>
5
6 extern guint32 create_child_plug (guint32  xid,
7                                   gboolean local);
8
9 int
10 main (int argc, char *argv[])
11 {
12   guint32 xid;
13   guint32 plug_xid;
14
15   gtk_init (&argc, &argv);
16
17   if (argc != 1 && argc != 2)
18     {
19       fprintf (stderr, "Usage: testsocket_child [WINDOW_ID]\n");
20       exit (1);
21     }
22
23   if (argc == 2)
24     {
25       xid = strtol (argv[1], NULL, 0);
26       if (xid == 0)
27         {
28           fprintf (stderr, "Invalid window id '%s'\n", argv[1]);
29           exit (1);
30         }
31       
32       create_child_plug (xid, FALSE);
33     }
34   else
35     {
36       plug_xid = create_child_plug (0, FALSE);
37       printf ("%d\n", plug_xid);
38       fflush (stdout);
39     }
40
41   gtk_main ();
42
43   return 0;
44 }
45
46