// ----- 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); }
protected void OnAnchorClickHandler(Utf8Str url) { if (AnchorClicked != null) { AnchorClicked(Utf8Util.Utf8PtrToString(url)); } }
private bool ShouldCreateElement(Utf8Str tag) { if (ShouldCreateElementCallback != null) { return(ShouldCreateElementCallback(Utf8Util.Utf8PtrToString(tag))); } return(false); }
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); }
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); } }
public void SetMasterCSS(string css) { var cssStr = Utf8Util.StringToHGlobalUTF8(css); try { Calls.SetMasterCSS(Calls.ID, cssStr); } finally { #if !AUTO_UTF8 Marshal.FreeHGlobal(cssStr); #endif } }
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!"); } }
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; } }
// ----- 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); }
void SetBaseURLCallback(Utf8Str base_url) { SetBaseURL(Utf8Util.Utf8PtrToString(base_url)); }
void TestCallback(int number, Utf8Str text) { _testText = Utf8Util.Utf8PtrToString(text); _testNumber = number; }
public void TriggerTestCallback(int number, string text) { Calls.TriggerTestCallback(Calls.ID, number, Utf8Util.StringToHGlobalUTF8(text)); }
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); }
private Utf8Str TransformTextCallback(Utf8Str text, text_transform t) { return(Utf8Util.StringToHGlobalUTF8(TransformText(Utf8Util.Utf8PtrToString(text), t))); }
// ----- private void GetImageSizeCallback(Utf8Str image, ref size size) { GetImageSize(Utf8Util.Utf8PtrToString(image), ref size); }
private void SetCursorCallback(Utf8Str cursor) { SetCursor(Utf8Util.Utf8PtrToString(cursor)); }
private int GetTextWidthCallback(Utf8Str text, UIntPtr font) { return(GetTextWidth(Utf8Util.Utf8PtrToString(text), font)); }
private void SetCaptionCallback(Utf8Str caption) { SetCaption(Utf8Util.Utf8PtrToString(caption)); }
private Utf8Str GetDefaultFontNameWrapper() { return(Utf8Util.StringToHGlobalUTF8(GetDefaultFontName())); }
private Utf8Str ImportCssCallback(Utf8Str url, Utf8Str baseurl) { return(Utf8Util.StringToHGlobalUTF8(ImportCss(Utf8Util.Utf8PtrToString(url), Utf8Util.Utf8PtrToString(baseurl)))); }
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)); }