[Tomoe-cvs 970] CVS update: libtomoe-gtk/src

Back to archive index

Takuro Ashie makei****@users*****
2006年 11月 24日 (金) 13:55:05 JST


Index: libtomoe-gtk/src/tomoe-canvas.c
diff -u libtomoe-gtk/src/tomoe-canvas.c:1.27 libtomoe-gtk/src/tomoe-canvas.c:1.28
--- libtomoe-gtk/src/tomoe-canvas.c:1.27	Thu Nov 23 20:32:23 2006
+++ libtomoe-gtk/src/tomoe-canvas.c	Fri Nov 24 13:55:05 2006
@@ -86,8 +86,8 @@
 static void   tomoe_canvas_draw_line            (TomoeCanvas       *canvas,
                                                  TomoePoint        *point1,
                                                  TomoePoint        *point2,
-                                                 gboolean           draw,
-                                                 GdkColor          *color);
+                                                 GdkGC             *line_gc,
+                                                 gboolean           draw);
 static void   tomoe_canvas_draw_background      (TomoeCanvas       *canvas,
                                                  gboolean           draw);
 static void   tomoe_canvas_draw_axis            (TomoeCanvas       *canvas);
@@ -109,8 +109,7 @@
                                                  guint              index);
 static void   draw_annotate                     (GList             *points,
                                                  TomoeCanvas       *canvas,
-                                                 guint              index,
-                                                 GdkColor          *color);
+                                                 guint              index);
 
 static GList*               instance_list = NULL;
 static guint                canvas_signals[LAST_SIGNAL] = { 0 };
@@ -382,7 +381,6 @@
     TomoeCanvas *canvas = TOMOE_CANVAS (widget);
     TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas);
     gboolean retval = FALSE;
-    GdkColor color = { 0, 0x8000, 0x0000, 0x0000};
 
     if (priv->locked) return retval;
 
@@ -390,7 +388,7 @@
         return retval;
 
     tomoe_writing_line_to (priv->writing, (gint) event->x, (gint) event->y);
-    /* draw_annotate (points, canvas, tomoe_writing_get_number_of_strokes (priv->writing) + 1, &color); */
+    /* draw_annotate (points, canvas, tomoe_writing_get_number_of_strokes (priv->writing) + 1); */
 
     g_signal_emit (G_OBJECT (widget), canvas_signals[STROKE_ADDED_SIGNAL], 0);
 
@@ -480,7 +478,6 @@
     TomoeWriting *writing;
     TomoeQuery *query;
     guint i;
-    GdkColor color = { 0, 0x8000, 0x0000, 0x0000};
 
     g_return_if_fail (TOMOE_IS_CANVAS (canvas));
 
@@ -500,9 +497,11 @@
         for (point = points; point; point = g_list_next (point)) {
             TomoePoint *p = (TomoePoint *) point->data;
             if (pp) {
-                tomoe_canvas_draw_line (canvas, pp, p, TRUE, &color);
+                tomoe_canvas_draw_line (canvas, pp, p,
+                                        priv->adjust_line_gc,
+                                        TRUE);
             } else {
-                draw_annotate (points, canvas, i, &color);
+                draw_annotate (points, canvas, i);
             }
             pp = p;
         }
@@ -960,28 +959,30 @@
 {
     TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas);
     GList *last;
-    GdkColor color = { 0, 0x0000, 0x0000, 0x0000};
 
     tomoe_writing_move_to (priv->writing, x, y);
 
     _init_gc (canvas);
-    /* tomoe_canvas_draw_line (canvas, pp, p, &color); */
+    /* tomoe_canvas_draw_line (canvas, pp, p); */
 }
 #endif
 
 static void
 tomoe_canvas_draw_line (TomoeCanvas *canvas,
                         TomoePoint *p1, TomoePoint *p2,
-                        gboolean draw, GdkColor *color)
+                        GdkGC *line_gc,
+                        gboolean draw)
 {
     TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas);
     GtkWidget *widget = GTK_WIDGET (canvas);
     gint x, y, width, height;
     gdouble factor = 1.0 / ((gdouble)TOMOE_WRITING_DEFAULT_SIZE / (gdouble)priv->size);
 
-    gdk_draw_line (priv->pixmap, priv->handwrite_line_gc,
+    gdk_draw_line (priv->pixmap,
+                   //priv->handwrite_line_gc,
+                   line_gc,
                    p1->x * factor, p1->y * factor,
-		   p2->x * factor, p2->y * factor);
+                   p2->x * factor, p2->y * factor);
     if (draw) {
         x = (MIN (p1->x, p2->x) - 2) * factor;
         y = (MIN (p1->y, p2->y) - 2) * factor;
@@ -1146,6 +1147,7 @@
 static void
 draw_stroke (GList *points, TomoeCanvas *canvas, guint index)
 {
+    TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas);
     GList *node;
     GdkColor color = { 0, 0x8000, 0x0000, 0x0000 };
 
@@ -1160,13 +1162,15 @@
         p1 = (TomoePoint *) node->data;
         p2 = (TomoePoint *) next->data;
 
-        tomoe_canvas_draw_line (canvas, p1, p2, FALSE, &color);
+        tomoe_canvas_draw_line (canvas, p1, p2,
+                                priv->handwrite_line_gc,
+                                FALSE);
     }
-    draw_annotate (points, canvas, index, &color);
+    draw_annotate (points, canvas, index);
 }
 
 static void
-draw_annotate (GList *points, TomoeCanvas *canvas, guint index, GdkColor *color)
+draw_annotate (GList *points, TomoeCanvas *canvas, guint index)
 {
     TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas);
     GtkWidget *widget = GTK_WIDGET (canvas);


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