gbrainy r218 - trunk/src



Author: jmas
Date: Sun Feb 17 14:20:50 2008
New Revision: 218
URL: http://svn.gnome.org/viewvc/gbrainy?rev=218&view=rev

Log:
2008-02-17 Jordi Mas <jmas softcatala org>

	* CairoContextEx.cs: Groups all the context related primitives
	* DrawingHelpers.cs: Remove it



Added:
   trunk/src/CairoContextEx.cs
Removed:
   trunk/src/DrawingHelpers.cs
Modified:
   trunk/src/ChangeLog
   trunk/src/CustomGameDialog.cs
   trunk/src/Game.cs
   trunk/src/GameDrawingArea.cs
   trunk/src/Makefile.am
   trunk/src/MathArithmetical.cs
   trunk/src/MathGreaterDivisor.cs
   trunk/src/MathOperator.cs
   trunk/src/MathTwoNumbers.cs
   trunk/src/MathWhichNumber.cs
   trunk/src/Memory.cs
   trunk/src/MemoryColouredFigures.cs
   trunk/src/MemoryColouredText.cs
   trunk/src/MemoryCountDots.cs
   trunk/src/MemoryFigures.cs
   trunk/src/MemoryIndications.cs
   trunk/src/MemoryNumbers.cs
   trunk/src/MemoryWords.cs
   trunk/src/PuzzleAlphabeticSequence.cs
   trunk/src/PuzzleBalance.cs
   trunk/src/PuzzleBuildTriangle.cs
   trunk/src/PuzzleCirclesRectangle.cs
   trunk/src/PuzzleCoverPercentage.cs
   trunk/src/PuzzleCube.cs
   trunk/src/PuzzleDivideCircle.cs
   trunk/src/PuzzleFigureLetter.cs
   trunk/src/PuzzleFigurePattern.cs
   trunk/src/PuzzleFigures.cs
   trunk/src/PuzzleLines.cs
   trunk/src/PuzzleMatrixGroups.cs
   trunk/src/PuzzleMatrixNumbers.cs
   trunk/src/PuzzleMissingPiece.cs
   trunk/src/PuzzleMissingSlice.cs
   trunk/src/PuzzleMostInCommon.cs
   trunk/src/PuzzleMoveFigure.cs
   trunk/src/PuzzleNextFigure.cs
   trunk/src/PuzzleNumericRelation.cs
   trunk/src/PuzzleNumericSequence.cs
   trunk/src/PuzzleOstracism.cs
   trunk/src/PuzzlePairs.cs
   trunk/src/PuzzlePencil.cs
   trunk/src/PuzzlePeopleTable.cs
   trunk/src/PuzzleSquareDots.cs
   trunk/src/PuzzleSquareSheets.cs
   trunk/src/PuzzleSquares.cs
   trunk/src/PuzzleTetris.cs
   trunk/src/PuzzleTriangles.cs

Added: trunk/src/CairoContextEx.cs
==============================================================================
--- (empty file)
+++ trunk/src/CairoContextEx.cs	Sun Feb 17 14:20:50 2008
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2007-2008 Jordi Mas i HernÃndez <jmas softcatala org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+using System;
+using Cairo;
+using Mono.Unix;
+using System.Text;
+using System.Runtime.InteropServices;
+
+
+public class CairoContextEx : Cairo.Context
+{
+	public CairoContextEx (IntPtr state) : base (state)
+	{
+
+	}
+	
+	[DllImport("libgdk-x11-2.0.so")]
+	static extern IntPtr gdk_cairo_create(IntPtr drawable);
+	
+	public static CairoContextEx CreateFromGdk (Gdk.Drawable drawable) 
+	{
+		IntPtr raw_ret = gdk_cairo_create (drawable == null ? IntPtr.Zero : drawable.Handle);
+		return new CairoContextEx (raw_ret);
+	}
+	
+	public void DrawTextAlignedRight (double x, double y, string str)
+	{
+		TextExtents extents;	
+
+		extents = TextExtents (str);
+		MoveTo (x - extents.Width, y);
+		ShowText (str);
+		Stroke ();
+	}
+
+	// From a giving point centers the text into it
+	public void DrawTextCentered (double x, double y, string str)
+	{
+		TextExtents extents;
+		extents = TextExtents (str);
+		MoveTo (x -extents.Width / 2, y + extents.Height / 2);
+		ShowText (str);
+		Stroke ();
+	}
+
+	public double DrawStringWithWrapping (double x, double y, double line_space, string str)
+	{
+		TextExtents extents;
+		StringBuilder sb = new StringBuilder ();
+		int idx = 0, prev = 0;			
+
+		while (idx < str.Length) {
+			prev = idx;
+			idx = str.IndexOf (' ', prev + 1);
+			if (idx == -1)
+				idx = str.Length;
+
+			extents = TextExtents (sb.ToString () + str.Substring (prev, idx - prev));
+			if (extents.Width > 1.0 - x - 0.05) {
+				MoveTo (x, y);
+				ShowText (sb.ToString ());
+				Stroke ();
+				y += line_space;
+				sb = new StringBuilder ();
+				prev++;
+			} 
+
+			sb.Append (str.Substring (prev, idx - prev)); 
+
+			if (str.Length == idx) {
+				MoveTo (x, y);
+				ShowText (sb.ToString ());
+				Stroke ();					
+			}				
+		}
+
+		return y;
+	}
+
+	public void DrawEquilateralTriangle (double x, double y, double size)
+	{
+		MoveTo (x + (size / 2), y);
+		LineTo (x, y + size);
+		LineTo (x + size, y + size);
+		LineTo (x + (size / 2), y);
+		Stroke ();	
+	}
+
+	public void DrawDiamond (double x, double y, double size)
+	{
+		MoveTo (x + size / 2, y);
+		LineTo (x, y + size / 2);
+		LineTo (x + size / 2, y + size);
+		LineTo (x + size, y + size / 2);
+		LineTo (x + size / 2, y);
+		Stroke ();
+	}
+}
+

Modified: trunk/src/CustomGameDialog.cs
==============================================================================
--- trunk/src/CustomGameDialog.cs	(original)
+++ trunk/src/CustomGameDialog.cs	Sun Feb 17 14:20:50 2008
@@ -217,7 +217,7 @@
    
 			int w, h;
 			args.Window.GetSize (out w, out h);
-			Cairo.Context cr = Gdk.CairoHelper.Create (args.Window);
+			CairoContextEx cr = CairoContextEx.CreateFromGdk (args.Window);
 			puzzle.DrawPreview (cr, w, h);
 
    			((IDisposable)cr).Dispose();

Modified: trunk/src/Game.cs
==============================================================================
--- trunk/src/Game.cs	(original)
+++ trunk/src/Game.cs	Sun Feb 17 14:20:50 2008
@@ -207,10 +207,10 @@
 
 	
 	public abstract void Initialize ();
-	public abstract void Draw (Cairo.Context gr, int width, int height);
+	public abstract void Draw (CairoContextEx gr, int width, int height);
 	public virtual void Finish () {}
 
-	public virtual void DrawPreview (Cairo.Context gr, int width, int height)
+	public virtual void DrawPreview (CairoContextEx gr, int width, int height)
 	{
 		Draw (gr, width, height);
 	}
@@ -220,17 +220,17 @@
 		return (String.Compare (answer, right_answer, true) == 0);
 	}
 	
-	public void SetLargeFont (Cairo.Context gr)
+	public void SetLargeFont (CairoContextEx gr)
 	{
 		gr.SetFontSize (0.05);
 	}
 
-	public void SetNormalFont (Cairo.Context gr)
+	public void SetNormalFont (CairoContextEx gr)
 	{
 		gr.SetFontSize (0.03);
 	}
 
-	virtual public void PrepareGC (Cairo.Context gr)
+	virtual public void PrepareGC (CairoContextEx gr)
 	{
 		gr.LineWidth = LineWidth;
 		gr.Color = DefaultDrawingColor;
@@ -238,7 +238,7 @@
 		SetNormalFont (gr);
 	}
 
-	protected void DrawBackground (Cairo.Context gr)
+	protected void DrawBackground (CairoContextEx gr)
 	{
 		int columns = 40;
 		int rows = 40;

Modified: trunk/src/GameDrawingArea.cs
==============================================================================
--- trunk/src/GameDrawingArea.cs	(original)
+++ trunk/src/GameDrawingArea.cs	Sun Feb 17 14:20:50 2008
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Jordi Mas i HernÃndez <jmas softcatala org>
+ * Copyright (C) 2007-2008 Jordi Mas i HernÃndez <jmas softcatala org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -62,7 +62,7 @@
 		}
 	}
 
-	private void DrawBackground (Cairo.Context gr)
+	private void DrawBackground (CairoContextEx gr)
 	{
 		gr.Save ();
 		gr.Color = new Cairo.Color (1, 1, 1);
@@ -71,7 +71,7 @@
 		gr.Restore ();		
 	}
 
-	private void DrawBand (Cairo.Context gr, double x, double y)
+	private void DrawBand (CairoContextEx gr, double x, double y)
 	{
 		gr.Save ();
 		gr.Rectangle (x, y, 1 - 0.06, 0.06);
@@ -80,7 +80,7 @@
 		gr.Restore ();		
 	}
 
-	private void DrawWelcome (Cairo.Context gr, int area_width, int area_height)
+	private void DrawWelcome (CairoContextEx gr, int area_width, int area_height)
 	{
 		double y = 0.07;
 		double space = 0.25;
@@ -97,7 +97,7 @@
 		gr.Stroke ();
 
 		gr.SetFontSize (0.03);
-		DrawingHelpers.DrawStringWithWrapping (gr, 0.05, y + 0.08, line_space, Catalog.GetString ("gbrainy is a brain teaser game and trainer to have fun and to keep your brain trained. It includes:"));
+		gr.DrawStringWithWrapping (0.05, y + 0.08, line_space, Catalog.GetString ("gbrainy is a brain teaser game and trainer to have fun and to keep your brain trained. It includes:"));
 
 		y = 0.3;
 		image = new ImageSurface (Defines.DATA_DIR + "logic-games-80.png");
@@ -109,7 +109,7 @@
 			gr.Paint ();
 			gr.Restore ();
 		}
-		DrawingHelpers.DrawStringWithWrapping (gr, 0.21, y + 0.03, line_space, Catalog.GetString ("Logic puzzles. Designed to challenge your reasoning and thinking skills."));
+		gr.DrawStringWithWrapping (0.21, y + 0.03, line_space, Catalog.GetString ("Logic puzzles. Designed to challenge your reasoning and thinking skills."));
 
 		y += space;
 		image = new ImageSurface (Defines.DATA_DIR + "math-games-80.png");
@@ -121,7 +121,7 @@
 			gr.Paint ();
 			gr.Restore ();
 		}
-		DrawingHelpers.DrawStringWithWrapping (gr, 0.21, y + 0.03, line_space, Catalog.GetString ("Mental calculation. Based on arithmetical operations that test your mental calculation abilities."));
+		gr.DrawStringWithWrapping (0.21, y + 0.03, line_space, Catalog.GetString ("Mental calculation. Based on arithmetical operations that test your mental calculation abilities."));
 
 		y += space;
 		image = new ImageSurface (Defines.DATA_DIR + "memory-games-80.png");
@@ -133,7 +133,7 @@
 			gr.Paint ();
 			gr.Restore ();
 		}
-		DrawingHelpers.DrawStringWithWrapping (gr, 0.21, y + 0.03, line_space, Catalog.GetString ("Memory trainers. To prove and enhance your short term memory."));
+		gr.DrawStringWithWrapping (0.21, y + 0.03, line_space, Catalog.GetString ("Memory trainers. To prove and enhance your short term memory."));
 		gr.Stroke ();
 	}
 
@@ -165,7 +165,7 @@
 		finish = OnFinish;
 	}
 
-	private void DrawCountDown (Cairo.Context gr, int area_width, int area_height)
+	private void DrawCountDown (CairoContextEx gr, int area_width, int area_height)
 	{
 		gr.Scale (area_width, area_height);
 
@@ -176,7 +176,7 @@
 		gr.Color = new Cairo.Color (0, 0, 0, 1);
 
 		gr.SetFontSize (0.033);
-		DrawingHelpers.DrawTextCentered (gr, 0.5, 0.1, Catalog.GetString ("Get ready to memorize the next objects..."));
+		gr.DrawTextCentered (0.5, 0.1, Catalog.GetString ("Get ready to memorize the next objects..."));
 		gr.Stroke ();
 
 		gr.SetFontSize (0.4);
@@ -191,7 +191,7 @@
 
 	}
 
-	private void DrawScores (Cairo.Context gr, int area_width, int area_height)
+	private void DrawScores (CairoContextEx gr, int area_width, int area_height)
 	{
 		double y = 0.08, x = 0.05;
 		double space_small = 0.06;
@@ -266,7 +266,7 @@
 		y += 0.08;
 		for (int i = 0; i < tips_shown; i++)
 		{
-			y = DrawingHelpers.DrawStringWithWrapping (gr, x, y, space_small, "- " + GetTip ((int) random_indices[i]));
+			y = gr.DrawStringWithWrapping (x, y, space_small, "- " + GetTip ((int) random_indices[i]));
 			if (y > 0.85)
 				break;
 
@@ -312,7 +312,7 @@
 
 		int w, h;
 		args.Window.GetSize (out w, out h);
-		Cairo.Context cr = Gdk.CairoHelper.Create (args.Window);
+		CairoContextEx cr = CairoContextEx.CreateFromGdk (args.Window);
 		
 		switch (mode) {
 		case Modes.Welcome:

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sun Feb 17 14:20:50 2008
@@ -39,7 +39,6 @@
 	$(srcdir)/PuzzlePairs.cs		\
 	$(srcdir)/PuzzleOstracism.cs		\
 	$(srcdir)/MemoryCountDots.cs		\
-	$(srcdir)/DrawingHelpers.cs		\
 	$(srcdir)/MathOperator.cs		\
 	$(srcdir)/PuzzleFigurePattern.cs	\
 	$(srcdir)/ColorPalette.cs		\
@@ -54,6 +53,7 @@
 	$(srcdir)/MemoryIndications.cs		\
 	$(srcdir)/PuzzleMostInCommon.cs		\
 	$(srcdir)/PuzzleBuildTriangle.cs	\
+	$(srcdir)/CairoContextEx.cs		\
 	$(srcdir)/gbrainy.cs			
 
 ASSEMBLIES = \

Modified: trunk/src/MathArithmetical.cs
==============================================================================
--- trunk/src/MathArithmetical.cs	(original)
+++ trunk/src/MathArithmetical.cs	Sun Feb 17 14:20:50 2008
@@ -100,7 +100,7 @@
 		right_answer = result.ToString ();
 	}
 	
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{	
 		double operand_y = DrawAreaY + 0.2, operand_space = 0.1;
 		double aligned_pos = 0.58;
@@ -113,7 +113,7 @@
 		SetLargeFont (gr);
 		for (int i = 0; i < operands.Length - 1; i++)
 		{
-			DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, operand_y, operands[i].ToString ());
+			gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[i].ToString ());
 			gr.MoveTo (DrawAreaX + 0.2, operand_y + 0.05);	
 
 			switch (operation) {
@@ -131,7 +131,7 @@
 			operand_y += operand_space;
 		}
 
-		DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, operand_y, operands[operands.Length - 1].ToString ());
+		gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[operands.Length - 1].ToString ());
 
 		operand_y += 0.05;
 		gr.MoveTo (DrawAreaX + 0.2, operand_y);
@@ -140,7 +140,7 @@
 
 		if (DrawAnswer) {
 			operand_y += 0.05;
-			DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, operand_y + 0.05, right_answer);
+			gr.DrawTextAlignedRight (aligned_pos, operand_y + 0.05, right_answer);
 			gr.Stroke ();
 		}
 

Modified: trunk/src/MathGreaterDivisor.cs
==============================================================================
--- trunk/src/MathGreaterDivisor.cs	(original)
+++ trunk/src/MathGreaterDivisor.cs	Sun Feb 17 14:20:50 2008
@@ -193,7 +193,7 @@
 		return rslt;
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{	
 		double x = DrawAreaX, y = DrawAreaY + 0.1;
 

Modified: trunk/src/MathOperator.cs
==============================================================================
--- trunk/src/MathOperator.cs	(original)
+++ trunk/src/MathOperator.cs	Sun Feb 17 14:20:50 2008
@@ -81,7 +81,7 @@
 		right_answer = String.Format (Catalog.GetString ("{0} and {1}"), oper1, oper2);
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{	
 		double aligned_pos = 0.58;
 
@@ -90,15 +90,15 @@
 		PrepareGC (gr);
 		SetLargeFont (gr);
 
-		DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, DrawAreaY + 0.2, number_a.ToString ());
-		DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, DrawAreaY + 0.3, number_b.ToString ());
-		DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, DrawAreaY + 0.4, number_c.ToString ());
+		gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.2, number_a.ToString ());
+		gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.3, number_b.ToString ());
+		gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.4, number_c.ToString ());
 
 		gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.45);
 		gr.LineTo (DrawAreaX + 0.5, DrawAreaY + 0.45);
 		gr.Stroke ();
 
-		DrawingHelpers.DrawTextAlignedRight (gr, aligned_pos, DrawAreaY + 0.55, total.ToString ());
+		gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.55, total.ToString ());
 
 		gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.25);
 		gr.ShowText ((DrawAnswer == true) ? oper1.ToString () : "?");

Modified: trunk/src/MathTwoNumbers.cs
==============================================================================
--- trunk/src/MathTwoNumbers.cs	(original)
+++ trunk/src/MathTwoNumbers.cs	Sun Feb 17 14:20:50 2008
@@ -62,7 +62,7 @@
 		right_answer = String.Format (Catalog.GetString ("{0} and {1}"), number_a, number_b);
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{	
 		double x = DrawAreaX;
 

Modified: trunk/src/MathWhichNumber.cs
==============================================================================
--- trunk/src/MathWhichNumber.cs	(original)
+++ trunk/src/MathWhichNumber.cs	Sun Feb 17 14:20:50 2008
@@ -119,7 +119,7 @@
 		right_answer += (char) (65 + which);
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{	
 		double x = DrawAreaX + 0.25, y = DrawAreaY + 0.2;
 		char option;

Modified: trunk/src/Memory.cs
==============================================================================
--- trunk/src/Memory.cs	(original)
+++ trunk/src/Memory.cs	Sun Feb 17 14:20:50 2008
@@ -113,7 +113,7 @@
 		timer.Enabled = false;
 	}		
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{	
 		gr.Scale (area_width, area_height);
 		DrawBackground (gr);
@@ -137,7 +137,7 @@
 		}		
 	}
 
-	public override void DrawPreview (Cairo.Context gr, int width, int height)
+	public override void DrawPreview (CairoContextEx gr, int width, int height)
 	{
 		gr.Scale (width, height);
 		DrawBackground (gr);
@@ -145,9 +145,9 @@
 		DrawObjectToMemorize (gr, width, height);
 	}
 
-	public virtual void DrawPossibleAnswers (Cairo.Context gr, int area_width, int area_height) {}
+	public virtual void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height) {}
 
-	public virtual void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public virtual void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		double percentage;
 
@@ -158,7 +158,7 @@
 		DrawTimeBar (gr, 0.1, 0.2, percentage);
 	}
 
-	public void DrawTimeBar (Cairo.Context gr, double x, double y, double percentage)
+	public void DrawTimeBar (CairoContextEx gr, double x, double y, double percentage)
 	{
 		double width = 0.04, height = 0.6;
 		double w = 0.003, h = 0.003;

Modified: trunk/src/MemoryColouredFigures.cs
==============================================================================
--- trunk/src/MemoryColouredFigures.cs	(original)
+++ trunk/src/MemoryColouredFigures.cs	Sun Feb 17 14:20:50 2008
@@ -133,7 +133,7 @@
 		}
 	}
 
-	public override void DrawPossibleAnswers (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX, y = DrawAreaY;
 	
@@ -152,14 +152,14 @@
 		}
 	}
 
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 		palette.Alpha = alpha; 
 		DrawSquare (gr, DrawAreaX + 0.3, DrawAreaY + 0.1, squares_colours, 0);
 	}
 
-	private void DrawSquare (Cairo.Context gr, double x, double y, SquareColor []colours, int index)
+	private void DrawSquare (CairoContextEx gr, double x, double y, SquareColor []colours, int index)
 	{
 		gr.Save ();
 		for (int column = 0; column < columns; column++) {

Modified: trunk/src/MemoryColouredText.cs
==============================================================================
--- trunk/src/MemoryColouredText.cs	(original)
+++ trunk/src/MemoryColouredText.cs	Sun Feb 17 14:20:50 2008
@@ -64,13 +64,13 @@
 		base.Initialize ();
 	}
 	
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 		DrawObject (gr, area_width, area_height);
 	}
 
-	private void DrawObject (Cairo.Context gr, int area_width, int area_height)
+	private void DrawObject (CairoContextEx gr, int area_width, int area_height)
 	{
 		palette.Alpha=alpha;
 

Modified: trunk/src/MemoryCountDots.cs
==============================================================================
--- trunk/src/MemoryCountDots.cs	(original)
+++ trunk/src/MemoryCountDots.cs	Sun Feb 17 14:20:50 2008
@@ -78,13 +78,13 @@
 		base.Initialize ();
 	}
 
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 		DrawObject (gr, area_width, area_height);
 	}
 
-	private void DrawObject (Cairo.Context gr, int area_width, int area_height)
+	private void DrawObject (CairoContextEx gr, int area_width, int area_height)
 	{
 		palette.Alpha = alpha;
 		double x = DrawAreaX + 0.15, y = DrawAreaY + 0.1 ;

Modified: trunk/src/MemoryFigures.cs
==============================================================================
--- trunk/src/MemoryFigures.cs	(original)
+++ trunk/src/MemoryFigures.cs	Sun Feb 17 14:20:50 2008
@@ -103,7 +103,7 @@
 		base.Initialize ();
 	}
 
-	public override void DrawPossibleAnswers (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height)
 	{
 		int col = 1, fig;
 		double x = start_x, y = start_y;
@@ -124,7 +124,7 @@
 			if (figure == question_pos)
 				DrawFigure (gr, x, y, (FigureType) fig);
 			else {
-				DrawingHelpers.DrawTextCentered (gr, x + rect_w / 2, y + rect_h / 2, (figure + 1).ToString ());
+				gr.DrawTextCentered (x + rect_w / 2, y + rect_h / 2, (figure + 1).ToString ());
 				gr.Stroke ();
 			}
 
@@ -138,14 +138,14 @@
 		}
 	}
 
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 		DrawGrid (gr, area_width, area_height);
 		DrawAllFigures (gr, area_width, area_height);
 	}
 
-	private void DrawAllFigures (Cairo.Context gr, int area_width, int area_height)
+	private void DrawAllFigures (CairoContextEx gr, int area_width, int area_height)
 	{
 		int col = 1, fig;
 		double x = start_x, y = start_y;
@@ -168,7 +168,7 @@
 		}
 	}
 
-	private void DrawFigure (Cairo.Context gr, double x, double y, FigureType fig)
+	private void DrawFigure (CairoContextEx gr, double x, double y, FigureType fig)
 	{
 		double space_x, space_y;
 
@@ -177,21 +177,21 @@
 
 		switch (fig) {
 		case FigureType.Triangle:
-			DrawingHelpers.DrawEquilateralTriangle (gr, x + space_x, y + space_y, figure_size);
+			gr.DrawEquilateralTriangle (x + space_x, y + space_y, figure_size);
 			break;
 		case FigureType.Rectangle:
 			gr.Rectangle (x + space_x, y + space_y, figure_size, figure_size);
 			gr.Stroke ();
 			break;
 		case FigureType.Diamond:
-			DrawingHelpers.DrawDiamond  (gr, x + space_x, y + space_y, figure_size);
+			gr.DrawDiamond (x + space_x, y + space_y, figure_size);
 			break;
 		case FigureType.Cercle:
 			gr.Arc (x + space_x + figure_size / 2, y + space_y + figure_size / 2, figure_size / 2, 0, 2 * Math.PI);	
 			gr.Stroke ();
 			break;
 		case FigureType.TriangleWithLine:
-			DrawingHelpers.DrawEquilateralTriangle (gr, x + space_x, y + space_y, figure_size);
+			gr.DrawEquilateralTriangle (x + space_x, y + space_y, figure_size);
 			gr.MoveTo (x + space_x + figure_size / 2, y + space_y);
 			gr.LineTo (x + space_x + figure_size / 2, y + space_y + figure_size);
 			gr.Stroke ();
@@ -205,7 +205,7 @@
 			gr.Stroke ();
 			break;
 		case FigureType.DiamondWithLine:
-			DrawingHelpers.DrawDiamond  (gr, x + space_x, y + space_y, figure_size);
+			gr.DrawDiamond (x + space_x, y + space_y, figure_size);
 			gr.MoveTo (x + space_x + figure_size / 2, y + space_y);
 			gr.LineTo (x + space_x + figure_size / 2, y + space_y + figure_size);
 			gr.Stroke ();
@@ -220,7 +220,7 @@
 		}
 	}
 
-	private void DrawGrid (Cairo.Context gr, int area_width, int area_height)
+	private void DrawGrid (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = start_x, y = start_y;
 		gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, DefaultDrawingColor.B, alpha);

Modified: trunk/src/MemoryIndications.cs
==============================================================================
--- trunk/src/MemoryIndications.cs	(original)
+++ trunk/src/MemoryIndications.cs	Sun Feb 17 14:20:50 2008
@@ -52,14 +52,14 @@
 			Up
 		}
 
-		public void Draw (Cairo.Context gr, ref double x, ref double y, Indication next_prev)
+		public void Draw (CairoContextEx gr, ref double x, ref double y, Indication next_prev)
 		{
 			double line_length = 0.050;
 			double points = 0.050;
 
 			if (type == Type.Start) {
 				gr.Rectangle (x, y, points, points);
-				DrawingHelpers.DrawTextCentered (gr, x + points /2 , y + points /2, ((int)obj).ToString ());
+				gr.DrawTextCentered (x + points /2 , y + points /2, ((int)obj).ToString ());
 				switch ((TurnDirection) next_prev.obj) {
 				case TurnDirection.Right:
 					x += points;
@@ -116,7 +116,7 @@
 					break;
 				}
 				gr.Rectangle (x, y, points, points);
-				DrawingHelpers.DrawTextCentered (gr, x + points /2 , y + points /2, ((int)obj).ToString ());
+				gr.DrawTextCentered (x + points /2 , y + points /2, ((int)obj).ToString ());
 			}
 		}	
 	
@@ -228,7 +228,7 @@
 		return answer;
 	}
 
-	private void DrawPossibleAnswers (Cairo.Context gr, double x, double y, Indication[] indications)
+	private void DrawPossibleAnswers (CairoContextEx gr, double x, double y, Indication[] indications)
 	{		
 		for (int i = 0; i < indications.Length - 1; i++)
 			indications[i].Draw (gr, ref x, ref y, indications[i + 1]);
@@ -252,7 +252,7 @@
 		return null;
 	}
 
-	public override void DrawPossibleAnswers (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x, y;
 
@@ -278,7 +278,7 @@
 		gr.ShowText (String.Format (Catalog.GetString ("Figure {0}"), "D"));
 	}
 	
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 

Modified: trunk/src/MemoryNumbers.cs
==============================================================================
--- trunk/src/MemoryNumbers.cs	(original)
+++ trunk/src/MemoryNumbers.cs	Sun Feb 17 14:20:50 2008
@@ -119,7 +119,7 @@
 	}
 	
 
-	public override void DrawPossibleAnswers (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX , y = DrawAreaY;
 		gr.Color = DefaultDrawingColor;
@@ -136,18 +136,18 @@
 		}
 	}
 
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 		DrawSquare (gr, 0.3 + DrawAreaX, DrawAreaY + 0.1, numbers, 0);
 	}
 
-	private void DrawSquare (Cairo.Context gr, double x, double y, int[] nums, int index)
+	private void DrawSquare (CairoContextEx gr, double x, double y, int[] nums, int index)
 	{
 		for (int column = 0; column < columns; column++) {
 			for (int row = 0; row < rows; row++) {
 				gr.Rectangle (x + row * rect_w, y + column * rect_h, rect_w, rect_h);
-				DrawingHelpers.DrawTextCentered (gr, x + (rect_w / 2) + column * rect_w, y + (rect_h / 2) + row * rect_h, 
+				gr.DrawTextCentered (x + (rect_w / 2) + column * rect_w, y + (rect_h / 2) + row * rect_h, 
 					(nums[index + column + (row * columns)]).ToString ());
 			}
 		}

Modified: trunk/src/MemoryWords.cs
==============================================================================
--- trunk/src/MemoryWords.cs	(original)
+++ trunk/src/MemoryWords.cs	Sun Feb 17 14:20:50 2008
@@ -115,7 +115,7 @@
 		base.Initialize ();
 	}
 	
-	public override void DrawPossibleAnswers (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawPossibleAnswers (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
 		int cnt = 0;
@@ -139,13 +139,13 @@
 		}
 	}
 	
-	public override void DrawObjectToMemorize (Cairo.Context gr, int area_width, int area_height)
+	public override void DrawObjectToMemorize (CairoContextEx gr, int area_width, int area_height)
 	{
 		base.DrawObjectToMemorize (gr, area_width, area_height);
 		DrawObject (gr, area_width, area_height);
 	}
 	
-	private void DrawObject (Cairo.Context gr, int area_width, int area_height)
+	private void DrawObject (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
 		for (int i = 0; i < showed; i++)

Modified: trunk/src/PuzzleAlphabeticSequence.cs
==============================================================================
--- trunk/src/PuzzleAlphabeticSequence.cs	(original)
+++ trunk/src/PuzzleAlphabeticSequence.cs	Sun Feb 17 14:20:50 2008
@@ -73,7 +73,7 @@
 		return s;
 	}
 
-	private void DrawRectangleWithText (Cairo.Context gr, double x, double y, int index)
+	private void DrawRectangleWithText (CairoContextEx gr, double x, double y, int index)
 	{
 		gr.Rectangle (x, y, figure_size, figure_size);
 
@@ -95,7 +95,7 @@
 	}
 
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.05, y = DrawAreaY + 0.1;
 

Modified: trunk/src/PuzzleBalance.cs
==============================================================================
--- trunk/src/PuzzleBalance.cs	(original)
+++ trunk/src/PuzzleBalance.cs	Sun Feb 17 14:20:50 2008
@@ -70,7 +70,7 @@
 		right_answer = ans.ToString ();
 	}
 
-	public void DrawBalance (Cairo.Context gr, double x, double y, int index, bool full)
+	public void DrawBalance (CairoContextEx gr, double x, double y, int index, bool full)
 	{
 		double width = 0.5;
 		double fig_x = x + 0.1, fig_y = y - 0.11;
@@ -85,10 +85,10 @@
 		for (int i = 0; i < total; i++) {
 			switch (balances[i + index]) {
 			case 1:
-				DrawingHelpers.DrawEquilateralTriangle (gr, fig_x, fig_y, 0.05);
+				gr.DrawEquilateralTriangle (fig_x, fig_y, 0.05);
 				break;
 			case 2:
-				DrawingHelpers.DrawDiamond (gr, fig_x, fig_y, 0.05);
+				gr.DrawDiamond (fig_x, fig_y, 0.05);
 				break;
 			case 3:
 				gr.Rectangle (fig_x, fig_y + 0.005, 0.045, 0.045);
@@ -112,12 +112,12 @@
 		gr.LineTo (x , y - 0.05);
 		gr.Stroke ();
 		
-		DrawingHelpers.DrawEquilateralTriangle (gr, x + (width / 2) - 0.04, y, 0.08);
+		gr.DrawEquilateralTriangle (x + (width / 2) - 0.04, y, 0.08);
 		gr.Stroke ();
 
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{		
 		double x = 0.05, y = DrawAreaY + 0.1;
 

Modified: trunk/src/PuzzleBuildTriangle.cs
==============================================================================
--- trunk/src/PuzzleBuildTriangle.cs	(original)
+++ trunk/src/PuzzleBuildTriangle.cs	Sun Feb 17 14:20:50 2008
@@ -92,11 +92,11 @@
 		right_answer = answers[0].ToString () + answers[1].ToString () + answers[2].ToString ();		
 	}
 
-	private void DrawFigure (Cairo.Context gr, double x, double y, Figures figure)
+	private void DrawFigure (CairoContextEx gr, double x, double y, Figures figure)
 	{
 		switch (figure) {
 		case Figures.TriangleA:
-			DrawingHelpers.DrawEquilateralTriangle (gr, x, y, figure_size);
+			gr.DrawEquilateralTriangle (x, y, figure_size);
 			break;
 		case Figures.TriangleB:
 			gr.MoveTo (x, y);
@@ -125,7 +125,7 @@
 			gr.Stroke ();
 			break;
 		case Figures.Diamon:
-			DrawingHelpers.DrawDiamond (gr, x, y, figure_size);
+			gr.DrawDiamond (x, y, figure_size);
 			break;
 		case Figures.TriangleD:
 			gr.MoveTo (x, y);
@@ -137,7 +137,7 @@
 		}
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.05, y = DrawAreaY + 0.05;
 		double degrees, x1, x2, dist;

Modified: trunk/src/PuzzleCirclesRectangle.cs
==============================================================================
--- trunk/src/PuzzleCirclesRectangle.cs	(original)
+++ trunk/src/PuzzleCirclesRectangle.cs	Sun Feb 17 14:20:50 2008
@@ -54,7 +54,7 @@
 		right_answer = "68";
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double first_x = DrawAreaX + 0.05;
 		double first_y = DrawAreaY + 0.1;

Modified: trunk/src/PuzzleCoverPercentage.cs
==============================================================================
--- trunk/src/PuzzleCoverPercentage.cs	(original)
+++ trunk/src/PuzzleCoverPercentage.cs	Sun Feb 17 14:20:50 2008
@@ -70,7 +70,7 @@
 		right_answer = total.ToString ();
 	}
 
-	private void DrawSection (Cairo.Context gr, double x, double y)
+	private void DrawSection (CairoContextEx gr, double x, double y)
 	{
 		double w =  width / 2, h = height / 2;
 		double pos_x = x, pos_y = y;
@@ -99,7 +99,7 @@
 		gr.Restore ();
 	}
 
-	private void CoverZone (Cairo.Context gr, double x, double y)
+	private void CoverZone (CairoContextEx gr, double x, double y)
 	{
 		gr.Save ();
 		gr.Color = new Cairo.Color (0.90, 0.90, 0.90);
@@ -108,7 +108,7 @@
 		gr.Restore ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = 0.25, y = 0.25;
 

Modified: trunk/src/PuzzleCube.cs
==============================================================================
--- trunk/src/PuzzleCube.cs	(original)
+++ trunk/src/PuzzleCube.cs	Sun Feb 17 14:20:50 2008
@@ -49,7 +49,7 @@
 		right_answer += (char) (48 + question_answer[(pair * 2) + 1]);
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.1;
 		double y = DrawAreaY + 0.1;

Modified: trunk/src/PuzzleDivideCircle.cs
==============================================================================
--- trunk/src/PuzzleDivideCircle.cs	(original)
+++ trunk/src/PuzzleDivideCircle.cs	Sun Feb 17 14:20:50 2008
@@ -60,7 +60,7 @@
 		}			
 	}
 
-	private void DrawAndConnectPoints (Cairo.Context gr, double x, double y, Cercle[] cercles, bool connect)
+	private void DrawAndConnectPoints (CairoContextEx gr, double x, double y, Cercle[] cercles, bool connect)
 	{
 		double point_size = 0.01;
 		for (int i = 0; i < cercles.Length; i++) {
@@ -85,7 +85,7 @@
 		gr.Restore ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.05, y = DrawAreaY;
 		double pos_x = x;

Modified: trunk/src/PuzzleFigureLetter.cs
==============================================================================
--- trunk/src/PuzzleFigureLetter.cs	(original)
+++ trunk/src/PuzzleFigureLetter.cs	Sun Feb 17 14:20:50 2008
@@ -109,7 +109,7 @@
 		return false;
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.05;
 		double y = DrawAreaY + 0.1;

Modified: trunk/src/PuzzleFigurePattern.cs
==============================================================================
--- trunk/src/PuzzleFigurePattern.cs	(original)
+++ trunk/src/PuzzleFigurePattern.cs	Sun Feb 17 14:20:50 2008
@@ -67,7 +67,7 @@
 		}
 	}
 
-	private void DrawRotatedCross (Cairo.Context gr, double x, double y, double size)
+	private void DrawRotatedCross (CairoContextEx gr, double x, double y, double size)
 	{
 		gr.MoveTo (x, y);
 		gr.LineTo (x + size, y + size);
@@ -76,7 +76,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawTwoLines (Cairo.Context gr, double x, double y, double size)
+	private void DrawTwoLines (CairoContextEx gr, double x, double y, double size)
 	{
 		gr.MoveTo (x, y);
 		gr.LineTo (x + size, y);
@@ -85,7 +85,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawCross (Cairo.Context gr, double x, double y, double size)
+	private void DrawCross (CairoContextEx gr, double x, double y, double size)
 	{
 		gr.MoveTo (x + size / 2, y);
 		gr.LineTo (x + size / 2, y + size);
@@ -94,7 +94,7 @@
 		gr.Stroke ();
 	}
 	
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double org_x = DrawAreaX + 0.1;
 		double x = org_x, y = 0.08;
@@ -141,7 +141,7 @@
 		DrawRotatedCross (gr, x, y, figure_size);
 
 		x += figure_size + space_x;
-		DrawingHelpers.DrawDiamond (gr, x, y, figure_size);
+		gr.DrawDiamond (x, y, figure_size);
 
 		y += space_y;
 		x = org_x;

Modified: trunk/src/PuzzleFigures.cs
==============================================================================
--- trunk/src/PuzzleFigures.cs	(original)
+++ trunk/src/PuzzleFigures.cs	Sun Feb 17 14:20:50 2008
@@ -67,7 +67,7 @@
 		right_answer = sb.ToString ();
 	}
 
-	private void AnswerCoding (Cairo.Context gr, double x, double y)
+	private void AnswerCoding (CairoContextEx gr, double x, double y)
 	{
 		double pos_x = x;
 
@@ -78,7 +78,7 @@
 		gr.MoveTo (pos_x, y + 0.05);
 		gr.ShowText ("A ->");
 		gr.Stroke ();
-		DrawingHelpers.DrawDiamond (gr, x + 0.1, y, 0.1);
+		gr.DrawDiamond (x + 0.1, y, 0.1);
 		gr.Stroke ();
 	
 		pos_x += 0.3;
@@ -94,7 +94,7 @@
 		gr.ShowText ("C ->");
 		gr.Stroke ();
 		pos_x += 0.1;
-		DrawingHelpers.DrawEquilateralTriangle (gr, pos_x, y, 0.1);
+		gr.DrawEquilateralTriangle (pos_x, y, 0.1);
 		gr.Stroke ();
 
 		y += 0.18;
@@ -102,7 +102,7 @@
 		gr.ShowText (Catalog.GetString ("E.g: ACB (diamond, circle, triangle)"));	
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{		
 		int element;
 		double figure_width = 0.1, figure_height = 0.1, space_width = 0.05, space_height = 0.1;
@@ -121,13 +121,13 @@
 				switch ((int) figures[(n * 6) + element])
 				{
 					case 0:
-						DrawingHelpers.DrawDiamond (gr, x, y, 0.1);
+						gr.DrawDiamond (x, y, 0.1);
 						break;
 					case 1:
 						gr.Arc (x + 0.05, y + 0.05, 0.05, 0, 2 * Math.PI);	
 						break;
 					case 2:
-						DrawingHelpers.DrawEquilateralTriangle (gr, x, y, 0.1);
+						gr.DrawEquilateralTriangle (x, y, 0.1);
 						break;
 					default:
 						break;

Modified: trunk/src/PuzzleLines.cs
==============================================================================
--- trunk/src/PuzzleLines.cs	(original)
+++ trunk/src/PuzzleLines.cs	Sun Feb 17 14:20:50 2008
@@ -64,14 +64,14 @@
 		right_answer = (fig1 + fig2).ToString ();
 	}
 
-	private void DrawLine (Cairo.Context gr, double x, double y, double w, double h)
+	private void DrawLine (CairoContextEx gr, double x, double y, double w, double h)
 	{
 		gr.MoveTo (x, y);
 		gr.LineTo (x + w, y + h);
 		gr.Stroke ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		gr.Scale (area_width, area_height);
 

Modified: trunk/src/PuzzleMatrixGroups.cs
==============================================================================
--- trunk/src/PuzzleMatrixGroups.cs	(original)
+++ trunk/src/PuzzleMatrixGroups.cs	Sun Feb 17 14:20:50 2008
@@ -103,7 +103,7 @@
 		return unique;
 	}	
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double rect_w = DrawAreaWidth / rows;
 		double rect_h = DrawAreaHeight / columns;

Modified: trunk/src/PuzzleMatrixNumbers.cs
==============================================================================
--- trunk/src/PuzzleMatrixNumbers.cs	(original)
+++ trunk/src/PuzzleMatrixNumbers.cs	Sun Feb 17 14:20:50 2008
@@ -126,7 +126,7 @@
 		right_answer = numbers[3*coordinateA + 3*coordinateB].ToString ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double rect_w = DrawAreaWidth / rows;
 		double rect_h = DrawAreaHeight / columns;

Modified: trunk/src/PuzzleMissingPiece.cs
==============================================================================
--- trunk/src/PuzzleMissingPiece.cs	(original)
+++ trunk/src/PuzzleMissingPiece.cs	Sun Feb 17 14:20:50 2008
@@ -61,7 +61,7 @@
 		}
 	}
 
-	private void DrawFigureSequence (Cairo.Context gr, double x, double y, int sequence, bool last_block)
+	private void DrawFigureSequence (CairoContextEx gr, double x, double y, int sequence, bool last_block)
 	{
 		gr.Rectangle (x, y, sub_figure, sub_figure);
 		gr.Rectangle (x + sub_figure, y, sub_figure, sub_figure);
@@ -109,7 +109,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawAnswerFigures (Cairo.Context gr, double x, double y, int figure)
+	private void DrawAnswerFigures (CairoContextEx gr, double x, double y, int figure)
 	{
 		gr.Rectangle (x, y, sub_figure, sub_figure);
 
@@ -131,7 +131,7 @@
 		gr.Stroke ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.15, y = DrawAreaY;
 		int figure;

Modified: trunk/src/PuzzleMissingSlice.cs
==============================================================================
--- trunk/src/PuzzleMissingSlice.cs	(original)
+++ trunk/src/PuzzleMissingSlice.cs	Sun Feb 17 14:20:50 2008
@@ -88,7 +88,7 @@
 		}
 	}
 
-	private void DrawSlice (Cairo.Context gr, double x, double y)
+	private void DrawSlice (CairoContextEx gr, double x, double y)
 	{
 		double degrees, x1, y1;
 		
@@ -110,7 +110,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawSliceText (Cairo.Context gr, double x, double y, int slice, string str1, string str2, string str3)
+	private void DrawSliceText (CairoContextEx gr, double x, double y, int slice, string str1, string str2, string str3)
 	{	
 		double x0, y0, degrees;
 
@@ -118,22 +118,22 @@
 		degrees = radian * (slice * ((360 / total_slices)) + (360 / 12));
 		x0 = 0.35 * radius * Math.Cos (degrees);
 		y0 = 0.35 * radius * Math.Sin (degrees);
-		DrawingHelpers.DrawTextCentered (gr, x + x0, y + y0, str1);
+		gr.DrawTextCentered (x + x0, y + y0, str1);
 	
 		// Number opposite to the center and at the top
 		degrees = radian * (slice * ((360 / total_slices)) + (360 / 24));
 		x0 = 0.8 * radius * Math.Cos (degrees);
 		y0 = 0.8 * radius * Math.Sin (degrees);
-		DrawingHelpers.DrawTextCentered (gr, x + x0, y + y0, str2);
+		gr.DrawTextCentered (x + x0, y + y0, str2);
 	
 		// Number opposite to the center and at the bottom
 		degrees = radian * (slice * ((360 / total_slices)) + (360 / 8));			
 		x0 = 0.8 * radius * Math.Cos (degrees);
 		y0 = 0.8 * radius * Math.Sin (degrees);
-		DrawingHelpers.DrawTextCentered (gr, x + x0, y + y0, str3);
+		gr.DrawTextCentered (x + x0, y + y0, str3);
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{		
 		double x = DrawAreaX + 0.2, y = DrawAreaY;
 		double x0, y0, degrees;
@@ -158,7 +158,7 @@
 				degrees = radian * (slice * ((360 / total_slices)) + (360 / 12));
 				x0 = 0.5 * radius * Math.Cos (degrees);
 				y0 = 0.5 * radius * Math.Sin (degrees);
-				DrawingHelpers.DrawTextCentered (gr, x + arc_centerx + x0, y + arc_centery + y0, "?");
+				gr.DrawTextCentered (x + arc_centerx + x0, y + arc_centery + y0, "?");
 				continue;
 			}
 			

Modified: trunk/src/PuzzleMostInCommon.cs
==============================================================================
--- trunk/src/PuzzleMostInCommon.cs	(original)
+++ trunk/src/PuzzleMostInCommon.cs	Sun Feb 17 14:20:50 2008
@@ -215,7 +215,7 @@
 		return element;
 	}
 
-	private void DrawFigureElement (Cairo.Context gr, double x, double y, FigureElement figure)
+	private void DrawFigureElement (CairoContextEx gr, double x, double y, FigureElement figure)
 	{
 		switch (figure.element) {
 		case Element.SmallCircle:
@@ -233,7 +233,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawFigure (Cairo.Context gr, double x, double y, FigureElement[] figure)
+	private void DrawFigure (CairoContextEx gr, double x, double y, FigureElement[] figure)
 	{
 		double cercle_size = 0.15;
 		gr.Stroke ();
@@ -246,7 +246,7 @@
 		gr.Stroke ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX, y = DrawAreaY + 0.1;
 

Modified: trunk/src/PuzzleMoveFigure.cs
==============================================================================
--- trunk/src/PuzzleMoveFigure.cs	(original)
+++ trunk/src/PuzzleMoveFigure.cs	Sun Feb 17 14:20:50 2008
@@ -67,7 +67,7 @@
 		
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double first_x, x, y;
 		double figure_size = 0.07 + (0.01 * (5 - lines));

Modified: trunk/src/PuzzleNextFigure.cs
==============================================================================
--- trunk/src/PuzzleNextFigure.cs	(original)
+++ trunk/src/PuzzleNextFigure.cs	Sun Feb 17 14:20:50 2008
@@ -75,7 +75,7 @@
 		}
 	}
 
-	private void DrawDiamon (Cairo.Context gr, double x, double y, CerclePosition cercles)
+	private void DrawDiamon (CairoContextEx gr, double x, double y, CerclePosition cercles)
 	{	
 		double distance = 0.04;
 
@@ -107,7 +107,7 @@
 		}
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX;
 		double y = DrawAreaY;

Modified: trunk/src/PuzzleNumericRelation.cs
==============================================================================
--- trunk/src/PuzzleNumericRelation.cs	(original)
+++ trunk/src/PuzzleNumericRelation.cs	Sun Feb 17 14:20:50 2008
@@ -96,7 +96,7 @@
 	}
 
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		StringBuilder sequence = new StringBuilder (64);
 

Modified: trunk/src/PuzzleNumericSequence.cs
==============================================================================
--- trunk/src/PuzzleNumericSequence.cs	(original)
+++ trunk/src/PuzzleNumericSequence.cs	Sun Feb 17 14:20:50 2008
@@ -82,7 +82,7 @@
 	}
 
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		StringBuilder sequence = new StringBuilder (64);
 

Modified: trunk/src/PuzzleOstracism.cs
==============================================================================
--- trunk/src/PuzzleOstracism.cs	(original)
+++ trunk/src/PuzzleOstracism.cs	Sun Feb 17 14:20:50 2008
@@ -70,7 +70,7 @@
 		}
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.15, y = DrawAreaY + 0.2;
 

Modified: trunk/src/PuzzlePairs.cs
==============================================================================
--- trunk/src/PuzzlePairs.cs	(original)
+++ trunk/src/PuzzlePairs.cs	Sun Feb 17 14:20:50 2008
@@ -92,7 +92,7 @@
 	}
 
 
-	private void DrawTriangle (Cairo.Context gr, double x, double y, int index, bool question)
+	private void DrawTriangle (CairoContextEx gr, double x, double y, int index, bool question)
 	{
 		gr.MoveTo (x + figure_size / 2, y);
 		gr.LineTo (x, y + figure_size);
@@ -111,7 +111,7 @@
 			gr.ShowText (numbers [(elements_group * group) + (index * 2) + 1].ToString ());	
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX, y = DrawAreaY + 0.1;
 

Modified: trunk/src/PuzzlePencil.cs
==============================================================================
--- trunk/src/PuzzlePencil.cs	(original)
+++ trunk/src/PuzzlePencil.cs	Sun Feb 17 14:20:50 2008
@@ -52,7 +52,7 @@
 		}	
 	}
 
-	private void DrawTriangle (Cairo.Context gr, double x, double y)
+	private void DrawTriangle (CairoContextEx gr, double x, double y)
 	{
 		gr.MoveTo (x + (figure_size / 2), y);
 		gr.LineTo (x, y + figure_size);
@@ -62,7 +62,7 @@
 		gr.Stroke ();	
 	}
 
-	private void DrawDiamon (Cairo.Context gr, double x, double y)
+	private void DrawDiamon (CairoContextEx gr, double x, double y)
 	{
 		gr.MoveTo (x, y);
 		gr.LineTo (x - (figure_size / 2), y + (figure_size / 2));
@@ -73,7 +73,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawRectangleWithTriangles (Cairo.Context gr, double x, double y)
+	private void DrawRectangleWithTriangles (CairoContextEx gr, double x, double y)
 	{
 		gr.Rectangle (x, y, figure_size, figure_size);
 		gr.Stroke ();	
@@ -91,7 +91,7 @@
 		gr.Stroke ();
 	}
 
-	private void DrawThreeTriangles (Cairo.Context gr, double x, double y)
+	private void DrawThreeTriangles (CairoContextEx gr, double x, double y)
 	{
 		gr.MoveTo (x, y);
 		gr.LineTo (x, y + figure_size);
@@ -104,7 +104,7 @@
 		
 	}
 
-	private void DrawHouse (Cairo.Context gr, double x, double y)
+	private void DrawHouse (CairoContextEx gr, double x, double y)
 	{
 		gr.MoveTo (x, y + figure_size);
 		gr.LineTo (x, y + figure_size / 2);
@@ -119,7 +119,7 @@
 		
 	}
 
-	private void DrawRectangleWithCross (Cairo.Context gr, double x, double y)
+	private void DrawRectangleWithCross (CairoContextEx gr, double x, double y)
 	{
 		gr.Rectangle (x, y, figure_size, figure_size);
 
@@ -132,7 +132,7 @@
 		gr.Stroke ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX, y = DrawAreaY;
 

Modified: trunk/src/PuzzlePeopleTable.cs
==============================================================================
--- trunk/src/PuzzlePeopleTable.cs	(original)
+++ trunk/src/PuzzlePeopleTable.cs	Sun Feb 17 14:20:50 2008
@@ -75,7 +75,7 @@
 		}			
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.22, y = DrawAreaY + 0.2;
 		double pos_x = x;

Modified: trunk/src/PuzzleSquareDots.cs
==============================================================================
--- trunk/src/PuzzleSquareDots.cs	(original)
+++ trunk/src/PuzzleSquareDots.cs	Sun Feb 17 14:20:50 2008
@@ -104,7 +104,7 @@
 		}
 	}
 
-	public void DrawFigure (Cairo.Context gr, double x, double y, bool [] puzzle, int index)
+	public void DrawFigure (CairoContextEx gr, double x, double y, bool [] puzzle, int index)
 	{
 		double pos_x = x, pos_y = y;
 		double square_size = figure_size / lines;
@@ -148,7 +148,7 @@
 		}
 	}
 
-	public void DrawPossibleAnswer (Cairo.Context gr, double x, double y, int figure)
+	public void DrawPossibleAnswer (CairoContextEx gr, double x, double y, int figure)
 	{
 		switch (figure) {
 		case 0: // Good answer
@@ -163,7 +163,7 @@
 		}
 	}
 	
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX, y = DrawAreaY;
 

Modified: trunk/src/PuzzleSquareSheets.cs
==============================================================================
--- trunk/src/PuzzleSquareSheets.cs	(original)
+++ trunk/src/PuzzleSquareSheets.cs	Sun Feb 17 14:20:50 2008
@@ -49,7 +49,7 @@
 		right_answer = "5";
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.2, y = DrawAreaY + 0.2, width = 0.4, height = 0.4;
 

Modified: trunk/src/PuzzleSquares.cs
==============================================================================
--- trunk/src/PuzzleSquares.cs	(original)
+++ trunk/src/PuzzleSquares.cs	Sun Feb 17 14:20:50 2008
@@ -68,7 +68,7 @@
 		}
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double rect_w = DrawAreaWidth / rows;
 		double rect_h = DrawAreaHeight / columns;

Modified: trunk/src/PuzzleTetris.cs
==============================================================================
--- trunk/src/PuzzleTetris.cs	(original)
+++ trunk/src/PuzzleTetris.cs	Sun Feb 17 14:20:50 2008
@@ -59,7 +59,7 @@
 		}
 	}
 
-	private void DrawQuestionFigures (Cairo.Context gr, double x, double y, int figure)
+	private void DrawQuestionFigures (CairoContextEx gr, double x, double y, int figure)
 	{
 		switch (figure) {
 		case 0:
@@ -99,7 +99,7 @@
 		}
 	}
 
-	private void DrawAnswerFigures (Cairo.Context gr, double x, double y, int figure)
+	private void DrawAnswerFigures (CairoContextEx gr, double x, double y, int figure)
 	{
 		switch (figure) {
 		case 0:
@@ -131,7 +131,7 @@
 		gr.Stroke ();
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX, y = DrawAreaY + 0.1;
 

Modified: trunk/src/PuzzleTriangles.cs
==============================================================================
--- trunk/src/PuzzleTriangles.cs	(original)
+++ trunk/src/PuzzleTriangles.cs	Sun Feb 17 14:20:50 2008
@@ -59,7 +59,7 @@
 			right_answer = "8";
 	}
 
-	public override void Draw (Cairo.Context gr, int area_width, int area_height)
+	public override void Draw (CairoContextEx gr, int area_width, int area_height)
 	{
 		double x = DrawAreaX + 0.1, y = DrawAreaY + 0.2;
 		double witdh = 0.6, height = 0.5;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]