コード例 #1
0
 static void RootInvalidateGraphicArea(RenderElement re, ref Rectangle rect)
 {
     //1.
     re.propFlags &= ~RenderElementConst.IS_GRAPHIC_VALID;
     //2.  
     re.rootGfx.InvalidateGraphicArea(re, ref rect);
 }
コード例 #2
0
 public static void InvalidateGraphicLocalArea(RenderElement re, Rectangle localArea)
 {
     if (localArea.Height == 0 || localArea.Width == 0)
     {
         return;
     }
     RootInvalidateGraphicArea(re, ref localArea);
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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
ファイル: dbug.cs プロジェクト: prepare/HTML-Renderer
 public dbugLayoutMsg(RenderElement ve, string msg)
 {
     this.owner = ve;
     this.msg = msg;
     if (ve == null)
     {
         this.msgOwnerKind = dbugLayoutMsgOwnerKind.Unknown;
     }
     else
     {
         this.msgOwnerKind = dbugLayoutMsgOwnerKind.VisualElement;
     }
 }
コード例 #6
0
 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
ファイル: 1_RootGraphic.cs プロジェクト: asmboom/HtmlRenderer
 public abstract void AddToLayoutQueue(RenderElement renderElement);
コード例 #10
0
ファイル: dbug.cs プロジェクト: prepare/HTML-Renderer
 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
ファイル: 1_RootGraphic.cs プロジェクト: BiDuc/PixelFarm
        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
ファイル: 1_RootGraphic.cs プロジェクト: BiDuc/PixelFarm
 public abstract void SetCurrentKeyboardFocus(RenderElement renderElement);
コード例 #27
0
 public abstract void AddToLayoutQueue(RenderElement renderElement);
コード例 #28
0
 public virtual void RemoveChild(RenderElement renderE)
 {
 }
コード例 #29
0
ファイル: RenderBoxBase.cs プロジェクト: brezza92/PixelFarm
 public virtual void InsertAfter(RenderElement afterElem, RenderElement renderE)
 {
     _elements.InsertChildAfter(this, afterElem, renderE);
 }
コード例 #30
0
ファイル: RenderBoxBase.cs プロジェクト: brezza92/PixelFarm
 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
ファイル: RenderBoxBase.cs プロジェクト: brezza92/PixelFarm
 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
ファイル: RenderBoxBase.cs プロジェクト: brezza92/PixelFarm
        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();
     }
 }
コード例 #52
0
 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
ファイル: 1_RootGraphic.cs プロジェクト: asmboom/HtmlRenderer
        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
        }