Updated FSF's address
[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, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include "atkwindow.h"
19 #include "atkmarshal.h"
20
21 /**
22  * SECTION:atkwindow
23  * @Short_description: The ATK Interface provided by UI components that represent a top-level window.
24  * @Title: AtkWindow
25  * @See_also: #AtkObject
26  *
27  * #AtkWindow should be implemented by the UI elements that represent
28  * a top-level window, such as the main window of an application or
29  * dialog.
30  *
31  */
32
33 enum {
34   ACTIVATE,
35   CREATE,
36   DEACTIVATE,
37   DESTROY,
38   MAXIMIZE,
39   MINIMIZE,
40   MOVE,
41   RESIZE,
42   RESTORE,
43   LAST_SIGNAL
44 };
45
46 static guint atk_window_signals[LAST_SIGNAL] = { 0 };
47
48 static guint
49 atk_window_add_signal (const gchar *name)
50 {
51   return g_signal_new (name,
52                        ATK_TYPE_WINDOW,
53                        G_SIGNAL_RUN_LAST,
54                        0,
55                        (GSignalAccumulator) NULL, NULL,
56                        g_cclosure_marshal_VOID__VOID,
57                        G_TYPE_NONE,
58                        0);
59 }
60
61 typedef AtkWindowIface AtkWindowInterface;
62 G_DEFINE_INTERFACE (AtkWindow, atk_window, ATK_TYPE_OBJECT)
63
64 static void
65 atk_window_default_init (AtkWindowIface *iface)
66 {
67   static gboolean initialized = FALSE;
68
69   if (!initialized)
70     {
71       /**
72        * AtkWindow::activate:
73        * @object: the object which received the signal
74        *
75        * The signal #AtkWindow::activate is emitted when a window
76        * becomes the active window of the application or session.
77        *
78        * Since: 2.2
79        */
80       atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
81       /**
82        * AtkWindow::create:
83        * @object: the object which received the signal
84        *
85        * The signal #AtkWindow::create is emitted when a new window
86        * is created.
87        *
88        * Since: 2.2
89        */
90       atk_window_signals[CREATE] = atk_window_add_signal ("create");
91       /**
92        * AtkWindow::deactivate:
93        * @object: the object which received the signal
94        *
95        * The signal #AtkWindow::deactivate is emitted when a window is
96        * no longer the active window of the application or session.
97        *
98        * Since: 2.2
99        */
100       atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
101       /**
102        * AtkWindow::destroy:
103        * @object: the object which received the signal
104        *
105        * The signal #AtkWindow::destroy is emitted when a window is
106        * destroyed.
107        *
108        * Since: 2.2
109        */
110       atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
111       /**
112        * AtkWindow::maximize:
113        * @object: the object which received the signal
114        *
115        * The signal #AtkWindow::maximize is emitted when a window
116        * is maximized.
117        *
118        * Since: 2.2
119        */
120       atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
121       /**
122        * AtkWindow::minimize:
123        * @object: the object which received the signal
124        *
125        * The signal #AtkWindow::minimize is emitted when a window
126        * is minimized.
127        *
128        * Since: 2.2
129        */
130       atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
131       /**
132        * AtkWindow::move:
133        * @object: the object which received the signal
134        *
135        * The signal #AtkWindow::move is emitted when a window
136        * is moved.
137        *
138        * Since: 2.2
139        */
140       atk_window_signals[MOVE] = atk_window_add_signal ("move");
141       /**
142        * AtkWindow::resize:
143        * @object: the object which received the signal
144        *
145        * The signal #AtkWindow::resize is emitted when a window
146        * is resized.
147        *
148        * Since: 2.2
149        */
150       atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
151       /**
152        * AtkWindow::restore:
153        * @object: the object which received the signal
154        *
155        * The signal #AtkWindow::restore is emitted when a window
156        * is restored.
157        *
158        * Since: 2.2
159        */
160       atk_window_signals[RESTORE] = atk_window_add_signal ("restore");
161
162       initialized = TRUE;
163     }
164 }