[Tomoe-cvs 1140] CVS update: tomoe/lib

Back to archive index

Kouhei Sutou kous****@users*****
2006年 11月 27日 (月) 15:54:25 JST


Index: tomoe/lib/tomoe-char.c
diff -u tomoe/lib/tomoe-char.c:1.49 tomoe/lib/tomoe-char.c:1.50
--- tomoe/lib/tomoe-char.c:1.49	Mon Nov 27 15:46:41 2006
+++ tomoe/lib/tomoe-char.c	Mon Nov 27 15:54:25 2006
@@ -18,7 +18,7 @@
  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  *  Boston, MA  02111-1307  USA
  *
- *  $Id: tomoe-char.c,v 1.49 2006/11/27 06:46:41 kous Exp $
+ *  $Id: tomoe-char.c,v 1.50 2006/11/27 06:54:25 kous Exp $
  */
 
 #include <stdlib.h>
@@ -35,6 +35,7 @@
 struct _TomoeCharPrivate
 {
     gchar                *char_code;
+    gint                  n_strokes;
     TomoeWriting         *writing;
     GList                *readings;
     GHashTable           *meta;
@@ -76,6 +77,7 @@
 {
     TomoeCharPrivate *priv = TOMOE_CHAR_GET_PRIVATE (chr);
     priv->char_code  = NULL;
+    priv->n_strokes  = 0;
     priv->writing    = NULL;
     priv->meta       = g_hash_table_new_full(g_str_hash, g_str_equal,
                                              g_free, g_free);
@@ -172,6 +174,28 @@
     priv->char_code = code ? g_strdup (code) : NULL;
 }
 
+gint
+tomoe_char_get_n_strokes (TomoeChar *chr)
+{
+    TomoeCharPrivate *priv;
+
+    g_return_val_if_fail (TOMOE_IS_CHAR (chr), 0);
+
+    priv = TOMOE_CHAR_GET_PRIVATE (chr);
+    return priv->n_strokes;
+}
+
+void
+tomoe_char_set_n_strokes (TomoeChar *chr, gint n_strokes)
+{
+    TomoeCharPrivate *priv;
+
+    g_return_if_fail (TOMOE_IS_CHAR (chr));
+
+    priv = TOMOE_CHAR_GET_PRIVATE (chr);
+    priv->n_strokes = n_strokes;
+}
+
 const GList *
 tomoe_char_get_readings (TomoeChar* chr)
 {
Index: tomoe/lib/tomoe-char.h
diff -u tomoe/lib/tomoe-char.h:1.45 tomoe/lib/tomoe-char.h:1.46
--- tomoe/lib/tomoe-char.h:1.45	Mon Nov 27 15:46:41 2006
+++ tomoe/lib/tomoe-char.h	Mon Nov 27 15:54:25 2006
@@ -18,7 +18,7 @@
  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  *  Boston, MA  02111-1307  USA
  *
- *  $Id: tomoe-char.h,v 1.45 2006/11/27 06:46:41 kous Exp $
+ *  $Id: tomoe-char.h,v 1.46 2006/11/27 06:54:25 kous Exp $
  */
 
 /** @file tomoe-char.h
@@ -66,6 +66,9 @@
 const char     *tomoe_char_get_code             (TomoeChar     *chr);
 void            tomoe_char_set_code             (TomoeChar     *chr,
                                                  const char    *code);
+gint            tomoe_char_get_n_strokes        (TomoeChar     *chr);
+void            tomoe_char_set_n_strokes        (TomoeChar     *chr,
+                                                 gint           n_strokes);
 const GList    *tomoe_char_get_readings         (TomoeChar     *chr);
 void            tomoe_char_add_reading          (TomoeChar     *chr,
                                                  TomoeReading  *reading);
Index: tomoe/lib/tomoe-dict.c
diff -u tomoe/lib/tomoe-dict.c:1.100 tomoe/lib/tomoe-dict.c:1.101
--- tomoe/lib/tomoe-dict.c:1.100	Mon Nov 27 15:50:55 2006
+++ tomoe/lib/tomoe-dict.c	Mon Nov 27 15:54:25 2006
@@ -21,7 +21,7 @@
  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  *  Boston, MA  02111-1307  USA
  *
- *  $Id: tomoe-dict.c,v 1.100 2006/11/27 06:50:55 makeinu Exp $
+ *  $Id: tomoe-dict.c,v 1.101 2006/11/27 06:54:25 kous Exp $
  */
 
 #include <stdio.h>
@@ -718,10 +718,7 @@
     }
     case STATE_N_STROKES:
     {
-        gint n_strokes = atoi (text);
-#if 0
-        tomoe_char_set_number_of_strokes (n_strokes);
-#endif
+        tomoe_char_set_n_strokes (data->chr, atoi (text));
         return;
     }
     case STATE_READING:


tomoe-cvs メーリングリストの案内
Back to archive index