From f295431c9a451c8fa3f32b6bccf2f48aadb774fc Mon Sep 17 00:00:00 2001 From: Bill Haneman Date: Sat, 29 Sep 2001 18:52:37 +0000 Subject: [PATCH] Added method for getting an AtkRelationType from a string. Rev'ed package as a result. --- ChangeLog | 12 ++++++++++++ atk/atkrelation.c | 16 ++++++++++++++++ atk/atkrelation.h | 2 ++ atk/atkutil.c | 2 ++ configure.in | 2 +- 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 33d2359..0f01afe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Sat Sep 29 19:45:00 2001 Bill Haneman + + * configure.in (ATK_MICRO_VERSION): Version 0.6 + (because libglade will depend on a the small api addition below) + + * atk/makefile.msc (PKG_VER): Version 0.6 + + * atk/atkrelation.h: + * atk/atkrelation.c: (AtkRelationType + atk_relation_type_from_string (const gchar *name)): Added method. + + Tue Sep 25 12:08:52 2001 Owen Taylor * configure.in (ATK_MICRO_VERSION): Version 0.5 diff --git a/atk/atkrelation.c b/atk/atkrelation.c index e248190..0511efb 100755 --- a/atk/atkrelation.c +++ b/atk/atkrelation.c @@ -72,6 +72,22 @@ atk_relation_type_register (const gchar *name) return (++type); } +AtkRelationType +atk_relation_type_from_string (const gchar *name) +{ + /* + * TODO: implement properly, + * checking type namelist in conjunction with above function. + */ + if ( !strcmp (name, "controlled_by") ) return ATK_RELATION_CONTROLLED_BY; + else if (!strcmp (name, "controller_for")) return ATK_RELATION_CONTROLLER_FOR; + else if (!strcmp (name, "label_for")) return ATK_RELATION_LABEL_FOR; + else if (!strcmp (name, "labelled_by")) return ATK_RELATION_LABELLED_BY; + else if (!strcmp (name, "member_of")) return ATK_RELATION_MEMBER_OF; + else return ATK_RELATION_NULL; +} + + /** * atk_relation_new: * @targets: an array of pointers to #AtkObjects diff --git a/atk/atkrelation.h b/atk/atkrelation.h index 0d7f473..eb4cebe 100755 --- a/atk/atkrelation.h +++ b/atk/atkrelation.h @@ -76,6 +76,8 @@ GType atk_relation_get_type (void); AtkRelationType atk_relation_type_register (const gchar *name); +AtkRelationType atk_relation_type_from_string (const gchar *name); + /* * Create a new relation for the specified key and the specified list * of targets. diff --git a/atk/atkutil.c b/atk/atkutil.c index c1d01a8..d02a3c6 100755 --- a/atk/atkutil.c +++ b/atk/atkutil.c @@ -20,6 +20,7 @@ #include "atkutil.h" #include "atkmarshal.c" + static void atk_util_class_init (AtkUtilClass *klass); GType @@ -290,3 +291,4 @@ atk_get_toolkit_version(void) return NULL; } } + diff --git a/configure.in b/configure.in index c70fd1e..743170a 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl ========================================================================== ATK_MAJOR_VERSION=0 ATK_MINOR_VERSION=0 -ATK_MICRO_VERSION=5 +ATK_MICRO_VERSION=6 ATK_INTERFACE_AGE=0 ATK_BINARY_AGE=0 ## with 1.0 you'd insert MINOR_VERSION in here, i.e. 0.3->1.0.0->1.0.1->1.0.2 -- 2.7.4