[atk] BGO#638924: Add AtkWindow



commit 6101fd44db4aa9d37aa3de7526d6d04047593d9a
Author: Mike Gorse <mgorse novell com>
Date:   Tue Aug 16 11:47:28 2011 -0500

    BGO#638924: Add AtkWindow

 atk/Makefile.am |    6 +++-
 atk/atk.h       |    1 +
 atk/atkwindow.c |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 atk/atkwindow.h |   54 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 132 insertions(+), 2 deletions(-)
---
diff --git a/atk/Makefile.am b/atk/Makefile.am
index 8f8edc7..9e12256 100644
--- a/atk/Makefile.am
+++ b/atk/Makefile.am
@@ -57,7 +57,8 @@ atk_sources = 	\
 	atktext.c		\
 	atkutil.c		\
 	atkmisc.c		\
-	atkvalue.c
+	atkvalue.c \
+	atkwindow.c
 
 libatk_1_0_la_SOURCES = 	\
 	$(atk_sources)		\
@@ -94,7 +95,8 @@ atk_headers = \
         atktext.h		\
         atkutil.h		\
         atkmisc.h		\
-        atkvalue.h
+        atkvalue.h \
+        atkwindow.h
 
 libatkinclude_HEADERS =		\
 	$(atk_headers)		\
diff --git a/atk/atk.h b/atk/atk.h
index 4047f99..d51aa52 100755
--- a/atk/atk.h
+++ b/atk/atk.h
@@ -50,6 +50,7 @@
 #include <atk/atkutil.h>
 #include <atk/atkmisc.h>
 #include <atk/atkvalue.h>
+#include <atk/atkwindow.h>
 
 #undef __ATK_H_INSIDE__
 
diff --git a/atk/atkwindow.c b/atk/atkwindow.c
new file mode 100644
index 0000000..60f2e8c
--- /dev/null
+++ b/atk/atkwindow.c
@@ -0,0 +1,73 @@
+/* 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 "atkwindow.h"
+#include "atkmarshal.h"
+
+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)
+    {
+      atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
+      atk_window_signals[CREATE] = atk_window_add_signal ("create");
+      atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
+      atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
+      atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
+      atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
+      atk_window_signals[MOVE] = atk_window_add_signal ("move");
+      atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
+      atk_window_signals[RESTORE] = atk_window_add_signal ("restore");
+
+      initialized = TRUE;
+    }
+}
diff --git a/atk/atkwindow.h b/atk/atkwindow.h
new file mode 100644
index 0000000..7d14913
--- /dev/null
+++ b/atk/atkwindow.h
@@ -0,0 +1,54 @@
+/* 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 Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
+#ifndef __ATK_WINDOW_H__
+#define __ATK_WINDOW_H__
+
+#include <atk/atkobject.h>
+
+G_BEGIN_DECLS
+
+/*
+ * AtkWindow describes signals pertaining to on-screen windows.
+ */
+
+
+#define ATK_TYPE_WINDOW                    (atk_window_get_type ())
+#define ATK_IS_WINDOW(obj)                 G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_WINDOW)
+#define ATK_WINDOW(obj)                    G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_WINDOW, AtkWindow)
+#define ATK_WINDOW_GET_IFACE(obj)          (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_WINDOW, AtkWindowIface))
+
+typedef struct _AtkWindow AtkWindow; /* Dummy typedef */
+typedef struct _AtkWindowIface AtkWindowIface;
+
+struct _AtkWindowIface
+{
+  GTypeInterface parent;
+
+  gpointer       _padding_dummy[16];
+};
+
+GType atk_window_get_type (void);
+G_END_DECLS
+
+#endif /* __ATK_WINDOW_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]