+++ /dev/null
-<Properties GitUserInfo="UsingGIT" StartupItem="Tests/Tests.csproj">
- <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|Linux_x86" />
- <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/Group.cs">
- <Files>
- <File FileName="src/GraphicObjects/GraphicObject.cs" Line="180" Column="41" />
- <File FileName="src/GraphicObjects/Grid.cs" Line="1" Column="1" />
- <File FileName="src/OpenTKGameWindow.cs" Line="1" Column="1" />
- <File FileName="src/LayoutingQueueItem.cs" Line="1" Column="1" />
- <File FileName="src/GraphicObjects/ILayoutable.cs" Line="1" Column="1" />
- <File FileName="src/GraphicObjects/ComboBox.cs" Line="1" Column="1" />
- <File FileName="src/GraphicObjects/GraduatedSlider.cs" Line="1" Column="1" />
- <File FileName="src/GraphicObjects/Group.cs" Line="1" Column="1" />
- </Files>
- </MonoDevelop.Ide.Workbench>
- <MonoDevelop.Ide.DebuggingService.Breakpoints>
- <BreakpointStore />
- </MonoDevelop.Ide.DebuggingService.Breakpoints>
- <MonoDevelop.Ide.DebuggingService.PinnedWatches>
- <Watch file="../../src/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs" line="1399" offsetX="14" offsetY="23383" expression="ex" liveUpdate="False" />
- <Watch file="src/GraphicObjects/Scroller.cs" line="95" offsetX="527" offsetY="1598" expression="layoutType" liveUpdate="False" />
- <Watch file="src/XCursor.cs" line="49" offsetX="757" offsetY="351" expression="type" liveUpdate="False" />
- <Watch file="src/XCursor.cs" line="50" offsetX="791" offsetY="377" expression="subtype" liveUpdate="False" />
- <Watch file="src/XCursor.cs" line="51" offsetX="812" offsetY="409" expression="pos" liveUpdate="False" />
- <Watch file="src/OpenTKGameWindow.cs" line="234" offsetX="746" offsetY="1618" expression="lqi" liveUpdate="False" />
- <Watch file="src/GraphicObjects/GenericStack.cs" line="171" offsetX="447" offsetY="1717" expression="layoutType" liveUpdate="False" />
- <Watch file="src/GraphicObjects/Combobox.cs" line="97" offsetX="750" offsetY="1303" expression="value" liveUpdate="False" />
- <Watch file="src/Interface.cs" line="217" offsetX="623" offsetY="3315" expression="es" liveUpdate="False" />
- <Watch file="src/Interface.cs" line="217" offsetX="623" offsetY="3339" expression="es.MemberName" liveUpdate="False" />
- <Watch file="src/GraphicObjects/GraphicObject.cs" line="907" offsetX="879" offsetY="9010" expression="targetValue" liveUpdate="False" />
- <Watch file="src/GraphicObjects/GraphicObject.cs" line="815" offsetX="511" offsetY="11050" expression="b.Expression" liveUpdate="False" />
- <Watch file="src/CompilerServices/CompilerServices.cs" line="88" offsetX="630" offsetY="1184" expression="Expression" liveUpdate="False" />
- <Watch file="src/GraphicObjects/GraphicObject.cs" line="394" offsetX="672" offsetY="1844" expression="pi.Name" liveUpdate="False" />
- <Watch file="src/GraphicObjects/GenericStack.cs" line="108" offsetX="495" offsetY="1377" expression="layoutType" liveUpdate="False" />
- <Watch file="src/Colors.cs" line="148" offsetX="367" offsetY="561" expression="R" liveUpdate="False" />
- <Watch file="src/GraphicObjects/GraphicObject.cs" line="522" offsetX="531" offsetY="6462" expression="layoutType" liveUpdate="False" />
- </MonoDevelop.Ide.DebuggingService.PinnedWatches>
- <AuthorInfo Name="Jean-Philippe Bruyère" Email="jp_bruyere@hotmail.com" Copyright="jp" Company="" Trademark="" />
-</Properties>
\ No newline at end of file
b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {
(sender as Border).Foreground = Color.Transparent;
};
- s.addChild (b);
+ s.AddChild (b);
- s.addChild (
+ s.AddChild (
new Label (col.ToString ()){
Bounds=new Rectangle(0,0,-1,-1),
}
void onButClick(object send, MouseButtonEventArgs e)
{
Color col = Color.ColorDic.ToArray () [i];
- HorizontalStack s = colors.addChild (new HorizontalStack () { Fit = true});
+ HorizontalStack s = colors.AddChild (new HorizontalStack () { Fit = true});
s.HorizontalAlignment = HorizontalAlignment.Left;
Border b = new Border () {
Bounds = new Size (32, 20),
b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {
(sender as Border).Foreground = Color.Transparent;
};
- s.addChild (b);
+ s.AddChild (b);
- s.addChild (
+ s.AddChild (
new Label (col.ToString ()){
Bounds=new Rectangle(0,0,-1,-1),
}
lock (mutex) {
if (loadedCols.Count > 50 || allColsLoaded) {
while (loadedCols.Count > 0) {
- colors.addChild (loadedCols[0]);
+ colors.AddChild (loadedCols[0]);
loadedCols.RemoveAt (0);
}
}
string[] testFiles = {
"0.crow",
"testExpandable.goml",
+ "4.crow",
+ "testColorList.crow",
"5.crow",
"testSpinner.goml",
"testScrollbar.goml",
- "4.crow",
- "testColorList.crow",
"testGroupBox.goml",
"testGrid.goml",
"test_Listbox.goml",
fps = (int)RenderFrequency;
- if (frameCpt > 200) {
+ if (frameCpt > 50) {
resetFps ();
frameCpt = 0;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
}
frameCpt++;
}
if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)
return;
while (pendingChildrenAddition.Count > 0) {
- _list.addChild (pendingChildrenAddition.Dequeue ());
+ _list.AddChild (pendingChildrenAddition.Dequeue ());
}
}
}
Orientation _orientation;
#endregion
- public override T addChild<T> (T child)
+ public override T AddChild<T> (T child)
{
- T tmp = base.addChild (child);
+ T tmp = base.AddChild (child);
this.RegisterForLayouting (LayoutingType.PositionChildren);
return tmp;
}
- public override void removeChild (GraphicObject child)
+ public override void RemoveChild (GraphicObject child)
{
- base.removeChild (child);
+ base.RemoveChild (child);
this.RegisterForLayouting (LayoutingType.PositionChildren);
}
int _rowCount;
#endregion
- public override T addChild<T> (T child)
+ public override T AddChild<T> (T child)
{
- T tmp = base.addChild (child);
+ T tmp = base.AddChild (child);
this.RegisterForLayouting (LayoutingType.PositionChildren);
return tmp;
}
- public override void removeChild (GraphicObject child)
+ public override void RemoveChild (GraphicObject child)
{
- base.removeChild (child);
+ base.RemoveChild (child);
this.RegisterForLayouting (LayoutingType.PositionChildren);
}
}
- public virtual T addChild<T>(T child)
+ public virtual T AddChild<T>(T child)
{
GraphicObject g = child as GraphicObject;
- Children.Add(g);
+ children.Add(g);
g.Parent = this as GraphicObject;
g.RegisterForLayouting (LayoutingType.Sizing);
g.LayoutChanged += OnChildLayoutChanges;
return (T)child;
}
- public virtual void removeChild(GraphicObject child)
+ public virtual void RemoveChild(GraphicObject child)
{
child.LayoutChanged -= OnChildLayoutChanges;
child.ClearBinding ();
child.Parent = null;
- Children.Remove(child);
+ children.Remove(child);
this.RegisterForLayouting (LayoutingType.Sizing);
}
public virtual void ClearChildren()
g.LayoutChanged -= OnChildLayoutChanges;
g.ClearBinding ();
g.Parent = null;
- Children.RemoveAt(children.Count-1);
+ children.RemoveAt(children.Count-1);
}
this.RegisterForLayouting (LayoutingType.Sizing);
ChildrenCleared.Raise (this, new EventArgs ());
}
public void putWidgetOnTop(GraphicObject w)
{
- if (Children.Contains(w))
+ if (children.Contains(w))
{
- Children.Remove(w);
- Children.Add(w);
+ children.Remove(w);
+ children.Add(w);
}
}
public void putWidgetOnBottom(GraphicObject w)
{
- if (Children.Contains(w))
+ if (children.Contains(w))
{
- Children.Remove(w);
- Children.Insert(0, w);
+ children.Remove(w);
+ children.Insert(0, w);
}
}
get {
if (!base.DrawingIsValid)
return false;
- foreach (GraphicObject g in Children) {
+ foreach (GraphicObject g in children) {
if (!g.DrawingIsValid)
return false;
}
public override void ResolveBindings ()
{
base.ResolveBindings ();
- foreach (GraphicObject w in Children)
+ foreach (GraphicObject w in children)
w.ResolveBindings ();
}
public override GraphicObject FindByName (string nameToFind)
if (Name == nameToFind)
return this;
- foreach (GraphicObject w in Children) {
+ foreach (GraphicObject w in children) {
GraphicObject r = w.FindByName (nameToFind);
if (r != null)
return r;
}
public override bool Contains (GraphicObject goToFind)
{
- foreach (GraphicObject w in Children) {
+ foreach (GraphicObject w in children) {
if (w == goToFind)
return true;
if (w.Contains (goToFind))
//position smaller objects in group when group size is fit
switch (layoutType) {
case LayoutingType.Width:
- foreach (GraphicObject c in Children) {
+ foreach (GraphicObject c in children) {
if (!c.Visible)
continue;
c.RegisterForLayouting (LayoutingType.X | LayoutingType.Width);
}
break;
case LayoutingType.Height:
- foreach (GraphicObject c in Children) {
+ foreach (GraphicObject c in children) {
if (!c.Visible)
continue;
c.RegisterForLayouting (LayoutingType.Y | LayoutingType.Height); }
{
base.onDraw (gr);
- foreach (GraphicObject g in Children) {
+ foreach (GraphicObject g in children) {
g.Paint (ref gr);
}
}
#if DEBUG_CLIP_RECTANGLE
clip.stroke (gr, Color.Amaranth.AdjustAlpha (0.8));
#endif
- foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+ foreach (GraphicObject c in children.Where(ch=>ch.Visible)) {
Rectangles childClip = clip.intersectingRects (ContextCoordinates(c.Slot));
if (!c.DrawingIsValid || childClip.count > 0)
c.Paint (ref gr, childClip);//, localClip);
HostContainer.hoverWidget = this;
onMouseEnter (this, e);
}
- foreach (GraphicObject g in Children)
+ foreach (GraphicObject g in children)
{
if (g.MouseIsIn(e.Position))
{
throw new Exception ("Crow." + subTree.Name + " type not found");
GraphicObject go = (GraphicObject)Activator.CreateInstance(t);
(go as IXmlSerializable).ReadXml(subTree);
- addChild(go);
+ AddChild(go);
}
}
}
{
base.WriteXml(writer);
- foreach (GraphicObject go in Children)
+ foreach (GraphicObject go in children)
{
writer.WriteStartElement(go.GetType().Name);
(go as IXmlSerializable).WriteXml(writer);
ms.Seek(0,SeekOrigin.Begin);
GraphicObject g = Interface.Load (ms, t);
g.MouseClick += itemClick;
- _list.addChild (g);
+ _list.AddChild (g);
g.DataSource = item;
}
updateTime.Restart ();
#endif
- surf = new ImageSurface(bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height,ClientRectangle.Width*4);
- ctx = new Context(surf);
+ using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) {
+ using (ctx = new Context (surf)){
- GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];
- GraphicObjects.CopyTo (invGOList,0);
- invGOList = invGOList.Reverse ().ToArray ();
+ GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];
+ GraphicObjects.CopyTo (invGOList, 0);
+ invGOList = invGOList.Reverse ().ToArray ();
- #if MEASURE_TIME
- layoutTime.Start ();
- #endif
- //Debug.WriteLine ("======= Layouting queue start =======");
-
- while (Interface.LayoutingQueue.Count > 0) {
- LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();
- lqi.ProcessLayouting ();
- }
-
- #if MEASURE_TIME
- layoutTime.Stop ();
- #endif
-
- //Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-");
- //final redraw clips should be added only when layout is completed among parents,
- //that's why it take place in a second pass
- GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];
- gobjsToRedraw.CopyTo (gotr);
- gobjsToRedraw.Clear ();
- foreach (GraphicObject p in gotr) {
- p.registerClipRect ();
- }
+ #if MEASURE_TIME
+ layoutTime.Start ();
+ #endif
+ //Debug.WriteLine ("======= Layouting queue start =======");
- #if MEASURE_TIME
- updateTime.Stop ();
- drawingTime.Start ();
- #endif
+ while (Interface.LayoutingQueue.Count > 0) {
+ LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();
+ lqi.ProcessLayouting ();
+ }
- lock (redrawClip) {
- if (redrawClip.count > 0) {
- #if DEBUG_CLIP_RECTANGLE
- redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));
+ #if MEASURE_TIME
+ layoutTime.Stop ();
#endif
- redrawClip.clearAndClip (ctx);
- //Link.draw (ctx);
- foreach (GraphicObject p in invGOList) {
- if (p.Visible) {
+ //Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-");
+ //final redraw clips should be added only when layout is completed among parents,
+ //that's why it take place in a second pass
+ GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];
+ gobjsToRedraw.CopyTo (gotr);
+ gobjsToRedraw.Clear ();
+ foreach (GraphicObject p in gotr) {
+ p.registerClipRect ();
+ }
- ctx.Save ();
- if (redrawClip.count > 0) {
- Rectangles clip = redrawClip.intersectingRects (p.Slot);
+ #if MEASURE_TIME
+ updateTime.Stop ();
+ drawingTime.Start ();
+ #endif
- if (clip.count > 0)
- p.Paint (ref ctx, clip);
+ lock (redrawClip) {
+ if (redrawClip.count > 0) {
+ #if DEBUG_CLIP_RECTANGLE
+ redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));
+ #endif
+ redrawClip.clearAndClip (ctx);
+
+ //Link.draw (ctx);
+ foreach (GraphicObject p in invGOList) {
+ if (p.Visible) {
+
+ ctx.Save ();
+ if (redrawClip.count > 0) {
+ Rectangles clip = redrawClip.intersectingRects (p.Slot);
+
+ if (clip.count > 0)
+ p.Paint (ref ctx, clip);
+ }
+ ctx.Restore ();
+ }
}
- ctx.Restore ();
+ ctx.ResetClip ();
+ #if DEBUG_CLIP_RECTANGLE
+ redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));
+ #endif
+ redrawClip.Reset ();
}
}
- ctx.ResetClip ();
- #if DEBUG_CLIP_RECTANGLE
- redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));
+ #if MEASURE_TIME
+ drawingTime.Stop ();
#endif
- redrawClip.Reset ();
+ //surf.WriteToPng (@"/mnt/data/test.png");
}
}
- #if MEASURE_TIME
- drawingTime.Stop ();
- #endif
- //surf.WriteToPng (@"/mnt/data/test.png");
- ctx.Dispose ();
- surf.Dispose ();
// if (ToolTip.isVisible) {
// ToolTip.panel.processkLayouting();
// if (ToolTip.panel.layoutIsValid)