示例#1
0
        public MainWindow(string[] args)
        {
            Glade.XML gxml = new Glade.XML("MainWindow.glade", "EithneWindow");
            gxml.BindFields(this);

            if (EithneWindow.Screen.RgbaColormap != null)
            {
                AlphaChannel          = true;
                EithneWindow.Colormap = EithneWindow.Screen.RgbaColormap;
            }

            EithneWindow.IconList = new Gdk.Pixbuf[2] {
                new Gdk.Pixbuf(null, "icon-48.png"), new Gdk.Pixbuf(null, "icon-16.png")
            };

            EithneWindow.DeleteEvent += OnWindowDelete;

            EithneWindow.Title = About.Name;

            StatusBar.Push(1, String.Format(Catalog.GetString("Welcome to {0}!"), About.Name));

            MenuFileNew.Image              = new Image(null, "document-new.png");
            MenuFileNew.Activated         += OnNew;
            MenuFileOpen.Image             = new Image(null, "document-open.png");
            MenuFileOpen.Activated        += OnLoad;
            MenuFileSave.Image             = new Image(null, "document-save.png");
            MenuFileSave.Activated        += OnSave;
            MenuFileSaveAs.Image           = new Image(null, "document-save-as.png");
            MenuFileSaveAs.Activated      += OnSaveAs;
            MenuFilePrint.Activated       += OnPrint;
            MenuFilePreferences.Image      = new Image(null, "preferences-desktop.png");
            MenuFilePreferences.Activated += delegate(object o, EventArgs eargs) { new Preferences(); };
            MenuFileQuit.Image             = new Image(null, "system-log-out.png");
            MenuFileQuit.Activated        += OnWindowDelete;
            MenuSystemRun.Image            = new Image(null, "media-playback-start.png");
            MenuSystemRun.Activated       += OnRun;
            MenuSystemStop.Image           = new Image(null, "media-playback-stop.png");
            MenuSystemStop.Activated      += OnRun;
            MenuHelpPluginList.Image       = new Image(null, "plugin-16.png");
            MenuHelpPluginList.Activated  += delegate(object o, EventArgs eargs) { new PluginList(); };
            MenuHelpAbout.Image            = new Image(null, "help-browser.png");
            MenuHelpAbout.Activated       += delegate(object o, EventArgs eargs) { new About(); };

            ToolbarNew.IconWidget  = new Image(null, "document-new-22.png");
            ToolbarNew.Clicked    += OnNew;
            ToolbarOpen.IconWidget = new Image(null, "document-open-22.png");
            ToolbarOpen.Clicked   += OnLoad;
            ToolbarSave.IconWidget = new Image(null, "document-save-22.png");
            ToolbarSave.Clicked   += OnSave;
            ToolbarRun.IconWidget  = new Image(null, "media-playback-start-22.png");
            ToolbarRun.Clicked    += OnRun;

            schematic = new Schematic(StatusBar);
            PluginToolboxSocket.AddWithViewport(new PluginToolbox(StatusBar, schematic));
            SchematicSocket.AddWithViewport(schematic);

            engine = new Engine2(schematic, SetRunToStart, progress.Pulse);

            progress.PulseStep = 0.05;
        }
示例#2
0
文件: Engine.cs 项目: zeta1999/eithne
        public EngineThread(Engine2 engine, Block b)
        {
            this.b      = b;
            this.engine = engine;

            b.Working = true;
            MainWindow.RedrawSchematic();

            try
            {
                if (b.Plugin.NumIn != 0)
                {
                    CommSocket cs = new CommSocket(b.Plugin.NumIn);

                    for (int i = 0; i < b.Plugin.NumIn; i++)
                    {
                        Socket other = b.SocketIn[i].Other;

                        if (other.Parent.Plugin.Out == null)
                        {
                            b.Working = false;
                            b         = other.Parent;
                            throw new PluginException(Catalog.GetString("Plugin has no data on output sockets."));
                        }

                        cs[i] = other.Parent.Plugin.Out[other.Num];
                    }

                    b.Plugin.In = cs;
                }

                Plugin = b.Plugin;
                t      = new Thread(ThreadedWork);
                t.Start();
            }
            catch (Exception e)
            {
                engine.Stop();

                b.ShowError = true;
                MainWindow.RedrawSchematic();
                new PluginError(e, b, false);
            }
        }
示例#3
0
 private static void UpdateHandler()
 {
     Block.CheckGConf();
     Schematic.CheckGConf();
     Engine2.CheckGConf();
 }