public Typing(Mode mode, Cursor cursor) { switch (mode) { case Mode.typewriter: Type = TypeTypewriter; break; case Mode.keyboard: Type = TypeKeyboard; break; } switch (cursor) { case Cursor.invisible: Out = OutputWithNoCursor; break; case Cursor.visible: Out = OutputWithCursor; break; case Cursor.hangeul: Out = OutputWithCursorOnlyHangeul; break; } }
void XFuncCheckChanged(object sender, EventArgs e) { var rb = sender as RadioButton; if (rb.Checked) { mFunc = (OutputFunc)rb.Tag; StartCurrentSequence(); } }
void AddFunctionRadio(string text, OutputFunc func, ISequence sequence = null) { var r = new RadioButton { Text = text, Tag = func, Checked = (0 == cFuncFlow.Controls.Count), AutoSize = true }; r.CheckedChanged += XFuncCheckChanged; cFuncFlow.Controls.Add(r); mSequenceList.Add(func, sequence); }
// Get the scanline output function for a particular pixel format. private static OutputFunc GetOutputFunc(PixelFormat format) { OutputFunc func = null; switch (format) { case PixelFormat.Format16bppRgb555: { func = new OutputFunc(Rgb555); } break; case PixelFormat.Format16bppRgb565: { func = new OutputFunc(Rgb565); } break; case PixelFormat.Format24bppRgb: { func = new OutputFunc(Rgb24bpp); } break; case PixelFormat.Format32bppRgb: { func = new OutputFunc(Rgb32bpp); } break; case PixelFormat.Format1bppIndexed: { func = new OutputFunc(Indexed1bpp); } break; case PixelFormat.Format4bppIndexed: { func = new OutputFunc(Indexed4bpp); } break; case PixelFormat.Format8bppIndexed: { func = new OutputFunc(Indexed8bpp); } break; case PixelFormat.Format16bppArgb1555: { func = new OutputFunc(RgbAlpha555); } break; case PixelFormat.Format32bppPArgb: case PixelFormat.Format32bppArgb: { func = new OutputFunc(RgbAlpha32bpp); } break; case PixelFormat.Format16bppGrayScale: { func = new OutputFunc(GrayScale16bpp); } break; case PixelFormat.Format48bppRgb: { func = new OutputFunc(Rgb48bpp); } break; case PixelFormat.Format64bppPArgb: case PixelFormat.Format64bppArgb: { func = new OutputFunc(RgbAlpha64bpp); } break; } return(func); }
// Get the scanline output function for a particular pixel format. private static OutputFunc GetOutputFunc(PixelFormat format) { OutputFunc func = null; switch(format) { case PixelFormat.Format16bppRgb555: { func = new OutputFunc(Rgb555); } break; case PixelFormat.Format16bppRgb565: { func = new OutputFunc(Rgb565); } break; case PixelFormat.Format24bppRgb: { func = new OutputFunc(Rgb24bpp); } break; case PixelFormat.Format32bppRgb: { func = new OutputFunc(Rgb32bpp); } break; case PixelFormat.Format1bppIndexed: { func = new OutputFunc(Indexed1bpp); } break; case PixelFormat.Format4bppIndexed: { func = new OutputFunc(Indexed4bpp); } break; case PixelFormat.Format8bppIndexed: { func = new OutputFunc(Indexed8bpp); } break; case PixelFormat.Format16bppArgb1555: { func = new OutputFunc(RgbAlpha555); } break; case PixelFormat.Format32bppPArgb: case PixelFormat.Format32bppArgb: { func = new OutputFunc(RgbAlpha32bpp); } break; case PixelFormat.Format16bppGrayScale: { func = new OutputFunc(GrayScale16bpp); } break; case PixelFormat.Format48bppRgb: { func = new OutputFunc(Rgb48bpp); } break; case PixelFormat.Format64bppPArgb: case PixelFormat.Format64bppArgb: { func = new OutputFunc(RgbAlpha64bpp); } break; } return func; }
private static OutputFunc SetInternalOutputFunc(OutputFunc func, LoggingLevels level) => (message, args) => { if (LoggingLevel >= level) { func(message, args); } };
public static extern void SetErrOutputFunc(IntPtr ctx, OutputFunc pfn, IntPtr writer);