summaryrefslogtreecommitdiff
path: root/atk/atkwindow.c
blob: 8e7ad8ac5769776b09e139bf0fba525623b220f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/* ATK -  Accessibility Toolkit
 * Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include "config.h"

#include "atkwindow.h"
#include "atkmarshal.h"

/**
 * SECTION:atkwindow
 * @Short_description: The ATK Interface provided by UI components that represent a top-level window.
 * @Title: AtkWindow
 * @See_also: #AtkObject
 *
 * #AtkWindow should be implemented by the UI elements that represent
 * a top-level window, such as the main window of an application or
 * dialog.
 *
 */

enum {
  ACTIVATE,
  CREATE,
  DEACTIVATE,
  DESTROY,
  MAXIMIZE,
  MINIMIZE,
  MOVE,
  RESIZE,
  RESTORE,
  LAST_SIGNAL
};

static guint atk_window_signals[LAST_SIGNAL] = { 0 };

static guint
atk_window_add_signal (const gchar *name)
{
  return g_signal_new (name,
		       ATK_TYPE_WINDOW,
		       G_SIGNAL_RUN_LAST,
		       0,
		       (GSignalAccumulator) NULL, NULL,
		       g_cclosure_marshal_VOID__VOID,
		       G_TYPE_NONE,
		       0);
}

typedef AtkWindowIface AtkWindowInterface;
G_DEFINE_INTERFACE (AtkWindow, atk_window, ATK_TYPE_OBJECT)

static void
atk_window_default_init (AtkWindowIface *iface)
{
  static gboolean initialized = FALSE;

  if (!initialized)
    {
      /**
       * AtkWindow::activate:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::activate is emitted when a window
       * becomes the active window of the application or session.
       *
       * Since: 2.2
       */
      atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
      /**
       * AtkWindow::create:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::create is emitted when a new window
       * is created.
       *
       * Since: 2.2
       */
      atk_window_signals[CREATE] = atk_window_add_signal ("create");
      /**
       * AtkWindow::deactivate:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::deactivate is emitted when a window is
       * no longer the active window of the application or session.
       *
       * Since: 2.2
       */
      atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
      /**
       * AtkWindow::destroy:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::destroy is emitted when a window is
       * destroyed.
       *
       * Since: 2.2
       */
      atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
      /**
       * AtkWindow::maximize:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::maximize is emitted when a window
       * is maximized.
       *
       * Since: 2.2
       */
      atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
      /**
       * AtkWindow::minimize:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::minimize is emitted when a window
       * is minimized.
       *
       * Since: 2.2
       */
      atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
      /**
       * AtkWindow::move:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::move is emitted when a window
       * is moved.
       *
       * Since: 2.2
       */
      atk_window_signals[MOVE] = atk_window_add_signal ("move");
      /**
       * AtkWindow::resize:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::resize is emitted when a window
       * is resized.
       *
       * Since: 2.2
       */
      atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
      /**
       * AtkWindow::restore:
       * @object: the object which received the signal
       *
       * The signal #AtkWindow::restore is emitted when a window
       * is restored.
       *
       * Since: 2.2
       */
      atk_window_signals[RESTORE] = atk_window_add_signal ("restore");

      initialized = TRUE;
    }
}