Hiroyuki Ikezoe
ikezo****@users*****
2006年 11月 22日 (水) 15:38:15 JST
Index: libtomoe-gtk/src/tomoe-canvas.c diff -u libtomoe-gtk/src/tomoe-canvas.c:1.12 libtomoe-gtk/src/tomoe-canvas.c:1.13 --- libtomoe-gtk/src/tomoe-canvas.c:1.12 Wed Nov 22 15:11:21 2006 +++ libtomoe-gtk/src/tomoe-canvas.c Wed Nov 22 15:38:15 2006 @@ -52,8 +52,8 @@ gint auto_find_time; guint auto_find_id; TomoeContext *context; - TomoeGlyph *preview; - TomoeGlyph *glyph; + TomoeWriting *preview; + TomoeWriting *writing; gboolean locked; }; @@ -228,7 +228,7 @@ priv->auto_find_time = 0; priv->auto_find_id = 0; priv->preview = NULL; - priv->glyph = tomoe_glyph_new (); + priv->writing = tomoe_writing_new (); priv->locked = FALSE; gtk_widget_get_size_request(GTK_WIDGET (canvas), &width, &height); @@ -304,9 +304,9 @@ priv->candidates = NULL; } - if (priv->glyph) { - g_object_unref (priv->glyph); - priv->glyph = NULL; + if (priv->writing) { + g_object_unref (priv->writing); + priv->writing = NULL; } if (priv->auto_find_id) { @@ -414,8 +414,8 @@ if (event->button != 1) return retval; #if 0 - tomoe_glyph_line_to (priv->glyph); - draw_annotate (canvas, tomoe_glyph_get_number_of_strokes (priv->glyph) + 1, &color); + tomoe_writing_line_to (priv->writing); + draw_annotate (canvas, tomoe_writing_get_number_of_strokes (priv->writing) + 1, &color); #endif g_signal_emit (G_OBJECT (widget), canvas_signals[STROKE_ADDED_SIGNAL], 0); @@ -454,32 +454,32 @@ } if (state & GDK_BUTTON1_MASK && priv->pixmap) { - tomoe_glyph_line_to (priv->glyph, x, y); + tomoe_writing_line_to (priv->writing, x, y); /* tomoe_canvas_append_point (canvas, x, y); */ } return retval; } -static TomoeGlyph * -create_sparse_glyph (TomoeCanvas *canvas) +static TomoeWriting * +create_sparse_writing (TomoeCanvas *canvas) { - TomoeGlyph *g; + TomoeWriting *g; TomoeCanvasPriv *priv; const GList *strokes, *list; g_return_val_if_fail (TOMOE_IS_CANVAS (canvas), NULL); priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - g = tomoe_glyph_new (); + g = tomoe_writing_new (); - strokes = tomoe_glyph_get_strokes (priv->glyph); + strokes = tomoe_writing_get_strokes (priv->writing); for (list = strokes; list; list = g_list_next (list)) { GList *points = (GList *) list->data; GList *point, *new_points; TomoePoint *start_point = (TomoePoint *) points->data; - tomoe_glyph_move_to (g, start_point->x, start_point->y); + tomoe_writing_move_to (g, start_point->x, start_point->y); new_points = g_list_prepend (get_vertex(points, g_list_last(points)), points->data); @@ -489,7 +489,7 @@ gint x, y; x = p->x * ((gdouble)TOMOE_CANVAS_DEFAULT_SIZE / priv->size); y = p->y * ((gdouble)TOMOE_CANVAS_DEFAULT_SIZE / priv->size); - tomoe_glyph_line_to (g, x, y); + tomoe_writing_line_to (g, x, y); } } @@ -502,7 +502,7 @@ TomoeCanvasPriv *priv; GtkWidget *widget = GTK_WIDGET (canvas); const GList *strokes, *list; - TomoeGlyph *g; + TomoeWriting *g; GdkColor color = { 0, 0x8000, 0x0000, 0x0000}; g_return_if_fail (TOMOE_IS_CANVAS (canvas)); @@ -510,11 +510,11 @@ _init_gc (canvas); priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - /* create a new glyph which has more sparse points */ - g = create_sparse_glyph (canvas); + /* create a new writing which has more sparse points */ + g = create_sparse_writing (canvas); /* draw thin red lines and annotations for sparse points */ - strokes = tomoe_glyph_get_strokes (g); + strokes = tomoe_writing_get_strokes (g); for (list = strokes; list; list = g_list_next (list)) { GList *points = (GList *) list->data; GList *point; @@ -568,23 +568,23 @@ tomoe_canvas_refresh (canvas); } -TomoeGlyph * -tomoe_canvas_get_glyph (TomoeCanvas *canvas) +TomoeWriting * +tomoe_canvas_get_writing (TomoeCanvas *canvas) { TomoeCanvasPriv *priv; - TomoeGlyph *g; + TomoeWriting *g; g_return_val_if_fail (TOMOE_IS_CANVAS (canvas), NULL); priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - g = create_sparse_glyph (canvas); + g = create_sparse_writing (canvas); return g; } void -tomoe_canvas_set_glyph (TomoeCanvas *canvas, TomoeGlyph *glyph) +tomoe_canvas_set_writing (TomoeCanvas *canvas, TomoeWriting *writing) { TomoeCanvasPriv *priv; @@ -592,17 +592,17 @@ priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - if (priv->glyph) - g_object_unref (priv->glyph); - priv->glyph = glyph; + if (priv->writing) + g_object_unref (priv->writing); + priv->writing = writing; } void -tomoe_canvas_set_preview_glyph (TomoeCanvas *canvas, TomoeGlyph *glyph) +tomoe_canvas_set_preview_writing (TomoeCanvas *canvas, TomoeWriting *writing) { TomoeCanvasPriv *priv; priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - priv->preview = glyph; + priv->preview = writing; if (GTK_WIDGET (canvas)->window) tomoe_canvas_refresh (canvas); @@ -645,14 +645,14 @@ { TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas); const GList *strokes, *list; - TomoeGlyph *g = priv->glyph; + TomoeWriting *g = priv->writing; rect->x = G_MAXINT; rect->y = G_MAXINT; rect->width = 0; rect->height = 0; - strokes = tomoe_glyph_get_strokes (g); + strokes = tomoe_writing_get_strokes (g); for (list= strokes; list; list = g_list_next (list)) { GList *points = (GList *) list->data; GList *point; @@ -662,13 +662,13 @@ } } -static TomoeGlyph * -_tomoe_glyph_new_scale_glyph (TomoeGlyph *glyph, gdouble sx, gdouble sy) +static TomoeWriting * +_tomoe_writing_new_scale_writing (TomoeWriting *writing, gdouble sx, gdouble sy) { const GList *strokes, *list; - TomoeGlyph *new = tomoe_glyph_new (); + TomoeWriting *new = tomoe_writing_new (); - strokes = tomoe_glyph_get_strokes (glyph); + strokes = tomoe_writing_get_strokes (writing); for (list= strokes; list; list = g_list_next (list)) { GList *points = (GList *) list->data; GList *point; @@ -676,9 +676,9 @@ for ( point = points; point; point = g_list_next (point)) { TomoePoint *cp = (TomoePoint *) point->data; if (first) - tomoe_glyph_line_to (new, cp->x * sx, cp->y * sy); + tomoe_writing_line_to (new, cp->x * sx, cp->y * sy); else - tomoe_glyph_move_to (new, cp->x * sx, cp->y * sy); + tomoe_writing_move_to (new, cp->x * sx, cp->y * sy); first = FALSE; } } @@ -689,20 +689,20 @@ tomoe_canvas_resize (TomoeCanvas *canvas, gdouble x_rate, gdouble y_rate) { TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - TomoeGlyph *new_glyph; + TomoeWriting *new_writing; - new_glyph = _tomoe_glyph_new_scale_glyph (priv->glyph, x_rate, y_rate); + new_writing = _tomoe_writing_new_scale_writing (priv->writing, x_rate, y_rate); - tomoe_canvas_set_glyph (canvas, new_glyph); + tomoe_canvas_set_writing (canvas, new_writing); } -static TomoeGlyph * -_tomoe_glyph_new_move_glyph (TomoeGlyph *glyph, gint dx, gint dy) +static TomoeWriting * +_tomoe_writing_new_move_writing (TomoeWriting *writing, gint dx, gint dy) { const GList *strokes, *list; - TomoeGlyph *new = tomoe_glyph_new (); + TomoeWriting *new = tomoe_writing_new (); - strokes = tomoe_glyph_get_strokes (glyph); + strokes = tomoe_writing_get_strokes (writing); for (list= strokes; list; list = g_list_next (list)) { GList *points = (GList *) list->data; GList *point; @@ -710,9 +710,9 @@ for ( point = points; point; point = g_list_next (point)) { TomoePoint *cp = (TomoePoint *) point->data; if (first) - tomoe_glyph_line_to (new, cp->x + dx, cp->y + dy); + tomoe_writing_line_to (new, cp->x + dx, cp->y + dy); else - tomoe_glyph_move_to (new, cp->x + dx, cp->y + dy); + tomoe_writing_move_to (new, cp->x + dx, cp->y + dy); first = FALSE; } } @@ -723,11 +723,11 @@ tomoe_canvas_move_position (TomoeCanvas *canvas, gint dx, gint dy) { TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas); - TomoeGlyph *new_glyph; + TomoeWriting *new_writing; - new_glyph = _tomoe_glyph_new_move_glyph (priv->glyph, dx, dy); + new_writing = _tomoe_writing_new_move_writing (priv->writing, dx, dy); - tomoe_canvas_set_glyph (canvas, new_glyph); + tomoe_canvas_set_writing (canvas, new_writing); } static void @@ -825,7 +825,7 @@ } #endif - strokes = tomoe_glyph_get_strokes (priv->glyph); + strokes = tomoe_writing_get_strokes (priv->writing); for (list = strokes, i = 1; list; list = g_list_next (list), i++) { GList *points = (GList *) list->data; draw_stroke (points, canvas, i); @@ -850,8 +850,8 @@ priv = TOMOE_CANVAS_GET_PRIVATE (canvas); /* remove last line */ - tomoe_glyph_remove_last_stroke (priv->glyph); - /* reverted = tomoe_glyph_remove_last_stroke (priv->glyph); */ + tomoe_writing_remove_last_stroke (priv->writing); + /* reverted = tomoe_writing_remove_last_stroke (priv->writing); */ if (reverted) { tomoe_canvas_refresh (canvas); @@ -885,7 +885,7 @@ g_return_val_if_fail (TOMOE_IS_CANVAS (canvas), FALSE); - return (tomoe_glyph_get_number_of_strokes (priv->glyph) > 0); + return (tomoe_writing_get_number_of_strokes (priv->writing) > 0); } void @@ -1005,7 +1005,7 @@ GList *last; GdkColor color = { 0, 0x0000, 0x0000, 0x0000}; - tomoe_glyph_move_to (priv->glyph, x, y); + tomoe_writing_move_to (priv->writing, x, y); _init_gc (canvas); /* tomoe_canvas_draw_line (canvas, pp, p, &color); */ Index: libtomoe-gtk/src/tomoe-canvas.h diff -u libtomoe-gtk/src/tomoe-canvas.h:1.5 libtomoe-gtk/src/tomoe-canvas.h:1.6 --- libtomoe-gtk/src/tomoe-canvas.h:1.5 Wed Nov 22 15:04:55 2006 +++ libtomoe-gtk/src/tomoe-canvas.h Wed Nov 22 15:38:15 2006 @@ -87,11 +87,11 @@ gint tomoe_canvas_get_auto_find_time (TomoeCanvas *canvas); void tomoe_canvas_set_context (TomoeCanvas *canvas, TomoeContext *context); -TomoeGlyph *tomoe_canvas_get_glyph (TomoeCanvas *canvas); -void tomoe_canvas_set_glyph (TomoeCanvas *canvas, - TomoeGlyph *glyph); -void tomoe_canvas_set_preview_glyph (TomoeCanvas *canvas, - TomoeGlyph *glyph); +TomoeWriting *tomoe_canvas_get_writing (TomoeCanvas *canvas); +void tomoe_canvas_set_writing (TomoeCanvas *canvas, + TomoeWriting *writing); +void tomoe_canvas_set_preview_writing(TomoeCanvas *canvas, + TomoeWriting *writing); void tomoe_canvas_lock (TomoeCanvas *canvas, gboolean lock); Index: libtomoe-gtk/src/tomoe-char-table.c diff -u libtomoe-gtk/src/tomoe-char-table.c:1.3 libtomoe-gtk/src/tomoe-char-table.c:1.4 --- libtomoe-gtk/src/tomoe-char-table.c:1.3 Tue Nov 21 19:53:52 2006 +++ libtomoe-gtk/src/tomoe-char-table.c Wed Nov 22 15:38:15 2006 @@ -307,7 +307,7 @@ (gpointer) on_canvas_find, (gpointer) view); g_object_remove_weak_pointer (G_OBJECT (canvas), - (gpointer*) &priv->canvas); + (gpointer *) &(priv->canvas)); } priv->canvas = canvas; @@ -315,7 +315,7 @@ if (canvas) { g_object_add_weak_pointer (G_OBJECT (canvas), - (gpointer*) &priv->canvas); + (gpointer *) &priv->canvas); g_signal_connect_after (G_OBJECT (canvas), "find", G_CALLBACK (on_canvas_find), (gpointer) view); Index: libtomoe-gtk/src/tomoe-details.c diff -u libtomoe-gtk/src/tomoe-details.c:1.14 libtomoe-gtk/src/tomoe-details.c:1.15 --- libtomoe-gtk/src/tomoe-details.c:1.14 Wed Nov 22 15:09:10 2006 +++ libtomoe-gtk/src/tomoe-details.c Wed Nov 22 15:38:15 2006 @@ -412,8 +412,8 @@ GtkTreeIter iter; gboolean editable = tomoe_dict_is_editable (d); - tomoe_canvas_set_preview_glyph (TOMOE_CANVAS (priv->canvas), - tomoe_char_get_glyph (c)); + tomoe_canvas_set_preview_writing (TOMOE_CANVAS (priv->canvas), + tomoe_char_get_writing (c)); gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (priv->basic_prop), &iter, NULL, CHARACTER_PROPERTY); @@ -421,9 +421,9 @@ PROPERTY_VALUE_COLUMN, tomoe_char_get_code (c), PROPERTY_EDITABLE_COLUMN, editable, -1); - if (tomoe_char_get_glyph (c)) { + if (tomoe_char_get_writing (c)) { chr = g_markup_printf_escaped - ("%d", tomoe_glyph_get_number_of_strokes (tomoe_char_get_glyph (c))); + ("%d", tomoe_writing_get_number_of_strokes (tomoe_char_get_writing (c))); gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (priv->basic_prop), &iter, NULL, STROKE_PROPERTY); gtk_list_store_set (priv->basic_prop, &iter, Index: libtomoe-gtk/src/tomoe-dictionary-page.c diff -u libtomoe-gtk/src/tomoe-dictionary-page.c:1.14 libtomoe-gtk/src/tomoe-dictionary-page.c:1.15 --- libtomoe-gtk/src/tomoe-dictionary-page.c:1.14 Wed Nov 22 15:09:10 2006 +++ libtomoe-gtk/src/tomoe-dictionary-page.c Wed Nov 22 15:38:15 2006 @@ -386,8 +386,8 @@ int j; GPtrArray *readings = tomoe_char_get_readings (chr); - if (tomoe_char_get_glyph (chr)) - strokes = tomoe_glyph_get_number_of_strokes (tomoe_char_get_glyph (chr)); + if (tomoe_char_get_writing (chr)) + strokes = tomoe_writing_get_number_of_strokes (tomoe_char_get_writing (chr)); if (strokes > 0) g_sprintf (strokes_text, "%d", strokes); Index: libtomoe-gtk/src/tomoe-edit-strokes.c diff -u libtomoe-gtk/src/tomoe-edit-strokes.c:1.7 libtomoe-gtk/src/tomoe-edit-strokes.c:1.8 --- libtomoe-gtk/src/tomoe-edit-strokes.c:1.7 Tue Nov 21 19:33:39 2006 +++ libtomoe-gtk/src/tomoe-edit-strokes.c Wed Nov 22 15:38:15 2006 @@ -254,13 +254,13 @@ { TomoeEditStrokes *dialog = TOMOE_EDIT_STROKES (user_data); TomoeEditStrokesPrivate *priv = TOMOE_EDIT_STROKES_GET_PRIVATE (dialog); - TomoeGlyph *glyph; + TomoeWriting *writing; g_return_if_fail (TOMOE_IS_EDIT_STROKES (dialog)); g_return_if_fail (TOMOE_IS_CANVAS (priv->canvas)); - glyph = tomoe_canvas_get_glyph (TOMOE_CANVAS (priv->canvas)); - tomoe_char_set_glyph (priv->character, glyph); + writing = tomoe_canvas_get_writing (TOMOE_CANVAS (priv->canvas)); + tomoe_char_set_writing (priv->character, writing); gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_DELETE_EVENT); } Index: libtomoe-gtk/src/tomoe-reading-search-page.c diff -u libtomoe-gtk/src/tomoe-reading-search-page.c:1.9 libtomoe-gtk/src/tomoe-reading-search-page.c:1.10 --- libtomoe-gtk/src/tomoe-reading-search-page.c:1.9 Wed Nov 22 15:09:10 2006 +++ libtomoe-gtk/src/tomoe-reading-search-page.c Wed Nov 22 15:38:15 2006 @@ -214,8 +214,8 @@ GtkTreeIter iter; GPtrArray *readings = tomoe_char_get_readings (chr); - if (tomoe_char_get_glyph (chr)) - strokes = tomoe_glyph_get_number_of_strokes (tomoe_char_get_glyph (chr)); + if (tomoe_char_get_writing (chr)) + strokes = tomoe_writing_get_number_of_strokes (tomoe_char_get_writing (chr)); if (strokes > 0) strokes_text = g_strdup_printf ("%d", strokes);