private DeviceContext(Graphics graphics, ScriptMetricsCache scriptMetricsCache) { this.graphics = graphics; this.scriptMetricsCache = scriptMetricsCache; HDC = graphics != null?graphics.GetHdc() : NativeMethods.GetDC(IntPtr.Zero); }
private DeviceContext(Graphics graphics, ScriptMetricsCache scriptMetricsCache) { this.graphics = graphics; this.scriptMetricsCache = scriptMetricsCache; HDC = graphics != null ? graphics.GetHdc() : NativeMethods.GetDC(IntPtr.Zero); }
public static DeviceContext CreateFromScreen(ScriptMetricsCache scriptMetricsCache) { return(new DeviceContext(null, scriptMetricsCache)); }
public static DeviceContext CreateFromGraphics(Graphics graphics, ScriptMetricsCache scriptMetricsCache) { return(new DeviceContext(graphics, scriptMetricsCache)); }
/// <summary> /// Creates a layout for a document. /// </summary> /// <param name="document">The document.</param> /// <param name="parentControl">The parent control to which embedded objects can /// attach themselves.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="document"/> /// or <paramref name="parentControl"/> is null.</exception> public SplashLayout(SplashDocument document, Control parentControl) { if (document == null) throw new ArgumentNullException("document"); if (parentControl == null) throw new ArgumentNullException("parentControl"); this.document = document; this.parentControl = parentControl; recursionGuard = new RecursionGuard(); scriptMetricsCache = new ScriptMetricsCache(); scriptLineBuffer = new UnmanagedBuffer(InitialCapacityForLinesPerDocument, sizeof(ScriptLine)); tempScriptItemBuffer = new UnmanagedBuffer(InitialCapacityForScriptRunsPerParagraph, sizeof(SCRIPT_ITEM)); tempEmbeddingLevelBuffer = new UnmanagedBuffer(InitialCapacityForScriptRunsPerParagraph, sizeof(byte)); tempVisualToLogicalMapBuffer = new UnmanagedBuffer(InitialCapacityForScriptRunsPerParagraph, sizeof(int)); tempLogicalClustersBuffer = new UnmanagedBuffer(InitialCapacityForCharsPerScriptRun, sizeof(short)); scriptParagraphCache = new ScriptParagraphCache(ScriptParagraphCacheSize); embeddedObjectHosts = new Dictionary<int, EmbeddedObjectHost>(); pendingEmbeddedObjectHostsToCreate = new Queue<EmbeddedObjectHost>(); pendingEmbeddedObjectHostsToShow = new Queue<EmbeddedObjectHost>(); desiredLayoutWidth = 400; // arbitrary desiredLayoutRightToLeft = false; // arbitrary AttachDocumentEvents(); Reset(); }
public static DeviceContext CreateFromScreen(ScriptMetricsCache scriptMetricsCache) { return new DeviceContext(null, scriptMetricsCache); }
public static DeviceContext CreateFromGraphics(Graphics graphics, ScriptMetricsCache scriptMetricsCache) { return new DeviceContext(graphics, scriptMetricsCache); }