EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MDCrow", "MDCrow\MDCrow.csproj", "{34956F17-5485-4C5C-9E2D-8EB15E5160AE}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {34956F17-5485-4C5C-9E2D-8EB15E5160AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {34956F17-5485-4C5C-9E2D-8EB15E5160AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {34956F17-5485-4C5C-9E2D-8EB15E5160AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {34956F17-5485-4C5C-9E2D-8EB15E5160AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
<?xml version="1.0"?>
-<Border Background="{./Background}" MinimumSize="50,20" Name="Content"
+<Border Background="{./Background}" MinimumSize="50,20" Name="Content" Focusable="true"
Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black;caption.Foreground=White}"
MouseLeave="{Foreground=Transparent;caption.Foreground=LightGrey}"
using System;
using System.IO;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
return arr[minp];
}
- public static void CairoRectangle(Cairo.Context gr, Rectangle r, double radius, double stroke = 0.0)
+ public static void CairoRectangle(Crow.Cairo.Context gr, Rectangle r, double radius, double stroke = 0.0)
{
if (radius > 0)
CairoHelpers.DrawRoundedRectangle (gr, r, radius, stroke);
else
gr.Rectangle (r, stroke);
}
- public static void CairoCircle(Cairo.Context gr, Rectangle r)
+ public static void CairoCircle(Crow.Cairo.Context gr, Rectangle r)
{
gr.Arc(r.X + r.Width/2, r.Y + r.Height/2, Math.Min(r.Width,r.Height)/2, 0, 2*Math.PI);
}
- public static void DrawRoundedRectangle(Cairo.Context gr, Rectangle r, double radius, double stroke = 0.0)
+ public static void DrawRoundedRectangle(Crow.Cairo.Context gr, Rectangle r, double radius, double stroke = 0.0)
{
if (stroke>0.0) {
gr.LineWidth = stroke;
}else
DrawRoundedRectangle(gr, r.X, r.Y, r.Width, r.Height, radius);
}
- public static void DrawRoundedRectangle(Cairo.Context gr, double x, double y, double width, double height, double radius)
+ public static void DrawRoundedRectangle(Crow.Cairo.Context gr, double x, double y, double width, double height, double radius)
{
gr.Save();
gr.ClosePath();
gr.Restore();
}
- public static void StrokeRaisedRectangle(Cairo.Context gr, Rectangle r, double width = 1)
+ public static void StrokeRaisedRectangle(Crow.Cairo.Context gr, Rectangle r, double width = 1)
{
gr.Save();
r.Inflate((int)-width / 2, (int)-width / 2);
gr.Restore();
}
- public static void StrokeLoweredRectangle(Cairo.Context gr, Rectangle r, double width = 1)
+ public static void StrokeLoweredRectangle(Crow.Cairo.Context gr, Rectangle r, double width = 1)
{
gr.Save();
r.Inflate((int)-width / 2, (int)-width / 2);
{
#region Cairo extensions
- public static void Rectangle(this Cairo.Context ctx, Rectangle r, double stroke = 0.0)
+ public static void Rectangle(this Crow.Cairo.Context ctx, Rectangle r, double stroke = 0.0)
{
if (stroke > 0.0) {
ctx.LineWidth = stroke;
}else
ctx.Rectangle (r.X, r.Y, r.Width, r.Height);
}
- public static double GetLength(this Cairo.PointD p){
+ public static double GetLength(this Crow.Cairo.PointD p){
return Math.Sqrt (Math.Pow (p.X, 2) + Math.Pow (p.Y, 2));
}
- public static Cairo.PointD GetPerp(this Cairo.PointD p){
- return new Cairo.PointD(-p.Y, p.X);
+ public static Crow.Cairo.PointD GetPerp(this Crow.Cairo.PointD p){
+ return new Crow.Cairo.PointD(-p.Y, p.X);
}
- public static Cairo.PointD GetNormalized(this Cairo.PointD p){
+ public static Crow.Cairo.PointD GetNormalized(this Crow.Cairo.PointD p){
double length = p.GetLength();
p.X /= length;
p.Y /= length;
return p;
}
- public static Cairo.PointD Substract(this Cairo.PointD p1, Cairo.PointD p2){
- return new Cairo.PointD(p1.X - p2.X, p1.Y - p2.Y);
+ public static Crow.Cairo.PointD Substract(this Crow.Cairo.PointD p1, Crow.Cairo.PointD p2){
+ return new Crow.Cairo.PointD(p1.X - p2.X, p1.Y - p2.Y);
}
- public static Cairo.PointD Divide(this Cairo.PointD p1, double d){
- return new Cairo.PointD(p1.X / d, p1.Y / d);
+ public static Crow.Cairo.PointD Divide(this Crow.Cairo.PointD p1, double d){
+ return new Crow.Cairo.PointD(p1.X / d, p1.Y / d);
}
- public static Cairo.PointD Add(this Cairo.PointD p1, Cairo.PointD p2){
- return new Cairo.PointD(p1.X + p2.X, p1.Y + p2.Y);
+ public static Crow.Cairo.PointD Add(this Crow.Cairo.PointD p1, Crow.Cairo.PointD p2){
+ return new Crow.Cairo.PointD(p1.X + p2.X, p1.Y + p2.Y);
}
- public static Cairo.PointD Multiply(this Cairo.PointD p1, double v){
- return new Cairo.PointD(p1.X * v, p1.Y * v);
+ public static Crow.Cairo.PointD Multiply(this Crow.Cairo.PointD p1, double v){
+ return new Crow.Cairo.PointD(p1.X * v, p1.Y * v);
}
- public static void DrawCote(this Cairo.Context ctx, Cairo.PointD p1, Cairo.PointD p2,
+ public static void DrawCote(this Crow.Cairo.Context ctx, Crow.Cairo.PointD p1, Crow.Cairo.PointD p2,
double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0)
{
- Cairo.PointD vDir = p2.Substract(p1);
+ Crow.Cairo.PointD vDir = p2.Substract(p1);
vDir = vDir.GetNormalized ();
- Cairo.PointD vPerp = vDir.GetPerp ();
+ Crow.Cairo.PointD vPerp = vDir.GetPerp ();
- Cairo.PointD pA0 = p1.Add(vDir.Multiply(arrowLength));
- Cairo.PointD pA1 = p2.Substract(vDir.Multiply(arrowLength));
+ Crow.Cairo.PointD pA0 = p1.Add(vDir.Multiply(arrowLength));
+ Crow.Cairo.PointD pA1 = p2.Substract(vDir.Multiply(arrowLength));
- Cairo.PointD vA = vPerp.Multiply (arrowWidth);
+ Crow.Cairo.PointD vA = vPerp.Multiply (arrowWidth);
ctx.MoveTo (p1);
ctx.LineTo (pA0.Add (vA));
ctx.LineWidth = stroke;
ctx.Stroke ();
}
- public static void DrawCoteInverse(this Cairo.Context ctx, Cairo.PointD p1, Cairo.PointD p2,
+ public static void DrawCoteInverse(this Crow.Cairo.Context ctx, Crow.Cairo.PointD p1, Crow.Cairo.PointD p2,
double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0)
{
- Cairo.PointD vDir = p2.Substract(p1);
+ Crow.Cairo.PointD vDir = p2.Substract(p1);
vDir = vDir.GetNormalized ();
- Cairo.PointD vPerp = vDir.GetPerp ();
+ Crow.Cairo.PointD vPerp = vDir.GetPerp ();
- Cairo.PointD pA0 = p1.Add(vDir.Multiply(arrowLength));
- Cairo.PointD pA1 = p2.Substract(vDir.Multiply(arrowLength));
+ Crow.Cairo.PointD pA0 = p1.Add(vDir.Multiply(arrowLength));
+ Crow.Cairo.PointD pA1 = p2.Substract(vDir.Multiply(arrowLength));
- Cairo.PointD vA = vPerp.Multiply (arrowWidth);
+ Crow.Cairo.PointD vA = vPerp.Multiply (arrowWidth);
ctx.MoveTo (p1.Add (vA));
ctx.LineTo (pA0);
ctx.LineWidth = stroke;
ctx.Stroke ();
}
- public static void DrawCoteFixed(this Cairo.Context ctx, Cairo.PointD p1, Cairo.PointD p2,
+ public static void DrawCoteFixed(this Crow.Cairo.Context ctx, Crow.Cairo.PointD p1, Crow.Cairo.PointD p2,
double stroke = 1.0, double coteWidth = 3.0)
{
- Cairo.PointD vDir = p2.Substract(p1);
+ Crow.Cairo.PointD vDir = p2.Substract(p1);
vDir = vDir.GetNormalized ();
- Cairo.PointD vPerp = vDir.GetPerp ();
- Cairo.PointD vA = vPerp.Multiply (coteWidth);
+ Crow.Cairo.PointD vPerp = vDir.GetPerp ();
+ Crow.Cairo.PointD vA = vPerp.Multiply (coteWidth);
ctx.MoveTo (p1.Add (vA));
ctx.LineTo (p1.Substract (vA));
ctx.Stroke ();
}
- public static void SetSourceColor(this Cairo.Context ctx, Color c)
+ public static void SetSourceColor(this Crow.Cairo.Context ctx, Color c)
{
ctx.SetSourceRGBA(c.R,c.G,c.B,c.A);
}
- public static void AddColorStop(this Cairo.Gradient grad, double offset, Color c)
+ public static void AddColorStop(this Crow.Cairo.Gradient grad, double offset, Color c)
{
grad.AddColorStop (offset, c);
}
using System;
using System.Collections.Generic;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
using System;
using System.Collections.Generic;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
public override void SetAsSource (Context ctx, Rectangle bounds = default(Rectangle))
{
- Cairo.Gradient grad = null;
+ Crow.Cairo.Gradient grad = null;
switch (GradientType) {
case Type.Vertical:
- grad = new Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Left, bounds.Bottom);
+ grad = new Crow.Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Left, bounds.Bottom);
break;
case Type.Horizontal:
- grad = new Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Top);
+ grad = new Crow.Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Top);
break;
case Type.Oblic:
- grad = new Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
+ grad = new Crow.Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
break;
case Type.Radial:
throw new NotImplementedException ();
using System.Xml.Serialization;
using System.ComponentModel;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
using System.Diagnostics;
using System.Xml.Serialization;
-using Cairo;
+using Crow.Cairo;
using System.ComponentModel;
namespace Crow
RegisterForGraphicUpdate ();
}
- protected override void onDraw (Cairo.Context gr)
+ protected override void onDraw (Crow.Cairo.Context gr)
{
gr.Save ();
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using Cairo;
+using Crow.Cairo;
using System.Xml.Serialization;
namespace Crow
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
-using Cairo;
+using Crow.Cairo;
using System.Diagnostics;
using System.Reflection;
using System.Threading;
using System;
using System.Xml.Serialization;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.ComponentModel;
{
base.onMouseEnter (sender, e);
if (Selectable)
- IFace.MouseCursor = XCursor.Text;
+ IFace.MouseCursor = MouseCursors.Text;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
}
protected override void onFocused (object sender, EventArgs e)
{
using System;
using System.Xml.Serialization;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using Cairo;
+using Crow.Cairo;
using System.Diagnostics;
using System.Xml.Serialization;
using System.ComponentModel;
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using System.Xml.Serialization;
namespace Crow
using System.Xml.Serialization;
using System.ComponentModel;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections;
-using Cairo;
+using Crow.Cairo;
namespace Crow
using System.ComponentModel;
using System.IO;
using System.Text;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Diagnostics;
{
base.onMouseEnter (sender, e);
if ((Parent as GenericStack).Orientation == Orientation.Horizontal)
- IFace.MouseCursor = XCursor.H;
+ IFace.MouseCursor = MouseCursors.H;
else
- IFace.MouseCursor = XCursor.V;
+ IFace.MouseCursor = MouseCursors.V;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- IFace.MouseCursor = XCursor.Default;
+ IFace.backend.SetCursor (MouseCursors.Default);
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
using System.Xml.Serialization;
using System.ComponentModel;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
using System.Linq;
namespace Crow
using System;
using System.Xml.Serialization;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
using System.Diagnostics;
using System.Linq;
using System.IO;
using System.Xml;
using System.Reflection;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using System.Diagnostics;
using System.Xml.Serialization;
using System.Linq;
using System.Text;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
-using Cairo;
+using Crow.Cairo;
using System.Diagnostics;
using Crow.IML;
using System.Threading;
/// <summary>
/// Font being used in many controls, it is defined in the base GraphicObject class.
/// </summary>
- [DesignCategory ("Appearance")][DefaultValue("sans, 10")]
+ [DesignCategory ("Appearance")][DefaultValue("sans, 12")]
public virtual Font Font {
get { return font; }
set {
if (!hoverBorder) {
currentDirection = Direction.None;
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
return;
}
if (currentDirection != lastDir) {
switch (currentDirection) {
case Direction.None:
- otkgw.MouseCursor = XCursor.Default;
+ otkgw.MouseCursor = MouseCursors.Default;
break;
case Direction.N:
- otkgw.MouseCursor = XCursor.V;
+ otkgw.MouseCursor = MouseCursors.V;
break;
case Direction.S:
- otkgw.MouseCursor = XCursor.V;
+ otkgw.MouseCursor = MouseCursors.V;
break;
case Direction.E:
- otkgw.MouseCursor = XCursor.H;
+ otkgw.MouseCursor = MouseCursors.H;
break;
case Direction.W:
- otkgw.MouseCursor = XCursor.H;
+ otkgw.MouseCursor = MouseCursors.H;
break;
case Direction.NW:
- otkgw.MouseCursor = XCursor.NW;
+ otkgw.MouseCursor = MouseCursors.NW;
break;
case Direction.NE:
- otkgw.MouseCursor = XCursor.NE;
+ otkgw.MouseCursor = MouseCursors.NE;
break;
case Direction.SW:
- otkgw.MouseCursor = XCursor.SW;
+ otkgw.MouseCursor = MouseCursors.SW;
break;
case Direction.SE:
- otkgw.MouseCursor = XCursor.SE;
+ otkgw.MouseCursor = MouseCursors.SE;
break;
}
}
{
hoverBorder = false;
currentDirection = Direction.None;
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
}
protected virtual void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
{
protected void butQuitPress (object sender, MouseButtonEventArgs e)
{
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
close ();
}
using System.Linq;
using System.Reflection;
using System.Threading;
-using Cairo;
+using Crow.Cairo;
using Crow.IML;
protected bool running;
protected virtual void InitBackend () {
if (Environment.OSVersion.Platform == PlatformID.Unix)
- backend = new Crow.XCB.XCBBackend();
+ backend = new Crow.XLib.XLibBackend();
else
backend = new Crow.Win32.Win32Backend();
running = true;
- Thread t = new Thread (interfaceThread);
+ /*Thread t = new Thread (interfaceThread);
t.IsBackground = true;
- t.Start ();
+ t.Start ();*/
}
public void Run () {
while (running) {
+ Update ();
ProcessEvents ();
- Thread.Sleep(1);
}
}
public void ProcessKeyPress (char c)
}
#region Mouse and Keyboard Handling
- XCursor cursor = XCursor.Default;
public MouseState Mouse;
- public XCursor MouseCursor {
+ public MouseCursors MouseCursor {
set {
- if (value == cursor)
- return;
- cursor = value;
- MouseCursorChanged.Raise (this,new MouseCursorChangedEventArgs(cursor));
+ backend.SetCursor (value);
}
}
/// <summary>Processes mouse move events from the root container, this function
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum Antialias
using System;
using System.Runtime.InteropServices;
-namespace Cairo
+namespace Crow.Cairo
{
public static class CairoAPI {
static public int Version {
get {
- return Cairo.NativeMethods.cairo_version ();
+ return Crow.Cairo.NativeMethods.cairo_version ();
}
}
static public string VersionString {
get {
- IntPtr x = Cairo.NativeMethods.cairo_version_string ();
+ IntPtr x = Crow.Cairo.NativeMethods.cairo_version_string ();
return Marshal.PtrToStringAnsi (x);
}
}
using System;
-namespace Cairo {
+namespace Crow.Cairo {
static class CairoDebug
{
using System;
-namespace Cairo
+namespace Crow.Cairo
{
//[Flags]
using System.Text;
using Color = Crow.Color;
-namespace Cairo {
+namespace Crow.Cairo {
[Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")]
public class Graphics : Context {
set { NativeMethods.cairo_set_antialias (handle, value); }
}
- public Cairo.Status Status {
+ public Crow.Cairo.Status Status {
get {
return NativeMethods.cairo_status (handle);
}
}
}
- public Cairo.FillRule FillRule {
+ public Crow.Cairo.FillRule FillRule {
set {
NativeMethods.cairo_set_fill_rule (handle, value);
}
}
}
- public Cairo.LineCap LineCap {
+ public Crow.Cairo.LineCap LineCap {
set {
NativeMethods.cairo_set_line_cap (handle, value);
}
}
}
- public Cairo.LineJoin LineJoin {
+ public Crow.Cairo.LineJoin LineJoin {
set {
NativeMethods.cairo_set_line_join (handle, value);
}
public Pattern GetSource ()
{
var ptr = NativeMethods.cairo_get_source (handle);
- return Cairo.Pattern.Lookup (ptr, false);
+ return Crow.Cairo.Pattern.Lookup (ptr, false);
}
public double MiterLimit {
}
[Obsolete ("Use GetTarget/SetTarget")]
- public Cairo.Surface Target {
+ public Crow.Cairo.Surface Target {
set {
if (handle != IntPtr.Zero)
NativeMethods.cairo_destroy (handle);
public FontFace GetContextFontFace ()
{
- return Cairo.FontFace.Lookup (NativeMethods.cairo_get_font_face (handle), false);
+ return Crow.Cairo.FontFace.Lookup (NativeMethods.cairo_get_font_face (handle), false);
}
public void SetContextFontFace (FontFace value)
//
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class DRMDevice : Device
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class DRMSurface : Surface
{
//
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class Device : IDisposable
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class DirectFBSurface : Surface
{
internal DirectFBSurface (IntPtr handle, bool owns) : base (handle, owns)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace Cairo {
+namespace Crow.Cairo {
public struct Distance
{
//
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class EGLDevice : Device
{
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum Extend
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum FillRule
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum Filter
using System;
using System.Runtime.InteropServices;
-namespace Cairo
+namespace Crow.Cairo
{
[StructLayout (LayoutKind.Sequential)]
public struct FontExtents
//
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class FontFace : IDisposable
{
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class FontOptions : IDisposable
{
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum FontSlant
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public enum FontType
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum FontWeight
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum Format
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class GLSurface : Surface
{
public GLSurface (IntPtr ptr, bool own) : base (ptr, own)
{}
- public GLSurface (Device device, Cairo.Content content, uint tex, int width, int height)
+ public GLSurface (Device device, Crow.Cairo.Content content, uint tex, int width, int height)
: base (NativeMethods.cairo_gl_surface_create_for_texture (device.Handle, (uint)content, tex, width, height), true)
{}
//
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class GLXDevice : Device
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class GlitzSurface : Surface
{
internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns)
using System;
using System.Runtime.InteropServices;
-namespace Cairo
+namespace Crow.Cairo
{
[StructLayout(LayoutKind.Sequential)]
public struct Glyph
using System;
using Color = Crow.Color;
-namespace Cairo {
+namespace Crow.Cairo {
public class Gradient : Pattern
{
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum HintMetrics
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum HintStyle
using System;
using System.Runtime.InteropServices;
-namespace Cairo {
+namespace Crow.Cairo {
public class ImageSurface : Surface
{
}
[Obsolete ("Use ImageSurface (byte[] data, Cairo.Format format, int width, int height, int stride)")]
- public ImageSurface (ref byte[] data, Cairo.Format format, int width, int height, int stride)
+ public ImageSurface (ref byte[] data, Crow.Cairo.Format format, int width, int height, int stride)
: this (data, format, width, height, stride)
{
}
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum LineCap
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum LineJoin
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class LinearGradient : Gradient
{
using System;
using System.Runtime.InteropServices;
-namespace Cairo {
+namespace Crow.Cairo {
[StructLayout(LayoutKind.Sequential)]
public class Matrix //: ICloneable
NativeMethods.cairo_matrix_rotate (this, radians);
}
- public Cairo.Status Invert ()
+ public Crow.Cairo.Status Invert ()
{
return NativeMethods.cairo_matrix_invert (this);
}
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class MeshPattern : Pattern
{
using System;
using System.Runtime.InteropServices;
-namespace Cairo
+namespace Crow.Cairo
{
// sort the functions like in the following page so it is easier to find what is missing
// http://cairographics.org/manual/index-all.html
#region Image Surface
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
- internal static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height);
+ internal static extern IntPtr cairo_image_surface_create (Crow.Cairo.Format format, int width, int height);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
- internal static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride);
+ internal static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Crow.Cairo.Format format, int width, int height, int stride);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
- internal static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride);
+ internal static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Crow.Cairo.Format format, int width, int height, int stride);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
internal static extern IntPtr cairo_image_surface_create_from_png (string filename);
internal static extern int cairo_get_dash_count (IntPtr cr);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
- internal static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
+ internal static extern void cairo_set_fill_rule (IntPtr cr, Crow.Cairo.FillRule fill_rule);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
internal static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
internal static extern void cairo_set_miter_limit (IntPtr cr, double limit);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
- internal static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
+ internal static extern void cairo_set_operator (IntPtr cr, Crow.Cairo.Operator op);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
internal static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
#region Surface
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
- internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height);
+ internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Crow.Cairo.Content content, int width, int height);
[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
internal static extern void cairo_surface_destroy (IntPtr surface);
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum Operator
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class PSSurface : Surface
{
using System;
using System.Runtime.InteropServices;
-using Cairo;
+using Crow.Cairo;
-namespace Cairo {
+namespace Crow.Cairo {
public class Path : IDisposable
{
using System;
using System.Collections;
-namespace Cairo {
+namespace Crow.Cairo {
public class Pattern : IDisposable
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public enum PatternType
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class PdfSurface : Surface
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace Cairo {
+namespace Crow.Cairo {
public struct Point
{
public Point (int x, int y)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace Cairo {
+namespace Crow.Cairo {
public struct PointD
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class RadialGradient : Gradient
{
using System;
using System.Runtime.InteropServices;
-namespace Cairo
+namespace Crow.Cairo
{
[StructLayout(LayoutKind.Sequential)]
public struct RectangleList {
using System;
using System.Runtime.InteropServices;
-namespace Cairo {
+namespace Crow.Cairo {
public class ScaledFont : IDisposable
{
using System;
using Color = Crow.Color;
-namespace Cairo {
+namespace Crow.Cairo {
public class SolidPattern : Pattern
{
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum Status
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public enum SubpixelOrder
using System;
using System.Collections;
-namespace Cairo {
+namespace Crow.Cairo {
public class Surface : IDisposable
{
}
[Obsolete ("Use an ImageSurface constructor instead.")]
- public static Cairo.Surface CreateForImage (
- ref byte[] data, Cairo.Format format, int width, int height, int stride)
+ public static Crow.Cairo.Surface CreateForImage (
+ ref byte[] data, Crow.Cairo.Format format, int width, int height, int stride)
{
IntPtr p = NativeMethods.cairo_image_surface_create_for_data (
data, format, width, height, stride);
- return new Cairo.Surface (p, true);
+ return new Crow.Cairo.Surface (p, true);
}
[Obsolete ("Use an ImageSurface constructor instead.")]
- public static Cairo.Surface CreateForImage (
- Cairo.Format format, int width, int height)
+ public static Crow.Cairo.Surface CreateForImage (
+ Crow.Cairo.Format format, int width, int height)
{
IntPtr p = NativeMethods.cairo_image_surface_create (
format, width, height);
- return new Cairo.Surface (p, true);
+ return new Crow.Cairo.Surface (p, true);
}
- public Cairo.Surface CreateSimilar (
- Cairo.Content content, int width, int height)
+ public Crow.Cairo.Surface CreateSimilar (
+ Crow.Cairo.Content content, int width, int height)
{
IntPtr p = NativeMethods.cairo_surface_create_similar (
this.Handle, content, width, height);
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class SurfacePattern : Pattern
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public enum SurfaceType
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class SvgSurface : Surface
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public enum SvgVersion
using System;
using System.Runtime.InteropServices;
-namespace Cairo
+namespace Crow.Cairo
{
[StructLayout (LayoutKind.Sequential)]
public struct TextExtents
//
using System;
-namespace Cairo
+namespace Crow.Cairo
{
public class WGLDevice : Device
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class Win32Surface : Surface
{
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class XcbSurface : Surface
{
internal XcbSurface (IntPtr handle, bool owns) : base (handle, owns)
using System;
-namespace Cairo {
+namespace Crow.Cairo {
public class XlibSurface : Surface
{
using System;
using System.IO;
-using Cairo;
+using Crow.Cairo;
using System.Collections.Generic;
namespace Crow
public double LengthD {
get { return Math.Sqrt (Math.Pow (_x, 2) + Math.Pow (_y, 2)); }
}
- public static implicit operator Cairo.Point(Point p)
+ public static implicit operator Crow.Cairo.Point(Point p)
{
- return new Cairo.Point(p.X, p.Y);
+ return new Crow.Cairo.Point(p.X, p.Y);
}
- public static implicit operator Cairo.PointD(Point p)
+ public static implicit operator Crow.Cairo.PointD(Point p)
{
- return new Cairo.PointD(p.X, p.Y);
+ return new Crow.Cairo.PointD(p.X, p.Y);
}
public static implicit operator Point(int i)
{
using System.Xml.Serialization;
using System.Reflection;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
using System;
using System.IO;
-using Cairo;
+using Crow.Cairo;
namespace Crow
{
namespace Crow
{
+ public enum MouseCursors
+ {
+ Default,
+ Cross,
+ Arrow,
+ Text,
+ SW,
+ SE,
+ NW,
+ NE,
+ N,
+ S,
+ V,
+ H,
+ MaxEnum,
+ }
public interface IBackend
{
void Init(Interface iFace);
void Flush();
void ProcessEvents();
+ void SetCursor (MouseCursors newCur);
+ void SetCursorPosition (int x, int y);
+
bool IsDown (Key key);
bool Shift { get; }
bool Ctrl { get; }
User32.Window.ShowWindow(handle, ShowWindowCommand.Show);
hdc = User32.Window.GetDC(handle);
- iFace.surf = new Cairo.Win32Surface(hdc);
+ iFace.surf = new Crow.Cairo.Win32Surface(hdc);
}
return User32.Window.DefWindowProc(handle, message, wParam, lParam);
}
- }
+ public void SetCursor (MouseCursors newCur)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetCursorPosition (int x, int y)
+ {
+ throw new NotImplementedException ();
+ }
+ }
}
loadCursors ();
- iFace.surf = new Cairo.XcbSurface (conn, win, visual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height);
+ iFace.surf = new Crow.Cairo.XcbSurface (conn, win, visual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height);
}
public void CleanUp ()
return IntPtr.Zero;
}
+ public void SetCursor (MouseCursors newCur)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetCursorPosition (int x, int y)
+ {
+ throw new NotImplementedException ();
+ }
}
}
public class XLibBackend : IBackend
{
#region pinvoke
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern int XInitThreads();
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
internal static extern IntPtr XOpenDisplay(IntPtr displayName);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
internal static extern IntPtr XCloseDisplay(IntPtr disp);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern Int32 XDefaultScreen(IntPtr disp);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XDefaultRootWindow(IntPtr disp);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern UInt32 XDefaultDepth (IntPtr disp, Int32 screen);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XDefaultVisual(IntPtr disp, Int32 screen);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XCreateSimpleWindow(IntPtr disp, IntPtr rootWindow, Int32 x, Int32 y, UInt32 width, UInt32 height,
UInt32 borderWidth, IntPtr border, IntPtr background);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XCreatePixmap(IntPtr disp, IntPtr rootWindow, UInt32 width, UInt32 height, UInt32 depth);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XFreePixmap(IntPtr disp, IntPtr pixmap);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XFree(IntPtr data);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern Int32 XSelectInput(IntPtr disp, IntPtr win, EventMask eventMask);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern Int32 XMapWindow(IntPtr disp, IntPtr win);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern int XPending (IntPtr disp);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XNextEvent(IntPtr disp, ref XEvent xevent);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern Int32 XSync(IntPtr disp, int discard);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern int XConnectionNumber(IntPtr disp);
- [DllImportAttribute("X11")]
+ [DllImport("X11")]
static extern IntPtr XSetErrorHandler(XErrorHandler error_handler);
+ [DllImport ("X11")]
+ static extern int XDefineCursor (IntPtr disp, IntPtr wnd, IntPtr cursor);
+
+ [DllImport ("X11")]
+ static extern uint XWarpPointer (IntPtr disp, IntPtr src_w, IntPtr dest_w, int src_x, int src_y, uint src_width, uint src_height, int dest_x, int dest_y);
+
+ [DllImport ("libXcursor.so.1")]
+ static extern int XcursorGetDefaultSize (IntPtr dpy);
+ [DllImport ("libXcursor.so.1")]
+ static extern string XcursorGetTheme (IntPtr dpy);
+ [DllImport ("libXcursor.so.1")]
+ static extern IntPtr XcursorLibraryLoadImage (string name, string theme, int size);
+ [DllImport ("libXcursor.so.1")]
+ static extern void XcursorImageDestroy (IntPtr image);
+
+ [DllImport ("libXcursor.so.1")]
+ static extern IntPtr XcursorImageLoadCursor (IntPtr dpy, IntPtr image);
#endregion
Interface iFace;
X11Keyboard keyboard;
+ IntPtr [] cursors = new IntPtr [(int)MouseCursors.MaxEnum];
+
#region IBackend implementation
public void Init (Interface _iFace)
keyboard = new Crow.XLib.X11Keyboard (xDisp);
- iFace.surf = new Cairo.XlibSurface (xDisp, xwinHnd, xDefaultVisual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height);
+ iFace.surf = new Crow.Cairo.XlibSurface (xDisp, xwinHnd, xDefaultVisual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height);
errorHnd = new XErrorHandler (HandleError);
XSetErrorHandler (errorHnd);
+
+ loadCursors ();
}
public void CleanUp ()
XCloseDisplay (xDisp);
}
public void Flush () {
- XSync (xDisp, 0);
+ XSync (xDisp, 1);
}
public void ProcessEvents ()
{
throw new NotImplementedException ();
}
}
-
public bool Ctrl {
get {
throw new NotImplementedException ();
}
}
-
public bool Alt {
get {
throw new NotImplementedException ();
}
}
+ public void SetCursor (MouseCursors newCur)
+ {
+ XDefineCursor (xDisp, xwinHnd, cursors[(int)newCur]);
+ XSync (xDisp, 0);
+ }
+ public void SetCursorPosition (int x, int y)
+ {
+ XWarpPointer (xDisp, IntPtr.Zero, xwinHnd, 0, 0, 0, 0, x, y);
+ }
#endregion
+ void loadCursor (MouseCursors id, string name)
+ {
+ IntPtr img = XcursorLibraryLoadImage (name, null, XcursorGetDefaultSize (xDisp));
+ cursors[(int)id] = XcursorImageLoadCursor (xDisp, img);
+ XcursorImageDestroy (img);
+ }
+
+ void loadCursors ()
+ {
+ loadCursor (MouseCursors.Default, "default");
+ loadCursor (MouseCursors.Cross, "cross");
+ loadCursor (MouseCursors.Arrow, "arrow");
+ loadCursor (MouseCursors.Text, "text");
+ loadCursor (MouseCursors.SW, "bottom_left_corner");
+ loadCursor (MouseCursors.SE, "bottom_right_corner");
+ loadCursor (MouseCursors.NW, "top_left_corner");
+ loadCursor (MouseCursors.NE, "top_right_corner");
+ loadCursor (MouseCursors.N, "top_side");
+ loadCursor (MouseCursors.S, "bottom_side");
+ loadCursor (MouseCursors.V, "size_ver");
+ loadCursor (MouseCursors.H, "size_hor");
+ }
+
int HandleError (IntPtr display, ref XErrorEvent error_event)
{
/*if (ErrorExceptions)
Debug.WriteLine ("XERROR {0}", error_event.error_code);
return 0;
}
+
+
}
}
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using System.Linq;
namespace Crow
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Cairo;
+using Crow.Cairo;
#if DEBUG_LOG
namespace Crow
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
//Copyright GPL2
-using Cairo;
+using Crow.Cairo;
namespace Rsvg {
[DllImport("rsvg-2")]
static extern void rsvg_handle_render_cairo_sub(IntPtr raw, IntPtr cr, string id);
- public void RenderCairoSub(Cairo.Context cr, string id) {
+ public void RenderCairoSub(Crow.Cairo.Context cr, string id) {
rsvg_handle_render_cairo_sub(Raw, cr == null ? IntPtr.Zero : cr.Handle, id);
}
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
-using Cairo;
+using Crow.Cairo;
namespace Crow.Coding
{
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections;
-using Cairo;
+using Crow.Cairo;
using System.Text;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public override void onMouseEnter (object sender, MouseMoveEventArgs e)
{
base.onMouseEnter (sender, e);
- IFace.MouseCursor = XCursor.Text;
+ IFace.MouseCursor = MouseCursors.Text;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
using System.Text;
using System.Xml;
using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
namespace Crow.Coding
{
}
- protected override void onDraw (Cairo.Context gr)
+ protected override void onDraw (Crow.Cairo.Context gr)
{
base.onDraw (gr);
double z = zoom / 100.0;
double coteW = 3, coteL = 5;
bool fill = true;
- Cairo.PointD p1 = new Cairo.PointD (hr.X + 0.5, hr.Y - space);
- Cairo.PointD p2 = new Cairo.PointD (hr.Right - 0.5, hr.Y - space);
+ Crow.Cairo.PointD p1 = new Crow.Cairo.PointD (hr.X + 0.5, hr.Y - space);
+ Crow.Cairo.PointD p2 = new Crow.Cairo.PointD (hr.Right - 0.5, hr.Y - space);
if (p1.Y < cb.Top) {
if (hr.Bottom > cb.Bottom - space)
drawCenteredTextLine (gr, p1.Add(p2.Substract(p1).Divide (2)), g.Width.Value.ToString());
}
- p1 = new Cairo.PointD (hr.X - space, hr.Top + 0.5);
- p2 = new Cairo.PointD (hr.X - space, hr.Bottom - 0.5);
+ p1 = new Crow.Cairo.PointD (hr.X - space, hr.Top + 0.5);
+ p2 = new Crow.Cairo.PointD (hr.X - space, hr.Bottom - 0.5);
if (p1.X < cb.Left) {
if (hr.Right > cb.Right - space)
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections;
-using Cairo;
+using Crow.Cairo;
using System.Text;
using System.Collections.Generic;
using System.Text.RegularExpressions;
{
base.onMouseEnter (sender, e);
if (e.X - ScreenCoordinates(Slot).X < leftMargin + ClientRectangle.X)
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
else
- IFace.MouseCursor = XCursor.Text;
+ IFace.MouseCursor = MouseCursors.Text;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
if (!e.Mouse.IsButtonDown (MouseButton.Left)) {
if (mouseLocalPos.X < leftMargin)
- IFace.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = MouseCursors.Default;
else
- IFace.MouseCursor = XCursor.Text;
+ IFace.MouseCursor = MouseCursors.Text;
return;
}
// THE SOFTWARE.
using System;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
namespace Crow.Coding
{
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
namespace Crow.Coding
{
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
-using Cairo;
+using Crow.Cairo;
namespace Crow.Coding
{
{
}
- protected override void onDraw (Cairo.Context gr)
+ protected override void onDraw (Crow.Cairo.Context gr)
{
base.onDraw (gr);
Foreground.SetAsSource (gr);
--- /dev/null
+//
+// AddinInfo.cs
+//
+// Author:
+// Mikayla Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2017 Microsoft Corp.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+using Mono.Addins.Description;
+
+[assembly: Addin (
+ "MDCrow",
+ Namespace = "MonoDevelop",
+ Version = "1.0"
+)]
+
+[assembly: AddinName ("MDCrow")]
+[assembly: AddinCategory ("IDE extensions")]
+[assembly: AddinDescription ("Crow interface designer")]
+[assembly: AddinAuthor ("JP Bruyère")]
+
+[assembly: AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
+[assembly: AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
+//[assembly: AddinDependency ("::Core", "7.0")]
+//[assembly: AddinDependency ("::Ide", "7.0")]
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ExtensionModel>
+ <Extension path = "/MonoDevelop/Ide/DisplayBindings">
+ <DisplayBinding
+ id = "Crow Designer"
+ insertafter ="AssemblyBrowser"
+ class = "MDCrow.CrowDisplayBinding" />
+ </Extension>
+ <Extension path = "/MonoDevelop/Ide/Pads/ProjectPad">
+ <NodeBuilder id = "CrowNodeExtension" class = "MDCrow.CrowNodeExtension"/>
+ </Extension>
+ <Extension path = "/MonoDevelop/Core/MimeTypes">
+ <MimeType id="text/x-crow" _description="Crow interface definition" icon="md-csharp-file" isText="false">
+ <File pattern="*.crow" />
+ </MimeType>
+ <MimeType id="text/x-goml" _description="GOlib interface definition" icon="md-csharp-file" isText="false">
+ <File pattern="*.goml" />
+ </MimeType>
+
+ </Extension>
+<!-- <Extension path = "/MonoDevelop/DesignerSupport/PropertyProviders" extension-nodes="Class">
+ <Class class = "MonoDevelop.GOLib.GOLibItemPropertyProvider"/>
+ </Extension>-->
+</ExtensionModel>
\ No newline at end of file
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>net461</TargetFramework>
+ <ReleaseVersion>0.8.0</ReleaseVersion>
+ </PropertyGroup>
+ <ItemGroup>
+ <Folder Include="src\" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Crow\Crow.csproj" />
+ </ItemGroup>
+ <ItemGroup>
+<!-- <Reference Include="MonoDevelop.Core">
+ <HintPath>..\..\..\..\..\opt\lib\monodevelop\bin\MonoDevelop.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="MonoDevelop.Ide">
+ <HintPath>..\..\..\..\..\opt\lib\monodevelop\bin\MonoDevelop.Ide.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Addins">
+ <HintPath>..\..\..\..\..\opt\lib\monodevelop\bin\Mono.Addins.dll</HintPath>
+ </Reference>
+-->
+<!-- <Reference Include="MonoDevelop.Core" />
+ <Reference Include="MonoDevelop.Ide" />
+ <Reference Include="Mono.Addins" />-->
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="MonoDevelop.Addins" Version="0.4.7" />
+ </ItemGroup>
+</Project>
--- /dev/null
+{
+ "version": 1,
+ "dgSpecHash": "NOLr8yug3fyGzNdtnGuiu+nsOLipm7yDza0aE769gwIvmZfTjFbAmOPxIueJkGAXWMxx8sw4H+nYZROzeSVvUQ==",
+ "success": true
+}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
+ <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
+ <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
+ <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/mnt/devel/gts/crow/MDCrow/obj/project.assets.json</ProjectAssetsFile>
+ <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/jp/.nuget/packages/</NuGetPackageRoot>
+ <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/jp/.nuget/packages/;/usr/share/dotnet/sdk/NuGetFallbackFolder</NuGetPackageFolders>
+ <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
+ <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.7.0</NuGetToolVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+ </PropertyGroup>
+ <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
+ <Import Project="$(NuGetPackageRoot)monodevelop.addins/0.4.7/build/MonoDevelop.Addins.props" Condition="Exists('$(NuGetPackageRoot)monodevelop.addins/0.4.7/build/MonoDevelop.Addins.props')" />
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+ </PropertyGroup>
+ <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
+ <Import Project="$(NuGetPackageRoot)monodevelop.addins/0.4.7/build/MonoDevelop.Addins.targets" Condition="Exists('$(NuGetPackageRoot)monodevelop.addins/0.4.7/build/MonoDevelop.Addins.targets')" />
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+{
+ "version": 3,
+ "targets": {
+ ".NETFramework,Version=v4.6.1": {
+ "MonoDevelop.Addins/0.4.7": {
+ "type": "package",
+ "build": {
+ "build/MonoDevelop.Addins.props": {},
+ "build/MonoDevelop.Addins.targets": {}
+ }
+ },
+ "Crow/1.0.0": {
+ "type": "project",
+ "compile": {
+ "bin/placeholder/Crow.dll": {}
+ },
+ "runtime": {
+ "bin/placeholder/Crow.dll": {}
+ }
+ }
+ }
+ },
+ "libraries": {
+ "MonoDevelop.Addins/0.4.7": {
+ "sha512": "eUqhwtcw224cx8OjkGaCwVsl4UO78X4nE3r1PpQVGaJWopwaUvKbyDfNmGxpDAKO5/+K4v3Dxxuz5zhFpz+6hQ==",
+ "type": "package",
+ "path": "monodevelop.addins/0.4.7",
+ "files": [
+ ".signature.p7s",
+ "build/ICSharpCode.SharpZipLib.dll",
+ "build/Mono.Addins.CecilReflector.dll",
+ "build/Mono.Addins.Setup.dll",
+ "build/Mono.Addins.dll",
+ "build/Mono.Cecil.Mdb.dll",
+ "build/Mono.Cecil.Pdb.dll",
+ "build/Mono.Cecil.Rocks.dll",
+ "build/Mono.Cecil.dll",
+ "build/MonoDevelop.Addins.Tasks.dll",
+ "build/MonoDevelop.Addins.Tasks.pdb",
+ "build/MonoDevelop.Addins.props",
+ "build/MonoDevelop.Addins.targets",
+ "monodevelop.addins.0.4.7.nupkg.sha512",
+ "monodevelop.addins.nuspec"
+ ]
+ },
+ "Crow/1.0.0": {
+ "type": "project",
+ "path": "../Crow/Crow.csproj",
+ "msbuildProject": "../Crow/Crow.csproj"
+ }
+ },
+ "projectFileDependencyGroups": {
+ ".NETFramework,Version=v4.6.1": [
+ "Crow >= 1.0.0",
+ "MonoDevelop.Addins >= 0.4.7"
+ ]
+ },
+ "packageFolders": {
+ "/home/jp/.nuget/packages/": {},
+ "/usr/share/dotnet/sdk/NuGetFallbackFolder": {}
+ },
+ "project": {
+ "version": "1.0.0",
+ "restore": {
+ "projectUniqueName": "/mnt/devel/gts/crow/MDCrow/MDCrow.csproj",
+ "projectName": "MDCrow",
+ "projectPath": "/mnt/devel/gts/crow/MDCrow/MDCrow.csproj",
+ "packagesPath": "/home/jp/.nuget/packages/",
+ "outputPath": "/mnt/devel/gts/crow/MDCrow/obj",
+ "projectStyle": "PackageReference",
+ "fallbackFolders": [
+ "/usr/share/dotnet/sdk/NuGetFallbackFolder"
+ ],
+ "configFilePaths": [
+ "/mnt/devel/gts/crow/.nuget/NuGet.config",
+ "/home/jp/.config/NuGet/NuGet.Config"
+ ],
+ "originalTargetFrameworks": [
+ "net461"
+ ],
+ "sources": {
+ "/mnt/devel/gts/crow-xlib/build/Debug": {},
+ "https://api.nuget.org/v3/index.json": {}
+ },
+ "frameworks": {
+ "net461": {
+ "projectReferences": {
+ "/mnt/devel/gts/crow/Crow/Crow.csproj": {
+ "projectPath": "/mnt/devel/gts/crow/Crow/Crow.csproj"
+ }
+ }
+ }
+ },
+ "warningProperties": {
+ "warnAsError": [
+ "NU1605"
+ ]
+ }
+ },
+ "frameworks": {
+ "net461": {
+ "dependencies": {
+ "MonoDevelop.Addins": {
+ "target": "Package",
+ "version": "[0.4.7, )"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// CrowCanvas.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace MDCrow
+{
+ [System.ComponentModel.Category ("Crow.CrowDesigner")]
+ [System.ComponentModel.ToolboxItem (true)]
+ public class CrowCanvas : Gtk.DrawingArea
+ {
+ DesignInterface iface;
+
+ public CrowCanvas ()
+ {
+ }
+ public override void Dispose ()
+ {
+ base.Dispose ();
+ iface.Dispose ();
+ }
+
+ }
+}
--- /dev/null
+//
+// command.cs
+//
+// Author:
+// jp <>
+//
+// Copyright (c) 2018 jp
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Projects;
+
+
+namespace MDCrow
+{
+ class CrowDisplayBinding : IViewDisplayBinding
+ {
+ bool canHandle = false;
+
+ public string Name {
+ get {
+ return GettextCatalog.GetString ("Crow designer");
+ }
+ }
+ public bool CanUseAsDefault { get { return true; } }
+
+ public bool CanHandle (FilePath fileName, string mimeType, Project ownerProject)
+ {
+ canHandle = mimeType.StartsWith ("text/x-goml", System.StringComparison.OrdinalIgnoreCase) |
+ mimeType.StartsWith ("text/x-crow", System.StringComparison.OrdinalIgnoreCase);
+ return canHandle;
+ }
+
+ ViewContent IViewDisplayBinding.CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ {
+ return new CrowView ();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// CrowView.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Threading.Tasks;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.Gui;
+using Xwt;
+
+namespace MDCrow
+{
+ public class CrowView : ViewContent
+ {
+ CrowCanvas view;
+
+ public override Control Control {
+ get { return view; }
+ }
+
+ public CrowView () {
+ view = new CrowCanvas ();
+
+ }
+
+ string src;
+
+ public override async Task Load (FileOpenInformation fileOpenInformation)
+ {
+ var fileName = fileOpenInformation.FileName;
+ using (Stream stream = File.OpenRead (fileName)) {
+ using (StreamReader sr = new StreamReader (stream)) {
+ src = await sr.ReadToEndAsync ();
+ }
+ }
+
+ ContentName = fileName;
+ this.IsDirty = false;
+ view.SetFocus ();
+ }
+ }
+}
--- /dev/null
+//
+// DesignInterface.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Crow;
+using System.Globalization;
+using System.Threading;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using Crow.Cairo;
+
+namespace MDCrow
+{
+ public class DesignInterface : Interface, IValueChange
+ {
+ #region IValueChange implementation
+ /// <summary>
+ /// Raise to notify that the value of a property has changed, the binding system
+ /// rely mainly on this event. the member name may not be present in the class, this is
+ /// used in **propertyless** bindings, this allow to raise custom named events without needing
+ /// to create an new one in the class or a new property.
+ /// </summary>
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ /// <summary>
+ /// Helper function to raise the value changed event
+ /// </summary>
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ public DesignInterface () : base()
+ {
+ }
+
+ //public ProjectFile ProjFile;
+
+
+
+ public override Widget CreateInstance (string path)
+ {
+ ProjectFile pi;
+
+ if (ProjFile.Project.solution.GetProjectFileFromPath (path, out pi))
+ return CreateITorFromIMLFragment (pi.Source).CreateInstance();
+
+ return null;
+ }
+ public override Stream GetStreamFromPath (string path)
+ {
+ ProjectFile pi;
+ if (ProjFile.Project.solution.GetProjectFileFromPath (path, out pi)) {
+ return new FileStream (pi.AbsolutePath, FileMode.Open);
+ }
+ throw new Exception ($"In Design File not found: {path}");
+ }
+
+ protected override void InitBackend ()
+ {
+ //surf = new Cairo.ImageSurface (Format.Argb32, 100, 100);
+ }
+ public override void ProcessResize (Rectangle bounds)
+ {
+ if (bounds == clientRectangle)
+ return;
+ lock (UpdateMutex) {
+ clientRectangle = bounds;
+ surf.Dispose ();
+ surf = new ImageSurface (Format.Argb32, clientRectangle.Width, clientRectangle.Height);
+
+ foreach (Widget g in GraphicTree)
+ g.RegisterForLayouting (LayoutingType.All);
+
+ RegisterClip (clientRectangle);
+ }
+
+ }
+ public override bool ProcessMouseMove (int x, int y)
+ {
+ int deltaX = x - Mouse.X;
+ int deltaY = y - Mouse.Y;
+ Mouse.X = x;
+ Mouse.Y = y;
+ MouseMoveEventArgs e = new MouseMoveEventArgs (x, y, deltaX, deltaY);
+ e.Mouse = Mouse;
+
+ if (ActiveWidget != null) {
+ //TODO, ensure object is still in the graphic tree
+ //send move evt even if mouse move outside bounds
+ ActiveWidget.onMouseMove (this, e);
+ if (!ActiveWidget.IsDragged)//if active is dragged, process mouse move as it was not visible.
+ return true;
+ }
+
+ if (HoverWidget != null) {
+
+ //check topmost graphicobject first
+ Widget tmp = HoverWidget;
+ Widget topc = null;
+ while (tmp is Widget) {
+ topc = tmp;
+ tmp = tmp.LogicalParent as Widget;
+ }
+ int idxhw = GraphicTree.IndexOf (topc);
+ if (idxhw != 0) {
+ int i = 0;
+ while (i < idxhw) {
+ if (GraphicTree [i].localLogicalParentIsNull) {
+ if (GraphicTree [i].MouseIsIn (e.Position)) {
+ while (HoverWidget != null) {
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ HoverWidget = HoverWidget.LogicalParent as Widget;
+ }
+
+ GraphicTree [i].checkHoverWidget (e);
+ return true;
+ }
+ }
+ i++;
+ }
+ }
+
+ if (HoverWidget.MouseIsIn (e.Position)) {
+ if (!(HoverWidget is TemplatedControl))
+ HoverWidget.checkHoverWidget (e);
+ return true;
+ } else {
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ //seek upward from last focused graph obj's
+ while (HoverWidget.LogicalParent as Widget != null) {
+ HoverWidget = HoverWidget.LogicalParent as Widget;
+ if (HoverWidget.MouseIsIn (e.Position)) {
+ HoverWidget.checkHoverWidget (e);
+ return true;
+ } else
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ }
+ }
+ }
+
+ //top level graphic obj's parsing
+ lock (GraphicTree) {
+ for (int i = 0; i < GraphicTree.Count; i++) {
+ Widget g = GraphicTree [i];
+ if (g.MouseIsIn (e.Position)) {
+ if (!(HoverWidget is TemplatedControl))
+ g.checkHoverWidget (e);
+ if (g is Window)
+ PutOnTop (g);
+ return true;
+ }
+ }
+ }
+ HoverWidget = null;
+ return false;
+ }
+
+ protected override void processLayouting ()
+ {
+ #if MEASURE_TIME
+ layoutingMeasure.StartCycle();
+ #endif
+
+ if (Monitor.TryEnter (LayoutMutex)) {
+ DiscardQueue = new Queue<LayoutingQueueItem> ();
+ LayoutingQueueItem lqi;
+ while (LayoutingQueue.Count > 0) {
+ lqi = LayoutingQueue.Dequeue ();
+ //Console.WriteLine (lqi.ToString ());
+ #if DEBUG_LAYOUTING
+ currentLQI = lqi;
+ curLQIsTries.Add(currentLQI);
+ #endif
+ lqi.ProcessLayouting ();
+ }
+ LayoutingQueue = DiscardQueue;
+ Monitor.Exit (LayoutMutex);
+ DiscardQueue = null;
+ }
+
+ #if MEASURE_TIME
+ layoutingMeasure.StopCycle();
+ #endif
+ }
+ }
+}
+
--- /dev/null
+//
+// MDCrowNodeExtension.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Projects;
+
+namespace MDCrow
+{
+ enum Commands
+ {
+ ShowCrowViewer
+ }
+
+ class CrowNodeExtension : NodeBuilderExtension
+ {
+ public override Type CommandHandlerType {
+ get { return typeof (CrowCommandHandler); }
+ }
+ public override bool CanBuildNode (Type dataType)
+ {
+ return typeof (ProjectFile).IsAssignableFrom (dataType);
+ }
+ public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
+ {
+ ProjectFile pf = dataObject as ProjectFile;
+
+ // string mimeType = DesktopService.GetMimeTypeForUri (pf.FilePath);
+ // if (mimeType.StartsWith ("image/", StringComparison.CurrentCultureIgnoreCase)) {
+ // Image i;
+ // if (pf != null) {
+ // i = Image.FromFile (pf.FilePath);
+ // nodeInfo.Icon = i.Scale (16.0 / i.Width, 16.0 / i.Height);
+ // }
+ // }
+
+ base.BuildNode (treeBuilder, dataObject, nodeInfo);
+ }
+ }
+
+ class CrowCommandHandler : NodeCommandHandler //, IPropertyPadProvider
+ {
+ [CommandHandler (Commands.ShowCrowViewer)]
+ protected void OnShowGOLibViewer ()
+ {
+
+ CrowView view = new CrowView ();
+
+ ProjectFile file = CurrentNode.DataItem as ProjectFile;
+
+ if (file != null)
+ view.Load (file.FilePath);
+
+
+ IdeApp.Workbench.OpenDocument (view, true);
+ //IdeApp.Workbench.Documents.Where (d => d.FileName == file.FilePath);
+ }
+
+ // public override void ActivateItem ()
+ // {
+ // ProjectFile o = this.CurrentNode.DataItem as ProjectFile;
+ //
+ // Ide.Gui.Document[] doc = IdeApp.Workbench.Documents.Where (d => d.FileName == o.FilePath).ToArray();
+ // var tmp = MonoDevelop.Ide.Gui.DisplayBindingService.GetFileViewers (o.FilePath, o.Project).ToList();
+ //
+ // OnShowGOLibViewer ();
+ // }
+
+ // #region IPropertyPadProvider implementation
+ // public object GetActiveComponent ()
+ // {
+ // if (CurrentNodes.Length == 1)
+ // return CurrentNode.DataItem;
+ // else
+ // return null;
+ // }
+ // public object GetProvider ()
+ // {
+ // return null;
+ // }
+ // public void OnEndEditing (object obj)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // public void OnChanged (object obj)
+ // {
+ //
+ // }
+ // #endregion
+ }
+
+ // class GOLibItemPropertyProvider : IPropertyProvider
+ // {
+ // #region IPropertyProvider implementation
+ // public object CreateProvider (object obj)
+ // {
+ // var projectFile = obj as ProjectFile;
+ // return projectFile;
+ // }
+ //
+ // public bool SupportsObject (object obj)
+ // {
+ // return obj is ProjectFile;
+ // }
+ // #endregion
+ // }
+}
// win.Show ();
//app.LoadIMLFragment (@"<SimpleGauge Level='40' Margin='5' Background='Jet' Foreground='Grey' Width='30' Height='50%'/>");
- app.CMDTest = new Command(new Action(() => app.AddWidget (app.instFileDlg.CreateInstance()).DataSource = app)) { Caption = "Test", Icon = new SvgPicture("#Tests.image.blank-file.svg"), CanExecute = true};
+ //app.CMDTest = new Command(new Action(() => app.AddWidget (app.instFileDlg.CreateInstance()).DataSource = app)) { Caption = "Test", Icon = new SvgPicture("#Tests.image.blank-file.svg"), CanExecute = true};
//app.AddWidget (@"Interfaces/Divers/testFocus.crow").DataSource = app;
//app.AddWidget (@"Interfaces/Divers/testMenu.crow").DataSource = app;
//app.AddWidget (@"Interfaces/Divers/testVisibility.crow").DataSource = app;
app.NotifyValueChanged ("TestColor", Color.Red);
else
app.NotifyValueChanged ("TestColor", Color.Blue);*/
-
+
/*#if MEASURE_TIME
foreach (PerformanceMeasure m in app.PerfMeasures)
m.NotifyChanges ();
#endif*/
+ app.Update ();
app.ProcessEvents ();
//Thread.Sleep(1);
}
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Cairo;
+using Crow.Cairo;
using Crow;
namespace Test
// THE SOFTWARE.
using System;
using Crow;
-using Cairo;
+using Crow.Cairo;
namespace Tutorials2
{
using System;
using Crow;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
using System.Diagnostics;
namespace Crow
using System;
using Crow;
using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
namespace Tutorials
{
{
return base.measureRawSize (lt) + 6;
}
- protected override void onDraw (Cairo.Context gr)
+ protected override void onDraw (Crow.Cairo.Context gr)
{
gr.Save ();
gr.Restore ();
}
- void drawTechBorder1 (Cairo.Context gr){
+ void drawTechBorder1 (Crow.Cairo.Context gr){
Rectangle r = ClientRectangle;
double l1 = Math.Round(0.2 * Math.Min (r.Width, r.Height)) + 0.5;
<?xml version="1.0"?>
-<VerticalStack >
- <Label Text="{StringTest}" Background="SeaGreen" DataSourceType="MainClass"/>
-</VerticalStack>
+
+ <Button CornerRadius="0" Background="Red"/>
+