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 "config.h"
21

            
22
#include "atkmarshal.h"
23
#include "atkwindow.h"
24

            
25
/**
26
 * AtkWindow:
27
 *
28
 * The ATK Interface provided by UI components that represent a top-level window.
29
 *
30
 * #AtkWindow should be implemented by the UI elements that represent
31
 * a top-level window, such as the main window of an application or
32
 * dialog.
33
 *
34
 * See [class@AtkObject]
35
 */
36

            
37
enum
38
{
39
  ACTIVATE,
40
  CREATE,
41
  DEACTIVATE,
42
  DESTROY,
43
  MAXIMIZE,
44
  MINIMIZE,
45
  MOVE,
46
  RESIZE,
47
  RESTORE,
48
  LAST_SIGNAL
49
};
50

            
51
static guint atk_window_signals[LAST_SIGNAL] = { 0 };
52

            
53
static guint
54
1449
atk_window_add_signal (const gchar *name)
55
{
56
1449
  return g_signal_new (name,
57
                       ATK_TYPE_WINDOW,
58
                       G_SIGNAL_RUN_LAST,
59
                       0,
60
                       (GSignalAccumulator) NULL, NULL,
61
                       g_cclosure_marshal_VOID__VOID,
62
                       G_TYPE_NONE,
63
                       0);
64
}
65

            
66
typedef AtkWindowIface AtkWindowInterface;
67
1610
G_DEFINE_INTERFACE (AtkWindow, atk_window, ATK_TYPE_OBJECT)
68

            
69
static void
70
161
atk_window_default_init (AtkWindowIface *iface)
71
{
72
  static gboolean initialized = FALSE;
73

            
74
161
  if (!initialized)
75
    {
76
      /**
77
       * AtkWindow::activate:
78
       * @object: the object which received the signal
79
       *
80
       * The signal #AtkWindow::activate is emitted when a window
81
       * becomes the active window of the application or session.
82
       *
83
       * Since: 2.2
84
       */
85
161
      atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
86
      /**
87
       * AtkWindow::create:
88
       * @object: the object which received the signal
89
       *
90
       * The signal #AtkWindow::create is emitted when a new window
91
       * is created.
92
       *
93
       * Since: 2.2
94
       */
95
161
      atk_window_signals[CREATE] = atk_window_add_signal ("create");
96
      /**
97
       * AtkWindow::deactivate:
98
       * @object: the object which received the signal
99
       *
100
       * The signal #AtkWindow::deactivate is emitted when a window is
101
       * no longer the active window of the application or session.
102
       *
103
       * Since: 2.2
104
       */
105
161
      atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
106
      /**
107
       * AtkWindow::destroy:
108
       * @object: the object which received the signal
109
       *
110
       * The signal #AtkWindow::destroy is emitted when a window is
111
       * destroyed.
112
       *
113
       * Since: 2.2
114
       */
115
161
      atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
116
      /**
117
       * AtkWindow::maximize:
118
       * @object: the object which received the signal
119
       *
120
       * The signal #AtkWindow::maximize is emitted when a window
121
       * is maximized.
122
       *
123
       * Since: 2.2
124
       */
125
161
      atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
126
      /**
127
       * AtkWindow::minimize:
128
       * @object: the object which received the signal
129
       *
130
       * The signal #AtkWindow::minimize is emitted when a window
131
       * is minimized.
132
       *
133
       * Since: 2.2
134
       */
135
161
      atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
136
      /**
137
       * AtkWindow::move:
138
       * @object: the object which received the signal
139
       *
140
       * The signal #AtkWindow::move is emitted when a window
141
       * is moved.
142
       *
143
       * Since: 2.2
144
       */
145
161
      atk_window_signals[MOVE] = atk_window_add_signal ("move");
146
      /**
147
       * AtkWindow::resize:
148
       * @object: the object which received the signal
149
       *
150
       * The signal #AtkWindow::resize is emitted when a window
151
       * is resized.
152
       *
153
       * Since: 2.2
154
       */
155
161
      atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
156
      /**
157
       * AtkWindow::restore:
158
       * @object: the object which received the signal
159
       *
160
       * The signal #AtkWindow::restore is emitted when a window
161
       * is restored.
162
       *
163
       * Since: 2.2
164
       */
165
161
      atk_window_signals[RESTORE] = atk_window_add_signal ("restore");
166

            
167
161
      initialized = TRUE;
168
    }
169
161
}