Ejemplo n.º 1
0
        private DeviceContext(Graphics graphics, ScriptMetricsCache scriptMetricsCache)
        {
            this.graphics           = graphics;
            this.scriptMetricsCache = scriptMetricsCache;

            HDC = graphics != null?graphics.GetHdc() : NativeMethods.GetDC(IntPtr.Zero);
        }
Ejemplo n.º 2
0
        private DeviceContext(Graphics graphics, ScriptMetricsCache scriptMetricsCache)
        {
            this.graphics = graphics;
            this.scriptMetricsCache = scriptMetricsCache;

            HDC = graphics != null ? graphics.GetHdc() : NativeMethods.GetDC(IntPtr.Zero);
        }
Ejemplo n.º 3
0
 public static DeviceContext CreateFromScreen(ScriptMetricsCache scriptMetricsCache)
 {
     return(new DeviceContext(null, scriptMetricsCache));
 }
Ejemplo n.º 4
0
 public static DeviceContext CreateFromGraphics(Graphics graphics, ScriptMetricsCache scriptMetricsCache)
 {
     return(new DeviceContext(graphics, scriptMetricsCache));
 }
Ejemplo n.º 5
0
        /// <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();
        }
Ejemplo n.º 6
0
 public static DeviceContext CreateFromScreen(ScriptMetricsCache scriptMetricsCache)
 {
     return new DeviceContext(null, scriptMetricsCache);
 }
Ejemplo n.º 7
0
 public static DeviceContext CreateFromGraphics(Graphics graphics, ScriptMetricsCache scriptMetricsCache)
 {
     return new DeviceContext(graphics, scriptMetricsCache);
 }