From: Brian Cameron Date: Fri, 29 Jun 2001 14:06:36 +0000 (+0000) Subject: Added new atk document interface. X-Git-Tag: EA_1_0~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65e40b09f61bdf40cc873b161275b44218b0573f;p=platform%2Fupstream%2Fatk.git Added new atk document interface. --- diff --git a/ChangeLog b/ChangeLog index 08727dc..7e8aad4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ 2001-06-28 Brian Cameron + * atk/Makefile.am atk/atk.h atk/atkdocument.c atk/atkdocument.h + docs/atk-docs.sgml docs/atk-sections.txt docs/tmpl/atk-unused.sgml + docs/tmpl/atkobject.sgml + Added new atk document interface. + +2001-06-28 Brian Cameron * atk/atkcomponent.c atk/atkcomponent.h atk/atkimage.c atk/atkimage.h atk/atktext.c atk/atktext.h atk/atkutil.h Updated so that functions that take screen coords as diff --git a/atk/Makefile.am b/atk/Makefile.am index 3d5daca..ddd3ce1 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -4,6 +4,7 @@ lib_LTLIBRARIES = libatk.la libatk_la_SOURCES = \ atkaction.c \ atkcomponent.c \ + atkdocument.c \ atkeditabletext.c \ atkhyperlink.c \ atkhypertext.c \ @@ -42,6 +43,7 @@ libatkinclude_HEADERS = \ atk.h \ atkaction.h \ atkcomponent.h \ + atkdocument.h \ atkeditabletext.h \ atkhyperlink.h \ atkhypertext.h \ diff --git a/atk/atk.h b/atk/atk.h index 15b9c83..d3b22c2 100755 --- a/atk/atk.h +++ b/atk/atk.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/atk/atkdocument.c b/atk/atkdocument.c new file mode 100755 index 0000000..ae90ff0 --- /dev/null +++ b/atk/atkdocument.c @@ -0,0 +1,99 @@ +/* ATK - Accessibility Toolkit + * Copyright 2001 Sun Microsystems Inc. + * + * 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 "atkdocument.h" + +GType +atk_document_get_type () +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = + { + sizeof (AtkDocumentIface), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + + }; + + type = g_type_register_static (G_TYPE_INTERFACE, "AtkDocument", &tinfo, 0); + } + + return type; +} + +/** + * atk_document_get_document_type: + * @document: a #GObject instance that implements AtkDocumentIface + * + * Gets a string indicating the document type. + * + * Returns: a string indicating the document type + **/ +G_CONST_RETURN gchar* +atk_document_get_document_type (AtkDocument *document) +{ + AtkDocumentIface *iface; + + g_return_val_if_fail (document != NULL, NULL); + g_return_val_if_fail (ATK_IS_DOCUMENT (document), NULL); + + iface = ATK_DOCUMENT_GET_IFACE (document); + + if (iface->get_document_type) + { + return (iface->get_document_type) (document); + } + else + { + return NULL; + } +} + +/** + * atk_document_get_document: + * @document: a #GObject instance that implements AtkDocumentIface + * + * Gets a %gpointer that points to an instance of the DOM. It is + * up to the caller to check atk_document_get_type to determine + * how to cast this pointer. + * + * Returns: a %gpointer that points to an instance of the DOM. + **/ +gpointer +atk_document_get_document (AtkDocument *document) +{ + AtkDocumentIface *iface; + + g_return_val_if_fail (document != NULL, NULL); + g_return_val_if_fail (ATK_IS_DOCUMENT (document), NULL); + + iface = ATK_DOCUMENT_GET_IFACE (document); + + if (iface->get_document) + { + return (iface->get_document) (document); + } + else + { + return NULL; + } +} + diff --git a/atk/atkdocument.h b/atk/atkdocument.h new file mode 100755 index 0000000..6813237 --- /dev/null +++ b/atk/atkdocument.h @@ -0,0 +1,62 @@ +/* ATK - Accessibility Toolkit + * Copyright 2001 Sun Microsystems Inc. + * + * 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. + */ + +#ifndef __ATK_DOCUMENT_H__ +#define __ATK_DOCUMENT_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * The AtkDocument interface should be supported by any object that has an + * associated document object model (DOM). This interface provides the + * standard mechanism allowing an assistive technology access to the DOM. + */ + +#define ATK_TYPE_DOCUMENT (atk_document_get_type ()) +#define ATK_IS_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_DOCUMENT) +#define ATK_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_DOCUMENT, AtkDocument) +#define ATK_DOCUMENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_DOCUMENT, AtkDocumentIface)) + +#ifndef _TYPEDEF_ATK_DOCUMENT_ +#define _TYPEDEF_ATK_DOCUMENT_ +typedef struct _AtkDocument AtkDocument; +#endif +typedef struct _AtkDocumentIface AtkDocumentIface; + +struct _AtkDocumentIface +{ + GTypeInterface parent; + G_CONST_RETURN gchar* ( *get_document_type) (AtkDocument *document); + gpointer ( *get_document) (AtkDocument *document); +}; + +GType atk_document_get_type (void); + +G_CONST_RETURN gchar* atk_document_get_document_type (AtkDocument *document); +gpointer atk_document_get_document (AtkDocument *document); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* __ATK_DOCUMENT_H__ */ diff --git a/docs/atk-docs.sgml b/docs/atk-docs.sgml index cf44911..07773dc 100644 --- a/docs/atk-docs.sgml +++ b/docs/atk-docs.sgml @@ -1,6 +1,7 @@ + @@ -31,6 +32,7 @@ ATK Library &atk-AtkAction; &atk-AtkComponent; + &atk-AtkDocument; &atk-AtkEditabletext; &atk-AtkHyperlink; &atk-AtkHypertext; diff --git a/docs/atk-sections.txt b/docs/atk-sections.txt index 4ce21e4..5901d18 100644 --- a/docs/atk-sections.txt +++ b/docs/atk-sections.txt @@ -41,6 +41,21 @@ atk_component_get_type
+atkdocument +AtkDocument +AtkDocument +AtkDocumentIface +atk_document_get_document_type +atk_document_get_document + +ATK_DOCUMENT +ATK_IS_DOCUMENT +ATK_TYPE_DOCUMENT +ATK_DOCUMENT_GET_IFACE +atk_document_get_type +
+ +
atkeditabletext AtkEditableText AtkEditableText @@ -130,7 +145,6 @@ atk_role_register AtkImplementor AtkImplementorIface AtkRelationSet -AtkStateSet AtkPropertyValues AtkPropertyChangeHandler atk_implementor_ref_accessible @@ -154,14 +168,15 @@ ATK_OBJECT ATK_IS_OBJECT ATK_TYPE_OBJECT ATK_IMPLEMENTOR_GET_IFACE -atk_object_get_type ATK_OBJECT_CLASS ATK_IS_OBJECT_CLASS ATK_OBJECT_GET_CLASS ATK_TYPE_IMPLEMENTOR ATK_IS_IMPLEMENTOR ATK_IMPLEMENTOR +AtkStateSet atk_implementor_get_type +atk_object_get_type
diff --git a/docs/tmpl/atk-unused.sgml b/docs/tmpl/atk-unused.sgml index 5a00683..5f40b42 100644 --- a/docs/tmpl/atk-unused.sgml +++ b/docs/tmpl/atk-unused.sgml @@ -38,6 +38,13 @@ atk @ATK_IMAGE_STOCK: @ATK_IMAGE_ICON_SET: + + + + + +@parent: + diff --git a/docs/tmpl/atkobject.sgml b/docs/tmpl/atkobject.sgml index 20271c8..9b1cb09 100644 --- a/docs/tmpl/atkobject.sgml +++ b/docs/tmpl/atkobject.sgml @@ -124,13 +124,6 @@ of the other ATK interfaces: @parent: @relations: - - - - - -@parent: -