]> Pileus Git - ~andy/gtk/blob - tests/testsocket_child.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / tests / testsocket_child.c
1 /* testsocket_child.c
2  * Copyright (C) 2001 Red Hat, Inc
3  * Author: Owen Taylor
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #include "config.h"
20 #include <stdio.h>
21 #include <stdlib.h>
22
23 #include <gtk/gtk.h>
24
25 extern guint32 create_child_plug (guint32  xid,
26                                   gboolean local);
27
28 int
29 main (int argc, char *argv[])
30 {
31   guint32 xid;
32   guint32 plug_xid;
33
34   gtk_init (&argc, &argv);
35
36   if (argc != 1 && argc != 2)
37     {
38       fprintf (stderr, "Usage: testsocket_child [WINDOW_ID]\n");
39       exit (1);
40     }
41
42   if (argc == 2)
43     {
44       xid = strtol (argv[1], NULL, 0);
45       if (xid == 0)
46         {
47           fprintf (stderr, "Invalid window id '%s'\n", argv[1]);
48           exit (1);
49         }
50       
51       create_child_plug (xid, FALSE);
52     }
53   else
54     {
55       plug_xid = create_child_plug (0, FALSE);
56       printf ("%d\n", plug_xid);
57       fflush (stdout);
58     }
59
60   gtk_main ();
61
62   return 0;
63 }
64
65