public LoaderDelegatePrototype LoadInterfaceDelegate;
#region CTOR
- static Interface(){
+ static Interface(){
Interface.LoadCursors ();
}
public Interface(){
try {
stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId);
} catch{}
- if (stream == null)//try to find ressource in Crow assembly
+ if (stream == null)//try to find ressource in Crow assembly
stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId);
if (stream == null)
throw new Exception ("Resource not found: " + path);
public void Update(){
- if (mouseRepeatCount > 0) {
- int mc = mouseRepeatCount;
- mouseRepeatCount -= mc;
- for (int i = 0; i < mc; i++) {
- FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));
+ lock (Interface.CurrentInterface.RenderMutex) {
+ if (mouseRepeatCount > 0) {
+ int mc = mouseRepeatCount;
+ mouseRepeatCount -= mc;
+ for (int i = 0; i < mc; i++) {
+ FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));
+ }
}
- }
- #if MEASURE_TIME
- layoutTime.Reset ();
- guTime.Reset ();
- drawingTime.Reset ();
- updateTime.Restart ();
- #endif
+ #if MEASURE_TIME
+ layoutTime.Reset ();
+ guTime.Reset ();
+ drawingTime.Reset ();
+ updateTime.Restart ();
+ #endif
+
+ #if MEASURE_TIME
+ layoutTime.Start ();
+ #endif
+ //Debug.WriteLine ("======= Layouting queue start =======");
+ int queueCount = 0;
+ LayoutingQueueItem lqi = null;
- #if MEASURE_TIME
- layoutTime.Start ();
- #endif
- //Debug.WriteLine ("======= Layouting queue start =======");
- int queueCount = 0;
- LayoutingQueueItem lqi = null;
-
- lock (Interface.LayoutingQueue)
- queueCount = Interface.LayoutingQueue.Count;
-
- while (queueCount > 0) {
- lock (Interface.LayoutingQueue)
- lqi = Interface.LayoutingQueue.Dequeue ();
- lqi.ProcessLayouting ();
lock (Interface.LayoutingQueue)
- queueCount = Interface.LayoutingQueue.Count;
- }
+ queueCount = Interface.LayoutingQueue.Count;
+
+ while (queueCount > 0) {
+ lock (Interface.LayoutingQueue)
+ lqi = Interface.LayoutingQueue.Dequeue ();
+ lqi.ProcessLayouting ();
+ lock (Interface.LayoutingQueue)
+ queueCount = Interface.LayoutingQueue.Count;
+ }
- #if MEASURE_TIME
- layoutTime.Stop ();
- #endif
+ #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 = null;
- lock (Interface.CurrentInterface.RenderMutex) {
+ //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 = null;
gotr = new GraphicObject[gobjsToRedraw.Count];
gobjsToRedraw.CopyTo (gotr);
gobjsToRedraw.Clear ();
- }
- foreach (GraphicObject p in gotr) {
- try {
- p.IsQueuedForRedraw = false;
- p.Parent.RegisterClip (p.LastPaintedSlot);
- p.Parent.RegisterClip (p.getSlot());
- } catch (Exception ex) {
- Debug.WriteLine ("Error Register Clip: " + ex.ToString ());
+
+ foreach (GraphicObject p in gotr) {
+ try {
+ p.IsQueuedForRedraw = false;
+ p.Parent.RegisterClip (p.LastPaintedSlot);
+ p.Parent.RegisterClip (p.getSlot());
+ } catch (Exception ex) {
+ Debug.WriteLine ("Error Register Clip: " + ex.ToString ());
+ }
}
- }
- #if MEASURE_TIME
- updateTime.Stop ();
- drawingTime.Start ();
- #endif
+ #if MEASURE_TIME
+ updateTime.Stop ();
+ drawingTime.Start ();
+ #endif
- using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) {
- using (ctx = new Context (surf)){
+ using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) {
+ using (ctx = new Context (surf)){
- if (clipping.count > 0) {
- //Link.draw (ctx);
- clipping.clearAndClip(ctx);
+ if (clipping.count > 0) {
+ //Link.draw (ctx);
+ clipping.clearAndClip(ctx);
- for (int i = GraphicObjects.Count -1; i >= 0 ; i--){
- GraphicObject p = GraphicObjects[i];
- if (!p.Visible)
- continue;
- if (!clipping.intersect (p.Slot))
- continue;
- ctx.Save ();
+ for (int i = GraphicObjects.Count -1; i >= 0 ; i--){
+ GraphicObject p = GraphicObjects[i];
+ if (!p.Visible)
+ continue;
+ if (!clipping.intersect (p.Slot))
+ continue;
+ ctx.Save ();
- p.Paint (ref ctx);
+ p.Paint (ref ctx);
- ctx.Restore ();
- }
+ ctx.Restore ();
+ }
- #if DEBUG_CLIP_RECTANGLE
- clipping.stroke (ctx, Color.Red.AdjustAlpha(0.5));
- #endif
+ #if DEBUG_CLIP_RECTANGLE
+ clipping.stroke (ctx, Color.Red.AdjustAlpha(0.5));
+ #endif
- lock (RenderMutex) {
if (IsDirty)
DirtyRect += clipping.Bounds;
else
DirtyRect.Top = Math.Max (0, DirtyRect.Top);
DirtyRect.Width = Math.Min (ClientRectangle.Width - DirtyRect.Left, DirtyRect.Width);
DirtyRect.Height = Math.Min (ClientRectangle.Height - DirtyRect.Top, DirtyRect.Height);
+
+ clipping.Reset ();
}
- clipping.Reset ();
+ #if MEASURE_TIME
+ drawingTime.Stop ();
+ #endif
+ //surf.WriteToPng (@"/mnt/data/test.png");
}
-
- #if MEASURE_TIME
- drawingTime.Stop ();
- #endif
- //surf.WriteToPng (@"/mnt/data/test.png");
}
- }
// if (ToolTip.isVisible) {
// ToolTip.panel.processkLayouting();
// if (ToolTip.panel.layoutIsValid)
// Debug.WriteLine("UPDATE: {0} ticks \t, {1} ms",
// updateTime.ElapsedTicks,
- // updateTime.ElapsedMilliseconds);
+ // updateTime.ElapsedMilliseconds);
+ }
}
public Rectangles clipping {
get { return _redrawClip; }