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