Add new function atk_text_get_default_attributes Rename
authorPadraig O'Briain <padraigo@src.gnome.org>
Wed, 10 Oct 2001 11:49:47 +0000 (11:49 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Wed, 10 Oct 2001 11:49:47 +0000 (11:49 +0000)
* atk/atktext.[c|h]:
* docs/atk-sections.txt, docs/tmpl/atktext.sgml:
Add new function atk_text_get_default_attributes
Rename atk_text_ref_run_attributes to atk_text_get_run_attributes

ChangeLog
atk/atktext.c
atk/atktext.h
docs/atk-sections.txt
docs/tmpl/atktext.sgml

index fdaf905..3328e46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
+2001-10-10  Padraig O'Briain  <padraig.obriain@sun.com>
+
+       * atk/atktext.[c|h]:
+        * docs/atk-sections.txt, docs/tmpl/atktext.sgml:
+       Add new function atk_text_get_default_attributes
+       Rename atk_text_ref_run_attributes to atk_text_get_run_attributes
+
 2001-10-09  Padraig O'Briain  <padraig.obriain@sun.com>
 
        * atk/atktext.c (atk_attribute_set_free):
        Avoid leaking of AtkAttributeSet data structure; speed up code.
 
+       * docs/tmpl.atk*.sgml
+       Updated to reflect current APIs.
+
 2001-10-01  jacob berkman  <jacob@ximian.com>
 
        * docs/Makefile.am (dist-hook-local): depend on all-local so that
index f54501f..a43d532 100755 (executable)
@@ -376,7 +376,7 @@ atk_text_get_character_extents (AtkText *text,
 }
 
 /**
- *atk_text_ref_run_attributes:
+ *atk_text_get_run_attributes:
  *@text: an #AtkText
  *@offset: the offset at which to get the attributes
  *@start_offset: the address to put the start offset of the range
@@ -390,12 +390,14 @@ atk_text_get_character_extents (AtkText *text,
  *attributes that do not have corresponding macros may also be returned.
  *
  *Returns: an #AtkAttributeSet which contains the attributes explicitly set
- *at @offset
+ *at @offset. This #AtkAttributeSet should be freed by a call to
+ *atk_attribute_set_free().
  **/
-AtkAttributeSet* atk_text_ref_run_attributes              (AtkText          *text,
-                                                           gint             offset,
-                                                           gint             *start_offset,
-                                                           gint             *end_offset)
+AtkAttributeSet* 
+atk_text_get_run_attributes (AtkText          *text,
+                             gint             offset,
+                             gint             *start_offset,
+                             gint             *end_offset)
 {
   AtkTextIface *iface;
   gint local_start_offset, local_end_offset;
@@ -414,8 +416,35 @@ AtkAttributeSet* atk_text_ref_run_attributes              (AtkText          *tex
 
   iface = ATK_TEXT_GET_IFACE (text);
 
-  if (iface->ref_run_attributes)
-    return (*(iface->ref_run_attributes)) (text, offset, real_start_offset, real_end_offset);
+  if (iface->get_run_attributes)
+    return (*(iface->get_run_attributes)) (text, offset, real_start_offset, real_end_offset);
+  else
+    return NULL;
+}
+
+/**
+ *atk_text_get_default_attributes:
+ *@text: an #AtkText
+ *
+ *Creates an #AtkAttributeSet which consists of the default values of
+ *attributes for the text. See the ATK_ATTRIBUTE macros, such as 
+ *#ATK_ATTRIBUTE_LEFT_MARGIN for types of text attributes that can be 
+ *returned. Note that other attributes that do not have corresponding macros 
+ *may also be returned.
+ *
+ *Returns: an #AtkAttributeSet which contains the default values of attributes.
+ *at @offset. This #AtkAttributeSet should be freed by a call to
+ *atk_attribute_set_free().
+ */
+AtkAttributeSet* 
+atk_text_get_default_attributes (AtkText          *text)
+{
+  AtkTextIface *iface;
+
+  g_return_val_if_fail (ATK_IS_TEXT (text), NULL);
+
+  if (iface->get_default_attributes)
+    return (*(iface->get_default_attributes)) (text);
   else
     return NULL;
 }
index ca3ddab..8ce97a3 100755 (executable)
@@ -33,7 +33,8 @@ extern "C" {
  * AtkAttributeSet:
  *
  * This is a singly-linked list (a #GSList) of #AtkAttribute. It is
- * used by atk_text_ref_run_attributes() and atk_editable_text_set_run_attributes()
+ * used by atk_text_get_run_attributes(), atk_text_get_default_attributes()
+ * and atk_editable_text_set_run_attributes()
  **/
 typedef GSList AtkAttributeSet;
 
@@ -325,10 +326,11 @@ struct _AtkTextIface
                                                   gint             *start_offset,
                                                   gint             *end_offset);
   gint           (* get_caret_offset)             (AtkText          *text);
-  AtkAttributeSet* (* ref_run_attributes)         (AtkText         *text,
+  AtkAttributeSet* (* get_run_attributes)         (AtkText         *text,
                                                   gint             offset,
                                                   gint             *start_offset,
                                                   gint             *end_offset);
+  AtkAttributeSet* (* get_default_attributes)     (AtkText         *text);
   void           (* get_character_extents)        (AtkText          *text,
                                                    gint             offset,
                                                    gint             *x,
@@ -404,10 +406,11 @@ void          atk_text_get_character_extents              (AtkText          *tex
                                                            gint             *width,
                                                            gint             *height,
                                                            AtkCoordType            coords);
-AtkAttributeSet* atk_text_ref_run_attributes              (AtkText         *text,
+AtkAttributeSet* atk_text_get_run_attributes              (AtkText         *text,
                                                           gint             offset,
                                                           gint             *start_offset,
                                                           gint             *end_offset);
+AtkAttributeSet* atk_text_get_default_attributes          (AtkText         *text);
 gint          atk_text_get_character_count                (AtkText          *text);
 gint          atk_text_get_offset_at_point                (AtkText          *text,
                                                            gint             x,
index 232dfc6..1697908 100644 (file)
@@ -350,7 +350,8 @@ atk_text_get_text_at_offset
 atk_text_get_text_before_offset
 atk_text_get_caret_offset
 atk_text_get_character_extents
-atk_text_ref_run_attributes
+atk_text_get_run_attributes
+atk_text_get_default_attributes
 atk_text_get_character_count
 atk_text_get_offset_at_point
 atk_text_get_n_selections
index 8b23ecc..61f3c4b 100644 (file)
@@ -32,7 +32,8 @@ AtkText
 @get_character_at_offset: 
 @get_text_before_offset: 
 @get_caret_offset: 
-@ref_run_attributes: 
+@get_run_attributes: 
+@get_default_attributes: 
 @get_character_extents: 
 @get_character_count: 
 @get_offset_at_point: 
@@ -166,7 +167,7 @@ AtkText
 @length: 
 
 
-<!-- ##### FUNCTION atk_text_ref_run_attributes ##### -->
+<!-- ##### FUNCTION atk_text_get_run_attributes ##### -->
 <para>
 
 </para>
@@ -178,6 +179,15 @@ AtkText
 @Returns: 
 
 
+<!-- ##### FUNCTION atk_text_get_default_attributes ##### -->
+<para>
+
+</para>
+
+@text: 
+@Returns: 
+
+
 <!-- ##### FUNCTION atk_text_get_character_count ##### -->
 <para>