static void RootInvalidateGraphicArea(RenderElement re, ref Rectangle rect)
 {
     //1.
     re.propFlags &= ~RenderElementConst.IS_GRAPHIC_VALID;
     //2.  
     re.rootGfx.InvalidateGraphicArea(re, ref rect);
 }
 public static void InvalidateGraphicLocalArea(RenderElement re, Rectangle localArea)
 {
     if (localArea.Height == 0 || localArea.Width == 0)
     {
         return;
     }
     RootInvalidateGraphicArea(re, ref localArea);
 }
 public void WriteInfo(string info, RenderElement ve)
 {
     ++msgCounter;
     ShouldBreak();
     strmWriter.Write(new string('\t', indentCount));
     strmWriter.Write(info);
     strmWriter.Write(ve.dbug_FullElementDescription());
     strmWriter.Write("\r\n"); strmWriter.Flush();
 }
 public void WriteInfo(RenderElement v, string info, string indentPrefix, string indentPostfix)
 {
     ++msgLineNum;
     ShouldBreak();
     strmWriter.Write(new string('\t', indentCount));
     strmWriter.Write(indentPrefix + indentCount + indentPostfix + info + " ");
     strmWriter.Write(v.dbug_FullElementDescription());
     strmWriter.Write("\r\n"); strmWriter.Flush();
 }
예제 #5
0
 public dbugLayoutMsg(RenderElement ve, string msg)
 {
     this.owner = ve;
     this.msg = msg;
     if (ve == null)
     {
         this.msgOwnerKind = dbugLayoutMsgOwnerKind.Unknown;
     }
     else
     {
         this.msgOwnerKind = dbugLayoutMsgOwnerKind.VisualElement;
     }
 }
 RenderElement IParentLink.FindOverlapedChildElementAtPoint(RenderElement afterThisChild, Point point)
 {
     //called from child node
     if (this._MayHasOverlapChild())
     {
         var child_internalLinkedNode = afterThisChild.internalLinkedNode;
         if (child_internalLinkedNode == null)
         {
             return null;
         }
         var curnode = child_internalLinkedNode.Previous;
         while (curnode != null)
         {
             var element = curnode.Value;
             if (element.Contains(point))
             {
                 return element;
             }
             curnode = curnode.Previous;
         }
     }
     return null;
 }
예제 #7
0
 public override void InsertAfter(RenderElement afterElem, RenderElement renderE)
 {
     _defaultLayer.InsertChildAfter(afterElem, renderE);
 }
예제 #8
0
 public virtual void AddChild(RenderElement renderE)
 {
 }
예제 #9
0
 public abstract void AddToLayoutQueue(RenderElement renderElement);
예제 #10
0
 public void Add(RenderElement ve, string msg)
 {
     this.Add(new dbugLayoutMsg(ve, msg));
 }
예제 #11
0
 void dbugWriteStopGfxBubbleUp(RenderElement fromElement, ref int dbug_ncount, int nleftOnStack, string state_str)
 {
     RootGraphic dbugMyroot = this;
     if (dbugMyroot.dbugEnableGraphicInvalidateTrace && dbugMyroot.dbugGraphicInvalidateTracer != null)
     {
         if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
         {
             state_str = "!!" + state_str;
         }
         dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo(state_str, fromElement);
         while (dbug_ncount > nleftOnStack)
         {
             dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
             dbug_ncount--;
         }
     }
 }
예제 #12
0
        public void dbug_AddDrawElement(RenderElement visualElement, Canvas currentCanvas, string additionalMsg)
        {
            StringBuilder stBuilder = new StringBuilder();
            stBuilder.Append(new string('.', dbug_drawLevel));
            stBuilder.Append("[" + dbug_drawLevel + "] c_" + currentCanvas.debug_canvas_id + " ");
            stBuilder.Append(visualElement.dbug_FullElementDescription());
            Rectangle r = visualElement.dbugGetGlobalRect();
            stBuilder.Append(" global(" + r.X + "," + r.Y + "," + r.Width + "," + r.Height + ")");
            Rectangle currentClipRect = currentCanvas.CurrentClipRect;
            stBuilder.Append(" clip(" + currentClipRect.X +
                "," + currentClipRect.Y + "," + currentClipRect.Width + "," + currentClipRect.Height + ") ");
            if (visualElement.dbugParentVisualElement != null)
            {
                stBuilder.Append(" of " + visualElement.dbugParentVisualElement.dbug_FullElementDescription());
            }

            dbug_rootDrawingMsg.AddLast(new dbugLayoutMsg(visualElement, stBuilder.ToString()));
            if (additionalMsg != null)
            {
                stBuilder.Length = 0; stBuilder.Append(new string('.', dbug_drawLevel));
                stBuilder.Append("[" + dbug_drawLevel + "] c:" + currentCanvas.debug_canvas_id + " ");
                stBuilder.Append(visualElement.dbug_FullElementDescription());
                dbug_rootDrawingMsg.AddLast(new dbugLayoutMsg(visualElement, stBuilder.ToString()));
            }
        }
예제 #13
0
 public static void dbug_EnterReArrangeContent(RenderElement v)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     debugVisualLay.PushVisualElement(v);
     debugVisualLay.WriteInfo(v, "ARR_INNER", ">>", "&");
 }
예제 #14
0
 public override void RemoveChild(RenderElement renderE)
 {
     if (this.defaultLayer != null)
     {
         this.defaultLayer.RemoveChild(renderE);
     }
 }
예제 #15
0
 public override void AddChild(RenderElement renderE)
 {
     if (this.defaultLayer == null)
     {
         this.defaultLayer = new PlainLayer(this);
     }
     this.defaultLayer.AddChild(renderE);
 }
예제 #16
0
 public void dbug_AddDrawElement(RenderElement visualElement, DrawBoard currentCanvas)
 {
     dbug_AddDrawElement(visualElement, currentCanvas, null);
 }
예제 #17
0
 public void AddContent(RenderElement renderElement)
 {
     this.vw.AddContent(renderElement);
 }
예제 #18
0
 public override void RemoveChild(RenderElement renderE)
 {
     _defaultLayer?.RemoveChild(renderE);
 }
예제 #19
0
 public override void InsertBefore(RenderElement beforeElem, RenderElement renderE)
 {
     _defaultLayer.InsertChildBefore(beforeElem, renderE);
 }
예제 #20
0
 public void PushVisualElement(RenderElement v)
 {
     elementStack.Push(v);
     BeginNewContext();
 }
예제 #21
0
 public static void dbug_ExitTopDownReCalculateContent(RenderElement v)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     debugVisualLay.WriteInfo(v, "<<TOPDOWN_RECAL_CONTENT ", "-", "&");
     debugVisualLay.PopVisualElement();
 }
예제 #22
0
 public virtual void RemoveChild(RenderElement renderE)
 {
 }
예제 #23
0
 protected static void debug_PopTopDownElement(RenderElement ve)
 {
 }
예제 #24
0
        public void InvalidateGraphicArea(RenderElement fromElement, ref Rectangle elemClientRect, bool passSourceElem = false)
        {
            //total bounds = total bounds at level

            if (this.IsInRenderPhase)
            {
                return;
            }
            //--------------------------------------
            //bubble up ,find global rect coord
            //and then merge to accumulate rect
            //int globalX = 0;
            //int globalY = 0;


            _hasRenderTreeInvalidateAccumRect = true;//***

            Point globalPoint = new Point();

#if DEBUG
            //if (fromElement.dbug_ObjectNote == "panel")
            //{

            //}

            int dbug_ncount = 0;
            dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> :" + elemClientRect.ToString());
#endif
            do
            {
                if (!fromElement.Visible)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "EARLY-RET: ");
#endif
                    return;
                }
                else if (fromElement.BlockGraphicUpdateBubble)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED2: ");
#endif
                    return;
                }
#if DEBUG
                dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> ");
#endif

                globalPoint.Offset(fromElement.X, fromElement.Y);

                if (fromElement.MayHasViewport && passSourceElem)
                {
                    elemClientRect.Offset(globalPoint);
                    //****
#if DEBUG
                    //TODO: review here
                    if (fromElement.HasDoubleScrollableSurface)
                    {
                        //container.VisualScrollableSurface.WindowRootNotifyInvalidArea(elementClientRect);
                    }
#endif
                    Rectangle elementRect = fromElement.RectBounds;
                    elementRect.Offset(fromElement.ViewportLeft, fromElement.ViewportTop);
                    if (fromElement.NeedClipArea)
                    {
                        elemClientRect.Intersect(elementRect);
                    }

                    globalPoint.X = -fromElement.ViewportLeft; //reset ?
                    globalPoint.Y = -fromElement.ViewportTop;  //reset ?
                }

                if (fromElement.IsTopWindow)
                {
                    break;
                }
                else
                {
#if DEBUG
                    if (fromElement.dbugParentVisualElement == null)
                    {
                        dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED3: ");
                    }
#endif
                    IParentLink parentLink = fromElement.MyParentLink;
                    if (parentLink == null)
                    {
                        return;
                    }
                    parentLink.AdjustLocation(ref globalPoint);
                    //move up
                    fromElement = parentLink.ParentRenderElement;
                    if (fromElement == null)
                    {
                        return;
                    }
                }

                passSourceElem = true;
            } while (true);
#if DEBUG
            var dbugMyroot = this;
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                while (dbug_ncount > 0)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
                    dbug_ncount--;
                }
            }
#endif

            //----------------------------------------

            elemClientRect.Offset(globalPoint);
            if (elemClientRect.Top > this.Height ||
                elemClientRect.Left > this.Width ||
                elemClientRect.Bottom < 0 ||
                elemClientRect.Right < 0)
            {
                //no intersect with

#if DEBUG
                if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                    dbugMyroot.dbugGraphicInvalidateTracer != null)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ZERO-EEX");
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
                }
#endif
                return;
            }
            //--------------------------------------------------------------------------------------------------
            if (!_hasAccumRect)
            {
                _accumulateInvalidRect = elemClientRect;
                _hasAccumRect          = true;
            }
            else
            {
                _accumulateInvalidRect = Rectangle.Union(_accumulateInvalidRect, elemClientRect);
            }

#if DEBUG
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                string state_str = "ACC: ";
                if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
                {
                    state_str = "!!" + state_str;
                }
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ACC: " + _accumulateInvalidRect.ToString());
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
            }
#endif
        }
예제 #25
0
 public void dbug_PushLayoutTraceMessage(dbugVisualRootMsg msg, RenderElement ve)
 {
     if (dbugLastestDebugVisualLay != null)
     {
         dbugLastestDebugVisualLay.WriteInfo(msg.msg, ve);
     }
 }
예제 #26
0
 public abstract void SetCurrentKeyboardFocus(RenderElement renderElement);
예제 #27
0
 public abstract void AddToLayoutQueue(RenderElement renderElement);
예제 #28
0
 public virtual void RemoveChild(RenderElement renderE)
 {
 }
예제 #29
0
 public virtual void InsertAfter(RenderElement afterElem, RenderElement renderE)
 {
     _elements.InsertChildAfter(this, afterElem, renderE);
 }
예제 #30
0
 public virtual void RemoveChild(RenderElement renderE)
 {
     _elements?.RemoveChild(this, renderE);
 }
 static Point GetGlobalLocationStatic(RenderElement re)
 {
     RenderElement parentVisualElement = re.ParentRenderElement;
     if (parentVisualElement != null)
     {
         Point parentGlobalLocation = GetGlobalLocationStatic(parentVisualElement);
         re.parentLink.AdjustLocation(ref parentGlobalLocation);
         if (parentVisualElement.MayHasViewport)
         {
             return new Point(
                 re.b_left + parentGlobalLocation.X - parentVisualElement.ViewportX,
                 re.b_top + parentGlobalLocation.Y - parentVisualElement.ViewportY);
         }
         else
         {
             return new Point(re.b_left + parentGlobalLocation.X, re.b_top + parentGlobalLocation.Y);
         }
     }
     else
     {
         return re.Location;
     }
 }
예제 #32
0
 //
 public override void AddChild(RenderElement renderElement)
 {
     _vw.AddChild(renderElement);
 }
예제 #33
0
 public static void RemoveParentLink(RenderElement childElement)
 {
     childElement.parentLink = null;
 }
예제 #34
0
 public void AddChild(RenderElement renderE)
 {
 }
예제 #35
0
 public virtual void InsertBefore(RenderElement beforeElem, RenderElement renderE)
 {
     _elements.InsertChildBefore(this, beforeElem, renderE);
 }
예제 #36
0
        //==============================================================
        //set location and size , not bubble***

        public static void DirectSetSize(RenderElement visualElement, int width, int height)
        {
            visualElement.b_width  = width;
            visualElement.b_height = height;
        }
예제 #37
0
        public static void DrawChildContent(HitTestHint hitTestHint, IEnumerable <RenderElement> drawingIter, DrawBoard d, UpdateArea updateArea)
        {
            int enter_canvas_x = d.OriginX;
            int enter_canvas_y = d.OriginY;

            switch (hitTestHint)
            {
            default:
            {
                foreach (RenderElement child in drawingIter)
                {
                    if (child.IntersectsWith(updateArea) ||
                        !child.NeedClipArea)
                    {
                        //if the child not need clip
                        //its children (if exist) may intersect
                        int x = child.X;
                        int y = child.Y;

                        d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                        updateArea.Offset(-x, -y);
                        RenderElement.Render(child, d, updateArea);
                        updateArea.Offset(x, y);
                    }
                }

                //restore
                d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y);
            }
            break;

            case HitTestHint.HorizontalRowNonOverlap:
            {
                bool found = false;
                foreach (RenderElement child in drawingIter)
                {
                    if (child.IntersectsWith(updateArea))
                    {
                        found = true;
                        //if the child not need clip
                        //its children (if exist) may intersect
                        int x = child.X;
                        int y = child.Y;

                        d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                        updateArea.Offset(-x, -y);
                        RenderElement.Render(child, d, updateArea);
                        updateArea.Offset(x, y);
                    }
                    else if (found)
                    {
                        break;
                    }
                }

                //restore
                d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y);
            }
            break;

            case HitTestHint.VerticalColumnNonOverlap:
            {
                bool found = false;
                foreach (RenderElement child in drawingIter)
                {
                    if (child.IntersectsWith(updateArea))
                    {
                        found = true;
                        //if the child not need clip
                        //its children (if exist) may intersect
                        int x = child.X;
                        int y = child.Y;

                        d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                        updateArea.Offset(-x, -y);
                        RenderElement.Render(child, d, updateArea);
                        updateArea.Offset(x, y);
                    }
                    else if (found)
                    {
                        break;
                    }
                }
                d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y);
            }
            break;
            }
        }
예제 #38
0
 public static void DirectSetLocation(RenderElement visualElement, int x, int y)
 {
     visualElement.b_left = x;
     visualElement.b_top  = y;
 }
예제 #39
0
 public override void AddChild(RenderElement renderElement, object owner)
 {
     _vw.AddChild(renderElement, owner);
 }
예제 #40
0
 public virtual void AddChild(RenderElement renderE)
 {
 }
예제 #41
0
 //-------------------------------------------------------------------------
 protected static void dbug_EnterTopDownReCalculateContent(RenderElement v)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     debugVisualLay.PushVisualElement(v);
     debugVisualLay.WriteInfo(v, ">>TOPDOWN_RECAL_CONTENT ", "-", "&");
 }
예제 #42
0
파일: dbug.cs 프로젝트: brezza92/PixelFarm
 public void Add(RenderElement ve, string msg)
 {
     this.Add(new dbugLayoutMsg(ve, msg));
 }
예제 #43
0
 public static void dbug_SetInitObject(RenderElement ve)
 {
     dbugInitObject = ve;
 }
예제 #44
0
파일: AppHost.cs 프로젝트: BiDuc/PixelFarm
 //
 public abstract void AddChild(RenderElement renderElement);
예제 #45
0
 public static void dbug_ExitReArrangeContent(RenderElement ve)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     RenderElement v = (RenderElement)debugVisualLay.PeekElement();
     debugVisualLay.WriteInfo(v, "ARR_INNER", "<<", "&");
     debugVisualLay.PopVisualElement();
 }
예제 #46
0
파일: AppHost.cs 프로젝트: BiDuc/PixelFarm
 public abstract void AddChild(RenderElement renderElement, object owner);
예제 #47
0
 public void dbug_AddDrawElement(RenderElement visualElement, Canvas currentCanvas)
 {
     dbug_AddDrawElement(visualElement, currentCanvas, null);
 }
예제 #48
0
        //-------


        public TopWindowEventRoot(RenderElement topRenderElement)
        {
            this.iTopBoxEventPortal  = this.topWinBoxEventPortal = new RenderElementEventPortal(topRenderElement);
            this.rootgfx             = topRenderElement.Root;
            this.hoverMonitoringTask = new UIHoverMonitorTask(OnMouseHover);
        }
예제 #49
0
 public void dbug_PushInvalidateMsg(dbugVisualRootMsg msg, RenderElement ve)
 {
     if (this.dbugEnableGraphicInvalidateTrace && dbugGraphicInvalidateTracer != null)
     {
         dbugGraphicInvalidateTracer.WriteInfo(msg.msg, ve);
     }
 }
예제 #50
0
 public static void AddChild(this RenderElement renderBox, UIElement ui)
 {
     renderBox.AddChild(ui.GetPrimaryRenderElement(renderBox.Root));
 }
예제 #51
0
 public void dbug_LayoutTraceEndContext(dbugVisualRootMsg msg, RenderElement ve)
 {
     if (dbugLastestDebugVisualLay != null)
     {
         dbugLastestDebugVisualLay.WriteInfo(msg.msg, ve);
         dbugLastestDebugVisualLay.EndCurrentContext();
     }
 }
 public void PushVisualElement(RenderElement v)
 {
     elementStack.Push(v);
     BeginNewContext();
 }
예제 #53
0
        public void InvalidateGraphicArea(RenderElement fromElement, ref Rectangle elemClientRect)
        {
            //total bounds = total bounds at level

            if (this.IsInRenderPhase) { return; }
            //--------------------------------------            
            //bubble up ,find global rect coord
            //and then merge to accumulate rect
            //int globalX = 0;
            //int globalY = 0;
            Point globalPoint = new Point();
            bool isBubbleUp = false;
#if DEBUG
            int dbug_ncount = 0;
            dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> :" + elemClientRect.ToString());
#endif
            do
            {
                if (!fromElement.Visible)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "EARLY-RET: ");
#endif
                    return;
                }
                else if (fromElement.BlockGraphicUpdateBubble)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED2: ");
#endif
                    return;
                }
                //--------------------------------------------------------------------- 


#if DEBUG
                dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> ");
#endif

                globalPoint.Offset(fromElement.X, fromElement.Y);
                //globalX += fromElement.BubbleUpX;
                //globalY += fromElement.BubbleUpY;


                if (fromElement.MayHasViewport && isBubbleUp)
                {
                    //elemClientRect.Offset(globalX, globalY);
                    elemClientRect.Offset(globalPoint);
                    if (fromElement.HasDoubleScrollableSurface)
                    {
                        //container.VisualScrollableSurface.WindowRootNotifyInvalidArea(elementClientRect);
                    }

                    Rectangle elementRect = fromElement.RectBounds;
                    elementRect.Offset(fromElement.ViewportX, fromElement.ViewportY);
                    elemClientRect.Intersect(elementRect);
                    globalPoint.X = -fromElement.ViewportX;
                    globalPoint.Y = -fromElement.ViewportY;
                    //globalX = -fromElement.ViewportX;
                    //globalY = -fromElement.ViewportY;
                }

                if (fromElement.IsTopWindow)
                {
                    break;
                }
                else
                {
#if DEBUG
                    if (fromElement.dbugParentVisualElement == null)
                    {
                        dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED3: ");
                    }
#endif

                    var parentLink = fromElement.MyParentLink;
                    if (parentLink == null)
                    {
                        return;
                    }
                    parentLink.AdjustLocation(ref globalPoint);
                    //move up
                    fromElement = parentLink.ParentRenderElement;// fromElement.ParentRenderElement;
                    if (fromElement == null)
                    {
                        return;
                    }
                }

                isBubbleUp = true;
            } while (true);
#if DEBUG
            var dbugMyroot = this;
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace
             && dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                while (dbug_ncount > 0)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
                    dbug_ncount--;
                }
            }
#endif

            //----------------------------------------
            //elemClientRect.Offset(globalX, globalY);
            elemClientRect.Offset(globalPoint);
            if (elemClientRect.Top > this.Height
                || elemClientRect.Left > this.Width
                || elemClientRect.Bottom < 0
                || elemClientRect.Right < 0)
            {
                //no intersect with  

#if DEBUG
                if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                    dbugMyroot.dbugGraphicInvalidateTracer != null)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ZERO-EEX");
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
                }
#endif
                return;
            }
            //--------------------------------------------------------------------------------------------------
            if (!hasAccumRect)
            {
                accumulateInvalidRect = elemClientRect;
                hasAccumRect = true;
            }
            else
            {
                accumulateInvalidRect = Rectangle.Union(accumulateInvalidRect, elemClientRect);
            }

#if DEBUG
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                string state_str = "ACC: ";
                if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
                {
                    state_str = "!!" + state_str;
                }
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ACC: " + accumulateInvalidRect.ToString());
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
            }
#endif

        }
예제 #54
0
 public void AddContent(RenderElement renderElement)
 {
     this.vw.AddContent(renderElement);
 }
예제 #55
0
 public abstract void SetCurrentKeyboardFocus(RenderElement renderElement);
예제 #56
0
 //
 protected static void DirectSetRootGraphics(RenderElement r, RootGraphic rootgfx)
 {
     r._rootGfx = rootgfx;
 }
예제 #57
0
 public static void dbug_SetInitObject(RenderElement ve)
 {
     dbugInitObject = ve;
 }
예제 #58
0
 protected static void debug_PopTopDownElement(RenderElement ve)
 {
 }
예제 #59
0
        //-------


        public TopWindowEventRoot(RenderElement topRenderElement)
        {
            this.iTopBoxEventPortal = this.topWinBoxEventPortal = new RenderElementEventPortal(topRenderElement);
            this.rootgfx = topRenderElement.Root;
            this.hoverMonitoringTask = new UIHoverMonitorTask(OnMouseHover);
        }
예제 #60
0
        public void InvalidateGraphicArea(RenderElement fromElement, ref Rectangle elemClientRect)
        {
            //total bounds = total bounds at level

            if (this.IsInRenderPhase)
            {
                return;
            }
            //--------------------------------------
            //bubble up ,find global rect coord
            //and then merge to accumulate rect
            //int globalX = 0;
            //int globalY = 0;
            Point globalPoint = new Point();

            bool isBubbleUp = false;

#if DEBUG
            int dbug_ncount = 0;
            dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> :" + elemClientRect.ToString());
#endif
            do
            {
                if (!fromElement.Visible)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "EARLY-RET: ");
#endif
                    return;
                }
                else if (fromElement.BlockGraphicUpdateBubble)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED2: ");
#endif
                    return;
                }
                //---------------------------------------------------------------------


#if DEBUG
                dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> ");
#endif

                globalPoint.Offset(fromElement.X, fromElement.Y);
                //globalX += fromElement.BubbleUpX;
                //globalY += fromElement.BubbleUpY;


                if (fromElement.MayHasViewport && isBubbleUp)
                {
                    //elemClientRect.Offset(globalX, globalY);
                    elemClientRect.Offset(globalPoint);

                    if (fromElement.HasDoubleScrollableSurface)
                    {
                        //container.VisualScrollableSurface.WindowRootNotifyInvalidArea(elementClientRect);
                    }

                    Rectangle elementRect = fromElement.RectBounds;
                    elementRect.Offset(fromElement.ViewportX, fromElement.ViewportY);
                    elemClientRect.Intersect(elementRect);

                    globalPoint.X = -fromElement.ViewportX;
                    globalPoint.Y = -fromElement.ViewportY;

                    //globalX = -fromElement.ViewportX;
                    //globalY = -fromElement.ViewportY;
                }

                if (fromElement.IsTopWindow)
                {
                    break;
                }
                else
                {
#if DEBUG
                    if (fromElement.dbugParentVisualElement == null)
                    {
                        dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED3: ");
                    }
#endif

                    var parentLink = fromElement.MyParentLink;
                    if (parentLink == null)
                    {
                        return;
                    }
                    parentLink.AdjustLocation(ref globalPoint);
                    //move up
                    fromElement = parentLink.ParentRenderElement;// fromElement.ParentRenderElement;
                    if (fromElement == null)
                    {
                        return;
                    }
                }

                isBubbleUp = true;
            } while (true);

#if DEBUG
            var dbugMyroot = this;
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                while (dbug_ncount > 0)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
                    dbug_ncount--;
                }
            }
#endif

            //----------------------------------------
            //elemClientRect.Offset(globalX, globalY);
            elemClientRect.Offset(globalPoint);

            if (elemClientRect.Top > this.Height ||
                elemClientRect.Left > this.Width ||
                elemClientRect.Bottom < 0 ||
                elemClientRect.Right < 0)
            {
                //no intersect with

#if DEBUG
                if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                    dbugMyroot.dbugGraphicInvalidateTracer != null)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ZERO-EEX");
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
                }
#endif
                return;
            }
            //--------------------------------------------------------------------------------------------------
            if (!hasAccumRect)
            {
                accumulateInvalidRect = elemClientRect;
                hasAccumRect          = true;
            }
            else
            {
                accumulateInvalidRect = Rectangle.Union(accumulateInvalidRect, elemClientRect);
            }

#if DEBUG
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                string state_str = "ACC: ";
                if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
                {
                    state_str = "!!" + state_str;
                }
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ACC: " + accumulateInvalidRect.ToString());
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
            }
#endif
        }