Example #1
0
        // -----

        private void DrawBackgroundScaled(UIntPtr hdc, Utf8Str image, background_repeat repeat, ref web_color color, ref position pos, ref border_radiuses borderRadiuses, ref position borderBox, bool isRoot)
        {
            pos.Scale(ScaleFactor);
            borderRadiuses.Scale(ScaleFactor);
            borderBox.Scale(ScaleFactor);
            DrawBackground(hdc, Utf8Util.Utf8PtrToString(image), repeat, ref color, ref pos, ref borderRadiuses, ref borderBox, isRoot);
        }
Example #2
0
 protected void OnAnchorClickHandler(Utf8Str url)
 {
     if (AnchorClicked != null)
     {
         AnchorClicked(Utf8Util.Utf8PtrToString(url));
     }
 }
Example #3
0
 private bool ShouldCreateElement(Utf8Str tag)
 {
     if (ShouldCreateElementCallback != null)
     {
         return(ShouldCreateElementCallback(Utf8Util.Utf8PtrToString(tag)));
     }
     return(false);
 }
Example #4
0
 public ElementInfo(ElementInfoStruct raw)
 {
     PosX       = raw.PosX;
     PosY       = raw.PosY;
     Width      = raw.Width;
     Height     = raw.Height;
     Attributes = Utf8Util.Utf8PtrToString(raw.Attributes);
     Text       = Utf8Util.Utf8PtrToString(raw.Text);
 }
Example #5
0
 private int CreateElementWrapper(Utf8Str tag, Utf8Str attributes, [Out, In] ref ElementInfoStruct elementInfo)
 {
     if (CreateElementCallback != null)
     {
         return(CreateElementCallback(Utf8Util.Utf8PtrToString(tag), Utf8Util.Utf8PtrToString(attributes), new ElementInfo(elementInfo)));
     }
     else
     {
         return(0);
     }
 }
Example #6
0
        public void SetMasterCSS(string css)
        {
            var cssStr = Utf8Util.StringToHGlobalUTF8(css);

            try
            {
                Calls.SetMasterCSS(Calls.ID, cssStr);
            }
            finally
            {
#if !AUTO_UTF8
                Marshal.FreeHGlobal(cssStr);
#endif
            }
        }
Example #7
0
        void TestFramework()
        {
            string testStringResult = "Test 1234 ....  \U0001D11E 𝄞 𩸽, ₤ · ₥ · ₦ · ₮ · ₯ · ₹";
            var    input            = Utf8Util.StringToHGlobalUTF8(testStringResult);

            var echoTest = _libInterop.LibEchoTest(input);

            var echoResult = Utf8Util.Utf8PtrToString(echoTest);


            if (testStringResult != echoResult)
            {
                throw new Exception("Utf8 string corrupted through boundary!");
            }

            Document.TriggerTestCallback(50, testStringResult);
            if (_testText != testStringResult || _testNumber != 50)
            {
                throw new Exception("Container instance callback test failed. Something is broken!");
            }
        }
Example #8
0
        public void CreateFromString(string html)
        {
            if (html == null)
            {
                throw new Exception("Cannot render a null string.");
            }
            else
            {
                var htmlStr = Utf8Util.StringToHGlobalUTF8(html);
                try
                {
                    Calls.CreateFromString(Calls.ID, htmlStr);
                }
                finally
                {
#if !AUTO_UTF8
                    Marshal.FreeHGlobal(htmlStr);
#endif
                }
                HasLoadedHtml = true;
            }
        }
Example #9
0
        // -----

        private void DrawTextScaled(Utf8Str text, UIntPtr font, ref web_color color, ref position pos)
        {
            pos.Scale(ScaleFactor);
            DrawText(Utf8Util.Utf8PtrToString(text), font, ref color, ref pos);
        }
Example #10
0
 void SetBaseURLCallback(Utf8Str base_url)
 {
     SetBaseURL(Utf8Util.Utf8PtrToString(base_url));
 }
Example #11
0
 void TestCallback(int number, Utf8Str text)
 {
     _testText   = Utf8Util.Utf8PtrToString(text);
     _testNumber = number;
 }
Example #12
0
 public void TriggerTestCallback(int number, string text)
 {
     Calls.TriggerTestCallback(Calls.ID, number, Utf8Util.StringToHGlobalUTF8(text));
 }
Example #13
0
 private void DrawListMarkerCallback(Utf8Str image, Utf8Str baseURL, list_style_type marker_type, ref web_color color, ref position pos)
 {
     DrawListMarker(Utf8Util.Utf8PtrToString(image), Utf8Util.Utf8PtrToString(baseURL), marker_type, ref color, ref pos);
 }
Example #14
0
 private Utf8Str TransformTextCallback(Utf8Str text, text_transform t)
 {
     return(Utf8Util.StringToHGlobalUTF8(TransformText(Utf8Util.Utf8PtrToString(text), t)));
 }
Example #15
0
        // -----

        private void GetImageSizeCallback(Utf8Str image, ref size size)
        {
            GetImageSize(Utf8Util.Utf8PtrToString(image), ref size);
        }
Example #16
0
 private void SetCursorCallback(Utf8Str cursor)
 {
     SetCursor(Utf8Util.Utf8PtrToString(cursor));
 }
Example #17
0
 private int GetTextWidthCallback(Utf8Str text, UIntPtr font)
 {
     return(GetTextWidth(Utf8Util.Utf8PtrToString(text), font));
 }
Example #18
0
 private void SetCaptionCallback(Utf8Str caption)
 {
     SetCaption(Utf8Util.Utf8PtrToString(caption));
 }
Example #19
0
 private Utf8Str GetDefaultFontNameWrapper()
 {
     return(Utf8Util.StringToHGlobalUTF8(GetDefaultFontName()));
 }
Example #20
0
 private Utf8Str ImportCssCallback(Utf8Str url, Utf8Str baseurl)
 {
     return(Utf8Util.StringToHGlobalUTF8(ImportCss(Utf8Util.Utf8PtrToString(url), Utf8Util.Utf8PtrToString(baseurl))));
 }
Example #21
0
 protected UIntPtr CreateFontWrapper(Utf8Str faceName, int size, int weight, font_style italic, uint decoration, ref font_metrics fm)
 {
     return(CreateFont(Utf8Util.Utf8PtrToString(faceName), size, weight, italic, (font_decoration)decoration, ref fm));
 }