-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
76 lines (60 loc) · 2.25 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows.Forms;
/*
Overview:
CsQuery is used to parse HTML content (TODO: Convert to HtmlParser use only)
UNUSED: ExCSS, AngleSharp code just for reference as CSS parsers
HtmlContent.LoadDocument() - main invocation of HTML layout and
rendered are there
HtmlContent.GetDimensions() - hardcoded window size
BoxTree - lots of unimplemented unmarked stuff
CSS call chain:
class BoxTree
\/ BoxGetStyle() - stub
\/ nscssGetStyle() - stub
\/ CssSelectStyle() - currently implementing
Example of function pointers array: CssParser.ParseFunc
Now working on: class CssProps, implementing initial properties dispatcher
for various needed props
Autogenerated code:
Some code is autogenerated, just like in NetSurf. The code generator
code is located in CodeGeneratos.cs. You have to call it
Useful links:
All possible array init syntices:
https://stackoverflow.com/questions/5678216/all-possible-array-initialization-syntaxes
*/
namespace SkiaSharpOpenGLBenchmark
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// Set the DPI Awareness to Per-Monitor
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDpiAwarenessContext(int value);
private const int DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4;
[MethodImpl(MethodImplOptions.NoInlining)]
public static string GetCurrentMethod()
{
var st = new StackTrace();
var sf = st.GetFrame(1);
return sf.GetMethod().Name;
}
}
}