Kouhei Sutou
kous****@users*****
2006年 11月 28日 (火) 14:13:43 JST
Index: tomoe/lib/tomoe-query.c diff -u tomoe/lib/tomoe-query.c:1.3 tomoe/lib/tomoe-query.c:1.4 --- tomoe/lib/tomoe-query.c:1.3 Tue Nov 28 13:10:01 2006 +++ tomoe/lib/tomoe-query.c Tue Nov 28 14:13:43 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-query.c,v 1.3 2006/11/28 04:10:01 kous Exp $ + * $Id: tomoe-query.c,v 1.4 2006/11/28 05:13:43 kous Exp $ */ #include <stdlib.h> @@ -35,23 +35,25 @@ typedef struct _TomoeQueryPrivate TomoeQueryPrivate; struct _TomoeQueryPrivate { - GList *readings; - GList *radicals; - GList *variants; + gchar *utf8; gint min_n_strokes; gint max_n_strokes; + GList *readings; + GList *radicals; TomoeWriting *writing; + TomoeChar *variant; }; enum { PROP_0, - PROP_READINGS, - PROP_RADICALS, - PROP_VARIANTS, + PROP_UTF8, PROP_MIN_N_STROKES, PROP_MAX_N_STROKES, - PROP_WRITING + PROP_READINGS, + PROP_RADICALS, + PROP_WRITING, + PROP_VARIANTS }; G_DEFINE_TYPE (TomoeQuery, tomoe_query, G_TYPE_OBJECT) @@ -85,12 +87,13 @@ { TomoeQueryPrivate *priv = TOMOE_QUERY_GET_PRIVATE (query); - priv->readings = NULL; - priv->radicals = NULL; - priv->variants = NULL; + priv->utf8 = NULL; priv->min_n_strokes = -1; priv->max_n_strokes = -1; - priv->writing = NULL; + priv->readings = NULL; + priv->radicals = NULL; + priv->writing = NULL; + priv->variant = NULL; } TomoeQuery * @@ -104,6 +107,8 @@ { TomoeQueryPrivate *priv = TOMOE_QUERY_GET_PRIVATE (object); + if (priv->utf8) + g_free (priv->utf8); if (priv->readings) { g_list_foreach (priv->readings, (GFunc)g_object_unref, NULL); g_list_free (priv->readings); @@ -112,20 +117,18 @@ g_list_foreach (priv->radicals, (GFunc)g_object_unref, NULL); g_list_free (priv->radicals); } - if (priv->variants) { - g_list_foreach (priv->variants, (GFunc)g_object_unref, NULL); - g_list_free (priv->variants); - } - + if (priv->variant) + g_object_unref (priv->variant); if (priv->writing) g_object_unref (priv->writing); - priv->readings = NULL; - priv->radicals = NULL; - priv->variants = NULL; + priv->utf8 = NULL; priv->min_n_strokes = -1; priv->max_n_strokes = -1; - priv->writing = NULL; + priv->readings = NULL; + priv->radicals = NULL; + priv->writing = NULL; + priv->variant = NULL; G_OBJECT_CLASS (tomoe_query_parent_class)->dispose (object); } Index: tomoe/lib/tomoe-query.h diff -u tomoe/lib/tomoe-query.h:1.3 tomoe/lib/tomoe-query.h:1.4 --- tomoe/lib/tomoe-query.h:1.3 Tue Nov 28 13:10:01 2006 +++ tomoe/lib/tomoe-query.h Tue Nov 28 14:13:43 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-query.h,v 1.3 2006/11/28 04:10:01 kous Exp $ + * $Id: tomoe-query.h,v 1.4 2006/11/28 05:13:43 kous Exp $ */ /** @@ -67,16 +67,23 @@ void tomoe_query_add_reading (TomoeQuery *query, TomoeReading *reading); const GList *tomoe_query_get_readings (TomoeQuery *query); + void tomoe_query_add_radical (TomoeQuery *query, TomoeChar *chr); -void tomoe_query_add_variant (TomoeQuery *query, +const GList *tomoe_query_get_radicals (TomoeQuery *query); + +void tomoe_query_set_variant (TomoeQuery *query, TomoeChar *chr); +TomoeChar *tomoe_query_get_variant (TomoeQuery *query); + void tomoe_query_set_min_n_strokes (TomoeQuery *query, gint n_strokes); gint tomoe_query_get_min_n_strokes (TomoeQuery *query); + void tomoe_query_set_max_n_strokes (TomoeQuery *query, gint n_strokes); gint tomoe_query_get_max_n_strokes (TomoeQuery *query); + void tomoe_query_set_writing (TomoeQuery *query, TomoeWriting *writing); TomoeWriting *tomoe_query_get_writing (TomoeQuery *query);