Re: [Mono-dev] [MonoDevelop] Soc 2008 idea: Universal graphical Framwork

2008-03-27 Thread Manuel Alejandro Cerón Estrada
Hello Sharique.

Something like that is what I've been thinking with MonoHotDraw [1].
After talking with some people in the #monosoc channel, I came to the
conclusion that the best way would be to port MonoHotDraw to run on
the top of Moonlight (currently It runs over Gtk#/Cario).

I'm planing to submit two proposals for GSoC. One is a Class Designer
for MonoDevelop (actually, this one is already submmited, if you are a
mentor, you could start making comments and suggestions). The other
one is for make some improvements to Lunar Eclipse, the XAML editor.
In both cases my plan is to build a reusable framework for writing
graphical editors that use structured graphics. There are plenty of
cool stuff that could be made with a framework such that:

   * A Class Designer for MonoDevelop.
   * A DataBase Graphical Desginer for MonoDevelop
   * A Dia replacement with all the cool features that Moonlight can offer.
   * An UML Editor (Actually, the MonoHotDraw project has been
written as a part o the MonoUML project)
   * A Mind map editor. How could would be a mind map editor for
tomboy. Or a moonlight collaborative mind map editor to be used inside
a wiki engine.
   * Improvements to Lunar eclipse.

[1] http://www.monouml.org/doku.php?id=monohotdraw
2008/3/24, Sharique uddin Ahmed Farooqui [EMAIL PROTECTED]:
 Hi,
  We need different types of graphical designers like, xml designer,
  class designer, xaml designer, moonlight designer, etc.
  I think we should have a base framework, which will provide basic
  features like canvas and few controls and Monodevelop addin api. So
  that one can easily add there desired designer in monodevelop (a PCB
  designer for example).

  What are ur views friends?


  --
  Sharique uddin Ahmed Farooqui
  (C++/C# Developer, IT Consultant)
  http://safknw.blogspot.com/
  ___
  Monodevelop-list mailing list
  [EMAIL PROTECTED]
  http://lists.ximian.com/mailman/listinfo/monodevelop-list



-- 
· Manuel Alejandro Cerón Estrada
· [EMAIL PROTECTED]
· http://ceronman.freaks-unidos.net
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [PATCH] System.Drawing.RectangleF != Operator Bug

2006-11-05 Thread Manuel Alejandro Cerón Estrada

Hello,

I found a small bug in System.Drawing.RectangleF.  The inequality
operator (!=) was wrong. Here is the patch that corrects it.

Manuel Alejandro Cerón Estrada
Index: class/System.Drawing/System.Drawing/RectangleF.cs
===
--- class/System.Drawing/System.Drawing/RectangleF.cs	(revisión: 67395)
+++ class/System.Drawing/System.Drawing/RectangleF.cs	(copia de trabajo)
@@ -201,8 +201,8 @@
 
 		public static bool operator != (RectangleF r1, RectangleF r2)
 		{
-			return (r1.X != r2.X)  (r1.Y != r2.Y) 
-(r1.Width != r2.Width)  (r1.Height != r2.Height);
+			return (r1.X != r2.X) || (r1.Y != r2.Y) ||
+(r1.Width != r2.Width) || (r1.Height != r2.Height);
 		}
 		
 		/// summary
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Re: Mono.Cairo Memory Leak

2005-10-06 Thread Manuel Alejandro Cerón Estrada
Hi Robert,

Thanks for your answer. I have tried to put ((IDisposable)g).Dispose
(); just at the end of OnMontionNotifyEvent, but, unfortunately,  this
does not fix the problem.

Manuel.

2005/10/6, Robert Jordan [EMAIL PROTECTED]:
 You're not calling g.Dispose () or ((IDisposable)g).Dispose ();
 when you're ready with the object.

 Rob

--
· Manuel Alejandro Cerón Estrada
· [EMAIL PROTECTED]
· http://ceronman.blogspot.com
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono.Cairo Memory Leak

2005-10-05 Thread Manuel Alejandro Cerón Estrada
Hello,

I'm writing an interactive canvas for the MonoUML Case Tool. I'm using
Cairo with Gtk# and I have experimented an ascending memory
consumption when drawings are continuously performed, for example
inside a MotionNotifyEvent Handler. This memory is never released and
eventually SWAP memory is needed making all too slow.

I attach a simple example that illustrate this problem. Cairo draws a
rectangle inside a Gtk.DrawingArea every time that the mouse is moved
over the DrawingArea. Compile it, run it, move the mouse, and see how
memory consumption starts to getting higher and higher over time.

Is anything wrong with my code? or is a bug?

Thanks in advance,

Manuel.

--
· Manuel Alejandro Cerón Estrada
· [EMAIL PROTECTED]
· http://ceronman.blogspot.com
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Cairo;
using Gtk;
	
public class GtkCairo
{
	static DrawingArea a;
	
	static void Main ()
	{		
		Application.Init ();
		Gtk.Window w = new Gtk.Window (Cairo);

		a = new CairoGraphic ();	
			
		w.Add (a);
		w.Resize (200,200);		
		w.ShowAll ();		
		
		Application.Run ();
	}


}

public class CairoGraphic : DrawingArea 
{

public CairoGraphic()
{
	SetSizeRequest (200, 200);
		AddEvents ((int)Gdk.EventMask.AllEventsMask);
}
   
	static void draw (Cairo.Graphics gr, int width, int height)
	{
		gr.Scale (width, height);
		gr.LineWidth = 0.04;
		gr.Rectangle (0.1,0.1, 0.8, 0.8);
		gr.Stroke ();
	}
	
	protected override bool OnMotionNotifyEvent (Gdk.EventMotion ev)
	{
		int x, y;

		//this is necesary for getting the event every time
		Gdk.ModifierType state;
		if (ev.IsHint) {
			ev.Window.GetPointer(out x, out y, out state);
		} 
		QueueDraw();
		return true;
	}
   

	protected override bool OnExposeEvent (Gdk.EventExpose args)
	{
		Gdk.Window win = args.Window;
		Cairo.Graphics g = Graphics.CreateDrawable (win);
		int x, y, w, h, d;
		win.GetGeometry(out x, out y, out w, out h, out d);
		draw (g, w, h);
		return true;
	}

}

public class Graphics
{		
	//Use [DllImport(libgdk-win32-2.0-0.dll)] for  Win32 
	[DllImport(libgdk-x11-2.0.so)]
	  internal static extern IntPtr gdk_x11_drawable_get_xdisplay (IntPtr raw);
	
	[DllImport(libgdk-x11-2.0.so)]
	  internal static extern IntPtr gdk_x11_drawable_get_xid (IntPtr raw);
	
	[DllImport(libgdk-x11-2.0.so)]
	  internal static extern IntPtr gdk_drawable_get_visual (IntPtr raw);
	
	[DllImport(libgdk-x11-2.0.so)]
	  internal static extern IntPtr gdk_x11_visual_get_xvisual (IntPtr raw);
	
	[DllImport(libgdk-x11-2.0.so)]
	  internal static extern IntPtr gdk_cairo_create (IntPtr raw);
	
public static Cairo.Graphics CreateDrawable (Gdk.Drawable drawable)
	{
		IntPtr x_drawable = IntPtr.Zero;
		int x_off = 0, y_off = 0;			
		
		int x, y, w, h, d;
		((Gdk.Window)drawable).GetGeometry(out x, out y, out w, out h, out d);
		
		if (drawable is Gdk.Window)
		  ((Gdk.Window) drawable).GetInternalPaintInfo(out drawable, 
			out x_off, out y_off);
		
		x_drawable = drawable.Handle;			
		IntPtr visual = gdk_drawable_get_visual(x_drawable);
		
		IntPtr Xdisplay = gdk_x11_drawable_get_xdisplay(x_drawable);
		IntPtr Xvisual = gdk_x11_visual_get_xvisual(visual);
		IntPtr Xdrawable = gdk_x11_drawable_get_xid (x_drawable);
		
		Cairo.XlibSurface s = new Cairo.XlibSurface (Xdisplay,
			   Xdrawable,
			   Xvisual,
			   w, h);
		
		Cairo.Graphics g = new Cairo.Graphics (s);
		
		// this can be safely removed now, just keep it for a bit more
		//Cairo.Graphics g = new Cairo.Graphics (
		//gdk_cairo_create (x_drawable ));
		
		if (drawable is Gdk.Window)
		  g.Translate (-(double)x_off,-(double)y_off);
		return g;
	}
}

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list