Release 2.15.1
[atk.git] / atk / atkwindow.c
blob8e7ad8ac5769776b09e139bf0fba525623b220f3
1 /* ATK - Accessibility Toolkit
2 * Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
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.
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.
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.
20 #include "config.h"
22 #include "atkwindow.h"
23 #include "atkmarshal.h"
25 /**
26 * SECTION:atkwindow
27 * @Short_description: The ATK Interface provided by UI components that represent a top-level window.
28 * @Title: AtkWindow
29 * @See_also: #AtkObject
31 * #AtkWindow should be implemented by the UI elements that represent
32 * a top-level window, such as the main window of an application or
33 * dialog.
37 enum {
38 ACTIVATE,
39 CREATE,
40 DEACTIVATE,
41 DESTROY,
42 MAXIMIZE,
43 MINIMIZE,
44 MOVE,
45 RESIZE,
46 RESTORE,
47 LAST_SIGNAL
50 static guint atk_window_signals[LAST_SIGNAL] = { 0 };
52 static guint
53 atk_window_add_signal (const gchar *name)
55 return g_signal_new (name,
56 ATK_TYPE_WINDOW,
57 G_SIGNAL_RUN_LAST,
59 (GSignalAccumulator) NULL, NULL,
60 g_cclosure_marshal_VOID__VOID,
61 G_TYPE_NONE,
62 0);
65 typedef AtkWindowIface AtkWindowInterface;
66 G_DEFINE_INTERFACE (AtkWindow, atk_window, ATK_TYPE_OBJECT)
68 static void
69 atk_window_default_init (AtkWindowIface *iface)
71 static gboolean initialized = FALSE;
73 if (!initialized)
75 /**
76 * AtkWindow::activate:
77 * @object: the object which received the signal
79 * The signal #AtkWindow::activate is emitted when a window
80 * becomes the active window of the application or session.
82 * Since: 2.2
84 atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
85 /**
86 * AtkWindow::create:
87 * @object: the object which received the signal
89 * The signal #AtkWindow::create is emitted when a new window
90 * is created.
92 * Since: 2.2
94 atk_window_signals[CREATE] = atk_window_add_signal ("create");
95 /**
96 * AtkWindow::deactivate:
97 * @object: the object which received the signal
99 * The signal #AtkWindow::deactivate is emitted when a window is
100 * no longer the active window of the application or session.
102 * Since: 2.2
104 atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
106 * AtkWindow::destroy:
107 * @object: the object which received the signal
109 * The signal #AtkWindow::destroy is emitted when a window is
110 * destroyed.
112 * Since: 2.2
114 atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
116 * AtkWindow::maximize:
117 * @object: the object which received the signal
119 * The signal #AtkWindow::maximize is emitted when a window
120 * is maximized.
122 * Since: 2.2
124 atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
126 * AtkWindow::minimize:
127 * @object: the object which received the signal
129 * The signal #AtkWindow::minimize is emitted when a window
130 * is minimized.
132 * Since: 2.2
134 atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
136 * AtkWindow::move:
137 * @object: the object which received the signal
139 * The signal #AtkWindow::move is emitted when a window
140 * is moved.
142 * Since: 2.2
144 atk_window_signals[MOVE] = atk_window_add_signal ("move");
146 * AtkWindow::resize:
147 * @object: the object which received the signal
149 * The signal #AtkWindow::resize is emitted when a window
150 * is resized.
152 * Since: 2.2
154 atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
156 * AtkWindow::restore:
157 * @object: the object which received the signal
159 * The signal #AtkWindow::restore is emitted when a window
160 * is restored.
162 * Since: 2.2
164 atk_window_signals[RESTORE] = atk_window_add_signal ("restore");
166 initialized = TRUE;