示例#1
0
        /// <summary>
        /// Init.
        /// </summary>
        public CssParser(RAdapter adapter)
        {
            ArgChecker.AssertArgNotNull(adapter, "global");

            _valueParser = new CssValueParser(adapter);
            _adapter     = adapter;
        }
示例#2
0
        /// <summary>
        /// Parse the given stylesheet to <see cref="CssData"/> object.<br/>
        /// If <paramref name="combineWithDefault"/> is true the parsed css blocks are added to the
        /// default css data (as defined by W3), merged if class name already exists. If false only the data in the given stylesheet is returned.
        /// </summary>
        /// <seealso cref="http://www.w3.org/TR/CSS21/sample.html"/>
        /// <param name="adapter">Platform adapter</param>
        /// <param name="stylesheet">the stylesheet source to parse</param>
        /// <param name="combineWithDefault">true - combine the parsed css data with default css data, false - return only the parsed css data</param>
        /// <returns>the parsed css data</returns>
        public static CssData Parse(RAdapter adapter, string stylesheet, bool combineWithDefault = true)
        {
            CssParser parser  = new CssParser(adapter);
            var       imports = new List <string>();

            return(parser.ParseStyleSheet(stylesheet, combineWithDefault, ref imports));
        }
示例#3
0
        /// <summary>
        /// Init.
        /// </summary>
        public HtmlContainerInt(RAdapter adapter)
        {
            ArgChecker.AssertArgNotNull(adapter, "global");

            _adapter   = adapter;
            _cssParser = new CssParser(adapter);
        }
 public GraphicsAdapter(RAdapter adapter, RRect initialClip) : base(adapter, initialClip)
 {
     _renderer = SDL2Adapter.Instance.renderer;
     if (_renderer == IntPtr.Zero)
     {
         throw new Exception("Graphics.GraphicsAdapter(): SDL2Adapter.Instance.renderer not set");
     }
 }
            public CssData GetCssData(RAdapter adapter)
            {
                if (Bytes == null)
                {
                    return(null);
                }

                if (m_cssData == null)
                {
                    var css = Encoding.UTF8.GetString(Bytes);
                    m_cssData = CssData.Parse(adapter, css);
                }
                return(m_cssData);
            }
            public RImage GetImage(RAdapter adapter)
            {
                if (Bytes == null)
                {
                    return(null);
                }

                if (m_image == null)
                {
                    using (var ms = new MemoryStream(Bytes))
                    {
                        m_image = adapter.ImageFromStream(ms);
                    }
                }
                return(m_image);
            }
示例#7
0
        /// <summary>
        /// Parse the given stylesheet to <see cref="CssData"/> object.<br/>
        /// If <paramref name="combineWithDefault"/> is true the parsed css blocks are added to the
        /// default css data (as defined by W3), merged if class name already exists. If false only the data in the given stylesheet is returned.
        /// </summary>
        /// <seealso cref="http://www.w3.org/TR/CSS21/sample.html"/>
        /// <param name="adapter">Platform adapter</param>
        /// <param name="stylesheet">the stylesheet source to parse</param>
        /// <param name="combineWithDefault">true - combine the parsed css data with default css data, false - return only the parsed css data</param>
        /// <returns>the parsed css data</returns>
        public static CssData Parse(RAdapter adapter, string stylesheet, bool combineWithDefault = true)
        {
            CssParser parser = new CssParser(adapter);

            return(parser.ParseStyleSheet(stylesheet, combineWithDefault));
        }
示例#8
0
        /// <summary>
        /// Init.
        /// </summary>
        public FontsHandler(RAdapter adapter)
        {
            ArgChecker.AssertArgNotNull(adapter, "global");

            this._adapter = adapter;
        }
 public ControlAdapter(RAdapter adapter, RPoint mouse_location, SDL.SDL_MouseButtonEvent mouse_event) : base(adapter)
 {
     _mouseLocation    = mouse_location;
     _leftMouseButton  = (mouse_event.button & SDL.SDL_BUTTON_LEFT) > 0;
     _rightMouseButton = (mouse_event.button & SDL.SDL_BUTTON_RIGHT) > 0;
 }
 public ControlAdapter(RAdapter adapter, RPoint mouse_location) : base(adapter)
 {
     _mouseLocation = mouse_location;
 }
 public ControlAdapter(RAdapter adapter) : base(adapter)
 {
 }
示例#12
0
        /// <summary>
        /// Init.
        /// </summary>
        public CssValueParser(RAdapter adapter)
        {
            ArgChecker.AssertArgNotNull(adapter, "global");

            this._adapter = adapter;
        }