BGO#638924: Add AtkWindow
[platform/upstream/atk.git] / atk / atkwindow.c
1 /* ATK -  Accessibility Toolkit
2  * Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include "atkwindow.h"
21 #include "atkmarshal.h"
22
23 enum {
24   ACTIVATE,
25   CREATE,
26   DEACTIVATE,
27   DESTROY,
28   MAXIMIZE,
29   MINIMIZE,
30   MOVE,
31   RESIZE,
32   RESTORE,
33   LAST_SIGNAL
34 };
35
36 static guint atk_window_signals[LAST_SIGNAL] = { 0 };
37
38 static guint
39 atk_window_add_signal (const gchar *name)
40 {
41   return g_signal_new (name,
42                        ATK_TYPE_WINDOW,
43                        G_SIGNAL_RUN_LAST,
44                        0,
45                        (GSignalAccumulator) NULL, NULL,
46                        g_cclosure_marshal_VOID__VOID,
47                        G_TYPE_NONE,
48                        0);
49 }
50
51 typedef AtkWindowIface AtkWindowInterface;
52 G_DEFINE_INTERFACE (AtkWindow, atk_window, ATK_TYPE_OBJECT)
53
54 static void
55 atk_window_default_init (AtkWindowIface *iface)
56 {
57   static gboolean initialized = FALSE;
58
59   if (!initialized)
60     {
61       atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
62       atk_window_signals[CREATE] = atk_window_add_signal ("create");
63       atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
64       atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
65       atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
66       atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
67       atk_window_signals[MOVE] = atk_window_add_signal ("move");
68       atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
69       atk_window_signals[RESTORE] = atk_window_add_signal ("restore");
70
71       initialized = TRUE;
72     }
73 }