Add Meson build system
[platform/upstream/atk.git] / atk / atkimage.c
old mode 100755 (executable)
new mode 100644 (file)
index 1abf5b8..3a00886
  * Boston, MA 02111-1307, USA.
  */
 
+#include "config.h"
+
 #include "atkimage.h"
 
+/**
+ * SECTION:atkimage
+ * @Short_description: The ATK Interface implemented by components
+ *  which expose image or pixmap content on-screen.
+ * @Title:AtkImage
+ *
+ * #AtkImage should be implemented by #AtkObject subtypes on behalf of
+ * components which display image/pixmap information onscreen, and
+ * which provide information (other than just widget borders, etc.)
+ * via that image content.  For instance, icons, buttons with icons,
+ * toolbar elements, and image viewing panes typically should
+ * implement #AtkImage.
+ *
+ * #AtkImage primarily provides two types of information: coordinate
+ * information (useful for screen review mode of screenreaders, and
+ * for use by onscreen magnifiers), and descriptive information.  The
+ * descriptive information is provided for alternative, text-only
+ * presentation of the most significant information present in the
+ * image.
+ */
+
 GType
-atk_image_get_type ()
+atk_image_get_type (void)
 {
   static GType type = 0;
 
@@ -46,7 +69,7 @@ atk_image_get_type ()
  *
  * Returns: a string representing the image description
  **/
-G_CONST_RETURN gchar*
+const gchar*
 atk_image_get_image_description (AtkImage *image)
 {
   AtkImageIface *iface;
@@ -68,12 +91,12 @@ atk_image_get_image_description (AtkImage *image)
 /**
  * atk_image_get_image_size:
  * @image: a #GObject instance that implements AtkImageIface
- * @width: filled with the image width
- * @height: filled with the image height
+ * @width: (out) (optional): filled with the image width, or -1 if the value cannot be obtained.
+ * @height: (out) (optional): filled with the image height, or -1 if the value cannot be obtained.
  *
  * Get the width and height in pixels for the specified image.
  * The values of @width and @height are returned as -1 if the
- * values cannot be obtained.
+ * values cannot be obtained (for instance, if the object is not onscreen).
  **/
 void
 atk_image_get_image_size (AtkImage *image, 
@@ -103,8 +126,8 @@ atk_image_get_image_size (AtkImage *image,
   }
   else
   {
-    *width = -1;
-    *height = -1;
+    *real_width = -1;
+    *real_height = -1;
   }
 }
 
@@ -141,14 +164,13 @@ atk_image_set_image_description (AtkImage        *image,
 /**
  * atk_image_get_image_position:
  * @image: a #GObject instance that implements AtkImageIface
- * @x: address of #gint to put x coordinate position
- * @y: address of #gint to put y coordinate position
+ * @x: (out) (optional): address of #gint to put x coordinate position; otherwise, -1 if value cannot be obtained.
+ * @y: (out) (optional): address of #gint to put y coordinate position; otherwise, -1 if value cannot be obtained.
  * @coord_type: specifies whether the coordinates are relative to the screen
  * or to the components top level window
  * 
  * Gets the position of the image in the form of a point specifying the
- * images top-left corner.  The values of @x and @y are returned as -1
- * if the values cannot be obtained.
+ * images top-left corner.
  **/
 void     
 atk_image_get_image_position (AtkImage *image,
@@ -170,10 +192,6 @@ atk_image_get_image_position (AtkImage *image,
     real_y = y;
   else
     real_y = &local_y;
-  
-  iface = ATK_IMAGE_GET_IFACE (image);
-
-  g_return_if_fail (ATK_IS_IMAGE (image));
 
   iface = ATK_IMAGE_GET_IFACE (image);
 
@@ -183,7 +201,38 @@ atk_image_get_image_position (AtkImage *image,
   }
   else
   {
-    *x = -1;
-    *y = -1;
+    *real_x = -1;
+    *real_y = -1;
   }
 }
+
+/**
+ * atk_image_get_image_locale: 
+ * @image: An #AtkImage
+ *
+ * Since: 1.12
+ *
+ * Returns: (nullable): a string corresponding to the POSIX
+ * LC_MESSAGES locale used by the image description, or %NULL if the
+ * image does not specify a locale.
+ *
+ */
+const gchar*
+atk_image_get_image_locale (AtkImage   *image)
+{
+       
+  AtkImageIface *iface;
+
+  g_return_val_if_fail (ATK_IS_IMAGE (image), NULL);
+
+  iface = ATK_IMAGE_GET_IFACE (image);
+
+  if (iface->get_image_locale)
+    {
+      return (iface->get_image_locale) (image);
+    }
+  else
+    {
+      return NULL;
+    }
+}