예제 #1
0
        public DialogHandlers(MainWindow window)
        {
            main_window = window;

            PintaCore.Actions.File.New.Activated += HandlePintaCoreActionsFileNewActivated;
            PintaCore.Actions.Image.Resize.Activated += HandlePintaCoreActionsImageResizeActivated;
            PintaCore.Actions.Image.CanvasSize.Activated += HandlePintaCoreActionsImageCanvasSizeActivated;
            PintaCore.Actions.Layers.Properties.Activated += HandlePintaCoreActionsLayersPropertiesActivated;
        }
예제 #2
0
파일: Main.cs 프로젝트: xxgreg/Pinta
        public static void Main(string[] args)
        {
            int threads = -1;

            var p = new OptionSet () {
                { "rt|render-threads=", "number of threads to use for rendering", (int v) => threads = v }
            };

            List<string> extra;

            try {
                extra = p.Parse (args);
            } catch (OptionException e) {
                Console.Write ("Pinta: ");
                Console.WriteLine (e.Message);
                return;
            }

            Application.Init ();
            MainWindow win = new MainWindow ();
            win.Show ();

            if (threads != -1)
                Pinta.Core.PintaCore.System.RenderThreads = threads;

            if (extra.Count > 0) {
                // Not sure what this does for Mac, so I'm not touching it
                if (Platform.GetOS () == Platform.OS.Mac) {
                    string arg = args[0];

                    if (args[0].StartsWith ("-psn_")) {
                        if (args.Length > 1)
                            arg = args[1];
                        else
                            arg = null;
                    }

                    if (arg != null && arg != "")
                        Pinta.Core.PintaCore.Actions.File.OpenFile (arg);
                } else {
                    Pinta.Core.PintaCore.Actions.File.OpenFile (extra[0]);
                }
            }

            Application.Run ();
        }
예제 #3
0
        public DialogHandlers(MainWindow window)
        {
            main_window = window;

            PintaCore.Actions.File.New.Activated += HandlePintaCoreActionsFileNewActivated;
            PintaCore.Actions.Image.Resize.Activated += HandlePintaCoreActionsImageResizeActivated;
            PintaCore.Actions.Image.CanvasSize.Activated += HandlePintaCoreActionsImageCanvasSizeActivated;
            PintaCore.Actions.Layers.Properties.Activated += HandlePintaCoreActionsLayersPropertiesActivated;
            PintaCore.Actions.Adjustments.BrightnessContrast.Activated += HandleAdjustmentsBrightnessContrastActivated;
            PintaCore.Actions.Adjustments.Curves.Activated += HandleAdjustmentsCurvesActivated;
            PintaCore.Actions.Adjustments.Posterize.Activated += HandleAdjustmentsPosterizeActivated;
            PintaCore.Actions.Adjustments.HueSaturation.Activated += HandleAdjustmentsHueSaturationActivated;
            PintaCore.Actions.Effects.InkSketch.Activated += HandleEffectInkSketchActivated;
            PintaCore.Actions.Effects.OilPainting.Activated += HandleEffectOilPaintingActivated;
            PintaCore.Actions.Effects.PencilSketch.Activated += HandleEffectPencilSketchActivated;
            PintaCore.Actions.Effects.GaussianBlur.Activated += HandleEffectGaussianBlurActivated;
            PintaCore.Actions.Effects.Glow.Activated += HandleEffectGlowActivated;
        }
예제 #4
0
        public DialogHandlers(MainWindow window)
        {
            main_window = window;

            PintaCore.Actions.File.New.Activated += HandlePintaCoreActionsFileNewActivated;
            PintaCore.Actions.File.NewScreenshot.Activated += HandlePintaCoreActionsFileNewScreenshotActivated;
            PintaCore.Actions.File.ModifyCompression += new EventHandler<ModifyCompressionEventArgs> (FileActions_ModifyCompression);

            PintaCore.Actions.Edit.ResizePalette.Activated += HandlePintaCoreActionsEditResizePaletteActivated;

            PintaCore.Actions.Image.Resize.Activated += HandlePintaCoreActionsImageResizeActivated;
            PintaCore.Actions.Image.CanvasSize.Activated += HandlePintaCoreActionsImageCanvasSizeActivated;

            PintaCore.Actions.Layers.Properties.Activated += HandlePintaCoreActionsLayersPropertiesActivated;

            PintaCore.Actions.View.Rulers.Toggled += HandlePintaCoreActionsViewRulersToggled;
            PintaCore.Actions.View.Pixels.Activated += HandlePixelsActivated;
            PintaCore.Actions.View.Inches.Activated += HandleInchesActivated;
            PintaCore.Actions.View.Centimeters.Activated += HandleCentimetersActivated;
            PintaCore.Actions.View.UnitComboBox.ComboBox.Changed += HandleUnitComboBoxComboBoxChanged;
        }
예제 #5
0
        public DialogHandlers(MainWindow window)
        {
            main_window = window;

            PintaCore.Actions.File.New.Activated += HandlePintaCoreActionsFileNewActivated;
            PintaCore.Actions.File.NewScreenshot.Activated += HandlePintaCoreActionsFileNewScreenshotActivated;
            PintaCore.Actions.File.ModifyCompression += new EventHandler<ModifyCompressionEventArgs> (FileActions_ModifyCompression);
            PintaCore.Actions.File.Open.Activated += HandlePintaCoreActionsFileOpenActivated;
            (PintaCore.Actions.File.OpenRecent as RecentAction).ItemActivated += HandleOpenRecentItemActivated;
            PintaCore.Actions.File.Save.Activated += HandlePintaCoreActionsFileSaveActivated;
            PintaCore.Actions.File.SaveAs.Activated += HandlePintaCoreActionsFileSaveAsActivated;

            PintaCore.Actions.File.Close.Activated += HandlePintaCoreActionsFileCloseActivated;

            PintaCore.Actions.Edit.PasteIntoNewLayer.Activated += HandlerPintaCoreActionsEditPasteIntoNewLayerActivated;
            PintaCore.Actions.Edit.PasteIntoNewImage.Activated += HandlerPintaCoreActionsEditPasteIntoNewImageActivated;
            PintaCore.Actions.Edit.ResizePalette.Activated += HandlePintaCoreActionsEditResizePaletteActivated;

            PintaCore.Actions.Image.Resize.Activated += HandlePintaCoreActionsImageResizeActivated;
            PintaCore.Actions.Image.CanvasSize.Activated += HandlePintaCoreActionsImageCanvasSizeActivated;

            PintaCore.Actions.Layers.Properties.Activated += HandlePintaCoreActionsLayersPropertiesActivated;

            PintaCore.Actions.View.ToolBar.Toggled += HandlePintaCoreActionsViewToolbarToggled;
            PintaCore.Actions.View.Rulers.Toggled += HandlePintaCoreActionsViewRulersToggled;
            PintaCore.Actions.View.Pixels.Activated += HandlePixelsActivated;
            PintaCore.Actions.View.Inches.Activated += HandleInchesActivated;
            PintaCore.Actions.View.Centimeters.Activated += HandleCentimetersActivated;

            PintaCore.Actions.Window.CloseAll.Activated += HandleCloseAllActivated;
            PintaCore.Actions.Window.SaveAll.Activated += HandleSaveAllActivated;

            PintaCore.Actions.File.SaveDocument += Workspace_SaveDocument;

            InitializeFileActions ();
        }
예제 #6
0
파일: Main.cs 프로젝트: linuxmhall/Pinta
        public static void Main(string[] args)
        {
            string app_dir = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
            string locale_dir;
            bool devel_mode = File.Exists (Path.Combine (Path.Combine (app_dir, ".."), "Pinta.sln"));

            if (Platform.GetOS () != Platform.OS.X11 || devel_mode)
                locale_dir = Path.Combine (app_dir, "locale");
            else {
                // From MonoDevelop:
                // Pinta is located at $prefix/lib/pinta
                // adding "../.." should give us $prefix
                string prefix = Path.Combine (Path.Combine (app_dir, ".."), "..");
                //normalise it
                prefix = Path.GetFullPath (prefix);
                //catalog is installed to "$prefix/share/locale" by default
                locale_dir = Path.Combine (Path.Combine (prefix, "share"), "locale");
            }

            try {
                Catalog.Init ("pinta", locale_dir);
            } catch (Exception ex) {
                Console.WriteLine (ex);
            }

            int threads = -1;

            var p = new OptionSet () {
                { "rt|render-threads=", Catalog.GetString ("number of threads to use for rendering"), (int v) => threads = v }
            };

            List<string> extra;

            try {
                extra = p.Parse (args);
            } catch (OptionException e) {
                Console.Write ("Pinta: ");
                Console.WriteLine (e.Message);
                return;
            }

            GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler (ExceptionManager_UnhandledException);

            Application.Init ();
            MainWindow win = new MainWindow ();
            win.Show ();

            if (threads != -1)
                Pinta.Core.PintaCore.System.RenderThreads = threads;

            if (extra.Count > 0) {
                // Not sure what this does for Mac, so I'm not touching it
                if (Platform.GetOS () == Platform.OS.Mac) {
                    string arg = args[0];

                    if (args[0].StartsWith ("-psn_")) {
                        if (args.Length > 1)
                            arg = args[1];
                        else
                            arg = null;
                    }

                    if (!string.IsNullOrEmpty (arg)) {
                        Pinta.Core.PintaCore.Actions.File.OpenFile (arg);
                        PintaCore.Workspace.ActiveDocument.HasFile = true;
                    }
                } else {
                    Pinta.Core.PintaCore.Actions.File.OpenFile (extra[0]);
                    PintaCore.Workspace.ActiveDocument.HasFile = true;
                }
            } else {
                // Create a blank document
                PintaCore.Actions.File.NewFile (new Gdk.Size (800, 600));
            }

            Application.Run ();
        }
예제 #7
0
파일: Main.cs 프로젝트: JoeyScarr/Pinta
        public static void Main(string[] args)
        {
            string app_dir = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
            string locale_dir;
            bool devel_mode = File.Exists (Path.Combine (Path.Combine (app_dir, ".."), "Pinta.sln"));

            if (SystemManager.GetOperatingSystem () != OS.X11 || devel_mode)
                locale_dir = Path.Combine (app_dir, "locale");
            else {
                // From MonoDevelop:
                // Pinta is located at $prefix/lib/pinta
                // adding "../.." should give us $prefix
                string prefix = Path.Combine (Path.Combine (app_dir, ".."), "..");
                //normalise it
                prefix = Path.GetFullPath (prefix);
                //catalog is installed to "$prefix/share/locale" by default
                locale_dir = Path.Combine (Path.Combine (prefix, "share"), "locale");
            }

            try {
                Catalog.Init ("pinta", locale_dir);
            } catch (Exception ex) {
                Console.WriteLine (ex);
            }

            int threads = -1;
            int sid = -1;
            int block = -1;

            var p = new OptionSet () {
                { "rt|render-threads=", Catalog.GetString ("number of threads to use for rendering"), (int v) => threads = v },
                { "sid|subject-id=", "id of study subject", (int v) => sid = v },
                { "blk|block=", "id of current block", (int v) => block = v }
            };

            List<string> extra;

            try {
                extra = p.Parse (args);
            } catch (OptionException e) {
                Console.Write ("Pinta: ");
                Console.WriteLine (e.Message);
                return;
            }

            // Set up logging.
            Logger.Initialize(sid, block);

            GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler (ExceptionManager_UnhandledException);

            Application.Init ();
            MainWindow win = new MainWindow ();
            //win.Show ();

            if (threads != -1)
                Pinta.Core.PintaCore.System.RenderThreads = threads;

            if (SystemManager.GetOperatingSystem () == OS.Mac) {
                RegisterForAppleEvents ();
            }

            OpenFilesFromCommandLine (extra);

            Application.Run ();
        }