From e215f4330239bfe0d9bf87dfe968ced9eca79089 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 20 Nov 2001 00:47:32 +0000 Subject: [PATCH] 2001-11-20 Michael Meeks * libspi/*.[ch]: fixup headers, includes and over commenting. * libspi/image.c (impl__get_imageDescription): const correctness warning fix. remove redundant casting. * libspi/table.c (impl_getRowDescription): ditto. (impl_getColumnDescription): ditto. * libspi/libspi.h: add. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@98 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 12 ++++++++++ libspi/Makefile.am | 37 ++++++++++++++--------------- libspi/accessible.c | 30 +++--------------------- libspi/action.c | 19 +++------------ libspi/application.c | 18 +++------------ libspi/component.c | 29 +++++------------------ libspi/desktop.c | 29 +++++------------------ libspi/editabletext.c | 23 ++++-------------- libspi/hyperlink.c | 27 ++++------------------ libspi/hypertext.c | 43 ++++++++++++++-------------------- libspi/hypertext.h | 7 ++---- libspi/image.c | 35 +++++++++------------------- libspi/libspi.h | 46 ++++++++++++++++++++++++++++++++++++ libspi/relation.c | 23 ++++-------------- libspi/selection.c | 25 ++++---------------- libspi/table.c | 54 ++++++++++++++++++------------------------- registryd/desktop.c | 29 +++++------------------ 17 files changed, 175 insertions(+), 311 deletions(-) create mode 100644 libspi/libspi.h diff --git a/ChangeLog b/ChangeLog index 94f6857a..23d1daca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-11-20 Michael Meeks + + * libspi/*.[ch]: fixup headers, includes and over commenting. + + * libspi/image.c (impl__get_imageDescription): const + correctness warning fix. remove redundant casting. + + * libspi/table.c (impl_getRowDescription): ditto. + (impl_getColumnDescription): ditto. + + * libspi/libspi.h: add. + 2001-11-19 Michael Meeks * libspi/editabletext.c (impl_setAttributes): fix warnings. diff --git a/libspi/Makefile.am b/libspi/Makefile.am index dd029370..5bf3880f 100644 --- a/libspi/Makefile.am +++ b/libspi/Makefile.am @@ -14,27 +14,28 @@ CFLAGS += $(DEBUG_CFLAGS) libspiincludedir = $(includedir)/at-spi-1.0/libspi -libspiinclude_HEADERS = accessible.h \ - action.h\ - application.h \ - component.h\ - desktop.h \ +libspiinclude_HEADERS = Accessibility.h \ + accessible.h \ + accessibleeventlistener.h \ + action.h \ + application.h \ + component.h \ + desktop.h \ + deviceeventcontroller.h \ editabletext.h\ hyperlink.h\ hypertext.h\ - image.h\ - relation.h\ - selection.h\ - table.h\ - text.h\ - value.h\ - listener.h \ - keystrokelistener.h \ - accessibleeventlistener.h \ - deviceeventcontroller.h \ - registry.h \ - keymasks.h \ - Accessibility.h + image.h \ + keystrokelistener.h \ + keymasks.h \ + libspi.h \ + listener.h \ + registry.h \ + relation.h \ + selection.h \ + table.h \ + text.h \ + value.h IDL_OUT = Accessibility.h Accessibility-stubs.c Accessibility-skels.c Accessibility-common.c diff --git a/libspi/accessible.c b/libspi/accessible.c index 5b70f7bf..f0e6002d 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -20,35 +20,11 @@ * Boston, MA 02111-1307, USA. */ -/* - * accessible.c: test for accessibility implementation - * - */ -#include -#include +/* accessible.c: the core of the accessibility implementation */ +#include #include - -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition for the BonoboObject (Gtk Type) - */ -#include "accessible.h" -#include "component.h" -#include "editabletext.h" -#include "hyperlink.h" -#include "hypertext.h" -#include "image.h" -#include "selection.h" -#include "table.h" -#include "text.h" -#include "value.h" -#include "action.h" -#include "relation.h" +#include /* * Our parent Gtk object type diff --git a/libspi/action.c b/libspi/action.c index 7024a7a5..13b1ec7e 100644 --- a/libspi/action.c +++ b/libspi/action.c @@ -20,24 +20,11 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* component.c : bonobo wrapper for accessible component implementation */ +#include #include - -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the SpiAction bonobo object - */ -#include "action.h" +#include /* * Static function declarations diff --git a/libspi/application.c b/libspi/application.c index 8149eabb..bca3dea6 100644 --- a/libspi/application.c +++ b/libspi/application.c @@ -20,24 +20,12 @@ * Boston, MA 02111-1307, USA. */ -/* - * application.c: implements SpiApplication.idl - * - */ +/* application.c: implements SpiApplication.idl */ + #include #include -#include #include - -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition for the BonoboObject (GObject Type) - */ -#include "application.h" +#include /* * Our parent Gtk object type diff --git a/libspi/component.c b/libspi/component.c index 521e6d91..5a5a687f 100644 --- a/libspi/component.c +++ b/libspi/component.c @@ -20,34 +20,17 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* component.c : implements the Component interface */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition for the BonoboObject (Gtk Type) - */ -#include "component.h" -#include "accessible.h" - -/* - * Our parent Gtk object type - */ +/* Our parent Gtk object type */ #define PARENT_TYPE BONOBO_OBJECT_TYPE -/* - * A pointer to our parent object class - */ +/* A pointer to our parent object class */ static GObjectClass *spi_component_parent_class; /* diff --git a/libspi/desktop.c b/libspi/desktop.c index 84c9b218..241fbc13 100644 --- a/libspi/desktop.c +++ b/libspi/desktop.c @@ -20,34 +20,17 @@ * Boston, MA 02111-1307, USA. */ -/* - * desktop.c: implements SpiDesktop.idl - * - */ - -/* #include */ -#include +/* desktop.c: implements SpiDesktop.idl */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition for the BonoboObject (Gtk Type) - */ -#include "desktop.h" - -/* - * Our parent Gtk object type - */ +/* Our parent Gtk object type */ #define PARENT_TYPE SPI_ACCESSIBLE_TYPE -/* - * A pointer to our parent object class - */ +/* A pointer to our parent object class */ static SpiAccessibleClass *parent_class; static void diff --git a/libspi/editabletext.c b/libspi/editabletext.c index 93dcb250..a9867c86 100644 --- a/libspi/editabletext.c +++ b/libspi/editabletext.c @@ -20,28 +20,13 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* editabletext.c : implements the EditableText interface */ +#include #include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the SpiEditableText bonobo object - */ -#include "editabletext.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_editable_text_class_init (SpiEditableTextClass *klass); diff --git a/libspi/hyperlink.c b/libspi/hyperlink.c index 13086ea7..aa4c9620 100644 --- a/libspi/hyperlink.c +++ b/libspi/hyperlink.c @@ -20,29 +20,14 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* hyperlink.c : implements the Hyperlink interface */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the hyperlink bonobo object - */ -#include "hyperlink.h" -#include "accessible.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_hyperlink_class_init (SpiHyperlinkClass *klass); @@ -195,5 +180,3 @@ impl_isValid (PortableServer_Servant _servant, SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant)); return (CORBA_boolean) atk_hyperlink_is_valid (ATK_HYPERLINK(link->hyperlink)); } - - diff --git a/libspi/hypertext.c b/libspi/hypertext.c index 7c750b49..42bc9001 100644 --- a/libspi/hypertext.c +++ b/libspi/hypertext.c @@ -20,28 +20,14 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* hypertext.c : implements the HyperText interface */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the hypertext bonobo object - */ -#include "hypertext.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_hypertext_class_init (SpiHypertextClass *klass); @@ -173,17 +159,22 @@ impl_getNLinks (PortableServer_Servant _servant, static Accessibility_Hyperlink -impl_getLink (PortableServer_Servant _servant, - const CORBA_long linkIndex, - CORBA_Environment * ev) +impl_getLink (PortableServer_Servant servant, + const CORBA_long linkIndex, + CORBA_Environment *ev) { AtkHyperlink *link; - SpiHypertext *hypertext = SPI_HYPERTEXT(bonobo_object_from_servant(_servant)); + SpiHypertext *hypertext; Accessibility_Hyperlink rv; - link = atk_hypertext_get_link (ATK_HYPERTEXT(hypertext->atko), - (gint) linkIndex); - rv = bonobo_object_corba_objref (BONOBO_OBJECT(spi_hyperlink_new(ATK_OBJECT(link)))); + hypertext = SPI_HYPERTEXT (bonobo_object_from_servant (servant)); + + link = atk_hypertext_get_link ( + ATK_HYPERTEXT (hypertext->atko), linkIndex); + + rv = bonobo_object_corba_objref (BONOBO_OBJECT ( + spi_hyperlink_new (ATK_OBJECT (link)))); + return rv; } diff --git a/libspi/hypertext.h b/libspi/hypertext.h index e4a1ec5a..6c00d44c 100644 --- a/libspi/hypertext.h +++ b/libspi/hypertext.h @@ -48,11 +48,8 @@ struct _HypertextClass { POA_Accessibility_Hypertext__epv epv; }; -GType -spi_hypertext_get_type (void); - -SpiHypertext * -spi_hypertext_interface_new (AtkObject *obj); +GType spi_hypertext_get_type (void); +SpiHypertext *spi_hypertext_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/image.c b/libspi/image.c index 794f1e7e..b9578495 100644 --- a/libspi/image.c +++ b/libspi/image.c @@ -20,28 +20,13 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* image.c : implements the Image interface */ +#include #include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the image bonobo object - */ -#include "image.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_image_class_init (SpiImageClass *klass); @@ -171,13 +156,15 @@ impl_getImageSize (PortableServer_Servant _servant, static CORBA_string -impl__get_imageDescription (PortableServer_Servant _servant, - CORBA_Environment * ev) +impl__get_imageDescription (PortableServer_Servant servant, + CORBA_Environment *ev) { - SpiImage *image = SPI_IMAGE (bonobo_object_from_servant(_servant)); - CORBA_char *rv; + SpiImage *image; + const char *rv; + + image = SPI_IMAGE (bonobo_object_from_servant (servant)); - rv = atk_image_get_image_description (ATK_IMAGE(image->atko)); + rv = atk_image_get_image_description (ATK_IMAGE (image->atko)); if (rv) return CORBA_string_dup (rv); else diff --git a/libspi/libspi.h b/libspi/libspi.h new file mode 100644 index 00000000..5b5ea710 --- /dev/null +++ b/libspi/libspi.h @@ -0,0 +1,46 @@ +/* ATK - Accessibility Toolkit + * Copyright 2001 Ximian, 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. + * + * libspi.h: the main include header for libspi. + */ +#ifndef LIBSPI_H_ +#define LIBSPI_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* LIBSPI_H_ */ diff --git a/libspi/relation.c b/libspi/relation.c index d3877efb..1ddb74f2 100644 --- a/libspi/relation.c +++ b/libspi/relation.c @@ -20,28 +20,13 @@ * Boston, MA 02111-1307, USA. */ -/* - * relation.c : bonobo wrapper for accessible relation implementation - * - */ -#include -#include +/* relation.c : implements the Relation interface */ +#include #include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the relation bonobo object - */ -#include "relation.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_relation_class_init (SpiRelationClass *klass); diff --git a/libspi/selection.c b/libspi/selection.c index 9ab0b0e5..aa0ff470 100644 --- a/libspi/selection.c +++ b/libspi/selection.c @@ -20,29 +20,14 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* selection.c : implements the Selection interface */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include -#include "accessible.h" - -/* - * This pulls the definition of the selection bonobo object - */ -#include "selection.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_selection_class_init (SpiSelectionClass *klass); diff --git a/libspi/table.c b/libspi/table.c index 08fc3bc1..42646977 100644 --- a/libspi/table.c +++ b/libspi/table.c @@ -20,28 +20,14 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* table.c : implements the Table interface */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the SpiTable bonobo object - */ -#include "table.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void spi_table_class_init (SpiTableClass *klass); @@ -333,14 +319,17 @@ impl_getColumnAtIndex (PortableServer_Servant _servant, static CORBA_string -impl_getRowDescription (PortableServer_Servant _servant, - const CORBA_long row, - CORBA_Environment * ev) +impl_getRowDescription (PortableServer_Servant servant, + const CORBA_long row, + CORBA_Environment *ev) { - SpiTable *table = SPI_TABLE (bonobo_object_from_servant (_servant)); - CORBA_char *rv; + const char *rv; + SpiTable *table; + + table = SPI_TABLE (bonobo_object_from_servant (servant)); - rv = atk_table_get_row_description (ATK_TABLE(table->atko), (gint) row); + rv = atk_table_get_row_description (ATK_TABLE (table->atko), row); + if (rv) return CORBA_string_dup (rv); else @@ -350,14 +339,17 @@ impl_getRowDescription (PortableServer_Servant _servant, static CORBA_string -impl_getColumnDescription (PortableServer_Servant _servant, - const CORBA_long column, - CORBA_Environment * ev) +impl_getColumnDescription (PortableServer_Servant servant, + const CORBA_long column, + CORBA_Environment *ev) { - SpiTable *table = SPI_TABLE (bonobo_object_from_servant (_servant)); - CORBA_char *rv; + const char *rv; + SpiTable *table; + + table = SPI_TABLE (bonobo_object_from_servant (servant)); + + rv = atk_table_get_row_description (ATK_TABLE (table->atko), column); - rv = atk_table_get_column_description (ATK_TABLE(table->atko), (gint) column); if (rv) return CORBA_string_dup (rv); else diff --git a/registryd/desktop.c b/registryd/desktop.c index 84c9b218..241fbc13 100644 --- a/registryd/desktop.c +++ b/registryd/desktop.c @@ -20,34 +20,17 @@ * Boston, MA 02111-1307, USA. */ -/* - * desktop.c: implements SpiDesktop.idl - * - */ - -/* #include */ -#include +/* desktop.c: implements SpiDesktop.idl */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition for the BonoboObject (Gtk Type) - */ -#include "desktop.h" - -/* - * Our parent Gtk object type - */ +/* Our parent Gtk object type */ #define PARENT_TYPE SPI_ACCESSIBLE_TYPE -/* - * A pointer to our parent object class - */ +/* A pointer to our parent object class */ static SpiAccessibleClass *parent_class; static void -- 2.34.1