public GimpDialog(string title, VariableSet variables) : this(title, title, IntPtr.Zero, 0, Gimp.StandardHelpFunc, title, GimpStock.Reset, (ResponseType)1, Stock.Cancel, ResponseType.Cancel, Stock.Ok, ResponseType.Ok) { Variables = variables; }
public void GetData(VariableSet variables) { var data = ProceduralDb.GetData(_name); if (data != null) { var stream = new MemoryStream(data); variables.ForEach(v => v.Deserialize(_formatter, stream)); } }
public void SetData(VariableSet variables) { var stream = new MemoryStream(); variables.ForEach(v => v.Serialize(_formatter, stream)); if (stream.Length != 0) { ProceduralDb.SetData(_name, stream.GetBuffer()); } }
public GimpDialogWithPreview(string title, Drawable drawable, VariableSet variables, Func <GimpPreview> factory) : base(title, variables) { Drawable = drawable; Vbox = new VBox(false, 0) { BorderWidth = 12 }; VBox.PackStart(Vbox, true, true, 0); Preview = factory(); Preview.Invalidated += delegate { UpdatePreview(Preview); }; Vbox.PackStart(Preview, true, true, 0); variables.ValueChanged += delegate { InvalidatePreview(); }; }
protected static void GimpMain <T>(string[] args, VariableSet variables = null) where T : Plugin, new() { var plugin = new T() { Variables = variables }; Catalog.Init(typeof(T).Name, Gimp.LocaleDirectory); _info.Init = plugin.HasMethod("Init") ? new InitProc(plugin.Init) : null; _info.Quit = plugin.HasMethod("Quit") ? new QuitProc(plugin.Quit) : null; _info.Query = new QueryProc(plugin.Query); _info.Run = new RunProc(plugin.Run); var progargs = new string[args.Length + 1]; progargs[0] = "gimp-sharp"; args.CopyTo(progargs, 1); gimp_main(ref _info, progargs.Length, progargs); }
protected BaseRenderer(VariableSet variables) { Variables = variables; }
public ParamDefList(VariableSet variables) : this() { variables.ForEach(v => Add(new ParamDef(v.Identifier, v.Type, v.Description))); }
public void Register(VariableSet variables) { ValueChanged += delegate { variables.Changed(); }; }