public override void Run() { ICollection<double> chapters = this.Theory.Chapters; StripCanvasSize scs = this.Manager.GenerateStripCanvasSize (chapters.Count); double dw = scs.CanvasSize.Width; double dh = scs.CanvasSize.Height; using (PdfSurface surface = new PdfSurface (this.Manager.OutputFile, scs.TotalWidth, scs.TotalHeight)) { using (Context ctx = new Context (surface)) { int index = 0x00; IPoint3 p; foreach (double chapter in chapters) { p = scs.GetCanvasOffset (index); ctx.Save (); ctx.Translate (p.X, p.Y); ctx.Rectangle (0.0d, 0.0d, dw, dh); ctx.Stroke (); this.Theory.Time = chapter; CairoEngine engine = new CairoEngine (this.Theory); engine.Context = ctx; engine.Process (); ctx.Restore (); index++; } } } }
public CairoFrameWidget(IDrawTheory theory) { this.engine = new CairoEngine (theory); this.Theory = theory; this.Theory.Changed += HandleChanged; this.CanFocus = true; this.Activate (); foreach (EventType type in theory.GetHookTypes ()) { this.AddEvents ((int)type); } }
public override void Run() { StripCanvasSize scs = this.Manager.GenerateStripCanvasSize (0x01); using (PdfSurface surface = new PdfSurface (this.Manager.OutputFile, scs.TotalWidth, scs.TotalHeight)) { using (Context ctx = new Context (surface)) { IPoint3 p = scs.GetCanvasOffset (0x00); ctx.Save (); ctx.Translate (p.X, p.Y); this.Theory.Time = this.Manager.Time; CairoEngine engine = new CairoEngine (this.Theory); engine.Context = ctx; engine.Process (); ctx.Restore (); } } }