コード例 #1
0
        /// <summary>
        /// Starts the new overflow rule.
        /// </summary>
        /// <param name="overflowType">Overflow type to be applied.</param>
        /// <returns>Next rule reference.</returns>
        public IFluentOverflowSecondRule WithSecondOverflow(OverflowType overflowType)
        {
            this.secondOverflowType = overflowType;
            Dirty();

            return(this);
        }
コード例 #2
0
        protected void SetupOverflowAndScroll(OverflowType overflow, Margin scrollBarMargin,
                                              ScrollType scroll, ScrollBarDisplayType scrollBarDisplay, int flags)
        {
            if (overflow == OverflowType.Hidden)
            {
                container = new Container();
                rootContainer.AddChild(container);
                UpdateMask();
                container.SetXY(_margin.left * GRoot.contentScaleFactor, _margin.top * GRoot.contentScaleFactor);
            }
            else if (overflow == OverflowType.Scroll)
            {
                container = new Container();
                rootContainer.AddChild(container);

                scrollPane = new ScrollPane(this, scroll, _margin, scrollBarMargin, scrollBarDisplay, flags);
            }
            else if (_margin.left != 0 || _margin.top != 0)
            {
                container = new Container();
                rootContainer.AddChild(container);

                container.SetXY(_margin.left * GRoot.contentScaleFactor, _margin.top * GRoot.contentScaleFactor);
            }

            SetBoundsChangedFlag();
        }
コード例 #3
0
 public SegmentLine(SegmentPoint A, SegmentPoint B, OverflowType LeftOverflowAction = OverflowType.AsLine, OverflowType RightOverflowAction = OverflowType.AsLine)
 {
     this.A = A;
     this.B = B;
     this.LOverflowAction = LeftOverflowAction;
     this.ROverflowAction = RightOverflowAction;
     InitParams();
 }
コード例 #4
0
        /// <summary>Recalculates the tab size of a scroll bar.</summary>
        public virtual void RecalculateTab()
        {
            if (ScrollTab == null)
            {
                if (Element.childNodes.Count > 1)
                {
                    Element scrollTab = Element.childNodes[1];

                    if (scrollTab != null)
                    {
                        ScrollTab = ((ScrollTabTag)scrollTab.Handler);
                    }
                }
            }

            if (ScrollTab != null)
            {
                Element target = GetTarget();
                if (target == null)
                {
                    return;
                }
                ComputedStyle computed = target.style.Computed;

                bool         useX         = ScrollTab.UseX();
                OverflowType overflowMode = useX?computed.OverflowX : computed.OverflowY;
                float        visible      = useX?computed.VisiblePercentageX() : computed.VisiblePercentageY();

                if (visible > 1f)
                {
                    visible = 1f;
                }
                else if (visible < 0f)
                {
                    visible = 0f;
                }

                if (overflowMode == OverflowType.Auto)
                {
                    // Handle AUTO here.
                    // Hide the bar by directly setting it's display style if the whole thing is visible - i.e. visible = 1(00%).
                    ComputedStyle barStyle = Element.Style.Computed;
                    if (visible == 1f)
                    {
                        barStyle.DisplayNone();
                    }
                    else if (barStyle.Display == DisplayType.None)
                    {
                        // Make it visible again:
                        barStyle.Display = DisplayType.InlineBlock;
                    }
                }
                ScrollTab.ApplyTabSize(visible);
            }
        }
コード例 #5
0
 public GLoader()
 {
     _playing       = true;
     _url           = "";
     _align         = AlignType.Left;
     _verticalAlign = VertAlignType.Top;
     _overflow      = OverflowType.Visible;
     _jtaDir        = 1;
     _loading       = 0;
     _showErrorSign = true;
 }
コード例 #6
0
        /// <summary>
        /// Performs events calling. The <c>EventArgs.Empty</c> is used as <c>EventArgs</c>.
        /// </summary>
        /// <param name="type"></param>
        protected virtual void OnEvent(OverflowType type)
        {
            DateOverflowEventArgs args = new DateOverflowEventArgs();

            args.Type = type;
            // Event is only performed if any listener is registered
            if (DateOverflowEvent != null)
            {
                DateOverflowEvent(this, args);
            }
        }
コード例 #7
0
        protected void SetupOverflow(OverflowType overflow)
        {
            if (overflow == OverflowType.Hidden)
            {
                container = new Container();
                rootContainer.AddChild(container);
                UpdateClipRect();
                container.SetXY(_margin.left, _margin.top);
            }
            else if (_margin.left != 0 || _margin.top != 0)
            {
                container = new Container();
                rootContainer.AddChild(container);

                container.SetXY(_margin.left, _margin.top);
            }
        }
コード例 #8
0
        protected void SetupOverflow(OverflowType overflow)
        {
            if (overflow == OverflowType.Hidden)
            {
                container = new Container();
                rootContainer.AddChild(container);
                UpdateMask();
                container.SetXY(_margin.left, _margin.top);
            }
            else if (_margin.left != 0 || _margin.top != 0)
            {
                container = new Container();
                rootContainer.AddChild(container);

                container.SetXY(_margin.left, _margin.top);
            }

            SetBoundsChangedFlag();
        }
コード例 #9
0
 public byte GetPixel(int x, int y, OverflowType oType = OverflowType.Ignore)
 {
     if (oType == OverflowType.Ignore)
     {
         if (x < 0 || y < 0)
         {
             return(0);
         }
         else if (x >= Width || y >= Height)
         {
             return(0);
         }
         else
         {
             return(Data[x, y]);
         }
     }
     else if (oType == OverflowType.EdgeExtend)
     {
     }
     return(0);
 }
コード例 #10
0
ファイル: GComponent.cs プロジェクト: qutin/github-kgui-qutin
        public void SetupOverflowAndScroll(OverflowType overflow, Margin margin, ScrollType scroll,
                                           int scrollSpeed, ScrollBarDisplayType scrollBarDisplay)
        {
            _margin = margin;
            if (overflow == OverflowType.Hidden)
            {
                container.clipRect = new Rect(0, 0, _width * GRoot.contentScaleFactor, _height * GRoot.contentScaleFactor);
                if (_scrollPane != null)
                {
                    _scrollPane.Dispose();
                    _scrollPane = null;
                }
                container.x = margin.left * GRoot.contentScaleFactor;
                container.y = margin.top * GRoot.contentScaleFactor;
            }
            else if (overflow == OverflowType.Scroll)
            {
                container.clipRect = null;
                if (_scrollPane == null)
                {
                    _scrollPane = new ScrollPane(this, scroll, margin, scrollSpeed, scrollBarDisplay);
                }
            }
            else
            {
                container.clipRect = null;
                if (_scrollPane != null)
                {
                    _scrollPane.Dispose();
                    _scrollPane = null;
                }
                container.x = margin.left * GRoot.contentScaleFactor;
                container.y = margin.top * GRoot.contentScaleFactor;
            }

            SetBoundsChangedFlag();
        }
コード例 #11
0
        internal void ConstructFromResource(List <GObject> objectPool, int poolIndex)
        {
            if (!packageItem.translated)
            {
                packageItem.translated = true;
                TranslationHelper.TranslateComponent(packageItem);
            }

            ByteBuffer buffer = packageItem.rawData;

            buffer.Seek(0, 0);

            underConstruct = true;

            sourceWidth  = buffer.ReadInt();
            sourceHeight = buffer.ReadInt();
            initWidth    = sourceWidth;
            initHeight   = sourceHeight;

            SetSize(sourceWidth, sourceHeight);

            if (buffer.ReadBool())
            {
                minWidth  = buffer.ReadInt();
                maxWidth  = buffer.ReadInt();
                minHeight = buffer.ReadInt();
                maxHeight = buffer.ReadInt();
            }

            if (buffer.ReadBool())
            {
                float f1 = buffer.ReadFloat();
                float f2 = buffer.ReadFloat();
                SetPivot(f1, f2, buffer.ReadBool());
            }

            if (buffer.ReadBool())
            {
                _margin.top    = buffer.ReadInt();
                _margin.bottom = buffer.ReadInt();
                _margin.left   = buffer.ReadInt();
                _margin.right  = buffer.ReadInt();
            }

            OverflowType overflow = (OverflowType)buffer.ReadByte();

            if (overflow == OverflowType.Scroll)
            {
                int savedPos = buffer.position;
                buffer.Seek(0, 7);
                SetupScroll(buffer);
                buffer.position = savedPos;
            }
            else
            {
                SetupOverflow(overflow);
            }

            if (buffer.ReadBool())             //clipSoftness
            {
                buffer.Skip(8);
            }

            _buildingDisplayList = true;

            buffer.Seek(0, 1);

            int controllerCount = buffer.ReadShort();

            for (int i = 0; i < controllerCount; i++)
            {
                int nextPos = buffer.ReadShort();
                nextPos += buffer.position;

                Controller controller = new Controller();
                _controllers.Add(controller);
                controller.parent = this;
                controller.Setup(buffer);

                buffer.position = nextPos;
            }

            buffer.Seek(0, 2);

            GObject child;
            int     childCount = buffer.ReadShort();

            for (int i = 0; i < childCount; i++)
            {
                int dataLen = buffer.ReadShort();
                int curPos  = buffer.position;

                if (objectPool != null)
                {
                    child = objectPool[poolIndex + i];
                }
                else
                {
                    buffer.Seek(curPos, 0);

                    ObjectType type  = (ObjectType)buffer.ReadByte();
                    string     src   = buffer.ReadS();
                    string     pkgId = buffer.ReadS();

                    PackageItem pi = null;
                    if (src != null)
                    {
                        UIPackage pkg;
                        if (pkgId != null)
                        {
                            pkg = UIPackage.GetById(pkgId);
                        }
                        else
                        {
                            pkg = packageItem.owner;
                        }

                        pi = pkg != null?pkg.GetItem(src) : null;
                    }

                    if (pi != null)
                    {
                        child             = UIObjectFactory.NewObject(pi);
                        child.packageItem = pi;
                        child.ConstructFromResource();
                    }
                    else
                    {
                        child = UIObjectFactory.NewObject(type);
                    }
                }

                child.underConstruct = true;
                child.Setup_BeforeAdd(buffer, curPos);
                child.InternalSetParent(this);
                _children.Add(child);

                buffer.position = curPos + dataLen;
            }

            buffer.Seek(0, 3);
            this.relations.Setup(buffer, true);

            buffer.Seek(0, 2);
            buffer.Skip(2);

            for (int i = 0; i < childCount; i++)
            {
                int nextPos = buffer.ReadShort();
                nextPos += buffer.position;

                buffer.Seek(buffer.position, 3);
                _children[i].relations.Setup(buffer, false);

                buffer.position = nextPos;
            }

            buffer.Seek(0, 2);
            buffer.Skip(2);

            for (int i = 0; i < childCount; i++)
            {
                int nextPos = buffer.ReadShort();
                nextPos += buffer.position;

                child = _children[i];
                child.Setup_AfterAdd(buffer, buffer.position);
                child.underConstruct = false;

                buffer.position = nextPos;
            }

            buffer.Seek(0, 4);

            buffer.Skip(2);             //customData
            this.opaque = buffer.ReadBool();
            int maskId = buffer.ReadShort();

            if (maskId != -1)
            {
                this.mask = GetChildAt(maskId).displayObject;
                buffer.ReadBool();                 //reversedMask
            }
            string hitTestId = buffer.ReadS();

            if (hitTestId != null)
            {
                PackageItem pi = packageItem.owner.GetItem(hitTestId);
                if (pi != null && pi.pixelHitTestData != null)
                {
                    int i1 = buffer.ReadInt();
                    int i2 = buffer.ReadInt();
                    this.rootContainer.hitArea = new PixelHitTest(pi.pixelHitTestData, i1, i2, sourceWidth, sourceHeight);
                }
            }

            buffer.Seek(0, 5);

            int transitionCount = buffer.ReadShort();

            for (int i = 0; i < transitionCount; i++)
            {
                int nextPos = buffer.ReadShort();
                nextPos += buffer.position;

                Transition trans = new Transition(this);
                trans.Setup(buffer);
                _transitions.Add(trans);

                buffer.position = nextPos;
            }

            if (_transitions.Count > 0)
            {
                this.onAddedToStage.Add(__addedToStage);
                this.onRemovedFromStage.Add(__removedFromStage);
            }

            ApplyAllControllers();

            _buildingDisplayList = false;
            underConstruct       = false;

            BuildNativeDisplayList();
            SetBoundsChangedFlag();

            if (packageItem.objectType != ObjectType.Component)
            {
                ConstructExtension(buffer);
            }

            OnConstruct();
        }
コード例 #12
0
        protected void SetupOverflow(OverflowType overflow)
        {
            if (overflow == OverflowType.Hidden)
            {
                container = new Container();
                rootContainer.AddChild(container);
                UpdateClipRect();
                container.SetXY(_margin.left, _margin.top);
            }
            else if (_margin.left != 0 || _margin.top != 0)
            {
                container = new Container();
                rootContainer.AddChild(container);

                container.SetXY(_margin.left, _margin.top);
            }

            SetBoundsChangedFlag();
        }
コード例 #13
0
        override public void Setup_BeforeAdd(XML xml)
        {
            base.Setup_BeforeAdd(xml);

            string str;

            str = (string)xml.GetAttribute("url");
            if (str != null)
            {
                url = str;
            }
            else
            {
                url = "";
            }

            str = (string)xml.GetAttribute("align");
            if (str != null)
            {
                _align = FieldTypes.parseAlign(str);
            }

            str = (string)xml.GetAttribute("vAlign");
            if (str != null)
            {
                _verticalAlign = FieldTypes.parseVerticalAlign(str);
            }

            str = (string)xml.GetAttribute("overflow");
            if (str != null)
            {
                _overflow = FieldTypes.parseOverflowType(str);
            }
            else
            {
                _overflow = OverflowType.Visible;
            }

            _autoSize = (string)xml.GetAttribute("autoSize") == "true";

            str            = (string)xml.GetAttribute("errorSign");
            _showErrorSign = str == "true";

            str = (string)xml.GetAttribute("jtaAction");
            if (str != null)
            {
                _jtaAction = int.Parse(str);
            }
            else
            {
                _jtaAction = 0;
            }

            str = (string)xml.GetAttribute("jtaDir");
            if (str != null)
            {
                _jtaDir = int.Parse(str);
                if (_jtaDir == 0)
                {
                    _jtaDir = 1;
                }
            }
            else
            {
                _jtaDir = 1;
            }
            _playing = (string)xml.GetAttribute("playing") != "false";

            if (_url != null)
            {
                LoadContent();
            }
        }
コード例 #14
0
//--------------------------------------
コード例 #15
0
 private void Log(OverflowType overflowType, UInt64 memStart, UInt64 memEnd, UInt64 size, InstructionDescription insn, IList<UInt64> bt, AnalyzeController ctrl)
 {
     XmlElement root = GenerateNode ("simple_heap_overflow");
     XmlHelper.WriteString (root, "OverflowType", overflowType.ToString());
     XmlHelper.WriteString (root, "MemStart", string.Format ("0x{0:X}", memStart));
     XmlHelper.WriteString (root, "MemEnd", string.Format ("0x{0:X}", memEnd));
     XmlHelper.WriteString (root, "Size", size.ToString());
     XmlHelper.WriteString (root, "At", BuildBacktraceString(bt));
 }
コード例 #16
0
ファイル: GComponent.cs プロジェクト: hxyxj/FairyGUI-unity
        protected void SetupOverflowAndScroll(OverflowType overflow, Margin scrollBarMargin,
			ScrollType scroll, ScrollBarDisplayType scrollBarDisplay, int flags)
        {
            if (overflow == OverflowType.Hidden)
            {
                container = new Container();
                rootContainer.AddChild(container);
                UpdateMask();
                container.SetXY(_margin.left * GRoot.contentScaleFactor, _margin.top * GRoot.contentScaleFactor);
            }
            else if (overflow == OverflowType.Scroll)
            {
                container = new Container();
                rootContainer.AddChild(container);

                scrollPane = new ScrollPane(this, scroll, _margin, scrollBarMargin, scrollBarDisplay, flags);
            }
            else if (_margin.left != 0 || _margin.top != 0)
            {
                container = new Container();
                rootContainer.AddChild(container);

                container.SetXY(_margin.left * GRoot.contentScaleFactor, _margin.top * GRoot.contentScaleFactor);
            }

            SetBoundsChangedFlag();
        }
コード例 #17
0
        /// <summary>
        /// Increment the specified integer counter.
        /// </summary>
        /// <param name="fieldType">Type of the field.</param>
        /// <param name="offset">The offset (bit or ordinal).</param>
        /// <param name="increment">The value to increment.</param>
        /// <param name="offsetIsOrdinal">if set to <c>true</c>, offset is ordinal, so offset=N means the N-th counter of the fieldType size.
        /// If set to <c>false</c>, offset is the bit position, so offset=N means the N-th bit</param>
        /// <param name="overflowType">Overflow handling.</param>
        /// <returns>The previous value.</returns>
        public T BitfieldIncrementBy <T>(BitfieldType fieldType, long offset, T increment, bool offsetIsOrdinal = false, OverflowType overflowType = OverflowType.Wrap)
            where T : struct, IComparable, IComparable <T>, IConvertible, IEquatable <T>, IFormattable
        {
            var db   = GetRedisDb();
            var args = new List <RedisValue>
            {
                "overflow",
                TextAttribute.GetEnumText(overflowType),
                "incrby",
                fieldType.ToString(),
                (offsetIsOrdinal ? "#" : "") + offset,
                Math.Round((decimal)Convert.ChangeType(increment, typeof(decimal)), 0).ToString(CultureInfo.InvariantCulture)
            };
            var results = (RedisResult[])db.ScriptEvaluate(LuaScriptResource.Bitfield, new RedisKey[] { RedisKey }, args.ToArray());

            if (results[0].IsNull)
            {
                throw new OverflowException("The value would overflow the type " + fieldType);
            }
            return((T)Convert.ChangeType((double)results[0], typeof(T)));
        }