Code style enforcement.
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / hypertext-adaptor.c
index a1c2298..082dde3 100644 (file)
 #include <atk/atk.h>
 #include <droute/droute.h>
 
-#include "spi-common/spi-dbus.h"
+#include "common/spi-dbus.h"
+#include "accessible-marshaller.h"
 
 static DBusMessage *
-impl_getNLinks (DBusConnection * bus, DBusMessage * message, void *user_data)
+impl_GetNLinks (DBusConnection * bus, DBusMessage * message, void *user_data)
 {
   AtkHypertext *hypertext = (AtkHypertext *) user_data;
   gint rv;
@@ -41,13 +42,13 @@ impl_getNLinks (DBusConnection * bus, DBusMessage * message, void *user_data)
   if (reply)
     {
       dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv,
-                               DBUS_TYPE_INVALID);
+                                DBUS_TYPE_INVALID);
     }
   return reply;
 }
 
 static DBusMessage *
-impl_getLink (DBusConnection * bus, DBusMessage * message, void *user_data)
+impl_GetLink (DBusConnection * bus, DBusMessage * message, void *user_data)
 {
   AtkHypertext *hypertext = (AtkHypertext *) user_data;
   DBusError error;
@@ -60,15 +61,16 @@ impl_getLink (DBusConnection * bus, DBusMessage * message, void *user_data)
   if (!dbus_message_get_args
       (message, &error, DBUS_TYPE_INT32, &linkIndex, DBUS_TYPE_INVALID))
     {
-      return SPI_DBUS_RETURN_ERROR (message, &error);
+      return droute_invalid_arguments_error (message);
     }
   link = atk_hypertext_get_link (hypertext, linkIndex);
-  return spi_dbus_return_object (message, ATK_OBJECT (link), FALSE);
+  return spi_dbus_return_hyperlink (message, link, ATK_OBJECT (hypertext),
+                                    TRUE);
 }
 
 static DBusMessage *
-impl_getLinkIndex (DBusConnection * bus, DBusMessage * message,
-                  void *user_data)
+impl_GetLinkIndex (DBusConnection * bus, DBusMessage * message,
+                   void *user_data)
 {
   AtkHypertext *hypertext = (AtkHypertext *) user_data;
   DBusError error;
@@ -82,30 +84,28 @@ impl_getLinkIndex (DBusConnection * bus, DBusMessage * message,
   if (!dbus_message_get_args
       (message, &error, DBUS_TYPE_INT32, &characterIndex, DBUS_TYPE_INVALID))
     {
-      return SPI_DBUS_RETURN_ERROR (message, &error);
+      return droute_invalid_arguments_error (message);
     }
   rv = atk_hypertext_get_link_index (hypertext, characterIndex);
   reply = dbus_message_new_method_return (message);
   if (reply)
     {
       dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv,
-                               DBUS_TYPE_INVALID);
+                                DBUS_TYPE_INVALID);
     }
   return reply;
 }
 
 static DRouteMethod methods[] = {
-  {impl_getNLinks, "getNLinks"},
-  {impl_getLink, "getLink"},
-  {impl_getLinkIndex, "getLinkIndex"},
+  {impl_GetNLinks, "GetNLinks"},
+  {impl_GetLink, "GetLink"},
+  {impl_GetLinkIndex, "GetLinkIndex"},
   {NULL, NULL}
 };
 
 void
-spi_initialize_hypertext (DRoutePath *path)
+spi_initialize_hypertext (DRoutePath * path)
 {
   droute_path_add_interface (path,
-                             SPI_DBUS_INTERFACE_HYPERTEXT,
-                             methods,
-                             NULL);
+                             SPI_DBUS_INTERFACE_HYPERTEXT, methods, NULL);
 };